From 4f0840ab88037fb0241a745f7e4b0f8969709ef3 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 27 Jul 2019 15:09:30 +0200 Subject: [PATCH 001/965] Update dev dependencies and fix linting errors (#10228) * chore: Uppate dev dependencies * chore: Fix lint errors * chore: Format options.json files * chore: Fix stupid flow errors * Update test262 whitelist Seems test262-stream was updated and now these tests work. --- package.json | 8 +- packages/babel-cli/test/index.js | 2 +- .../babel-core/src/config/config-chain.js | 26 +- .../config/validation/option-assertions.js | 4 +- .../src/transformation/file/generate.js | 2 +- .../src/transformation/file/merge-map.js | 2 +- .../babel-core/src/transformation/index.js | 2 +- .../options.json | 2 +- .../loose-false/options.json | 4 +- .../loose-true/options.json | 4 +- packages/babel-helper-fixtures/src/index.js | 4 +- packages/babel-node/test/index.js | 2 +- .../babel-parser/src/parser/expression.js | 4 +- .../src/plugins/typescript/index.js | 5 +- .../object/invalid-escape-get/options.json | 2 +- .../dupl-bind-2nd-lvl-lex-nested/options.json | 2 +- .../scope/dupl-bind-2nd-lvl-lex/options.json | 2 +- .../dupl-bind-2nd-lvl-var-nested/options.json | 2 +- .../scope/dupl-bind-2nd-lvl-var/options.json | 2 +- .../dupl-bind-catch-arr-destr/options.json | 2 +- .../dupl-bind-catch-dbl-let/options.json | 2 +- .../scope/dupl-bind-catch-func/options.json | 2 +- .../dupl-bind-catch-obj-destr/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../scope/dupl-bind-class-const/options.json | 2 +- .../scope/dupl-bind-class-func/options.json | 2 +- .../scope/dupl-bind-class-let/options.json | 2 +- .../scope/dupl-bind-class-var/options.json | 2 +- .../scope/dupl-bind-func-gen/options.json | 2 +- .../scope/dupl-bind-func-module/options.json | 2 +- .../dupl-bind-func-var-sloppy/options.json | 2 +- .../scope/dupl-bind-gen-func/options.json | 2 +- .../core/scope/dupl-bind-let-let/options.json | 2 +- .../dupl-bind-nested-let-var/options.json | 2 +- .../fixtures/core/scope/for-var/options.json | 2 +- .../core/uncategorised/468/options.json | 2 +- .../core/uncategorised/469/options.json | 2 +- .../core/uncategorised/470/options.json | 2 +- .../core/uncategorised/471/options.json | 2 +- .../core/uncategorised/472/options.json | 2 +- .../core/uncategorised/473/options.json | 2 +- .../core/uncategorised/474/options.json | 2 +- .../core/uncategorised/475/options.json | 2 +- .../core/uncategorised/476/options.json | 2 +- .../core/uncategorised/477/options.json | 2 +- .../core/uncategorised/478/options.json | 2 +- .../core/uncategorised/479/options.json | 2 +- .../core/uncategorised/480/options.json | 2 +- .../core/uncategorised/481/options.json | 2 +- .../core/uncategorised/482/options.json | 2 +- .../core/uncategorised/483/options.json | 2 +- .../core/uncategorised/484/options.json | 2 +- .../core/uncategorised/485/options.json | 2 +- .../core/uncategorised/486/options.json | 2 +- .../core/uncategorised/487/options.json | 2 +- .../core/uncategorised/488/options.json | 2 +- .../core/uncategorised/489/options.json | 2 +- .../core/uncategorised/490/options.json | 2 +- .../core/uncategorised/491/options.json | 2 +- .../core/uncategorised/492/options.json | 2 +- .../core/uncategorised/493/options.json | 2 +- .../core/uncategorised/494/options.json | 2 +- .../core/uncategorised/495/options.json | 2 +- .../core/uncategorised/496/options.json | 2 +- .../core/uncategorised/497/options.json | 2 +- .../core/uncategorised/498/options.json | 2 +- .../core/uncategorised/511/options.json | 2 +- .../core/uncategorised/512/options.json | 2 +- .../core/uncategorised/515/options.json | 2 +- .../core/uncategorised/516/options.json | 2 +- .../core/uncategorised/520/options.json | 2 +- .../core/uncategorised/521/options.json | 2 +- .../options.json | 2 +- .../class/invalid-escape-get/options.json | 2 +- .../class/invalid-escape-set/options.json | 2 +- .../class/invalid-escape-static/options.json | 2 +- .../for-in/bare-initializer/options.json | 2 +- .../for-in/const-initializer/options.json | 2 +- .../for-in/let-initializer/options.json | 2 +- .../for-in/strict-initializer/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../for-of/bare-initializer/options.json | 2 +- .../for-of/invalid-escape-of/options.json | 2 +- .../es2015/for-of/invalid-expr/options.json | 2 +- .../invalid-escape-yield/options.json | 2 +- .../es2015/let/invalid-escape/options.json | 2 +- .../let-at-binding-list-fail-1/options.json | 2 +- .../let-at-binding-list-fail-2/options.json | 2 +- .../let-at-binding-list-fail-3/options.json | 2 +- .../let-at-binding-list-fail-4/options.json | 2 +- .../let-at-binding-list-fail-5/options.json | 2 +- .../let-at-binding-list-fail-6/options.json | 2 +- .../invalid-arrow-function/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../invalid-escape-export-as/options.json | 2 +- .../invalid-escape-import-from/options.json | 2 +- .../async-method-linebreak/options.json | 2 +- .../options.json | 2 +- .../es2015/uncategorised/109/options.json | 2 +- .../es2015/uncategorised/123/options.json | 2 +- .../es2015/uncategorised/166/options.json | 2 +- .../es2015/uncategorised/227/options.json | 2 +- .../es2015/uncategorised/233/options.json | 2 +- .../es2015/uncategorised/234/options.json | 2 +- .../es2015/uncategorised/235/options.json | 2 +- .../es2015/uncategorised/236/options.json | 2 +- .../es2015/uncategorised/242/options.json | 2 +- .../es2015/uncategorised/243/options.json | 2 +- .../es2015/uncategorised/244/options.json | 2 +- .../es2015/uncategorised/245/options.json | 2 +- .../es2015/uncategorised/246/options.json | 2 +- .../es2015/uncategorised/247/options.json | 2 +- .../es2015/uncategorised/289/options.json | 2 +- .../es2015/uncategorised/296/options.json | 2 +- .../es2015/uncategorised/297/options.json | 2 +- .../es2015/uncategorised/332/options.json | 2 +- .../es2015/uncategorised/334/options.json | 2 +- .../es2015/uncategorised/368/options.json | 2 +- .../es2015/uncategorised/369/options.json | 2 +- .../es2015/uncategorised/370/options.json | 2 +- .../es2015/uncategorised/371/options.json | 2 +- .../es2015/uncategorised/372/options.json | 2 +- .../es2015/uncategorised/373/options.json | 2 +- .../es2015/uncategorised/374/options.json | 2 +- .../es2015/uncategorised/375/options.json | 2 +- .../es2015/uncategorised/376/options.json | 2 +- .../es2015/uncategorised/377/options.json | 2 +- .../es2015/uncategorised/378/options.json | 2 +- .../es2015/uncategorised/379/options.json | 2 +- .../function-name-strict-body/options.json | 2 +- .../parameter-name-strict-body/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../invalid-escape-await/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../invalid-newline-after-params/options.json | 2 +- .../invalid-parens-async-arrow/options.json | 2 +- .../invalid-parens-async-func/options.json | 2 +- .../for-await-no-in/options.json | 2 +- .../invalid-param-strict-mode/options.json | 2 +- .../invalid-export-default-token/options.json | 2 +- .../invalid-export-named-default/options.json | 2 +- .../invalid-const-init/options.json | 2 +- .../invalid-let-init/options.json | 2 +- .../invalid-var-init/options.json | 2 +- .../invalid_const_forin/options.json | 2 +- .../invalid_let_forin/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../invalid-syntax/migrated_0087/options.json | 2 +- .../invalid-syntax/migrated_0088/options.json | 2 +- .../invalid-syntax/migrated_0089/options.json | 2 +- .../invalid-syntax/migrated_0090/options.json | 2 +- .../invalid-syntax/migrated_0091/options.json | 2 +- .../invalid-syntax/migrated_0100/options.json | 2 +- .../invalid-syntax/migrated_0101/options.json | 2 +- .../invalid-syntax/migrated_0185/options.json | 2 +- .../invalid-syntax/migrated_0186/options.json | 2 +- .../invalid-syntax/migrated_0187/options.json | 2 +- .../invalid-syntax/migrated_0188/options.json | 2 +- .../invalid-syntax/migrated_0189/options.json | 2 +- .../invalid-syntax/migrated_0190/options.json | 2 +- .../invalid-syntax/migrated_0191/options.json | 2 +- .../invalid-syntax/migrated_0192/options.json | 2 +- .../invalid-syntax/migrated_0193/options.json | 2 +- .../invalid-syntax/migrated_0194/options.json | 2 +- .../invalid-syntax/migrated_0195/options.json | 2 +- .../invalid-syntax/migrated_0196/options.json | 2 +- .../invalid-syntax/migrated_0197/options.json | 2 +- .../invalid-syntax/migrated_0198/options.json | 2 +- .../invalid-syntax/migrated_0199/options.json | 2 +- .../invalid-syntax/migrated_0200/options.json | 2 +- .../invalid-syntax/migrated_0201/options.json | 2 +- .../invalid-syntax/migrated_0202/options.json | 2 +- .../invalid-syntax/migrated_0203/options.json | 2 +- .../invalid-syntax/migrated_0204/options.json | 2 +- .../invalid-syntax/migrated_0205/options.json | 2 +- .../invalid-syntax/migrated_0206/options.json | 2 +- .../invalid-syntax/migrated_0207/options.json | 2 +- .../invalid-syntax/migrated_0208/options.json | 2 +- .../invalid-syntax/migrated_0209/options.json | 2 +- .../invalid-syntax/migrated_0210/options.json | 2 +- .../invalid-syntax/migrated_0211/options.json | 2 +- .../invalid-syntax/migrated_0212/options.json | 2 +- .../invalid-syntax/migrated_0213/options.json | 2 +- .../invalid-syntax/migrated_0214/options.json | 2 +- .../invalid-syntax/migrated_0215/options.json | 2 +- .../invalid-syntax/migrated_0233/options.json | 2 +- .../invalid-syntax/migrated_0234/options.json | 2 +- .../invalid-syntax/migrated_0235/options.json | 2 +- .../invalid-syntax/migrated_0236/options.json | 2 +- .../invalid-syntax/migrated_0241/options.json | 2 +- .../invalid-syntax/migrated_0242/options.json | 2 +- .../invalid-syntax/migrated_0246/options.json | 2 +- .../invalid-syntax/migrated_0247/options.json | 2 +- .../options.json | 2 +- .../default-invalid-declare-func/options.json | 2 +- .../default-invalid-var-type/options.json | 2 +- .../export/default-default-from/options.json | 6 +- .../export/default-named-from-2/options.json | 6 +- .../export/default-named-from-3/options.json | 6 +- .../export/default-named-from/options.json | 6 +- .../export/star-from-2/options.json | 6 +- .../export/star-from-3/options.json | 6 +- .../const/reserved-word/options.json | 2 +- .../types/literal-string-2/options.json | 6 +- .../typescript/types/read-only-2/options.json | 6 +- .../typescript/types/read-only-3/options.json | 6 +- .../typescript/types/read-only-4/options.json | 6 +- .../do-expressions/await/options.json | 2 +- .../test/fixtures/fsharp/await/options.json | 4 +- .../test/fixtures/fsharp/options.json | 4 +- .../test/fixtures/smart/await/options.json | 4 +- .../test/fixtures/smart/options.json | 4 +- .../fixtures/class-properties/options.json | 6 +- .../src/index.js | 12 +- .../built-in-globals-proposals/options.json | 4 +- .../options.json | 4 +- .../options.json | 4 +- .../src/polyfills/regenerator/entry-plugin.js | 4 +- .../src/polyfills/regenerator/usage-plugin.js | 4 +- packages/babel-standalone/src/index.js | 8 +- packages/babel-template/src/options.js | 2 +- packages/babel-template/src/populate.js | 4 +- packages/babel-traverse/src/index.js | 4 +- .../babel-types/scripts/generators/flow.js | 4 +- .../scripts/generators/generateAsserts.js | 3 +- .../scripts/generators/typescript.js | 4 +- .../babel-types/src/asserts/assertNode.js | 2 +- .../src/asserts/generated/index.js | 2 +- packages/babel-types/src/builders/builder.js | 4 +- scripts/tests/test262/test262_whitelist.txt | 17 - yarn.lock | 3956 +++++++++++------ 242 files changed, 2866 insertions(+), 1719 deletions(-) diff --git a/package.json b/package.json index bd04e0638455..a329e7667326 100644 --- a/package.json +++ b/package.json @@ -32,13 +32,13 @@ "derequire": "^2.0.2", "duplicate-package-checker-webpack-plugin": "^2.1.0", "enhanced-resolve": "^3.0.0", - "eslint": "^5.16.0", + "eslint": "^6.0.1", "eslint-config-babel": "^9.0.0", "eslint-plugin-flowtype": "^3.8.2", "eslint-plugin-import": "^2.17.2", "eslint-plugin-prettier": "^3.1.0", "fancy-log": "^1.3.3", - "flow-bin": "^0.94.0", + "flow-bin": "^0.102.0", "graceful-fs": "^4.1.15", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", @@ -48,11 +48,11 @@ "gulp-rename": "^1.4.0", "gulp-uglify": "^3.0.2", "gulp-watch": "^5.0.1", - "husky": "^2.3.0", + "husky": "^3.0.0", "jest": "^24.8.0", "lerna": "^3.14.2", "lerna-changelog": "^0.5.0", - "lint-staged": "^8.1.7", + "lint-staged": "^9.2.0", "lodash": "^4.17.13", "merge-stream": "^1.0.1", "output-file-sync": "^2.0.0", diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 64f64273319c..2787b5832355 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -92,7 +92,7 @@ const assertTest = function(stdout, stderr, opts, cwd) { if ( // saveInFiles always creates an empty .babelrc, so lets exclude for now filename !== ".babelrc" && - !opts.inFiles.hasOwnProperty(filename) + !Object.prototype.hasOwnProperty.call(opts.inFiles, filename) ) { const expected = opts.outFiles[filename]; const actual = actualFiles[filename]; diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js index 3bbedcdff1a9..cb0fd1e1a4ac 100644 --- a/packages/babel-core/src/config/config-chain.js +++ b/packages/babel-core/src/config/config-chain.js @@ -268,13 +268,11 @@ function babelrcLoadEnabled( }); } -const validateConfigFile = makeWeakCache( - (file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("configfile", file.options), - }), -); +const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("configfile", file.options), +})); const validateBabelrcFile = makeWeakCache( (file: ConfigFile): ValidatedFile => ({ @@ -284,13 +282,11 @@ const validateBabelrcFile = makeWeakCache( }), ); -const validateExtendFile = makeWeakCache( - (file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("extendsfile", file.options), - }), -); +const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("extendsfile", file.options), +})); /** * Build a config chain for just the programmatic options passed into Babel. @@ -549,7 +545,7 @@ function normalizeOptions(opts: ValidatedOptions): ValidatedOptions { // "sourceMap" is just aliased to sourceMap, so copy it over as // we merge the options together. - if (options.hasOwnProperty("sourceMap")) { + if (Object.prototype.hasOwnProperty.call(options, "sourceMap")) { options.sourceMaps = options.sourceMap; delete options.sourceMap; } diff --git a/packages/babel-core/src/config/validation/option-assertions.js b/packages/babel-core/src/config/validation/option-assertions.js index 87244b4f16b3..a279a72781a0 100644 --- a/packages/babel-core/src/config/validation/option-assertions.js +++ b/packages/babel-core/src/config/validation/option-assertions.js @@ -278,7 +278,7 @@ export function assertConfigFileSearch( ) { throw new Error( `${msg(loc)} must be a undefined, a boolean, a string, ` + - `got ${JSON.stringify(value)}`, + `got ${JSON.stringify((value: any))}`, ); } @@ -302,7 +302,7 @@ export function assertBabelrcSearch( } else if (!checkValidTest(value)) { throw new Error( `${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` + - `or an array of those, got ${JSON.stringify(value)}`, + `or an array of those, got ${JSON.stringify((value: any))}`, ); } return (value: any); diff --git a/packages/babel-core/src/transformation/file/generate.js b/packages/babel-core/src/transformation/file/generate.js index e124c16fc4c6..9aff0188405c 100644 --- a/packages/babel-core/src/transformation/file/generate.js +++ b/packages/babel-core/src/transformation/file/generate.js @@ -1,7 +1,7 @@ // @flow import type { PluginPasses } from "../../config"; -import convertSourceMap, { type SourceMap } from "convert-source-map"; +import convertSourceMap, { typeof SourceMap } from "convert-source-map"; import generate from "@babel/generator"; import type File from "./file"; diff --git a/packages/babel-core/src/transformation/file/merge-map.js b/packages/babel-core/src/transformation/file/merge-map.js index ff2e65b042b8..911867d96890 100644 --- a/packages/babel-core/src/transformation/file/merge-map.js +++ b/packages/babel-core/src/transformation/file/merge-map.js @@ -1,6 +1,6 @@ // @flow -import type { SourceMap } from "convert-source-map"; +import typeof { SourceMap } from "convert-source-map"; import sourceMap from "source-map"; export default function mergeSourceMap( diff --git a/packages/babel-core/src/transformation/index.js b/packages/babel-core/src/transformation/index.js index a03c4db0cf2a..2412dd9e4981 100644 --- a/packages/babel-core/src/transformation/index.js +++ b/packages/babel-core/src/transformation/index.js @@ -1,6 +1,6 @@ // @flow import traverse from "@babel/traverse"; -import type { SourceMap } from "convert-source-map"; +import typeof { SourceMap } from "convert-source-map"; import type { ResolvedConfig, PluginPasses } from "../config"; diff --git a/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json index 7c49b91ec9b2..ffc84e30b554 100644 --- a/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json +++ b/packages/babel-generator/test/fixtures/comments/create-parenthesized-expressions/options.json @@ -1,3 +1,3 @@ { - "parserOpts": {"createParenthesizedExpressions": true} + "parserOpts": { "createParenthesizedExpressions": true } } diff --git a/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/options.json b/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/options.json index f85119d087cc..31c874fe9097 100644 --- a/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/options.json +++ b/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-false/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - ["proposal-private-methods", { "loose": false }] - ] + "plugins": [["proposal-private-methods", { "loose": false }]] } diff --git a/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/options.json b/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/options.json index e0ee1124a93a..0d20a8dcadc8 100644 --- a/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/options.json +++ b/packages/babel-helper-create-class-features-plugin/test/fixtures/plugin-proposal-private-methods/loose-true/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - ["proposal-private-methods", { "loose": true }] - ] + "plugins": [["proposal-private-methods", { "loose": true }]] } diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index 7fc0cf21a3c7..d187a118f8e6 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -169,9 +169,7 @@ export default function get(entryLoc): Array { if (minimumVersion == null) { throw new Error( - `'minNodeVersion' has invalid semver format: ${ - taskOpts.minNodeVersion - }`, + `'minNodeVersion' has invalid semver format: ${taskOpts.minNodeVersion}`, ); } diff --git a/packages/babel-node/test/index.js b/packages/babel-node/test/index.js index dfed556b75df..a603204aea07 100644 --- a/packages/babel-node/test/index.js +++ b/packages/babel-node/test/index.js @@ -77,7 +77,7 @@ const assertTest = function(stdout, stderr, opts) { const actualFiles = readDir(path.join(tmpLoc)); Object.keys(actualFiles).forEach(function(filename) { - if (!opts.inFiles.hasOwnProperty(filename)) { + if (!Object.prototype.hasOwnProperty.call(opts.inFiles, filename)) { const expected = opts.outFiles[filename]; const actual = actualFiles[filename]; diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9b48c7129e2f..ae60b1746ba7 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1137,9 +1137,7 @@ export default class ExpressionParser extends LValParser { if (node.property.name !== propertyName || containsEsc) { this.raise( node.property.start, - `The only valid meta property for ${meta.name} is ${ - meta.name - }.${propertyName}`, + `The only valid meta property for ${meta.name} is ${meta.name}.${propertyName}`, ); } diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index fb6e8363a333..078797d74bb0 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -369,9 +369,8 @@ export default (superClass: Class): Class => ) { throw this.unexpected( pattern.start, - `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${ - pattern.type - }`, + "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + + `instead got ${pattern.type}`, ); } return pattern; diff --git a/packages/babel-parser/test/fixtures/core/object/invalid-escape-get/options.json b/packages/babel-parser/test/fixtures/core/object/invalid-escape-get/options.json index 0cd822570731..99a2bc92f2c0 100644 --- a/packages/babel-parser/test/fixtures/core/object/invalid-escape-get/options.json +++ b/packages/babel-parser/test/fixtures/core/object/invalid-escape-get/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:12)" -} \ 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 index b09098cda9c8..b14806508f97 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (4:6)" -} \ 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 index 37dd7bff7207..6a0c16d56696 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:4)" -} \ 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 index b09098cda9c8..b14806508f97 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (4:6)" -} \ 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 index 37dd7bff7207..6a0c16d56696 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:4)" -} \ 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 index 70121ca46ead..2cbe06c40914 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:15)" -} \ 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 index 386e81ecdc4c..ac735b2ace22 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (1:35)" -} \ 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 index 62b0c73eb164..6f5b5641a148 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:11)" -} \ 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 index a00c2989e1b1..bf345ea77127 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:28)" -} \ 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 index ff69adb0860a..254a763e653e 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:6)" -} \ 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 index ff69adb0860a..254a763e653e 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:6)" -} \ 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 index c45b9bf38290..cdd0ac832c57 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:6)" -} \ 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 index 58aaf9d99d22..a3504d289fd7 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:9)" -} \ 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 index bf89e4692c99..c04a6f3e48eb 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:4)" -} \ 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 index bf89e4692c99..c04a6f3e48eb 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (2:4)" -} \ 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 index c083e3d4c063..1b6192a1bc04 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'f' has already been declared (1:28)" -} \ 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 23553cce3705..e253f0a85f47 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,4 @@ { "sourceType": "module", - "throws":"Identifier 'foo' has already been declared (2:9)" + "throws": "Identifier 'foo' has already been declared (2:9)" } 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 index ff69adb0860a..254a763e653e 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (3:6)" -} \ 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 index c083e3d4c063..1b6192a1bc04 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'f' has already been declared (1:28)" -} \ 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 index 714354e14501..8ca49120a98a 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'foo' has already been declared (1:9)" -} \ 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 index a0925d495610..3eaa378d43e7 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Identifier 'a' has already been declared (3:8)" -} \ 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 index 10e45adf4560..5f2332a9ed8f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/for-var/options.json +++ b/packages/babel-parser/test/fixtures/core/scope/for-var/options.json @@ -1,3 +1,3 @@ { "throws": "Identifier 'i' has already been declared (2:8)" -} \ 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 index b463f315f9eb..dfbf1f6d0d1c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:36)" -} \ 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 index 9e9f875dfbb5..b74dfcf59199 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:36)" -} \ 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 index b5fd79ff5ff1..e95a2d7f7535 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:47)" -} \ 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 index 15b7ac855374..14d96617b4b6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:47)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index 2783b68b3d58..0964911894d9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:34)" -} \ 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 index 2783b68b3d58..0964911894d9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:34)" -} \ 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 index fe2654496fc9..ba5ef9dd55cc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:34)" -} \ 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 index fe2654496fc9..ba5ef9dd55cc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:34)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index 6db4ae7bf008..439ffff53e89 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:41)" -} \ 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 index b02fb725c767..ad15b27f9b9a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:41)" -} \ 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 index a7490f9321d4..1eb91299eb1b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:9)" -} \ 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 index 80b8b2d85caa..c903c1205ce8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:9)" -} \ 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 index 706ba8380c70..884ab94e3403 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:42)" -} \ 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 index d0e461af3911..58a98e4ca953 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:42)" -} \ 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 index ee2e7d7c7745..aa44c4aafa4d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:10)" -} \ 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 index bb4b812bab32..59ccf8eb8209 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:10)" -} \ 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 index b5fd79ff5ff1..e95a2d7f7535 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:47)" -} \ 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 index ff90f09173c4..e29c7aee6091 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:10)" -} \ 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 index b8f97ca4fe56..43dc5662e1e5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:48)" -} \ 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 index 6db4ae7bf008..439ffff53e89 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:41)" -} \ 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 index e80a856d48a0..8b18a4ec3e5a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:49)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 5d2dc563b16e..212d35fcb5fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:15)" -} \ 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 index b8f97ca4fe56..43dc5662e1e5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:48)" -} \ 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 index ab7000409bab..8370ba5c765f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:48)" -} \ 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 index fff472344fd7..78c799ec6a49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'static' in strict mode (1:15)" -} \ 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 index d4d0a96bfb64..d4a2d92e5b45 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'static' in strict mode (1:9)" -} \ 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 index e227bd1a6b74..85fd3822f433 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:11)" -} \ 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 index 8e1f9af4ec47..604b5896c2c5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:11)" -} \ 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 index 3c24c608c88a..b60957f217a4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:12)" -} \ 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 index 96d524816cc9..62075401e782 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:12)" -} \ 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 index c7a2c3ba50a0..a848b7de671a 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Argument name clash (2:11)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-get/options.json b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-get/options.json index 1e730e170733..d5583f7bc5ba 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-get/options.json +++ b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-get/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:19)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-set/options.json b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-set/options.json index 1e730e170733..d5583f7bc5ba 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-set/options.json +++ b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-set/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:19)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-static/options.json b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-static/options.json index b23f881870cf..a015cd4108e6 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-static/options.json +++ b/packages/babel-parser/test/fixtures/es2015/class/invalid-escape-static/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:22)" -} \ 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 index f5710cd7a9c9..2a64fa7c20ad 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Invalid left-hand side in for-loop (2:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index 0048427255c0..1fa21b020d65 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (2:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index f5710cd7a9c9..2a64fa7c20ad 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Invalid left-hand side in for-loop (2:5)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/options.json b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/options.json index 6b9933a77108..8678455a0f9c 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/options.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-escape-of/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:7)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-expr/options.json b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-expr/options.json index e4ff6fef3cde..5eaf674e06e0 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/invalid-expr/options.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/invalid-expr/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \")\" (1:15)" -} \ No newline at end of file +} 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 index dcd45c9b9715..67305b830e87 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Can not use 'yield' as identifier inside a generator (1:16)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/options.json b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/options.json index 410ecd16fddf..e4ae9a99d01b 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/options.json +++ b/packages/babel-parser/test/fixtures/es2015/let/invalid-escape/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:9)" -} \ 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 index f57eb3dfe6c2..75f41b260f56 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" -} \ 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 index 365d76ddf46e..0a2459ae24fc 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)" -} \ 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 index d83275e4a85a..80b209cf3816 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)" -} \ 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 index 456948bdd272..ccbcbd4b6bbc 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)" -} \ 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 index 4ca932f989ae..6152a659dcca 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)" -} \ 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 index f57eb3dfe6c2..75f41b260f56 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" -} \ 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 index 4be1533d8e29..4931a93f395d 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "new.target can only be used in functions (2:2)" -} \ 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 index 4f4b2be4c186..09a27d63dba1 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "The only valid meta property for new is new.target (1:19)" -} \ 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 d3d3a199e6e0..ea1f7f46f967 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,4 @@ { "sourceType": "module", "throws": "`foo` has already been exported. Exported identifiers must be unique. (2:15)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-export-as/options.json b/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-export-as/options.json index 16c061d4dfd4..3e1bec330f62 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-export-as/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-export-as/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", "throws": "Unexpected token, expected \",\" (1:11)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-import-from/options.json b/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-import-from/options.json index 6dab969b1115..5fe96f9ef281 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-import-from/options.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/invalid-escape-import-from/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", "throws": "Unexpected token (1:9)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2015/object/async-method-linebreak/options.json b/packages/babel-parser/test/fixtures/es2015/object/async-method-linebreak/options.json index 978486d6a57c..cef3a955d6c4 100644 --- a/packages/babel-parser/test/fixtures/es2015/object/async-method-linebreak/options.json +++ b/packages/babel-parser/test/fixtures/es2015/object/async-method-linebreak/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (3:4)" -} \ 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 index c7a2c3ba50a0..a848b7de671a 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Argument name clash (2:11)" -} \ 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 index c145a86bc613..1fc5db8949ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/options.json @@ -1,3 +1,3 @@ { "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} \ 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 index fdf74cefe1b2..42317f2b92ee 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/options.json @@ -1,3 +1,3 @@ { "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)" -} \ 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 index 3481bedf3cc1..b25685c6eac5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/options.json @@ -1,3 +1,3 @@ { "throws": "Argument name clash (1:16)" -} \ 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 index 6c907b0a7009..3f171f03c70c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:44)" -} \ 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 index 178fa1e528b2..084570ac7584 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:20)" -} \ 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 index 4ca97da7ca86..bfa460f59bbd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:20)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/options.json @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index c145a86bc613..1fc5db8949ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/options.json @@ -1,3 +1,3 @@ { "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} \ 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 index 02a0eafbbbbe..92845f5f2081 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:15)" -} \ 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 index e4abe279ab29..ad54c428a2f9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:14)" -} \ 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 index c2a4aaec255e..bfa08eae293e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:14)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 5d2dc563b16e..212d35fcb5fe 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:15)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 8ed5553896c1..a8f0b3c33031 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:5)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 224716db8070..cc2bef2a9a34 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/options.json @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:1)" -} \ 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 index 610884bb674c..5718d0551359 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/options.json @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:18)" -} \ 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 e45ea16ee8a4..e31fbe3a64b9 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,4 @@ { "sourceType": "module", "throws": "Assigning to 'eval' in strict mode (1:4)" -} \ 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 bd449d1a1743..8e557dcc53af 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:0)" -} \ 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 a8c4888490b6..9ef8cae21e3e 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:0)" -} \ 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 eb23932ac559..55bc1ec84f4a 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:6)" -} \ 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 caa406928d15..e6801417951e 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:6)" -} \ 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 1b022077e7c6..3ef9cf1c71bb 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:8)" -} \ 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 dd3434fd06e4..91d0958e3d0b 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:8)" -} \ 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 e8900a801461..be1d10ebd92c 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:15)" -} \ 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 8169da7d9069..f3a107c75be7 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:15)" -} \ 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 24b609367ea8..de270bbb0542 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:9)" -} \ 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 51b7612a6eef..27f9ea278f30 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:9)" -} \ 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 eb23932ac559..55bc1ec84f4a 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,4 @@ { "sourceType": "script", "throws": "Unexpected reserved word 'enum' (1:6)" -} \ 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 caa406928d15..e6801417951e 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,4 @@ { "sourceType": "module", "throws": "Unexpected reserved word 'enum' (1:6)" -} \ 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 index 091e7958db52..e55b18eb4f07 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'yield' in strict mode (1:9)" -} \ 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 index cb8efaaa0aff..0329a317f084 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'yield' in strict mode (1:12)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-class-method/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-class-method/options.json index b81bee7fa2e4..3e7adc2e54dd 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-class-method/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-class-method/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:21)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-obj-method/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-obj-method/options.json index f0907a448458..4f0d43b57042 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-obj-method/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-obj-method/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:14)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-static-class-method/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-static-class-method/options.json index f55830c1c373..c7dd7266de69 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-static-class-method/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-async-static-class-method/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:28)" -} \ 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 ac6c5914cec6..9e964f0047f8 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)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-async-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-async-function/options.json index 9d60866b80c3..f2ecbd9741e7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-async-function/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-async-function/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \"{\" (1:7)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/options.json index b0e5516212f3..1e1812883385 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-export-dflt-async-function/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:26)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow-list/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow-list/options.json index 0cd822570731..99a2bc92f2c0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow-list/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow-list/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:12)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/options.json index f6eb197b1dd8..b98beb83593e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-arrow/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:11)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function-list/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function-list/options.json index 0cd822570731..99a2bc92f2c0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function-list/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function-list/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:12)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function/options.json index f6eb197b1dd8..b98beb83593e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-escape-sequence-function/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:11)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-newline-after-params/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-newline-after-params/options.json index 0361d7c7d2b2..7d847e99c88e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-newline-after-params/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-newline-after-params/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (2:0)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-arrow/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-arrow/options.json index f6eb197b1dd8..b98beb83593e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-arrow/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-arrow/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:11)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/options.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/options.json index c2fcdb08cf9f..cf30cd9156b7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/options.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-parens-async-func/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \";\" (1:8)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/for-await-no-in/options.json b/packages/babel-parser/test/fixtures/es2018/async-generators/for-await-no-in/options.json index f86bbd48e917..9660494a29ea 100644 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/for-await-no-in/options.json +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/for-await-no-in/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (2:6)" -} \ 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 index 2e6d7156cf57..8f5ca9d5da67 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:0)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json index b6ce2c43af87..8c1430963ecf 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-default-token/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", "throws": "Unexpected token, expected \";\" (1:17)" -} \ 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 e03d273fdcd5..9371e19769ce 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,4 @@ { "sourceType": "module", "throws": "Unexpected keyword 'default' (1:8)" -} \ 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 index c145a86bc613..1fc5db8949ff 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} \ 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 index c145a86bc613..1fc5db8949ff 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} \ 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 index c145a86bc613..1fc5db8949ff 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-of loop variable declaration may not have an initializer (1:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index dd3b73e5d533..68677faac9b9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "for-in loop variable declaration may not have an initializer (1:5)" -} \ 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 index 091e7958db52..e55b18eb4f07 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'yield' in strict mode (1:9)" -} \ 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 index 1c3817f8e018..8928b8977517 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'yield' in strict mode (1:10)" -} \ 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 index 02a0eafbbbbe..92845f5f2081 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:15)" -} \ 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 index e4abe279ab29..ad54c428a2f9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:14)" -} \ 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 index c2a4aaec255e..bfa08eae293e 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:14)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 5d2dc563b16e..212d35fcb5fe 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:15)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 224716db8070..cc2bef2a9a34 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:1)" -} \ 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 index b463f315f9eb..dfbf1f6d0d1c 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:36)" -} \ 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 index 9e9f875dfbb5..b74dfcf59199 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:36)" -} \ 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 index b5fd79ff5ff1..e95a2d7f7535 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:47)" -} \ 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 index 15b7ac855374..14d96617b4b6 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:47)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index 2783b68b3d58..0964911894d9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:34)" -} \ 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 index 2783b68b3d58..0964911894d9 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:34)" -} \ 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 index fe2654496fc9..ba5ef9dd55cc 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:34)" -} \ 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 index fe2654496fc9..ba5ef9dd55cc 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:34)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index 95f470aed511..6faa5d0476c3 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'eval' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index ef45890ab53f..2f502104f7d4 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Assigning to 'arguments' in strict mode (1:32)" -} \ 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 index 6db4ae7bf008..439ffff53e89 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:41)" -} \ 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 index b02fb725c767..ad15b27f9b9a 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:41)" -} \ 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 index a7490f9321d4..1eb91299eb1b 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:9)" -} \ 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 index 80b8b2d85caa..c903c1205ce8 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:9)" -} \ 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 index 706ba8380c70..884ab94e3403 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:42)" -} \ 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 index d0e461af3911..58a98e4ca953 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:42)" -} \ 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 index ee2e7d7c7745..aa44c4aafa4d 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:10)" -} \ 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 index bb4b812bab32..59ccf8eb8209 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:10)" -} \ 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 index b5fd79ff5ff1..e95a2d7f7535 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:47)" -} \ 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 index ff90f09173c4..e29c7aee6091 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:10)" -} \ 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 index b8f97ca4fe56..43dc5662e1e5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:48)" -} \ 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 index 6db4ae7bf008..439ffff53e89 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:41)" -} \ 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 index e80a856d48a0..8b18a4ec3e5a 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:49)" -} \ 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 index d93d5b2aa62e..794c4864d4e5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:15)" -} \ 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 index 5d2dc563b16e..212d35fcb5fe 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:15)" -} \ 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 index b8f97ca4fe56..43dc5662e1e5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:48)" -} \ 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 index ab7000409bab..8370ba5c765f 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:48)" -} \ 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 index fff472344fd7..78c799ec6a49 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'static' in strict mode (1:15)" -} \ 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 index d4d0a96bfb64..d4a2d92e5b45 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'static' in strict mode (1:9)" -} \ 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 index a7490f9321d4..1eb91299eb1b 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:9)" -} \ 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 index 80b8b2d85caa..c903c1205ce8 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'arguments' in strict mode (1:9)" -} \ 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 index e227bd1a6b74..85fd3822f433 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:11)" -} \ 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 index 8e1f9af4ec47..604b5896c2c5 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:11)" -} \ 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 index 3c24c608c88a..b60957f217a4 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'eval' in strict mode (1:12)" -} \ 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 index 96d524816cc9..62075401e782 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Binding 'package' in strict mode (1:12)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-class-extends/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-class-extends/options.json index 6f017e5a5919..81e7a97e3f7e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-class-extends/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-class-extends/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:20)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-declare-func/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-declare-func/options.json index 161afd296dc4..4d9531c1b174 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-declare-func/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-declare-func/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \":\" (1:35)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-var-type/options.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-var-type/options.json index fbfad415eebf..e3427614a192 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-var-type/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-invalid-var-type/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token, expected \",\" (1:15)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/placeholders/export/default-default-from/options.json b/packages/babel-parser/test/fixtures/placeholders/export/default-default-from/options.json index b3f883263b7b..c2396306e4fa 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/default-default-from/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/default-default-from/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-2/options.json b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-2/options.json index 404b94bc6cbe..9bc164c502b0 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-2/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-2/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-3/options.json b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-3/options.json index 404b94bc6cbe..9bc164c502b0 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-3/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from-3/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:16)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from/options.json b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from/options.json index b3f883263b7b..c2396306e4fa 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/default-named-from/options.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/default-named-from/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)" -} \ No newline at end of file +} 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 8c48e4fc0f20..ec7b8f83c3d7 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,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)" -} \ 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 8c48e4fc0f20..ec7b8f83c3d7 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,7 +1,5 @@ { - "plugins": [ - "placeholders" - ], + "plugins": ["placeholders"], "sourceType": "module", "throws": "This experimental syntax requires enabling the parser plugin: 'exportNamespaceFrom' (1:9)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/typescript/const/reserved-word/options.json b/packages/babel-parser/test/fixtures/typescript/const/reserved-word/options.json index 93db7641c75b..2a28555f76db 100644 --- a/packages/babel-parser/test/fixtures/typescript/const/reserved-word/options.json +++ b/packages/babel-parser/test/fixtures/typescript/const/reserved-word/options.json @@ -1,3 +1,3 @@ { "throws": "Unexpected token (1:9)" -} \ 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 index 3c001f6afda6..856a8477d1ca 100644 --- 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 @@ -1,7 +1,5 @@ { "sourceType": "module", - "plugins": [ - "typescript" - ], + "plugins": ["typescript"], "throws": "Template literal types cannot have any substitution (1:14)" -} \ 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 index cdb818eee9b2..0a91d0015278 100644 --- 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 @@ -1,7 +1,5 @@ { "sourceType": "module", - "plugins": [ - "typescript" - ], + "plugins": ["typescript"], "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} \ 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 index cdb818eee9b2..0a91d0015278 100644 --- 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 @@ -1,7 +1,5 @@ { "sourceType": "module", - "plugins": [ - "typescript" - ], + "plugins": ["typescript"], "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} \ 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 index cdb818eee9b2..0a91d0015278 100644 --- 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 @@ -1,7 +1,5 @@ { "sourceType": "module", - "plugins": [ - "typescript" - ], + "plugins": ["typescript"], "throws": "'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" -} \ No newline at end of file +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/await/options.json b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/await/options.json index 7edb6d2fc815..2454c2169cf8 100644 --- a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/await/options.json +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/await/options.json @@ -1,3 +1,3 @@ { "minNodeVersion": "8.0.0" -} \ No newline at end of file +} diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/await/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/await/options.json index c5a39e971027..970314ed16fe 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/await/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/await/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - ["proposal-pipeline-operator", { "proposal": "fsharp" }] - ], + "plugins": [["proposal-pipeline-operator", { "proposal": "fsharp" }]], "parserOpts": { "allowReturnOutsideFunction": true }, diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/options.json index 4e41244cc302..d94a839f79a3 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/fsharp/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - ["proposal-pipeline-operator", { "proposal": "fsharp" }] - ], + "plugins": [["proposal-pipeline-operator", { "proposal": "fsharp" }]], "parserOpts": { "allowReturnOutsideFunction": true } diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json index ef8ed8865bd4..df1848815387 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/await/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - ["proposal-pipeline-operator", { "proposal": "smart" }] - ], + "plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]], "parserOpts": { "allowReturnOutsideFunction": true }, diff --git a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json index c82020184d7b..d8c03ffdf701 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json +++ b/packages/babel-plugin-proposal-pipeline-operator/test/fixtures/smart/options.json @@ -1,7 +1,5 @@ { - "plugins": [ - ["proposal-pipeline-operator", { "proposal": "smart" }] - ], + "plugins": [["proposal-pipeline-operator", { "proposal": "smart" }]], "parserOpts": { "allowReturnOutsideFunction": true } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/class-properties/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/class-properties/options.json index cfb4f002f46a..4aaaa6971f9e 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/class-properties/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/class-properties/options.json @@ -1,6 +1,10 @@ { "parserOpts": { - "plugins": ["classProperties", "classPrivateProperties", "classPrivateMethods"] + "plugins": [ + "classProperties", + "classPrivateProperties", + "classPrivateMethods" + ] }, "plugins": ["transform-modules-commonjs"] } diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 3b7ff68e9c2f..7e227a6f20a8 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -314,9 +314,7 @@ export default declare((api, options, dirname) => { node.callee = t.memberExpression( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${ - InstanceProperties[propertyName].path - }`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, `${propertyName}InstanceProperty`, ), [context2], @@ -407,9 +405,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${ - InstanceProperties[propertyName].path - }`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, `${propertyName}InstanceProperty`, ), [object], @@ -421,9 +417,7 @@ export default declare((api, options, dirname) => { path.replaceWith( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${ - StaticProperties[objectName][propertyName].path - }`, + `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`, `${objectName}$${propertyName}`, ), ); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/options.json index 1e8ea7d11308..2b36aa6019b4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/options.json +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/options.json @@ -1,3 +1,5 @@ { - "plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]] + "plugins": [ + ["transform-runtime", { "corejs": { "version": 3, "proposals": true } }] + ] } diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/options.json index 1e8ea7d11308..2b36aa6019b4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/options.json +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/options.json @@ -1,3 +1,5 @@ { - "plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]] + "plugins": [ + ["transform-runtime", { "corejs": { "version": 3, "proposals": true } }] + ] } diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/options.json index 1e8ea7d11308..2b36aa6019b4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/options.json +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/options.json @@ -1,3 +1,5 @@ { - "plugins": [["transform-runtime", { "corejs": { "version": 3, "proposals": true } }]] + "plugins": [ + ["transform-runtime", { "corejs": { "version": 3, "proposals": true } }] + ] } diff --git a/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js b/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js index a7872ac5429f..ea0baffbf350 100644 --- a/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js +++ b/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js @@ -34,9 +34,7 @@ export default function() { post() { if (this.opts.debug && this.regeneratorImportExcluded) { console.log( - `\n[${ - this.file.opts.filename - }] Based on your targets, regenerator-runtime import excluded.`, + `\n[${this.file.opts.filename}] Based on your targets, regenerator-runtime import excluded.`, ); } }, diff --git a/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js b/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js index 36ac15502b18..2803e7be1231 100644 --- a/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js @@ -22,9 +22,7 @@ export default function() { post() { if (this.opts.debug && this.usesRegenerator) { console.log( - `\n[${ - this.file.opts.filename - }] Based on your code and targets, added regenerator-runtime.`, + `\n[${this.file.opts.filename}] Based on your code and targets, added regenerator-runtime.`, ); } }, diff --git a/packages/babel-standalone/src/index.js b/packages/babel-standalone/src/index.js index 1e7c83d30c6c..cdd68b31bf6b 100644 --- a/packages/babel-standalone/src/index.js +++ b/packages/babel-standalone/src/index.js @@ -40,7 +40,7 @@ const isArray = */ function loadBuiltin(builtinTable, name) { if (isArray(name) && typeof name[0] === "string") { - if (builtinTable.hasOwnProperty(name[0])) { + if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) { return [builtinTable[name[0]]].concat(name.slice(1)); } return; @@ -66,7 +66,7 @@ function processOptions(options) { if ( isArray(preset) && typeof preset[0] === "object" && - preset[0].hasOwnProperty("buildPreset") + Object.prototype.hasOwnProperty.call(preset[0], "buildPreset") ) { preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset }; } @@ -112,7 +112,7 @@ export const buildExternalHelpers = babelBuildExternalHelpers; * Registers a named plugin for use with Babel. */ export function registerPlugin(name: string, plugin: Object | Function): void { - if (availablePlugins.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(availablePlugins, name)) { console.warn( `A plugin named "${name}" is already registered, it will be overridden`, ); @@ -135,7 +135,7 @@ export function registerPlugins(newPlugins: { * Registers a named preset for use with Babel. */ export function registerPreset(name: string, preset: Object | Function): void { - if (availablePresets.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(availablePresets, name)) { console.warn( `A preset named "${name}" is already registered, it will be overridden`, ); diff --git a/packages/babel-template/src/options.js b/packages/babel-template/src/options.js index cb2639319e51..07230cf1cf0b 100644 --- a/packages/babel-template/src/options.js +++ b/packages/babel-template/src/options.js @@ -149,7 +149,7 @@ export function normalizeReplacements( return acc; }, {}); } else if (typeof replacements === "object" || replacements == null) { - return replacements || undefined; + return (replacements: any) || undefined; } throw new Error( diff --git a/packages/babel-template/src/populate.js b/packages/babel-template/src/populate.js index 93cf4f1b677e..3ac536f6d81c 100644 --- a/packages/babel-template/src/populate.js +++ b/packages/babel-template/src/populate.js @@ -45,9 +45,7 @@ export default function populatePlaceholders( (replacements && replacements[placeholder.name]) || null, ); } catch (e) { - e.message = `@babel/template placeholder "${placeholder.name}": ${ - e.message - }`; + e.message = `@babel/template placeholder "${placeholder.name}": ${e.message}`; throw e; } }); diff --git a/packages/babel-traverse/src/index.js b/packages/babel-traverse/src/index.js index 5b1ebfdc6ed2..fa0306e07cd0 100644 --- a/packages/babel-traverse/src/index.js +++ b/packages/babel-traverse/src/index.js @@ -25,9 +25,7 @@ export default function traverse( if (parent.type !== "Program" && parent.type !== "File") { throw new Error( "You must pass a scope and parentPath unless traversing a Program/File. " + - `Instead of that you tried to traverse a ${ - parent.type - } node without ` + + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.", ); } diff --git a/packages/babel-types/scripts/generators/flow.js b/packages/babel-types/scripts/generators/flow.js index daab2411d742..3afacc1dd1a6 100644 --- a/packages/babel-types/scripts/generators/flow.js +++ b/packages/babel-types/scripts/generators/flow.js @@ -103,9 +103,7 @@ for (const type in t.NODE_FIELDS) { } for (let i = 0; i < t.TYPES.length; i++) { - let decl = `declare function is${ - t.TYPES[i] - }(node: ?Object, opts?: ?Object): boolean`; + let decl = `declare function is${t.TYPES[i]}(node: ?Object, opts?: ?Object): boolean`; if (t.NODE_FIELDS[t.TYPES[i]]) { decl += ` %checks (node instanceof ${NODE_PREFIX}${t.TYPES[i]})`; diff --git a/packages/babel-types/scripts/generators/generateAsserts.js b/packages/babel-types/scripts/generators/generateAsserts.js index 150e8557c733..26bdb8dccbed 100644 --- a/packages/babel-types/scripts/generators/generateAsserts.js +++ b/packages/babel-types/scripts/generators/generateAsserts.js @@ -18,7 +18,8 @@ import is from "../../validators/is"; function assert(type: string, node: Object, opts?: Object): void { if (!is(type, node, opts)) { throw new Error( - \`Expected type "\${type}" with option \${JSON.stringify(opts)}, but instead got "\${node.type}".\`, + \`Expected type "\${type}" with option \${JSON.stringify((opts: any))}, \` + + \`but instead got "\${node.type}".\`, ); } }\n\n`; diff --git a/packages/babel-types/scripts/generators/typescript.js b/packages/babel-types/scripts/generators/typescript.js index b6019ec37324..78397d840ca0 100644 --- a/packages/babel-types/scripts/generators/typescript.js +++ b/packages/babel-types/scripts/generators/typescript.js @@ -104,9 +104,7 @@ for (const type in t.NODE_FIELDS) { } for (let i = 0; i < t.TYPES.length; i++) { - let decl = `export function is${ - t.TYPES[i] - }(node: object | null | undefined, opts?: object | null): `; + let decl = `export function is${t.TYPES[i]}(node: object | null | undefined, opts?: object | null): `; if (t.NODE_FIELDS[t.TYPES[i]]) { decl += `node is ${t.TYPES[i]};`; diff --git a/packages/babel-types/src/asserts/assertNode.js b/packages/babel-types/src/asserts/assertNode.js index 61891e54de40..0097871ebc94 100644 --- a/packages/babel-types/src/asserts/assertNode.js +++ b/packages/babel-types/src/asserts/assertNode.js @@ -4,6 +4,6 @@ import isNode from "../validators/isNode"; export default function assertNode(node?: Object): void { if (!isNode(node)) { const type = (node && node.type) || JSON.stringify(node); - throw new TypeError(`Not a valid node of type "${type}"`); + throw new TypeError(`Not a valid node of type "${(type: any)}"`); } } diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index 3a4e81d34700..c21db148f2c3 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -9,7 +9,7 @@ function assert(type: string, node: Object, opts?: Object): void { if (!is(type, node, opts)) { throw new Error( `Expected type "${type}" with option ${JSON.stringify( - opts, + (opts: any), )}, but instead got "${node.type}".`, ); } diff --git a/packages/babel-types/src/builders/builder.js b/packages/babel-types/src/builders/builder.js index e01cf9fd97d6..04b5df08b888 100644 --- a/packages/babel-types/src/builders/builder.js +++ b/packages/babel-types/src/builders/builder.js @@ -8,9 +8,7 @@ export default function builder(type: string, ...args: Array): Object { const countArgs = args.length; if (countArgs > keys.length) { throw new Error( - `${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${ - keys.length - }`, + `${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`, ); } diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index b832b67af6ab..0bbef1b44eb0 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -282,23 +282,6 @@ built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js( built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(strict mode) built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default) built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode) -language/comments/hashbang/escaped-bang-041.js(default) -language/comments/hashbang/escaped-bang-u0021.js(default) -language/comments/hashbang/escaped-bang-u21.js(default) -language/comments/hashbang/escaped-bang-x21.js(default) -language/comments/hashbang/escaped-hash-043.js(default) -language/comments/hashbang/escaped-hash-u0023.js(default) -language/comments/hashbang/escaped-hash-u23.js(default) -language/comments/hashbang/escaped-hash-x23.js(default) -language/comments/hashbang/escaped-hashbang.js(default) -language/comments/hashbang/multi-line-comment.js(default) -language/comments/hashbang/preceding-directive-prologue-sc.js(default) -language/comments/hashbang/preceding-directive-prologue.js(default) -language/comments/hashbang/preceding-empty-statement.js(default) -language/comments/hashbang/preceding-hashbang.js(default) -language/comments/hashbang/preceding-line-comment.js(default) -language/comments/hashbang/preceding-multi-line-comment.js(default) -language/comments/hashbang/preceding-whitespace.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default) diff --git a/yarn.lock b/yarn.lock index b9d237c25ec1..7800bbd77715 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@babel/cli@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.4.4.tgz#5454bb7112f29026a4069d8e6f0e1794e651966c" - integrity sha512-XGr5YjQSjgTa6OzQZY57FAJsdeVSAKR/u/KA5exWIz66IKtv/zXtHy+fIZcMry/EgYegwuHE7vzGnrFhjdIAsQ== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.5.0.tgz#f403c930692e28ecfa3bf02a9e7562b474f38271" + integrity sha512-qNH55fWbKrEsCwID+Qc/3JDPnsSGpIIiMDbppnR8Z6PxLAqMQCFNqBctkIkBrMH49Nx+qqVTrHRWUR+ho2k+qQ== dependencies: commander "^2.8.1" convert-source-map "^1.1.0" @@ -27,17 +27,17 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0", "@babel/core@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a" - integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA== + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" + integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" - "@babel/helpers" "^7.4.4" - "@babel/parser" "^7.4.5" + "@babel/generator" "^7.5.0" + "@babel/helpers" "^7.5.4" + "@babel/parser" "^7.5.0" "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.5" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" @@ -51,12 +51,12 @@ resolved "https://registry.yarnpkg.com/@babel/eslint-plugin-development/-/eslint-plugin-development-1.0.1.tgz#1f5206ae95795db09b65e7dbc2b158d66497a44c" integrity sha512-ioEhN8HgKr4Yx8ef+XryNpKN4FimSFceb0qVVxvoUzpFn3xyq17MlY5AquEqtXObE7Nu7WKq7QL9INzjCrugyw== -"@babel/generator@^7.0.0", "@babel/generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" - integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== +"@babel/generator@^7.4.0", "@babel/generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" + integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== dependencies: - "@babel/types" "^7.4.4" + "@babel/types" "^7.5.0" jsesc "^2.5.1" lodash "^4.17.11" source-map "^0.5.0" @@ -86,10 +86,10 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.4.4.tgz#fc3d690af6554cc9efc607364a82d48f58736dba" - integrity sha512-UbBHIa2qeAGgyiNR9RszVF7bUHEdgS4JAUNT8SiqrAN6YJVxlOxeLr5pBzb5kan302dejJ9nla4RyKcR1XT6XA== +"@babel/helper-create-class-features-plugin@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz#02edb97f512d44ba23b3227f1bf2ed43454edac5" + integrity sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-member-expression-to-functions" "^7.0.0" @@ -229,28 +229,28 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.2.0" -"@babel/helpers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" - integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== +"@babel/helpers@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" + integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== dependencies: "@babel/template" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" "@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" - integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" + integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" @@ -262,17 +262,25 @@ "@babel/plugin-syntax-async-generators" "^7.2.0" "@babel/plugin-proposal-class-properties@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.4.4.tgz#93a6486eed86d53452ab9bab35e368e9461198ce" - integrity sha512-WjKTI8g8d5w1Bc9zgwSz2nfrsNQsXcCf9J9cdCvrJV6RF56yztwm4TmJC0MgJ9tvwO9gUA/mcYe89bLdGfiXFg== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.0.tgz#5bc6a0537d286fcb4fd4e89975adbca334987007" + integrity sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.4" + "@babel/helper-create-class-features-plugin" "^7.5.0" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-proposal-dynamic-import@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" + integrity sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-proposal-export-namespace-from@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.2.0.tgz#308fd4d04ff257fc3e4be090550840eeabad5dd9" - integrity sha512-DZUxbHYxQ5fUFIkMEnh75ogEdBLPfL+mQUqrO2hNY2LGm+tqFnxE924+mhAcCOh/8za8AaZsWHbq6bBoS3TAzA== + version "7.5.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.5.2.tgz#ccd5ed05b06d700688ff1db01a9dd27155e0d2a0" + integrity sha512-TKUdOL07anjZEbR1iSxb5WFh810KyObdd29XLFLGo1IDsSuGrjH3ouWSbAxHNmrVKzr9X71UYl2dQ7oGGcRp0g== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-export-namespace-from" "^7.2.0" @@ -293,10 +301,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.4.4.tgz#1ef173fcf24b3e2df92a678f027673b55e7e3005" - integrity sha512-dMBG6cSPBbHeEBdFXeQ2QLc5gUpg4Vkaz8octD4aoW/ISO+jBOcsuxYL7bsb5WSu8RLP6boxrBIALEHgoHtO9g== +"@babel/plugin-proposal-object-rest-spread@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.4.tgz#250de35d867ce8260a31b1fdac6c4fc1baa99331" + integrity sha512-KCx0z3y7y8ipZUMAEEJOyNi11lMb/FOPUjjB113tfowgw0c16EGYos7worCKBcUAh2oG+OBnoUhsnTSoLpV9uA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -325,6 +333,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-dynamic-import@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" + integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-export-namespace-from@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" @@ -374,10 +389,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.4.4.tgz#a3f1d01f2f21cadab20b33a82133116f14fb5894" - integrity sha512-YiqW2Li8TXmzgbXw+STsSqPBPFnGviiaSp6CYOq55X8GQ2SGVLrXB6pNid8HkqkZAzOH6knbai3snhP7v0fNwA== +"@babel/plugin-transform-async-to-generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" + integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -419,10 +434,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.4.4.tgz#9d964717829cc9e4b601fc82a26a71a4d8faf20f" - integrity sha512-/aOx+nW0w8eHiEHm+BTERB2oJn5D127iye/SUQl7NjHy0lf+j7h4MKMMSOwdazGq9OxgiNADncE+SRJkCxjZpQ== +"@babel/plugin-transform-destructuring@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" + integrity sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -435,10 +450,10 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" -"@babel/plugin-transform-duplicate-keys@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.2.0.tgz#d952c4930f312a4dbfff18f0b2914e60c35530b3" - integrity sha512-q+yuxW4DsTjNceUiTzK0L+AfQ0zD9rWaTLiUqHA8p0gxx7lu1EylenfzjeIWNkPy6e/0VG/Wjw9uf9LueQwLOw== +"@babel/plugin-transform-duplicate-keys@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" + integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -487,30 +502,33 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.2.0.tgz#82a9bce45b95441f617a24011dc89d12da7f4ee6" - integrity sha512-mK2A8ucqz1qhrdqjS9VMIDfIvvT2thrEsIQzbaTdc5QFzhDjQv2CkJJ5f6BXIkgbmaoax3zBr2RyvV/8zeoUZw== +"@babel/plugin-transform-modules-amd@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" + integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.4.4.tgz#0bef4713d30f1d78c2e59b3d6db40e60192cac1e" - integrity sha512-4sfBOJt58sEo9a2BQXnZq+Q3ZTSAUXyK3E30o36BOGnJ+tvJ6YSxF0PG6kERvbeISgProodWuI9UVG3/FMY6iw== +"@babel/plugin-transform-modules-commonjs@^7.4.4", "@babel/plugin-transform-modules-commonjs@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" + integrity sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ== dependencies: "@babel/helper-module-transforms" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.4.4.tgz#dc83c5665b07d6c2a7b224c00ac63659ea36a405" - integrity sha512-MSiModfILQc3/oqnG7NrP1jHaSPryO6tA2kOMmAQApz5dayPxWiHqmq4sWH2xF5LcQK56LlbKByCd8Aah/OIkQ== +"@babel/plugin-transform-modules-systemjs@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" + integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== dependencies: "@babel/helper-hoist-variables" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" "@babel/plugin-transform-modules-umd@^7.2.0": version "7.2.0" @@ -573,9 +591,9 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-runtime@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.4.4.tgz#a50f5d16e9c3a4ac18a1a9f9803c107c380bce08" - integrity sha512-aMVojEjPszvau3NRg+TIH14ynZLvPewH4xhlCW1w6A3rkxTS1m4uwzRclYR9oS+rl/dr+kT+pzbfHuAWP/lc7Q== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.5.0.tgz#45242c2c9281158c5f06d25beebac63e498a284e" + integrity sha512-LmPIZOAgTLl+86gR9KjLXex6P/lRz1fWEjTz6V6QZMmKie51ja3tvzdwORqhHc4RWR8TcZ5pClpRWs0mlaA2ng== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -629,38 +647,40 @@ regexpu-core "^4.5.4" "@babel/preset-env@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.5.tgz#2fad7f62983d5af563b5f3139242755884998a58" - integrity sha512-f2yNVXM+FsR5V8UwcFeIHzHWgnhXg3NpRmy0ADvALpnhB0SLbCvrCRr4BLOUYbQNLS+Z0Yer46x9dJXpXewI7w== + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.4.tgz#64bc15041a3cbb0798930319917e70fcca57713d" + integrity sha512-hFnFnouyRNiH1rL8YkX1ANCNAUVC8Djwdqfev8i1415tnAG+7hlA5zhZ0Q/3Q5gkop4HioIPbCEWAalqcbxRoQ== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-async-generator-functions" "^7.2.0" + "@babel/plugin-proposal-dynamic-import" "^7.5.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.4.4" + "@babel/plugin-proposal-object-rest-spread" "^7.5.4" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@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-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.4.4" + "@babel/plugin-transform-async-to-generator" "^7.5.0" "@babel/plugin-transform-block-scoped-functions" "^7.2.0" "@babel/plugin-transform-block-scoping" "^7.4.4" "@babel/plugin-transform-classes" "^7.4.4" "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.4.4" + "@babel/plugin-transform-destructuring" "^7.5.0" "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/plugin-transform-duplicate-keys" "^7.2.0" + "@babel/plugin-transform-duplicate-keys" "^7.5.0" "@babel/plugin-transform-exponentiation-operator" "^7.2.0" "@babel/plugin-transform-for-of" "^7.4.4" "@babel/plugin-transform-function-name" "^7.4.4" "@babel/plugin-transform-literals" "^7.2.0" "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.2.0" - "@babel/plugin-transform-modules-commonjs" "^7.4.4" - "@babel/plugin-transform-modules-systemjs" "^7.4.4" + "@babel/plugin-transform-modules-amd" "^7.5.0" + "@babel/plugin-transform-modules-commonjs" "^7.5.0" + "@babel/plugin-transform-modules-systemjs" "^7.5.0" "@babel/plugin-transform-modules-umd" "^7.2.0" "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" "@babel/plugin-transform-new-target" "^7.4.4" @@ -675,7 +695,7 @@ "@babel/plugin-transform-template-literals" "^7.4.4" "@babel/plugin-transform-typeof-symbol" "^7.2.0" "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/types" "^7.5.0" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -702,14 +722,14 @@ pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12" - integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ== +"@babel/runtime@^7.4.5": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.4.tgz#cb7d1ad7c6d65676e66b47186577930465b5271b" + integrity sha512-Na84uwyImZZc3FKf4aUF1tysApzwf3p2yuFBIyBfbzT5glzKTdvYI4KVW4kcgjrzoGUjC7w3YyCHcJKaRxsr2Q== dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.4.4": +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== @@ -718,25 +738,25 @@ "@babel/parser" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" - integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" + integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.4.4" + "@babel/generator" "^7.5.0" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.4.5" - "@babel/types" "^7.4.4" + "@babel/parser" "^7.5.0" + "@babel/types" "^7.5.0" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.11" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" - integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" + integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== dependencies: esutils "^2.0.2" lodash "^4.17.11" @@ -751,22 +771,22 @@ minimist "^1.2.0" "@evocateur/libnpmaccess@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.0.tgz#e546ee4e4bedca54ed9303948ec54c985cec33e4" - integrity sha512-bfrqZ0v+Il5TJBsgF2oyepeJg34K2pBItapzP+UT1QMIGpUh/Zc1pQql4jrafamZTqP3ZvdJxaElat8B5K3ICA== + version "3.1.1" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.1.tgz#e998466d9398dbc8e429a9640bb668924bef203d" + integrity sha512-sGRA6pDmlhQaRXH44tLLa6SlDF+Ws1gdEa0aeFJwJfeN8nV2oUpMbpJiIHDF2OxZnSkjOiyg/OAbNEeGzwL1/g== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.1" + "@evocateur/npm-registry-fetch" "^3.9.2" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" npm-package-arg "^6.1.0" "@evocateur/libnpmpublish@^1.2.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.0.tgz#3e0d79fdc0a75f212adabb7c7e341b017effeac2" - integrity sha512-sezhX9FSnPIyrBBvxVocVJVO1uIWPczf6rOmUZSntCWfQMraO8pWTFlDJbroFqPbEqFFHf3eyw8NQ0Eb7OLd1g== + version "1.2.1" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.1.tgz#db6c69f3a0417c6477c4b9a273b2c4314bf82713" + integrity sha512-aQ1IyvOmwwXie2TTkSuXC8H1EJU7b3GUWgefW49vgTzENEhvt8OOcoFg8pp5vvEe6Ty7YOUarEL/Wz+T/GQYHA== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.1" + "@evocateur/npm-registry-fetch" "^3.9.2" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" @@ -776,49 +796,49 @@ semver "^5.5.1" ssri "^6.0.1" -"@evocateur/npm-registry-fetch@^3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-3.9.1.tgz#75b3917320e559f6c91e26af17e62b085ec457a2" - integrity sha512-6v1bHbcAypQ+te/1RGSNL4JkK6mcMtcZrUusqo5iKRtYSAig9UJXlOaCcBR+eLywt2DQMNpEwAj24jwWDX5G/w== +"@evocateur/npm-registry-fetch@^3.9.1", "@evocateur/npm-registry-fetch@^3.9.2": + version "3.9.2" + resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-3.9.2.tgz#4e23b8b6c812c34828520ce42b31fcdb927c77a3" + integrity sha512-lz4cWdC32z6iI05YT9y79YuJtp4IXUu9lAP5JA/Z/difUXJRLAKlemboY64ELa8BKDav/ktjeCKUUJL8jxNTig== dependencies: JSONStream "^1.3.4" bluebird "^3.5.1" figgy-pudding "^3.4.1" - lru-cache "^4.1.3" - make-fetch-happen "^4.0.1" + lru-cache "^5.1.1" + make-fetch-happen "^4.0.2" npm-package-arg "^6.1.0" safe-buffer "^5.1.2" "@evocateur/pacote@^9.6.0": - version "9.6.0" - resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.0.tgz#3f0d08fb81c572289a2dfa981e7f97b6dd83cef2" - integrity sha512-nKx8EPxXhzqNfePbqC6603z7Kkf6GBS2q+SNGtBS/bCgS5Q+p3OVR6MXKOkpvC3WHse98W2WLu8QaV9axtfxyw== + version "9.6.1" + resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.1.tgz#51770f22735ffd73224fe98dd9660c6f7b725b88" + integrity sha512-5G3LlCSmqELvR0b7uJOo8M4eYlmnA25Efft6s8kMeS6N0YZrDcqveRXr1B7BNAeFlXi80pHAA7kFJ1Hcy+427Q== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.1" - bluebird "^3.5.3" - cacache "^11.3.2" + "@evocateur/npm-registry-fetch" "^3.9.2" + bluebird "^3.5.5" + cacache "^11.3.3" figgy-pudding "^3.5.1" get-stream "^4.1.0" - glob "^7.1.3" + glob "^7.1.4" lru-cache "^5.1.1" - make-fetch-happen "^4.0.1" + make-fetch-happen "^4.0.2" minimatch "^3.0.4" minipass "^2.3.5" mississippi "^3.0.0" mkdirp "^0.5.1" - normalize-package-data "^2.4.0" + normalize-package-data "^2.5.0" npm-package-arg "^6.1.0" - npm-packlist "^1.1.12" + npm-packlist "^1.4.4" npm-pick-manifest "^2.2.3" osenv "^0.1.5" promise-inflight "^1.0.1" promise-retry "^1.1.1" protoduck "^5.0.1" - rimraf "^2.6.2" - safe-buffer "^5.1.2" - semver "^5.6.0" + rimraf "^2.6.3" + safe-buffer "^5.2.0" + semver "^5.7.0" ssri "^6.0.1" - tar "^4.4.8" + tar "^4.4.10" unique-filename "^1.1.1" which "^1.3.1" @@ -1646,6 +1666,7 @@ "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== dependencies: call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" @@ -1653,15 +1674,16 @@ "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@octokit/endpoint@^5.1.0": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.1.2.tgz#45fd879e33a25ee10fa4cffc4d098ee04135afe6" - integrity sha512-bBGGmcRFq1x0jrB29G/9KjYmO3cdHfk3476B2JOHRvLsNw1Pn3l+ZvbiqtcO9qAS4Ti+zFedLB84ziHZRZclQA== + version "5.2.2" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.2.2.tgz#8fbb2e99ae0d8e6b30099f73063801e64467e761" + integrity sha512-VhKxM4CQanIUZDffExqpdpgqu3heF51qbY1wazoNtvIKXAAVoFjqLq2BOhesXkTqxXMO1Ze1XbS8DkIjUxAB+g== dependencies: - deepmerge "3.2.0" + deepmerge "4.0.0" is-plain-object "^3.0.0" - universal-user-agent "^2.1.0" + universal-user-agent "^3.0.0" url-template "^2.0.8" "@octokit/plugin-enterprise-rest@^2.1.1": @@ -1669,26 +1691,36 @@ resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.2.tgz#c0e22067a043e19f96ff9c7832e2a3019f9be75c" integrity sha512-CTZr64jZYhGWNTDGlSJ2mvIlFsm9OEO3LqWn9I/gmoHI4jRBp4kpHoFYNemG4oA75zUAcmbuWblb7jjP877YZw== -"@octokit/request@3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-3.0.3.tgz#ace63b5ea196cc00ad27f3fbe5c13a9698681ec8" - integrity sha512-M7pUfsiaiiUMEP4/SMysTeWxyGrkoQg6FBPEtCBIFgeDnzHaPboTpUZGTh6u1GQXdrlzMfPVn/vQs98js1QtwQ== +"@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.0.4.tgz#15e1dc22123ba4a9a4391914d80ec1e5303a23be" + integrity sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig== + dependencies: + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.0.1.tgz#6705c9a883db0ac0f58cee717e806b6575d4a199" + integrity sha512-SHOk/APYpfrzV1RNf7Ux8SZi+vZXhMIB2dBr4TQR6ExMX8R4jcy/0gHw26HLe1dWV7Wxe9WzYyDSEC0XwnoCSQ== dependencies: "@octokit/endpoint" "^5.1.0" - deprecation "^1.0.1" + "@octokit/request-error" "^1.0.1" + deprecation "^2.0.0" is-plain-object "^3.0.0" node-fetch "^2.3.0" once "^1.4.0" - universal-user-agent "^2.0.1" + universal-user-agent "^3.0.0" "@octokit/rest@^16.16.0": - version "16.25.5" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.25.5.tgz#9268afad252f72a1e39553cf87e1aa0493e355de" - integrity sha512-xemNMkhjSBPnPR7gzGNDelRJvAOu1T9oVABUADyQ2gE9E788qgVOr/xnBPusVLlYfhX7FhGhvGiVrgho/D4pfw== + version "16.28.4" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.4.tgz#2f8ef08305033bc91256530d6a3c98eada700660" + integrity sha512-ZBsfD46t3VNkwealxm5zloVgQta8d8o4KYBR/hMAZ582IgjmSDKZdkjyv5w37IUCM3tcPZWKUT+kml9pEIC2GA== dependencies: - "@octokit/request" "3.0.3" + "@octokit/request" "^5.0.0" + "@octokit/request-error" "^1.0.2" atob-lite "^2.0.0" - before-after-hook "^1.4.0" + before-after-hook "^2.0.0" btoa-lite "^1.0.0" deprecation "^2.0.0" lodash.get "^4.4.2" @@ -1696,25 +1728,27 @@ lodash.uniq "^4.5.0" octokit-pagination-methods "^1.1.0" once "^1.4.0" - universal-user-agent "^2.0.0" + universal-user-agent "^3.0.0" url-template "^2.0.8" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== dependencies: any-observable "^0.3.0" "@types/acorn@^4.0.2": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/acorn/-/acorn-4.0.3.tgz#d1f3e738dde52536f9aad3d3380d14e448820afd" + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/acorn/-/acorn-4.0.5.tgz#e29fdf884695e77be4e99e67d748f5147255752d" + integrity sha512-603sPiZ4GVRHPvn6vNgEAvJewKsy+zwRWYS2MeIMemgoAtcjlw2G3lALxrb9OPA17J28bkB71R33yXlQbUatCA== dependencies: "@types/estree" "*" "@types/babel__core@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51" - integrity sha512-wJTeJRt7BToFx3USrCDs2BhEi4ijBInTQjOIukj6a/5tEkwpFMVZ+1ppgmE+Q/FQyc5P/VWUbx7I9NELrKruHA== + version "7.1.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" + integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1738,30 +1772,36 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.6" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" - integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + version "7.0.7" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" + integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== dependencies: "@babel/types" "^7.3.0" "@types/cheerio@^0.22.1": - version "0.22.7" - resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.7.tgz#4a92eafedfb2b9f4437d3a4410006d81114c66ce" + version "0.22.12" + resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.12.tgz#93c050401d4935a5376e8b352965f7458bed5340" + integrity sha512-aczowyAJNfrkBV+HS8DyAA87OnvkqGrrOmm5s7V6Jbgimzv/1ZoAy91cLJX8GQrUS60KufD7EIzA2LbK8HV4hg== + dependencies: + "@types/node" "*" "@types/debug@^0.0.29": version "0.0.29" resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.29.tgz#a1e514adfbd92f03a224ba54d693111dbf1f3754" + integrity sha1-oeUUrfvZLwOiJLpU1pMRHb8fN1Q= "@types/enhanced-resolve@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/enhanced-resolve/-/enhanced-resolve-3.0.4.tgz#d93cb91b0b14dbcba0f45948bed73db9456697c2" + version "3.0.6" + resolved "https://registry.yarnpkg.com/@types/enhanced-resolve/-/enhanced-resolve-3.0.6.tgz#a51eaa24f4458ed13fb42a7048c0b66f92e95a28" + integrity sha512-mAWc6JpDiA6GnPCF5023YSGMa/E7baMvLs+HtT9E6Z52lUds3pthf4APhVQpbmV6sZTrbASgBEDdh70eGWTJFw== dependencies: "@types/node" "*" - "@types/tapable" "*" + "@types/tapable" "^0" "@types/escape-string-regexp@^0.0.30": version "0.0.30" resolved "https://registry.yarnpkg.com/@types/escape-string-regexp/-/escape-string-regexp-0.0.30.tgz#8cfaf0b5d2e46943d6efd77d3f4d18bfa1c9f225" + integrity sha1-jPrwtdLkaUPW79d9P00Yv6HJ8iU= "@types/estree@*", "@types/estree@0.0.39": version "0.0.39" @@ -1771,6 +1811,21 @@ "@types/estree@0.0.35": version "0.0.35" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.35.tgz#8999974b34028686a8d61a719e61c138d3755107" + integrity sha1-iZmXSzQChoao1hpxnmHBONN1UQc= + +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": version "2.0.1" @@ -1793,17 +1848,24 @@ "@types/istanbul-lib-report" "*" "@types/lodash@^4.14.67": - version "4.14.104" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80" + version "4.14.136" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f" + integrity sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA== + +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.0.2": - version "12.0.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40" - integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA== +"@types/node@*", "@types/node@^12.6.2": + version "12.6.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.3.tgz#44d507c5634f85e7164707ca36bba21b5213d487" + integrity sha512-7TEYTQT1/6PP53NftXXabIZDaZfaoBdeBm8Md/i7zsWRoBe0YwOXguyK8vhHs8ehgB/w9U4K/6EWuTyp0W6nIA== "@types/node@^8.0.0": - version "8.9.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.4.tgz#dfd327582a06c114eb6e0441fa3d6fab35edad48" + version "8.10.50" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.50.tgz#f3d68482b1f54b5f4fba8daaac385db12bb6a706" + integrity sha512-+ZbcUwJdaBgOZpwXeT0v+gHC/jQbEfzoc9s4d0rN0JIKeQbuTrT+A2n1aQY6LpZjrLXJT7avVUqiCecCJeeZxA== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1820,117 +1882,143 @@ "@types/semver@^5.3.32": version "5.5.0" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" + integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== -"@types/tapable@*": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-0.2.4.tgz#8181a228da46185439300e600c5ae3b3b3982585" +"@types/tapable@^0": + version "0.2.5" + resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-0.2.5.tgz#2443fc12da514c81346b1a665675559cee21fa75" + integrity sha512-dEoVvo/I9QFomyhY+4Q6Qk+I+dhG59TYceZgC6Q0mCifVPErx6Y83PNTKGDS5e9h9Eti6q0S2mm16BU6iQK+3w== "@types/uglify-js@*": - version "2.6.30" - resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-2.6.30.tgz#257d2b6dd86673d60da476680fba90f2e30c6eef" + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082" + integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ== dependencies: source-map "^0.6.1" "@types/webpack@^3.0.0": - version "3.8.8" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.8.tgz#fd9483edf2d6935eaab52aa530b1f737c188cd9a" + version "3.8.18" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.18.tgz#dd57fbedf23a07653817365fefc4586e9c48f0bd" + integrity sha512-qRk84mxsmMImpDAS7WHwdVSUabNSvdYD9M15U7OXaEo+ZkMW6zmdwmZRWr8SF6ZAA93ppkh5lNky5TiCuqcfAA== dependencies: "@types/node" "*" - "@types/tapable" "*" + "@types/tapable" "^0" "@types/uglify-js" "*" source-map "^0.6.0" "@types/yargs@^12.0.2", "@types/yargs@^12.0.9": - version "12.0.9" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.9.tgz#693e76a52f61a2f1e7fb48c0eef167b95ea4ffd0" - integrity sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA== + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== JSONStream@^1.0.3, JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== dependencies: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.4.tgz#5faad9c2c07f60dd76770f71cf025b62a63cfd4e" +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== acorn-dynamic-import@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" + integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= dependencies: acorn "^4.0.3" acorn-dynamic-import@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" + integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== acorn-globals@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + version "4.3.2" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" + integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== dependencies: - acorn "^5.0.0" + acorn "^6.0.1" + acorn-walk "^6.0.1" acorn-jsx@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== -acorn-node@^1.2.0, acorn-node@^1.3.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.6.2.tgz#b7d7ceca6f22e6417af933a62cad4de01048d5d2" +acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.7.0.tgz#aac6a559d27af6176b076ab6fb13c5974c213e3b" + integrity sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw== dependencies: - acorn "^6.0.2" + acorn "^6.1.1" acorn-dynamic-import "^4.0.0" - acorn-walk "^6.1.0" + acorn-walk "^6.1.1" xtend "^4.0.1" -acorn-walk@^6.1.0: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" +acorn-walk@^6.0.1, acorn-walk@^6.1.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" + integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" + integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= -acorn@^5.0.0, acorn@^5.0.3, acorn@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298" +acorn@^5.0.0, acorn@^5.0.3, acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1, acorn@^6.0.7, acorn@^6.1.1, acorn@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" + integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== -acorn@^6.0.2, acorn@^6.0.7, acorn@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" - integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== +agent-base@4, agent-base@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" + integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== + dependencies: + es6-promisify "^5.0.0" -agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: +agent-base@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" + integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg== dependencies: es6-promisify "^5.0.0" agentkeepalive@^3.4.1: version "3.5.2" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-3.5.2.tgz#a113924dd3fa24a0bc3b78108c450c2abee00f67" + integrity sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ== dependencies: humanize-ms "^1.2.1" ajv-keywords@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" + version "3.4.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" + integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== -ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1: - version "6.9.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.9.2.tgz#4927adb83e7f48e5a32b45729744c71ec39c9c7b" - integrity sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg== +ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" @@ -1940,6 +2028,7 @@ ajv@^6.1.0, ajv@^6.5.5, ajv@^6.9.1: align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= dependencies: kind-of "^3.0.2" longest "^1.0.1" @@ -1948,16 +2037,19 @@ align-text@^0.1.1, align-text@^0.1.3: amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= ansi-colors@1.1.0, ansi-colors@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" + integrity sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA== dependencies: ansi-wrap "^0.1.0" ansi-cyan@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-cyan/-/ansi-cyan-0.1.1.tgz#538ae528af8982f28ae30d86f2f17456d2609873" + integrity sha1-U4rlKK+JgvKK4w2G8vF0VtJgmHM= dependencies: ansi-wrap "0.1.0" @@ -1969,48 +2061,58 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" + integrity sha1-KWLPVOyXksSFEKPetSRDaGHvclE= dependencies: ansi-wrap "0.1.0" ansi-red@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-red/-/ansi-red-0.1.1.tgz#8c638f9d1080800a353c9c28c8a81ca4705d946c" + integrity sha1-jGOPnRCAgAo1PJwoyKgcpHBdlGw= dependencies: ansi-wrap "0.1.0" ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-regex@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-wrap@0.1.0, ansi-wrap@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf" + integrity sha1-qCJQ3bABXponyoLoLqYDu/pF768= any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== dependencies: micromatch "^2.1.5" normalize-path "^2.0.0" @@ -2018,6 +2120,7 @@ anymatch@^1.3.0: anymatch@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== dependencies: micromatch "^3.1.4" normalize-path "^2.1.1" @@ -2025,24 +2128,29 @@ anymatch@^2.0.0: append-buffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/append-buffer/-/append-buffer-1.0.2.tgz#d8220cf466081525efea50614f3de6514dfa58f1" + integrity sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE= dependencies: buffer-equal "^1.0.0" aproba@^1.0.3, aproba@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== aproba@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" + integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA= are-we-there-yet@~1.1.2: - version "1.1.4" - resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== dependencies: delegates "^1.0.0" readable-stream "^2.0.6" @@ -2050,12 +2158,14 @@ are-we-there-yet@~1.1.2: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" arr-diff@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-1.1.0.tgz#687c32758163588fef7de7b36fabe495eb1a399a" + integrity sha1-aHwydYFjWI/vfeezb6vklesaOZo= dependencies: arr-flatten "^1.0.1" array-slice "^0.2.3" @@ -2063,60 +2173,73 @@ arr-diff@^1.0.1: arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= dependencies: arr-flatten "^1.0.1" arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-filter@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= dependencies: make-iterator "^1.0.0" arr-flatten@^1.0.1, arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-map@^2.0.0, arr-map@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= dependencies: make-iterator "^1.0.0" arr-union@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-2.1.0.tgz#20f9eab5ec70f5c7d215b1077b1c39161d292c7d" + integrity sha1-IPnqtexw9cfSFbEHexw5Fh0pLH0= arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= array-differ@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" + integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= array-each@^1.0.0, array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" + integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= array-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= array-filter@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" + integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E= array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" + integrity sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4= array-includes@^3.0.3: version "3.0.3" @@ -2129,6 +2252,7 @@ array-includes@^3.0.3: array-initial@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= dependencies: array-slice "^1.0.0" is-number "^4.0.0" @@ -2136,28 +2260,34 @@ array-initial@^1.0.0: array-last@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" + integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== dependencies: is-number "^4.0.0" array-map@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" + integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= array-reduce@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" + integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= array-slice@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" + integrity sha1-3Tz7gO15c6dRF82sabC5nshhhvU= array-slice@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.1.0.tgz#e368ea15f89bc7069f7ffb89aec3a6c7d4ac22d4" + integrity sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w== array-sort@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" + integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== dependencies: default-compare "^1.0.0" get-value "^2.0.6" @@ -2166,76 +2296,87 @@ array-sort@^1.0.0: array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= dependencies: array-uniq "^1.0.1" array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= asap@^2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" + integrity sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw== dependencies: bn.js "^4.0.0" inherits "^2.0.1" minimalistic-assert "^1.0.0" asn1@~0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" assert-plus@1.0.0, assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= assert@^1.1.1, assert@^1.4.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + version "1.5.0" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" + integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== dependencies: + object-assign "^4.1.1" util "0.10.3" assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" + integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - -astw@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" - dependencies: - acorn "^4.0.3" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== async-done@^1.2.0, async-done@^1.2.2: - version "1.2.4" - resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.2.4.tgz#17b0fcefb9a33cb9de63daa8904c0a65bd535fa0" + version "1.3.2" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.2.tgz#5e15aa729962a4b07414f528a88cdf18e0b290a2" + integrity sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw== dependencies: end-of-stream "^1.1.0" once "^1.3.2" - process-nextick-args "^1.0.7" + process-nextick-args "^2.0.0" stream-exhaust "^1.0.1" async-each@^1.0.1: @@ -2246,43 +2387,51 @@ async-each@^1.0.1: async-limiter@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== async-settle@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= dependencies: async-done "^1.2.2" -async@^2.1.2, async@^2.5.0: - version "2.6.1" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" +async@^2.1.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" + integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== dependencies: - lodash "^4.17.10" + lodash "^4.17.14" asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= atob-lite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/atob-lite/-/atob-lite-2.0.0.tgz#0fef5ad46f1bd7a8502c65727f0367d5ee43d696" integrity sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY= -atob@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d" +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== babel-eslint@^11.0.0-beta.0: version "11.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-11.0.0-beta.0.tgz#3645b9b84d848e070e0afadc95d0c8ff96f4c63a" + integrity sha512-GJTX0XL22be/A5sFp1/4qQIOnZJ/KJ8YrA0aW07SZoDXTMLB1KQT0rYl4a9Y5DfJGPuVDVf0bMYyvLLXmXPpHw== dependencies: eslint-scope "3.7.1" eslint-visitor-keys "^1.0.0" @@ -2311,13 +2460,21 @@ babel-loader@^8.0.6: mkdirp "^0.5.1" pify "^4.0.1" +babel-plugin-dynamic-import-node@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" + integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== + dependencies: + object.assign "^4.1.0" + babel-plugin-istanbul@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30" + version "5.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== dependencies: find-up "^3.0.0" - istanbul-lib-instrument "^3.0.0" - test-exclude "^5.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" babel-plugin-jest-hoist@^24.6.0: version "24.6.0" @@ -2329,6 +2486,7 @@ babel-plugin-jest-hoist@^24.6.0: babel-plugin-transform-charcodes@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-charcodes/-/babel-plugin-transform-charcodes-0.2.0.tgz#c17307cc852c979103ceafd97e1799ef10916941" + integrity sha512-owzuAMq9EIampG9G7DqeNDp/fl5i2FQ9RIgP1mTrYORByN0vZiVF9aHl4flDdAecxWtduxb0Peha/Fkd6t4n5A== dependencies: "@babel/parser" "^7.0.0" "@babel/traverse" "^7.0.0" @@ -2344,6 +2502,7 @@ babel-preset-jest@^24.6.0: bach@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= dependencies: arr-filter "^1.1.1" arr-flatten "^1.0.1" @@ -2358,14 +2517,17 @@ bach@^1.0.0: balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.0.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.3.tgz#fb13668233d9614cf5fb4bce95a9ba4096cdf801" + version "1.3.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" + integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -2376,39 +2538,46 @@ base@^0.11.1: pascalcase "^0.1.1" bcrypt-pbkdf@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz#63bc5dcb61331b92bc05fd528953c33462a06f8d" + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= dependencies: tweetnacl "^0.14.3" -before-after-hook@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-1.4.0.tgz#2b6bf23dca4f32e628fd2747c10a37c74a4b484d" - integrity sha512-l5r9ir56nda3qu14nAXIlyq1MmUSs0meCIaFAh8HwkFwP1F8eToOuS3ah2VAHHcY04jaYD7FpJC5JTXHYRbkzg== +before-after-hook@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" + integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -big.js@^3.1.3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.2.0.tgz#a5fc298b81b9e0dca2e458824784b65c52ba588e" +big.js@^5.2.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" + integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== binary-extensions@^1.0.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== -bluebird@^3.5.1, bluebird@^3.5.3: - version "3.5.3" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.3.tgz#7d01c6f9616c9a51ab0f8c549a79dfe6ec33efa7" +bluebird@^3.5.1, bluebird@^3.5.5: + version "3.5.5" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" + integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" + integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== boolbase@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -2416,6 +2585,7 @@ brace-expansion@^1.1.7: braces@^1.8.2: version "1.8.5" resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= dependencies: expand-range "^1.8.1" preserve "^0.2.0" @@ -2437,13 +2607,22 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= browser-pack@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-5.0.1.tgz#4197719b20c6e0aaa09451c5111e53efb6fbc18d" + integrity sha1-QZdxmyDG4KqglFHFER5T77b7wY0= dependencies: JSONStream "^1.0.3" combine-source-map "~0.6.1" @@ -2452,8 +2631,9 @@ browser-pack@^5.0.1: umd "^3.0.0" browser-pack@^6.0.1: - version "6.0.4" - resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.4.tgz#9a73beb3b48f9e36868be007b64400102c04a99f" + version "6.1.0" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.1.0.tgz#c34ba10d0b9ce162b5af227c7131c92c2ecd5774" + integrity sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA== dependencies: JSONStream "^1.0.3" combine-source-map "~0.8.0" @@ -2463,8 +2643,9 @@ browser-pack@^6.0.1: umd "^3.0.0" browser-process-hrtime@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.2.tgz#425d68a58d3447f02a04aa894187fce8af8b7b8e" + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== browser-resolve@^1.11.0, browser-resolve@^1.11.3, browser-resolve@^1.7.0: version "1.11.3" @@ -2474,17 +2655,18 @@ browser-resolve@^1.11.0, browser-resolve@^1.11.3, browser-resolve@^1.7.0: resolve "1.1.7" browser-unpack@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browser-unpack/-/browser-unpack-1.2.0.tgz#357aee31fc467831684d063e4355e070a782970d" + version "1.4.2" + resolved "https://registry.yarnpkg.com/browser-unpack/-/browser-unpack-1.4.2.tgz#7a708774dc7448df1c24a735d65d409708b95ce2" + integrity sha512-uHkiY4bmXjjBBWoKH1aRnEGTQxUUCCcVtoJfH9w1lmGGjETY4u93Zk+GRYkCE/SRMrdoMTINQ/1/manr/3aMVA== dependencies: - acorn "^4.0.3" - browser-pack "^5.0.1" + acorn-node "^1.5.2" concat-stream "^1.5.0" minimist "^1.1.1" browserify-aes@^1.0.0, browserify-aes@^1.0.4: - version "1.1.1" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" + version "1.2.0" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" cipher-base "^1.0.0" @@ -2494,24 +2676,28 @@ browserify-aes@^1.0.0, browserify-aes@^1.0.4: safe-buffer "^5.0.1" browserify-cipher@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + version "1.0.1" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.1.tgz#8d6474c1b870bfdabcd3bcfcc1934a10e94f15f0" + integrity sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w== dependencies: browserify-aes "^1.0.4" browserify-des "^1.0.0" evp_bytestokey "^1.0.0" browserify-des@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + version "1.0.2" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.2.tgz#3af4f1f59839403572f1c66204375f7a7f703e9c" + integrity sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A== dependencies: cipher-base "^1.0.1" des.js "^1.0.0" inherits "^2.0.1" + safe-buffer "^5.1.2" browserify-rsa@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + integrity sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ= dependencies: bn.js "^4.1.0" randombytes "^2.0.1" @@ -2519,6 +2705,7 @@ browserify-rsa@^4.0.0: browserify-sign@^4.0.0: version "4.0.4" resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" + integrity sha1-qk62jl17ZYuqa/alfmMMvXqT0pg= dependencies: bn.js "^4.1.1" browserify-rsa "^4.0.0" @@ -2531,12 +2718,14 @@ browserify-sign@^4.0.0: browserify-zlib@^0.2.0, browserify-zlib@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" + integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== dependencies: pako "~1.0.5" browserify@^16.2.3: - version "16.2.3" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.2.3.tgz#7ee6e654ba4f92bce6ab3599c3485b1cc7a0ad0b" + version "16.3.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.3.0.tgz#4d414466e0b07492fff493a009ea883a9f2db230" + integrity sha512-BWaaD7alyGZVEBBwSTYx4iJF5DswIGzK17o8ai9w4iKRbYpk3EOiprRHMRRA8DCZFmFeOdx7A385w2XdFvxWmg== dependencies: JSONStream "^1.0.3" assert "^1.4.0" @@ -2587,18 +2776,19 @@ browserify@^16.2.3: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.0.tgz#5274028c26f4d933d5b1323307c1d1da5084c9ff" - integrity sha512-Jk0YFwXBuMOOol8n6FhgkDzn3mY9PYLYGk29zybF05SbRTsMgPqmTNeQQhOghCxq5oFqAXE3u4sYddr4C0uRhg== +browserslist@^4.6.0, browserslist@^4.6.2: + version "4.6.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" + integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30000967" - electron-to-chromium "^1.3.133" - node-releases "^1.1.19" + caniuse-lite "^1.0.30000984" + electron-to-chromium "^1.3.191" + node-releases "^1.1.25" bser@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + version "2.1.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" + integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== dependencies: node-int64 "^0.4.0" @@ -2610,26 +2800,31 @@ btoa-lite@^1.0.0: buffer-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" + integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= buffer-from@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.0.tgz#87fcaa3a298358e0ade6e442cfce840740d1ad04" + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== buffer-xor@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^4.3.0: version "4.9.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" isarray "^1.0.0" buffer@^5.0.2: - version "5.2.0" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.0.tgz#53cf98241100099e9eeae20ee6d51d21b16e541e" + version "5.2.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" + integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -2642,14 +2837,17 @@ builtin-modules@^3.1.0: builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" + integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= builtins@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" + integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og= bundle-collapser@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/bundle-collapser/-/bundle-collapser-1.3.0.tgz#f4b4ff58b2f22ee7701b20fa76306e23f53a3fb6" + integrity sha1-9LT/WLLyLudwGyD6djBuI/U6P7Y= dependencies: browser-pack "^5.0.1" browser-unpack "^1.1.0" @@ -2661,27 +2859,29 @@ bundle-collapser@^1.2.1: byline@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" + integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= byte-size@^4.0.3: version "4.0.4" resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.4.tgz#29d381709f41aae0d89c631f1c81aec88cd40b23" + integrity sha512-82RPeneC6nqCdSwCX2hZUz3JPOvN5at/nTEw/CMf05Smu3Hrpo9Psb7LjN+k+XndNArG1EY8L4+BM3aTM4BCvw== -cacache@^11.0.1, cacache@^11.3.2: - version "11.3.2" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.2.tgz#2d81e308e3d258ca38125b676b98b2ac9ce69bfa" - integrity sha512-E0zP4EPGDOaT2chM08Als91eYnf8Z+eH1awwwVsngUmgppfM5jjJ8l3z5vO5p5w/I3LsiXawb1sW0VY65pQABg== +cacache@^11.3.3: + version "11.3.3" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" + integrity sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA== dependencies: - bluebird "^3.5.3" + bluebird "^3.5.5" chownr "^1.1.1" figgy-pudding "^3.5.1" - glob "^7.1.3" + glob "^7.1.4" graceful-fs "^4.1.15" lru-cache "^5.1.1" mississippi "^3.0.0" mkdirp "^0.5.1" move-concurrently "^1.0.1" promise-inflight "^1.0.1" - rimraf "^2.6.2" + rimraf "^2.6.3" ssri "^6.0.1" unique-filename "^1.1.1" y18n "^4.0.0" @@ -2689,6 +2889,7 @@ cacache@^11.0.1, cacache@^11.3.2: cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -2700,37 +2901,44 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -cached-path-relative@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" +cached-path-relative@^1.0.0, cached-path-relative@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.2.tgz#a13df4196d26776220cc3356eb147a52dba2c6db" + integrity sha512-5r2GqsoEb4qMTTN9J+WzXfjov+hjxT+j3u5K+kIVNIwAd99DLCJE9pBIMP1qVeybV6JiijL385Oz0DcYxfbOIg== call-me-maybe@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= dependencies: callsites "^2.0.0" caller-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= dependencies: caller-callsite "^2.0.0" callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= callsites@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= dependencies: no-case "^2.2.0" upper-case "^1.1.1" @@ -2738,6 +2946,7 @@ camel-case@3.0.x: camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + integrity sha1-MIvur/3ygRkFHvodkyITyRuPkuc= dependencies: camelcase "^2.0.0" map-obj "^1.0.0" @@ -2745,6 +2954,7 @@ camelcase-keys@^2.0.0: camelcase-keys@^4.0.0: version "4.2.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-4.2.0.tgz#a2aa5fb1af688758259c32c141426d78923b9b77" + integrity sha1-oqpfsa9oh1glnDLBQUJteJI7m3c= dependencies: camelcase "^4.1.0" map-obj "^2.0.0" @@ -2753,41 +2963,49 @@ camelcase-keys@^4.0.0: camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= camelcase@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" + integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= camelcase@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000967: - version "1.0.30000967" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000967.tgz#a5039577806fccee80a04aaafb2c0890b1ee2f73" - integrity sha512-rUBIbap+VJfxTzrM4akJ00lkvVb5/n5v3EGXfWzSH5zT8aJmGzjA8HWhJ4U6kCpzxozUSnB+yvAYDRPY6mRpgQ== +caniuse-lite@^1.0.30000984: + version "1.0.30000984" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz#dc96c3c469e9bcfc6ad5bdd24c77ec918ea76fe0" + integrity sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA== -capture-exit@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-1.2.0.tgz#1c5fcc489fd0ab00d4f1ac7ae1072e3173fbab6f" +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== dependencies: - rsvp "^3.3.3" + rsvp "^4.8.4" caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= center-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= dependencies: align-text "^0.1.3" lazy-cache "^1.0.3" @@ -2795,6 +3013,7 @@ center-align@^0.1.1: chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -2814,17 +3033,20 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4 charcodes@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/charcodes/-/charcodes-0.2.0.tgz#5208d327e6cc05f99eb80ffc814707572d1f14e4" + integrity sha512-Y4kiDb+AM4Ecy58YkuZrrSRJBDQdQ2L+NyS1vHHFtNtUjgutcZfx3yp1dAONI/oPaPmyGfCLx5CxL+zauIMyKQ== chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== cheerio@^1.0.0-rc.1: - version "1.0.0-rc.2" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.2.tgz#4b9f53a81b27e4d5dac31c0ffd0cfa03cc6830db" + version "1.0.0-rc.3" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" + integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== dependencies: css-select "~1.2.0" - dom-serializer "~0.1.0" + dom-serializer "~0.1.1" entities "~1.1.1" htmlparser2 "^3.9.1" lodash "^4.15.0" @@ -2850,20 +3072,24 @@ chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: fsevents "^1.2.7" chownr@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" - -ci-info@^1.0.0: version "1.1.2" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" + integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== + +ci-info@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -2871,27 +3097,31 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" isobject "^3.0.0" static-extend "^0.1.1" -clean-css@4.1.x: - version "4.1.9" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.9.tgz#35cee8ae7687a49b98034f70de00c4edd3826301" +clean-css@4.2.x: + version "4.2.1" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" + integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== dependencies: - source-map "0.5.x" + source-map "~0.6.0" cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= dependencies: slice-ansi "0.0.4" string-width "^1.0.1" @@ -2899,10 +3129,12 @@ cli-truncate@^0.2.1: cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= dependencies: center-align "^0.1.1" right-align "^0.1.1" @@ -2911,14 +3143,16 @@ cliui@^2.1.0: cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" wrap-ansi "^2.0.0" cliui@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc" + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -2927,34 +3161,41 @@ cliui@^4.0.0: clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" + integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" + integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= clone-stats@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" + integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= clone@^1.0.0, clone@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= clone@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.1.tgz#d217d1e961118e3ac9a4b8bba3285553bf647cdb" + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= cloneable-readable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.0.0.tgz#a6290d413f217a61232f95e458ff38418cfb0117" + version "1.1.3" + resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" + integrity sha512-2EF8zTQOxYq70Y4XKtorQupqF0m49MBz2/yf5Bj+MHjvpG3Hy7sImifnqD6UA+TKYxeSV+u6qqQPawN5UvnpKQ== dependencies: inherits "^2.0.1" - process-nextick-args "^1.0.6" - through2 "^2.0.1" + process-nextick-args "^2.0.0" + readable-stream "^2.3.5" cmd-shim@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" + integrity sha1-b8vamUg6j9FdfTChlspp1oii79s= dependencies: graceful-fs "^4.1.2" mkdirp "~0.5.0" @@ -2962,14 +3203,17 @@ cmd-shim@^2.0.2: co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= collection-map@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= dependencies: arr-map "^2.0.2" for-own "^1.0.0" @@ -2978,107 +3222,125 @@ collection-map@^1.0.0: collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "^1.1.1" + color-name "1.1.3" -color-name@^1.1.1: +color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= color-support@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" + integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== columnify@^1.5.4: version "1.5.4" resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb" + integrity sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs= dependencies: strip-ansi "^3.0.0" wcwidth "^1.0.0" -combine-source-map@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.6.1.tgz#9b4a09c316033d768e0f11e029fa2730e079ad96" - dependencies: - convert-source-map "~1.1.0" - inline-source-map "~0.5.0" - lodash.memoize "~3.0.3" - source-map "~0.4.2" - -combine-source-map@~0.7.1: - version "0.7.2" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" +combine-source-map@^0.8.0, combine-source-map@~0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" + integrity sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos= dependencies: convert-source-map "~1.1.0" inline-source-map "~0.6.0" lodash.memoize "~3.0.3" source-map "~0.5.3" -combine-source-map@~0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" +combine-source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.6.1.tgz#9b4a09c316033d768e0f11e029fa2730e079ad96" + integrity sha1-m0oJwxYDPXaODxHgKfonMOB5rZY= dependencies: convert-source-map "~1.1.0" - inline-source-map "~0.6.0" + inline-source-map "~0.5.0" lodash.memoize "~3.0.3" - source-map "~0.5.3" + source-map "~0.4.2" combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== dependencies: delayed-stream "~1.0.0" -commander@2.14.x, commander@^2.14.1, commander@^2.8.1, commander@^2.9.0, commander@~2.14.1: - version "2.14.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" +commander@2.17.x: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== + +commander@^2.20.0, commander@^2.8.1, commander@~2.20.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commander@~2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" + integrity sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg= dependencies: array-ify "^1.0.0" dot-prop "^3.0.0" component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@~1.6.0: +concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== dependencies: buffer-from "^1.0.0" inherits "^2.0.3" readable-stream "^2.2.2" typedarray "^0.0.6" -concat-stream@~1.5.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" +concat-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-2.0.0.tgz#414cf5af790a48c60ab9be4527d56d5e41133cb1" + integrity sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A== dependencies: - inherits "~2.0.1" - readable-stream "~2.0.0" - typedarray "~0.0.5" + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.0.2" + typedarray "^0.0.6" config-chain@^1.1.11: version "1.1.12" resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== dependencies: ini "^1.3.4" proto-list "~1.2.1" @@ -3086,26 +3348,25 @@ config-chain@^1.1.11: console-browserify@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= dependencies: date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= constants-browserify@^1.0.0, constants-browserify@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= -content-type-parser@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.2.tgz#caabe80623e63638b2502fd4c7f12ff4ce2352e7" - conventional-changelog-angular@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.3.tgz#299fdd43df5a1f095283ac16aeedfb0a682ecab0" @@ -3133,14 +3394,15 @@ conventional-changelog-core@^3.1.6: read-pkg-up "^3.0.0" through2 "^3.0.0" -conventional-changelog-preset-loader@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.0.2.tgz#81d1a07523913f3d17da3a49f0091f967ad345b0" +conventional-changelog-preset-loader@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4" + integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== conventional-changelog-writer@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.5.tgz#fb9e384bb294e8e8a9f2568a3f4d1e11953d8641" - integrity sha512-g/Myp4MaJ1A+f7Ai+SnVhkcWtaHk6flw0SYN7A+vQ+MTu0+gSovQWs4Pg4NtcNUcIztYQ9YHsoxHP+GGQplI7Q== + version "4.0.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" + integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" @@ -3149,11 +3411,11 @@ conventional-changelog-writer@^4.0.5: json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" - semver "^5.5.0" + semver "^6.0.0" split "^1.0.0" through2 "^3.0.0" -conventional-commits-filter@^2.0.1, conventional-commits-filter@^2.0.2: +conventional-commits-filter@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-2.0.2.tgz#f122f89fbcd5bb81e2af2fcac0254d062d1039c1" integrity sha512-WpGKsMeXfs21m1zIw4s9H5sys2+9JccTzpN6toXtxhpw2VNF2JUXwIakthKBy+LN4DvJm+TzWhxOMWOs1OFCFQ== @@ -3161,13 +3423,13 @@ conventional-commits-filter@^2.0.1, conventional-commits-filter@^2.0.2: lodash.ismatch "^4.4.0" modify-values "^1.0.0" -conventional-commits-parser@^3.0.1, conventional-commits-parser@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.2.tgz#1295590dd195f64f53d6f8eb7c41114bb9a60742" - integrity sha512-y5eqgaKR0F6xsBNVSQ/5cI5qIF3MojddSUi1vKIggRkqUTbkqFKH9P5YX/AT1BVZp9DtSzBTIkvjyVLotLsVog== +conventional-commits-parser@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" + integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== dependencies: JSONStream "^1.0.4" - is-text-path "^1.0.0" + is-text-path "^2.0.0" lodash "^4.2.1" meow "^4.0.0" split2 "^2.0.0" @@ -3175,29 +3437,35 @@ conventional-commits-parser@^3.0.1, conventional-commits-parser@^3.0.2: trim-off-newlines "^1.0.0" conventional-recommended-bump@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-4.0.4.tgz#05540584641d3da758c8863c09788fcaeb586872" + version "4.1.1" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-4.1.1.tgz#37014fadeda267d0607e2fc81124da840a585127" + integrity sha512-JT2vKfSP9kR18RXXf55BRY1O3AHG8FPg5btP3l7LYfcWJsiXI6MCf30DepQ98E8Qhowvgv7a8iev0J1bEDkTFA== dependencies: - concat-stream "^1.6.0" - conventional-changelog-preset-loader "^2.0.2" - conventional-commits-filter "^2.0.1" - conventional-commits-parser "^3.0.1" + concat-stream "^2.0.0" + conventional-changelog-preset-loader "^2.1.1" + conventional-commits-filter "^2.0.2" + conventional-commits-parser "^3.0.2" git-raw-commits "2.0.0" git-semver-tags "^2.0.2" meow "^4.0.0" q "^1.5.1" convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" convert-source-map@~1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" + integrity sha1-SCnId+n+SbMWHzvzZziI4gRpmGA= copy-concurrently@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/copy-concurrently/-/copy-concurrently-1.0.5.tgz#92297398cae34937fcafd6ec8139c18051f0b5e0" + integrity sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A== dependencies: aproba "^1.1.1" fs-write-stream-atomic "^1.0.8" @@ -3209,38 +3477,41 @@ copy-concurrently@^1.0.0: copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= copy-props@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.2.tgz#6151fc8fd47fd8703df00f53940a0ebfeb8c2162" + version "2.0.4" + resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.4.tgz#93bb1cadfafd31da5bb8a9d4b41f471ec3a72dfe" + integrity sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A== dependencies: each-props "^1.3.0" is-plain-object "^2.0.1" core-js-compat@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.1.tgz#a1ae7edd5b791066d6eaa969c1b62986b844fd42" - integrity sha512-RH3kv8NFovFRMdeTEUgu8nMquEWKEVttOY3JFi8mN75sg72zygPqWbpWNTUw4JYEU43562tlzhdWsWqXmdFAnQ== + version "3.1.4" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.4.tgz#e4d0c40fbd01e65b1d457980fe4112d4358a7408" + integrity sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg== dependencies: - browserslist "^4.6.0" - core-js-pure "3.1.1" - semver "^6.0.0" + browserslist "^4.6.2" + core-js-pure "3.1.4" + semver "^6.1.1" -core-js-pure@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.1.tgz#92494ab7bae22f156ae93973a5e2738814efa7f8" - integrity sha512-jH3ZJ0CJ0wwDvWY0olbOComLo6tbWg4kE2x0j4+wlqYnofwF9mYm98YvADuENUzGw69IddmWFCF1FQ2S0jP96A== +core-js-pure@3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.4.tgz#5fa17dc77002a169a3566cc48dc774d2e13e3769" + integrity sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA== core-js@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.0.tgz#a8dbfa978d29bfc263bfb66c556d0ca924c28957" - integrity sha512-WBmxlgH2122EzEJ6GH8o9L/FeoUKxxxZ6q6VUxoTlsE4EvbTWKJb447eyVxTEuq0LpXjlq/kCB2qgBvsYRkLvQ== + version "3.1.4" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.1.4.tgz#3a2837fc48e582e1ae25907afcd6cf03b0cc7a07" + integrity sha512-YNZN8lt82XIMLnLirj9MhKDFZHalwzzrL9YLt6eb0T5D0EDl4IQ90IGkua8mHbnxNrkj1d8hbdizMc0Qmg1WnQ== core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -cosmiconfig@^5.1.0, cosmiconfig@^5.2.0: +cosmiconfig@^5.1.0, cosmiconfig@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== @@ -3251,24 +3522,28 @@ cosmiconfig@^5.1.0, cosmiconfig@^5.2.0: parse-json "^4.0.0" create-ecdh@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + version "4.0.3" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" + integrity sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw== dependencies: bn.js "^4.1.0" elliptic "^6.0.0" create-hash@^1.1.0, create-hash@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" + version "1.2.0" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" inherits "^2.0.1" - ripemd160 "^2.0.0" + md5.js "^1.3.4" + ripemd160 "^2.0.1" sha.js "^2.4.0" create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: - version "1.1.6" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" + version "1.1.7" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" create-hash "^1.1.0" @@ -3280,6 +3555,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" @@ -3288,6 +3564,7 @@ cross-spawn@^5.0.1: cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -3298,6 +3575,7 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" + integrity sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg== dependencies: browserify-cipher "^1.0.0" browserify-sign "^4.0.0" @@ -3314,6 +3592,7 @@ crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: css-select@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= dependencies: boolbase "~1.0.0" css-what "2.1" @@ -3321,84 +3600,122 @@ css-select@~1.2.0: nth-check "~1.0.1" css-what@2.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" + version "2.1.3" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" + integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== -"cssstyle@>= 0.2.37 < 0.3.0": - version "0.2.37" - resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" +cssstyle@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.4.0.tgz#9d31328229d3c565c61e586b02041a28fccdccf1" + integrity sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA== dependencies: cssom "0.3.x" currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + integrity sha1-mI3zP+qxke95mmE2nddsF635V+o= dependencies: array-find-index "^1.0.1" cyclist@~0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" + integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== dependencies: - es5-ext "^0.10.9" + es5-ext "^0.10.50" + type "^1.0.1" dargs@^4.0.1: version "4.1.0" resolved "https://registry.yarnpkg.com/dargs/-/dargs-4.1.0.tgz#03a9dbb4b5c2f139bf14ae53f0b8a2a6a86f4e17" + integrity sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc= dependencies: number-is-nan "^1.0.0" +dash-ast@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/dash-ast/-/dash-ast-1.0.0.tgz#12029ba5fb2f8aa6f0a861795b23c1b4b6c27d37" + integrity sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA== + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= dependencies: assert-plus "^1.0.0" +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + date-fns@^1.27.2: - version "1.29.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" + integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -debug@3.1.0, debug@^3.0.0, debug@^3.1.0: +debug@3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== dependencies: ms "2.0.0" -debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" +debug@^3.0.0, debug@^3.1.0, debug@^3.2.6: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + debug@^4.0.1, debug@^4.1.0, debug@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" debuglog@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492" + integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI= decamelize-keys@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + integrity sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk= dependencies: decamelize "^1.1.0" map-obj "^1.0.0" @@ -3406,66 +3723,77 @@ decamelize-keys@^1.0.0: decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.2.0.tgz#58ef463a57c08d376547f8869fdc5bcee957f44e" - integrity sha512-6+LuZGU7QCNUnAJyX8cIrlzoEgggTM6B7mm+znKOX4t5ltluT9KLjN6g61ECMS0LTsLW7yDpNoxhix5FZcrIow== +deepmerge@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" + integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww== default-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" + integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== dependencies: kind-of "^5.0.2" default-resolution@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= defaults@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" + integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= dependencies: clone "^1.0.2" define-properties@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== dependencies: - foreach "^2.0.5" - object-keys "^1.0.8" + object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" @@ -3473,39 +3801,40 @@ define-property@^2.0.2: defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= -del@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" +del@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" + integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== dependencies: + "@types/glob" "^7.1.1" globby "^6.1.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - p-map "^1.1.1" - pify "^3.0.0" - rimraf "^2.2.8" + is-path-cwd "^2.0.0" + is-path-in-cwd "^2.0.0" + p-map "^2.0.0" + pify "^4.0.1" + rimraf "^2.6.3" delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" - -deprecation@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-1.0.1.tgz#2df79b79005752180816b7b6e079cbd80490d711" - integrity sha512-ccVHpE72+tcIKaGMql33x5MAjKQIZrk+3x2GbJ7TeraUCZWHoT+KSZpoC+JQFsUBlSTXUrBaGiF0j6zVTepPLg== + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= deprecation@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.0.0.tgz#dd0427cd920c78bc575ec39dab2f22e7c304fb9d" - integrity sha512-lbQN037mB3VfA2JFuguM5GCJ+zPinMeCrFe+AfSZ6eqrnJA/Fs+EYMnd6Nb2mn9lf2jO9xwEd9o9lic+D4vkcw== + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== deps-sort@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" + integrity sha1-CRckkC6EZYJg65EHSMzNGvbiH7U= dependencies: JSONStream "^1.0.3" shasum "^1.0.0" @@ -3515,6 +3844,7 @@ deps-sort@^2.0.0: derequire@^2.0.2: version "2.0.6" resolved "https://registry.yarnpkg.com/derequire/-/derequire-2.0.6.tgz#31a414bb7ca176239fa78b116636ef77d517e768" + integrity sha1-MaQUu3yhdiOfp4sRZjbvd9UX52g= dependencies: acorn "^4.0.3" concat-stream "^1.4.6" @@ -3525,6 +3855,7 @@ derequire@^2.0.2: des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -3532,30 +3863,36 @@ des.js@^1.0.0: detect-file@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= detect-newline@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= detective@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/detective/-/detective-5.1.0.tgz#7a20d89236d7b331ccea65832e7123b5551bb7cb" + version "5.2.0" + resolved "https://registry.yarnpkg.com/detective/-/detective-5.2.0.tgz#feb2a77e85b904ecdea459ad897cc90a99bd2a7b" + integrity sha512-6SsIx+nUUbuK0EthKjv0zrdnajCCXVYGmbYYiYjFVpzcjwEs/JMDZ8tPRG29J/HhN56t3GJp2cGSWDRjjot8Pg== dependencies: - acorn-node "^1.3.0" + acorn-node "^1.6.1" defined "^1.0.0" minimist "^1.1.1" dezalgo@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/dezalgo/-/dezalgo-1.0.3.tgz#7f742de066fc748bc8db820569dddce49bf0d456" + integrity sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY= dependencies: asap "^2.0.0" wrappy "1" @@ -3566,16 +3903,18 @@ diff-sequences@^24.3.0: integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== diffie-hellman@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + version "5.0.3" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" + integrity sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg== dependencies: bn.js "^4.1.0" miller-rabin "^4.0.0" randombytes "^2.0.0" -dir-glob@^2.0.0: +dir-glob@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== dependencies: arrify "^1.0.1" path-type "^3.0.0" @@ -3595,40 +3934,50 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-serializer@0, dom-serializer@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" +dom-serializer@0, dom-serializer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== dependencies: - domelementtype "~1.1.1" - entities "~1.1.1" + domelementtype "^1.3.0" + entities "^1.1.1" domain-browser@^1.1.1, domain-browser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domelementtype@1, domelementtype@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" - -domelementtype@~1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== -domexception@^1.0.0: +domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== dependencies: webidl-conversions "^4.0.2" domhandler@^2.3.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.1.tgz#892e47000a99be55bbf3774ffea0561d8879c259" + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== dependencies: domelementtype "1" -domutils@1.5.1, domutils@^1.5.1: +domutils@1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== dependencies: dom-serializer "0" domelementtype "1" @@ -3636,28 +3985,33 @@ domutils@1.5.1, domutils@^1.5.1: dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" + integrity sha1-G3CK8JSknJoOfbyteQq6U52sEXc= dependencies: is-obj "^1.0.0" dot-prop@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== dependencies: is-obj "^1.0.0" duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" + integrity sha1-ixLauHjA1p4+eJEFFmKjL8a93ME= dependencies: readable-stream "^2.0.2" duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + integrity sha1-rOb/gIwc5mtX0ev5eXessCM0z8E= duplexify@^3.4.2, duplexify@^3.6.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.6.1.tgz#b1a7a29c4abfd639585efaecce80d666b1e34125" + version "3.7.1" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.7.1.tgz#2a4df5317f6ccfd91f86d6fd25d8d8a103b88309" + integrity sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g== dependencies: end-of-stream "^1.0.0" inherits "^2.0.1" @@ -3675,30 +4029,35 @@ duplicate-package-checker-webpack-plugin@^2.1.0: semver "^5.4.1" each-props@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.1.tgz#fc138f51e3a2774286d4858e02d6e7de462de158" + version "1.3.2" + resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" + integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== dependencies: is-plain-object "^2.0.1" object.defaults "^1.1.0" ecc-jsbn@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= dependencies: jsbn "~0.1.0" + safer-buffer "^2.1.0" -electron-to-chromium@^1.3.133: - version "1.3.134" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.134.tgz#550222bddac43c6bd6c445c3543a0fe8a615021d" - integrity sha512-C3uK2SrtWg/gSWaluLHWSHjyebVZCe4ZC0NVgTAoTq8tCR9FareRK5T7R7AS/nPZShtlEcjVMX1kQ8wi4nU68w== +electron-to-chromium@^1.3.191: + version "1.3.191" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.191.tgz#c451b422cd8b2eab84dedabab5abcae1eaefb6f0" + integrity sha512-jasjtY5RUy/TOyiUYM2fb4BDaPZfm6CXRFeJDMfFsXYADGxUN49RBqtgB7EL2RmJXeIRUk9lM1U6A5yk2YJMPQ== elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= elliptic@^6.0.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" + version "6.5.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" + integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -3708,30 +4067,34 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== +emoji-regex@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= dependencies: iconv-lite "~0.4.13" end-of-stream@^1.0.0, end-of-stream@^1.1.0: version "1.4.1" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: once "^1.4.0" enhanced-resolve@^3.0.0, enhanced-resolve@^3.4.0: version "3.4.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" + integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= dependencies: graceful-fs "^4.1.2" memory-fs "^0.4.0" @@ -3739,22 +4102,26 @@ enhanced-resolve@^3.0.0, enhanced-resolve@^3.4.0: tapable "^0.2.7" entities@^1.1.1, entities@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== err-code@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" + integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= errno@^0.1.3: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" + integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== dependencies: prr "~1.0.1" error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" @@ -3779,16 +4146,19 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.39" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.39.tgz#fca21b67559277ca4ac1a1ed7048b107b6f76d87" +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@~0.10.14: + version "0.10.50" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.50.tgz#6d0e23a0abdb27018e5ac4fd09b412bc5517a778" + integrity sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw== dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" + next-tick "^1.0.0" -es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: +es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= dependencies: d "1" es5-ext "^0.10.35" @@ -3797,6 +4167,7 @@ es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: es6-map@^0.1.3: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= dependencies: d "1" es5-ext "~0.10.14" @@ -3806,18 +4177,21 @@ es6-map@^0.1.3: event-emitter "~0.3.5" es6-promise@^4.0.3: - version "4.2.5" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.5.tgz#da6d0d5692efb461e082c14817fe2427d8f5d054" + version "4.2.8" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" + integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== es6-promisify@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" + integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= dependencies: es6-promise "^4.0.3" es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= dependencies: d "1" es5-ext "~0.10.14" @@ -3828,6 +4202,7 @@ es6-set@~0.1.5: es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= dependencies: d "1" es5-ext "~0.10.14" @@ -3835,26 +4210,30 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: es6-templates@^0.2.2: version "0.2.3" resolved "https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4" + integrity sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ= dependencies: recast "~0.11.12" through "~2.3.6" es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== dependencies: d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" es6-symbol "^3.1.1" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.4, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -3866,6 +4245,7 @@ escodegen@^1.9.0: escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + integrity sha1-4Bl16BJ4GhY6ba392AOY3GTIicM= dependencies: es6-map "^0.1.3" es6-weak-map "^2.0.1" @@ -3894,16 +4274,16 @@ eslint-module-utils@^2.4.0: pkg-dir "^2.0.0" eslint-plugin-flowtype@^3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.8.2.tgz#8e1ecaae570d149ba3ba2c73964ebac5582e8ff9" - integrity sha512-3fBLnSQ4WEVKtd+PWuqL9qhciYrJWjLuOGilEIN3LzEYnPtvDcnjQPHP2OFhzTCRlpojSv2EEqoPW+Sol0vn2A== + version "3.11.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.11.1.tgz#1aae15a10dbcd5aecc89897f810f2e9fcc18a5e3" + integrity sha512-4NiaaGZuz9iEGRTK8j4lkA/scibOXSYaYoHbsTtgLOxxqQCkbWV3xt8ETqILKg7DAYDqB69z1H5U71UmtdF9hw== dependencies: lodash "^4.17.11" eslint-plugin-import@^2.17.2: - version "2.17.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.17.2.tgz#d227d5c6dc67eca71eb590d2bb62fb38d86e9fcb" - integrity sha512-m+cSVxM7oLsIpmwNn2WXTJoReOF9f/CtLMo7qOVmKd1KntBy0hEcuNZ3erTmWjx+DxRO0Zcrm5KwAvI9wHcV5g== + version "2.18.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" + integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== dependencies: array-includes "^3.0.3" contains-path "^0.1.0" @@ -3915,7 +4295,7 @@ eslint-plugin-import@^2.17.2: lodash "^4.17.11" minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.10.0" + resolve "^1.11.0" eslint-plugin-prettier@^3.1.0: version "3.1.0" @@ -3927,6 +4307,7 @@ eslint-plugin-prettier@^3.1.0: eslint-scope@3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -3940,20 +4321,24 @@ eslint-scope@^4.0.3: estraverse "^4.1.1" eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" + integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + dependencies: + eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.16.0: - version "5.16.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.16.0.tgz#a1e3ac1aae4a3fbd8296fcf8f7ab7314cbb6abea" - integrity sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg== +eslint@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" + integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.9.1" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" debug "^4.0.1" @@ -3961,18 +4346,19 @@ eslint@^5.16.0: eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^5.0.1" + espree "^6.0.0" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^3.1.0" globals "^11.7.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.2.2" - js-yaml "^3.13.0" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" lodash "^4.17.11" @@ -3980,7 +4366,6 @@ eslint@^5.16.0: mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" progress "^2.0.0" regexpp "^2.0.1" semver "^5.5.1" @@ -3989,10 +4374,10 @@ eslint@^5.16.0: table "^5.2.3" text-table "^0.2.0" -espree@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.1.tgz#5d6526fa4fc7f0788a5cf75b15f30323e2f81f7a" - integrity sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A== +espree@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" + integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== dependencies: acorn "^6.0.7" acorn-jsx "^5.0.0" @@ -4001,39 +4386,46 @@ espree@^5.0.1: esprima@^3.1.3, esprima@~3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= -estree-walker@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.0.tgz#5d865327c44a618dde5699f763891ae31f257dae" - integrity sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw== +estree-walker@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" + integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= event-emitter@~0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= dependencies: d "1" es5-ext "~0.10.14" @@ -4043,17 +4435,20 @@ eventemitter3@^3.1.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7" integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q== -events@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - events@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" + integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== + +events@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" + integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" safe-buffer "^5.1.1" @@ -4063,21 +4458,10 @@ exec-sh@^0.3.2: resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== -execa@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50" - dependencies: - cross-spawn "^6.0.0" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -4090,6 +4474,7 @@ execa@^0.7.0: execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== dependencies: cross-spawn "^6.0.0" get-stream "^4.0.0" @@ -4099,19 +4484,37 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" +execa@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.3.tgz#4b84301b33042cfb622771e886ed0b10e5634642" + integrity sha512-iM124nlyGSrXmuyZF1EMe83ESY2chIYVyDRZKgmcDynid2Q2v/+GuE7gNMl6Sy9Niwf4MC0DDxagOxeMPjuLsw== + dependencies: + cross-spawn "^6.0.5" + get-stream "^5.0.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^3.0.0" + onetime "^5.1.0" + p-finally "^2.0.0" + signal-exit "^3.0.2" + strip-final-newline "^2.0.0" + exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= dependencies: is-posix-bracket "^0.1.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -4124,12 +4527,14 @@ expand-brackets@^2.1.4: expand-range@^1.8.1: version "1.8.2" resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= dependencies: fill-range "^2.1.0" expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= dependencies: homedir-polyfill "^1.0.1" @@ -4148,18 +4553,21 @@ expect@^24.8.0: extend-shallow@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" + integrity sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE= dependencies: kind-of "^1.1.0" extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" @@ -4167,10 +4575,12 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== external-editor@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" @@ -4179,12 +4589,14 @@ external-editor@^3.0.3: extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= dependencies: is-extglob "^1.0.0" extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -4195,13 +4607,20 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0, extsprintf@^1.2.0: +extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= falafel@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" + integrity sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw= dependencies: acorn "^5.0.0" foreach "^2.0.5" @@ -4211,6 +4630,7 @@ falafel@^2.1.0: fancy-log@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" + integrity sha1-9BEl49hPLn2JpD0G2VjI94vha+E= dependencies: ansi-gray "^0.1.1" color-support "^1.1.3" @@ -4219,6 +4639,7 @@ fancy-log@1.3.2: fancy-log@^1.3.2, fancy-log@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== dependencies: ansi-gray "^0.1.1" color-support "^1.1.3" @@ -4228,14 +4649,17 @@ fancy-log@^1.3.2, fancy-log@^1.3.3: fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= fast-diff@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== fast-glob@^2.0.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.4.tgz#e54f4b66d378040e0e4d6a68ec36bbc5b04363c0" + version "2.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" + integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== dependencies: "@mrmlnc/readdir-enhanced" "^2.2.1" "@nodelib/fs.stat" "^1.1.2" @@ -4247,28 +4671,34 @@ fast-glob@^2.0.2: fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= fastparse@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" + version "1.1.2" + resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" + integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= dependencies: bser "^2.0.0" figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" + integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" @@ -4276,6 +4706,7 @@ figures@^1.7.0: figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" @@ -4289,38 +4720,45 @@ file-entry-cache@^5.0.1: filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== dependencies: is-number "^2.1.0" isobject "^2.0.0" - randomatic "^1.1.3" + randomatic "^3.0.0" repeat-element "^1.1.2" repeat-string "^1.5.2" fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" repeat-string "^1.6.1" to-regex-range "^2.1.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + find-cache-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.0.0.tgz#4c1faed59f45184530fb9d7fa123a4d04a98472d" + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7" + integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ== dependencies: commondir "^1.0.1" - make-dir "^1.0.0" + make-dir "^2.0.0" pkg-dir "^3.0.0" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - find-root@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -4329,6 +4767,7 @@ find-root@^1.0.0: find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" @@ -4336,18 +4775,29 @@ find-up@^1.0.0: find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: locate-path "^3.0.0" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + findup-sync@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" + integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= dependencies: detect-file "^1.0.0" is-glob "^3.1.0" @@ -4365,8 +4815,9 @@ findup-sync@^3.0.0: resolve-dir "^1.0.1" fined@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fined/-/fined-1.1.0.tgz#b37dc844b76a2f5e7081e884f7c0ae344f153476" + version "1.2.0" + resolved "https://registry.yarnpkg.com/fined/-/fined-1.2.0.tgz#d00beccf1aa2b475d16d423b0238b713a2c4a37b" + integrity sha512-ZYDqPLGxDkDhDZBjZBb+oD1+j0rA4E0pXY50eplAAOPg2N/gUBSSk5IM1/QhPfyVo19lJ+CvXpqfvk+b2p/8Ng== dependencies: expand-tilde "^2.0.2" is-plain-object "^2.0.3" @@ -4377,12 +4828,14 @@ fined@^1.0.1: first-chunk-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-2.0.0.tgz#1bdecdb8e083c0664b91945581577a43a9f31d70" + integrity sha1-G97NuOCDwGZLkZRVgVd6Q6nzHXA= dependencies: readable-stream "^2.0.2" flagged-respawn@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.0.tgz#4e79ae9b2eb38bf86b3bb56bf3e0a56aa5fcabd7" + version "1.0.1" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" + integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== flat-cache@^2.0.1: version "2.0.1" @@ -4394,54 +4847,56 @@ flat-cache@^2.0.1: write "1.0.3" flatted@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.0.tgz#55122b6536ea496b4b44893ee2608141d10d9916" - integrity sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg== + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -flow-bin@^0.94.0: - version "0.94.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.94.0.tgz#b5d58fe7559705b73a18229f97edfc3ab6ffffcb" - integrity sha512-DYF7r9CJ/AksfmmB4+q+TyLMoeQPRnqtF1Pk7KY3zgfkB/nVuA3nXyzqgsIPIvnMSiFEXQcFK4z+iPxSLckZhQ== +flow-bin@^0.102.0: + version "0.102.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.102.0.tgz#3d5de44bcc26d26585e932b3201988b766f9b380" + integrity sha512-mYon6noeLO0Q5SbiWULLQeM1L96iuXnRtYMd47j3bEWXAwUW9EnwNWcn+cZg/jC/Dg4Wj/jnkdTDEuFtbeu1ww== flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" + version "1.1.1" + resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.1.1.tgz#8dd7d873a1babc207d94ead0c2e0e44276ebf2e8" + integrity sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w== dependencies: - inherits "^2.0.1" - readable-stream "^2.0.4" - -fn-name@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fn-name/-/fn-name-2.0.1.tgz#5214d7537a4d06a4a301c0cc262feb84188002e7" - integrity sha1-UhTXU3pNBqSjAcDMJi/rhBiAAuc= + inherits "^2.0.3" + readable-stream "^2.3.6" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= for-own@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= dependencies: for-in "^1.0.1" for-own@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/for-own/-/for-own-1.0.0.tgz#c63332f415cedc4b04dbfe70cf836494c53cb44b" + integrity sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs= dependencies: for-in "^1.0.1" foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== dependencies: asynckit "^0.4.0" combined-stream "^1.0.6" @@ -4450,12 +4905,14 @@ form-data@~2.3.2: fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" from2@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" + integrity sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8= dependencies: inherits "^2.0.1" readable-stream "^2.0.0" @@ -4463,20 +4920,23 @@ from2@^2.1.0: fs-extra@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== dependencies: graceful-fs "^4.1.2" jsonfile "^4.0.0" universalify "^0.1.0" fs-minipass@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + version "1.2.6" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" + integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== dependencies: minipass "^2.2.1" fs-mkdirp-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz#0b7815fc3201c6a69e14db98ce098c16935259eb" + integrity sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes= dependencies: graceful-fs "^4.1.11" through2 "^2.0.3" @@ -4484,10 +4944,12 @@ fs-mkdirp-stream@^1.0.0: fs-readdir-recursive@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== fs-write-stream-atomic@^1.0.8: version "1.0.10" resolved "https://registry.yarnpkg.com/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz#b47df53493ef911df75731e70a9ded0189db40c9" + integrity sha1-tH31NJPvkR33VzHnCp3tAYnbQMk= dependencies: graceful-fs "^4.1.2" iferr "^0.1.5" @@ -4497,6 +4959,7 @@ fs-write-stream-atomic@^1.0.8: fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= fsevents@^1.2.7: version "1.2.9" @@ -4509,22 +4972,17 @@ fsevents@^1.2.7: function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - -g-status@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/g-status/-/g-status-2.0.2.tgz#270fd32119e8fc9496f066fe5fe88e0a6bc78b97" - dependencies: - arrify "^1.0.1" - matcher "^1.0.0" - simple-git "^1.85.0" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= dependencies: aproba "^1.0.3" console-control-strings "^1.0.0" @@ -4538,18 +4996,27 @@ gauge@~2.7.3: genfun@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" + integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== + +get-assigned-identifiers@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz#6dbf411de648cbaf8d9169ebb0d2d576191e2ff1" + integrity sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ== get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== -get-own-enumerable-property-symbols@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== get-pkg-repo@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz#c73b489c06d80cc5536c2c853f9e05232056972d" + integrity sha1-xztInAbYDMVTbCyFP54FIyBWly0= dependencies: hosted-git-info "^2.1.4" meow "^3.3.0" @@ -4560,10 +5027,12 @@ get-pkg-repo@^1.0.0: get-port@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" + integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + integrity sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4= get-stdin@^7.0.0: version "7.0.0" @@ -4573,26 +5042,38 @@ get-stdin@^7.0.0: get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-stream@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" + integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== dependencies: pump "^3.0.0" get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= getpass@^0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= dependencies: assert-plus "^1.0.0" git-raw-commits@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.0.tgz#d92addf74440c14bcc5c83ecce3fb7f8a79118b5" + integrity sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg== dependencies: dargs "^4.0.1" lodash.template "^4.0.2" @@ -4603,6 +5084,7 @@ git-raw-commits@2.0.0: git-remote-origin-url@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/git-remote-origin-url/-/git-remote-origin-url-2.0.0.tgz#5282659dae2107145a11126112ad3216ec5fa65f" + integrity sha1-UoJlna4hBxRaERJhEq0yFuxfpl8= dependencies: gitconfiglocal "^1.0.0" pify "^2.3.0" @@ -4610,6 +5092,7 @@ git-remote-origin-url@^2.0.0: git-semver-tags@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3" + integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w== dependencies: meow "^4.0.0" semver "^5.5.0" @@ -4632,12 +5115,14 @@ git-url-parse@^11.1.2: gitconfiglocal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gitconfiglocal/-/gitconfiglocal-1.0.0.tgz#41d045f3851a5ea88f03f24ca1c6178114464b9b" + integrity sha1-QdBF84UaXqiPA/JMocYXgRRGS5s= dependencies: ini "^1.3.2" glob-base@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= dependencies: glob-parent "^2.0.0" is-glob "^2.0.0" @@ -4645,12 +5130,14 @@ glob-base@^0.3.0: glob-parent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= dependencies: is-glob "^2.0.0" glob-parent@^3.0.1, glob-parent@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= dependencies: is-glob "^3.1.0" path-dirname "^1.0.0" @@ -4658,6 +5145,7 @@ glob-parent@^3.0.1, glob-parent@^3.1.0: glob-stream@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" + integrity sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ= dependencies: extend "^3.0.0" glob "^7.1.1" @@ -4673,6 +5161,7 @@ glob-stream@^6.1.0: glob-to-regexp@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= glob-watcher@^5.0.3: version "5.0.3" @@ -4686,10 +5175,10 @@ glob-watcher@^5.0.3: just-debounce "^1.0.0" object.defaults "^1.1.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== +glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -4701,6 +5190,7 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: global-modules@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== dependencies: global-prefix "^1.0.1" is-windows "^1.0.1" @@ -4709,6 +5199,7 @@ global-modules@^1.0.0: global-prefix@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= dependencies: expand-tilde "^2.0.2" homedir-polyfill "^1.0.1" @@ -4717,13 +5208,14 @@ global-prefix@^1.0.1: which "^1.2.14" globals@^11.1.0, globals@^11.7.0: - version "11.11.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.11.0.tgz#dcf93757fa2de5486fbeed7118538adf789e9c2e" - integrity sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw== + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= dependencies: array-union "^1.0.1" glob "^7.0.3" @@ -4732,11 +5224,12 @@ globby@^6.1.0: pinkie-promise "^2.0.0" globby@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" + version "8.0.2" + resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" + integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== dependencies: array-union "^1.0.1" - dir-glob "^2.0.0" + dir-glob "2.0.0" fast-glob "^2.0.2" glob "^7.1.2" ignore "^3.3.5" @@ -4744,23 +5237,26 @@ globby@^8.0.1: slash "^1.0.0" glogg@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.1.tgz#dcf758e44789cc3f3d32c1f3562a3676e6a34810" + version "1.0.2" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.2.tgz#2d7dd702beda22eb3bffadf880696da6d846313f" + integrity sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA== dependencies: sparkles "^1.0.0" graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= gulp-babel@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0.tgz#e0da96f4f2ec4a88dd3a3030f476e38ab2126d87" + integrity sha512-oomaIqDXxFkg7lbpBou/gnUkX51/Y/M2ZfSjL2hdqXTAlSWZcgZtd2o0cOH0r/eE8LWD0+Q/PsLsr2DKOoqToQ== dependencies: plugin-error "^1.0.1" replace-ext "^1.0.0" @@ -4794,6 +5290,7 @@ gulp-cli@^2.2.0: gulp-filter@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-5.1.0.tgz#a05e11affb07cf7dcf41a7de1cb7b63ac3783e73" + integrity sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM= dependencies: multimatch "^2.0.0" plugin-error "^0.1.2" @@ -4802,6 +5299,7 @@ gulp-filter@^5.1.0: gulp-newer@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/gulp-newer/-/gulp-newer-1.4.0.tgz#25243ed6eac8f5462b95894e0d41937b112e65f3" + integrity sha512-h79fGO55S/P9eAADbLAP9aTtVYpLSR1ONj08VPaSdVVNVYhTS8p1CO1TW7kEMu+hC+sytmCqcUr5LesvZEtDoQ== dependencies: glob "^7.0.3" kew "^0.7.0" @@ -4810,6 +5308,7 @@ gulp-newer@^1.0.0: gulp-plumber@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/gulp-plumber/-/gulp-plumber-1.2.1.tgz#d38700755a300b9d372318e4ffb5ff7ced0b2c84" + integrity sha512-mctAi9msEAG7XzW5ytDVZ9PxWMzzi1pS2rBH7lA095DhMa6KEXjm+St0GOCc567pJKJ/oCvosVAZEpAey0q2eQ== dependencies: chalk "^1.1.3" fancy-log "^1.3.2" @@ -4819,6 +5318,7 @@ gulp-plumber@^1.2.1: gulp-rename@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd" + integrity sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg== gulp-uglify@^3.0.2: version "3.0.2" @@ -4839,6 +5339,7 @@ gulp-uglify@^3.0.2: gulp-watch@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/gulp-watch/-/gulp-watch-5.0.1.tgz#83d378752f5bfb46da023e73c17ed1da7066215d" + integrity sha512-HnTSBdzAOFIT4wmXYPDUn783TaYAq9bpaN05vuZNP5eni3z3aRx0NAKbjhhMYtcq76x4R1wf4oORDGdlrEjuog== dependencies: ansi-colors "1.1.0" anymatch "^1.3.0" @@ -4866,15 +5367,16 @@ gulp@^4.0.2: gulplog@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gulplog/-/gulplog-1.0.0.tgz#e28c4d45d05ecbbed818363ce8f9c5926229ffe5" + integrity sha1-4oxNRdBey77YGDY86PnFkmIp/+U= dependencies: glogg "^1.0.0" -handlebars@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" - integrity sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w== +handlebars@^4.1.0, handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== dependencies: - async "^2.5.0" + neo-async "^2.6.0" optimist "^0.6.1" source-map "^0.6.1" optionalDependencies: @@ -4883,10 +5385,12 @@ handlebars@^4.1.0: har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= har-validator@~5.1.0: version "5.1.3" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== dependencies: ajv "^6.5.5" har-schema "^2.0.0" @@ -4894,34 +5398,41 @@ har-validator@~5.1.0: has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= has-gulplog@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" + integrity sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4= dependencies: sparkles "^1.0.0" has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -4930,6 +5441,7 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -4938,10 +5450,12 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" @@ -4953,57 +5467,59 @@ has@^1.0.0, has@^1.0.1, has@^1.0.3: dependencies: function-bind "^1.1.1" -hash-base@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" - dependencies: - inherits "^2.0.1" - hash-base@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" + integrity sha1-X8hoaEfs1zSZQDMZprCj8/auSRg= dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" hash.js@^1.0.0, hash.js@^1.0.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" - minimalistic-assert "^1.0.0" + minimalistic-assert "^1.0.1" -he@1.1.x: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +he@1.2.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha1-0nRXAQJabHdabFRXk+1QL8DGSaE= dependencies: hash.js "^1.0.3" minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" homedir-polyfill@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== dependencies: parse-passwd "^1.0.0" hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: version "2.7.1" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== html-encoding-sniffer@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== dependencies: whatwg-encoding "^1.0.1" html-loader@^0.4.5: version "0.4.5" resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.4.5.tgz#5fbcd87cd63a5c49a7fce2fe56f425e05729c68c" + integrity sha1-X7zYfNY6XEmn/OL+VvQl4Fcpxow= dependencies: es6-templates "^0.2.2" fastparse "^1.1.1" @@ -5012,40 +5528,44 @@ html-loader@^0.4.5: object-assign "^4.1.0" html-minifier@^3.0.1: - version "3.5.10" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.10.tgz#8522c772c388db81aa5c26f62033302d906ea1c7" + version "3.5.21" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" + integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== dependencies: camel-case "3.0.x" - clean-css "4.1.x" - commander "2.14.x" - he "1.1.x" - ncname "1.0.x" + clean-css "4.2.x" + commander "2.17.x" + he "1.2.x" param-case "2.1.x" relateurl "0.2.x" - uglify-js "3.3.x" + uglify-js "3.4.x" htmlescape@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" + integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= htmlparser2@^3.9.1: - version "3.9.2" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.9.2.tgz#1bdf87acca0f3f9e53fa4fcceb0f4b4cbb00b338" + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== dependencies: - domelementtype "^1.3.0" + domelementtype "^1.3.1" domhandler "^2.3.0" domutils "^1.5.1" entities "^1.1.1" inherits "^2.0.1" - readable-stream "^2.0.2" + readable-stream "^3.1.1" http-cache-semantics@^3.8.1: version "3.8.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" + integrity sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w== http-proxy-agent@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405" + integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg== dependencies: agent-base "4" debug "3.1.0" @@ -5053,6 +5573,7 @@ http-proxy-agent@^2.1.0: http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= dependencies: assert-plus "^1.0.0" jsprim "^1.2.2" @@ -5061,78 +5582,85 @@ http-signature@~1.2.0: https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" + integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= https-proxy-agent@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0" + version "2.2.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" + integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== dependencies: - agent-base "^4.1.0" + agent-base "^4.3.0" debug "^3.1.0" humanize-ms@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0= dependencies: ms "^2.0.0" -husky@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-2.3.0.tgz#8b78ed24d763042df7fd899991985d65a976dd13" - integrity sha512-A/ZQSEILoq+mQM3yC3RIBSaw1bYXdkKnyyKVSUiJl+iBjVZc5LQEXdGY1ZjrDxC4IzfRPiJ0IqzEQGCN5TQa/A== +husky@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.0.tgz#de63821a7049dc412b1afd753c259e2f6e227562" + integrity sha512-lKMEn7bRK+7f5eWPNGclDVciYNQt0GIkAQmhKl+uHP1qFzoN0h92kmH9HZ8PCwyVA2EQPD8KHf0FYWqnTxau+Q== dependencies: - cosmiconfig "^5.2.0" + cosmiconfig "^5.2.1" execa "^1.0.0" - find-up "^3.0.0" get-stdin "^7.0.0" is-ci "^2.0.0" - pkg-dir "^4.1.0" + opencollective-postinstall "^2.0.2" + pkg-dir "^4.2.0" please-upgrade-node "^3.1.1" read-pkg "^5.1.1" run-node "^1.0.0" slash "^3.0.0" -iconv-lite@0.4.19: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - -iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" ieee754@^1.1.4: - version "1.1.8" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" + version "1.1.13" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" + integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501" + integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore-walk@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== dependencies: minimatch "^3.0.4" ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= dependencies: caller-path "^2.0.0" resolve-from "^3.0.0" import-fresh@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -5140,6 +5668,7 @@ import-fresh@^3.0.0: import-local@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== dependencies: pkg-dir "^2.0.0" resolve-cwd "^2.0.0" @@ -5147,6 +5676,7 @@ import-local@^1.0.0: import-local@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== dependencies: pkg-dir "^3.0.0" resolve-cwd "^2.0.0" @@ -5154,43 +5684,52 @@ import-local@^2.0.0: imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indent-string@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + integrity sha1-ji1INIdCEhtKghi3oTfppSBJ3IA= dependencies: repeating "^2.0.0" indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - -indexof@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== init-package-json@^1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-1.10.3.tgz#45ffe2f610a8ca134f2bd1db5637b235070f6cbe" + integrity sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw== dependencies: glob "^7.1.1" npm-package-arg "^4.0.0 || ^5.0.0 || ^6.0.0" @@ -5204,19 +5743,21 @@ init-package-json@^1.10.3: inline-source-map@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.5.0.tgz#4a4c5dd8e4fb5e9b3cda60c822dfadcaee66e0af" + integrity sha1-Skxd2OT7Xps82mDIIt+tyu5m4K8= dependencies: source-map "~0.4.0" inline-source-map@~0.6.0: version "0.6.2" resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" + integrity sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU= dependencies: source-map "~0.5.3" inquirer@^6.2.0, inquirer@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" - integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + version "6.5.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" + integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== dependencies: ansi-escapes "^3.2.0" chalk "^2.4.2" @@ -5224,52 +5765,61 @@ inquirer@^6.2.0, inquirer@^6.2.2: cli-width "^2.0.0" external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.11" + lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" rxjs "^6.4.0" string-width "^2.1.0" - strip-ansi "^5.0.0" + strip-ansi "^5.1.0" through "^2.3.6" insert-module-globals@^7.0.0: - version "7.0.2" - resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.2.tgz#012c56baa7d3307a8b417d4ec5270cf9741c18f4" + version "7.2.0" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.0.tgz#ec87e5b42728479e327bd5c5c71611ddfb4752ba" + integrity sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw== dependencies: JSONStream "^1.0.3" - combine-source-map "~0.7.1" - concat-stream "~1.5.1" + acorn-node "^1.5.2" + combine-source-map "^0.8.0" + concat-stream "^1.6.1" is-buffer "^1.1.0" - lexical-scope "^1.2.0" + path-is-absolute "^1.0.1" process "~0.11.0" through2 "^2.0.0" + undeclared-identifiers "^1.1.2" xtend "^4.0.0" interpret@^1.0.0, interpret@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" + version "1.2.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" + integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" invert-kv@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= invert-kv@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== ip@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" + integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= is-absolute@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-absolute/-/is-absolute-1.0.0.tgz#395e1ae84b11f26ad1795e73c17378e48a301576" + integrity sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA== dependencies: is-relative "^1.0.0" is-windows "^1.0.1" @@ -5277,28 +5827,33 @@ is-absolute@^1.0.0: is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= dependencies: binary-extensions "^1.0.0" is-buffer@^1.1.0, is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== is-callable@^1.1.4: version "1.1.4" @@ -5306,36 +5861,42 @@ is-callable@^1.1.4: integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== is-ci@^1.0.10: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" + integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== dependencies: - ci-info "^1.0.0" + ci-info "^1.5.0" is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== dependencies: ci-info "^2.0.0" is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" is-date-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -5344,6 +5905,7 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -5352,136 +5914,166 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= is-dotfile@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= is-equal-shallow@^0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= dependencies: is-primitive "^2.0.0" is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + integrity sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-fullwidth-code-point@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-generator-fn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.0.0.tgz#038c31b774709641bda678b1f06a4e3227c10b3e" + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== is-glob@^2.0.0, is-glob@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= dependencies: is-extglob "^1.0.0" is-glob@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= dependencies: is-extglob "^2.1.0" is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" is-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" + integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= is-negated-glob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-negated-glob/-/is-negated-glob-1.0.0.tgz#6910bca5da8c95e784b5751b976cf5a10fee36d2" + integrity sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI= is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= dependencies: kind-of "^3.0.2" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-number@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-obj@^1.0.0, is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== dependencies: symbol-observable "^1.1.0" -is-odd@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-2.0.0.tgz#7646624671fd7ea558ccd9a2795182f2958f1b24" - dependencies: - is-number "^4.0.0" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" +is-path-cwd@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" + integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" +is-path-in-cwd@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" + integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== dependencies: - is-path-inside "^1.0.0" + is-path-inside "^2.1.0" -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" +is-path-inside@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" + integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== dependencies: - path-is-inside "^1.0.1" + path-is-inside "^1.0.2" is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" @@ -5495,28 +6087,34 @@ is-plain-object@^3.0.0: is-posix-bracket@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= dependencies: has "^1.0.1" is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= is-relative@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-relative/-/is-relative-1.0.0.tgz#a1bb6935ce8c5dba1e8b9754b9b2dcc020e2260d" + integrity sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA== dependencies: is-unc-path "^1.0.0" @@ -5530,6 +6128,12 @@ is-ssh@^1.3.0: is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== is-symbol@^1.0.2: version "1.0.2" @@ -5538,55 +6142,71 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" -is-text-path@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" +is-text-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" + integrity sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw== dependencies: - text-extensions "^1.0.0" + text-extensions "^2.0.0" is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= is-unc-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-unc-path/-/is-unc-path-1.0.0.tgz#d731e8898ed090a12c352ad2eaed5095ad322c9d" + integrity sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ== dependencies: unc-path-regex "^0.1.2" is-utf8@^0.2.0, is-utf8@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + integrity sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI= is-valid-glob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" + integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= -isarray@0.0.1, isarray@~0.0.1: +isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + integrity sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8= isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= isobject@^4.0.0: version "4.0.0" @@ -5596,47 +6216,52 @@ isobject@^4.0.0: isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#0b891e5ad42312c2b9488554f603795f9a2211ba" +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== -istanbul-lib-instrument@^3.0.0, istanbul-lib-instrument@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz#a2b5484a7d445f1f311e93190813fa56dfb62971" - dependencies: - "@babel/generator" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/template" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - istanbul-lib-coverage "^2.0.3" - semver "^5.5.0" +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" istanbul-lib-report@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz#bfd324ee0c04f59119cb4f07dab157d09f24d7e4" + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== dependencies: - istanbul-lib-coverage "^2.0.3" - make-dir "^1.3.0" - supports-color "^6.0.0" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" istanbul-lib-source-maps@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz#f1e817229a9146e8424a28e5d69ba220fda34156" + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== dependencies: debug "^4.1.1" - istanbul-lib-coverage "^2.0.3" - make-dir "^1.3.0" - rimraf "^2.6.2" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" source-map "^0.6.1" istanbul-reports@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.1.1.tgz#72ef16b4ecb9a4a7bd0e2001e00f95d1eec8afa9" - integrity sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw== + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== dependencies: - handlebars "^4.1.0" + handlebars "^4.1.2" jest-changed-files@^24.8.0: version "24.8.0" @@ -5746,9 +6371,9 @@ jest-get-type@^24.8.0: integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== jest-haste-map@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" - integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== + version "24.8.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" + integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g== dependencies: "@jest/types" "^24.8.0" anymatch "^2.0.0" @@ -5991,18 +6616,16 @@ jest@^24.8.0: jest-cli "^24.8.0" js-levenshtein@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.3.tgz#3ef627df48ec8cf24bacf05c0f184ff30ef413c5" - -js-tokens@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.2.1: +js-yaml@^3.13.1, js-yaml@^3.2.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -6013,109 +6636,127 @@ js-yaml@^3.13.0, js-yaml@^3.13.1, js-yaml@^3.2.1: jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= jsdom@^11.5.1: - version "11.6.2" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb" + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== dependencies: - abab "^1.0.4" - acorn "^5.3.0" + abab "^2.0.0" + acorn "^5.5.3" acorn-globals "^4.1.0" array-equal "^1.0.0" - browser-process-hrtime "^0.1.2" - content-type-parser "^1.0.2" cssom ">= 0.3.2 < 0.4.0" - cssstyle ">= 0.2.37 < 0.3.0" - domexception "^1.0.0" - escodegen "^1.9.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" html-encoding-sniffer "^1.0.2" - left-pad "^1.2.0" - nwmatcher "^1.4.3" + left-pad "^1.3.0" + nwsapi "^2.0.7" parse5 "4.0.0" pn "^1.1.0" - request "^2.83.0" + request "^2.87.0" request-promise-native "^1.0.5" sax "^1.2.4" symbol-tree "^3.2.2" - tough-cookie "^2.3.3" + tough-cookie "^2.3.4" w3c-hr-time "^1.0.1" webidl-conversions "^4.0.2" whatwg-encoding "^1.0.3" - whatwg-url "^6.4.0" - ws "^4.0.0" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" xml-name-validator "^3.0.0" jsesc@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= json-loader@^0.5.4: version "0.5.7" resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" + integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - -json-stable-stringify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json-stable-stringify@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" + integrity sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U= dependencies: jsonify "~0.0.0" json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^0.5.0, json5@^0.5.1: +json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" json5@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== dependencies: minimist "^1.2.0" jsonfile@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= optionalDependencies: graceful-fs "^4.1.6" jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM= jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" + integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= dependencies: assert-plus "1.0.0" extsprintf "1.3.0" @@ -6125,56 +6766,66 @@ jsprim@^1.2.2: just-debounce@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" + integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= kew@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" + integrity sha1-edk9LTM2PW/dKXCzNdkUGtWR15s= kind-of@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-1.1.0.tgz#140a3d2d41a36d2efcfa9377b62c24f8495a5c44" + integrity sha1-FAo9LUGjbS78+pN3tiwk+ElaXEQ= -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.1.0, kind-of@^3.2.0: +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0, kind-of@^5.0.2: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== klaw@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/klaw/-/klaw-2.1.1.tgz#42b76894701169cc910fd0d19ce677b5fb378af1" + integrity sha1-QrdolHARacyRD9DRnOZ3tfs3ivE= dependencies: graceful-fs "^4.1.9" -kleur@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.1.tgz#4f5b313f5fa315432a400f19a24db78d451ede62" +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== labeled-stream-splicer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" + version "2.0.2" + resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz#42a41a16abcd46fd046306cf4f2c3576fffb1c21" + integrity sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw== dependencies: inherits "^2.0.1" - isarray "~0.0.1" stream-splicer "^2.0.0" last-run@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= dependencies: default-resolution "^2.0.0" es6-weak-map "^2.0.1" @@ -6182,44 +6833,45 @@ last-run@^1.1.0: lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -lazy-cache@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-2.0.2.tgz#b9190a4f913354694840859f8a8f7084d8822264" - dependencies: - set-getter "^0.1.0" + integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" + integrity sha1-9plf4PggOS9hOWvolGJAe7dxaOQ= dependencies: readable-stream "^2.0.5" lcid@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + integrity sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU= dependencies: invert-kv "^1.0.0" lcid@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== dependencies: invert-kv "^2.0.0" lead@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" + integrity sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI= dependencies: flush-write-stream "^1.0.2" -left-pad@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== lerna-changelog@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/lerna-changelog/-/lerna-changelog-0.5.0.tgz#1617a8193a1309451ffa1e686b425faf0424b3f8" + integrity sha512-+HFe8T3Q35Fwn2+fTRBvi0EdbKXrsGOozkuWBhq33DTJLBAqAFZ7m1LtKqF8LLuP0asZ0W9L+tGCAhoAt1+J1w== dependencies: chalk "^1.1.3" mkdirp "^0.5.1" @@ -6255,20 +6907,16 @@ lerna@^3.14.2: leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" -lexical-scope@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" - dependencies: - astw "^2.0.0" - liftoff@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-3.1.0.tgz#c9ba6081f908670607ee79062d700df062c52ed3" @@ -6283,44 +6931,39 @@ liftoff@^3.1.0: rechoir "^0.6.2" resolve "^1.1.7" -lint-staged@^8.1.7: - version "8.1.7" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-8.1.7.tgz#a8988bc83bdffa97d04adb09dbc0b1f3a58fa6fc" - integrity sha512-egT0goFhIFoOGk6rasPngTFh2qDqxZddM0PwI58oi66RxCDcn5uDwxmiasWIF0qGnchHSYVJ8HPRD5LrFo7TKA== +lines-and-columns@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" + integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + +lint-staged@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.2.0.tgz#155e5723dffdaa55d252c47bab05a2962c1e9781" + integrity sha512-K/CQWcxYunc8lGMNTFvtI4+ybJcHW3K4Ghudz2OrJhIWdW/i1WWu9rGiVj4yJ0+D/xh8a08kp5slt89VZC9Eqg== dependencies: - chalk "^2.3.1" - commander "^2.14.1" - cosmiconfig "^5.2.0" - debug "^3.1.0" + chalk "^2.4.2" + commander "^2.20.0" + cosmiconfig "^5.2.1" + debug "^4.1.1" dedent "^0.7.0" - del "^3.0.0" - execa "^1.0.0" - find-parent-dir "^0.3.0" - g-status "^2.0.2" - is-glob "^4.0.0" - is-windows "^1.0.2" - listr "^0.14.2" - listr-update-renderer "^0.5.0" - lodash "^4.17.11" - log-symbols "^2.2.0" - micromatch "^3.1.8" - npm-which "^3.0.1" - p-map "^1.1.1" - path-is-inside "^1.0.2" - pify "^3.0.0" - please-upgrade-node "^3.0.2" - staged-git-files "1.1.2" - string-argv "^0.0.2" - stringify-object "^3.2.2" - yup "^0.27.0" + del "^4.1.1" + execa "^2.0.1" + listr "^0.14.3" + log-symbols "^3.0.0" + micromatch "^4.0.2" + please-upgrade-node "^3.1.1" + string-argv "^0.3.0" + stringify-object "^3.3.0" listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= listr-update-renderer@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" + integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -6334,15 +6977,17 @@ listr-update-renderer@^0.5.0: listr-verbose-renderer@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" + integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== dependencies: chalk "^2.4.1" cli-cursor "^2.1.0" date-fns "^1.27.2" figures "^2.0.0" -listr@^0.14.2: +listr@^0.14.3: version "0.14.3" resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" + integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== dependencies: "@samverschueren/stream-to-observable" "^0.3.0" is-observable "^1.1.0" @@ -6357,6 +7002,7 @@ listr@^0.14.2: load-json-file@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + integrity sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -6367,6 +7013,7 @@ load-json-file@^1.0.0: load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -6376,6 +7023,7 @@ load-json-file@^2.0.0: load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= dependencies: graceful-fs "^4.1.2" parse-json "^4.0.0" @@ -6383,20 +7031,23 @@ load-json-file@^4.0.0: strip-bom "^3.0.0" loader-runner@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2" + version "2.4.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" + integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== loader-utils@^1.0.2, loader-utils@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd" + version "1.2.3" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" + integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== dependencies: - big.js "^3.1.3" + big.js "^5.2.2" emojis-list "^2.0.0" - json5 "^0.5.0" + json5 "^1.0.1" locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -6404,10 +7055,18 @@ locate-path@^2.0.0: locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" path-exists "^3.0.0" +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + lodash._reinterpolate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" @@ -6416,10 +7075,12 @@ lodash._reinterpolate@^3.0.0: lodash.clone@^4.3.2: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" + integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= lodash.get@^4.4.2: version "4.4.2" @@ -6434,6 +7095,7 @@ lodash.ismatch@^4.4.0: lodash.memoize@~3.0.3: version "3.0.4" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" + integrity sha1-LcvSwofLwKVcxCMovQxzYVDVPj8= lodash.set@^4.3.2: version "4.3.2" @@ -6443,10 +7105,12 @@ lodash.set@^4.3.2: lodash.some@^4.2.2: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" + integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= lodash.template@^4.0.2: version "4.5.0" @@ -6468,26 +7132,29 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1: - version "4.17.13" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.13.tgz#0bdc3a6adc873d2f4e0c4bac285df91b64fc7b93" - integrity sha512-vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA== +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= dependencies: chalk "^1.0.0" -log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" +log-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" + integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ== dependencies: - chalk "^2.0.1" + chalk "^2.4.2" log-update@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= dependencies: ansi-escapes "^3.0.0" cli-cursor "^2.0.0" @@ -6496,16 +7163,19 @@ log-update@^2.3.0: longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: - js-tokens "^3.0.0" + js-tokens "^3.0.0 || ^4.0.0" loud-rejection@^1.0.0: version "1.6.0" resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + integrity sha1-W0b4AUft7leIcPCG0Eghz5mOVR8= dependencies: currently-unhandled "^0.4.1" signal-exit "^3.0.0" @@ -6513,8 +7183,9 @@ loud-rejection@^1.0.0: lower-case@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" + integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= -lru-cache@^4.0.1, lru-cache@^4.1.2, lru-cache@^4.1.3: +lru-cache@^4.0.1: version "4.1.5" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== @@ -6530,44 +7201,55 @@ lru-cache@^5.1.1: yallist "^3.0.2" macos-release@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.2.0.tgz#ab58d55dd4714f0a05ad4b0e90f4370fef5cdea8" - integrity sha512-iV2IDxZaX8dIcM7fG6cI46uNmHUxHE4yN+Z8tKHAW1TBPMZDIKHf/3L+YnOuj/FK9il14UaVdHmiQ1tsi90ltA== + version "2.3.0" + resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" + integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== magic-string@^0.25.2: - version "0.25.2" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.2.tgz#139c3a729515ec55e96e69e82a11fe890a293ad9" - integrity sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg== + version "0.25.3" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" + integrity sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA== dependencies: sourcemap-codec "^1.4.4" -make-dir@^1.0.0, make-dir@^1.3.0: +make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" integrity sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ== dependencies: pify "^3.0.0" +make-dir@^2.0.0, make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + make-error-cause@^1.1.1: version "1.2.2" resolved "https://registry.yarnpkg.com/make-error-cause/-/make-error-cause-1.2.2.tgz#df0388fcd0b37816dff0a5fb8108939777dcbc9d" + integrity sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0= dependencies: make-error "^1.2.0" make-error@^1.2.0: - version "1.3.4" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" + version "1.3.5" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" + integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== -make-fetch-happen@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.1.tgz#141497cb878f243ba93136c83d8aba12c216c083" +make-fetch-happen@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.2.tgz#2d156b11696fb32bffbafe1ac1bc085dd6c78a79" + integrity sha512-YMJrAjHSb/BordlsDEcVcPyTbiJKkzqMf48N8dAJZT9Zjctrkb6Yg4TY9Sq2AwSIQJFn5qBBKVTYt3vP5FMIHA== dependencies: agentkeepalive "^3.4.1" - cacache "^11.0.1" + cacache "^11.3.3" http-cache-semantics "^3.8.1" http-proxy-agent "^2.1.0" https-proxy-agent "^2.2.1" - lru-cache "^4.1.2" + lru-cache "^5.1.1" mississippi "^3.0.0" node-fetch-npm "^2.0.2" promise-retry "^1.1.1" @@ -6575,80 +7257,92 @@ make-fetch-happen@^4.0.1: ssri "^6.0.0" make-iterator@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.0.tgz#57bef5dc85d23923ba23767324d8e8f8f3d9694b" + version "1.0.1" + resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" + integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== dependencies: - kind-of "^3.1.0" + kind-of "^6.0.2" makeerror@1.0.x: version "1.0.11" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= dependencies: tmpl "1.0.x" map-age-cleaner@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== dependencies: p-defer "^1.0.0" map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-obj@^1.0.0, map-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + integrity sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0= map-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" + integrity sha1-plzSkIepJZi4eRJXpSPgISIqwfk= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" matchdep@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" + integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= dependencies: findup-sync "^2.0.0" micromatch "^3.0.4" resolve "^1.4.0" stack-trace "0.0.10" -matcher@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/matcher/-/matcher-1.1.1.tgz#51d8301e138f840982b338b116bb0c09af62c1c2" - dependencies: - escape-string-regexp "^1.0.4" +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== md5.js@^1.3.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" + version "1.3.5" + resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" inherits "^2.0.1" + safe-buffer "^5.1.2" mem@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= dependencies: mimic-fn "^1.0.0" mem@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.0.0.tgz#6437690d9471678f6cc83659c00cbafcd6b0cdaf" + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== dependencies: map-age-cleaner "^0.1.1" - mimic-fn "^1.0.0" - p-is-promise "^1.1.0" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" + integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= dependencies: errno "^0.1.3" readable-stream "^2.0.1" @@ -6656,6 +7350,7 @@ memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= dependencies: camelcase-keys "^2.0.0" decamelize "^1.1.2" @@ -6669,8 +7364,9 @@ meow@^3.3.0: trim-newlines "^1.0.0" meow@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.0.tgz#fd5855dd008db5b92c552082db1c307cba20b29d" + version "4.0.1" + resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.1.tgz#d48598f6f4b1472f35bf6317a95945ace347f975" + integrity sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A== dependencies: camelcase-keys "^4.0.0" decamelize-keys "^1.0.0" @@ -6685,16 +7381,24 @@ meow@^4.0.0: merge-stream@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= dependencies: readable-stream "^2.0.1" +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + merge2@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= dependencies: arr-diff "^2.0.0" array-unique "^0.2.1" @@ -6710,7 +7414,7 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -6729,74 +7433,103 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" + integrity sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA== dependencies: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@~1.38.0: - version "1.38.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" - integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== +mime-db@1.40.0: + version "1.40.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" + integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.22" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" - integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + version "2.1.24" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" + integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== dependencies: - mime-db "~1.38.0" + mime-db "1.40.0" mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -minimalistic-assert@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" +mimic-fn@^2.0.0, mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= minimatch@^3.0.0, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist-options@^3.0.1: version "3.0.2" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" + integrity sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ== dependencies: arrify "^1.0.1" is-plain-obj "^1.1.0" -minimist@0.0.8, minimist@~0.0.1: +minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.4, minipass@^2.3.5: +minipass@^2.2.1, minipass@^2.3.5: version "2.3.5" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" -minizlib@^1.1.1: +minizlib@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== dependencies: minipass "^2.2.1" mississippi@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-3.0.0.tgz#ea0a3291f97e0b5e8776b363d5f0a12d94c67022" + integrity sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA== dependencies: concat-stream "^1.5.0" duplexify "^3.4.2" @@ -6810,8 +7543,9 @@ mississippi@^3.0.0: through2 "^2.0.0" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -6819,20 +7553,23 @@ mixin-deep@^1.2.0: mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" modify-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" + version "1.0.1" + resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022" + integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== module-deps@^6.0.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.1.0.tgz#d1e1efc481c6886269f7112c52c3236188e16479" + version "6.2.1" + resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-6.2.1.tgz#cfe558784060e926824f474b4e647287837cda50" + integrity sha512-UnEn6Ah36Tu4jFiBbJVUtt0h+iXqxpLqDvPS8nllbw5RZFmNJ1+Mz5BjYnM9ieH80zyxHkARGLnMIHlPK5bu6A== dependencies: JSONStream "^1.0.3" browser-resolve "^1.7.0" - cached-path-relative "^1.0.0" + cached-path-relative "^1.0.2" concat-stream "~1.6.0" defined "^1.0.0" detective "^5.0.2" @@ -6849,6 +7586,7 @@ module-deps@^6.0.0: move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" + integrity sha1-viwAX9oy4LKa8fBdfEszIUxwH5I= dependencies: aproba "^1.1.1" copy-concurrently "^1.0.0" @@ -6860,14 +7598,17 @@ move-concurrently@^1.0.1: ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= ms@^2.0.0, ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== multimatch@^2.0.0, multimatch@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" + integrity sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis= dependencies: array-differ "^1.0.0" array-union "^1.0.1" @@ -6875,28 +7616,35 @@ multimatch@^2.0.0, multimatch@^2.1.0: minimatch "^3.0.0" mute-stdout@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.0.tgz#5b32ea07eb43c9ded6130434cf926f46b2a7fd4d" + version "1.0.1" + resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" + integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== -mute-stream@0.0.7, mute-stream@~0.0.4: +mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +mute-stream@~0.0.4: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== nan@^2.12.1: - version "2.13.2" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" - integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== + version "2.14.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" + integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== nanomatch@^1.2.9: - version "1.2.9" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" define-property "^2.0.2" extend-shallow "^3.0.2" fragment-cache "^0.2.1" - is-odd "^2.0.0" is-windows "^1.0.2" kind-of "^6.0.2" object.pick "^1.3.0" @@ -6907,38 +7655,43 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -ncname@1.0.x: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" - dependencies: - xml-char-classes "^1.0.0" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= needle@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + version "2.4.0" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.4.0.tgz#6833e74975c444642590e15a750288c5f939b57c" + integrity sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg== dependencies: - debug "^2.1.2" + debug "^3.2.6" iconv-lite "^0.4.4" sax "^1.2.4" -neo-async@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f" +neo-async@^2.5.0, neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + +next-tick@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= nice-try@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== no-case@^2.2.0: version "2.3.2" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" + integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== dependencies: lower-case "^1.1.1" node-fetch-npm@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" + integrity sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw== dependencies: encoding "^0.1.11" json-parse-better-errors "^1.0.0" @@ -6947,6 +7700,7 @@ node-fetch-npm@^2.0.2: node-fetch@^1.7.0: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== dependencies: encoding "^0.1.11" is-stream "^1.0.1" @@ -6976,10 +7730,12 @@ node-gyp@^4.0.0: node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= node-libs-browser@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.1.0.tgz#5f94263d404f6e44767d726901fff05478d600df" + version "2.2.1" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" + integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== dependencies: assert "^1.1.1" browserify-zlib "^0.2.0" @@ -6988,10 +7744,10 @@ node-libs-browser@^2.0.0: constants-browserify "^1.0.0" crypto-browserify "^3.11.0" domain-browser "^1.1.1" - events "^1.0.0" + events "^3.0.0" https-browserify "^1.0.0" os-browserify "^0.3.0" - path-browserify "0.0.0" + path-browserify "0.0.1" process "^0.11.10" punycode "^1.2.4" querystring-es3 "^0.2.0" @@ -7002,19 +7758,22 @@ node-libs-browser@^2.0.0: timers-browserify "^2.0.4" tty-browserify "0.0.0" url "^0.11.0" - util "^0.10.3" - vm-browserify "0.0.4" + util "^0.11.0" + vm-browserify "^1.0.1" node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= node-notifier@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== dependencies: growly "^1.3.0" - semver "^5.4.1" + is-wsl "^1.1.0" + semver "^5.5.0" shellwords "^0.1.1" which "^1.3.0" @@ -7034,22 +7793,24 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.19: - version "1.1.19" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.19.tgz#c492d1e381fea0350b338b646c27867e88e91b3d" - integrity sha512-SH/B4WwovHbulIALsQllAVwqZZD1kPmKCqrhGfR29dXjLAVZMHvBjD3S6nL9D/J9QkmZ1R92/0wCMDKXUUvyyA== +node-releases@^1.1.25: + version "1.1.25" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" + integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== dependencies: semver "^5.3.0" "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= dependencies: abbrev "1" osenv "^0.1.4" @@ -7067,6 +7828,7 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package- normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= dependencies: remove-trailing-separator "^1.0.1" @@ -7081,14 +7843,16 @@ normalize-url@^3.3.0: integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== now-and-later@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.0.tgz#bc61cbb456d79cb32207ce47ca05136ff2e7d6ee" + version "2.0.1" + resolved "https://registry.yarnpkg.com/now-and-later/-/now-and-later-2.0.1.tgz#8e579c8685764a7cc02cb680380e94f43ccb1f7c" + integrity sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ== dependencies: once "^1.3.2" npm-bundled@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== npm-lifecycle@^2.1.1: version "2.1.1" @@ -7107,29 +7871,25 @@ npm-lifecycle@^2.1.1: "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" + integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== dependencies: hosted-git-info "^2.6.0" osenv "^0.1.5" semver "^5.5.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.12, npm-packlist@^1.1.6, npm-packlist@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" - integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== +npm-packlist@^1.1.6, npm-packlist@^1.4.1, npm-packlist@^1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" + integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" -npm-path@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" - dependencies: - which "^1.2.10" - npm-pick-manifest@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz#32111d2a9562638bb2c8f2bf27f7f3092c8fae40" + integrity sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA== dependencies: figgy-pudding "^3.5.1" npm-package-arg "^6.0.0" @@ -7138,20 +7898,21 @@ npm-pick-manifest@^2.2.3: npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" -npm-which@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" +npm-run-path@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-3.1.0.tgz#7f91be317f6a466efed3c9f2980ad8a4ee8b0fa5" + integrity sha512-Dbl4A/VfiVGLgQv29URL9xshU8XDY1GeLy+fsaZ1AA8JDSfjvr5P5+pzRbWqRSBxk6/DW7MIh8lTM/PaGnP2kg== dependencies: - commander "^2.9.0" - npm-path "^2.0.2" - which "^1.2.10" + path-key "^3.0.0" "npmlog@0 || 1 || 2 || 3 || 4", npmlog@^4.0.2, npmlog@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== dependencies: are-we-there-yet "~1.1.2" console-control-strings "~1.1.0" @@ -7159,36 +7920,42 @@ npm-which@^3.0.1: set-blocking "~2.0.0" nth-check@~1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== dependencies: boolbase "~1.0.0" number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -nwmatcher@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" +nwsapi@^2.0.7: + version "2.1.4" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" + integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.0.8: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -7196,12 +7963,14 @@ object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.0.8 object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" -object.assign@^4.0.4: +object.assign@^4.0.4, object.assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== dependencies: define-properties "^1.1.2" function-bind "^1.1.1" @@ -7211,6 +7980,7 @@ object.assign@^4.0.4: object.defaults@^1.0.0, object.defaults@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" + integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= dependencies: array-each "^1.0.1" array-slice "^1.0.0" @@ -7220,6 +7990,7 @@ object.defaults@^1.0.0, object.defaults@^1.1.0: object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= dependencies: define-properties "^1.1.2" es-abstract "^1.5.1" @@ -7227,6 +7998,7 @@ object.getownpropertydescriptors@^2.0.3: object.map@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" + integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= dependencies: for-own "^1.0.0" make-iterator "^1.0.0" @@ -7234,6 +8006,7 @@ object.map@^1.0.0: object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= dependencies: for-own "^0.1.4" is-extendable "^0.1.1" @@ -7241,12 +8014,14 @@ object.omit@^2.0.0: object.pick@^1.2.0, object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" object.reduce@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= dependencies: for-own "^1.0.0" make-iterator "^1.0.0" @@ -7259,18 +8034,33 @@ octokit-pagination-methods@^1.1.0: once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" +onetime@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5" + integrity sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q== + dependencies: + mimic-fn "^2.1.0" + +opencollective-postinstall@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz#5657f1bede69b6e33a45939b061eb53d3c6c3a89" + integrity sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw== + optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= dependencies: minimist "~0.0.1" wordwrap "~0.0.2" @@ -7278,6 +8068,7 @@ optimist@^0.6.1: optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -7289,36 +8080,42 @@ optionator@^0.8.1, optionator@^0.8.2: ordered-read-streams@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz#77c0cb37c41525d64166d990ffad7ec6a0e1363e" + integrity sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4= dependencies: readable-stream "^2.0.1" os-browserify@^0.3.0, os-browserify@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" + integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= os-locale@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= dependencies: lcid "^1.0.0" os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== dependencies: execa "^0.7.0" lcid "^1.0.0" mem "^1.1.0" os-locale@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.0.1.tgz#3b014fbf01d87f60a1e5348d80fe870dc82c4620" + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== dependencies: - execa "^0.10.0" + execa "^1.0.0" lcid "^2.0.0" mem "^4.0.0" @@ -7333,10 +8130,12 @@ os-name@^3.0.0: os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= osenv@0, osenv@^0.1.4, osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" @@ -7344,6 +8143,7 @@ osenv@0, osenv@^0.1.4, osenv@^0.1.5: output-file-sync@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.1.tgz#f53118282f5f553c2799541792b723a4c71430c0" + integrity sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ== dependencies: graceful-fs "^4.1.11" is-plain-obj "^1.1.0" @@ -7352,62 +8152,86 @@ output-file-sync@^2.0.0: p-defer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= p-each-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= dependencies: p-reduce "^1.0.0" p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= -p-is-promise@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-1.1.0.tgz#9c9456989e9f6588017b0434d56097675c3da05e" +p-finally@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" + integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== p-limit@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" -p-limit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" +p-limit@^2.0.0, p-limit@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== dependencies: p-try "^2.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-map-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-map-series/-/p-map-series-1.0.0.tgz#bf98fe575705658a9e1351befb85ae4c1f07bdca" + integrity sha1-v5j+V1cFZYqeE1G++4WuTB8Hvco= dependencies: p-reduce "^1.0.0" p-map@^1.1.1, p-map@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== p-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.0.0.tgz#be18c5a5adeb8e156460651421aceca56c213a50" + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== p-pipe@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" + integrity sha1-SxoROZoRUgpneQ7loMHViB1r7+k= p-queue@^4.0.0: version "4.0.0" @@ -7419,28 +8243,34 @@ p-queue@^4.0.0: p-reduce@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== p-waterfall@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-waterfall/-/p-waterfall-1.0.0.tgz#7ed94b3ceb3332782353af6aae11aa9fc235bb00" + integrity sha1-ftlLPOszMngjU69qrhGqn8I1uwA= dependencies: p-reduce "^1.0.0" pako@~1.0.5: - version "1.0.6" - resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" + version "1.0.10" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.10.tgz#4328badb5086a426aa90f541977d4955da5c9732" + integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== parallel-transform@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" + integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= dependencies: cyclist "~0.2.2" inherits "^2.0.3" @@ -7449,34 +8279,40 @@ parallel-transform@^1.1.0: param-case@2.1.x: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" + integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= dependencies: no-case "^2.2.0" parent-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== dependencies: callsites "^3.0.0" parents@^1.0.0, parents@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" + integrity sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E= dependencies: path-platform "~0.11.15" parse-asn1@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" + version "5.1.4" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" + integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" create-hash "^1.1.0" evp_bytestokey "^1.0.0" pbkdf2 "^3.0.3" + safe-buffer "^5.1.1" parse-filepath@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/parse-filepath/-/parse-filepath-1.0.2.tgz#a632127f53aaf3d15876f5872f3ffac763d6c891" + integrity sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE= dependencies: is-absolute "^1.0.0" map-cache "^0.2.0" @@ -7485,10 +8321,12 @@ parse-filepath@^1.0.1: parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" + integrity sha1-nn2LslKmy2ukJZUGC3v23z28H1A= parse-glob@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= dependencies: glob-base "^0.3.0" is-dotfile "^1.0.0" @@ -7498,23 +8336,37 @@ parse-glob@^3.0.4: parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse-json@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.0.0.tgz#73e5114c986d143efa3712d4ea24db9a4266f60f" + integrity sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw== dependencies: + "@babel/code-frame" "^7.0.0" error-ex "^1.3.1" json-parse-better-errors "^1.0.1" + lines-and-columns "^1.1.6" parse-node-version@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY= parse-path@^4.0.0: version "4.0.1" @@ -7537,68 +8389,93 @@ parse-url@^5.0.0: parse5@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== parse5@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== dependencies: "@types/node" "*" pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-browserify@0.0.0, path-browserify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" +path-browserify@0.0.1, path-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" + integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= dependencies: pinkie-promise "^2.0.0" path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-key@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" + integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-platform@~0.11.15: version "0.11.15" resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" + integrity sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I= path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" + integrity sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0= path-root@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/path-root/-/path-root-0.1.1.tgz#9a4a6814cac1c0cd73360a95f32083c8ea4745b7" + integrity sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc= dependencies: path-root-regex "^0.1.0" path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + integrity sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE= dependencies: graceful-fs "^4.1.2" pify "^2.0.0" @@ -7607,18 +8484,21 @@ path-type@^1.0.0: path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= dependencies: pify "^2.0.0" path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== dependencies: pify "^3.0.0" pbkdf2@^3.0.3: - version "3.0.14" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" + version "3.0.17" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" + integrity sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA== dependencies: create-hash "^1.1.2" create-hmac "^1.1.4" @@ -7629,14 +8509,22 @@ pbkdf2@^3.0.3: performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +picomatch@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" + integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= pify@^4.0.1: version "4.0.1" @@ -7646,12 +8534,14 @@ pify@^4.0.1: pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= dependencies: pinkie "^2.0.0" pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= pirates@^4.0.0, pirates@^4.0.1: version "4.0.1" @@ -7663,31 +8553,35 @@ pirates@^4.0.0, pirates@^4.0.1: pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= dependencies: find-up "^2.1.0" pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: find-up "^3.0.0" -pkg-dir@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.1.0.tgz#aaeb91c0d3b9c4f74a44ad849f4de34781ae01de" - integrity sha512-55k9QN4saZ8q518lE6EFgYiu95u3BWkSajCifhdQjvLvmr8IpnRbhI+UGpWJQfa0KzDguHeeWT1ccO1PmkOi3A== +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== dependencies: - find-up "^3.0.0" + find-up "^4.0.0" -please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: +please-upgrade-node@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== dependencies: semver-compare "^1.0.0" plugin-error@1.0.1, plugin-error@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" + integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== dependencies: ansi-colors "^1.0.1" arr-diff "^4.0.0" @@ -7697,6 +8591,7 @@ plugin-error@1.0.1, plugin-error@^1.0.1: plugin-error@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-0.1.2.tgz#3b9bb3335ccf00f425e07437e19276967da47ace" + integrity sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= dependencies: ansi-cyan "^0.1.1" ansi-red "^0.1.1" @@ -7707,29 +8602,34 @@ plugin-error@^0.1.2: pn@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== dependencies: fast-diff "^1.1.2" prettier@^1.17.1: - version "1.17.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.17.1.tgz#ed64b4e93e370cb8a25b9ef7fef3e4fd1c0995db" - integrity sha512-TzGRNvuUSmPgwivDqkZ9tM/qTGW9hqDKWOE9YHiyQdixlKbv7kvEqsmDPrcHJTKwthU774TQwZXVtaQ/mMsvjg== + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== pretty-format@^24.8.0: version "24.8.0" @@ -7744,63 +8644,65 @@ pretty-format@^24.8.0: pretty-hrtime@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" + integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= private@^0.1.6, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== -process-nextick-args@^1.0.6, process-nextick-args@^1.0.7, process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" +process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== process@^0.11.10, process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" + integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= progress@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" + integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= promise-retry@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d" + integrity sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0= dependencies: err-code "^1.0.0" retry "^0.10.0" prompts@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.0.1.tgz#201b3718b4276fb407f037db48c0029d6465245c" + version "2.1.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" + integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== dependencies: - kleur "^3.0.0" + kleur "^3.0.2" sisteransi "^1.0.0" promzard@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/promzard/-/promzard-0.3.0.tgz#26a5d6ee8c7dee4cb12208305acfb93ba382a9ee" + integrity sha1-JqXW7ox97kyxIggwWs+5O6OCqe4= dependencies: read "1" -property-expr@^1.5.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-1.5.1.tgz#22e8706894a0c8e28d58735804f6ba3a3673314f" - integrity sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g== - proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" + integrity sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk= protocols@^1.1.0, protocols@^1.4.0: version "1.4.7" @@ -7810,34 +8712,41 @@ protocols@^1.1.0, protocols@^1.4.0: protoduck@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/protoduck/-/protoduck-5.0.1.tgz#03c3659ca18007b69a50fd82a7ebcc516261151f" + integrity sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg== dependencies: genfun "^5.0.0" prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" + integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" +psl@^1.1.24, psl@^1.1.28: + version "1.2.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" + integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== public-encrypt@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + version "4.0.3" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" + integrity sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q== dependencies: bn.js "^4.1.0" browserify-rsa "^4.0.0" create-hash "^1.1.0" parse-asn1 "^5.0.0" randombytes "^2.0.1" + safe-buffer "^5.1.2" pump@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + integrity sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -7845,6 +8754,7 @@ pump@^2.0.0: pump@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== dependencies: end-of-stream "^1.1.0" once "^1.3.1" @@ -7852,6 +8762,7 @@ pump@^3.0.0: pumpify@^1.3.3, pumpify@^1.3.5: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" + integrity sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ== dependencies: duplexify "^3.6.0" inherits "^2.0.3" @@ -7860,51 +8771,63 @@ pumpify@^1.3.3, pumpify@^1.3.5: punycode@1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" + integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== querystring-es3@^0.2.0, querystring-es3@~0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= quick-lru@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" + integrity sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g= -randomatic@^1.1.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" randomfill@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" + integrity sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw== dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" @@ -7912,6 +8835,7 @@ randomfill@^1.0.3: rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== dependencies: deep-extend "^0.6.0" ini "~1.3.0" @@ -7919,25 +8843,28 @@ rc@^1.2.7: strip-json-comments "~2.0.1" react-is@^16.8.4: - version "16.8.4" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.4.tgz#90f336a68c3a29a096a3d648ab80e87ec61482a2" - integrity sha512-PVadd+WaUDOAciICm/J1waJaSvgq+4rHE/K70j0PFqKhkTBsPv/82UGQJNXAngz1fOQLLxI6z1sEDmJDQhCTAA== + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== read-cmd-shim@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" + integrity sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs= dependencies: graceful-fs "^4.1.2" read-only-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" + integrity sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A= dependencies: readable-stream "^2.0.2" "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: version "2.0.13" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" + integrity sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg== dependencies: glob "^7.1.1" json-parse-better-errors "^1.0.1" @@ -7947,18 +8874,18 @@ read-only-stream@^2.0.0: graceful-fs "^4.1.2" read-package-tree@^5.1.6: - version "5.2.1" - resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.2.1.tgz#6218b187d6fac82289ce4387bbbaf8eef536ad63" + version "5.3.1" + resolved "https://registry.yarnpkg.com/read-package-tree/-/read-package-tree-5.3.1.tgz#a32cb64c7f31eb8a6f31ef06f9cedf74068fe636" + integrity sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw== dependencies: - debuglog "^1.0.1" - dezalgo "^1.0.0" - once "^1.3.0" read-package-json "^2.0.0" readdir-scoped-modules "^1.0.0" + util-promisify "^2.1.0" read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + integrity sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI= dependencies: find-up "^1.0.0" read-pkg "^1.0.0" @@ -7966,6 +8893,7 @@ read-pkg-up@^1.0.1: read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= dependencies: find-up "^2.0.0" read-pkg "^2.0.0" @@ -7973,6 +8901,7 @@ read-pkg-up@^2.0.0: read-pkg-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07" + integrity sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc= dependencies: find-up "^2.0.0" read-pkg "^3.0.0" @@ -7980,6 +8909,7 @@ read-pkg-up@^3.0.0: read-pkg-up@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== dependencies: find-up "^3.0.0" read-pkg "^3.0.0" @@ -7987,6 +8917,7 @@ read-pkg-up@^4.0.0: read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + integrity sha1-9f+qXs0pyzHAR0vKfXVra7KePyg= dependencies: load-json-file "^1.0.0" normalize-package-data "^2.3.2" @@ -7995,6 +8926,7 @@ read-pkg@^1.0.0: read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" @@ -8003,30 +8935,33 @@ read-pkg@^2.0.0: read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= dependencies: load-json-file "^4.0.0" normalize-package-data "^2.3.2" path-type "^3.0.0" read-pkg@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.1.1.tgz#5cf234dde7a405c90c88a519ab73c467e9cb83f5" - integrity sha512-dFcTLQi6BZ+aFUaICg7er+/usEoqFdQxiEBsEMNGoipenihtxxtdrQuBXvyANCEI8VuUIVYFgeHGx9sLLvim4w== + version "5.2.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" + integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== dependencies: "@types/normalize-package-data" "^2.4.0" normalize-package-data "^2.5.0" - parse-json "^4.0.0" - type-fest "^0.4.1" + parse-json "^5.0.0" + type-fest "^0.6.0" read@1, read@~1.0.1: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", "readable-stream@2 || 3", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== dependencies: core-util-is "~1.0.0" inherits "~2.0.3" @@ -8036,29 +8971,29 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + "readable-stream@>=1.1.13-1 <1.2.0-0": version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= dependencies: core-util-is "~1.0.0" inherits "~2.0.1" isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@~2.0.0: - version "2.0.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.1" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - string_decoder "~0.10.x" - util-deprecate "~1.0.1" - readdir-scoped-modules@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz#9fafa37d286be5d92cbaebdee030dc9b5f406747" + version "1.1.0" + resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" + integrity sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw== dependencies: debuglog "^1.0.1" dezalgo "^1.0.0" @@ -8084,6 +9019,7 @@ realpath-native@^1.1.0: recast@~0.11.12: version "0.11.23" resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" + integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= dependencies: ast-types "0.9.6" esprima "~3.1.0" @@ -8093,12 +9029,14 @@ recast@~0.11.12: rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= dependencies: resolve "^1.1.6" redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + integrity sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94= dependencies: indent-string "^2.1.0" strip-indent "^1.0.1" @@ -8106,20 +9044,22 @@ redent@^1.0.0: redent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" + integrity sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo= dependencies: indent-string "^3.0.0" strip-indent "^2.0.0" regenerate-unicode-properties@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.0.2.tgz#7b38faa296252376d363558cfbda90c9ce709662" - integrity sha512-SbA/iNrBUf6Pv2zU8Ekv1Qbhv92yxL4hiDa2siuxs4KKn4oOoMDHXjAf7+Nz9qinUQ46B1LcWEi/PhJfPWpZWQ== + version "8.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" + integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== dependencies: regenerate "^1.4.0" regenerate@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.13.2: version "0.13.2" @@ -8136,24 +9076,27 @@ regenerator-transform@^0.14.0: regex-cache@^0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== dependencies: is-equal-shallow "^0.1.3" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" regexp-tree@^0.1.6: - version "0.1.10" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.10.tgz#d837816a039c7af8a8d64d7a7c3cf6a1d93450bc" - integrity sha512-K1qVSbcedffwuIslMwpe6vGlj+ZXRnGkvjAtFHfDZZZuEdA/h0dxljAPu9vhUo6Rrx2U2AwJ+nSQ6hK+lrP5MQ== + version "0.1.11" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" + integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^4.5.4: version "4.5.4" @@ -8170,20 +9113,24 @@ regexpu-core@^4.5.4: regjsgen@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== regjsparser@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== dependencies: jsesc "~0.5.0" relateurl@0.2.x: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= remove-bom-buffer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" + integrity sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ== dependencies: is-buffer "^1.1.5" is-utf8 "^0.2.1" @@ -8191,6 +9138,7 @@ remove-bom-buffer@^3.0.0: remove-bom-stream@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz#05f1a593f16e42e1fb90ebf59de8e569525f9523" + integrity sha1-BfGlk/FuQuH7kOv1nejlaVJflSM= dependencies: remove-bom-buffer "^3.0.0" safe-buffer "^5.1.0" @@ -8199,54 +9147,64 @@ remove-bom-stream@^1.2.0: remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= dependencies: is-finite "^1.0.0" replace-ext@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924" + integrity sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ= replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" + integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= replace-homedir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" + integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= dependencies: homedir-polyfill "^1.0.1" is-absolute "^1.0.0" remove-trailing-separator "^1.1.0" -request-promise-core@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.1.tgz#3eee00b2c5aa83239cfb04c5700da36f81cd08b6" +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== dependencies: - lodash "^4.13.1" + lodash "^4.17.11" request-promise-native@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== dependencies: - request-promise-core "1.1.1" - stealthy-require "^1.1.0" - tough-cookie ">=2.3.3" + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" -request@^2.83.0, request@^2.87.0: +request@^2.87.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== dependencies: aws-sign2 "~0.7.0" aws4 "^1.8.0" @@ -8272,20 +9230,29 @@ request@^2.83.0, request@^2.87.0: require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= require-main-filename@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= dependencies: resolve-from "^3.0.0" resolve-dir@^1.0.0, resolve-dir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= dependencies: expand-tilde "^2.0.0" global-modules "^1.0.0" @@ -8293,36 +9260,41 @@ resolve-dir@^1.0.0, resolve-dir@^1.0.1: resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-options@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" + integrity sha1-MrueOcBtZzONyTeMDW1gdFZq0TE= dependencies: value-or-function "^3.0.0" resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: - version "1.10.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.1.tgz#664842ac960795bbe758221cdccda61fb64b5f18" - integrity sha512-KuIe4mf++td/eFb6wkaPbMDnP6kObCaEtIDuHOUED6MNUo4K670KZUHuuvYPZDxNF0WVLw49n06M2m2dXphEzA== +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" @@ -8330,48 +9302,53 @@ restore-cursor@^2.0.0: ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== retry@^0.10.0: version "0.10.1" resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" + integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= dependencies: align-text "^0.1.1" -rimraf@2, rimraf@2.6.3, rimraf@^2.2.8, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" + version "2.0.2" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: - hash-base "^2.0.0" + hash-base "^3.0.0" inherits "^2.0.1" rollup-plugin-babel@^4.0.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.3.2.tgz#8c0e1bd7aa9826e90769cf76895007098ffd1413" - integrity sha512-KfnizE258L/4enADKX61ozfwGHoqYauvoofghFJBhFnpH9Sb9dNPpWg8QHOaAfVASUYV8w0mCx430i9z0LJoJg== + version "4.3.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.3.3.tgz#7eb5ac16d9b5831c3fd5d97e8df77ba25c72a2aa" + integrity sha512-tKzWOCmIJD/6aKNz0H1GMM+lW1q9KyFubbWzGiOG540zxPPifnEAHTZwjo0g991Y+DyOZcLqBgqOdqazYE5fkw== dependencies: "@babel/helper-module-imports" "^7.0.0" - rollup-pluginutils "^2.3.0" + rollup-pluginutils "^2.8.1" rollup-plugin-node-resolve@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.0.0.tgz#754abf4841ed4bab2241551cba0a11d04c57f290" - integrity sha512-JUFr7DkFps3div9DYwpSg0O+s8zuSSRASUZUVNx6h6zhw2m8vcpToeS68JDPsFbmisMVSMYK0IxftngCRv7M9Q== + version "5.2.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" + integrity sha512-jUlyaDXts7TW2CqQ4GaO5VJ4PwwaV8VUGA7+km3n6k6xtOEacf61u0VXwN80phY/evMcaS+9eIeJ9MOyDxt5Zw== dependencies: "@types/resolve" "0.0.8" builtin-modules "^3.1.0" is-module "^1.0.0" - resolve "^1.10.1" - rollup-pluginutils "^2.7.0" + resolve "^1.11.1" + rollup-pluginutils "^2.8.1" rollup-plugin-replace@^2.2.0: version "2.2.0" @@ -8381,72 +9358,83 @@ rollup-plugin-replace@^2.2.0: magic-string "^0.25.2" rollup-pluginutils "^2.6.0" -rollup-pluginutils@^2.3.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.7.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.7.1.tgz#a7915ce8b12c177364784bf38a1590cc6c2c8250" - integrity sha512-3nRf3buQGR9qz/IsSzhZAJyoK663kzseps8itkYHr+Z7ESuaffEPfgRinxbCRA0pf0gzLqkNKkSb8aNVTq75NA== +rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97" + integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== dependencies: - estree-walker "^0.6.0" - micromatch "^3.1.10" + estree-walker "^0.6.1" rollup@^1.12.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.12.0.tgz#3e07e7d178bf61fe12325660a037ae0041219d8c" - integrity sha512-DFqgTupu9dkoS80AZ4xMgeLCeC96pGRCu1MLlOwRAjJ3qGItw+j4YWcL3/uWbgQO2mnmrAZphxAdjSXYsG5pWA== + version "1.17.0" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.17.0.tgz#47ee8b04514544fc93b39bae06271244c8db7dfa" + integrity sha512-k/j1m0NIsI4SYgCJR4MWPstGJOWfJyd6gycKoMhyoKPVXxm+L49XtbUwZyFsrSU2YXsOkM4u1ll9CS/ZgJBUpw== dependencies: "@types/estree" "0.0.39" - "@types/node" "^12.0.2" - acorn "^6.1.1" + "@types/node" "^12.6.2" + acorn "^6.2.0" -rsvp@^3.3.3: - version "3.6.2" - resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" +rsvp@^4.8.4: + version "4.8.5" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734" + integrity sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA== run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= dependencies: is-promise "^2.1.0" run-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" + integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" + integrity sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec= dependencies: aproba "^1.1.1" rxjs@^6.3.3, rxjs@^6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" - integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" + integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" -"safer-buffer@>= 2.1.2 < 3": +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== sane@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/sane/-/sane-4.0.3.tgz#e878c3f19e25cc57fbb734602f48f8a97818b181" - integrity sha512-hSLkC+cPHiBQs7LSyXkotC3UUtyn8C4FMn50TNaacRyvBlI+3ebcxMpqckmTdtXVtel87YS7GXN3UIOj7NiGVQ== + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== dependencies: "@cnakazawa/watch" "^1.0.3" anymatch "^2.0.0" - capture-exit "^1.2.0" + capture-exit "^2.0.0" exec-sh "^0.3.2" execa "^1.0.0" fb-watchman "^2.0.0" @@ -8457,52 +9445,44 @@ sane@^4.0.3: sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= semver-greatest-satisfied-range@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" + integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -semver@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65" - integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ== +semver@^6.0.0, semver@^6.1.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= -set-getter@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/set-getter/-/set-getter-0.1.0.tgz#d769c182c9d5a51f409145f2fba82e5e86e80376" - dependencies: - to-object-path "^0.3.0" - -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" - -set-value@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -8512,10 +9492,12 @@ set-value@^2.0.0: setimmediate@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: - version "2.4.10" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b" + version "2.4.11" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" safe-buffer "^5.0.1" @@ -8523,6 +9505,7 @@ sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: shasum@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" + integrity sha1-5wEjENj0F/TetXEhUOVni4euVl8= dependencies: json-stable-stringify "~0.0.0" sha.js "~2.4.4" @@ -8530,16 +9513,19 @@ shasum@^1.0.0: shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= shell-quote@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" + integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= dependencies: array-filter "~0.0.0" array-map "~0.0.0" @@ -8549,28 +9535,32 @@ shell-quote@^1.6.1: shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -simple-git@^1.85.0: - version "1.107.0" - resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-1.107.0.tgz#12cffaf261c14d6f450f7fdb86c21ccee968b383" - dependencies: - debug "^4.0.1" +simple-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= sisteransi@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + version "1.0.2" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.2.tgz#ec57d64b6f25c4f26c0e2c7dd23f2d7f12f7e418" + integrity sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w== slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== slash@^3.0.0: version "3.0.0" @@ -8580,6 +9570,7 @@ slash@^3.0.0: slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= slice-ansi@^2.1.0: version "2.1.0" @@ -8593,14 +9584,17 @@ slice-ansi@^2.1.0: slide@^1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" + integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= -smart-buffer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" +smart-buffer@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.2.tgz#5207858c3815cc69110703c6b94e46c15634395d" + integrity sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw== snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -8609,12 +9603,14 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.1.tgz#e12b5487faded3e3dea0ac91e9400bf75b401370" + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -8623,45 +9619,51 @@ snapdragon@^0.8.1: map-cache "^0.2.2" source-map "^0.5.6" source-map-resolve "^0.5.0" - use "^2.0.0" + use "^3.1.0" socks-proxy-agent@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.1.tgz#5936bf8b707a993079c6f37db2091821bffa6473" + version "4.0.2" + resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz#3c8991f3145b2799e70e11bd5fbc8b1963116386" + integrity sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg== dependencies: - agent-base "~4.2.0" - socks "~2.2.0" + agent-base "~4.2.1" + socks "~2.3.2" -socks@~2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.2.2.tgz#f061219fc2d4d332afb4af93e865c84d3fa26e2b" +socks@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.3.2.tgz#ade388e9e6d87fdb11649c15746c578922a5883e" + integrity sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ== dependencies: ip "^1.1.5" - smart-buffer "^4.0.1" + smart-buffer "4.0.2" sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + integrity sha1-ZYU1WEhh7JfXMNbPQYIuH1ZoQSg= dependencies: is-plain-obj "^1.0.0" source-list-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" + version "2.0.1" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" + integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== source-map-resolve@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a" + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: - atob "^2.0.0" + atob "^2.1.1" decode-uri-component "^0.2.0" resolve-url "^0.2.1" source-map-url "^0.4.0" urix "^0.1.0" source-map-support@^0.5.6, source-map-support@^0.5.9: - version "0.5.9" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.9.tgz#41bc953b2534267ea2d605bccfa7bfa3111ced5f" + version "0.5.12" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" + integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -8669,120 +9671,136 @@ source-map-support@^0.5.6, source-map-support@^0.5.9: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@0.5.x, source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== source-map@~0.4.0, source-map@~0.4.2: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + integrity sha1-66T12pwNyZneaAMti092FzZSA2s= dependencies: amdefine ">=0.0.4" sourcemap-codec@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz#c63ea927c029dd6bd9a2b7fa03b3fec02ad56e9f" - integrity sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg== + version "1.4.6" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.6.tgz#e30a74f0402bad09807640d39e971090a08ce1e9" + integrity sha512-1ZooVLYFxC448piVLBbtOxFcXwnymH9oUF8nRd3CuYDVvkRBxRl6pB4Mtas5a4drtL+E8LDgFkQNcgIw6tc8Hg== sparkles@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" + version "1.0.1" + resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.1.tgz#008db65edce6c50eec0c5e228e1945061dd0437c" + integrity sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw== spdx-correct@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: spdx-expression-parse "^3.0.0" spdx-license-ids "^3.0.0" spdx-exceptions@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== spdx-expression-parse@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== dependencies: spdx-exceptions "^2.1.0" spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" split2@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/split2/-/split2-2.2.0.tgz#186b2575bcf83e85b7d18465756238ee4ee42493" + integrity sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw== dependencies: through2 "^2.0.2" split@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/split/-/split-1.0.1.tgz#605bd9be303aa59fb35f9229fbea0ddec9ea07d9" + integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== dependencies: through "2" sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= sshpk@^1.7.0: - version "1.13.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3" + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" - dashdash "^1.12.0" - getpass "^0.1.1" - optionalDependencies: bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" ecc-jsbn "~0.1.1" + getpass "^0.1.1" jsbn "~0.1.0" + safer-buffer "^2.0.2" tweetnacl "~0.14.0" ssri@^6.0.0, ssri@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" + integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== dependencies: figgy-pudding "^3.5.1" stack-trace@0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= stack-utils@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.1.tgz#d4f33ab54e8e38778b0ca5cfd3b3afb12db68620" - -staged-git-files@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.2.tgz#4326d33886dc9ecfa29a6193bf511ba90a46454b" + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" -stealthy-require@^1.1.0: +stealthy-require@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= stream-browserify@^2.0.0, stream-browserify@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" + version "2.0.2" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" + integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== dependencies: inherits "~2.0.1" readable-stream "^2.0.2" @@ -8790,6 +9808,7 @@ stream-browserify@^2.0.0, stream-browserify@^2.0.1: stream-combiner2@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" + integrity sha1-+02KFCDqNidk4hrUeAOXvry0HL4= dependencies: duplexer2 "~0.1.0" readable-stream "^2.0.2" @@ -8797,6 +9816,7 @@ stream-combiner2@^1.1.1: stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" + integrity sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw== dependencies: end-of-stream "^1.1.0" stream-shift "^1.0.0" @@ -8804,24 +9824,28 @@ stream-each@^1.1.0: stream-exhaust@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" + integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== stream-http@^2.0.0, stream-http@^2.7.2: - version "2.8.0" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10" + version "2.8.3" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" + integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.3.3" + readable-stream "^2.3.6" to-arraybuffer "^1.0.0" xtend "^4.0.0" stream-shift@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= stream-splicer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.1.tgz#0b13b7ee2b5ac7e0609a7463d83899589a363fcd" + integrity sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg== dependencies: inherits "^2.0.1" readable-stream "^2.0.2" @@ -8829,16 +9853,19 @@ stream-splicer@^2.0.0: streamfilter@^1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/streamfilter/-/streamfilter-1.0.7.tgz#ae3e64522aa5a35c061fd17f67620c7653c643c9" + integrity sha512-Gk6KZM+yNA1JpW0KzlZIhjo3EaBJDkYfXtYSbOwNIQ7Zd6006E6+sCFlW1NDvFG/vnXhKmw6TJJgiEQg/8lXfQ== dependencies: readable-stream "^2.0.2" -string-argv@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" +string-argv@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.0.tgz#0ea99e7257fea5e97a1bfcdfc19cf12d68e6ec6a" + integrity sha512-NGZHq3nkSXVtGZXTBjFru3MNfoZyIzN25T7BmvdgnSC0LCJczAGLLMQLyjywSIaAoqSemgLzBRHOsnrHbt60+Q== string-length@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= dependencies: astral-regex "^1.0.0" strip-ansi "^4.0.0" @@ -8846,74 +9873,91 @@ string-length@^2.0.0: string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string-width@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.0.0.tgz#5a1690a57cc78211fffd9bf24bbe24d090604eb1" - integrity sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew== +string-width@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" + integrity sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ== dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.0.0" + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^5.2.0" string.prototype.padend@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/string.prototype.padend/-/string.prototype.padend-3.0.0.tgz#f3aaef7c1719f170c5eab1c32bf780d96e21f2f0" + integrity sha1-86rvfBcZ8XDF6rHDK/eA2W4h8vA= dependencies: define-properties "^1.1.2" es-abstract "^1.4.3" function-bind "^1.0.2" -string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" +string_decoder@^1.0.0, string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== dependencies: safe-buffer "~5.1.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= -stringify-object@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: - get-own-enumerable-property-symbols "^2.0.1" + safe-buffer "~5.1.0" + +stringify-object@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" is-obj "^1.0.1" is-regexp "^1.0.0" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" -strip-ansi@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== dependencies: - ansi-regex "^4.0.0" + ansi-regex "^4.1.0" strip-bom-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" + integrity sha1-+H217yYT9paKpUWr/h7HKLaoKco= dependencies: first-chunk-stream "^2.0.0" strip-bom "^2.0.0" @@ -8921,34 +9965,46 @@ strip-bom-stream@^2.0.0: strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + integrity sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4= dependencies: is-utf8 "^0.2.0" strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-final-newline@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" + integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== strip-indent@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + integrity sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI= dependencies: get-stdin "^4.0.1" strip-indent@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= strong-log-transformer@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz#0f5ed78d325e0421ac6f90f7f10e691d6ae3ae10" + integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== dependencies: duplexer "^0.1.1" minimist "^1.2.0" @@ -8957,34 +10013,40 @@ strong-log-transformer@^2.0.0: subarg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" + integrity sha1-9izxdYHplrSPyWVpn1TAauJouNI= dependencies: minimist "^1.1.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" + integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= dependencies: has-flag "^2.0.0" -supports-color@^5.2.0, supports-color@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" -supports-color@^6.0.0, supports-color@^6.1.0: +supports-color@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== dependencies: has-flag "^3.0.0" sver-compat@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" + integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= dependencies: es6-iterator "^2.0.1" es6-symbol "^3.1.1" @@ -8992,55 +10054,57 @@ sver-compat@^1.5.0: symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== symbol-tree@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" - -synchronous-promise@^2.0.6: - version "2.0.8" - resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.8.tgz#01fd026fffdbf2d3d39ec06ee1a7c971578136f7" - integrity sha512-xYavZtFC1vKgJu0AOSYdrLeikNCsNwmUeZaV1XF9cMqEhBVVxLq6rEbYzOGrF1MV2MNPkhsJqqiXuQ4a76CEUg== + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== syntax-error@^1.1.1: version "1.4.0" resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" + integrity sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w== dependencies: acorn-node "^1.2.0" table@^5.2.3: - version "5.2.3" - resolved "https://registry.yarnpkg.com/table/-/table-5.2.3.tgz#cde0cc6eb06751c009efab27e8c820ca5b67b7f2" - integrity sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ== + version "5.4.2" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.2.tgz#e837706859a17b5a9a6352c6695d4c8534543b4d" + integrity sha512-DQqgZw837CvGJ/IDqjHX3ZCY9RWlB3jEpbPURQaTMZPbuYEV+F58RGfPG1WMvghzXKFQyvIShcD4bSLiIkkuUg== dependencies: - ajv "^6.9.1" - lodash "^4.17.11" + ajv "^6.10.2" + lodash "^4.17.14" slice-ansi "^2.1.0" - string-width "^3.0.0" + string-width "^4.1.0" tapable@^0.2.7: - version "0.2.8" - resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" + version "0.2.9" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.9.tgz#af2d8bbc9b04f74ee17af2b4d9048f807acd18a8" + integrity sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A== -tar@^4, tar@^4.4.8: - version "4.4.8" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" +tar@^4, tar@^4.4.10, tar@^4.4.8: + version "4.4.10" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" + integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.4" - minizlib "^1.1.1" + minipass "^2.3.5" + minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" - yallist "^3.0.2" + yallist "^3.0.3" temp-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= temp-write@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-3.4.0.tgz#8cff630fb7e9da05f047c74ce4ce4d685457d492" + integrity sha1-jP9jD7fp2gXwR8dM5M5NaFRX1JI= dependencies: graceful-fs "^4.1.2" is-stream "^1.1.0" @@ -9049,44 +10113,43 @@ temp-write@^3.4.0: temp-dir "^1.0.0" uuid "^3.0.1" -test-exclude@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.0.0.tgz#cdce7cece785e0e829cd5c2b27baf18bc583cfb7" +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== dependencies: - arrify "^1.0.1" + glob "^7.1.3" minimatch "^3.0.4" read-pkg-up "^4.0.0" - require-main-filename "^1.0.1" - -test262-parser@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/test262-parser/-/test262-parser-2.0.7.tgz#733b46bf7759e747eae34b5b14d6a3c8d2082add" - dependencies: - js-yaml "^3.2.1" - through "^2.3.4" + require-main-filename "^2.0.0" test262-stream@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/test262-stream/-/test262-stream-1.2.0.tgz#37f03bf56672ec0f0120596372ea98313309d32e" + version "1.3.0" + resolved "https://registry.yarnpkg.com/test262-stream/-/test262-stream-1.3.0.tgz#98c4ab9f8e74c7f9478afcf52e071a89d319df61" + integrity sha512-TSv+Z4hftmRuUJVJk7kaguWLlVLRfwyWm1DOt4kvTXAanATxv6A1HhjRTrSBI00XXEWQ+cUdsDii8tn+fkjXyw== dependencies: + js-yaml "^3.2.1" klaw "^2.1.0" - test262-parser "^2.0.7" -text-extensions@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.7.0.tgz#faaaba2625ed746d568a23e4d0aacd9bf08a8b39" +text-extensions@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.0.0.tgz#43eabd1b495482fae4a2bf65e5f56c29f69220f6" + integrity sha512-F91ZqLgvi1E0PdvmxMgp+gcf6q8fMH7mhdwWfzXnl1k+GbpQDmi8l7DzLC5JTASKbwpY3TfxajAUzAXcv2NmsQ== text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= throat@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= -through2-filter@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" +through2-filter@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-3.0.0.tgz#700e786df2367c2c88cd8aa5be4cf9c1e7831254" + integrity sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA== dependencies: through2 "~2.0.0" xtend "~4.0.0" @@ -9094,13 +10157,15 @@ through2-filter@^2.0.0: through2@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/through2/-/through2-1.1.1.tgz#0847cbc4449f3405574dbdccd9bb841b83ac3545" + integrity sha1-CEfLxESfNAVXTb3M2buEG4OsNUU= dependencies: readable-stream ">=1.1.13-1 <1.2.0-0" xtend ">=4.0.0 <4.1.0-0" -through2@^2.0.0, through2@^2.0.1, through2@^2.0.2, through2@^2.0.3, through2@~2.0.0: +through2@^2.0.0, through2@^2.0.2, through2@^2.0.3, through2@~2.0.0: version "2.0.5" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.5.tgz#01c1e39eb31d07cb7d03a96a70823260b23132cd" + integrity sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ== dependencies: readable-stream "~2.3.6" xtend "~4.0.1" @@ -9115,36 +10180,43 @@ through2@^3.0.0: through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= time-stamp@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" + integrity sha1-dkpaEa9QVhkhsTPztE5hhofg9cM= timers-browserify@^1.0.1: version "1.4.2" resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + integrity sha1-ycWLV1voQHN1y14kYtrO50NZ9B0= dependencies: process "~0.11.0" timers-browserify@^2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae" + version "2.0.10" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" + integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== dependencies: setimmediate "^1.0.4" tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= to-absolute-glob@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz#1865f43d9e74b0822db9f145b78cff7d0f7c849b" + integrity sha1-GGX0PZ50sIItufFFt4z/fQ98hJs= dependencies: is-absolute "^1.0.0" is-negated-glob "^1.0.0" @@ -9152,27 +10224,39 @@ to-absolute-glob@^2.0.0: to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" + integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" @@ -9182,103 +10266,137 @@ to-regex@^3.0.1, to-regex@^3.0.2: to-through@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-through/-/to-through-2.0.0.tgz#fc92adaba072647bc0b67d6b03664aa195093af6" + integrity sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY= dependencies: through2 "^2.0.3" -toposort@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330" - integrity sha1-riF2gXXRVZ1IvvNUILL0li8JwzA= +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" -tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.4.3: +tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== dependencies: psl "^1.1.24" punycode "^1.4.1" -tr46@^1.0.0, tr46@^1.0.1: +tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= dependencies: punycode "^2.1.0" trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + integrity sha1-WIeWa7WCpFA6QetST301ARgVphM= trim-newlines@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" + integrity sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA= trim-off-newlines@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" + integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= tty-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + integrity sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw== tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= dependencies: safe-buffer "^5.0.1" tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.5" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" -type-fest@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.4.1.tgz#8bdf77743385d8a4f13ba95f610f5ccd68c728f8" - integrity sha512-IwzA/LSfD2vC1/YDYMv/zHP4rDF1usCwllsDpbolT3D4fUepIO7f9K70jjmUewU/LmGUKJcwcVtDCpnKk4BPMw== +type-fest@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" + integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== -typedarray@^0.0.6, typedarray@~0.0.5: +type@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61" + integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw== + +typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -uglify-js@3.3.x, uglify-js@^3.0.5, uglify-js@^3.1.4: - version "3.3.13" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.13.tgz#8a1a89eeb16e2d6a66b0db2b04cb871af3c669cf" +uglify-js@3.4.x: + version "3.4.10" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" + integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== dependencies: - commander "~2.14.1" + commander "~2.19.0" source-map "~0.6.1" uglify-js@^2.8.29: version "2.8.29" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= dependencies: source-map "~0.5.1" yargs "~3.10.0" optionalDependencies: uglify-to-browserify "~1.0.0" +uglify-js@^3.0.5, uglify-js@^3.1.4: + version "3.6.0" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" + integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== + dependencies: + commander "~2.20.0" + source-map "~0.6.1" + uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= uglifyjs-webpack-plugin@^0.4.6: version "0.4.6" resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" + integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= dependencies: source-map "^0.5.6" uglify-js "^2.8.29" @@ -9287,22 +10405,38 @@ uglifyjs-webpack-plugin@^0.4.6: uid-number@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + integrity sha1-DqEOgDXo61uOREnwbaHHMGY7qoE= umask@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" + integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= umd@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" + version "3.0.3" + resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.3.tgz#aa9fe653c42b9097678489c01000acb69f0b26cf" + integrity sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow== unc-path-regex@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" + integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= + +undeclared-identifiers@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz#9254c1d37bdac0ac2b52de4b6722792d2a91e30f" + integrity sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw== + dependencies: + acorn-node "^1.3.0" + dash-ast "^1.0.0" + get-assigned-identifiers "^1.2.0" + simple-concat "^1.0.0" + xtend "^4.0.1" undertaker-registry@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= undertaker@^1.2.1: version "1.2.1" @@ -9322,10 +10456,12 @@ undertaker@^1.2.1: unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== unicode-match-property-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== dependencies: unicode-canonical-property-names-ecmascript "^1.0.4" unicode-property-aliases-ecmascript "^1.0.4" @@ -9336,51 +10472,58 @@ unicode-match-property-value-ecmascript@^1.1.0: integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== unicode-property-aliases-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + version "1.0.5" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" + integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" + integrity sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ== dependencies: unique-slug "^2.0.0" unique-slug@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.1.tgz#5e9edc6d1ce8fb264db18a507ef9bd8544451ca6" + version "2.0.2" + resolved "https://registry.yarnpkg.com/unique-slug/-/unique-slug-2.0.2.tgz#baabce91083fc64e945b0f3ad613e264f7cd4e6c" + integrity sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w== dependencies: imurmurhash "^0.1.4" unique-stream@^2.0.2: - version "2.2.1" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" + version "2.3.1" + resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.3.1.tgz#c65d110e9a4adf9a6c5948b28053d9a8d04cbeac" + integrity sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A== dependencies: - json-stable-stringify "^1.0.0" - through2-filter "^2.0.0" + json-stable-stringify-without-jsonify "^1.0.1" + through2-filter "^3.0.0" -universal-user-agent@^2.0.0, universal-user-agent@^2.0.1, universal-user-agent@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.1.0.tgz#5abfbcc036a1ba490cb941f8fd68c46d3669e8e4" - integrity sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q== +universal-user-agent@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-3.0.0.tgz#4cc88d68097bffd7ac42e3b7c903e7481424b4b9" + integrity sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA== dependencies: os-name "^3.0.0" universalify@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -9393,16 +10536,19 @@ upath@^1.1.1: upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= url-template@^2.0.8: version "2.0.8" @@ -9412,43 +10558,66 @@ url-template@^2.0.8: url@^0.11.0, url@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= dependencies: punycode "1.3.2" querystring "0.2.0" -use@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/use/-/use-2.0.2.tgz#ae28a0d72f93bf22422a18a2e379993112dec8e8" - dependencies: - define-property "^0.2.5" - isobject "^3.0.0" - lazy-cache "^2.0.2" +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util-promisify@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/util-promisify/-/util-promisify-2.1.0.tgz#3c2236476c4d32c5ff3c47002add7c13b9a82a53" + integrity sha1-PCI2R2xNMsX/PEcAKt18E7moKlM= + dependencies: + object.getownpropertydescriptors "^2.0.3" util.promisify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== dependencies: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util@0.10.3, util@^0.10.3, util@~0.10.1: +util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" +util@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" + integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== + dependencies: + inherits "2.0.3" + +util@~0.10.1: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + uuid@^3.0.1, uuid@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== v8flags@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.0.2.tgz#ad6a78a20a6b23d03a8debc11211e3cc23149477" + version "3.1.3" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8" + integrity sha512-amh9CCg3ZxkzQ48Mhcb8iX7xpAfYJgePHxWMQCBWECpOSqJUXgY26ncA61UTV0BkPqfhcy6mzwCIoP4ygxpW8w== dependencies: homedir-polyfill "^1.0.1" @@ -9463,16 +10632,19 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.3: validate-npm-package-name@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" + integrity sha1-X6kS2B630MdK/BQN5zF/DKffQ34= dependencies: builtins "^1.0.3" value-or-function@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/value-or-function/-/value-or-function-3.0.0.tgz#1c243a50b595c1be54a754bfece8563b9ff8d813" + integrity sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM= verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= dependencies: assert-plus "^1.0.0" core-util-is "1.0.2" @@ -9481,6 +10653,7 @@ verror@1.10.0: vinyl-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/vinyl-file/-/vinyl-file-2.0.0.tgz#a7ebf5ffbefda1b7d18d140fcb07b223efb6751a" + integrity sha1-p+v1/779obfRjRQPyweyI++2dRo= dependencies: graceful-fs "^4.1.2" pify "^2.3.0" @@ -9490,8 +10663,9 @@ vinyl-file@^2.0.0: vinyl "^1.1.0" vinyl-fs@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.2.tgz#1b86258844383f57581fcaac081fe09ef6d6d752" + version "3.0.3" + resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" + integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== dependencies: fs-mkdirp-stream "^1.0.0" glob-stream "^6.1.0" @@ -9514,6 +10688,7 @@ vinyl-fs@^3.0.0: vinyl-sourcemap@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz#92a800593a38703a8cdb11d8b300ad4be63b3e16" + integrity sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY= dependencies: append-buffer "^1.0.2" convert-source-map "^1.5.0" @@ -9526,20 +10701,23 @@ vinyl-sourcemap@^1.1.0: vinyl-sourcemaps-apply@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz#ab6549d61d172c2b1b87be5c508d239c8ef87705" + integrity sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU= dependencies: source-map "^0.5.1" vinyl@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" + integrity sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ= dependencies: clone "^1.0.0" clone-stats "^0.0.1" replace-ext "0.0.1" vinyl@^2.0.0, vinyl@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.1.0.tgz#021f9c2cf951d6b939943c89eb5ee5add4fd924c" + version "2.2.0" + resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-2.2.0.tgz#d85b07da96e458d25b2ffe19fece9f2caa13ed86" + integrity sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg== dependencies: clone "^2.1.1" clone-buffer "^1.0.0" @@ -9548,25 +10726,22 @@ vinyl@^2.0.0, vinyl@^2.1.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vm-browserify@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" - dependencies: - indexof "0.0.1" - -vm-browserify@^1.0.0: +vm-browserify@^1.0.0, vm-browserify@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" + integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= dependencies: browser-process-hrtime "^0.1.2" walker@^1.0.7, walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= dependencies: makeerror "1.0.x" @@ -9576,8 +10751,9 @@ warnings-to-errors-webpack-plugin@^2.0.0: integrity sha512-0Girb3F5xc5U1TpYMiLDcie5oB+Ko2EuujOYyS3aXpKS4Yp264WkIuJ+0vF8wnmkDkmZAOBxahBedEL0mLjHQA== watchpack@^1.4.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed" + version "1.6.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" + integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== dependencies: chokidar "^2.0.2" graceful-fs "^4.1.2" @@ -9586,16 +10762,19 @@ watchpack@^1.4.0: wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= dependencies: defaults "^1.0.3" -webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: +webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== webpack-dependency-suite@^2.4.4: version "2.4.5" resolved "https://registry.yarnpkg.com/webpack-dependency-suite/-/webpack-dependency-suite-2.4.5.tgz#e2d3c9a178140edb7be41de57413a31cb2f11ec0" + integrity sha512-UyAXvIu12XjcuiUkO1QQ7xRC/rpOyCfdCOhlhgJrLkt2FqK/l0dhynVxLRHO/QyGoNpfoO0N7k+m/LTxfriwrQ== dependencies: "@types/acorn" "^4.0.2" "@types/cheerio" "^0.22.1" @@ -9618,29 +10797,32 @@ webpack-dependency-suite@^2.4.4: source-map "^0.5.6" webpack-sources@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" + version "1.3.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" + integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== dependencies: source-list-map "^2.0.0" source-map "~0.6.1" webpack-stream@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-4.0.2.tgz#7b90aec71d45c8a4519ff8b5a4d59e039cfd02c0" + version "4.0.3" + resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-4.0.3.tgz#96399fd7911b94c264bfc59e356738a89b5ca136" + integrity sha512-Tx7ks7Of/JiPz7/tUM4WqSg4OcXF4m4OzNSaEzNA1TNXQaiTHIjiKqUoL79wGXbFt2q1IP8VG5DcEdaxifY5Ew== dependencies: fancy-log "^1.3.2" lodash.clone "^4.3.2" lodash.some "^4.2.2" memory-fs "^0.4.1" plugin-error "^1.0.1" - supports-color "^5.2.0" + supports-color "^5.3.0" through "^2.3.8" vinyl "^2.1.0" webpack "^3.4.1" webpack@^3.4.1: - version "3.11.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894" + version "3.12.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" + integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" @@ -9666,22 +10848,30 @@ webpack@^3.4.1: yargs "^8.0.2" whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.3.tgz#57c235bc8657e914d24e1a397d3c82daee0a6ba3" + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== dependencies: - iconv-lite "0.4.19" + iconv-lite "0.4.24" -whatwg-url@^6.4.0: - version "6.4.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08" +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== dependencies: lodash.sortby "^4.7.0" - tr46 "^1.0.0" - webidl-conversions "^4.0.1" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" whatwg-url@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -9690,12 +10880,14 @@ whatwg-url@^7.0.0: which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= -which@1, which@^1.2.10, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: +which@1, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -9703,14 +10895,16 @@ which@1, which@^1.2.10, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: isexe "^2.0.0" wide-align@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== dependencies: - string-width "^1.0.2" + string-width "^1.0.2 || 2" window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= windows-release@^3.1.0: version "3.2.0" @@ -9719,17 +10913,25 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -wordwrap@0.0.2, wordwrap@~0.0.2: +wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= dependencies: string-width "^1.0.1" strip-ansi "^3.0.1" @@ -9737,6 +10939,7 @@ wrap-ansi@^2.0.0: wrap-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= dependencies: string-width "^2.1.1" strip-ansi "^4.0.0" @@ -9744,8 +10947,9 @@ wrap-ansi@^3.0.1: wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write-file-atomic@2.4.1, write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: +write-file-atomic@2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== @@ -9754,9 +10958,19 @@ write-file-atomic@2.4.1, write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: + version "2.4.3" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" + integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + write-json-file@^2.2.0, write-json-file@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" + integrity sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= dependencies: detect-indent "^5.0.0" graceful-fs "^4.1.2" @@ -9768,6 +10982,7 @@ write-json-file@^2.2.0, write-json-file@^2.3.0: write-pkg@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.2.0.tgz#0e178fe97820d389a8928bc79535dbe68c2cff21" + integrity sha512-tX2ifZ0YqEFOF1wjRW2Pk93NLsj02+n1UP5RvO6rCs0K6R2g1padvf006cY74PQJKMGS2r42NK7FD0dG6Y6paw== dependencies: sort-keys "^2.0.0" write-json-file "^2.2.0" @@ -9779,44 +10994,47 @@ write@1.0.3: dependencies: mkdirp "^0.5.1" -ws@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-4.1.0.tgz#a979b5d7d4da68bf54efe0408967c324869a7289" +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== dependencies: async-limiter "~1.0.0" - safe-buffer "~5.1.0" - -xml-char-classes@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= "y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= -yallist@^3.0.0, yallist@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" +yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== yargs-parser@^11.1.1: version "11.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== dependencies: camelcase "^5.0.0" decamelize "^1.2.0" @@ -9824,24 +11042,28 @@ yargs-parser@^11.1.1: yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" + integrity sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw= dependencies: camelcase "^3.0.0" yargs-parser@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo= dependencies: camelcase "^3.0.0" yargs-parser@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" + integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= dependencies: camelcase "^4.1.0" yargs@^12.0.1, yargs@^12.0.2: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== dependencies: cliui "^4.0.0" decamelize "^1.2.0" @@ -9859,6 +11081,7 @@ yargs@^12.0.1, yargs@^12.0.2: yargs@^6.5.0, yargs@^6.6.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" + integrity sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg= dependencies: camelcase "^3.0.0" cliui "^3.2.0" @@ -9877,6 +11100,7 @@ yargs@^6.5.0, yargs@^6.6.0: yargs@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + integrity sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg= dependencies: camelcase "^3.0.0" cliui "^3.2.0" @@ -9895,6 +11119,7 @@ yargs@^7.1.0: yargs@^8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" + integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= dependencies: camelcase "^4.1.0" cliui "^3.2.0" @@ -9913,20 +11138,9 @@ yargs@^8.0.2: yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= dependencies: camelcase "^1.0.2" cliui "^2.1.0" decamelize "^1.0.0" window-size "0.1.0" - -yup@^0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/yup/-/yup-0.27.0.tgz#f8cb198c8e7dd2124beddc2457571329096b06e7" - integrity sha512-v1yFnE4+u9za42gG/b/081E7uNW9mUj3qtkmelLbW5YPROZzSH/KUUyJu9Wt8vxFJcT9otL/eZopS0YK1L5yPQ== - dependencies: - "@babel/runtime" "^7.0.0" - fn-name "~2.0.1" - lodash "^4.17.11" - property-expr "^1.5.0" - synchronous-promise "^2.0.6" - toposort "^2.0.2" From f08062b1deaf34d28726d0ef825821d060cb8554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 29 Jul 2019 11:14:11 -0400 Subject: [PATCH 002/965] chore: fix ESLint errors (#10278) --- packages/babel-cli/src/babel/file.js | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js index 14cf4c562971..7c38d3052f3d 100644 --- a/packages/babel-cli/src/babel/file.js +++ b/packages/babel-cli/src/babel/file.js @@ -103,24 +103,22 @@ export default async function({ } function readStdin(): Promise { - return new Promise( - (resolve: Function, reject: Function): void => { - let code = ""; + return new Promise((resolve: Function, reject: Function): void => { + let code = ""; - process.stdin.setEncoding("utf8"); + process.stdin.setEncoding("utf8"); - process.stdin.on("readable", function() { - const chunk = process.stdin.read(); - // $FlowIgnore - if (chunk !== null) code += chunk; - }); + process.stdin.on("readable", function() { + const chunk = process.stdin.read(); + // $FlowIgnore + if (chunk !== null) code += chunk; + }); - process.stdin.on("end", function() { - resolve(code); - }); - process.stdin.on("error", reject); - }, - ); + process.stdin.on("end", function() { + resolve(code); + }); + process.stdin.on("error", reject); + }); } async function stdin(): Promise { From ba28f462bc7f703470ae1cfabf5f9223b4655198 Mon Sep 17 00:00:00 2001 From: Brian Donovan <1938+eventualbuddha@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:04:54 -0700 Subject: [PATCH 003/965] =?UTF-8?q?Fix=20typo=20"to"=20=E2=86=92=20"so".?= =?UTF-8?q?=20(#10288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/babel-template/src/populate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-template/src/populate.js b/packages/babel-template/src/populate.js index 3ac536f6d81c..90b13853ba67 100644 --- a/packages/babel-template/src/populate.js +++ b/packages/babel-template/src/populate.js @@ -32,7 +32,7 @@ export default function populatePlaceholders( }); } - // Process in reverse order to AST mutation doesn't change indices that + // Process in reverse order so AST mutation doesn't change indices that // will be needed for later calls to `placeholder.resolve()`. metadata.placeholders .slice() From 66727632e8be57046b2e15040200f46e0821fc7a Mon Sep 17 00:00:00 2001 From: Ashwin Ramaswami Date: Thu, 1 Aug 2019 00:20:52 -0700 Subject: [PATCH 004/965] fix: replace es.string.reverse with es.array.reverse (#10284) --- .../src/polyfills/corejs3/built-in-definitions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js index 656738f16fee..e03208878726 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js @@ -215,7 +215,7 @@ export const InstanceProperties: ObjectMap = { repeat: ["es.string.repeat"], replace: ["es.string.replace", "es.regexp.exec"], replaceAll: ["esnext.string.replace-all"], - reverse: ["es.string.reverse"], + reverse: ["es.array.reverse"], search: ["es.string.search", "es.regexp.exec"], slice: ["es.array.slice"], small: ["es.string.small"], From be2cbde5607e49c6c0d8cf99b2a16f23ed417669 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Thu, 1 Aug 2019 15:24:08 +0800 Subject: [PATCH 005/965] remove finally from completion record in trystatement (#10277) --- .../test/fixtures/do-expressions/finally-block/input.js | 9 +++++++++ .../fixtures/do-expressions/finally-block/options.json | 3 +++ .../test/fixtures/do-expressions/finally-block/output.js | 9 +++++++++ packages/babel-traverse/src/path/family.js | 1 - 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/options.json create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/output.js diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/input.js new file mode 100644 index 000000000000..8827149f32f9 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/input.js @@ -0,0 +1,9 @@ +const x = do { + try { + a(); + } catch (e) { + b(); + } finally { + c(); + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/options.json b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/options.json new file mode 100644 index 000000000000..116249a4f7a7 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-block-scoping", "proposal-do-expressions"] +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/output.js new file mode 100644 index 000000000000..22a29ec91b8b --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/finally-block/output.js @@ -0,0 +1,9 @@ +var x = function () { + try { + return a(); + } catch (e) { + return b(); + } finally { + c(); + } +}(); diff --git a/packages/babel-traverse/src/path/family.js b/packages/babel-traverse/src/path/family.js index 0af3d2b110cb..1ed824d3789d 100644 --- a/packages/babel-traverse/src/path/family.js +++ b/packages/babel-traverse/src/path/family.js @@ -33,7 +33,6 @@ export function getCompletionRecords(): NodePath[] { } else if (this.isTryStatement()) { paths = addCompletionRecords(this.get("block"), paths); paths = addCompletionRecords(this.get("handler"), paths); - paths = addCompletionRecords(this.get("finalizer"), paths); } else if (this.isCatchClause()) { paths = addCompletionRecords(this.get("body"), paths); } else { From 3e4a9d588b43be341355b629faf278602774681a Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Thu, 1 Aug 2019 15:36:35 +0800 Subject: [PATCH 006/965] Do expressions transform for switch statements (#10070) * lint fix * switch inside do expression * review comments * review comments * make min diff * adding more test * review changes * review changes * handle block statement and added more test cases * fix implementation and add more test cases * fix last swtich case * disable block fallthrough case * fix nitpick reviews --- .../.fallthrough-multiblock/exec.js | 36 +++++++++++ .../.fallthrough-multiblock/input.js | 25 ++++++++ .../declaration-before-break/input.js | 9 +++ .../declaration-before-break/output.js | 11 ++++ .../empty-case-block/input.js | 7 +++ .../empty-case-block/output.js | 9 +++ .../fallthrough-block-last/exec.js | 26 ++++++++ .../fallthrough-block-last/input.js | 19 ++++++ .../fallthrough-block-last/output.js | 26 ++++++++ .../fallthrough-block/exec.js | 30 ++++++++++ .../fallthrough-block/input.js | 23 +++++++ .../fallthrough-block/output.js | 30 ++++++++++ .../fallthrough-last/exec.js | 21 +++++++ .../fallthrough-last/input.js | 14 +++++ .../fallthrough-last/output.js | 18 ++++++ .../fallthrough/exec.js | 25 ++++++++ .../fallthrough/input.js | 18 ++++++ .../fallthrough/output.js | 22 +++++++ .../multi-consequent-multiblock/exec.js | 36 +++++++++++ .../multi-consequent-multiblock/input.js | 29 +++++++++ .../multi-consequent-multiblock/output.js | 60 +++++++++++++++++++ .../multiple-break/exec.js | 19 ++++++ .../multiple-break/input.js | 15 +++++ .../multiple-break/output.js | 16 +++++ .../multiple-consequent-block/exec.js | 32 ++++++++++ .../multiple-consequent-block/input.js | 27 +++++++++ .../multiple-consequent-block/output.js | 34 +++++++++++ .../multiple-consequent/input.js | 9 +++ .../multiple-consequent/output.js | 10 ++++ .../do-expression-switch-case/options.json | 3 + .../single-consequent-block/exec.js | 13 ++++ .../single-consequent-block/input.js | 9 +++ .../single-consequent-block/output.js | 12 ++++ .../single-consequent/exec.js | 10 ++++ .../single-consequent/input.js | 6 ++ .../single-consequent/output.js | 10 ++++ packages/babel-traverse/src/path/family.js | 57 ++++++++++++++++++ 37 files changed, 776 insertions(+) create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/options.json create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/output.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/exec.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/input.js create mode 100644 packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/output.js diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/exec.js new file mode 100644 index 000000000000..3811a50b2494 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/exec.js @@ -0,0 +1,36 @@ +// `blockExpressions` before `break` is hard to deal with +// https://github.com/babel/babel/pull/10070#discussion_r296048106 +const x = (n) => do { + switch (n) { + case 0: + { "a"; } + { "b"; }; + case 1: + { "c"; } + break; + { "d"; }; + case 2: + "a"; + "b"; + case 3: + {} + { break; } + case 4: + { "d"; } + { "e"; } + case 5: + "f"; + case 6: + {} + case 7: + } +} + +expect(x(0)).toBe('c') +expect(x(1)).toBe('c') +expect(x(2)).toBeUndefined() +expect(x(3)).toBeUndefined() +expect(x(4)).toBe('f') +expect(x(5)).toBe('f') +expect(x(6)).toBeUndefined() +expect(x(7)).toBeUndefined() diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/input.js new file mode 100644 index 000000000000..adda24b703d1 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/.fallthrough-multiblock/input.js @@ -0,0 +1,25 @@ +const x = (n) => do { + switch (n) { + case 0: + { "a"; } + { "b"; }; + case 1: + { "c"; } + break; + { "d"; }; + case 2: + "a"; + "b"; + case 3: + {} + { break; } + case 4: + { "a"; } + { "b"; } + case 5: + "c"; + case 6: + {} + case 7: + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/input.js new file mode 100644 index 000000000000..3e64d8911875 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/input.js @@ -0,0 +1,9 @@ +const x = (n) => do { + switch (n) { + case 0: + case 6: + const b = 1; + break; + default: 'bar'; + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/output.js new file mode 100644 index 000000000000..a438311f5e24 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/declaration-before-break/output.js @@ -0,0 +1,11 @@ +const x = n => function () { + switch (n) { + case 0: + case 6: + const b = 1; + return void 0; + + default: + return 'bar'; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/input.js new file mode 100644 index 000000000000..920878526152 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/input.js @@ -0,0 +1,7 @@ +const x = () => do { + switch (new Date().getDay()) { + case 0: + break; + default: "weekday 🚴" + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/output.js new file mode 100644 index 000000000000..15fb9f3537ff --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/empty-case-block/output.js @@ -0,0 +1,9 @@ +const x = () => function () { + switch (new Date().getDay()) { + case 0: + return void 0; + + default: + return "weekday 🚴"; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/exec.js new file mode 100644 index 000000000000..395fdf6f0538 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/exec.js @@ -0,0 +1,26 @@ +const x = (n) => do { + switch (n) { + case 0: { + 'a'; + } + case 1: { + 'b'; + break; + } + default: { + 'd'; + } + case 2: { + 'c'; + } + case 3: + case 4: + } +} + +expect(x(0)).toBe('b'); +expect(x(1)).toBe('b'); +expect(x(2)).toBe('c'); +expect(x(3)).toBeUndefined(); +expect(x(4)).toBeUndefined(); +expect(x(5)).toBe('c'); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/input.js new file mode 100644 index 000000000000..e9c30a6b4550 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/input.js @@ -0,0 +1,19 @@ +const x = (n) => do { + switch (n) { + case 0: { + 'a'; + } + case 1: { + 'b'; + break; + } + default: { + 'd'; + } + case 2: { + 'c'; + } + case 3: + case 4: + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/output.js new file mode 100644 index 000000000000..91f6ebcdc15c --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block-last/output.js @@ -0,0 +1,26 @@ +const x = n => function () { + switch (n) { + case 0: + { + 'a'; + } + + case 1: + { + return 'b'; + } + + default: + { + 'd'; + } + + case 2: + { + return 'c'; + } + + case 3: + case 4: + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/exec.js new file mode 100644 index 000000000000..f9593ecc8cdb --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/exec.js @@ -0,0 +1,30 @@ +const x = (n) => do { + switch (n) { + case 0: { + 'a'; + } + case 1: { + 'b'; + break; + } + case 2: { + 'c'; + break; + } + case 3: { + break; + } + case 4: { + 'd'; + 'e'; + } + default: 'f'; + } +} + +expect(x(0)).toBe('b'); +expect(x(1)).toBe('b'); +expect(x(2)).toBe('c'); +expect(x(3)).toBeUndefined(); +expect(x(4)).toBe('f'); +expect(x(5)).toBe('f'); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/input.js new file mode 100644 index 000000000000..768140a79198 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/input.js @@ -0,0 +1,23 @@ +const x = (n) => do { + switch (n) { + case 0: { + 'a'; + } + case 1: { + 'b'; + break; + } + case 2: { + 'c'; + break; + } + case 3: { + break; + } + case 4: { + 'd'; + 'e'; + } + default: 'f'; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/output.js new file mode 100644 index 000000000000..4bf150750242 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-block/output.js @@ -0,0 +1,30 @@ +const x = n => function () { + switch (n) { + case 0: + { + 'a'; + } + + case 1: + { + return 'b'; + } + + case 2: + { + return 'c'; + } + + case 3: + return void 0; + + case 4: + { + 'd'; + 'e'; + } + + default: + return 'f'; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/exec.js new file mode 100644 index 000000000000..f1a689aa3e1a --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/exec.js @@ -0,0 +1,21 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + case 1: + 'b'; + break; + default: 'd'; + case 2: + 'c'; + case 3: + case 4: + } +} + +expect(x(0)).toBe('b'); +expect(x(1)).toBe('b'); +expect(x(2)).toBe('c'); +expect(x(3)).toBeUndefined(); +expect(x(4)).toBeUndefined(); +expect(x(5)).toBe('c'); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/input.js new file mode 100644 index 000000000000..0c432fe07022 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/input.js @@ -0,0 +1,14 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + case 1: + 'b'; + break; + default: 'd'; + case 2: + 'c'; + case 3: + case 4: + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/output.js new file mode 100644 index 000000000000..85bec17a0cda --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough-last/output.js @@ -0,0 +1,18 @@ +const x = n => function () { + switch (n) { + case 0: + 'a'; + + case 1: + return 'b'; + + default: + 'd'; + + case 2: + return 'c'; + + case 3: + case 4: + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/exec.js new file mode 100644 index 000000000000..6531d426eca8 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/exec.js @@ -0,0 +1,25 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + case 1: + 'b'; + break; + case 2: + 'c'; + break; + case 3: + break; + case 4: + 'd'; + 'e'; + default: 'f'; + } +} + +expect(x(0)).toBe('b'); +expect(x(1)).toBe('b'); +expect(x(2)).toBe('c'); +expect(x(3)).toBeUndefined(); +expect(x(4)).toBe('f'); +expect(x(5)).toBe('f'); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/input.js new file mode 100644 index 000000000000..ea14170edc44 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/input.js @@ -0,0 +1,18 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + case 1: + 'b'; + break; + case 2: + 'c'; + break; + case 3: + break; + case 4: + 'd'; + 'e'; + default: 'f'; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/output.js new file mode 100644 index 000000000000..a006d36deea8 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/fallthrough/output.js @@ -0,0 +1,22 @@ +const x = n => function () { + switch (n) { + case 0: + 'a'; + + case 1: + return 'b'; + + case 2: + return 'c'; + + case 3: + return void 0; + + case 4: + 'd'; + 'e'; + + default: + return 'f'; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/exec.js new file mode 100644 index 000000000000..da1fb5e8764b --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/exec.js @@ -0,0 +1,36 @@ +const x = (n) => do { + switch (n) { + case 0: + { "a"; } + { break; } + { "b"; }; + case 1: + { "a"; } + break; + { "b"; }; + case 2: + "a"; + { break; } + "b"; + case 3: + "a"; + { "b"; break; } + { "c"; } + case 4: + { "a"; } + { "b"; } + { "c"; break; "d" } + { "e"; break; "f" } + case 5: + { "a"; } + { break; "b"; } + { break; "c"; } + } +} + +expect(x(0)).toBe('a') +expect(x(1)).toBe('a') +expect(x(2)).toBe('a') +expect(x(3)).toBe('b') +expect(x(4)).toBe('c') +expect(x(5)).toBe('a') diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/input.js new file mode 100644 index 000000000000..f038e3b27b39 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/input.js @@ -0,0 +1,29 @@ +const x = (n) => do { + switch (n) { + case 0: + { "a"; } + { break; } + { "b"; }; + case 1: + { "a"; } + break; + { "b"; }; + case 2: + "a"; + { break; } + "b"; + case 3: + "a"; + { "b"; break; } + { "c"; } + case 4: + { "a"; } + { "b"; } + { "c"; break; "d" } + { "e"; break; "f" } + case 5: + { "a"; } + { break; "b"; } + { break; "c"; } + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/output.js new file mode 100644 index 000000000000..a51ac54ca308 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multi-consequent-multiblock/output.js @@ -0,0 +1,60 @@ +const x = n => function () { + switch (n) { + case 0: + { + return "a"; + } + { + "b"; + } + ; + + case 1: + { + return "a"; + } + { + "b"; + } + ; + + case 2: + return "a"; + "b"; + + case 3: + "a"; + { + return "b"; + } + { + "c"; + } + + case 4: + { + "a"; + } + { + "b"; + } + { + return "c"; + "d"; + } + { + "e"; + break; + "f"; + } + + case 5: + { + return "a"; + } + { + break; + "c"; + } + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/exec.js new file mode 100644 index 000000000000..5ae85c2392e4 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/exec.js @@ -0,0 +1,19 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + break; + 'b'; + 'c'; + break; + 'd'; + case 6: + 'e'; + default: + 'f' + } +} + +expect(x(0)).toBe('a'); +expect(x(1)).toBe('f'); +expect(x(6)).toBe('f'); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/input.js new file mode 100644 index 000000000000..fd57351fe300 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/input.js @@ -0,0 +1,15 @@ +const x = (n) => do { + switch (n) { + case 0: + 'a'; + break; + 'b'; + 'c'; + break; + 'd'; + case 6: + 'e'; + default: + 'f' + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/output.js new file mode 100644 index 000000000000..36f4c4abcb8b --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-break/output.js @@ -0,0 +1,16 @@ +const x = n => function () { + switch (n) { + case 0: + return 'a'; + 'b'; + 'c'; + break; + 'd'; + + case 6: + 'e'; + + default: + return 'f'; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/exec.js new file mode 100644 index 000000000000..0a2bce023197 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/exec.js @@ -0,0 +1,32 @@ +const x = (n) => do { + switch (n) { + case 0: { + 'a'; + break; + } + case 1: { + 'b'; + break; + 'c'; + break; + 'd'; + } + case 2: { + 'e'; + const a = 'e'; + break; + } + case 3: { + const a = 'f'; + break; + 'f'; + } + default: 'g'; + } +} + +expect(x(0)).toBe('a'); +expect(x(1)).toBe('b'); +expect(x(2)).toBeUndefined(); +expect(x(3)).toBeUndefined(); +expect(x(4)).toBe('g'); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/input.js new file mode 100644 index 000000000000..d859f871f276 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/input.js @@ -0,0 +1,27 @@ +const x = (n) => do { + switch (n) { + case 0: { + get(); + 'a'; + break; + } + case 1: { + 'b'; + break; + 'c'; + break; + 'd'; + } + case 2: { + 'e'; + const a = 'e'; + break; + } + case 3: { + const a = 'f'; + break; + 'f'; + } + default: 'g'; + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/output.js new file mode 100644 index 000000000000..b5d77d0ff7cd --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent-block/output.js @@ -0,0 +1,34 @@ +const x = n => function () { + switch (n) { + case 0: + { + get(); + return 'a'; + } + + case 1: + { + return 'b'; + 'c'; + break; + 'd'; + } + + case 2: + { + 'e'; + const a = 'e'; + return void 0; + } + + case 3: + { + const a = 'f'; + return void 0; + 'f'; + } + + default: + return 'g'; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/input.js new file mode 100644 index 000000000000..5ef4ca35d4cc --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/input.js @@ -0,0 +1,9 @@ +const x = () => do { + switch (new Date().getDay()) { + case 0: + get(); + 1+1; + break; + default: "weekday 🚴" + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/output.js new file mode 100644 index 000000000000..ad928a82a82d --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/multiple-consequent/output.js @@ -0,0 +1,10 @@ +const x = () => function () { + switch (new Date().getDay()) { + case 0: + get(); + return 1 + 1; + + default: + return "weekday 🚴"; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/options.json b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/options.json new file mode 100644 index 000000000000..96d2eb705b15 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["proposal-do-expressions"] +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/exec.js new file mode 100644 index 000000000000..bfb6d498243b --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/exec.js @@ -0,0 +1,13 @@ +const x = (n) => do { + switch (n) { + case 0: case 6: { + "weekend 🚵"; + break; + } + default: "weekday 🚴" + } +} + +expect(x(0)).toBe('weekend 🚵') +expect(x(1)).toBe('weekday 🚴') +expect(x(6)).toBe('weekend 🚵') \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/input.js new file mode 100644 index 000000000000..8f41efb7ea45 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/input.js @@ -0,0 +1,9 @@ +const x = (n) => do { + switch (n) { + case 0: case 6: { + "weekend 🚵"; + break; + } + default: "weekday 🚴" + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/output.js new file mode 100644 index 000000000000..12d69e7a3448 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent-block/output.js @@ -0,0 +1,12 @@ +const x = n => function () { + switch (n) { + case 0: + case 6: + { + return "weekend 🚵"; + } + + default: + return "weekday 🚴"; + } +}(); diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/exec.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/exec.js new file mode 100644 index 000000000000..c48058f0b36d --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/exec.js @@ -0,0 +1,10 @@ +const x = (n) => do { + switch (n) { + case 0: case 6: "weekend 🚵"; break + default: "weekday 🚴" + } +} + +expect(x(0)).toBe('weekend 🚵') +expect(x(1)).toBe('weekday 🚴') +expect(x(6)).toBe('weekend 🚵') \ No newline at end of file diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/input.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/input.js new file mode 100644 index 000000000000..e3012915a365 --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/input.js @@ -0,0 +1,6 @@ +const x = (n) => do { + switch (n) { + case 0: case 6: "weekend 🚵"; break + default: "weekday 🚴" + } +} diff --git a/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/output.js b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/output.js new file mode 100644 index 000000000000..2c7f6486cefc --- /dev/null +++ b/packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expression-switch-case/single-consequent/output.js @@ -0,0 +1,10 @@ +const x = n => function () { + switch (n) { + case 0: + case 6: + return "weekend 🚵"; + + default: + return "weekday 🚴"; + } +}(); diff --git a/packages/babel-traverse/src/path/family.js b/packages/babel-traverse/src/path/family.js index 1ed824d3789d..b2d9cefc4e1b 100644 --- a/packages/babel-traverse/src/path/family.js +++ b/packages/babel-traverse/src/path/family.js @@ -18,6 +18,61 @@ function addCompletionRecords(path, paths) { return paths; } +function completionRecordForSwitch(cases, paths) { + let isLastCaseWithConsequent = true; + + for (let i = cases.length - 1; i >= 0; i--) { + const switchCase = cases[i]; + const consequent = switchCase.get("consequent"); + + let breakStatement; + findBreak: for (const statement of consequent) { + if (statement.isBlockStatement()) { + for (const statementInBlock of statement.get("body")) { + if (statementInBlock.isBreakStatement()) { + breakStatement = statementInBlock; + break findBreak; + } + } + } else if (statement.isBreakStatement()) { + breakStatement = statement; + break; + } + } + + if (breakStatement) { + while ( + breakStatement.key === 0 && + breakStatement.parentPath.isBlockStatement() + ) { + breakStatement = breakStatement.parentPath; + } + + const prevSibling = breakStatement.getPrevSibling(); + if ( + breakStatement.key > 0 && + (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement()) + ) { + paths = addCompletionRecords(prevSibling, paths); + breakStatement.remove(); + } else { + breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode()); + paths = addCompletionRecords(breakStatement, paths); + } + } else if (isLastCaseWithConsequent) { + const statementFinder = statement => + !statement.isBlockStatement() || + statement.get("body").some(statementFinder); + const hasConsequent = consequent.some(statementFinder); + if (hasConsequent) { + paths = addCompletionRecords(consequent[consequent.length - 1], paths); + isLastCaseWithConsequent = false; + } + } + } + return paths; +} + export function getCompletionRecords(): NodePath[] { let paths = []; @@ -35,6 +90,8 @@ export function getCompletionRecords(): NodePath[] { paths = addCompletionRecords(this.get("handler"), paths); } else if (this.isCatchClause()) { paths = addCompletionRecords(this.get("body"), paths); + } else if (this.isSwitchStatement()) { + paths = completionRecordForSwitch(this.get("cases"), paths); } else { paths.push(this); } From 5fb4d84a33351c13057dc542513a3fe2309e08b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 1 Aug 2019 03:53:40 -0400 Subject: [PATCH 007/965] perf: always return `void 0` as undefined node (#10243) --- packages/babel-traverse/src/scope/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/babel-traverse/src/scope/index.js b/packages/babel-traverse/src/scope/index.js index 375d5827b970..b26b59ce1844 100644 --- a/packages/babel-traverse/src/scope/index.js +++ b/packages/babel-traverse/src/scope/index.js @@ -490,12 +490,7 @@ export default class Scope { } buildUndefinedNode() { - if (this.hasBinding("undefined")) { - return t.unaryExpression("void", t.numericLiteral(0), true); - } else { - // eslint-disable-next-line @babel/development/no-undefined-identifier - return t.identifier("undefined"); - } + return t.unaryExpression("void", t.numericLiteral(0), true); } registerConstantViolation(path: NodePath) { From ba2c0f7adf58dfb9de6a152d858c418f374c6194 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Thu, 8 Aug 2019 02:14:23 -0300 Subject: [PATCH 008/965] fix: register inserted class declaration (#10302) * Decorators legacy: register inserted declaration For compatibility with the Typescript plugin Fixes #10264 * Register declaration but also keep replaceWithMultiple --- .../src/transformer-legacy.js | 6 +++++- .../test/fixtures/legacy-regression/10264/input.mjs | 4 ++++ .../test/fixtures/legacy-regression/10264/options.json | 6 ++++++ .../test/fixtures/legacy-regression/10264/output.mjs | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/input.mjs create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json create mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/output.mjs diff --git a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js index 0eb0ebdbd87a..53cfe47df91d 100644 --- a/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js +++ b/packages/babel-plugin-proposal-decorators/src/transformer-legacy.js @@ -237,7 +237,7 @@ export default { const replacement = decoratedClassToExpression(decl); if (replacement) { - path.replaceWithMultiple([ + const [varDeclPath] = path.replaceWithMultiple([ replacement, t.exportNamedDeclaration(null, [ t.exportSpecifier( @@ -246,6 +246,10 @@ export default { ), ]), ]); + + if (!decl.node.id) { + path.scope.registerDeclaration(varDeclPath); + } } }, ClassDeclaration(path) { diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/input.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/input.mjs new file mode 100644 index 000000000000..90ba5e106f57 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/input.mjs @@ -0,0 +1,4 @@ +function myDecorator(decoratee) {} + +@myDecorator +export default class {} 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 new file mode 100644 index 000000000000..51aa897d2c31 --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "transform-typescript", + [ "proposal-decorators", { "legacy": true } ] + ] +} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/output.mjs b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/output.mjs new file mode 100644 index 000000000000..5e99551db44a --- /dev/null +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/legacy-regression/10264/output.mjs @@ -0,0 +1,7 @@ +var _class2; + +function myDecorator(decoratee) {} + +let _class = myDecorator(_class2 = class {}) || _class2; + +export { _class as default }; From 9ec26a7d3ee2dceff75d2872721ff23e3dd83df3 Mon Sep 17 00:00:00 2001 From: ifsnow Date: Thu, 8 Aug 2019 18:11:50 +0900 Subject: [PATCH 009/965] Improves the logic to import objects in helpers (#10161) * Improves the logic to import objects in helpers * Modified to work with more cases. * Modified by considering exception cases * Fixed not using bundler's polyfill Co-Authored-By: Jordan Harband * Updated test output files * Changes to cache logic * Modified to use if statement --- packages/babel-helpers/src/helpers.js | 47 +++++++++++++------ .../misc/copy-getters-setters-star/output.js | 4 +- .../output.js | 4 +- .../dynamic-import/modules-amd/output.js | 4 +- .../dynamic-import/modules-cjs/output.js | 4 +- 5 files changed, 44 insertions(+), 19 deletions(-) diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index b9eef5095520..26416c926e9d 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -606,28 +606,45 @@ helpers.interopRequireDefault = helper("7.0.0-beta.0")` `; helpers.interopRequireWildcard = helper("7.0.0-beta.0")` + function _getRequireWildcardCache() { + if (typeof WeakMap !== "function") return null; + + var cache = new WeakMap(); + _getRequireWildcardCache = function () { return cache; }; + return cache; + } + export default function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = Object.defineProperty && Object.getOwnPropertyDescriptor - ? Object.getOwnPropertyDescriptor(obj, key) - : {}; - if (desc.get || desc.set) { - Object.defineProperty(newObj, key, desc); - } else { - newObj[key] = obj[key]; - } + } + + 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; - return newObj; } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; } `; 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 71696cd623e0..90b458ba8d18 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 @@ -9,4 +9,6 @@ var foo = _interopRequireWildcard(require("./moduleWithGetter")); exports.foo = foo; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } +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; } 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; } 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 9c2292edabb1..b49aa8ea3bd9 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 @@ -1,6 +1,8 @@ "use strict"; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } +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; } 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; } 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 07297795f680..7932f5924429 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 @@ -1,5 +1,7 @@ define(["require"], function (_require) { - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } + 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; } 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; } 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 9c2292edabb1..b49aa8ea3bd9 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 @@ -1,6 +1,8 @@ "use strict"; -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; return newObj; } } +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; } 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; } Promise.resolve().then(function () { return _interopRequireWildcard(require("foo")); From a112be2fa0b2abab7fd9a845b3a76b273c506449 Mon Sep 17 00:00:00 2001 From: Serge Havas Date: Thu, 8 Aug 2019 22:43:57 +0200 Subject: [PATCH 010/965] [fix] jsx helper calls order (#10307) imitate properly react createElement calls order --- packages/babel-helpers/src/helpers.js | 21 ++++++++++--------- .../inline-elements/output.js | 2 +- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index 26416c926e9d..ef9231df6ff4 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -47,15 +47,6 @@ helpers.jsx = helper("7.0.0-beta.0")` children: void 0, }; } - if (props && defaultProps) { - for (var propName in defaultProps) { - if (props[propName] === void 0) { - props[propName] = defaultProps[propName]; - } - } - } else if (!props) { - props = defaultProps || {}; - } if (childrenLength === 1) { props.children = children; @@ -67,6 +58,16 @@ helpers.jsx = helper("7.0.0-beta.0")` props.children = childArray; } + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + return { $$typeof: REACT_ELEMENT_TYPE, type: type, @@ -410,7 +411,7 @@ helpers.objectSpread2 = helper("7.5.0")` import defineProperty from "defineProperty"; // This function is different to "Reflect.ownKeys". The enumerableOnly - // filters on symbol properties only. Returned string properties are always + // filters on symbol properties only. Returned string properties are always // enumerable. It is good to use in objectSpread. function ownKeys(object, enumerableOnly) { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inline-elements/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inline-elements/output.js index 27a2ad4df045..9d4821377915 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inline-elements/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inline-elements/output.js @@ -1,6 +1,6 @@ var REACT_ELEMENT_TYPE; -function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } +function _jsx(type, props, key, children) { if (!REACT_ELEMENT_TYPE) { REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol["for"] && Symbol["for"]("react.element") || 0xeac7; } var defaultProps = type && type.defaultProps; var childrenLength = arguments.length - 3; if (!props && childrenLength !== 0) { props = { children: void 0 }; } if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = new Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 3]; } props.children = childArray; } if (props && defaultProps) { for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } } else if (!props) { props = defaultProps || {}; } return { $$typeof: REACT_ELEMENT_TYPE, type: type, key: key === undefined ? null : '' + key, ref: null, props: props, _owner: null }; } var _ref = /*#__PURE__*/ From 682d9f9f0996e3f8e36c834d6ad32cc7ff2ef521 Mon Sep 17 00:00:00 2001 From: README Bot <35302948+codetriage-readme-bot@users.noreply.github.com> Date: Fri, 9 Aug 2019 12:18:18 -0500 Subject: [PATCH 011/965] Add CodeTriage badge to babel/babel (#10088) [skip ci] Adds a badge showing the number of people helping this repo on CodeTriage. [![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel) ## What is CodeTriage? CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed [Read more about the CodeTriage project](https://www.codetriage.com/what). ## Why am I getting this PR? Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly over 3 years ago, [iamsolankiamit](https://github.com/iamsolankiamit) added this project to CodeTriage in order to start contributing. Since then, 94 people have subscribed to help this repo. ## What does adding a badge accomplish? Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project. You can see an example of a CodeTriage badge on these popular OSS READMEs: - [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails - [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal ## Have a question or comment? While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics. If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again. Thanks for making your project Open Source! Any feedback is greatly appreciated. --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7b9bd953b54..a33b52621a88 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,6 +32,7 @@ contributing, please read the - Follow along with what we are working on by joining our [Slack](https://babeljs.slack.com) (you can sign-up [here](https://slack.babeljs.io/) for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes). - Check out our [website](http://babeljs.io/) and the [repo](https://github.com/babel/website) +- You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to babel on CodeTriage](https://www.codetriage.com/babel/babel). [![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel) ## Chat From 15535cf52c2140c7bf27165ec88e2cfdad68d5ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sun, 11 Aug 2019 18:55:28 -0400 Subject: [PATCH 012/965] Update preset-env text fixtures (#10318) * chore: update preset-env text fixtures * chore: remove FORCE_COLOR workaround --- Makefile | 3 --- .../debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt | 2 +- .../test/debug-fixtures/entry-corejs3-all/stdout.txt | 2 +- .../entry-corejs3-es-proposals-chrome-71/stdout.txt | 2 +- .../test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt | 2 +- .../entry-corejs3-proposals-chrome-71/stdout.txt | 2 +- .../test/debug-fixtures/entry-corejs3-proposals/stdout.txt | 2 +- .../debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt | 2 +- .../test/debug-fixtures/entry-corejs3-stage/stdout.txt | 2 +- .../test/fixtures/corejs3/entry-all-chrome-71/output.mjs | 2 +- .../test/fixtures/corejs3/entry-all/output.mjs | 2 +- .../entry-entries-es-proposals-stage-chrome-71/output.mjs | 2 +- .../corejs3/entry-entries-es-proposals-stage/output.mjs | 2 +- .../corejs3/entry-entries-proposals-chrome-71/output.mjs | 2 +- .../test/fixtures/corejs3/entry-entries-proposals/output.mjs | 2 +- .../fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs | 2 +- .../test/fixtures/corejs3/entry-entries-stage/output.mjs | 2 +- .../test/fixtures/corejs3/entry-require-all/output.js | 4 ++-- .../fixtures/corejs3/entry-require-es-proposals/output.js | 4 ++-- 19 files changed, 20 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 5fa5cb0cfdbf..5eca02889afd 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,6 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 TEST262_COMMIT = de567d3aa5de4eaa11e00131d26b9fe77997dfb0 -# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 -export FORCE_COLOR = true - SOURCES = packages codemods .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt index 9bd35deedc21..bbefff8cb204 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt @@ -88,6 +88,7 @@ Using polyfills with `entry` option: esnext.set.union { "chrome":"71" } esnext.string.at { "chrome":"71" } esnext.string.code-points { "chrome":"71" } + esnext.string.match-all { "chrome":"71" } esnext.string.replace-all { "chrome":"71" } esnext.symbol.dispose { "chrome":"71" } esnext.symbol.observable { "chrome":"71" } @@ -100,7 +101,6 @@ Using polyfills with `entry` option: esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } web.immediate { "chrome":"71" } - esnext.string.match-all { "chrome":"71" } [/src/in.js] Based on your targets, regenerator-runtime import excluded. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt index cf2f612260b2..9c9fa026270b 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt @@ -312,6 +312,7 @@ Using polyfills with `entry` option: esnext.set.union {} esnext.string.at {} esnext.string.code-points {} + esnext.string.match-all {} esnext.string.replace-all {} esnext.symbol.dispose {} esnext.symbol.observable {} @@ -331,5 +332,4 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} - esnext.string.match-all {} Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt index 6d0687966b22..5cf2958c3b05 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt @@ -88,6 +88,7 @@ Using polyfills with `entry` option: esnext.set.union { "chrome":"71" } esnext.string.at { "chrome":"71" } esnext.string.code-points { "chrome":"71" } + esnext.string.match-all { "chrome":"71" } esnext.string.replace-all { "chrome":"71" } esnext.symbol.dispose { "chrome":"71" } esnext.symbol.observable { "chrome":"71" } @@ -99,7 +100,6 @@ Using polyfills with `entry` option: esnext.weak-set.delete-all { "chrome":"71" } esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } - esnext.string.match-all { "chrome":"71" } [/src/in.js] Based on your targets, regenerator-runtime import excluded. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt index 954fd4133665..bc007cc33283 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt @@ -312,6 +312,7 @@ Using polyfills with `entry` option: esnext.set.union {} esnext.string.at {} esnext.string.code-points {} + esnext.string.match-all {} esnext.string.replace-all {} esnext.symbol.dispose {} esnext.symbol.observable {} @@ -326,5 +327,4 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} - esnext.string.match-all {} Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt index 7b8630d1d45f..415f49d21038 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt @@ -85,6 +85,7 @@ Using polyfills with `entry` option: esnext.set.union { "chrome":"71" } esnext.string.at { "chrome":"71" } esnext.string.code-points { "chrome":"71" } + esnext.string.match-all { "chrome":"71" } esnext.string.replace-all { "chrome":"71" } esnext.symbol.dispose { "chrome":"71" } esnext.symbol.observable { "chrome":"71" } @@ -96,7 +97,6 @@ Using polyfills with `entry` option: esnext.weak-set.delete-all { "chrome":"71" } esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } - esnext.string.match-all { "chrome":"71" } [/src/in.js] Based on your targets, regenerator-runtime import excluded. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt index 34bf4094e273..e0cdc2017967 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt @@ -112,6 +112,7 @@ Using polyfills with `entry` option: esnext.set.union {} esnext.string.at {} esnext.string.code-points {} + esnext.string.match-all {} esnext.string.replace-all {} esnext.symbol.dispose {} esnext.symbol.observable {} @@ -126,5 +127,4 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} - esnext.string.match-all {} Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt index 7b8630d1d45f..415f49d21038 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt @@ -85,6 +85,7 @@ Using polyfills with `entry` option: esnext.set.union { "chrome":"71" } esnext.string.at { "chrome":"71" } esnext.string.code-points { "chrome":"71" } + esnext.string.match-all { "chrome":"71" } esnext.string.replace-all { "chrome":"71" } esnext.symbol.dispose { "chrome":"71" } esnext.symbol.observable { "chrome":"71" } @@ -96,7 +97,6 @@ Using polyfills with `entry` option: esnext.weak-set.delete-all { "chrome":"71" } esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } - esnext.string.match-all { "chrome":"71" } [/src/in.js] Based on your targets, regenerator-runtime import excluded. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt index 34bf4094e273..e0cdc2017967 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt @@ -112,6 +112,7 @@ Using polyfills with `entry` option: esnext.set.union {} esnext.string.at {} esnext.string.code-points {} + esnext.string.match-all {} esnext.string.replace-all {} esnext.symbol.dispose {} esnext.symbol.observable {} @@ -126,5 +127,4 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} - esnext.string.match-all {} Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs index b0bfda361f5d..5e6fe80b6a9a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs @@ -70,6 +70,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -82,4 +83,3 @@ import "core-js/modules/esnext.weak-set.delete-all"; import "core-js/modules/esnext.weak-set.from"; import "core-js/modules/esnext.weak-set.of"; import "core-js/modules/web.immediate"; -import "core-js/modules/esnext.string.match-all"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs index d1fd6163046e..de6d3f35f1d0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs @@ -268,6 +268,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -287,5 +288,4 @@ import "core-js/modules/web.timers"; import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; import "core-js/modules/web.url-search-params"; -import "core-js/modules/esnext.string.match-all"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs index a6c680fa982e..31397143f89d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs @@ -70,6 +70,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -81,4 +82,3 @@ import "core-js/modules/esnext.weak-set.add-all"; import "core-js/modules/esnext.weak-set.delete-all"; import "core-js/modules/esnext.weak-set.from"; import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/esnext.string.match-all"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs index c90f59ea1482..51a04c11f07a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs @@ -268,6 +268,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -282,5 +283,4 @@ import "core-js/modules/esnext.weak-set.of"; import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; import "core-js/modules/web.url-search-params"; -import "core-js/modules/esnext.string.match-all"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs index 56b2198265f2..c010a7b5fccb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs @@ -67,6 +67,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -78,4 +79,3 @@ import "core-js/modules/esnext.weak-set.add-all"; import "core-js/modules/esnext.weak-set.delete-all"; import "core-js/modules/esnext.weak-set.from"; import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/esnext.string.match-all"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs index 65c37496e056..d59c98b71768 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs @@ -68,6 +68,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -82,5 +83,4 @@ import "core-js/modules/esnext.weak-set.of"; import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; import "core-js/modules/web.url-search-params"; -import "core-js/modules/esnext.string.match-all"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs index 56b2198265f2..c010a7b5fccb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs @@ -67,6 +67,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -78,4 +79,3 @@ import "core-js/modules/esnext.weak-set.add-all"; import "core-js/modules/esnext.weak-set.delete-all"; import "core-js/modules/esnext.weak-set.from"; import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/esnext.string.match-all"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs index 65c37496e056..d59c98b71768 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs @@ -68,6 +68,7 @@ import "core-js/modules/esnext.set.symmetric-difference"; import "core-js/modules/esnext.set.union"; import "core-js/modules/esnext.string.at"; import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; import "core-js/modules/esnext.string.replace-all"; import "core-js/modules/esnext.symbol.dispose"; import "core-js/modules/esnext.symbol.observable"; @@ -82,5 +83,4 @@ import "core-js/modules/esnext.weak-set.of"; import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; import "core-js/modules/web.url-search-params"; -import "core-js/modules/esnext.string.match-all"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js index ac1379a63561..7a80df8b9bb7 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js @@ -180,6 +180,8 @@ require("core-js/modules/esnext.string.at"); require("core-js/modules/esnext.string.code-points"); +require("core-js/modules/esnext.string.match-all"); + require("core-js/modules/esnext.string.replace-all"); require("core-js/modules/esnext.symbol.dispose"); @@ -216,6 +218,4 @@ require("core-js/modules/web.url.to-json"); require("core-js/modules/web.url-search-params"); -require("core-js/modules/esnext.string.match-all"); - 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js index 31ec22fc83ba..2507fd832b3d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js @@ -180,6 +180,8 @@ require("core-js/modules/esnext.string.at"); require("core-js/modules/esnext.string.code-points"); +require("core-js/modules/esnext.string.match-all"); + require("core-js/modules/esnext.string.replace-all"); require("core-js/modules/esnext.symbol.dispose"); @@ -208,6 +210,4 @@ require("core-js/modules/web.url.to-json"); require("core-js/modules/web.url-search-params"); -require("core-js/modules/esnext.string.match-all"); - 1 ** 2; From ee397ff1074184a78fc78bc599cc2e4af66e61c8 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Mon, 12 Aug 2019 12:32:31 -0300 Subject: [PATCH 013/965] Adds note about two approval policy to PR template (#10313) * Adds note about two approval policy to PR template * Adds qualifier to approval policy Because, although two approvals is the general case, some PRs maybe merged with more or fewer approvals [skip ci] --- .github/PULL_REQUEST_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e5a78bd6542d..a45e7ae92cfe 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,6 +2,8 @@ Before making a PR, please read our contributing guidelines https://github.com/babel/babel/blob/master/CONTRIBUTING.md +Please note that the Babel Team requires two approvals before merging most PRs. + For issue references: Add a comma-separated list of a [closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by the ticket number fixed by the PR. (it should be underlined in the preview if done correctly) If you are making a change that should have a docs update: submit another PR to https://github.com/babel/website From 051965052c3ea85c85a865265e85ca206bc77113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 13 Aug 2019 12:03:34 +0200 Subject: [PATCH 014/965] Update @lerna/collect-updates git hash --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 7800bbd77715..e9c8313a4122 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1107,7 +1107,7 @@ "@lerna/collect-updates@3.14.2", "@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": version "3.14.2" - resolved "https://github.com/babel/lerna.git#89eab830be040fbaabc31ad7206c5efab878c6c3" + resolved "https://github.com/babel/lerna.git#ece37c645b84227edd4d10fdcf056acf8a2a4183" dependencies: "@lerna/child-process" "^3.3.0" "@lerna/describe-ref" "^3.6.0" From 22df2ae244da7dfbe3793048390de815238ef6ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 13 Aug 2019 10:31:28 -0400 Subject: [PATCH 015/965] Commit generated code (#10331) * update prettier generated artifacts * chore: sync babel-helpers to artifacts --- packages/babel-runtime-corejs2/helpers/esm/temporalRef.js | 7 ++----- packages/babel-runtime-corejs2/helpers/temporalRef.js | 8 +++----- packages/babel-runtime/helpers/esm/temporalRef.js | 7 ++----- packages/babel-runtime/helpers/temporalRef.js | 8 +++----- packages/babel-types/src/asserts/generated/index.js | 5 ++--- 5 files changed, 12 insertions(+), 23 deletions(-) diff --git a/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js b/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js index 4b0679c64cfc..6d167a30397b 100644 --- a/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js +++ b/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js @@ -1,8 +1,5 @@ import undef from "./temporalUndefined"; +import err from "./tdz"; export default function _temporalRef(val, name) { - if (val === undef) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); - } else { - return val; - } + return val === undef ? err(name) : val; } \ No newline at end of file diff --git a/packages/babel-runtime-corejs2/helpers/temporalRef.js b/packages/babel-runtime-corejs2/helpers/temporalRef.js index 20b2652a1f8c..8aa5e5e58dcb 100644 --- a/packages/babel-runtime-corejs2/helpers/temporalRef.js +++ b/packages/babel-runtime-corejs2/helpers/temporalRef.js @@ -1,11 +1,9 @@ var temporalUndefined = require("./temporalUndefined"); +var tdz = require("./tdz"); + function _temporalRef(val, name) { - if (val === temporalUndefined) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); - } else { - return val; - } + return val === temporalUndefined ? tdz(name) : val; } module.exports = _temporalRef; \ No newline at end of file diff --git a/packages/babel-runtime/helpers/esm/temporalRef.js b/packages/babel-runtime/helpers/esm/temporalRef.js index 4b0679c64cfc..6d167a30397b 100644 --- a/packages/babel-runtime/helpers/esm/temporalRef.js +++ b/packages/babel-runtime/helpers/esm/temporalRef.js @@ -1,8 +1,5 @@ import undef from "./temporalUndefined"; +import err from "./tdz"; export default function _temporalRef(val, name) { - if (val === undef) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); - } else { - return val; - } + return val === undef ? err(name) : val; } \ No newline at end of file diff --git a/packages/babel-runtime/helpers/temporalRef.js b/packages/babel-runtime/helpers/temporalRef.js index 20b2652a1f8c..8aa5e5e58dcb 100644 --- a/packages/babel-runtime/helpers/temporalRef.js +++ b/packages/babel-runtime/helpers/temporalRef.js @@ -1,11 +1,9 @@ var temporalUndefined = require("./temporalUndefined"); +var tdz = require("./tdz"); + function _temporalRef(val, name) { - if (val === temporalUndefined) { - throw new ReferenceError(name + " is not defined - temporal dead zone"); - } else { - return val; - } + return val === temporalUndefined ? tdz(name) : val; } module.exports = _temporalRef; \ No newline at end of file diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index c21db148f2c3..c50116b309d5 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -8,9 +8,8 @@ import is from "../../validators/is"; function assert(type: string, node: Object, opts?: Object): void { if (!is(type, node, opts)) { throw new Error( - `Expected type "${type}" with option ${JSON.stringify( - (opts: any), - )}, but instead got "${node.type}".`, + `Expected type "${type}" with option ${JSON.stringify((opts: any))}, ` + + `but instead got "${node.type}".`, ); } } From 75090f10e550b9bfd6556d3bb8ff6ac79996c610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 13 Aug 2019 14:49:16 -0400 Subject: [PATCH 016/965] fix: assign comment to ObjectProperty only when inside an ObjectExpression (#10292) Fixes #10230 --- packages/babel-parser/src/parser/comments.js | 2 +- .../comments/regression/10230/input.js | 7 + .../comments/regression/10230/output.json | 239 ++++++++++++++++++ 3 files changed, 247 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10230/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10230/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 7f6b6e2de6e2..5ef57efe2fd9 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -91,7 +91,7 @@ export default class CommentsParser extends BaseParser { const lastComment = last(this.state.leadingComments); if (firstChild.type === "ObjectProperty") { - if (lastComment.start >= node.start) { + if (lastComment.start >= node.start && lastComment.end <= node.end) { if (this.state.commentPreviousNode) { for (j = 0; j < this.state.leadingComments.length; j++) { if ( diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/input.js b/packages/babel-parser/test/fixtures/comments/regression/10230/input.js new file mode 100644 index 000000000000..131dbd7a00f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/input.js @@ -0,0 +1,7 @@ +A = { + a: 42, + // One +} + +// Two +B diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json new file mode 100644 index 000000000000..0c3dcfdf9744 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 0, + "end": 1, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 1 + }, + "identifierName": "A" + }, + "name": "A" + }, + "right": { + "type": "ObjectExpression", + "start": 4, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 11, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ] + } + } + }, + { + "type": "ExpressionStatement", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "expression": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + }, + "identifierName": "B" + }, + "name": "B" + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Two", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " One", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + } + } + ] +} \ No newline at end of file From 469a5a71cd8ef0008c25d80ef864f752354cedc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 14 Aug 2019 08:03:03 +0200 Subject: [PATCH 017/965] Allow testing logs with `@babel/helper-transform-fixture-test-runner` (#10326) * Add support for logs to transform-fixture-test-runner * Test some warnings * Use stderr/stdout, and add a validateLogs test option * Normalize CWD in logs and rename vars * Silence preset-env tests * Restore old methods --- packages/babel-helper-fixtures/src/index.js | 15 ++++ .../src/index.js | 90 +++++++++++++------ .../systemjs/missing-plugin/options.json | 1 + .../systemjs/missing-plugin/stderr.txt | 3 + .../options.json | 1 + .../stdout.txt | 33 +++++++ .../output.mjs | 0 .../options.json | 1 + .../stdout.txt | 34 +++++++ .../options.json | 1 + .../options.json | 1 + .../stderr.txt | 1 + .../options.json | 1 + .../dynamic-import/modules-amd/options.json | 1 + .../dynamic-import/modules-cjs/options.json | 1 + .../dynamic-import/modules-false/options.json | 1 + .../modules-systemjs/options.json | 1 + .../dynamic-import/modules-umd/options.json | 1 + .../dynamic-import/modules-umd/stderr.txt | 1 + .../safari-10_3-block-scoped/options.json | 1 + .../safari-10_3-block-scoped/stdout.txt | 24 +++++ 21 files changed, 185 insertions(+), 28 deletions(-) create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt create mode 100644 packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index d187a118f8e6..fe30b82309a5 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -120,6 +120,8 @@ export default function get(entryLoc): Array { const expectLoc = findFile(taskDir + "/output", true /* allowJSON */) || taskDir + "/output.js"; + const stdoutLoc = taskDir + "/stdout.txt"; + const stderrLoc = taskDir + "/stderr.txt"; const actualLocAlias = suiteName + "/" + taskName + "/" + path.basename(actualLoc); @@ -146,6 +148,9 @@ export default function get(entryLoc): Array { title: humanize(taskName, true), disabled: taskName[0] === ".", options: taskOpts, + validateLogs: taskOpts.validateLogs, + stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) }, + stderr: { loc: stderrLoc, code: readFile(stderrLoc) }, exec: { loc: execLoc, code: readFile(execLoc), @@ -222,6 +227,16 @@ export default function get(entryLoc): Array { ); } } + + if (!test.validateLogs && (test.stdout.code || test.stderr.code)) { + throw new Error( + "stdout.txt and stderr.txt are only allowed when the 'validateLogs' option is enabled: " + + (test.stdout.code ? stdoutLoc : stderrLoc), + ); + } + + // Delete to avoid option validation error + delete test.options.validateLogs; } } diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index a83e8ff1c61b..ba85918ee12f 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -131,11 +131,16 @@ function wrapPackagesArray(type, names, optionsDir) { } function run(task) { - const actual = task.actual; - const expected = task.expect; - const exec = task.exec; - const opts = task.options; - const optionsDir = task.optionsDir; + const { + actual, + expect: expected, + exec, + options: opts, + optionsDir, + validateLogs, + stdout, + stderr, + } = task; function getOpts(self) { const newOpts = merge( @@ -191,19 +196,34 @@ function run(task) { } } - let actualCode = actual.code; - const expectCode = expected.code; - if (!execCode || actualCode) { - result = babel.transform(actualCode, getOpts(actual)); - const expectedCode = result.code.replace( - escapeRegExp(path.resolve(__dirname, "../../../")), - "", - ); + const inputCode = actual.code; + const expectedCode = expected.code; + if (!execCode || inputCode) { + const actualLogs = { stdout: "", stderr: "" }; + let restoreSpies = null; + if (validateLogs) { + const spy1 = jest.spyOn(console, "log").mockImplementation(msg => { + actualLogs.stdout += `${msg}\n`; + }); + const spy2 = jest.spyOn(console, "warn").mockImplementation(msg => { + actualLogs.stderr += `${msg}\n`; + }); + restoreSpies = () => { + spy1.mockRestore(); + spy2.mockRestore(); + }; + } + + result = babel.transform(inputCode, getOpts(actual)); + + if (restoreSpies) restoreSpies(); + + const outputCode = normalizeOutput(result.code); checkDuplicatedNodes(babel, result.ast); if ( !expected.code && - expectedCode && + outputCode && !opts.throws && fs.statSync(path.dirname(expected.loc)).isDirectory() && !process.env.CI @@ -214,7 +234,7 @@ function run(task) { ); console.log(`New test file created: ${expectedFile}`); - fs.writeFileSync(expectedFile, `${expectedCode}\n`); + fs.writeFileSync(expectedFile, `${outputCode}\n`); if (expected.loc !== expectedFile) { try { @@ -222,25 +242,19 @@ function run(task) { } catch (e) {} } } else { - actualCode = expectedCode.trim(); - try { - expect(actualCode).toEqualFile({ - filename: expected.loc, - code: expectCode, - }); - } catch (e) { - if (!process.env.OVERWRITE) throw e; - - console.log(`Updated test file: ${expected.loc}`); - fs.writeFileSync(expected.loc, `${expectedCode}\n`); - } + validateFile(outputCode, expected.loc, expectedCode); - if (actualCode) { + if (inputCode) { expect(expected.loc).toMatch( result.sourceType === "module" ? /\.mjs$/ : /\.js$/, ); } } + + if (validateLogs) { + validateFile(normalizeOutput(actualLogs.stdout), stdout.loc, stdout.code); + validateFile(normalizeOutput(actualLogs.stderr), stderr.loc, stderr.code); + } } if (task.sourceMap) { @@ -263,6 +277,26 @@ function run(task) { } } +function validateFile(actualCode, expectedLoc, expectedCode) { + try { + expect(actualCode).toEqualFile({ + filename: expectedLoc, + code: expectedCode, + }); + } catch (e) { + if (!process.env.OVERWRITE) throw e; + + console.log(`Updated test file: ${expectedLoc}`); + fs.writeFileSync(expectedLoc, `${actualCode}\n`); + } +} + +function normalizeOutput(code) { + return code + .trim() + .replace(escapeRegExp(path.resolve(__dirname, "../../../")), ""); +} + const toEqualFile = () => ({ compare: (actual, { filename, code }) => { const pass = actual === code; diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json index c4fe39793abd..c269a708f8a2 100644 --- a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "plugins": [ "syntax-dynamic-import", "transform-modules-systemjs", diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/stderr.txt b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/stderr.txt new file mode 100644 index 000000000000..6a64047d50bc --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/stderr.txt @@ -0,0 +1,3 @@ +WARNING: Dynamic import() transformation must be enabled using the + @babel/plugin-proposal-dynamic-import plugin. Babel 8 will + no longer transform import() without using that plugin. diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/options.json b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/options.json index f0e1e2cba61d..d7dca0ca75ef 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/options.json +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt new file mode 100644 index 000000000000..61526c5b8070 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt @@ -0,0 +1,33 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "61", + "edge": "16", + "firefox": "60", + "ios": "10.3", + "opera": "48", + "safari": "10.1" +} + +Using modules transform: false + +Using plugins: + transform-template-literals { "ios":"10.3", "safari":"10.1" } + transform-function-name { "edge":"16" } + transform-dotall-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + transform-unicode-regex { "ios":"10.3", "safari":"10.1" } + transform-parameters { "edge":"16" } + transform-block-scoping { "ios":"10.3", "safari":"10.1" } + transform-async-to-generator { "ios":"10.3", "safari":"10.1" } + proposal-async-generator-functions { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-object-rest-spread { "edge":"16", "ios":"10.3", "safari":"10.1" } + proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/input.mjs] Added following core-js polyfill: + web.dom.iterable { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/output.mjs new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/options.json b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/options.json index 95a82bb5ec7a..ffb21b1f8aa2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/options.json +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt new file mode 100644 index 000000000000..af7e5f8e39c4 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt @@ -0,0 +1,34 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "61", + "edge": "16", + "firefox": "60", + "ios": "10.3", + "opera": "48", + "safari": "10.1" +} + +Using modules transform: false + +Using plugins: + transform-template-literals { "ios":"10.3", "safari":"10.1" } + transform-function-name { "edge":"16" } + transform-dotall-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + transform-unicode-regex { "ios":"10.3", "safari":"10.1" } + transform-parameters { "edge":"16" } + transform-block-scoping { "ios":"10.3", "safari":"10.1" } + transform-async-to-generator { "ios":"10.3", "safari":"10.1" } + proposal-async-generator-functions { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-object-rest-spread { "edge":"16", "ios":"10.3", "safari":"10.1" } + proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/input.mjs] Added following core-js polyfills: + es.array.iterator { "chrome":"61", "opera":"48" } + web.dom-collections.iterator { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-supported/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-supported/options.json index 154ea4199025..65df7ec7a7d3 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-supported/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-supported/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "caller": { "name": "test-fixture", "supportsStaticESM": true, diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/options.json index c444f60ae955..85b4d7deafad 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "caller": { "name": "test-fixture", "supportsStaticESM": true, diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/stderr.txt b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/stderr.txt new file mode 100644 index 000000000000..f3e3df470839 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-supported-import-unsupported/stderr.txt @@ -0,0 +1 @@ +Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled. diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/options.json index 370b48e76fb2..60d72e63221a 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/auto-esm-unsupported-import-unsupported/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "caller": { "name": "test-fixture", "supportsStaticESM": false, diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/options.json index e34f77e9664c..dad5640aa571 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-amd/options.json @@ -1,3 +1,4 @@ { + "validateLogs": true, "presets": [["env", { "modules": "amd" }]] } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/options.json index 1b03b37c6f6d..091b0e2a32c6 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-cjs/options.json @@ -1,3 +1,4 @@ { + "validateLogs": true, "presets": [["env", { "modules": "cjs" }]] } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-false/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-false/options.json index 3c22b6872e58..c7c066f78489 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-false/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-false/options.json @@ -1,3 +1,4 @@ { + "validateLogs": true, "presets": [["env", { "modules": false }]] } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-systemjs/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-systemjs/options.json index 9be6fdb3812e..206e080b9c53 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-systemjs/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-systemjs/options.json @@ -1,3 +1,4 @@ { + "validateLogs": true, "presets": [["env", { "modules": "systemjs" }]] } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/options.json b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/options.json index da7772e2d584..6315da5c545a 100644 --- a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/options.json +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/options.json @@ -1,3 +1,4 @@ { + "validateLogs": true, "presets": [["env", { "modules": "umd" }]] } diff --git a/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/stderr.txt b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/stderr.txt new file mode 100644 index 000000000000..f3e3df470839 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/dynamic-import/modules-umd/stderr.txt @@ -0,0 +1 @@ +Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled. diff --git a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/options.json b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/options.json index 7eca9afc37fe..daee94dc032e 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/options.json +++ b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt new file mode 100644 index 000000000000..494481624f2f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt @@ -0,0 +1,24 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "safari": "10" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "safari":"10" } + transform-dotall-regex { "safari":"10" } + transform-unicode-regex { "safari":"10" } + transform-block-scoping { "safari":"10" } + transform-exponentiation-operator { "safari":"10" } + transform-async-to-generator { "safari":"10" } + proposal-async-generator-functions { "safari":"10" } + proposal-object-rest-spread { "safari":"10" } + proposal-unicode-property-regex { "safari":"10" } + proposal-json-strings { "safari":"10" } + proposal-optional-catch-binding { "safari":"10" } + transform-named-capturing-groups-regex { "safari":"10" } + +Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. From 64041e16695a4f98cdc7dd4e1ae0694a261f3df2 Mon Sep 17 00:00:00 2001 From: Ziad El Khoury Hanna Date: Wed, 14 Aug 2019 15:46:26 +0200 Subject: [PATCH 018/965] Fix flow comments plugin issues (#10329) * Fix issues in flow-comments to preserve comments and there order (fixes #10324) * Add support in flow-comments for extends in class declarations (fixes #10323, #10321) * Refactoring and cleanup of flow-comments plugin * Fix comments preservation logic of flow-comments * Fix flow-comments where comments are class identifier and extends keyword --- .../src/index.js | 240 +++++++++++------- .../class-extends-type-parameter/input.js | 1 + .../class-extends-type-parameter/output.js | 3 + .../input.js | 3 + .../output.js | 30 +++ .../class-type-parameter-extends/input.js | 1 + .../class-type-parameter-extends/output.js | 3 + .../preserve-comments-order/input.js | 7 + .../preserve-comments-order/output.js | 11 + .../flow-comments/preserve-comments/input.js | 2 + .../flow-comments/preserve-comments/output.js | 3 + 11 files changed, 219 insertions(+), 85 deletions(-) create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/input.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/output.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/input.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/output.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/input.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/output.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/input.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/output.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/input.js create mode 100644 packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/output.js diff --git a/packages/babel-plugin-transform-flow-comments/src/index.js b/packages/babel-plugin-transform-flow-comments/src/index.js index 2d54ae9d9854..742db1f0f263 100644 --- a/packages/babel-plugin-transform-flow-comments/src/index.js +++ b/packages/babel-plugin-transform-flow-comments/src/index.js @@ -6,27 +6,73 @@ import generateCode from "@babel/generator"; export default declare(api => { api.assertVersion(7); - function attachComment(path, comment) { - let attach = path.getPrevSibling(); - let where = "trailing"; - if (!attach.node) { - attach = path.parentPath; + function commentFromString(comment) { + return typeof comment === "string" + ? { type: "CommentBlock", value: comment } + : comment; + } + + function attachComment({ + ofPath, + toPath, + where = "trailing", + optional = false, + comments = generateComment(ofPath, optional), + keepType = false, + }) { + if (!toPath || !toPath.node) { + toPath = ofPath.getPrevSibling(); + where = "trailing"; + } + if (!toPath.node) { + toPath = ofPath.getNextSibling(); + where = "leading"; + } + if (!toPath.node) { + toPath = ofPath.parentPath; where = "inner"; } - attach.addComment(where, comment); - path.remove(); + if (!Array.isArray(comments)) { + comments = [comments]; + } + comments = comments.map(commentFromString); + if (!keepType && ofPath && ofPath.node) { + // Removes the node at `ofPath` while conserving the comments attached + // to it. + const node = ofPath.node; + const parent = ofPath.parentPath; + const prev = ofPath.getPrevSibling(); + const next = ofPath.getNextSibling(); + const isSingleChild = !(prev.node || next.node); + const leading = node.leadingComments; + const trailing = node.trailingComments; + + if (isSingleChild && leading) { + parent.addComments("inner", leading); + } + toPath.addComments(where, comments); + ofPath.remove(); + if (isSingleChild && trailing) { + parent.addComments("inner", trailing); + } + } else { + toPath.addComments(where, comments); + } } - function wrapInFlowComment(path, parent) { - attachComment(path, generateComment(path, parent)); + function wrapInFlowComment(path) { + attachComment({ + ofPath: path, + comments: generateComment(path, path.parent.optional), + }); } - function generateComment(path, parent) { + function generateComment(path, optional) { let comment = path .getSource() .replace(/\*-\//g, "*-ESCAPED/") .replace(/\*\//g, "*-/"); - if (parent && parent.optional) comment = "?" + comment; + if (optional) comment = "?" + comment; if (comment[0] !== ":") comment = ":: " + comment; return comment; } @@ -42,28 +88,32 @@ export default declare(api => { visitor: { TypeCastExpression(path) { const { node } = path; - path - .get("expression") - .addComment("trailing", generateComment(path.get("typeAnnotation"))); + attachComment({ + ofPath: path.get("typeAnnotation"), + toPath: path.get("expression"), + keepType: true, + }); path.replaceWith(t.parenthesizedExpression(node.expression)); }, // support function a(b?) {} Identifier(path) { - if (path.parentPath.isFlow()) { - return; - } - + if (path.parentPath.isFlow()) return; const { node } = path; if (node.typeAnnotation) { - const typeAnnotation = path.get("typeAnnotation"); - path.addComment("trailing", generateComment(typeAnnotation, node)); - typeAnnotation.remove(); + attachComment({ + ofPath: path.get("typeAnnotation"), + toPath: path, + optional: node.optional || node.typeAnnotation.optional, + }); if (node.optional) { node.optional = false; } } else if (node.optional) { - path.addComment("trailing", ":: ?"); + attachComment({ + toPath: path, + comments: ":: ?", + }); node.optional = false; } }, @@ -81,58 +131,51 @@ export default declare(api => { Function(path) { if (path.isDeclareFunction()) return; const { node } = path; - if (node.returnType) { - const returnType = path.get("returnType"); - const typeAnnotation = returnType.get("typeAnnotation"); - const block = path.get("body"); - block.addComment( - "leading", - generateComment(returnType, typeAnnotation.node), - ); - returnType.remove(); - } if (node.typeParameters) { - const typeParameters = path.get("typeParameters"); - const id = path.get("id"); - id.addComment( - "trailing", - generateComment(typeParameters, typeParameters.node), - ); - typeParameters.remove(); + attachComment({ + ofPath: path.get("typeParameters"), + toPath: path.get("id"), + optional: node.typeParameters.optional, + }); + } + if (node.returnType) { + attachComment({ + ofPath: path.get("returnType"), + toPath: path.get("body"), + where: "leading", + optional: node.returnType.typeAnnotation.optional, + }); } }, // support for `class X { foo: string }` - #4622 ClassProperty(path) { - const { node, parent } = path; + const { node } = path; if (!node.value) { - wrapInFlowComment(path, parent); + wrapInFlowComment(path); } else if (node.typeAnnotation) { - const typeAnnotation = path.get("typeAnnotation"); - path - .get("key") - .addComment( - "trailing", - generateComment(typeAnnotation, typeAnnotation.node), - ); - typeAnnotation.remove(); + attachComment({ + ofPath: path.get("typeAnnotation"), + toPath: path.get("key"), + optional: node.typeAnnotation.optional, + }); } }, // support `export type a = {}` - #8 Error: You passed path.replaceWith() a falsy node ExportNamedDeclaration(path) { - const { node, parent } = path; + const { node } = path; if (node.exportKind !== "type" && !t.isFlow(node.declaration)) { return; } - wrapInFlowComment(path, parent); + wrapInFlowComment(path); }, // support `import type A` and `import typeof A` #10 ImportDeclaration(path) { - const { node, parent } = path; + const { node } = path; if (isTypeImport(node.importKind)) { - wrapInFlowComment(path, parent); + wrapInFlowComment(path); return; } @@ -148,61 +191,88 @@ export default declare(api => { if (typeSpecifiers.length > 0) { const typeImportNode = t.cloneNode(node); typeImportNode.specifiers = typeSpecifiers; + const comment = `:: ${generateCode(typeImportNode).code}`; if (nonTypeSpecifiers.length > 0) { - path.addComment( - "trailing", - `:: ${generateCode(typeImportNode).code}`, - ); + attachComment({ toPath: path, comments: comment }); } else { - attachComment(path, `:: ${generateCode(typeImportNode).code}`); + attachComment({ ofPath: path, comments: comment }); } } }, ObjectPattern(path) { const { node } = path; if (node.typeAnnotation) { - const typeAnnotation = path.get("typeAnnotation"); - path.addComment( - "trailing", - generateComment(typeAnnotation, typeAnnotation.node), - ); - typeAnnotation.remove(); + attachComment({ + ofPath: path.get("typeAnnotation"), + toPath: path, + optional: node.optional || node.typeAnnotation.optional, + }); } }, Flow(path) { - const { parent } = path; - wrapInFlowComment(path, parent); + wrapInFlowComment(path); }, Class(path) { const { node } = path; - if (node.typeParameters || node.implements) { - const comments = []; - if (node.typeParameters) { - const typeParameters = path.get("typeParameters"); + let comments = []; + if (node.typeParameters) { + const typeParameters = path.get("typeParameters"); + comments.push( + generateComment(typeParameters, node.typeParameters.optional), + ); + const trailingComments = node.typeParameters.trailingComments; + if (trailingComments) { + comments.push(...trailingComments); + } + typeParameters.remove(); + } + + if (node.superClass) { + if (comments.length > 0) { + attachComment({ + toPath: path.get("id"), + comments: comments, + }); + comments = []; + } + + if (node.superTypeParameters) { + const superTypeParameters = path.get("superTypeParameters"); comments.push( - generateComment(typeParameters, typeParameters.node).replace( - /^:: /, - "", + generateComment( + superTypeParameters, + superTypeParameters.node.optional, ), ); - typeParameters.remove(); + superTypeParameters.remove(); } - if (node.implements) { - const impls = path.get("implements"); - comments.push( - "implements " + - impls - .map(impl => generateComment(impl).replace(/^:: /, "")) - .join(", "), - ); - delete node["implements"]; + } + + if (node.implements) { + const impls = path.get("implements"); + const comment = + "implements " + + impls + .map(impl => generateComment(impl).replace(/^:: /, "")) + .join(", "); + delete node["implements"]; + + if (comments.length === 1) { + comments[0] += ` ${comment}`; + } else { + comments.push(`:: ${comment}`); } + } - const block = path.get("body"); - block.addComment("leading", ":: " + comments.join(" ")); + if (comments.length > 0) { + attachComment({ + toPath: path.get("body"), + where: "leading", + comments: comments, + }); } }, }, diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/input.js new file mode 100644 index 000000000000..c75d5b793b2e --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/input.js @@ -0,0 +1 @@ +class Foo extends Bar {} diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/output.js new file mode 100644 index 000000000000..b4f9a9dba49c --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-extends-type-parameter/output.js @@ -0,0 +1,3 @@ +class Foo extends Bar +/*:: */ +{} diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/input.js new file mode 100644 index 000000000000..7a7673af94cc --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/input.js @@ -0,0 +1,3 @@ +class Foo /* inner */ extends Bar {} + +/*a*/class /*b*/Baz/*c*//*d*/extends /*e*/Bar/*f*//*g*/ {/*h*/}/*i*/ diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/output.js new file mode 100644 index 000000000000..45e9c5e696fa --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends-type-parameter/output.js @@ -0,0 +1,30 @@ +class Foo +/*:: */ + +/* inner */ +extends Bar +/*:: */ +{} +/*a*/ + + +class +/*b*/ +Baz +/*c*/ + +/*:: */ + +/*d*/ +extends +/*e*/ +Bar +/*f*/ + +/*:: */ + +/*g*/ +{} +/*h*/ + +/*i*/ diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/input.js new file mode 100644 index 000000000000..3fb5906c3afc --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/input.js @@ -0,0 +1 @@ +class Foo extends Bar {} diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/output.js new file mode 100644 index 000000000000..47ca6593757d --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/class-type-parameter-extends/output.js @@ -0,0 +1,3 @@ +class Foo +/*:: */ +extends Bar {} diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/input.js new file mode 100644 index 000000000000..e21008c2f7d7 --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/input.js @@ -0,0 +1,7 @@ +/*a*/ +type Foo = number; +/*b*/ +var foo; +/*c*/ +type Bar = number; +/*d*/ diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/output.js new file mode 100644 index 000000000000..8365f7d536e2 --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments-order/output.js @@ -0,0 +1,11 @@ +/*a*/ + +/*:: type Foo = number;*/ + +/*b*/ +var foo; +/*c*/ + +/*:: type Bar = number;*/ + +/*d*/ diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/input.js new file mode 100644 index 000000000000..4de529bb0fda --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/input.js @@ -0,0 +1,2 @@ +/**/ +type Foo = number; diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/output.js new file mode 100644 index 000000000000..95b2dd0f9cbf --- /dev/null +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/preserve-comments/output.js @@ -0,0 +1,3 @@ +/**/ + +/*:: type Foo = number;*/ From ee344c3e4cc65ee9d5d8d22650f05cc7f9a66af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 14 Aug 2019 10:58:01 -0400 Subject: [PATCH 019/965] Revert "chore: remove FORCE_COLOR workaround" (#10336) This reverts commit 347ee036becdca3c9e158311d44a48ed89df9a94. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 5eca02889afd..5fa5cb0cfdbf 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 TEST262_COMMIT = de567d3aa5de4eaa11e00131d26b9fe77997dfb0 +# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 +export FORCE_COLOR = true + SOURCES = packages codemods .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap From f0c2364d0177908da4fab336fb2b1ad1b1a082d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 14 Aug 2019 17:05:55 +0200 Subject: [PATCH 020/965] Do not delete "fake" source map comments from strings (#9960) Instead of using `convert-source-map`'s `removeComments` method before parsing the file, we can first parse the file with `@babel/parser` and then analyze the comments. This is needed because it is not possible to reliabily detect comments in JavaScript without fully parsing the file: https://github.com/thlorenz/convert-source-map/issues/63 --- lib/third-party-libs.js.flow | 2 +- .../src/transformation/normalize-file.js | 102 ++++++++++++------ .../comment-inside-string/input.js | 8 ++ .../comment-inside-string/options.json | 3 + .../comment-inside-string/output.js | 5 + .../babel-types/src/traverse/traverseFast.js | 2 +- 6 files changed, 88 insertions(+), 34 deletions(-) create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/input.js create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/options.json create mode 100644 packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/output.js diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index 884b1e68bbfb..f2c81c237d72 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -181,7 +181,7 @@ declare module "convert-source-map" { fromJSON(str: string): Converter, fromBase64(str: string): Converter, fromComment(str: string): Converter, - fromMapFileComment(str: string): Converter, + fromMapFileComment(str: string, dir: string): Converter, fromSource(str: string): Converter, fromMapFileSource(str: string, dir: string): Converter, removeComments(str: string): string, diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 1df42ad763b2..0bc88c8a0c1b 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -27,6 +27,20 @@ export default function normalizeFile( ): File { code = `${code || ""}`; + if (ast) { + if (ast.type === "Program") { + ast = t.file(ast, [], []); + } else if (ast.type !== "File") { + throw new Error("AST root must be a Program or File node"); + } + ast = cloneDeep(ast); + } else { + // The parser's AST types aren't fully compatible with the types generated + // by the logic in babel-types. + // $FlowFixMe + ast = parser(pluginPasses, options, code); + } + let inputMap = null; if (options.inputSourceMap !== false) { // If an explicit object is passed in, it overrides the processing of @@ -36,54 +50,33 @@ export default function normalizeFile( } if (!inputMap) { - try { - inputMap = convertSourceMap.fromSource(code); - - if (inputMap) { - code = convertSourceMap.removeComments(code); + const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast); + if (lastComment) { + try { + inputMap = convertSourceMap.fromComment(lastComment); + } catch (err) { + debug("discarding unknown inline input sourcemap", err); } - } catch (err) { - debug("discarding unknown inline input sourcemap", err); - code = convertSourceMap.removeComments(code); } } if (!inputMap) { - if (typeof options.filename === "string") { + const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); + if (typeof options.filename === "string" && lastComment) { try { - inputMap = convertSourceMap.fromMapFileSource( - code, + inputMap = convertSourceMap.fromMapFileComment( + lastComment, path.dirname(options.filename), ); - - if (inputMap) { - code = convertSourceMap.removeMapFileComments(code); - } } catch (err) { debug("discarding unknown file input sourcemap", err); - code = convertSourceMap.removeMapFileComments(code); } - } else { + } else if (lastComment) { debug("discarding un-loadable file input sourcemap"); - code = convertSourceMap.removeMapFileComments(code); } } } - if (ast) { - if (ast.type === "Program") { - ast = t.file(ast, [], []); - } else if (ast.type !== "File") { - throw new Error("AST root must be a Program or File node"); - } - ast = cloneDeep(ast); - } else { - // The parser's AST types aren't fully compatible with the types generated - // by the logic in babel-types. - // $FlowFixMe - ast = parser(pluginPasses, options, code); - } - return new File(options, { code, ast, @@ -156,3 +149,48 @@ function parser( throw err; } } + +// These regexps are copied from the convert-source-map package, +// but without // or /* at the beginning of the comment. + +// 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]*$/; + +function extractCommentsFromList(regex, comments, lastComment) { + if (comments) { + comments = comments.filter(({ value }) => { + if (regex.test(value)) { + lastComment = value; + return false; + } + return true; + }); + } + return [comments, lastComment]; +} + +function extractComments(regex, ast) { + let lastComment = null; + t.traverseFast(ast, node => { + // $FlowIgnore destructuring with expressions is not supported + [node.leadingComments, lastComment] = extractCommentsFromList( + regex, + node.leadingComments, + lastComment, + ); + // $FlowIgnore destructuring with expressions is not supported + [node.innerComments, lastComment] = extractCommentsFromList( + regex, + node.innerComments, + lastComment, + ); + // $FlowIgnore destructuring with expressions is not supported + [node.trailingComments, lastComment] = extractCommentsFromList( + regex, + node.trailingComments, + lastComment, + ); + }); + return lastComment; +} diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/input.js b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/input.js new file mode 100644 index 000000000000..b883f5d7b9a4 --- /dev/null +++ b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/input.js @@ -0,0 +1,8 @@ +// https://github.com/babel/babel/issues/9790 +const comment = `//# sourceMappingURL=${path.basename( + sourceMapFilename +)}` + +// https://github.com/babel/babel/issues/9956 +this.shadowRoot.innerHTML = ``; diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/options.json b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/options.json new file mode 100644 index 000000000000..0e6084f210d8 --- /dev/null +++ b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/options.json @@ -0,0 +1,3 @@ +{ + "inputSourceMap": true +} diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/output.js b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/output.js new file mode 100644 index 000000000000..9188ec5abc3b --- /dev/null +++ b/packages/babel-core/test/fixtures/transformation/source-maps/comment-inside-string/output.js @@ -0,0 +1,5 @@ +// https://github.com/babel/babel/issues/9790 +const comment = `//# sourceMappingURL=${path.basename(sourceMapFilename)}`; // https://github.com/babel/babel/issues/9956 + +this.shadowRoot.innerHTML = ``; diff --git a/packages/babel-types/src/traverse/traverseFast.js b/packages/babel-types/src/traverse/traverseFast.js index 580628343cfb..e262c10ad47d 100644 --- a/packages/babel-types/src/traverse/traverseFast.js +++ b/packages/babel-types/src/traverse/traverseFast.js @@ -7,7 +7,7 @@ import { VISITOR_KEYS } from "../definitions"; */ export default function traverseFast( node: Object, - enter: (node: Node, opts?: Object) => void, + enter: (node: BabelNode, opts?: Object) => void, opts?: Object, ): void { if (!node) return; From eb3767d58b5e376fa4f4e95e1ba9dc86c667908d Mon Sep 17 00:00:00 2001 From: Even Alander Date: Thu, 15 Aug 2019 19:59:08 +0200 Subject: [PATCH 021/965] Add a builder definition including name for tsTypeParameter (#10319) --- .../babel-types/src/definitions/typescript.js | 1 + .../__snapshots__/tsTypeParameter.js.snap | 24 +++++++++++++++++++ .../builders/typescript/tsTypeParameter.js | 24 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 packages/babel-types/test/builders/typescript/__snapshots__/tsTypeParameter.js.snap create mode 100644 packages/babel-types/test/builders/typescript/tsTypeParameter.js diff --git a/packages/babel-types/src/definitions/typescript.js b/packages/babel-types/src/definitions/typescript.js index 843f2408ecc9..9f0625d12320 100644 --- a/packages/babel-types/src/definitions/typescript.js +++ b/packages/babel-types/src/definitions/typescript.js @@ -494,6 +494,7 @@ defineType("TSTypeParameterDeclaration", { }); defineType("TSTypeParameter", { + builder: ["constraint", "default", "name"], visitor: ["constraint", "default"], fields: { name: { diff --git a/packages/babel-types/test/builders/typescript/__snapshots__/tsTypeParameter.js.snap b/packages/babel-types/test/builders/typescript/__snapshots__/tsTypeParameter.js.snap new file mode 100644 index 000000000000..51940ca2d50a --- /dev/null +++ b/packages/babel-types/test/builders/typescript/__snapshots__/tsTypeParameter.js.snap @@ -0,0 +1,24 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`builders typescript tsTypeParameter accept name as argument for tsTypeParameter 1`] = ` +Object { + "constraint": Object { + "type": "TSTypeReference", + "typeName": Object { + "name": "bar", + "type": "Identifier", + }, + "typeParameters": null, + }, + "default": Object { + "type": "TSTypeReference", + "typeName": Object { + "name": "baz", + "type": "Identifier", + }, + "typeParameters": null, + }, + "name": "foo", + "type": "TSTypeParameter", +} +`; diff --git a/packages/babel-types/test/builders/typescript/tsTypeParameter.js b/packages/babel-types/test/builders/typescript/tsTypeParameter.js new file mode 100644 index 000000000000..985d67909c2a --- /dev/null +++ b/packages/babel-types/test/builders/typescript/tsTypeParameter.js @@ -0,0 +1,24 @@ +import * as t from "../../.."; + +describe("builders", function() { + describe("typescript", function() { + describe("tsTypeParameter", function() { + it("accept name as argument for tsTypeParameter", function() { + const tsTypeParameter = t.tsTypeParameter( + t.tsTypeReference(t.identifier("bar")), + t.tsTypeReference(t.identifier("baz")), + "foo", + ); + expect(tsTypeParameter).toMatchSnapshot(); + }); + it("throws when name is missing", function() { + expect(() => { + t.tsTypeParameter( + t.tsTypeReference(t.identifier("bar")), + t.tsTypeReference(t.identifier("baz")), + ); + }).toThrow("Property name expected type of string but got null"); + }); + }); + }); +}); From 11ed2e2bf572c5748b1bef47d748da97f7e0bedb Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 19 Aug 2019 03:31:37 -0400 Subject: [PATCH 022/965] readme: links/contributing updates (#10206) [skip ci] * readme: links/contributing updates * Update README.md --- README.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 579b85a7cd88..51315b7a7e12 100644 --- a/README.md +++ b/README.md @@ -80,14 +80,14 @@ Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGD Mostly a handful of volunteers, funded by you! Please check out our [team page](https://babeljs.io/team)! -### Looking for support? - -For questions and support please join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs). - ### Is there a Babel song? I'm so glad you asked: [Hallelujah —— In Praise of Babel](SONG.md) by [@angus-c](https://github.com/angus-c), [audio version](https://youtu.be/40abpedBKK8) by [@swyx](https://twitter.com/@swyx). Tweet us your recordings! +### Looking for support? + +For questions and support please join our [Slack Community](https://slack.babeljs.io/) (you can sign-up [here](https://slack.babeljs.io/) for an invite), ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/babeljs), or ping us on [Twitter](https://twitter.com/babeljs). + ### Where are the docs? Check out our website: [babeljs.io](https://babeljs.io/), and report issues/features at [babel/website](https://github.com/babel/website/issues). @@ -98,12 +98,19 @@ Please read through our [CONTRIBUTING.md](CONTRIBUTING.md) and fill out the issu ### Want to contribute to Babel? -Check out our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo. +Check out: + +- Our [#development](https://babeljs.slack.com/messages/development) Slack channel and say hi ([signup](https://slack.babeljs.io))! +- Issues with the [good first issue](https://github.com/babel/babel/labels/good%20first%20issue) and [help wanted](https://github.com/babel/babel/labels/help%20wanted) label. We suggest also looking at the [closed ones](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aclosed+label%3A%22good+first+issue%22) to get a sense of the kinds of issues you can tackle. + +Some resources: -- If you have already joined Slack, join our [#development](https://babeljs.slack.com/messages/development) channel and say hi! -- Check out the issues with the [good first issue](https://github.com/babel/babel/labels/good%20first%20issue) and [help wanted](https://github.com/babel/babel/labels/help%20wanted) label. We suggest also looking at the closed ones to get a sense of the kinds of issues you can tackle. +- Our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo. - Our discussions/notes/roadmap: [babel/notes](https://github.com/babel/notes) - Our progress on TC39 proposals: [babel/proposals](https://github.com/babel/proposals) +- Our blog which contains release posts and explainations: [/blog](https://babeljs.io/blog) +- Our videos page with talks about open source and Babel: [/videos](https://babeljs.io/videos) +- Our [podcast](https://podcast.babeljs.io) ### How is the repo structured? From 15aa511b8e2190da18970784f3f7a3352ba981b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 21 Aug 2019 00:22:47 +0200 Subject: [PATCH 023/965] Do not register ambient classes to the TS scope (#10352) --- packages/babel-parser/src/parser/statement.js | 4 +- .../src/plugins/typescript/index.js | 15 +- .../src/plugins/typescript/scope.js | 2 +- packages/babel-parser/src/util/scopeflags.js | 6 +- .../scope/callable-class-ambient/input.ts | 2 + .../scope/callable-class-ambient/output.json | 151 +++++++++++++++++ .../typescript/scope/callable-class/input.ts | 2 + .../scope/callable-class/output.json | 137 ++++++++++++++++ .../input.ts | 3 + .../output.json | 154 ++++++++++++++++++ 10 files changed, 468 insertions(+), 8 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/callable-class/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index b677bfd0c9e2..3e950d26578b 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -20,6 +20,7 @@ import { SCOPE_OTHER, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, + type BindingTypes, } from "../util/scopeflags"; const loopLabel = { kind: "loop" }, @@ -1611,11 +1612,12 @@ export default class StatementParser extends ExpressionParser { node: N.Class, isStatement: boolean, optionalId: ?boolean, + bindingType: BindingTypes = BIND_CLASS, ): void { if (this.match(tt.name)) { node.id = this.parseIdentifier(); if (isStatement) { - this.checkLVal(node.id, BIND_CLASS, undefined, "class name"); + this.checkLVal(node.id, bindingType, undefined, "class name"); } } else { if (optionalId || !isStatement) { diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 078797d74bb0..5d6922d329eb 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -14,8 +14,9 @@ import { BIND_TS_CONST_ENUM, BIND_TS_TYPE, BIND_TS_INTERFACE, - BIND_TS_FN_TYPE, + BIND_TS_AMBIENT, BIND_TS_NAMESPACE, + BIND_CLASS, } from "../../util/scopeflags"; import TypeScriptScopeHandler from "./scope"; @@ -1278,6 +1279,9 @@ export default (superClass: Class): Class => /* declarationPosition */ true, ); case tt._class: + // While this is also set by tsParseExpressionStatement, we need to set it + // before parsing the class declaration to now how to register it in the scope. + nany.declare = true; return this.parseClass( nany, /* isStatement */ true, @@ -1552,7 +1556,7 @@ export default (superClass: Class): Class => checkFunctionStatementId(node: N.Function): void { if (!node.body && node.id) { - this.checkLVal(node.id, BIND_TS_FN_TYPE, null, "function name"); + this.checkLVal(node.id, BIND_TS_AMBIENT, null, "function name"); } else { super.checkFunctionStatementId(...arguments); } @@ -1988,7 +1992,12 @@ export default (superClass: Class): Class => return; } - super.parseClassId(...arguments); + super.parseClassId( + node, + isStatement, + optionalId, + (node: any).declare ? BIND_TS_AMBIENT : BIND_CLASS, + ); const typeParameters = this.tsTryParseTypeParameters(); if (typeParameters) node.typeParameters = typeParameters; } diff --git a/packages/babel-parser/src/plugins/typescript/scope.js b/packages/babel-parser/src/plugins/typescript/scope.js index f706f1e88e99..085b90e73496 100644 --- a/packages/babel-parser/src/plugins/typescript/scope.js +++ b/packages/babel-parser/src/plugins/typescript/scope.js @@ -25,7 +25,7 @@ class TypeScriptScope extends Scope { // classes (which are also in .lexical) and interface (which are also in .types) classes: string[] = []; - // namespaces and bodyless-functions are too difficult to track, + // namespaces and ambient functions (or classes) are too difficult to track, // especially without type analysis. // We need to track them anyway, to avoid "X is not defined" errors // when exporting them. diff --git a/packages/babel-parser/src/util/scopeflags.js b/packages/babel-parser/src/util/scopeflags.js index 8c9697b3a416..43b18f6641e1 100644 --- a/packages/babel-parser/src/util/scopeflags.js +++ b/packages/babel-parser/src/util/scopeflags.js @@ -62,14 +62,14 @@ export const BIND_CLASS = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_ BIND_TS_INTERFACE = 0 | BIND_KIND_TYPE | 0 | BIND_FLAGS_CLASS , BIND_TS_TYPE = 0 | BIND_KIND_TYPE | 0 | 0 , BIND_TS_ENUM = BIND_KIND_VALUE | BIND_KIND_TYPE | BIND_SCOPE_LEXICAL | BIND_FLAGS_TS_ENUM, - BIND_TS_FN_TYPE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, + BIND_TS_AMBIENT = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY, // These bindings don't introduce anything in the scope. They are used for assignments and // function expressions IDs. BIND_NONE = 0 | 0 | 0 | BIND_FLAGS_NONE , BIND_OUTSIDE = BIND_KIND_VALUE | 0 | 0 | BIND_FLAGS_NONE , BIND_TS_CONST_ENUM = BIND_TS_ENUM | BIND_FLAGS_TS_CONST_ENUM, - BIND_TS_NAMESPACE = BIND_TS_FN_TYPE; + BIND_TS_NAMESPACE = 0 | 0 | 0 | BIND_FLAGS_TS_EXPORT_ONLY; export type BindingTypes = | typeof BIND_NONE @@ -81,5 +81,5 @@ export type BindingTypes = | typeof BIND_TS_INTERFACE | typeof BIND_TS_TYPE | typeof BIND_TS_ENUM - | typeof BIND_TS_FN_TYPE + | typeof BIND_TS_AMBIENT | typeof BIND_TS_NAMESPACE; diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/input.ts b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/input.ts new file mode 100644 index 000000000000..7714551a2449 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/input.ts @@ -0,0 +1,2 @@ +declare class C { } +declare function C(): void; diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json new file mode 100644 index 000000000000..d62f3bba74be --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class-ambient/output.json @@ -0,0 +1,151 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + }, + "declare": true + }, + { + "type": "TSDeclareFunction", + "start": 20, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "C" + }, + "name": "C" + }, + "generator": false, + "async": false, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start": 40, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "typeAnnotation": { + "type": "TSVoidKeyword", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 26 + } + } + } + }, + "declare": true + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class/input.ts b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/input.ts new file mode 100644 index 000000000000..e54e510e93ff --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/input.ts @@ -0,0 +1,2 @@ +declare class C { } +function C() { } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json new file mode 100644 index 000000000000..205c683a029d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json @@ -0,0 +1,137 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "declare": true, + "id": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 16, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "body": [] + } + }, + { + "type": "FunctionDeclaration", + "start": 20, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "C" + }, + "name": "C" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 33, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/input.ts b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/input.ts new file mode 100644 index 000000000000..e57fcdb01a82 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/input.ts @@ -0,0 +1,3 @@ +import Something from './somewhere.js' + +declare class Something {} diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json new file mode 100644 index 000000000000..fe9e84eee59d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "specifiers": [ + { + "type": "ImportDefaultSpecifier", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 7, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 16 + }, + "identifierName": "Something" + }, + "name": "Something" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "extra": { + "rawValue": "./somewhere.js", + "raw": "'./somewhere.js'" + }, + "value": "./somewhere.js" + } + }, + { + "type": "ClassDeclaration", + "start": 40, + "end": 66, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "declare": true, + "id": { + "type": "Identifier", + "start": 54, + "end": 63, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 23 + }, + "identifierName": "Something" + }, + "name": "Something" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 64, + "end": 66, + "loc": { + "start": { + "line": 3, + "column": 24 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From a2bf68981fbe26a5574607c526818868562fb1f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 21 Aug 2019 00:31:45 +0200 Subject: [PATCH 024/965] Add TSBigIntKeyword to @babel/types (#10341) --- .../src/generators/typescript.js | 3 + .../test/fixtures/regression/10338/input.ts | 4 ++ .../fixtures/regression/10338/options.json | 3 + .../test/fixtures/regression/10338/output.js | 4 ++ .../src/asserts/generated/index.js | 27 ++++---- .../src/builders/generated/index.js | 49 ++++++++------- .../babel-types/src/definitions/typescript.js | 11 ++-- .../src/validators/generated/index.js | 61 ++++++++++++------- 8 files changed, 100 insertions(+), 62 deletions(-) create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/input.ts create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/options.json create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/output.js diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js index 68d31f3d43f3..4ff2fe1ad188 100644 --- a/packages/babel-generator/src/generators/typescript.js +++ b/packages/babel-generator/src/generators/typescript.js @@ -129,6 +129,9 @@ export function TSIndexSignature(node) { export function TSAnyKeyword() { this.word("any"); } +export function TSBigIntKeyword() { + this.word("bigint"); +} export function TSUnknownKeyword() { this.word("unknown"); } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/input.ts new file mode 100644 index 000000000000..36a5d899a6e1 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/input.ts @@ -0,0 +1,4 @@ +const {result} = idArray.reduce( + (a, b) => {}, + {result: [] as (number | bigint)[]}, +) \ No newline at end of file diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/options.json new file mode 100644 index 000000000000..c22d3cb0914c --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-typescript", "transform-destructuring"] +} diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/output.js new file mode 100644 index 000000000000..20db22353cb9 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/regression/10338/output.js @@ -0,0 +1,4 @@ +const _idArray$reduce = idArray.reduce((a, b) => {}, { + result: [] +}), + result = _idArray$reduce.result; diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index c50116b309d5..93c911d9004f 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -794,8 +794,17 @@ export function assertTSIndexSignature(node: Object, opts?: Object = {}): void { export function assertTSAnyKeyword(node: Object, opts?: Object = {}): void { assert("TSAnyKeyword", node, opts); } -export function assertTSUnknownKeyword(node: Object, opts?: Object = {}): void { - assert("TSUnknownKeyword", node, opts); +export function assertTSBooleanKeyword(node: Object, opts?: Object = {}): void { + assert("TSBooleanKeyword", node, opts); +} +export function assertTSBigIntKeyword(node: Object, opts?: Object = {}): void { + assert("TSBigIntKeyword", node, opts); +} +export function assertTSNeverKeyword(node: Object, opts?: Object = {}): void { + assert("TSNeverKeyword", node, opts); +} +export function assertTSNullKeyword(node: Object, opts?: Object = {}): void { + assert("TSNullKeyword", node, opts); } export function assertTSNumberKeyword(node: Object, opts?: Object = {}): void { assert("TSNumberKeyword", node, opts); @@ -803,29 +812,23 @@ export function assertTSNumberKeyword(node: Object, opts?: Object = {}): void { export function assertTSObjectKeyword(node: Object, opts?: Object = {}): void { assert("TSObjectKeyword", node, opts); } -export function assertTSBooleanKeyword(node: Object, opts?: Object = {}): void { - assert("TSBooleanKeyword", node, opts); -} export function assertTSStringKeyword(node: Object, opts?: Object = {}): void { assert("TSStringKeyword", node, opts); } export function assertTSSymbolKeyword(node: Object, opts?: Object = {}): void { assert("TSSymbolKeyword", node, opts); } -export function assertTSVoidKeyword(node: Object, opts?: Object = {}): void { - assert("TSVoidKeyword", node, opts); -} export function assertTSUndefinedKeyword( node: Object, opts?: Object = {}, ): void { assert("TSUndefinedKeyword", node, opts); } -export function assertTSNullKeyword(node: Object, opts?: Object = {}): void { - assert("TSNullKeyword", node, opts); +export function assertTSUnknownKeyword(node: Object, opts?: Object = {}): void { + assert("TSUnknownKeyword", node, opts); } -export function assertTSNeverKeyword(node: Object, opts?: Object = {}): void { - assert("TSNeverKeyword", node, opts); +export function assertTSVoidKeyword(node: Object, opts?: Object = {}): void { + assert("TSVoidKeyword", node, opts); } export function assertTSThisType(node: Object, opts?: Object = {}): void { assert("TSThisType", node, opts); diff --git a/packages/babel-types/src/builders/generated/index.js b/packages/babel-types/src/builders/generated/index.js index e4ca375762cc..af48f24ec876 100644 --- a/packages/babel-types/src/builders/generated/index.js +++ b/packages/babel-types/src/builders/generated/index.js @@ -722,11 +722,26 @@ export function TSAnyKeyword(...args: Array): Object { } export { TSAnyKeyword as tsAnyKeyword }; export { TSAnyKeyword as tSAnyKeyword }; -export function TSUnknownKeyword(...args: Array): Object { - return builder("TSUnknownKeyword", ...args); +export function TSBooleanKeyword(...args: Array): Object { + return builder("TSBooleanKeyword", ...args); } -export { TSUnknownKeyword as tsUnknownKeyword }; -export { TSUnknownKeyword as tSUnknownKeyword }; +export { TSBooleanKeyword as tsBooleanKeyword }; +export { TSBooleanKeyword as tSBooleanKeyword }; +export function TSBigIntKeyword(...args: Array): Object { + return builder("TSBigIntKeyword", ...args); +} +export { TSBigIntKeyword as tsBigIntKeyword }; +export { TSBigIntKeyword as tSBigIntKeyword }; +export function TSNeverKeyword(...args: Array): Object { + return builder("TSNeverKeyword", ...args); +} +export { TSNeverKeyword as tsNeverKeyword }; +export { TSNeverKeyword as tSNeverKeyword }; +export function TSNullKeyword(...args: Array): Object { + return builder("TSNullKeyword", ...args); +} +export { TSNullKeyword as tsNullKeyword }; +export { TSNullKeyword as tSNullKeyword }; export function TSNumberKeyword(...args: Array): Object { return builder("TSNumberKeyword", ...args); } @@ -737,11 +752,6 @@ export function TSObjectKeyword(...args: Array): Object { } export { TSObjectKeyword as tsObjectKeyword }; export { TSObjectKeyword as tSObjectKeyword }; -export function TSBooleanKeyword(...args: Array): Object { - return builder("TSBooleanKeyword", ...args); -} -export { TSBooleanKeyword as tsBooleanKeyword }; -export { TSBooleanKeyword as tSBooleanKeyword }; export function TSStringKeyword(...args: Array): Object { return builder("TSStringKeyword", ...args); } @@ -752,26 +762,21 @@ export function TSSymbolKeyword(...args: Array): Object { } export { TSSymbolKeyword as tsSymbolKeyword }; export { TSSymbolKeyword as tSSymbolKeyword }; -export function TSVoidKeyword(...args: Array): Object { - return builder("TSVoidKeyword", ...args); -} -export { TSVoidKeyword as tsVoidKeyword }; -export { TSVoidKeyword as tSVoidKeyword }; export function TSUndefinedKeyword(...args: Array): Object { return builder("TSUndefinedKeyword", ...args); } export { TSUndefinedKeyword as tsUndefinedKeyword }; export { TSUndefinedKeyword as tSUndefinedKeyword }; -export function TSNullKeyword(...args: Array): Object { - return builder("TSNullKeyword", ...args); +export function TSUnknownKeyword(...args: Array): Object { + return builder("TSUnknownKeyword", ...args); } -export { TSNullKeyword as tsNullKeyword }; -export { TSNullKeyword as tSNullKeyword }; -export function TSNeverKeyword(...args: Array): Object { - return builder("TSNeverKeyword", ...args); +export { TSUnknownKeyword as tsUnknownKeyword }; +export { TSUnknownKeyword as tSUnknownKeyword }; +export function TSVoidKeyword(...args: Array): Object { + return builder("TSVoidKeyword", ...args); } -export { TSNeverKeyword as tsNeverKeyword }; -export { TSNeverKeyword as tSNeverKeyword }; +export { TSVoidKeyword as tsVoidKeyword }; +export { TSVoidKeyword as tSVoidKeyword }; export function TSThisType(...args: Array): Object { return builder("TSThisType", ...args); } diff --git a/packages/babel-types/src/definitions/typescript.js b/packages/babel-types/src/definitions/typescript.js index 9f0625d12320..af34dbfc6255 100644 --- a/packages/babel-types/src/definitions/typescript.js +++ b/packages/babel-types/src/definitions/typescript.js @@ -128,16 +128,17 @@ defineType("TSIndexSignature", { const tsKeywordTypes = [ "TSAnyKeyword", - "TSUnknownKeyword", + "TSBooleanKeyword", + "TSBigIntKeyword", + "TSNeverKeyword", + "TSNullKeyword", "TSNumberKeyword", "TSObjectKeyword", - "TSBooleanKeyword", "TSStringKeyword", "TSSymbolKeyword", - "TSVoidKeyword", "TSUndefinedKeyword", - "TSNullKeyword", - "TSNeverKeyword", + "TSUnknownKeyword", + "TSVoidKeyword", ]; for (const type of tsKeywordTypes) { diff --git a/packages/babel-types/src/validators/generated/index.js b/packages/babel-types/src/validators/generated/index.js index 076495d5cb28..259e37d90430 100644 --- a/packages/babel-types/src/validators/generated/index.js +++ b/packages/babel-types/src/validators/generated/index.js @@ -2523,11 +2523,11 @@ export function isTSAnyKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSUnknownKeyword(node: ?Object, opts?: Object): boolean { +export function isTSBooleanKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSUnknownKeyword") { + if (nodeType === "TSBooleanKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2537,11 +2537,11 @@ export function isTSUnknownKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSNumberKeyword(node: ?Object, opts?: Object): boolean { +export function isTSBigIntKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNumberKeyword") { + if (nodeType === "TSBigIntKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2551,11 +2551,11 @@ export function isTSNumberKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSObjectKeyword(node: ?Object, opts?: Object): boolean { +export function isTSNeverKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSObjectKeyword") { + if (nodeType === "TSNeverKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2565,11 +2565,11 @@ export function isTSObjectKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSBooleanKeyword(node: ?Object, opts?: Object): boolean { +export function isTSNullKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSBooleanKeyword") { + if (nodeType === "TSNullKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2579,11 +2579,11 @@ export function isTSBooleanKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSStringKeyword(node: ?Object, opts?: Object): boolean { +export function isTSNumberKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSStringKeyword") { + if (nodeType === "TSNumberKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2593,11 +2593,11 @@ export function isTSStringKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSSymbolKeyword(node: ?Object, opts?: Object): boolean { +export function isTSObjectKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSSymbolKeyword") { + if (nodeType === "TSObjectKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2607,11 +2607,25 @@ export function isTSSymbolKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSVoidKeyword(node: ?Object, opts?: Object): boolean { +export function isTSStringKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSVoidKeyword") { + if (nodeType === "TSStringKeyword") { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; +} +export function isTSSymbolKeyword(node: ?Object, opts?: Object): boolean { + if (!node) return false; + + const nodeType = node.type; + if (nodeType === "TSSymbolKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2635,11 +2649,11 @@ export function isTSUndefinedKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSNullKeyword(node: ?Object, opts?: Object): boolean { +export function isTSUnknownKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNullKeyword") { + if (nodeType === "TSUnknownKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -2649,11 +2663,11 @@ export function isTSNullKeyword(node: ?Object, opts?: Object): boolean { return false; } -export function isTSNeverKeyword(node: ?Object, opts?: Object): boolean { +export function isTSVoidKeyword(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "TSNeverKeyword") { + if (nodeType === "TSVoidKeyword") { if (typeof opts === "undefined") { return true; } else { @@ -4326,16 +4340,17 @@ export function isTSType(node: ?Object, opts?: Object): boolean { if ( nodeType === "TSType" || "TSAnyKeyword" === nodeType || - "TSUnknownKeyword" === nodeType || + "TSBooleanKeyword" === nodeType || + "TSBigIntKeyword" === nodeType || + "TSNeverKeyword" === nodeType || + "TSNullKeyword" === nodeType || "TSNumberKeyword" === nodeType || "TSObjectKeyword" === nodeType || - "TSBooleanKeyword" === nodeType || "TSStringKeyword" === nodeType || "TSSymbolKeyword" === nodeType || - "TSVoidKeyword" === nodeType || "TSUndefinedKeyword" === nodeType || - "TSNullKeyword" === nodeType || - "TSNeverKeyword" === nodeType || + "TSUnknownKeyword" === nodeType || + "TSVoidKeyword" === nodeType || "TSThisType" === nodeType || "TSFunctionType" === nodeType || "TSConstructorType" === nodeType || From 1664cce6811a7aa856e9cf382b3774fd1384d066 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Mon, 26 Aug 2019 13:16:22 -0400 Subject: [PATCH 025/965] Don't allow JSXNamespacedName to chain (#10366) Eg, `namespace:foo.bar` used to parse but is invalid in the [spec](https://facebook.github.io/jsx/). Also, allow `JSXNamespacedName` in the `JSXOpeningElement`/`JSXClosingElement` builders. --- packages/babel-parser/src/plugins/jsx/index.js | 8 +++++++- .../jsx/errors/member-in-namespace-1/input.js | 1 + .../jsx/errors/member-in-namespace-1/options.json | 3 +++ .../jsx/errors/member-in-namespace-2/input.js | 1 + .../jsx/errors/member-in-namespace-2/options.json | 3 +++ packages/babel-types/src/definitions/jsx.js | 12 ++++++++++-- 6 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/input.js create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/options.json create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/input.js create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/options.json diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index 5d3c2ec2ece1..4daa31ef545d 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -250,10 +250,16 @@ export default (superClass: Class): Class => // Parses element name in any form - namespaced, member // or single identifier. - jsxParseElementName(): N.JSXNamespacedName | N.JSXMemberExpression { + jsxParseElementName(): + | N.JSXIdentifier + | N.JSXNamespacedName + | N.JSXMemberExpression { const startPos = this.state.start; const startLoc = this.state.startLoc; let node = this.jsxParseNamespacedName(); + if (node.type === "JSXNamespacedName") { + return node; + } while (this.eat(tt.dot)) { const newNode = this.startNodeAt(startPos, startLoc); newNode.object = node; diff --git a/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/input.js b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/input.js new file mode 100644 index 000000000000..abb989b65a36 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/input.js @@ -0,0 +1 @@ + diff --git a/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/options.json b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/options.json new file mode 100644 index 000000000000..27a7b64d71d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-1/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} diff --git a/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/input.js b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/input.js new file mode 100644 index 000000000000..fc13a07cc754 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/input.js @@ -0,0 +1 @@ + diff --git a/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/options.json b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/options.json new file mode 100644 index 000000000000..27a7b64d71d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/member-in-namespace-2/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token (1:4)" +} diff --git a/packages/babel-types/src/definitions/jsx.js b/packages/babel-types/src/definitions/jsx.js index 776714c873f7..a088f03c1929 100644 --- a/packages/babel-types/src/definitions/jsx.js +++ b/packages/babel-types/src/definitions/jsx.js @@ -30,7 +30,11 @@ defineType("JSXClosingElement", { aliases: ["JSX", "Immutable"], fields: { name: { - validate: assertNodeType("JSXIdentifier", "JSXMemberExpression"), + validate: assertNodeType( + "JSXIdentifier", + "JSXMemberExpression", + "JSXNamespacedName", + ), }, }, }); @@ -130,7 +134,11 @@ defineType("JSXOpeningElement", { aliases: ["JSX", "Immutable"], fields: { name: { - validate: assertNodeType("JSXIdentifier", "JSXMemberExpression"), + validate: assertNodeType( + "JSXIdentifier", + "JSXMemberExpression", + "JSXNamespacedName", + ), }, selfClosing: { default: false, From 94e47c30a9b056c1702e51b801545630c3c3df04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2019 09:50:33 +0200 Subject: [PATCH 026/965] Bump eslint-utils from 1.4.0 to 1.4.2 (#10370) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2) Signed-off-by: dependabot[bot] --- yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yarn.lock b/yarn.lock index e9c8313a4122..04555a378a69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4321,16 +4321,16 @@ eslint-scope@^4.0.3: estraverse "^4.1.1" eslint-utils@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" - integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + version "1.4.2" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" + integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== dependencies: eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== eslint@^6.0.1: version "6.0.1" From 8a775a32ba3dc74c3bb784550ff9a78bdc98e47d Mon Sep 17 00:00:00 2001 From: Shrey Banga Date: Wed, 28 Aug 2019 11:03:37 -0700 Subject: [PATCH 027/965] Retain trailing comments in array expressions (#10369) * Retain trailing comments in array expressions This is a proposed fix for https://github.com/babel/babel/issues/10368 with a simple test. * Move lastElement in the block where it's used * Test trailing comment after array expression * Don't move comments after the array expression * Retain trailing comment after the array expression --- packages/babel-parser/src/parser/comments.js | 28 +- .../array-expression-trailing-comma/input.js | 18 + .../output.json | 702 ++++++++++++++++++ 3 files changed, 747 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 5ef57efe2fd9..60f3c1a23f9b 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -86,7 +86,7 @@ export default class CommentsParser extends BaseParser { // Attach comments that follow a trailing comma on the last // property in an object literal or a trailing comma in function arguments - // as trailing comments + // or a trailing comma in array expressions as trailing comments if (firstChild && this.state.leadingComments.length > 0) { const lastComment = last(this.state.leadingComments); @@ -137,6 +137,32 @@ export default class CommentsParser extends BaseParser { } } } + } else if (node.type === "ArrayExpression" && node.elements.length > 0) { + if (this.state.commentPreviousNode) { + for (j = 0; j < this.state.leadingComments.length; j++) { + if ( + this.state.leadingComments[j].end < + this.state.commentPreviousNode.end + ) { + this.state.leadingComments.splice(j, 1); + j--; + } + } + + const lastElement = last(node.elements); + lastElement.trailingComments = []; + while (this.state.leadingComments.length) { + const leadingComment = this.state.leadingComments.shift(); + if (leadingComment.end < node.end) { + lastElement.trailingComments.push(leadingComment); + } else { + if (node.trailingComments === undefined) { + node.trailingComments = []; + } + node.trailingComments.push(leadingComment); + } + } + } } } diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/input.js b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/input.js new file mode 100644 index 000000000000..bc0802b8addd --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/input.js @@ -0,0 +1,18 @@ +const nonTrailing = [ + "One", // One + // Two + "Two" // Three + // Four +] + +const trailingAfterComma = [ + "One", // One + // Two + "Two", // Three + // Four +] + +const trailingAfterArray = [ + "One", // One + // Two +] // Three diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json new file mode 100644 index 000000000000..90428301c81b --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json @@ -0,0 +1,702 @@ +{ + "type": "File", + "start": 0, + "end": 229, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 18, + "column": 10 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 229, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 18, + "column": 10 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "nonTrailing" + }, + "name": "nonTrailing" + }, + "init": { + "type": "ArrayExpression", + "start": 20, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "elements": [ + { + "type": "StringLiteral", + "start": 24, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + } + }, + "extra": { + "rawValue": "One", + "raw": "\"One\"" + }, + "value": "One" + }, + { + "type": "StringLiteral", + "start": 50, + "end": 55, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + } + }, + "extra": { + "rawValue": "Two", + "raw": "\"Two\"" + }, + "value": "Two", + "leadingComments": [ + { + "type": "CommentLine", + "value": " One", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 9 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentLine", + "value": " Three", + "start": 56, + "end": 64, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 16 + } + } + }, + { + "type": "CommentLine", + "value": " Four", + "start": 67, + "end": 74, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 9 + } + } + } + ] + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 78, + "end": 162, + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 84, + "end": 162, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 84, + "end": 102, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 24 + }, + "identifierName": "trailingAfterComma" + }, + "name": "trailingAfterComma" + }, + "init": { + "type": "ArrayExpression", + "start": 105, + "end": 162, + "loc": { + "start": { + "line": 8, + "column": 27 + }, + "end": { + "line": 13, + "column": 1 + } + }, + "elements": [ + { + "type": "StringLiteral", + "start": 109, + "end": 114, + "loc": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 9, + "column": 7 + } + }, + "extra": { + "rawValue": "One", + "raw": "\"One\"" + }, + "value": "One" + }, + { + "type": "StringLiteral", + "start": 135, + "end": 140, + "loc": { + "start": { + "line": 11, + "column": 2 + }, + "end": { + "line": 11, + "column": 7 + } + }, + "extra": { + "rawValue": "Two", + "raw": "\"Two\"" + }, + "value": "Two", + "leadingComments": [ + { + "type": "CommentLine", + "value": " One", + "start": 116, + "end": 122, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 126, + "end": 132, + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 9 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentLine", + "value": " Three", + "start": 142, + "end": 150, + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "CommentLine", + "value": " Four", + "start": 153, + "end": 160, + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 9 + } + } + } + ] + } + ] + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 164, + "end": 220, + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 170, + "end": 220, + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 170, + "end": 188, + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 24 + }, + "identifierName": "trailingAfterArray" + }, + "name": "trailingAfterArray" + }, + "init": { + "type": "ArrayExpression", + "start": 191, + "end": 220, + "loc": { + "start": { + "line": 15, + "column": 27 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "elements": [ + { + "type": "StringLiteral", + "start": 195, + "end": 200, + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 16, + "column": 7 + } + }, + "extra": { + "rawValue": "One", + "raw": "\"One\"" + }, + "value": "One", + "trailingComments": [ + { + "type": "CommentLine", + "value": " One", + "start": 202, + "end": 208, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 212, + "end": 218, + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 17, + "column": 9 + } + } + } + ] + } + ] + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentLine", + "value": " Three", + "start": 221, + "end": 229, + "loc": { + "start": { + "line": 18, + "column": 2 + }, + "end": { + "line": 18, + "column": 10 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " One", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 9 + } + } + }, + { + "type": "CommentLine", + "value": " Three", + "start": 56, + "end": 64, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 16 + } + } + }, + { + "type": "CommentLine", + "value": " Four", + "start": 67, + "end": 74, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 9 + } + } + }, + { + "type": "CommentLine", + "value": " One", + "start": 116, + "end": 122, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 126, + "end": 132, + "loc": { + "start": { + "line": 10, + "column": 3 + }, + "end": { + "line": 10, + "column": 9 + } + } + }, + { + "type": "CommentLine", + "value": " Three", + "start": 142, + "end": 150, + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 17 + } + } + }, + { + "type": "CommentLine", + "value": " Four", + "start": 153, + "end": 160, + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 12, + "column": 9 + } + } + }, + { + "type": "CommentLine", + "value": " One", + "start": 202, + "end": 208, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 15 + } + } + }, + { + "type": "CommentLine", + "value": " Two", + "start": 212, + "end": 218, + "loc": { + "start": { + "line": 17, + "column": 3 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + { + "type": "CommentLine", + "value": " Three", + "start": 221, + "end": 229, + "loc": { + "start": { + "line": 18, + "column": 2 + }, + "end": { + "line": 18, + "column": 10 + } + } + } + ] +} \ No newline at end of file From 7c0333e12a0cbce18bd5e721981e2902d41bc308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 2 Sep 2019 12:41:55 +0200 Subject: [PATCH 028/965] Move preset-env old changelog Fixes #9730 --- .../CHANGELOG.md => .github/CHANGELO-preset-env-v0-v1.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/babel-preset-env/CHANGELOG.md => .github/CHANGELO-preset-env-v0-v1.md (100%) diff --git a/packages/babel-preset-env/CHANGELOG.md b/.github/CHANGELO-preset-env-v0-v1.md similarity index 100% rename from packages/babel-preset-env/CHANGELOG.md rename to .github/CHANGELO-preset-env-v0-v1.md From e7fa566442e0bf650e14a64ffcf10da193af1e95 Mon Sep 17 00:00:00 2001 From: Thiago Arrais Date: Mon, 2 Sep 2019 16:58:54 -0300 Subject: [PATCH 029/965] Includes test for #8354 (#10385) --- .../test/fixtures/regression/8354/exec.js | 5 +++++ .../test/fixtures/regression/8354/options.json | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/exec.js create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/exec.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/exec.js new file mode 100644 index 000000000000..c050ed412a62 --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/exec.js @@ -0,0 +1,5 @@ +const foo = undefined; +const bar = 'bar'; +const foobar = foo?.replace(`foo${bar}`, ''); + +expect(foobar).toBe(undefined); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json new file mode 100644 index 000000000000..8d2ec02da0e8 --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["proposal-optional-chaining", "transform-template-literals"] +} \ No newline at end of file From e5afa57ccad38ab961cfdc9a1886509916537e4c Mon Sep 17 00:00:00 2001 From: Dylan Kirkby Date: Mon, 2 Sep 2019 17:33:01 -0700 Subject: [PATCH 030/965] Allow setting 'allowNamespaces' in typescript preset (#10382) * Support 'allowNamespaces' in typescript preset * Remove default for allowNamespaces --- packages/babel-preset-typescript/src/index.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/babel-preset-typescript/src/index.js b/packages/babel-preset-typescript/src/index.js index ebbb2390fde1..bb1687e623c4 100644 --- a/packages/babel-preset-typescript/src/index.js +++ b/packages/babel-preset-typescript/src/index.js @@ -2,7 +2,10 @@ import { declare } from "@babel/helper-plugin-utils"; import transformTypeScript from "@babel/plugin-transform-typescript"; export default declare( - (api, { jsxPragma, allExtensions = false, isTSX = false }) => { + ( + api, + { jsxPragma, allExtensions = false, isTSX = false, allowNamespaces }, + ) => { api.assertVersion(7); if (typeof allExtensions !== "boolean") { @@ -20,7 +23,9 @@ export default declare( overrides: allExtensions ? [ { - plugins: [[transformTypeScript, { jsxPragma, isTSX }]], + plugins: [ + [transformTypeScript, { jsxPragma, isTSX, allowNamespaces }], + ], }, ] : [ @@ -28,13 +33,18 @@ export default declare( // Only set 'test' if explicitly requested, since it requires that // Babel is being called` test: /\.ts$/, - plugins: [[transformTypeScript, { jsxPragma }]], + plugins: [[transformTypeScript, { jsxPragma, allowNamespaces }]], }, { // Only set 'test' if explicitly requested, since it requires that // Babel is being called` test: /\.tsx$/, - plugins: [[transformTypeScript, { jsxPragma, isTSX: true }]], + plugins: [ + [ + transformTypeScript, + { jsxPragma, isTSX: true, allowNamespaces }, + ], + ], }, ], }; From c0e3fa008145b255b72df7d86c1df5a5f77d78d4 Mon Sep 17 00:00:00 2001 From: Shrey Banga Date: Mon, 2 Sep 2019 17:35:15 -0700 Subject: [PATCH 031/965] Refactor trailing comma comment adjustment (#10380) * Refactor trailing comment adjustment Following up from https://github.com/babel/babel/pull/10369 - Unify the logic for adjusting trailing comments into a separate function - Use it for all three cases, which fixes a bug for ObjectExpressions and CallExpressions - Update tests to check for the fixed bug * Fix tests - Only modify trailingComments if necessary - Update snapshots of a couple of affected tests * Drop the underscore in adjustCommentsAfterTrailingComma_ * Handle ArrayPattern * Handle ObjectPattern * Handle import and export declarations These have to be handled a bit differently, because the node is visited after the and before the declaration. So we intercept when we are going from the last specifier to the source node. * Remove unnecessary check --- packages/babel-parser/src/parser/comments.js | 144 ++++----- .../array-pattern-trailing-comma/input.js | 6 + .../array-pattern-trailing-comma/output.json | 254 +++++++++++++++ .../input.js | 2 +- .../output.json | 62 +++- .../basic/function-trailing-comma/input.js | 2 +- .../basic/function-trailing-comma/output.json | 62 +++- .../object-expression-trailing-comma/input.js | 6 + .../output.json | 292 ++++++++++++++++++ .../object-property-trailing-comma/input.js | 2 +- .../output.json | 44 ++- .../output.json | 20 +- .../comments/regression/10230/output.json | 60 ++-- .../input.js | 5 + .../output.json | 256 +++++++++++++++ .../input.js | 5 + .../output.json | 255 +++++++++++++++ 17 files changed, 1322 insertions(+), 155 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json create mode 100644 packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/input.js create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/input.js create mode 100644 packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 60f3c1a23f9b..bdeac9c140cb 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -38,6 +38,45 @@ export default class CommentsParser extends BaseParser { this.state.leadingComments.push(comment); } + adjustCommentsAfterTrailingComma(node: Node, elements: Node[]) { + if (elements.length === 0) { + return; + } + if (this.state.leadingComments.length === 0) { + return; + } + + const lastElement = last(elements); + + for (let j = 0; j < this.state.leadingComments.length; j++) { + if ( + this.state.leadingComments[j].end < this.state.commentPreviousNode.end + ) { + this.state.leadingComments.splice(j, 1); + j--; + } + } + + const newTrailingComments = []; + while (this.state.leadingComments.length) { + const leadingComment = this.state.leadingComments.shift(); + if (leadingComment.end < node.end) { + newTrailingComments.push(leadingComment); + } else { + if (node.trailingComments === undefined) { + node.trailingComments = []; + } + node.trailingComments.push(leadingComment); + } + } + + if (newTrailingComments.length > 0) { + lastElement.trailingComments = newTrailingComments; + } else if (lastElement.trailingComments !== undefined) { + lastElement.trailingComments = []; + } + } + processComment(node: Node): void { if (node.type === "Program" && node.body.length > 0) return; @@ -84,86 +123,33 @@ export default class CommentsParser extends BaseParser { if (!lastChild && firstChild) lastChild = firstChild; - // Attach comments that follow a trailing comma on the last - // property in an object literal or a trailing comma in function arguments - // or a trailing comma in array expressions as trailing comments - if (firstChild && this.state.leadingComments.length > 0) { - const lastComment = last(this.state.leadingComments); - - if (firstChild.type === "ObjectProperty") { - if (lastComment.start >= node.start && lastComment.end <= node.end) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if ( - this.state.leadingComments[j].end < - this.state.commentPreviousNode.end - ) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - if (this.state.leadingComments.length > 0) { - firstChild.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } else if ( - node.type === "CallExpression" && - node.arguments && - node.arguments.length - ) { - const lastArg = last(node.arguments); - - if ( - lastArg && - lastComment.start >= lastArg.start && - lastComment.end <= node.end - ) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if ( - this.state.leadingComments[j].end < - this.state.commentPreviousNode.end - ) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - if (this.state.leadingComments.length > 0) { - lastArg.trailingComments = this.state.leadingComments; - this.state.leadingComments = []; - } - } - } - } else if (node.type === "ArrayExpression" && node.elements.length > 0) { - if (this.state.commentPreviousNode) { - for (j = 0; j < this.state.leadingComments.length; j++) { - if ( - this.state.leadingComments[j].end < - this.state.commentPreviousNode.end - ) { - this.state.leadingComments.splice(j, 1); - j--; - } - } - - const lastElement = last(node.elements); - lastElement.trailingComments = []; - while (this.state.leadingComments.length) { - const leadingComment = this.state.leadingComments.shift(); - if (leadingComment.end < node.end) { - lastElement.trailingComments.push(leadingComment); - } else { - if (node.trailingComments === undefined) { - node.trailingComments = []; - } - node.trailingComments.push(leadingComment); - } - } - } + // Adjust comments that follow a trailing comma on the last element in a + // comma separated list of nodes to be the trailing comments on the last + // element + if (firstChild) { + switch (node.type) { + case "ObjectExpression": + case "ObjectPattern": + this.adjustCommentsAfterTrailingComma(node, node.properties); + break; + case "CallExpression": + this.adjustCommentsAfterTrailingComma(node, node.arguments); + break; + case "ArrayExpression": + case "ArrayPattern": + this.adjustCommentsAfterTrailingComma(node, node.elements); + break; } + } else if ( + this.state.commentPreviousNode && + ((this.state.commentPreviousNode.type === "ImportSpecifier" && + node.type !== "ImportSpecifier") || + (this.state.commentPreviousNode.type === "ExportSpecifier" && + node.type !== "ExportSpecifier")) + ) { + this.adjustCommentsAfterTrailingComma(node, [ + this.state.commentPreviousNode, + ]); } if (lastChild) { diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/input.js b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/input.js new file mode 100644 index 000000000000..3d234bad027c --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/input.js @@ -0,0 +1,6 @@ +const [ + /* One */ + x + /* Two */, + /* Three */ +] /* Four */ = []; diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json new file mode 100644 index 000000000000..124041c4bb99 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json @@ -0,0 +1,254 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "id": { + "type": "ArrayPattern", + "start": 6, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x", + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Two ", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + } + } + ] + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Four ", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ] + }, + "init": { + "type": "ArrayExpression", + "start": 66, + "end": 68, + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "elements": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Two ", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/input.js b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/input.js index 0936c59b4e55..cbeebe5ee3b6 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/input.js +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/input.js @@ -1 +1 @@ -fn(a, { b }, /* comment */); +fn(a, { b }, /* comment 1 */) /* comment 2 */; diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json index ecc67f22abd0..3e22bc1678e5 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 28, + "end": 46, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 28 + "column": 46 } }, "program": { "type": "Program", "start": 0, - "end": 28, + "end": 46, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 28 + "column": 46 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 28, + "end": 46, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 28 + "column": 46 } }, "expression": { "type": "CallExpression", "start": 0, - "end": 27, + "end": 29, "loc": { "start": { "line": 1, @@ -54,7 +54,7 @@ }, "end": { "line": 1, - "column": 27 + "column": 29 } }, "callee": { @@ -166,9 +166,9 @@ "trailingComments": [ { "type": "CommentBlock", - "value": " comment ", + "value": " comment 1 ", "start": 13, - "end": 26, + "end": 28, "loc": { "start": { "line": 1, @@ -176,12 +176,30 @@ }, "end": { "line": 1, - "column": 26 + "column": 28 } } } ] } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " comment 2 ", + "start": 30, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 45 + } + } + } ] } } @@ -191,9 +209,9 @@ "comments": [ { "type": "CommentBlock", - "value": " comment ", + "value": " comment 1 ", "start": 13, - "end": 26, + "end": 28, "loc": { "start": { "line": 1, @@ -201,7 +219,23 @@ }, "end": { "line": 1, - "column": 26 + "column": 28 + } + } + }, + { + "type": "CommentBlock", + "value": " comment 2 ", + "start": 30, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 30 + }, + "end": { + "line": 1, + "column": 45 } } } diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/input.js b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/input.js index d8611dab0c54..ebebb26100af 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/input.js +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/input.js @@ -1 +1 @@ -fn(a, b, /* comment */); +fn(a, b, /* comment 1 */) /* comment 2*/; diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json index 756beb301cf3..6147660b79f9 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 24, + "end": 41, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 24 + "column": 41 } }, "program": { "type": "Program", "start": 0, - "end": 24, + "end": 41, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 24 + "column": 41 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 24, + "end": 41, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 24 + "column": 41 } }, "expression": { "type": "CallExpression", "start": 0, - "end": 23, + "end": 25, "loc": { "start": { "line": 1, @@ -54,7 +54,7 @@ }, "end": { "line": 1, - "column": 23 + "column": 25 } }, "callee": { @@ -111,9 +111,9 @@ "trailingComments": [ { "type": "CommentBlock", - "value": " comment ", + "value": " comment 1 ", "start": 9, - "end": 22, + "end": 24, "loc": { "start": { "line": 1, @@ -121,12 +121,30 @@ }, "end": { "line": 1, - "column": 22 + "column": 24 } } } ] } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " comment 2", + "start": 26, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 40 + } + } + } ] } } @@ -136,9 +154,9 @@ "comments": [ { "type": "CommentBlock", - "value": " comment ", + "value": " comment 1 ", "start": 9, - "end": 22, + "end": 24, "loc": { "start": { "line": 1, @@ -146,7 +164,23 @@ }, "end": { "line": 1, - "column": 22 + "column": 24 + } + } + }, + { + "type": "CommentBlock", + "value": " comment 2", + "start": 26, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 40 } } } diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/input.js b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/input.js new file mode 100644 index 000000000000..78f80a9968e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/input.js @@ -0,0 +1,6 @@ +const { + /* One */ + x + /* Two */, + /* Three */ +} /* Four */ = {}; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json new file mode 100644 index 000000000000..5f2a5b29b779 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json @@ -0,0 +1,292 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 18 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "id": { + "type": "ObjectPattern", + "start": 6, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "shorthand": true, + "value": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Two ", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + } + } + ], + "extra": { + "shorthand": true + } + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Four ", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ] + }, + "init": { + "type": "ObjectExpression", + "start": 66, + "end": 68, + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "properties": [] + } + } + ], + "kind": "const" + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 10, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Two ", + "start": 26, + "end": 35, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 39, + "end": 50, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 53, + "end": 63, + "loc": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 6, + "column": 12 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/input.js b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/input.js index acd5921a7c0e..695835903290 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/input.js +++ b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/input.js @@ -2,4 +2,4 @@ var obj = { a: '1', // comment 1 b: '2', // comment 2 c: '3', // comment 3 -}; +}; // comment 4 diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json index 0004e27a14fd..82f13bbfed5e 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 83, + "end": 96, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 5, - "column": 2 + "column": 15 } }, "program": { "type": "Program", "start": 0, - "end": 83, + "end": 96, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 5, - "column": 2 + "column": 15 } }, "sourceType": "script", @@ -313,7 +313,25 @@ } } ], - "kind": "var" + "kind": "var", + "trailingComments": [ + { + "type": "CommentLine", + "value": " comment 4", + "start": 84, + "end": 96, + "loc": { + "start": { + "line": 5, + "column": 3 + }, + "end": { + "line": 5, + "column": 15 + } + } + } + ] } ], "directives": [] @@ -366,6 +384,22 @@ "column": 22 } } + }, + { + "type": "CommentLine", + "value": " comment 4", + "start": 84, + "end": 96, + "loc": { + "start": { + "line": 5, + "column": 3 + }, + "end": { + "line": 5, + "column": 15 + } + } } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json index f732250d6daa..4452426a990f 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json @@ -250,25 +250,7 @@ "label": null } ], - "test": null, - "leadingComments": [ - { - "type": "CommentLine", - "value": " comment", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } - } - ] + "test": null } ] } diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json index 0c3dcfdf9744..9e185da12f9c 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json @@ -143,11 +143,47 @@ "raw": "42" }, "value": 42 - } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " One", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 8 + } + } + } + ] } ] } - } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " Two", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + } + } + ] }, { "type": "ExpressionStatement", @@ -179,25 +215,7 @@ "identifierName": "B" }, "name": "B" - }, - "leadingComments": [ - { - "type": "CommentLine", - "value": " Two", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - } - } - ] + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/input.js b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/input.js new file mode 100644 index 000000000000..2524b3f08c75 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/input.js @@ -0,0 +1,5 @@ +export { + /* One */ Foo + /* Two */, + /* Three */ +} /* Four */ from "foo"; diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json new file mode 100644 index 000000000000..a663fd513d11 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-declaration-trailing-comma/output.json @@ -0,0 +1,256 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "local": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "exported": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Two ", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 40, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 54, + "end": 64, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ] + } + ], + "source": { + "type": "StringLiteral", + "start": 70, + "end": 75, + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + }, + "declaration": null + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Two ", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 40, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 54, + "end": 64, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/input.js b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/input.js new file mode 100644 index 000000000000..1b933ff9af5c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/input.js @@ -0,0 +1,5 @@ +import { + /* One */ Foo + /* Two */, + /* Three */ +} /* Four */ from "foo"; diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json new file mode 100644 index 000000000000..a5ebc224c99b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-declaration-trailing-comma/output.json @@ -0,0 +1,255 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 24 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "imported": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "local": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + } + ], + "trailingComments": [ + { + "type": "CommentBlock", + "value": " Two ", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 40, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 54, + "end": 64, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ] + } + ], + "source": { + "type": "StringLiteral", + "start": 70, + "end": 75, + "loc": { + "start": { + "line": 5, + "column": 18 + }, + "end": { + "line": 5, + "column": 23 + } + }, + "extra": { + "rawValue": "foo", + "raw": "\"foo\"" + }, + "value": "foo" + } + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " One ", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Two ", + "start": 27, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 11 + } + } + }, + { + "type": "CommentBlock", + "value": " Three ", + "start": 40, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 13 + } + } + }, + { + "type": "CommentBlock", + "value": " Four ", + "start": 54, + "end": 64, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 12 + } + } + } + ] +} \ No newline at end of file From a08e856804691016b8138481b941d952a18f9f49 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Wed, 4 Sep 2019 21:35:19 +0800 Subject: [PATCH 032/965] fix typescript for babel-types (#10098) * fix typescript for babel-types * fix missing typescript/flow types for babel-types * Add cloneNode to flow.js * Add cloneNode to typescript.js --- .../babel-types/scripts/generators/flow.js | 27 ++++++++++++++++++- .../scripts/generators/typescript.js | 25 ++++++++++++++++- .../src/definitions/experimental.js | 11 ++++++-- 3 files changed, 59 insertions(+), 4 deletions(-) diff --git a/packages/babel-types/scripts/generators/flow.js b/packages/babel-types/scripts/generators/flow.js index 3afacc1dd1a6..d82ced365c66 100644 --- a/packages/babel-types/scripts/generators/flow.js +++ b/packages/babel-types/scripts/generators/flow.js @@ -99,6 +99,14 @@ for (const type in t.NODE_FIELDS) { ", " )}): ${NODE_PREFIX}${type};` ); + } else { + const functionName = toFunctionName(type); + lines.push( + `declare function _${functionName}(${args.join( + ", " + )}): ${NODE_PREFIX}${type};`, + `declare export { _${functionName} as ${functionName} }` + ); } } @@ -116,6 +124,7 @@ lines.push( `declare function validate(n: BabelNode, key: string, value: mixed): void;`, `declare function clone(n: T): T;`, `declare function cloneDeep(n: T): T;`, + `declare function cloneNode(n: T, deep?: boolean): T;`, `declare function removeProperties(n: T, opts: ?{}): void;`, `declare function removePropertiesDeep(n: T, opts: ?{}): T;`, `declare type TraversalAncestors = Array<{ @@ -129,7 +138,23 @@ lines.push( exit?: TraversalHandler, };`.replace(/(^|\n) {2}/g, "$1"), // eslint-disable-next-line - `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;` + `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;`, + `declare function is(type: string, n: BabelNode, opts: Object): boolean;`, + `declare function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, + `declare function isBlockScoped(node: BabelNode): boolean`, + `declare function isImmutable(node: BabelNode): boolean`, + `declare function isLet(node: BabelNode): boolean`, + `declare function isNode(node: ?Object): boolean`, + `declare function isNodesEquivalent(a: any, b: any): boolean`, + `declare function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `declare function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, + `declare function isScope(node: BabelNode, parent: BabelNode): boolean`, + `declare function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, + `declare function isType(nodetype: ?string, targetType: string): boolean`, + `declare function isValidES3Identifier(name: string): boolean`, + `declare function isValidES3Identifier(name: string): boolean`, + `declare function isValidIdentifier(name: string): boolean`, + `declare function isVar(node: BabelNode): boolean` ); for (const type in t.FLIPPED_ALIAS_KEYS) { diff --git a/packages/babel-types/scripts/generators/typescript.js b/packages/babel-types/scripts/generators/typescript.js index 78397d840ca0..35696923e1ae 100644 --- a/packages/babel-types/scripts/generators/typescript.js +++ b/packages/babel-types/scripts/generators/typescript.js @@ -100,6 +100,12 @@ for (const type in t.NODE_FIELDS) { lines.push( `export function ${toFunctionName(type)}(${args.join(", ")}): ${type};` ); + } else { + const functionName = toFunctionName(type); + lines.push( + `declare function _${functionName}(${args.join(", ")}): ${type};`, + `export { _${functionName} as ${functionName}}` + ); } } @@ -121,6 +127,7 @@ lines.push( `export function validate(n: Node, key: string, value: any): void;`, `export function clone(n: T): T;`, `export function cloneDeep(n: T): T;`, + `export function cloneNode(n: T, deep?: boolean): T;`, `export function removeProperties( n: Node, opts?: { preserveComments: boolean } | null @@ -140,7 +147,23 @@ lines.push( exit?: TraversalHandler, };`.replace(/(^|\n) {2}/g, "$1"), // eslint-disable-next-line - `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;` + `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;`, + `export function is(type: string, n: Node, opts: object): boolean;`, + `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`, + `export function isBlockScoped(node: Node): boolean`, + `export function isImmutable(node: Node): boolean`, + `export function isLet(node: Node): boolean`, + `export function isNode(node: ?object): boolean`, + `export function isNodesEquivalent(a: any, b: any): boolean`, + `export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, + `export function isScope(node: Node, parent: Node): boolean`, + `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, + `export function isType(nodetype: ?string, targetType: string): boolean`, + `export function isValidES3Identifier(name: string): boolean`, + `export function isValidES3Identifier(name: string): boolean`, + `export function isValidIdentifier(name: string): boolean`, + `export function isVar(node: Node): boolean` ); for (const type in t.DEPRECATED_KEYS) { diff --git a/packages/babel-types/src/definitions/experimental.js b/packages/babel-types/src/definitions/experimental.js index 32481fffd31b..d344630dcc75 100644 --- a/packages/babel-types/src/definitions/experimental.js +++ b/packages/babel-types/src/definitions/experimental.js @@ -153,8 +153,8 @@ defineType("OptionalCallExpression", { }); defineType("ClassPrivateProperty", { - visitor: ["key", "value"], - builder: ["key", "value"], + visitor: ["key", "value", "decorators"], + builder: ["key", "value", "decorators"], aliases: ["Property", "Private"], fields: { key: { @@ -164,6 +164,13 @@ defineType("ClassPrivateProperty", { validate: assertNodeType("Expression"), optional: true, }, + decorators: { + validate: chain( + assertValueType("array"), + assertEach(assertNodeType("Decorator")), + ), + optional: true, + }, }, }); From 27ba292774261744cbebc9c8d58a794c55c1245f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 4 Sep 2019 22:56:47 +0200 Subject: [PATCH 033/965] Silence remaining test warnings (#10392) --- .../usage-remove-babel-polyfill-import/options.json | 1 + .../usage-remove-babel-polyfill-import/stderr.txt | 11 +++++++++++ .../corejs3/entry-babel-polyfill/options.json | 1 + .../fixtures/corejs3/entry-babel-polyfill/stderr.txt | 2 ++ .../corejs3/entry-require-babel-polyfill/options.json | 1 + .../corejs3/entry-require-babel-polyfill/stderr.txt | 2 ++ .../test/fixtures/modules/auto-esm/options.json | 3 ++- .../test/fixtures/modules/modules-umd/options.json | 1 + .../test/fixtures/modules/modules-umd/stderr.txt | 1 + 9 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/modules/modules-umd/stderr.txt diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/options.json b/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/options.json index fe3e4d6cf9c9..71b68e4379e7 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/options.json +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/stderr.txt b/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/stderr.txt new file mode 100644 index 000000000000..6234fa874573 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-remove-babel-polyfill-import/stderr.txt @@ -0,0 +1,11 @@ +When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed. + Please remove the `import '@babel/polyfill'` call or use `useBuiltIns: 'entry'` instead. + + When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed. + Please remove the `import '@babel/polyfill'` call or use `useBuiltIns: 'entry'` instead. + + When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed. + Please remove the `import '@babel/polyfill'` call or use `useBuiltIns: 'entry'` instead. + + When setting `useBuiltIns: 'usage'`, polyfills are automatically imported when needed. + Please remove the `import '@babel/polyfill'` call or use `useBuiltIns: 'entry'` instead. diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/options.json b/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/options.json index fe930890ee20..1b870fc5224a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/options.json +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/stderr.txt b/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/stderr.txt new file mode 100644 index 000000000000..228f1a052848 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-babel-polyfill/stderr.txt @@ -0,0 +1,2 @@ +`@babel/polyfill` is deprecated. Please, use required parts of `core-js` + and `regenerator-runtime/runtime` separately \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/options.json b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/options.json index bc7cfa8eb23e..fc08c036754a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/options.json +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/stderr.txt b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/stderr.txt new file mode 100644 index 000000000000..eaf553660fd2 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-babel-polyfill/stderr.txt @@ -0,0 +1,2 @@ +`@babel/polyfill` is deprecated. Please, use required parts of `core-js` + and `regenerator-runtime/runtime` separately diff --git a/packages/babel-preset-env/test/fixtures/modules/auto-esm/options.json b/packages/babel-preset-env/test/fixtures/modules/auto-esm/options.json index c4294fee0e57..154ea4199025 100644 --- a/packages/babel-preset-env/test/fixtures/modules/auto-esm/options.json +++ b/packages/babel-preset-env/test/fixtures/modules/auto-esm/options.json @@ -1,7 +1,8 @@ { "caller": { "name": "test-fixture", - "supportsStaticESM": true + "supportsStaticESM": true, + "supportsDynamicImport": true }, "presets": ["env"] } diff --git a/packages/babel-preset-env/test/fixtures/modules/modules-umd/options.json b/packages/babel-preset-env/test/fixtures/modules/modules-umd/options.json index 18b39b6fa2e9..d4838a7e7e06 100644 --- a/packages/babel-preset-env/test/fixtures/modules/modules-umd/options.json +++ b/packages/babel-preset-env/test/fixtures/modules/modules-umd/options.json @@ -1,4 +1,5 @@ { + "validateLogs": true, "presets": [ [ "../../../../lib", diff --git a/packages/babel-preset-env/test/fixtures/modules/modules-umd/stderr.txt b/packages/babel-preset-env/test/fixtures/modules/modules-umd/stderr.txt new file mode 100644 index 000000000000..f3e3df470839 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/modules/modules-umd/stderr.txt @@ -0,0 +1 @@ +Dynamic import can only be supported when transforming ES modules to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled. From d05bd9edc8f8c0ec3d0c6590e5a0b4825e62cfca Mon Sep 17 00:00:00 2001 From: Ajay Sagar Date: Thu, 5 Sep 2019 03:33:31 +0200 Subject: [PATCH 034/965] Bumped chokidar dependency of babel-cli to 2.1.8 (#10394) --- packages/babel-cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 0b4bd8731363..9adbc4cdd984 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -30,7 +30,7 @@ "source-map": "^0.5.0" }, "optionalDependencies": { - "chokidar": "^2.0.4" + "chokidar": "^2.1.8" }, "peerDependencies": { "@babel/core": "^7.0.0-0" From fcb77de9013378c1089abffee3c648b02828e572 Mon Sep 17 00:00:00 2001 From: Adam Ramberg Date: Thu, 5 Sep 2019 15:58:29 +0200 Subject: [PATCH 035/965] [preset-env] Include / exclude module plugins properly (#10218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Include / exclude module plugins properly * Use filter-items to excl / incl module plugins * Move transform selection to getModulesPluginNames * Remove unnecessary spread operator Co-Authored-By: Nicolò Ribaudo * Adjust tests to changes in #10218 --- packages/babel-preset-env/src/index.js | 213 ++++++++++------- .../babel-preset-env/src/normalize-options.js | 52 ++-- .../corejs-without-usebuiltins/stdout.txt | 2 + .../entry-corejs2-android/stdout.txt | 2 + .../entry-corejs2-electron/stdout.txt | 2 + .../stdout.txt | 1 + .../entry-corejs2-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs2-proposals/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs2-shippedProposals/stdout.txt | 2 + .../entry-corejs2-specific-targets/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs2-versions-strings/stdout.txt | 2 + .../debug-fixtures/entry-corejs2/stdout.txt | 2 + .../entry-corejs3-all-chrome-71/stdout.txt | 2 + .../entry-corejs3-all/stdout.txt | 2 + .../entry-corejs3-android/stdout.txt | 2 + .../entry-corejs3-babel-polyfill/stdout.txt | 2 + .../entry-corejs3-electron/stdout.txt | 2 + .../entry-corejs3-es-chrome-71/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-es-proposals/stdout.txt | 2 + .../entry-corejs3-es/stdout.txt | 2 + .../stdout.txt | 1 + .../entry-corejs3-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-proposals/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-runtime-only/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-specific-entries/stdout.txt | 2 + .../entry-corejs3-specific-targets/stdout.txt | 2 + .../entry-corejs3-stable-chrome-71/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-stable/stdout.txt | 2 + .../entry-corejs3-stage-chrome-71/stdout.txt | 2 + .../entry-corejs3-stage/stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-versions-strings/stdout.txt | 2 + .../entry-corejs3-web-chrome-71/stdout.txt | 2 + .../entry-corejs3-web/stdout.txt | 2 + .../debug-fixtures/entry-corejs3/stdout.txt | 2 + .../entry-no-corejs-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-no-corejs-uglify/stdout.txt | 1 + .../debug-fixtures/entry-no-corejs/stdout.txt | 2 + .../debug-fixtures/plugins-only/stdout.txt | 2 + .../usage-corejs2-chrome-71/stdout.txt | 2 + .../usage-corejs2-none/stdout.txt | 2 + .../stdout.txt | 2 + .../usage-corejs2-proposals/stdout.txt | 2 + .../usage-corejs2-shippedProposals/stdout.txt | 2 + .../usage-corejs2-with-import/stdout.txt | 2 + .../debug-fixtures/usage-corejs2/stdout.txt | 2 + .../usage-corejs3-chrome-71/stdout.txt | 2 + .../usage-corejs3-none/stdout.txt | 2 + .../stdout.txt | 2 + .../usage-corejs3-proposals/stdout.txt | 2 + .../usage-corejs3-shippedProposals/stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../usage-corejs3-with-import/stdout.txt | 2 + .../debug-fixtures/usage-corejs3/stdout.txt | 2 + .../usage-no-corejs-none/stdout.txt | 2 + .../debug-fixtures/usage-no-corejs/stdout.txt | 2 + .../stdout.txt | 1 + .../stdout.txt | 1 + .../safari-10_3-block-scoped/stdout.txt | 2 + packages/babel-preset-env/test/index.spec.js | 224 ++++++++++++++++++ .../test/normalize-options.spec.js | 18 ++ 73 files changed, 537 insertions(+), 103 deletions(-) diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js index 85a784476b83..76f11ebcb934 100644 --- a/packages/babel-preset-env/src/index.js +++ b/packages/babel-preset-env/src/index.js @@ -1,5 +1,6 @@ //@flow +import { SemVer } from "semver"; import { logPluginOrPolyfill } from "./debug"; import getOptionSpecificExcludesFor from "./get-option-specific-excludes"; import filterItems from "./filter-items"; @@ -20,6 +21,9 @@ import availablePlugins from "./available-plugins"; import { filterStageFromList, prettifyTargets } from "./utils"; import { declare } from "@babel/helper-plugin-utils"; +import typeof ModuleTransformationsType from "./module-transformations"; +import type { BuiltInsOption, Targets, ModuleOption } from "./types"; + export { isPluginRequired } from "./filter-items"; const pluginListWithoutProposals = filterStageFromList( @@ -56,6 +60,103 @@ export const transformIncludesAndExcludes = (opts: Array): Object => { ); }; +export const getModulesPluginNames = ({ + modules, + transformations, + shouldTransformESM, + shouldTransformDynamicImport, +}: { + modules: ModuleOption, + transformations: ModuleTransformationsType, + shouldTransformESM: boolean, + shouldTransformDynamicImport: boolean, +}) => { + const modulesPluginNames = []; + if (modules !== false && transformations[modules]) { + if (shouldTransformESM) { + modulesPluginNames.push(transformations[modules]); + } + + if ( + shouldTransformDynamicImport && + shouldTransformESM && + modules !== "umd" + ) { + modulesPluginNames.push("proposal-dynamic-import"); + } else { + if (shouldTransformDynamicImport) { + console.warn( + "Dynamic import can only be supported when transforming ES modules" + + " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.", + ); + } + modulesPluginNames.push("syntax-dynamic-import"); + } + } else { + modulesPluginNames.push("syntax-dynamic-import"); + } + return modulesPluginNames; +}; + +export const getPolyfillPlugins = ({ + useBuiltIns, + corejs, + polyfillTargets, + include, + exclude, + proposals, + shippedProposals, + regenerator, + debug, +}: { + useBuiltIns: BuiltInsOption, + corejs: typeof SemVer | null | false, + polyfillTargets: Targets, + include: Set, + exclude: Set, + proposals: boolean, + shippedProposals: boolean, + regenerator: boolean, + debug: boolean, +}) => { + const polyfillPlugins = []; + if (useBuiltIns === "usage" || useBuiltIns === "entry") { + const pluginOptions = { + corejs, + polyfillTargets, + include, + exclude, + proposals, + shippedProposals, + regenerator, + debug, + }; + + if (corejs) { + if (useBuiltIns === "usage") { + if (corejs.major === 2) { + polyfillPlugins.push([addCoreJS2UsagePlugin, pluginOptions]); + } else { + polyfillPlugins.push([addCoreJS3UsagePlugin, pluginOptions]); + } + if (regenerator) { + polyfillPlugins.push([addRegeneratorUsagePlugin, pluginOptions]); + } + } else { + if (corejs.major === 2) { + polyfillPlugins.push([replaceCoreJS2EntryPlugin, pluginOptions]); + } else { + polyfillPlugins.push([replaceCoreJS3EntryPlugin, pluginOptions]); + if (!regenerator) { + polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]); + } + } + } + } + } + return polyfillPlugins; +}; + function supportsStaticESM(caller) { return !!(caller && caller.supportsStaticESM); } @@ -115,58 +216,46 @@ export default declare((api, opts) => { const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets; - const transformations = filterItems( + const modulesPluginNames = getModulesPluginNames({ + modules, + transformations: moduleTransformations, + // TODO: Remove the 'api.caller' check eventually. Just here to prevent + // unnecessary breakage in the short term for users on older betas/RCs. + shouldTransformESM: + modules !== "auto" || !api.caller || !api.caller(supportsStaticESM), + shouldTransformDynamicImport: + modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport), + }); + + const pluginNames = filterItems( shippedProposals ? pluginList : pluginListWithoutProposals, include.plugins, exclude.plugins, transformTargets, - null, + modulesPluginNames, getOptionSpecificExcludesFor({ loose }), pluginSyntaxMap, ); - const plugins = []; - const pluginUseBuiltIns = useBuiltIns !== false; - - if (modules !== false && moduleTransformations[modules]) { - // TODO: Remove the 'api.caller' check eventually. Just here to prevent - // unnecessary breakage in the short term for users on older betas/RCs. - const shouldTransformESM = - modules !== "auto" || !api.caller || !api.caller(supportsStaticESM); - const shouldTransformDynamicImport = - modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport); - - if (shouldTransformESM) { - // NOTE: not giving spec here yet to avoid compatibility issues when - // transform-modules-commonjs gets its spec mode - plugins.push([getPlugin(moduleTransformations[modules]), { loose }]); - } - - if ( - shouldTransformDynamicImport && - shouldTransformESM && - modules !== "umd" - ) { - plugins.push([getPlugin("proposal-dynamic-import"), { loose }]); - } else { - if (shouldTransformDynamicImport) { - console.warn( - "Dynamic import can only be supported when transforming ES modules" + - " to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.", - ); - } - plugins.push(getPlugin("syntax-dynamic-import")); - } - } else { - plugins.push(getPlugin("syntax-dynamic-import")); - } + const polyfillPlugins = getPolyfillPlugins({ + useBuiltIns, + corejs, + polyfillTargets: targets, + include: include.builtIns, + exclude: exclude.builtIns, + proposals, + shippedProposals, + regenerator: pluginNames.has("transform-regenerator"), + debug, + }); - transformations.forEach(pluginName => - plugins.push([ + const pluginUseBuiltIns = useBuiltIns !== false; + const plugins = Array.from(pluginNames) + .map(pluginName => [ getPlugin(pluginName), { spec, loose, useBuiltIns: pluginUseBuiltIns }, - ]), - ); + ]) + .concat(polyfillPlugins); if (debug) { console.log("@babel/preset-env: `DEBUG` option"); @@ -174,8 +263,8 @@ export default declare((api, opts) => { console.log(JSON.stringify(prettifyTargets(targets), null, 2)); console.log(`\nUsing modules transform: ${modules.toString()}`); console.log("\nUsing plugins:"); - transformations.forEach(transform => { - logPluginOrPolyfill(transform, targets, pluginList); + pluginNames.forEach(pluginName => { + logPluginOrPolyfill(pluginName, targets, pluginList); }); if (!useBuiltIns) { @@ -183,46 +272,10 @@ export default declare((api, opts) => { "\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.", ); } else { + // NOTE: Polyfill plugins are outputting debug info internally console.log(`\nUsing polyfills with \`${useBuiltIns}\` option:`); } } - if (useBuiltIns === "usage" || useBuiltIns === "entry") { - const regenerator = transformations.has("transform-regenerator"); - - const pluginOptions = { - corejs, - polyfillTargets: targets, - include: include.builtIns, - exclude: exclude.builtIns, - proposals, - shippedProposals, - regenerator, - debug, - }; - - if (corejs) { - if (useBuiltIns === "usage") { - if (corejs.major === 2) { - plugins.push([addCoreJS2UsagePlugin, pluginOptions]); - } else { - plugins.push([addCoreJS3UsagePlugin, pluginOptions]); - } - if (regenerator) { - plugins.push([addRegeneratorUsagePlugin, pluginOptions]); - } - } else { - if (corejs.major === 2) { - plugins.push([replaceCoreJS2EntryPlugin, pluginOptions]); - } else { - plugins.push([replaceCoreJS3EntryPlugin, pluginOptions]); - if (!regenerator) { - plugins.push([removeRegeneratorEntryPlugin, pluginOptions]); - } - } - } - } - } - return { plugins }; }); diff --git a/packages/babel-preset-env/src/normalize-options.js b/packages/babel-preset-env/src/normalize-options.js index 76b13f5a7e39..523857ea5832 100644 --- a/packages/babel-preset-env/src/normalize-options.js +++ b/packages/babel-preset-env/src/normalize-options.js @@ -32,23 +32,29 @@ const validateTopLevelOptions = (options: Options) => { } }; -const allPluginsList = [ - ...Object.keys(pluginsList), +const allPluginsList = Object.keys(pluginsList); + +// NOTE: Since module plugins are handled seperatly compared to other plugins (via the "modules" option) it +// should only be possible to exclude and not include module plugins, otherwise it's possible that preset-env +// will add a module plugin twice. +const modulePlugins = [ + "proposal-dynamic-import", ...Object.keys(moduleTransformations).map(m => moduleTransformations[m]), ]; -const validIncludesAndExcludesWithoutCoreJS = new Set(allPluginsList); - -const validIncludesAndExcludesWithCoreJS2 = new Set([ - ...allPluginsList, - ...Object.keys(corejs2Polyfills), - ...defaultWebIncludes, -]); - -const validIncludesAndExcludesWithCoreJS3 = new Set([ - ...allPluginsList, - ...Object.keys(corejs3Polyfills), -]); +const getValidIncludesAndExcludes = ( + type: "include" | "exclude", + corejs: number | false, +) => + new Set([ + ...allPluginsList, + ...(type === "exclude" ? modulePlugins : []), + ...(corejs + ? corejs == 2 + ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes] + : Object.keys(corejs3Polyfills) + : []), + ]); const pluginToRegExp = (plugin: PluginListItem) => { if (plugin instanceof RegExp) return plugin; @@ -59,14 +65,14 @@ const pluginToRegExp = (plugin: PluginListItem) => { } }; -const selectPlugins = (regexp: RegExp | null, corejs: number | false) => - Array.from( - corejs - ? corejs == 2 - ? validIncludesAndExcludesWithCoreJS2 - : validIncludesAndExcludesWithCoreJS3 - : validIncludesAndExcludesWithoutCoreJS, - ).filter(item => regexp instanceof RegExp && regexp.test(item)); +const selectPlugins = ( + regexp: RegExp | null, + type: "include" | "exclude", + corejs: number | false, +) => + Array.from(getValidIncludesAndExcludes(type, corejs)).filter( + item => regexp instanceof RegExp && regexp.test(item), + ); const flatten = (array: Array>): Array => [].concat(...array); @@ -78,7 +84,7 @@ const expandIncludesAndExcludes = ( if (plugins.length === 0) return []; const selectedPlugins = plugins.map(plugin => - selectPlugins(pluginToRegExp(plugin), corejs), + selectPlugins(pluginToRegExp(plugin), type, corejs), ); const invalidRegExpList = plugins.filter( (p, i) => selectedPlugins[i].length === 0, diff --git a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt index 1480ffe6bec5..8edc822211ac 100644 --- a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt @@ -40,6 +40,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt index f3d91c14ed87..9660624a053b 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-optional-catch-binding { "android":"4" } transform-named-capturing-groups-regex { "android":"4" } transform-reserved-words { "android":"4" } + transform-modules-commonjs { "android":"4" } + proposal-dynamic-import { "android":"4" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt index e0c6a95adc0d..ce32c796e65c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt @@ -34,6 +34,8 @@ Using plugins: transform-named-capturing-groups-regex { "electron":"0.36" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + transform-modules-commonjs { "electron":"0.36" } + proposal-dynamic-import { "electron":"0.36" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt index 988f64db332a..30fbdca39bfc 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt @@ -40,6 +40,7 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt index ac37a584bfdf..8d7d5c3610d2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt @@ -20,6 +20,8 @@ Using plugins: proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + transform-modules-commonjs { "node":"6" } + proposal-dynamic-import { "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt index c5a336627064..1892aa8040bb 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt index 04e8ce0e5829..68c0e41d5803 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt index c5a336627064..1892aa8040bb 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt index 04e8ce0e5829..68c0e41d5803 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt index a7c6a94b05aa..0ef9459d2b43 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt @@ -42,6 +42,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-optional-catch-binding { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-named-capturing-groups-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + transform-modules-commonjs { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-dynamic-import { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt index 3988359b77cf..52357b555629 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt @@ -50,6 +50,8 @@ Using plugins: transform-named-capturing-groups-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + transform-modules-commonjs { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } + proposal-dynamic-import { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt index 2599a836d290..05a6f95b2cac 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6.10" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt index 943bad68b9b1..fd68de0c44c6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt index bbefff8cb204..2951c8d2839d 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt index 9c9fa026270b..09822b87afc2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt index b73850b76698..85869080092e 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-optional-catch-binding { "android":"4" } transform-named-capturing-groups-regex { "android":"4" } transform-reserved-words { "android":"4" } + transform-modules-commonjs { "android":"4" } + proposal-dynamic-import { "android":"4" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt index 22616b88ea89..9e116b9ca002 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt index f554ec16ce1f..2db44452e27e 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt @@ -34,6 +34,8 @@ Using plugins: transform-named-capturing-groups-regex { "electron":"0.36" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + transform-modules-commonjs { "electron":"0.36" } + proposal-dynamic-import { "electron":"0.36" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt index 1e83b69ce75f..9b5801afb435 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt index 5cf2958c3b05..f1855c04cb94 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt index bc007cc33283..87b297105bbf 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt index cf961ab95885..83949367f997 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt index 332da98e97bf..da1c67caeaf5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt @@ -40,6 +40,7 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt index 73ffcc5860ea..f5eaed804825 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt @@ -20,6 +20,8 @@ Using plugins: proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + transform-modules-commonjs { "node":"6" } + proposal-dynamic-import { "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt index 415f49d21038..a561ed31a0c5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt index e0cdc2017967..ad2dc8d7e10a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt index 2420ffb75e8e..26521e3ce411 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt index 2420ffb75e8e..26521e3ce411 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt index e77af2686b72..41a8bda0a4c0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt index d8ff0734f2d0..34ce13f88405 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt index 0be270e41146..799b42a28da5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt @@ -42,6 +42,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-optional-catch-binding { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-named-capturing-groups-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + transform-modules-commonjs { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-dynamic-import { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt index 781f32ad0974..f286aae03105 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt index 50f7b3e20e25..e3b023fc70a1 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt @@ -14,6 +14,8 @@ Using plugins: proposal-json-strings { "samsung":"8.2" } proposal-optional-catch-binding { "samsung":"8.2" } transform-named-capturing-groups-regex { "samsung":"8.2" } + transform-modules-commonjs { "samsung":"8.2" } + proposal-dynamic-import { "samsung":"8.2" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt index ac359171f3f1..27caa7f6dffa 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt index 415f49d21038..a561ed31a0c5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt index e0cdc2017967..ad2dc8d7e10a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt index 359bbdb07bdd..37f523184009 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt @@ -50,6 +50,8 @@ Using plugins: transform-named-capturing-groups-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + transform-modules-commonjs { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } + proposal-dynamic-import { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/stdout.txt index d51520a95c36..e609f7f5a6d4 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6.10" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/stdout.txt index 9bdec21bb16c..2fd667e1edbe 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6.10" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt index d51520a95c36..e609f7f5a6d4 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6.10" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt index 47e1b712c226..7915062dd76c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt index 10497d8551ab..31e603812e9c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt index be4132d6b1f0..712a1e1dcbb1 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt index ac37a584bfdf..8d7d5c3610d2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt @@ -20,6 +20,8 @@ Using plugins: proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + transform-modules-commonjs { "node":"6" } + proposal-dynamic-import { "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt index 04e8ce0e5829..68c0e41d5803 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + transform-modules-commonjs {} + proposal-dynamic-import {} Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt index 2a97e7973107..e7948062c039 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt @@ -43,6 +43,7 @@ Using plugins: transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt index 943bad68b9b1..fd68de0c44c6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt @@ -39,6 +39,8 @@ Using plugins: proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } + proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt index b9408aae4462..2fa404a6d446 100644 --- a/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt @@ -27,6 +27,8 @@ Using plugins: proposal-json-strings { "firefox":"52", "node":"7.4" } proposal-optional-catch-binding { "firefox":"52", "node":"7.4" } transform-named-capturing-groups-regex { "firefox":"52", "node":"7.4" } + transform-modules-commonjs { "firefox":"52", "node":"7.4" } + proposal-dynamic-import { "firefox":"52", "node":"7.4" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt index b3df5f0872ba..f3e6f360ea96 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt index fafdcfca187c..5f82e7187c64 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt index b3df5f0872ba..f3e6f360ea96 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt index 8d1136d823bd..430a23ee87e9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt index 8d1136d823bd..430a23ee87e9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt index e976e00c5f93..8682c140a4c0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt @@ -15,6 +15,8 @@ Using plugins: proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } + transform-modules-commonjs { "chrome":"55" } + proposal-dynamic-import { "chrome":"55" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt index 8d1136d823bd..430a23ee87e9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt index 3b0d7b91373c..e6cf48c68031 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt index fafdcfca187c..5f82e7187c64 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt index e3546e022a16..c1e4baec7483 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt index cec7b6803911..201d4da1235c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt index c9d333c5820b..dcf94e17e1d4 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt index 5c7a63345026..170f5231957f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt index 5c7a63345026..170f5231957f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt index e976e00c5f93..8682c140a4c0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt @@ -15,6 +15,8 @@ Using plugins: proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } + transform-modules-commonjs { "chrome":"55" } + proposal-dynamic-import { "chrome":"55" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt index 5c7a63345026..170f5231957f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt index fafdcfca187c..5f82e7187c64 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt index 8d1136d823bd..430a23ee87e9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt @@ -38,6 +38,8 @@ Using plugins: proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt index 61526c5b8070..3489d7294e09 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt @@ -26,6 +26,7 @@ Using plugins: proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + syntax-dynamic-import { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt index af7e5f8e39c4..5b3c33fd0b12 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt @@ -26,6 +26,7 @@ Using plugins: proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + syntax-dynamic-import { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt index 494481624f2f..ba01385d275e 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt @@ -20,5 +20,7 @@ Using plugins: proposal-json-strings { "safari":"10" } proposal-optional-catch-binding { "safari":"10" } transform-named-capturing-groups-regex { "safari":"10" } + transform-modules-commonjs { "safari":"10" } + proposal-dynamic-import { "safari":"10" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/index.spec.js b/packages/babel-preset-env/test/index.spec.js index 7b281f4e1885..ded00e6c2e14 100644 --- a/packages/babel-preset-env/test/index.spec.js +++ b/packages/babel-preset-env/test/index.spec.js @@ -1,6 +1,19 @@ "use strict"; const babelPresetEnv = require("../lib/index"); +const addCoreJS2UsagePlugin = require("../lib/polyfills/corejs2/usage-plugin") + .default; +const addCoreJS3UsagePlugin = require("../lib/polyfills/corejs3/usage-plugin") + .default; +const addRegeneratorUsagePlugin = require("../lib/polyfills/regenerator/usage-plugin") + .default; +const replaceCoreJS2EntryPlugin = require("../lib/polyfills/corejs2/entry-plugin") + .default; +const replaceCoreJS3EntryPlugin = require("../lib/polyfills/corejs3/entry-plugin") + .default; +const removeRegeneratorEntryPlugin = require("../lib/polyfills/regenerator/entry-plugin") + .default; +const transformations = require("../lib/module-transformations").default; describe("babel-preset-env", () => { describe("transformIncludesAndExcludes", () => { @@ -24,4 +37,215 @@ describe("babel-preset-env", () => { }); }); }); + describe("getModulesPluginNames", () => { + describe("modules is set to false", () => { + it("returns only syntax-dynamic-import", () => { + expect( + babelPresetEnv.getModulesPluginNames({ + modules: false, + transformations, + shouldTransformESM: false, + shouldTransformDynamicImport: false, + }), + ).toEqual(["syntax-dynamic-import"]); + }); + }); + describe("modules is not set to false", () => { + describe("ESMs should not be transformed", () => { + it("returns syntax-dynamic-import", () => { + expect( + babelPresetEnv.getModulesPluginNames({ + modules: "commonjs", + transformations, + shouldTransformESM: false, + shouldTransformDynamicImport: false, + }), + ).toEqual(["syntax-dynamic-import"]); + }); + }); + describe("ESMs should be transformed", () => { + describe("dynamic imports should not be transformed", () => { + it("returns specified modules transform and syntax-dynamic-import", () => { + expect( + babelPresetEnv.getModulesPluginNames({ + modules: "commonjs", + transformations, + shouldTransformESM: true, + shouldTransformDynamicImport: false, + }), + ).toEqual(["transform-modules-commonjs", "syntax-dynamic-import"]); + }); + }); + describe("dynamic imports should be transformed", () => { + it("returns specified modules transform and proposal-dynamic-import", () => { + expect( + babelPresetEnv.getModulesPluginNames({ + modules: "systemjs", + transformations, + shouldTransformESM: true, + shouldTransformDynamicImport: true, + }), + ).toEqual([ + "transform-modules-systemjs", + "proposal-dynamic-import", + ]); + }); + }); + }); + }); + }); + describe("getPolyfillPlugins", () => { + const staticProps = { + polyfillTargets: [], + include: new Set(), + exclude: new Set(), + proposals: false, + shippedProposals: false, + debug: false, + }; + describe("useBuiltIns is false", () => { + it("returns no polyfill plugins", () => { + expect( + babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: false, + corejs: false, + regenerator: false, + }, + staticProps, + ), + ), + ).toEqual([]); + }); + }); + describe("useBuiltIns is not false", () => { + describe("corejs is not given", () => { + it("returns no polyfill plugins", () => { + expect( + babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "usage", + corejs: false, + regenerator: false, + }, + staticProps, + ), + ), + ).toEqual([]); + }); + }); + describe("useBuiltIns is set to usage", () => { + describe("using corejs 2", () => { + it("returns an array with core js 2 usage plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "usage", + corejs: { major: 2 }, + regenerator: false, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(1); + expect(polyfillPlugins[0][0]).toEqual(addCoreJS2UsagePlugin); + }); + }); + describe("using corejs 3", () => { + describe("regenerator is set to false", () => { + it("returns an array with core js 3 usage plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "usage", + corejs: { major: 3 }, + regenerator: false, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(1); + expect(polyfillPlugins[0][0]).toEqual(addCoreJS3UsagePlugin); + }); + }); + + describe("regenerator is set to true", () => { + it("returns an array with core js 3 usage plugin and add regenerator usage plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "usage", + corejs: { major: 3 }, + regenerator: true, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(2); + expect(polyfillPlugins[0][0]).toEqual(addCoreJS3UsagePlugin); + expect(polyfillPlugins[1][0]).toEqual(addRegeneratorUsagePlugin); + }); + }); + }); + }); + describe("useBuiltIns is set to entry", () => { + describe("using corejs 2", () => { + it("returns an array with core js 2 entry plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "entry", + corejs: { major: 2 }, + regenerator: true, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(1); + expect(polyfillPlugins[0][0]).toEqual(replaceCoreJS2EntryPlugin); + }); + }); + describe("using corejs 3", () => { + describe("regenerator is set to true", () => { + it("returns an array with core js 3 entry plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "entry", + corejs: { major: 3 }, + regenerator: true, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(1); + expect(polyfillPlugins[0][0]).toEqual(replaceCoreJS3EntryPlugin); + }); + }); + + describe("regenerator is set to false", () => { + it("returns an array with core js 3 entry plugin and remove regenerator entry plugin", () => { + const polyfillPlugins = babelPresetEnv.getPolyfillPlugins( + Object.assign( + { + useBuiltIns: "entry", + corejs: { major: 3 }, + regenerator: false, + }, + staticProps, + ), + ); + expect(polyfillPlugins.length).toBe(2); + expect(polyfillPlugins[0][0]).toEqual(replaceCoreJS3EntryPlugin); + expect(polyfillPlugins[1][0]).toEqual( + removeRegeneratorEntryPlugin, + ); + }); + }); + }); + }); + }); + }); }); diff --git a/packages/babel-preset-env/test/normalize-options.spec.js b/packages/babel-preset-env/test/normalize-options.spec.js index eefb69e45f46..abe1ba25b9ea 100644 --- a/packages/babel-preset-env/test/normalize-options.spec.js +++ b/packages/babel-preset-env/test/normalize-options.spec.js @@ -84,6 +84,24 @@ describe("normalize-options", () => { }); }); }); + + it("throws when including module plugins", () => { + expect(() => + normalizeOptions.default({ include: ["proposal-dynamic-import"] }), + ).toThrow(); + expect(() => + normalizeOptions.default({ include: ["transform-modules-amd"] }), + ).toThrow(); + }); + + it("allows exclusion of module plugins ", () => { + expect(() => + normalizeOptions.default({ exclude: ["proposal-dynamic-import"] }), + ).not.toThrow(); + expect(() => + normalizeOptions.default({ exclude: ["transform-modules-commonjs"] }), + ).not.toThrow(); + }); }); describe("Config format validation", () => { From 6813ee02d72b5fdb7dd8d86bb91b45cf612cc025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 5 Sep 2019 11:07:18 -0400 Subject: [PATCH 036/965] chore: update regexp-tree to version 0.1.13 (#10376) --- .../package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 dc95a58d86e8..faf1eb48cd24 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -14,7 +14,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-named-capturing-groups-regex", "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "regexp-tree": "^0.1.6" + "regexp-tree": "^0.1.13" }, "peerDependencies": { "@babel/core": "^7.0.0" From 29734b924aad9f3f43e2d4fd2bc50b7c10be00e7 Mon Sep 17 00:00:00 2001 From: Bin Xin Date: Thu, 5 Sep 2019 23:32:57 +0800 Subject: [PATCH 037/965] Don't allow instance properties transformation on namespace (#10372) --- packages/babel-plugin-transform-runtime/src/index.js | 7 +++++++ .../runtime-corejs3/modules-namespaced/input.mjs | 2 ++ .../runtime-corejs3/modules-namespaced/options.json | 3 +++ .../runtime-corejs3/modules-namespaced/output.mjs | 2 ++ .../src/polyfills/corejs2/usage-plugin.js | 4 ++++ .../src/polyfills/corejs3/usage-plugin.js | 6 ++++-- packages/babel-preset-env/src/utils.js | 7 +++++++ .../corejs2/usage-modules-namespaced/input.mjs | 2 ++ .../corejs2/usage-modules-namespaced/options.json | 12 ++++++++++++ .../corejs2/usage-modules-namespaced/output.mjs | 3 +++ .../corejs3/usage-modules-namespaced/input.mjs | 2 ++ .../corejs3/usage-modules-namespaced/options.json | 12 ++++++++++++ .../corejs3/usage-modules-namespaced/output.mjs | 2 ++ 13 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/input.mjs create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/options.json create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/options.json create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/options.json create mode 100644 packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/output.mjs diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 7e227a6f20a8..06efe3f0f19e 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -113,7 +113,14 @@ export default declare((api, options, dirname) => { ); } + function isNamespaced(path) { + const binding = path.scope.getBinding(path.node.name); + if (!binding) return false; + return binding.path.isImportNamespaceSpecifier(); + } + function maybeNeedsPolyfill(path, methods, name) { + if (isNamespaced(path.get("object"))) return false; if (!methods[name].types) return true; const typeAnnotation = path.get("object").getTypeAnnotation(); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/input.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/input.mjs new file mode 100644 index 000000000000..7962c3d2005c --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/input.mjs @@ -0,0 +1,2 @@ +import * as bar from "bar"; +bar.map(); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/options.json new file mode 100644 index 000000000000..ea8bb9c3aa1c --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["transform-runtime", { "corejs": 3 }]] +} diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/output.mjs new file mode 100644 index 000000000000..7962c3d2005c --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-namespaced/output.mjs @@ -0,0 +1,2 @@ +import * as bar from "bar"; +bar.map(); diff --git a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js index 038736100841..bd80b5af9f82 100644 --- a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js @@ -15,6 +15,7 @@ import { isPolyfillSource, getImportSource, getRequireSource, + isNamespaced, } from "../../utils"; import { logUsagePolyfills } from "../../debug"; @@ -102,6 +103,9 @@ export default function( const { node } = path; const { object, property } = node; + // ignore namespace + if (isNamespaced(path.get("object"))) return; + let evaluatedPropType = object.name; let propertyName = property.name; let instanceType = ""; diff --git a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js index ea1e06492134..2b06088aa61a 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js @@ -21,6 +21,7 @@ import { isPolyfillSource, getImportSource, getRequireSource, + isNamespaced, } from "../../utils"; import { logUsagePolyfills } from "../../debug"; @@ -98,7 +99,7 @@ export default function( } } } - return { builtIn, instanceType }; + return { builtIn, instanceType, isNamespaced: isNamespaced(path) }; } const addAndRemovePolyfillImports = { @@ -230,7 +231,8 @@ export default function( }; this.addPropertyDependencies = function(source = {}, key) { - const { builtIn, instanceType } = source; + const { builtIn, instanceType, isNamespaced } = source; + if (isNamespaced) return; if (PossibleGlobalObjects.has(builtIn)) { this.addBuiltInDependencies(key); } else if (has(StaticProperties, builtIn)) { diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index 81c1c3721c99..fa4e2ecce0fe 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -162,3 +162,10 @@ export function getModulePath(mod: string): string { export function createImport(path: NodePath, mod: string) { return addSideEffect(path, getModulePath(mod)); } + +export function isNamespaced(path: NodePath) { + if (!path.node) return false; + const binding = path.scope.getBinding(path.node.name); + if (!binding) return false; + return binding.path.isImportNamespaceSpecifier(); +} diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/input.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/input.mjs new file mode 100644 index 000000000000..3f57abb6052e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/input.mjs @@ -0,0 +1,2 @@ +import * as ns from "ns"; +ns.map; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/options.json b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/options.json new file mode 100644 index 000000000000..429ee132c960 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/options.json @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "modules": false, + "useBuiltIns": "usage", + "corejs": 2 + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/output.mjs new file mode 100644 index 000000000000..4efb9b0a495f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-namespaced/output.mjs @@ -0,0 +1,3 @@ +import * as ns from "ns"; +ns.map; + diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/input.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/input.mjs new file mode 100644 index 000000000000..3f57abb6052e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/input.mjs @@ -0,0 +1,2 @@ +import * as ns from "ns"; +ns.map; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/options.json b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/options.json new file mode 100644 index 000000000000..d15a6c1c2826 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/options.json @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "modules": false, + "useBuiltIns": "usage", + "corejs": 3 + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/output.mjs new file mode 100644 index 000000000000..3f57abb6052e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-namespaced/output.mjs @@ -0,0 +1,2 @@ +import * as ns from "ns"; +ns.map; From 2e7bea4a6abdea0d99c70bbb28b4889df58223d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 5 Sep 2019 11:35:57 -0400 Subject: [PATCH 038/965] fix: transform name capturing regex once (#10395) * fix: transform name capturing regex once * refactor: early return when pattern contains only lookbehind * chore: simplify test regex * chore: run test on >=8.0.0 --- .../src/index.js | 2 +- .../test/fixtures/runtime/issue-10393/exec.js | 7 +++++++ .../test/fixtures/runtime/issue-10393/options.json | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/exec.js create mode 100644 packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/options.json 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 042d16de9d4d..d646101852e0 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 @@ -12,7 +12,7 @@ export default function({ types: t }, options) { visitor: { RegExpLiteral(path) { const node = path.node; - if (node.pattern.indexOf("(?<") === -1) { + if (!/\(\?<(?![=!])/.test(node.pattern)) { // Return early if there are no named groups. // The .indexOf check may have false positives (e.g. /\(?[a])/ + +const result = regex.exec("aa"); + +expect(result.groups).toEqual({ + a: "a" +}); diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/options.json b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/options.json new file mode 100644 index 000000000000..2454c2169cf8 --- /dev/null +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/runtime/issue-10393/options.json @@ -0,0 +1,3 @@ +{ + "minNodeVersion": "8.0.0" +} From 5c859b11177ea4ad25b861af81268799e29ead75 Mon Sep 17 00:00:00 2001 From: Bin Xin Date: Fri, 6 Sep 2019 06:29:19 +0800 Subject: [PATCH 039/965] Don't polyfill if evaluation is not confident (#10397) --- .../src/polyfills/corejs2/usage-plugin.js | 4 +++- .../corejs2/usage-evaluated-not-confident/input.mjs | 5 +++++ .../usage-evaluated-not-confident/options.json | 12 ++++++++++++ .../usage-evaluated-not-confident/output.mjs | 13 +++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/options.json create mode 100644 packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs diff --git a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js index bd80b5af9f82..ffe73bf8d59b 100644 --- a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js @@ -107,7 +107,7 @@ export default function( if (isNamespaced(path.get("object"))) return; let evaluatedPropType = object.name; - let propertyName = property.name; + let propertyName = ""; let instanceType = ""; if (node.computed) { @@ -119,6 +119,8 @@ export default function( propertyName = result.value; } } + } else { + propertyName = property.name; } if (path.scope.getBindingIdentifier(object.name)) { diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/input.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/input.mjs new file mode 100644 index 000000000000..279b65c0b53e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/input.mjs @@ -0,0 +1,5 @@ +Object['values'](); // include +[]['map'](); // include + +Object[keys](); // don't include +[][filter](); // don't include diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/options.json b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/options.json new file mode 100644 index 000000000000..fe3e4d6cf9c9 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/options.json @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "useBuiltIns": "usage", + "corejs": 2, + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs new file mode 100644 index 000000000000..8ce9547c189d --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs @@ -0,0 +1,13 @@ +import "core-js/modules/es6.array.map"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.object.values"; +Object['values'](); // include + +[]['map'](); // include + +Object[keys](); // don't include + +[][filter](); // don't include + From 8769903284debe19f551744dcc9c35d549ec7bd9 Mon Sep 17 00:00:00 2001 From: Bin Xin Date: Fri, 6 Sep 2019 07:35:03 +0800 Subject: [PATCH 040/965] Add supports for polyfill computed methods (#10398) --- .../src/index.js | 49 ++++++++++++------- .../evaluated-static-methods/input.js | 5 ++ .../evaluated-static-methods/options.json | 3 ++ .../evaluated-static-methods/output.js | 10 ++++ .../instance-computed/input.js | 2 +- .../evaluated-instance-methods/input.js | 9 ++++ .../evaluated-instance-methods/options.json | 5 ++ .../evaluated-instance-methods/output.js | 21 ++++++++ .../evaluated-static-methods/input.js | 5 ++ .../evaluated-static-methods/options.json | 5 ++ .../evaluated-static-methods/output.js | 10 ++++ .../instance-computed/input.js | 2 +- 12 files changed, 107 insertions(+), 19 deletions(-) create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/input.js create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/options.json create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/input.js create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/options.json create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/input.js create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/options.json create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 06efe3f0f19e..a9d0fd350deb 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -130,6 +130,14 @@ export default declare((api, options, dirname) => { return methods[name].types.some(name => name === type); } + function resolvePropertyName(path, computed) { + const { node } = path; + if (!computed) return node.name; + if (path.isStringLiteral()) return node.value; + const result = path.evaluate(); + return result.value; + } + if (has(options, "useBuiltIns")) { if (options.useBuiltIns) { throw new Error( @@ -297,8 +305,11 @@ export default declare((api, options, dirname) => { if (!t.isMemberExpression(callee)) return; - const { object, property } = callee; - const propertyName = property.name; + const { object } = callee; + const propertyName = resolvePropertyName( + path.get("callee.property"), + callee.computed, + ); // transform calling instance methods like `something.includes()` if (injectCoreJS3 && !hasStaticMapping(object.name, propertyName)) { @@ -375,29 +386,33 @@ export default declare((api, options, dirname) => { if (!path.isReferenced()) return; const { node } = path; - const { object, property } = node; + const { object } = node; if (!t.isReferenced(object, node)) return; - if (node.computed) { - if (injectCoreJS2) return; - // transform `something[Symbol.iterator]` to calling `getIteratorMethod(something)` helper - if (path.get("property").matchesPattern("Symbol.iterator")) { - path.replaceWith( - t.callExpression( - this.addDefaultImport( - `${moduleName}/core-js/get-iterator-method`, - "getIteratorMethod", - ), - [object], + // transform `something[Symbol.iterator]` to calling `getIteratorMethod(something)` helper + if ( + !injectCoreJS2 && + node.computed && + path.get("property").matchesPattern("Symbol.iterator") + ) { + path.replaceWith( + t.callExpression( + this.addDefaultImport( + `${moduleName}/core-js/get-iterator-method`, + "getIteratorMethod", ), - ); - } + [object], + ), + ); return; } const objectName = object.name; - const propertyName = property.name; + const propertyName = resolvePropertyName( + path.get("property"), + node.computed, + ); // doesn't reference the global if ( path.scope.getBindingIdentifier(objectName) || diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/input.js new file mode 100644 index 000000000000..6968e9a2729b --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/input.js @@ -0,0 +1,5 @@ +var _isArray = "isArray"; + +Array["from"]; // polyfill +Array[_isArray]; // polyfill +Array[of]; // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/options.json new file mode 100644 index 000000000000..3514ed63b409 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["transform-runtime", { "corejs": 2 }]] +} diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js new file mode 100644 index 000000000000..59868c6f60d5 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js @@ -0,0 +1,10 @@ +var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array"); + +var _Array$from = require("@babel/runtime-corejs2/core-js/array/from"); + +var _isArray = "isArray"; +_Array$from; // polyfill + +_Array$isArray; // polyfill + +Array[of]; // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/instance-computed/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/instance-computed/input.js index 87ed431301c8..0ca5137f3896 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/instance-computed/input.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/instance-computed/input.js @@ -1 +1 @@ -bar[filter]() \ No newline at end of file +bar[filter]() diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/input.js new file mode 100644 index 000000000000..edc557316374 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/input.js @@ -0,0 +1,9 @@ +var _map = "map"; + +object["filter"]; // polyfill +object[_map]; // polyfill +object[find]; // don't polyfill + +object["filter"](); // polyfill +object[_map](); // polyfill +object[find](); // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/options.json new file mode 100644 index 000000000000..2b36aa6019b4 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + ["transform-runtime", { "corejs": { "version": 3, "proposals": true } }] + ] +} diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js new file mode 100644 index 000000000000..1f2bc8c78155 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js @@ -0,0 +1,21 @@ +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map"); + +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter"); + +var _map = "map"; + +_filterInstanceProperty(object); // polyfill + + +_mapInstanceProperty(object); // polyfill + + +object[find]; // don't polyfill + +_filterInstanceProperty(object).call(object); // polyfill + + +_mapInstanceProperty(object).call(object); // polyfill + + +object[find](); // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/input.js new file mode 100644 index 000000000000..6968e9a2729b --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/input.js @@ -0,0 +1,5 @@ +var _isArray = "isArray"; + +Array["from"]; // polyfill +Array[_isArray]; // polyfill +Array[of]; // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/options.json new file mode 100644 index 000000000000..2b36aa6019b4 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + ["transform-runtime", { "corejs": { "version": 3, "proposals": true } }] + ] +} diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js new file mode 100644 index 000000000000..83dde082836f --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js @@ -0,0 +1,10 @@ +var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array"); + +var _Array$from = require("@babel/runtime-corejs3/core-js/array/from"); + +var _isArray = "isArray"; +_Array$from; // polyfill + +_Array$isArray; // polyfill + +Array[of]; // don't polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/input.js index 87ed431301c8..225ac3534de6 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/input.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/input.js @@ -1 +1 @@ -bar[filter]() \ No newline at end of file +bar['filter']() From 3e8a5c5e28214a6f7849bd2faa47efa5ebf5a881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Sep 2019 17:32:20 +0200 Subject: [PATCH 041/965] Use "validateLogs" for preset-env's debug fixtures (#10401) * Add ability to ignore output to the test runner * Use normal fixtures instead of custom debug-fixtures in preset-env --- packages/babel-helper-fixtures/src/index.js | 15 ++ .../src/index.js | 60 +++---- .../babel-preset-env/test/debug-fixtures.js | 148 ------------------ .../entry-corejs3-runtime-only/options.json | 13 -- .../options.json | 13 -- .../options.json | 10 -- .../options.json | 13 -- .../entry-corejs3-stable/options.json | 10 -- .../options.json | 13 -- .../entry-corejs3-stage/options.json | 10 -- .../entry-corejs3-web-chrome-71/options.json | 13 -- .../entry-corejs3-web/options.json | 10 -- .../corejs-without-usebuiltins/input.mjs} | 0 .../corejs-without-usebuiltins/options.json | 4 +- .../corejs-without-usebuiltins/stdout.txt | 1 - .../debug/entry-corejs2-android/input.mjs} | 0 .../debug}/entry-corejs2-android/options.json | 4 +- .../debug}/entry-corejs2-android/stdout.txt | 3 +- .../debug/entry-corejs2-electron/input.mjs} | 0 .../entry-corejs2-electron/options.json | 4 +- .../debug}/entry-corejs2-electron/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../debug/entry-corejs2-no-import/input.js} | 0 .../entry-corejs2-no-import/options.json | 4 +- .../debug/entry-corejs2-no-import}/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../debug/entry-corejs2-proposals/input.mjs} | 0 .../entry-corejs2-proposals/options.json | 4 +- .../debug/entry-corejs2-proposals}/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../entry-corejs2-shippedProposals/input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../entry-corejs2-specific-targets/input.mjs} | 0 .../options.json | 4 +- .../entry-corejs2-specific-targets/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../entry-corejs2-versions-strings/input.mjs} | 0 .../options.json | 4 +- .../entry-corejs2-versions-strings/stdout.txt | 3 +- .../debug/entry-corejs2/input.mjs} | 0 .../debug}/entry-corejs2/options.json | 4 +- .../debug}/entry-corejs2/stdout.txt | 3 +- .../entry-corejs3-all-chrome-71/input.mjs} | 0 .../entry-corejs3-all-chrome-71}/options.json | 4 +- .../entry-corejs3-all-chrome-71/stdout.txt | 5 +- .../debug/entry-corejs3-all/input.mjs} | 0 .../debug/entry-corejs3-all}/options.json | 4 +- .../debug}/entry-corejs3-all/stdout.txt | 3 +- .../debug/entry-corejs3-android/input.mjs} | 0 .../debug}/entry-corejs3-android/options.json | 6 +- .../debug}/entry-corejs3-android/stdout.txt | 3 +- .../entry-corejs3-babel-polyfill/input.mjs} | 0 .../options.json | 4 +- .../entry-corejs3-babel-polyfill/stderr.txt | 0 .../entry-corejs3-babel-polyfill/stdout.txt | 3 +- .../debug/entry-corejs3-electron/input.mjs} | 0 .../entry-corejs3-electron/options.json | 4 +- .../debug}/entry-corejs3-electron/stdout.txt | 3 +- .../entry-corejs3-es-chrome-71/input.mjs} | 0 .../entry-corejs3-es-chrome-71}/options.json | 4 +- .../entry-corejs3-es-chrome-71/stdout.txt | 5 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 5 +- .../entry-corejs3-es-proposals/input.mjs} | 0 .../entry-corejs3-es-proposals}/options.json | 4 +- .../entry-corejs3-es-proposals/stdout.txt | 3 +- .../debug/entry-corejs3-es/input.mjs} | 0 .../debug/entry-corejs3-es}/options.json | 4 +- .../debug}/entry-corejs3-es/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../debug/entry-corejs3-no-import/input.js} | 0 .../entry-corejs3-no-import/options.json | 4 +- .../debug/entry-corejs3-no-import}/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 5 +- .../debug/entry-corejs3-proposals/input.mjs} | 0 .../entry-corejs3-proposals/options.json | 4 +- .../debug}/entry-corejs3-proposals/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 22 +++ .../entry-corejs3-runtime-only/input.mjs} | 0 .../entry-corejs3-runtime-only/options.json | 15 ++ .../entry-corejs3-runtime-only}/stdout.txt | 5 +- .../input.mjs} | 0 .../options.json | 15 ++ .../stdout.txt | 5 +- .../entry-corejs3-specific-entries/input.mjs} | 0 .../options.json | 12 ++ .../entry-corejs3-specific-entries/stdout.txt | 3 +- .../entry-corejs3-specific-targets/input.mjs} | 0 .../options.json | 4 +- .../entry-corejs3-specific-targets/stdout.txt | 3 +- .../entry-corejs3-stable-chrome-71/input.mjs} | 0 .../options.json | 15 ++ .../entry-corejs3-stable-chrome-71/stdout.txt | 5 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 5 +- .../debug/entry-corejs3-stable/input.mjs} | 0 .../debug/entry-corejs3-stable/options.json | 12 ++ .../debug}/entry-corejs3-stable/stdout.txt | 3 +- .../entry-corejs3-stage-chrome-71/input.mjs} | 0 .../options.json | 15 ++ .../entry-corejs3-stage-chrome-71}/stdout.txt | 5 +- .../debug/entry-corejs3-stage/input.mjs} | 0 .../debug/entry-corejs3-stage/options.json | 12 ++ .../debug}/entry-corejs3-stage/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 6 +- .../stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stdout.txt | 3 +- .../entry-corejs3-versions-strings/input.mjs} | 0 .../options.json | 4 +- .../entry-corejs3-versions-strings/stdout.txt | 3 +- .../entry-corejs3-web-chrome-71/input.mjs} | 0 .../entry-corejs3-web-chrome-71/options.json | 15 ++ .../entry-corejs3-web-chrome-71/stdout.txt | 5 +- .../debug/entry-corejs3-web/input.mjs} | 0 .../debug/entry-corejs3-web/options.json | 12 ++ .../debug}/entry-corejs3-web/stdout.txt | 3 +- .../debug/entry-corejs3/input.mjs} | 0 .../debug}/entry-corejs3/options.json | 4 +- .../debug}/entry-corejs3/stdout.txt | 3 +- .../debug/entry-no-corejs-no-import/input.js} | 0 .../entry-no-corejs-no-import/options.json | 4 +- .../entry-no-corejs-no-import/stderr.txt | 0 .../entry-no-corejs-no-import/stdout.txt | 3 +- .../input.mjs} | 0 .../options.json | 4 +- .../stderr.txt | 0 .../stdout.txt | 3 +- .../debug/entry-no-corejs-uglify/input.mjs} | 0 .../entry-no-corejs-uglify/options.json | 4 +- .../debug}/entry-no-corejs-uglify/stderr.txt | 0 .../debug}/entry-no-corejs-uglify/stdout.txt | 3 +- .../debug/entry-no-corejs/input.mjs} | 0 .../debug}/entry-no-corejs/options.json | 4 +- .../debug}/entry-no-corejs/stderr.txt | 0 .../debug}/entry-no-corejs/stdout.txt | 3 +- .../debug/plugins-only/input.mjs} | 0 .../debug}/plugins-only/options.json | 6 +- .../debug}/plugins-only/stdout.txt | 1 - .../debug/usage-corejs2-1/input.js} | 0 .../debug/usage-corejs2-1}/options.json | 4 +- .../debug/usage-corejs2-1}/stdout.txt | 8 +- .../debug/usage-corejs2-2/input.js} | 0 .../debug/usage-corejs2-2}/options.json | 4 +- .../fixtures/debug/usage-corejs2-2/stdout.txt | 49 ++++++ .../debug/usage-corejs2-chrome-71-1/input.js} | 0 .../usage-corejs2-chrome-71-1}/options.json | 4 +- .../usage-corejs2-chrome-71-1}/stdout.txt | 6 +- .../debug/usage-corejs2-chrome-71-2/input.js} | 0 .../usage-corejs2-chrome-71-2}/options.json | 6 +- .../usage-corejs2-chrome-71-2}/stdout.txt | 6 +- .../debug/usage-corejs2-none-1/input.js} | 0 .../debug/usage-corejs2-none-1/options.json | 16 ++ .../debug/usage-corejs2-none-1}/stdout.txt | 5 +- .../debug/usage-corejs2-none-2/input.js} | 0 .../debug/usage-corejs2-none-2/options.json | 16 ++ .../debug/usage-corejs2-none-2}/stdout.txt | 5 +- .../debug/usage-corejs2-proposals-1/input.js} | 0 .../usage-corejs2-proposals-1}/options.json | 4 +- .../usage-corejs2-proposals-1}/stdout.txt | 8 +- .../debug/usage-corejs2-proposals-2/input.js} | 0 .../usage-corejs2-proposals-2/options.json | 16 ++ .../usage-corejs2-proposals-2/stdout.txt | 49 ++++++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 6 +- .../input.js} | 0 .../options.json | 14 ++ .../stdout.txt | 21 +++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 8 +- .../input.js} | 0 .../options.json | 17 ++ .../stdout.txt | 49 ++++++ .../usage-corejs2-with-import/input.mjs} | 0 .../usage-corejs2-with-import/options.json | 4 +- .../usage-corejs2-with-import/stderr.txt | 0 .../usage-corejs2-with-import}/stdout.txt | 3 +- .../debug/usage-corejs3-1/input.js} | 0 .../debug/usage-corejs3-1}/options.json | 4 +- .../debug/usage-corejs3-1}/stdout.txt | 10 +- .../debug/usage-corejs3-2/input.js} | 0 .../debug/usage-corejs3-2}/options.json | 4 +- .../fixtures/debug/usage-corejs3-2/stdout.txt | 51 ++++++ .../debug/usage-corejs3-chrome-71-1/input.js} | 0 .../usage-corejs3-chrome-71-1/options.json | 14 ++ .../usage-corejs3-chrome-71-1}/stdout.txt | 7 +- .../debug/usage-corejs3-chrome-71-2/input.js} | 0 .../usage-corejs3-chrome-71-2/options.json | 14 ++ .../usage-corejs3-chrome-71-2/stdout.txt | 20 +++ .../debug/usage-corejs3-none-1/input.js} | 0 .../debug/usage-corejs3-none-1/options.json | 16 ++ .../debug/usage-corejs3-none-1}/stdout.txt | 5 +- .../debug/usage-corejs3-none-2/input.js} | 0 .../debug/usage-corejs3-none-2/options.json | 16 ++ .../debug/usage-corejs3-none-2/stdout.txt | 46 ++++++ .../debug/usage-corejs3-proposals-1/input.js} | 0 .../usage-corejs3-proposals-1}/options.json | 4 +- .../usage-corejs3-proposals-1}/stdout.txt | 10 +- .../debug/usage-corejs3-proposals-2/input.js} | 0 .../usage-corejs3-proposals-2/options.json | 16 ++ .../usage-corejs3-proposals-2/stdout.txt | 51 ++++++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 5 +- .../input.js} | 0 .../options.json | 14 ++ .../stdout.txt | 20 +++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 10 +- .../input.js} | 0 .../options.json | 17 ++ .../stdout.txt | 51 ++++++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 10 +- .../input.js} | 0 .../options.json | 16 ++ .../stdout.txt | 51 ++++++ .../input.js} | 0 .../options.json | 4 +- .../stdout.txt | 10 +- .../input.js} | 0 .../options.json | 16 ++ .../stdout.txt | 51 ++++++ .../usage-corejs3-with-import/input.mjs} | 0 .../usage-corejs3-with-import/options.json | 4 +- .../usage-corejs3-with-import/stderr.txt | 0 .../usage-corejs3-with-import}/stdout.txt | 3 +- .../debug/usage-no-corejs-1/input.js} | 0 .../debug/usage-no-corejs-1/options.json | 15 ++ .../debug/usage-no-corejs-1}/stderr.txt | 0 .../debug/usage-no-corejs-1}/stdout.txt | 8 +- .../debug/usage-no-corejs-2/input.js} | 0 .../debug/usage-no-corejs-2/options.json | 15 ++ .../debug/usage-no-corejs-2}/stderr.txt | 0 .../debug/usage-no-corejs-2/stdout.txt | 49 ++++++ .../debug/usage-no-corejs-none-1/input.js} | 0 .../usage-no-corejs-none-1}/options.json | 4 +- .../debug/usage-no-corejs-none-1/stderr.txt | 6 + .../debug/usage-no-corejs-none-1/stdout.txt | 46 ++++++ .../debug/usage-no-corejs-none-2/input.js} | 0 .../usage-no-corejs-none-2}/options.json | 4 +- .../debug/usage-no-corejs-none-2/stderr.txt | 6 + .../debug/usage-no-corejs-none-2/stdout.txt | 46 ++++++ 269 files changed, 1354 insertions(+), 555 deletions(-) delete mode 100644 packages/babel-preset-env/test/debug-fixtures.js delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/options.json delete mode 100644 packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/options.json rename packages/babel-preset-env/test/{debug-fixtures/corejs-without-usebuiltins/in/in.js => fixtures/debug/corejs-without-usebuiltins/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/corejs-without-usebuiltins/options.json (52%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/corejs-without-usebuiltins/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-android/in/in.js => fixtures/debug/entry-corejs2-android/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-android/options.json (72%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-android/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-electron/in/in.js => fixtures/debug/entry-corejs2-electron/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-electron/options.json (71%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-electron/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-force-all-transforms/in/in.js => fixtures/debug/entry-corejs2-force-all-transforms/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-force-all-transforms/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-force-all-transforms/stdout.txt (92%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-no-import/in/in.js => fixtures/debug/entry-corejs2-no-import/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-no-import/options.json (70%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-no-import => fixtures/debug/entry-corejs2-no-import}/stdout.txt (85%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-proposals-chrome-71/in/in.js => fixtures/debug/entry-corejs2-proposals-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-proposals-chrome-71/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-proposals-chrome-71/stdout.txt (76%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-proposals/in/in.js => fixtures/debug/entry-corejs2-proposals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-proposals/options.json (68%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-shippedProposals => fixtures/debug/entry-corejs2-proposals}/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-shippedProposals-chrome-71/in/in.js => fixtures/debug/entry-corejs2-shippedProposals-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-shippedProposals-chrome-71/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-shippedProposals-chrome-71/stdout.txt (75%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-shippedProposals/in/in.js => fixtures/debug/entry-corejs2-shippedProposals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-shippedProposals/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures/entry-no-corejs-shippedProposals => fixtures/debug/entry-corejs2-shippedProposals}/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-specific-targets/in/in.js => fixtures/debug/entry-corejs2-specific-targets/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-specific-targets/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-specific-targets/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-versions-decimals/in/in.js => fixtures/debug/entry-corejs2-versions-decimals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-versions-decimals/options.json (77%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-versions-decimals/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-versions-strings/in/in.js => fixtures/debug/entry-corejs2-versions-strings/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-versions-strings/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2-versions-strings/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2/in/in.js => fixtures/debug/entry-corejs2/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs2/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-all-chrome-71/in/in.js => fixtures/debug/entry-corejs3-all-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-proposals-chrome-71 => fixtures/debug/entry-corejs3-all-chrome-71}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-all-chrome-71/stdout.txt (93%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-all/in/in.js => fixtures/debug/entry-corejs3-all/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-babel-polyfill => fixtures/debug/entry-corejs3-all}/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-all/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-android/in/in.js => fixtures/debug/entry-corejs3-android/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-android/options.json (56%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-android/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-babel-polyfill/in/in.js => fixtures/debug/entry-corejs3-babel-polyfill/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-proposals => fixtures/debug/entry-corejs3-babel-polyfill}/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-babel-polyfill/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-babel-polyfill/stdout.txt (90%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-electron/in/in.js => fixtures/debug/entry-corejs3-electron/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-electron/options.json (71%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-electron/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-chrome-71/in/in.js => fixtures/debug/entry-corejs3-es-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-runtime-only-chrome-71 => fixtures/debug/entry-corejs3-es-chrome-71}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-es-chrome-71/stdout.txt (65%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-proposals-chrome-71/in/in.js => fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-chrome-71 => fixtures/debug/entry-corejs3-es-proposals-chrome-71}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-es-proposals-chrome-71/stdout.txt (92%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es-proposals/in/in.js => fixtures/debug/entry-corejs3-es-proposals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es => fixtures/debug/entry-corejs3-es-proposals}/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-es-proposals/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-es/in/in.js => fixtures/debug/entry-corejs3-es/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-all => fixtures/debug/entry-corejs3-es}/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-es/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-force-all-transforms/in/in.js => fixtures/debug/entry-corejs3-force-all-transforms/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-force-all-transforms/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-force-all-transforms/stdout.txt (94%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-no-import/in/in.js => fixtures/debug/entry-corejs3-no-import/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-no-import/options.json (70%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-no-import => fixtures/debug/entry-corejs3-no-import}/stdout.txt (86%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-proposals-chrome-71/in/in.js => fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-proposals-chrome-71/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stage-chrome-71 => fixtures/debug/entry-corejs3-proposals-chrome-71}/stdout.txt (92%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-proposals/in/in.js => fixtures/debug/entry-corejs3-proposals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-proposals/options.json (68%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-proposals/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-runtime-only-chrome-71/in/in.js => fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-all-chrome-71 => fixtures/debug/entry-corejs3-runtime-only-chrome-71}/options.json (75%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-runtime-only/in/in.js => fixtures/debug/entry-corejs3-runtime-only/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-runtime-only-chrome-71 => fixtures/debug/entry-corejs3-runtime-only}/stdout.txt (60%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-specific-entries-chrome-71/in/in.js => fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-specific-entries-chrome-71/stdout.txt (74%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-specific-entries/in/in.js => fixtures/debug/entry-corejs3-specific-entries/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-specific-entries/stdout.txt (94%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-specific-targets/in/in.js => fixtures/debug/entry-corejs3-specific-targets/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-specific-targets/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-specific-targets/stdout.txt (99%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stable-chrome-71/in/in.js => fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-stable-chrome-71/stdout.txt (66%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stable-samsung-8.2/in/in.js => fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-stable-samsung-8.2/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-stable-samsung-8.2/stdout.txt (79%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stable/in/in.js => fixtures/debug/entry-corejs3-stable/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-stable/stdout.txt (97%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stage-chrome-71/in/in.js => fixtures/debug/entry-corejs3-stage-chrome-71/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-proposals-chrome-71 => fixtures/debug/entry-corejs3-stage-chrome-71}/stdout.txt (92%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-stage/in/in.js => fixtures/debug/entry-corejs3-stage/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-stage/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-versions-decimals/in/in.js => fixtures/debug/entry-corejs3-versions-decimals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-decimals/options.json (69%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-decimals/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-versions-strings-minor-3.0/in/in.js => fixtures/debug/entry-corejs3-versions-strings-minor-3.0/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings-minor-3.0/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings-minor-3.0/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-versions-strings-minor-3.1/in/in.js => fixtures/debug/entry-corejs3-versions-strings-minor-3.1/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings-minor-3.1/options.json (76%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings-minor-3.1/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-versions-strings/in/in.js => fixtures/debug/entry-corejs3-versions-strings/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-versions-strings/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-web-chrome-71/in/in.js => fixtures/debug/entry-corejs3-web-chrome-71/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-web-chrome-71/stdout.txt (60%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-web/in/in.js => fixtures/debug/entry-corejs3-web/input.mjs} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3-web/stdout.txt (91%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3/in/in.js => fixtures/debug/entry-corejs3/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-corejs3/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/entry-no-corejs-no-import/in/in.js => fixtures/debug/entry-no-corejs-no-import/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-no-import/options.json (67%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-no-import/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-no-import/stdout.txt (85%) rename packages/babel-preset-env/test/{debug-fixtures/entry-no-corejs-shippedProposals/in/in.js => fixtures/debug/entry-no-corejs-shippedProposals/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-shippedProposals/options.json (64%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-shippedProposals/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs2-proposals => fixtures/debug/entry-no-corejs-shippedProposals}/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/entry-no-corejs-uglify/in/in.js => fixtures/debug/entry-no-corejs-uglify/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-uglify/options.json (74%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-uglify/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs-uglify/stdout.txt (93%) rename packages/babel-preset-env/test/{debug-fixtures/entry-no-corejs/in/in.js => fixtures/debug/entry-no-corejs/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs/options.json (73%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/entry-no-corejs/stdout.txt (98%) rename packages/babel-preset-env/test/{debug-fixtures/plugins-only/in/in.js => fixtures/debug/plugins-only/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/plugins-only/options.json (78%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/plugins-only/stdout.txt (96%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-chrome-71/in/in.js => fixtures/debug/usage-corejs2-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2 => fixtures/debug/usage-corejs2-1}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-shippedProposals => fixtures/debug/usage-corejs2-1}/stdout.txt (88%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-chrome-71/in/in2.js => fixtures/debug/usage-corejs2-2/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-none => fixtures/debug/usage-corejs2-2}/options.json (75%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals-chrome-71/in/in.js => fixtures/debug/usage-corejs2-chrome-71-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-chrome-71 => fixtures/debug/usage-corejs2-chrome-71-1}/options.json (70%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-chrome-71 => fixtures/debug/usage-corejs2-chrome-71-1}/stdout.txt (71%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals-chrome-71/in/in2.js => fixtures/debug/usage-corejs2-chrome-71-2/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-chrome-71 => fixtures/debug/usage-corejs2-chrome-71-2}/options.json (61%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals-chrome-71 => fixtures/debug/usage-corejs2-chrome-71-2}/stdout.txt (71%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-none/in/in.js => fixtures/debug/usage-corejs2-none-1/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-none => fixtures/debug/usage-corejs2-none-1}/stdout.txt (89%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-none/in/in2.js => fixtures/debug/usage-corejs2-none-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs-none => fixtures/debug/usage-corejs2-none-2}/stdout.txt (89%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals/in/in.js => fixtures/debug/usage-corejs2-proposals-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals => fixtures/debug/usage-corejs2-proposals-1}/options.json (78%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2 => fixtures/debug/usage-corejs2-proposals-1}/stdout.txt (88%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals/in/in2.js => fixtures/debug/usage-corejs2-proposals-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-shippedProposals/in/in.js => fixtures/debug/usage-corejs2-proposals-chrome-71-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals-chrome-71 => fixtures/debug/usage-corejs2-proposals-chrome-71-1}/options.json (74%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-chrome-71 => fixtures/debug/usage-corejs2-proposals-chrome-71-1}/stdout.txt (66%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-shippedProposals/in/in2.js => fixtures/debug/usage-corejs2-proposals-chrome-71-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2/in/in.js => fixtures/debug/usage-corejs2-shippedProposals-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-shippedProposals => fixtures/debug/usage-corejs2-shippedProposals-1}/options.json (78%) rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs => fixtures/debug/usage-corejs2-shippedProposals-1}/stdout.txt (88%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2/in/in2.js => fixtures/debug/usage-corejs2-shippedProposals-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-with-import/in/in.js => fixtures/debug/usage-corejs2-with-import/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/usage-corejs2-with-import/options.json (70%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/usage-corejs2-with-import/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-with-import => fixtures/debug/usage-corejs2-with-import}/stdout.txt (79%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-chrome-71/in/in.js => fixtures/debug/usage-corejs3-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-none => fixtures/debug/usage-corejs3-1}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.1 => fixtures/debug/usage-corejs3-1}/stdout.txt (84%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-chrome-71/in/in2.js => fixtures/debug/usage-corejs3-2/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3 => fixtures/debug/usage-corejs3-2}/options.json (75%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals-chrome-71/in/in.js => fixtures/debug/usage-corejs3-chrome-71-1/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json rename packages/babel-preset-env/test/{debug-fixtures/entry-corejs3-runtime-only => fixtures/debug/usage-corejs3-chrome-71-1}/stdout.txt (65%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals-chrome-71/in/in2.js => fixtures/debug/usage-corejs3-chrome-71-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-none/in/in.js => fixtures/debug/usage-corejs3-none-1/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-none => fixtures/debug/usage-corejs3-none-1}/stdout.txt (89%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-none/in/in2.js => fixtures/debug/usage-corejs3-none-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals/in/in.js => fixtures/debug/usage-corejs3-proposals-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals => fixtures/debug/usage-corejs3-proposals-1}/options.json (78%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals => fixtures/debug/usage-corejs3-proposals-1}/stdout.txt (89%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals/in/in2.js => fixtures/debug/usage-corejs3-proposals-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-shippedProposals/in/in.js => fixtures/debug/usage-corejs3-proposals-chrome-71-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals-chrome-71 => fixtures/debug/usage-corejs3-proposals-chrome-71-1}/options.json (74%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-proposals-chrome-71 => fixtures/debug/usage-corejs3-proposals-chrome-71-1}/stdout.txt (84%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-shippedProposals/in/in2.js => fixtures/debug/usage-corejs3-proposals-chrome-71-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in.js => fixtures/debug/usage-corejs3-shippedProposals-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-shippedProposals => fixtures/debug/usage-corejs3-shippedProposals-1}/options.json (78%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-shippedProposals => fixtures/debug/usage-corejs3-shippedProposals-1}/stdout.txt (85%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in2.js => fixtures/debug/usage-corejs3-shippedProposals-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in.js => fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.0 => fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3 => fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1}/stdout.txt (84%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in2.js => fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3/in/in.js => fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.1 => fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1}/options.json (75%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-versions-strings-minor-3.0 => fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1}/stdout.txt (84%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3/in/in2.js => fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs3-with-import/in/in.js => fixtures/debug/usage-corejs3-with-import/input.mjs} (100%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/usage-corejs3-with-import/options.json (70%) rename packages/babel-preset-env/test/{debug-fixtures => fixtures/debug}/usage-corejs3-with-import/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-with-import => fixtures/debug/usage-corejs3-with-import}/stdout.txt (79%) rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs/in/in.js => fixtures/debug/usage-no-corejs-1/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs-none => fixtures/debug/usage-no-corejs-1}/stderr.txt (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-corejs2-proposals => fixtures/debug/usage-no-corejs-1}/stdout.txt (88%) rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs/in/in2.js => fixtures/debug/usage-no-corejs-2/input.js} (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs => fixtures/debug/usage-no-corejs-2}/stderr.txt (100%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs-none/in/in.js => fixtures/debug/usage-no-corejs-none-1/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs-none => fixtures/debug/usage-no-corejs-none-1}/options.json (73%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs-none/in/in2.js => fixtures/debug/usage-no-corejs-none-2/input.js} (100%) rename packages/babel-preset-env/test/{debug-fixtures/usage-no-corejs => fixtures/debug/usage-no-corejs-none-2}/options.json (73%) create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt create mode 100644 packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index fe30b82309a5..991975fcadf3 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -149,6 +149,7 @@ export default function get(entryLoc): Array { disabled: taskName[0] === ".", options: taskOpts, validateLogs: taskOpts.validateLogs, + ignoreOutput: taskOpts.ignoreOutput, stdout: { loc: stdoutLoc, code: readFile(stdoutLoc) }, stderr: { loc: stderrLoc, code: readFile(stderrLoc) }, exec: { @@ -234,9 +235,23 @@ export default function get(entryLoc): Array { (test.stdout.code ? stdoutLoc : stderrLoc), ); } + if (test.options.ignoreOutput) { + if (test.expect.code) { + throw new Error( + "Test cannot ignore its output and also validate it: " + expectLoc, + ); + } + if (!test.validateLogs) { + throw new Error( + "ignoreOutput can only be used when validateLogs is true: " + + taskOptsLoc, + ); + } + } // Delete to avoid option validation error delete test.options.validateLogs; + delete test.options.ignoreOutput; } } diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index ba85918ee12f..1af2fb868560 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -138,6 +138,7 @@ function run(task) { options: opts, optionsDir, validateLogs, + ignoreOutput, stdout, stderr, } = task; @@ -221,33 +222,35 @@ function run(task) { const outputCode = normalizeOutput(result.code); checkDuplicatedNodes(babel, result.ast); - if ( - !expected.code && - outputCode && - !opts.throws && - fs.statSync(path.dirname(expected.loc)).isDirectory() && - !process.env.CI - ) { - const expectedFile = expected.loc.replace( - /\.m?js$/, - result.sourceType === "module" ? ".mjs" : ".js", - ); - - console.log(`New test file created: ${expectedFile}`); - fs.writeFileSync(expectedFile, `${outputCode}\n`); - - if (expected.loc !== expectedFile) { - try { - fs.unlinkSync(expected.loc); - } catch (e) {} - } - } else { - validateFile(outputCode, expected.loc, expectedCode); - - if (inputCode) { - expect(expected.loc).toMatch( - result.sourceType === "module" ? /\.mjs$/ : /\.js$/, + if (!ignoreOutput) { + if ( + !expected.code && + outputCode && + !opts.throws && + fs.statSync(path.dirname(expected.loc)).isDirectory() && + !process.env.CI + ) { + const expectedFile = expected.loc.replace( + /\.m?js$/, + result.sourceType === "module" ? ".mjs" : ".js", ); + + console.log(`New test file created: ${expectedFile}`); + fs.writeFileSync(expectedFile, `${outputCode}\n`); + + if (expected.loc !== expectedFile) { + try { + fs.unlinkSync(expected.loc); + } catch (e) {} + } + } else { + validateFile(outputCode, expected.loc, expectedCode); + + if (inputCode) { + expect(expected.loc).toMatch( + result.sourceType === "module" ? /\.mjs$/ : /\.js$/, + ); + } } } @@ -294,7 +297,10 @@ function validateFile(actualCode, expectedLoc, expectedCode) { function normalizeOutput(code) { return code .trim() - .replace(escapeRegExp(path.resolve(__dirname, "../../../")), ""); + .replace( + new RegExp(escapeRegExp(path.resolve(__dirname, "../../../")), "g"), + "", + ); } const toEqualFile = () => ({ diff --git a/packages/babel-preset-env/test/debug-fixtures.js b/packages/babel-preset-env/test/debug-fixtures.js deleted file mode 100644 index 959a2fd133b5..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures.js +++ /dev/null @@ -1,148 +0,0 @@ -const child = require("child_process"); -const fs = require("fs-extra"); -const helper = require("@babel/helper-fixtures"); -const path = require("path"); - -const fixtureLoc = path.join(__dirname, "debug-fixtures"); -const tmpLoc = path.join(__dirname, "tmp"); - -const clear = () => { - process.chdir(__dirname); - if (fs.existsSync(tmpLoc)) fs.removeSync(tmpLoc); - fs.mkdirSync(tmpLoc); - process.chdir(tmpLoc); -}; - -const saveInFiles = files => { - Object.keys(files).forEach(filename => { - const content = files[filename]; - fs.outputFileSync(filename, content); - }); -}; - -const testOutputType = (type, stdTarg, opts) => { - stdTarg = stdTarg.trim(); - stdTarg = stdTarg.replace(/\\/g, "/"); - const optsTarg = opts[type]; - - if (optsTarg) { - const expectStdout = optsTarg.trim(); - expect(stdTarg).toBe(expectStdout); - } else { - const file = path.join(opts.testLoc, `${type}.txt`); - console.log(`New test file created: ${file}`); - fs.outputFileSync(file, stdTarg); - } -}; - -const assertTest = (stdout, stderr, opts) => { - testOutputType("stdout", stdout, opts); - if (stderr) { - testOutputType("stderr", stderr, opts); - } -}; - -const buildTest = opts => { - const binLoc = require.resolve("@babel/cli/bin/babel"); - - return callback => { - clear(); - saveInFiles(opts.inFiles); - - let args = [binLoc]; - args = args.concat(opts.args); - - const spawn = child.spawn(process.execPath, args, { - cwd: tmpLoc, - }); - - let stdout = ""; - let stderr = ""; - - spawn.stdout.on("data", chunk => (stdout += chunk)); - spawn.stderr.on("data", chunk => (stderr += chunk)); - - spawn.on("close", () => { - let err; - - try { - stdout = replacePaths(stdout); - stderr = replacePaths(stderr); - - assertTest(stdout, stderr, opts); - } catch (e) { - err = e; - } - - callback(err); - }); - }; -}; - -function replacePaths(str) { - let prev; - do { - prev = str; - str = str.replace(tmpLoc, ""); - } while (str !== prev); - - return str; -} - -describe("debug output", () => { - let cwd; - - beforeEach(() => { - cwd = process.cwd(); - }); - - afterEach(() => { - process.chdir(cwd); - }); - - fs.readdirSync(fixtureLoc).forEach(testName => { - if (testName.slice(0, 1) === ".") return; - const testLoc = path.join(fixtureLoc, testName); - - const opts = { - args: ["src", "--out-dir", "lib"], - testLoc: testLoc, - }; - - const stdoutLoc = path.join(testLoc, "stdout.txt"); - const stderrLoc = path.join(testLoc, "stderr.txt"); - - if (fs.existsSync(stdoutLoc)) { - opts.stdout = helper.readFile(stdoutLoc); - } - - if (fs.existsSync(stderrLoc)) { - opts.stderr = helper.readFile(stderrLoc); - } - - const optionsLoc = path.join(testLoc, "options.json"); - - if (!fs.existsSync(optionsLoc)) { - throw new Error( - `Debug test '${testName}' is missing an options.json file`, - ); - } - - const inFilesFolderLoc = path.join(testLoc, "in"); - - opts.inFiles = { - ".babelrc": helper.readFile(optionsLoc), - }; - - if (!fs.existsSync(inFilesFolderLoc)) { - opts.inFiles["src/in.js"] = ""; - } else { - fs.readdirSync(inFilesFolderLoc).forEach(filename => { - opts.inFiles[`src/${filename}`] = helper.readFile( - path.join(inFilesFolderLoc, filename), - ); - }); - } - it(testName, buildTest(opts)); - }); -}); diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/options.json deleted file mode 100644 index b9db1e21e401..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/options.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/options.json deleted file mode 100644 index b9db1e21e401..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/options.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/options.json deleted file mode 100644 index 1e5ef9ed0a56..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/options.json deleted file mode 100644 index b9db1e21e401..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/options.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/options.json deleted file mode 100644 index 1e5ef9ed0a56..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/options.json deleted file mode 100644 index b9db1e21e401..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/options.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/options.json deleted file mode 100644 index 1e5ef9ed0a56..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/options.json deleted file mode 100644 index b9db1e21e401..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/options.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/options.json b/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/options.json deleted file mode 100644 index 1e5ef9ed0a56..000000000000 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/options.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - ["../../lib", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] - ] -} diff --git a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/in/in.js b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/options.json b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json similarity index 52% rename from packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/options.json rename to packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json index 5e051fe4e1b1..4b48078b39fe 100644 --- a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "corejs": 3 }] diff --git a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt index 8edc822211ac..dd2af17fc22d 100644 --- a/packages/babel-preset-env/test/debug-fixtures/corejs-without-usebuiltins/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt @@ -44,4 +44,3 @@ Using plugins: proposal-dynamic-import {} Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json similarity index 72% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json index 4874a2298d1e..4c0f7ba53228 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": [ "Android >= 4" ] diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt index 9660624a053b..d4cb727787d8 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-android/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "android":"4" } es6.array.fill { "android":"4" } es6.array.find { "android":"4" } @@ -158,4 +158,3 @@ Using polyfills with `entry` option: web.timers { "android":"4" } web.immediate { "android":"4" } web.dom.iterable { "android":"4" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json similarity index 71% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json index 7055c2d63318..6e94b50ef9cd 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "electron": 0.36 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt index ce32c796e65c..c3c18fa3a051 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-electron/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/stdout.txt @@ -39,7 +39,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.every { "electron":"0.36" } es6.array.filter { "electron":"0.36" } es7.array.flat-map { "electron":"0.36" } @@ -133,4 +133,3 @@ Using polyfills with `entry` option: web.timers { "electron":"0.36" } web.immediate { "electron":"0.36" } web.dom.iterable { "electron":"0.36" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json index 3615dbaff0f6..85173e88bc5a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "modules": false, "targets": { diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt similarity index 92% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt index 30fbdca39bfc..32637c13542d 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-force-all-transforms/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es7.array.flat-map { "chrome":"55" } es6.array.sort { "chrome":"55" } es7.object.define-getter { "chrome":"55" } @@ -61,4 +61,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"55" } web.immediate { "chrome":"55" } web.dom.iterable { "chrome":"55" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json similarity index 70% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json index b8acc7a56de8..f25fe559174a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "node": 6 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt similarity index 85% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt index f5eaed804825..fc924a413e56 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt @@ -25,5 +25,4 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Import of core-js was not found. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/input.js] Import of @babel/polyfill was not found. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json index 6873f884f7c8..7b1a34227227 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt index 1892aa8040bb..632adbae014a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt @@ -17,8 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/input.mjs] Replaced @babel/polyfill entries with the following polyfills: web.timers { "chrome":"71" } web.immediate { "chrome":"71" } web.dom.iterable { "chrome":"71" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json similarity index 68% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json index e95eabddbf17..6f3ed59a0688 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "useBuiltIns": "entry", "corejs": { "version": 2, "proposals": true } diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt index 68c0e41d5803..e5a186c32135 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within {} es6.array.every {} es6.array.fill {} @@ -192,4 +192,3 @@ Using polyfills with `entry` option: web.timers {} web.immediate {} web.dom.iterable {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json index 2998e96d184b..396589b5f1f9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt index 1892aa8040bb..583e108fd4cf 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt @@ -17,8 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/input.mjs] Replaced @babel/polyfill entries with the following polyfills: web.timers { "chrome":"71" } web.immediate { "chrome":"71" } web.dom.iterable { "chrome":"71" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json index 519fd0ad0e7b..7510b6b4ec8b 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt index 68c0e41d5803..cbffdcc578f3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within {} es6.array.every {} es6.array.fill {} @@ -192,4 +192,3 @@ Using polyfills with `entry` option: web.timers {} web.immediate {} web.dom.iterable {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json index dc30ad296d4b..f36ee4c5d356 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt index 0ef9459d2b43..16202760ee72 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-specific-targets/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/stdout.txt @@ -47,7 +47,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "ie":"10", "safari":"7" } es6.array.fill { "ie":"10", "safari":"7" } es6.array.find { "ie":"10", "safari":"7" } @@ -177,4 +177,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } web.immediate { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } web.dom.iterable { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json similarity index 77% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json index abf19b511667..633a32f89827 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": 2, "debug": true, diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt index 52357b555629..63ba5e06fce5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-decimals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/stdout.txt @@ -55,7 +55,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "ie":"10" } es6.array.every { "electron":"0.36" } es6.array.fill { "ie":"10" } @@ -204,4 +204,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.immediate { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.dom.iterable { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json index e586d8bb545e..031acab85bc0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": 2, "debug": true, diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt index 05a6f95b2cac..ae6350c447da 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-versions-strings/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "ie":"10" } es6.array.fill { "ie":"10" } es6.array.find { "ie":"10" } @@ -173,4 +173,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"54", "ie":"10", "node":"6.10" } web.immediate { "chrome":"54", "ie":"10", "node":"6.10" } web.dom.iterable { "chrome":"54", "ie":"10", "node":"6.10" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json index de9fd3231ddf..5ef6d39cc2a1 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome >= 54, ie 10", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt index fd68de0c44c6..4b45c43d32d2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "ie":"10" } es6.array.fill { "ie":"10" } es6.array.find { "ie":"10" } @@ -173,4 +173,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"54", "ie":"10", "node":"6" } web.immediate { "chrome":"54", "ie":"10", "node":"6" } web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json index b9db1e21e401..6782704424da 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt similarity index 93% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt index 2951c8d2839d..d09bcf36bfe8 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } es.object.from-entries { "chrome":"71" } @@ -104,5 +104,4 @@ Using polyfills with `entry` option: esnext.weak-set.of { "chrome":"71" } web.immediate { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json index 1e5ef9ed0a56..5f13bdc6b92f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt index 09822b87afc2..0d0f575f70c3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/input.mjs] Replaced core-js entries with the following polyfills: es.symbol {} es.symbol.description {} es.symbol.async-iterator {} @@ -334,4 +334,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json similarity index 56% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json index e7f7ecdb7292..b6c566915214 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json @@ -1,9 +1,11 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { - "browsers": [ "Android >= 4" ] + "browsers": ["Android >= 4"] }, "useBuiltIns": "entry", "corejs": 3 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt index 85869080092e..42d9f81c58b4 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-android/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "android":"4" } es.symbol.description { "android":"4" } es.symbol.async-iterator { "android":"4" } @@ -247,4 +247,3 @@ Using polyfills with `entry` option: web.url { "android":"4" } web.url.to-json { "android":"4" } web.url-search-params { "android":"4" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json index 1e5ef9ed0a56..5f13bdc6b92f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt similarity index 90% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt index 9e116b9ca002..a900b4720ab0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-babel-polyfill/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/stdout.txt @@ -43,5 +43,4 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Import of core-js was not found. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/input.mjs] Import of core-js was not found. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json similarity index 71% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json index acc203c75c8e..1f0ca6f76f10 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "electron": 0.36 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt index 2db44452e27e..5445a52fdfa9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-electron/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/stdout.txt @@ -39,7 +39,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "electron":"0.36" } es.symbol.description { "electron":"0.36" } es.symbol.async-iterator { "electron":"0.36" } @@ -135,4 +135,3 @@ Using polyfills with `entry` option: web.url { "electron":"0.36" } web.url.to-json { "electron":"0.36" } web.url-search-params { "electron":"0.36" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json index b9db1e21e401..6782704424da 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt similarity index 65% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt index 9b5801afb435..99d49d29aacb 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt @@ -17,10 +17,9 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } es.object.from-entries { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json index b9db1e21e401..6782704424da 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt similarity index 92% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt index f1855c04cb94..b33a091e4a0c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } es.object.from-entries { "chrome":"71" } @@ -103,5 +103,4 @@ Using polyfills with `entry` option: esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json index 1e5ef9ed0a56..5f13bdc6b92f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt index 87b297105bbf..07743893310e 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es-proposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/input.mjs] Replaced core-js entries with the following polyfills: es.symbol {} es.symbol.description {} es.symbol.async-iterator {} @@ -329,4 +329,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json index 1e5ef9ed0a56..5f13bdc6b92f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt index 83949367f997..f6c3da52ca39 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-es/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/input.mjs] Replaced core-js entries with the following polyfills: es.symbol {} es.symbol.description {} es.symbol.async-iterator {} @@ -244,4 +244,3 @@ Using polyfills with `entry` option: es.typed-array.to-string {} es.weak-map {} es.weak-set {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json index c1c4390e7125..6fb693e23b6a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "modules": false, "targets": { diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt similarity index 94% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt index da1c67caeaf5..f367d425aa6a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-force-all-transforms/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/input.mjs] Replaced core-js entries with the following polyfills: es.symbol.description { "chrome":"55" } es.symbol.async-iterator { "chrome":"55" } es.array.flat { "chrome":"55" } @@ -73,4 +73,3 @@ Using polyfills with `entry` option: web.url { "chrome":"55" } web.url.to-json { "chrome":"55" } web.url-search-params { "chrome":"55" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json similarity index 70% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json index 394e16ee1e55..d4bddcf3bd17 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "node": 6 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt similarity index 86% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt index 8d7d5c3610d2..7dd81bf8bd49 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt @@ -25,5 +25,4 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Import of @babel/polyfill was not found. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/input.js] Import of core-js was not found. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json index f08309ca7b73..22bbaecaf5bc 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt similarity index 92% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt index a561ed31a0c5..3efcd119e087 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: esnext.aggregate-error { "chrome":"71" } esnext.array.last-index { "chrome":"71" } esnext.array.last-item { "chrome":"71" } @@ -100,5 +100,4 @@ Using polyfills with `entry` option: esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json similarity index 68% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json index 56005256589a..e7b977b6a6fd 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "useBuiltIns": "entry", "corejs": { "version": 3, "proposals": true } diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt index ad2dc8d7e10a..2d70ebb4d616 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/input.mjs] Replaced core-js entries with the following polyfills: esnext.aggregate-error {} esnext.array.last-index {} esnext.array.last-item {} @@ -129,4 +129,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json index b9db1e21e401..6782704424da 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-all-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome 71" diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt new file mode 100644 index 000000000000..b964de442cc5 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt @@ -0,0 +1,22 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "71" +} + +Using modules transform: auto + +Using plugins: + syntax-async-generators { "chrome":"71" } + syntax-object-rest-spread { "chrome":"71" } + syntax-json-strings { "chrome":"71" } + syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } + +Using polyfills with `entry` option: + +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs] Import of core-js was not found. + +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json new file mode 100644 index 000000000000..6782704424da --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt similarity index 60% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt index 26521e3ce411..e7986cb8ca44 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt @@ -17,7 +17,6 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Import of core-js was not found. +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs] Import of core-js was not found. -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json new file mode 100644 index 000000000000..6782704424da --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt similarity index 74% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt index 41a8bda0a4c0..9b068053e50e 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.object.from-entries { "chrome":"71" } esnext.reflect.define-metadata { "chrome":"71" } esnext.reflect.delete-metadata { "chrome":"71" } @@ -29,5 +29,4 @@ Using polyfills with `entry` option: esnext.reflect.has-own-metadata { "chrome":"71" } esnext.reflect.metadata { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json new file mode 100644 index 000000000000..5f13bdc6b92f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json @@ -0,0 +1,12 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt similarity index 94% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt index 34ce13f88405..237cf943f7c3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-entries/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/input.mjs] Replaced core-js entries with the following polyfills: es.symbol {} es.json.to-string-tag {} es.math.to-string-tag {} @@ -94,4 +94,3 @@ Using polyfills with `entry` option: esnext.reflect.has-metadata {} esnext.reflect.has-own-metadata {} esnext.reflect.metadata {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json index b5693669350b..8fc9e8f3d651 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt similarity index 99% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt index 799b42a28da5..343730b312a9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-specific-targets/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/stdout.txt @@ -47,7 +47,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.symbol.description { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.symbol.async-iterator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } @@ -251,4 +251,3 @@ Using polyfills with `entry` option: 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" } web.url-search-params { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json new file mode 100644 index 000000000000..6782704424da --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt similarity index 66% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt index f286aae03105..f205f4ee7e90 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt @@ -17,11 +17,10 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } es.object.from-entries { "chrome":"71" } web.immediate { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json index 381749958890..b135943fb521 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "samsung 8.2" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt similarity index 79% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt index e3b023fc70a1..521763cfccd9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable-samsung-8.2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt @@ -19,7 +19,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs] Replaced core-js entries with the following polyfills: es.symbol.description { "samsung":"8.2" } es.array.flat { "samsung":"8.2" } es.array.flat-map { "samsung":"8.2" } @@ -37,5 +37,4 @@ Using polyfills with `entry` option: web.queue-microtask { "samsung":"8.2" } web.url.to-json { "samsung":"8.2" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json new file mode 100644 index 000000000000..5f13bdc6b92f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json @@ -0,0 +1,12 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt similarity index 97% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt index 27caa7f6dffa..38e8356a3478 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stable/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/input.mjs] Replaced core-js entries with the following polyfills: es.symbol {} es.symbol.description {} es.symbol.async-iterator {} @@ -252,4 +252,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json new file mode 100644 index 000000000000..6782704424da --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt similarity index 92% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt index a561ed31a0c5..b6011886e4d9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: esnext.aggregate-error { "chrome":"71" } esnext.array.last-index { "chrome":"71" } esnext.array.last-item { "chrome":"71" } @@ -100,5 +100,4 @@ Using polyfills with `entry` option: esnext.weak-set.from { "chrome":"71" } esnext.weak-set.of { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json new file mode 100644 index 000000000000..5f13bdc6b92f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json @@ -0,0 +1,12 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt index ad2dc8d7e10a..5380e1c89aa6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-stage/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/input.mjs] Replaced core-js entries with the following polyfills: esnext.aggregate-error {} esnext.array.last-index {} esnext.array.last-item {} @@ -129,4 +129,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json similarity index 69% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json index 8eebdab425d8..b692cabae5fb 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json @@ -1,13 +1,15 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": 3, "debug": true, "targets": { "chrome": 54, "electron": 0.36, - "node": 6.10, + "node": 6.1, "ie": 10 } }] diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt index 37f523184009..ac4e78a5e55a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-decimals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/stdout.txt @@ -55,7 +55,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "electron":"0.36", "ie":"10" } es.symbol.description { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } es.symbol.async-iterator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } @@ -243,4 +243,3 @@ Using polyfills with `entry` option: web.url { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.url.to-json { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } web.url-search-params { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json index 41cfee645021..24e7ea83fdde 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": "3.0", "debug": true, diff --git a/packages/babel-preset-env/test/debug-fixtures/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 similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.0/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt index e609f7f5a6d4..3e1c3e4cb655 100644 --- a/packages/babel-preset-env/test/debug-fixtures/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 @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "ie":"10" } es.symbol.description { "chrome":"54", "ie":"10", "node":"6.10" } es.symbol.async-iterator { "chrome":"54", "ie":"10", "node":"6.10" } @@ -230,4 +230,3 @@ Using polyfills with `entry` option: web.url { "chrome":"54", "ie":"10", "node":"6.10" } web.url.to-json { "chrome":"54", "ie":"10", "node":"6.10" } web.url-search-params { "chrome":"54", "ie":"10", "node":"6.10" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json similarity index 76% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json index fd88d31055ef..d00724a723e3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": "3.1", "debug": true, diff --git a/packages/babel-preset-env/test/debug-fixtures/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 similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings-minor-3.1/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt index 2fd667e1edbe..39329f1c54b4 100644 --- a/packages/babel-preset-env/test/debug-fixtures/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 @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "ie":"10" } es.symbol.description { "chrome":"54", "ie":"10", "node":"6.10" } es.symbol.async-iterator { "chrome":"54", "ie":"10", "node":"6.10" } @@ -232,4 +232,3 @@ Using polyfills with `entry` option: web.url { "chrome":"54", "ie":"10", "node":"6.10" } web.url.to-json { "chrome":"54", "ie":"10", "node":"6.10" } web.url-search-params { "chrome":"54", "ie":"10", "node":"6.10" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json index 7cda7fb38c22..8372211f221f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "useBuiltIns": "entry", "corejs": 3, "debug": true, diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt index e609f7f5a6d4..be2c12299d4a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-versions-strings/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "ie":"10" } es.symbol.description { "chrome":"54", "ie":"10", "node":"6.10" } es.symbol.async-iterator { "chrome":"54", "ie":"10", "node":"6.10" } @@ -230,4 +230,3 @@ Using polyfills with `entry` option: web.url { "chrome":"54", "ie":"10", "node":"6.10" } web.url.to-json { "chrome":"54", "ie":"10", "node":"6.10" } web.url-search-params { "chrome":"54", "ie":"10", "node":"6.10" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json new file mode 100644 index 000000000000..6782704424da --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt similarity index 60% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt index 7915062dd76c..edbc01bf1056 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt @@ -17,8 +17,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfill: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/input.mjs] Replaced core-js entries with the following polyfill: web.immediate { "chrome":"71" } -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json new file mode 100644 index 000000000000..5f13bdc6b92f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json @@ -0,0 +1,12 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt similarity index 91% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt index 31e603812e9c..9dea1a0f8905 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-web/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/input.mjs] Replaced core-js entries with the following polyfills: web.dom-collections.for-each {} web.dom-collections.iterator {} web.immediate {} @@ -52,4 +52,3 @@ Using polyfills with `entry` option: web.url {} web.url.to-json {} web.url-search-params {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json index d4af133772ff..6f5c3415a1d6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome >= 54, ie 10", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt index 712a1e1dcbb1..892118c99f83 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced core-js entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/input.mjs] Replaced core-js entries with the following polyfills: es.symbol { "ie":"10" } es.symbol.description { "chrome":"54", "ie":"10", "node":"6" } es.symbol.async-iterator { "chrome":"54", "ie":"10", "node":"6" } @@ -232,4 +232,3 @@ Using polyfills with `entry` option: web.url { "chrome":"54", "ie":"10", "node":"6" } web.url.to-json { "chrome":"54", "ie":"10", "node":"6" } web.url-search-params { "chrome":"54", "ie":"10", "node":"6" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json similarity index 67% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json index c852ad03f690..41fb4e367afd 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "node": 6 diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt similarity index 85% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt index 8d7d5c3610d2..55a1471d55d2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt @@ -25,5 +25,4 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Import of @babel/polyfill was not found. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/input.js] Import of @babel/polyfill was not found. diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json similarity index 64% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json index 40884decf8fd..16d3f47c9797 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "shippedProposals": true, "useBuiltIns": "entry" diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-shippedProposals/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt index 68c0e41d5803..621161013483 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs2-proposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within {} es6.array.every {} es6.array.fill {} @@ -192,4 +192,3 @@ Using polyfills with `entry` option: web.timers {} web.immediate {} web.dom.iterable {} -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json similarity index 74% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json index 99859f1e9d1c..0d88dc7094a9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 55, diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt similarity index 93% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt index e7948062c039..c773b35d1314 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs-uglify/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stdout.txt @@ -47,7 +47,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es7.array.flat-map { "chrome":"55" } es6.array.sort { "chrome":"55" } es7.object.define-getter { "chrome":"55" } @@ -64,4 +64,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"55" } web.immediate { "chrome":"55" } web.dom.iterable { "chrome":"55" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/in/in.js b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json similarity index 73% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/options.json rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json index 8a1de9062d64..d7687f587a7f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "browsers": "chrome >= 54, ie 10", diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt similarity index 98% rename from packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt index fd68de0c44c6..b070fd82ae2c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-no-corejs/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stdout.txt @@ -44,7 +44,7 @@ Using plugins: Using polyfills with `entry` option: -[/src/in.js] Replaced @babel/polyfill entries with the following polyfills: +[/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/input.mjs] Replaced @babel/polyfill entries with the following polyfills: es6.array.copy-within { "ie":"10" } es6.array.fill { "ie":"10" } es6.array.find { "ie":"10" } @@ -173,4 +173,3 @@ Using polyfills with `entry` option: web.timers { "chrome":"54", "ie":"10", "node":"6" } web.immediate { "chrome":"54", "ie":"10", "node":"6" } web.dom.iterable { "chrome":"54", "ie":"10", "node":"6" } -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/plugins-only/in/in.js b/packages/babel-preset-env/test/fixtures/debug/plugins-only/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/plugins-only/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/plugins-only/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/plugins-only/options.json b/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json similarity index 78% rename from packages/babel-preset-env/test/debug-fixtures/plugins-only/options.json rename to packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json index ec9d6a4e722a..801639d976b0 100644 --- a/packages/babel-preset-env/test/debug-fixtures/plugins-only/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json @@ -1,12 +1,14 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "exclude": [ "transform-async-to-generator", "transform-regenerator", "transform-parameters" - ], + ], "targets": { "firefox": 52, "node": 7.4 diff --git a/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt similarity index 96% rename from packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt index 2fa404a6d446..58781f6b2ec1 100644 --- a/packages/babel-preset-env/test/debug-fixtures/plugins-only/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt @@ -31,4 +31,3 @@ Using plugins: proposal-dynamic-import { "firefox":"52", "node":"7.4" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. -Successfully compiled 1 file with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json index 087a0efc9f65..2c35aeec223c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt similarity index 88% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt index 430a23ee87e9..10a416642303 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/stdout.txt @@ -43,16 +43,10 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/input.js] Added following core-js polyfills: es6.object.to-string { "chrome":"52", "firefox":"50", "ie":"11" } es6.promise { "ie":"11" } es6.map { "firefox":"50", "ie":"11" } es6.string.iterator { "ie":"11" } es6.array.iterator { "ie":"11" } web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json index 087a0efc9f65..2c35aeec223c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, 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 new file mode 100644 index 000000000000..c6bd456f09c6 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/stdout.txt @@ -0,0 +1,49 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json similarity index 70% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json index b2ed793a3530..f4aa63a4cca2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 71 diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt similarity index 71% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt index f3e6f360ea96..19256d92e761 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt @@ -17,9 +17,5 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfill: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/input.js] Added following core-js polyfill: web.dom.iterable { "chrome":"71" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"71" } -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json similarity index 61% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json index 31c2a9c77a6f..f4aa63a4cca2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json @@ -1,12 +1,14 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 71 }, "useBuiltIns": "usage", - "corejs": 3 + "corejs": 2 }] ] } diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt similarity index 71% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt index f3e6f360ea96..c03ef9bbeaf2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt @@ -17,9 +17,5 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfill: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/input.js] Added following core-js polyfill: web.dom.iterable { "chrome":"71" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"71" } -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json new file mode 100644 index 000000000000..2c35aeec223c --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt similarity index 89% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt index 5f82e7187c64..83701579d0ee 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/stdout.txt @@ -43,7 +43,4 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. - -[/src/in2.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 2 files with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json new file mode 100644 index 000000000000..2c35aeec223c --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt similarity index 89% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt index 5f82e7187c64..d0cc380462d3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/stdout.txt @@ -43,7 +43,4 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. - -[/src/in2.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 2 files with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json similarity index 78% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json index 04beb327c6ab..6c606d27d701 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt similarity index 88% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt index 430a23ee87e9..f7f567c4c47a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/stdout.txt @@ -43,16 +43,10 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/input.js] Added following core-js polyfills: es6.object.to-string { "chrome":"52", "firefox":"50", "ie":"11" } es6.promise { "ie":"11" } es6.map { "firefox":"50", "ie":"11" } es6.string.iterator { "ie":"11" } es6.array.iterator { "ie":"11" } web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json new file mode 100644 index 000000000000..6c606d27d701 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + }] + ] +} 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 new file mode 100644 index 000000000000..8f4c5e1df667 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/stdout.txt @@ -0,0 +1,49 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json similarity index 74% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json index b2110d7ec87a..7b5c421a7a0d 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 71 diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt similarity index 66% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt index e6cf48c68031..aabc7e867e83 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt @@ -17,7 +17,5 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. - -[/src/in2.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 2 files with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"71" } diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json new file mode 100644 index 000000000000..7b5c421a7a0d --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json @@ -0,0 +1,14 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + }] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt new file mode 100644 index 000000000000..9154f4f3ace6 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt @@ -0,0 +1,21 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "71" +} + +Using modules transform: auto + +Using plugins: + syntax-async-generators { "chrome":"71" } + syntax-object-rest-spread { "chrome":"71" } + syntax-json-strings { "chrome":"71" } + syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"71" } diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json similarity index 78% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json index 448b3d6f1e8e..fe52508cd3b7 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt similarity index 88% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt index 430a23ee87e9..f456fc31c325 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/stdout.txt @@ -43,16 +43,10 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/input.js] Added following core-js polyfills: es6.object.to-string { "chrome":"52", "firefox":"50", "ie":"11" } es6.promise { "ie":"11" } es6.map { "firefox":"50", "ie":"11" } es6.string.iterator { "ie":"11" } es6.array.iterator { "ie":"11" } web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json new file mode 100644 index 000000000000..fe52508cd3b7 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json @@ -0,0 +1,17 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 2 + }] + ] +} 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 new file mode 100644 index 000000000000..14c735dcba8c --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/stdout.txt @@ -0,0 +1,49 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json similarity index 70% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json index ab34fa8b5159..4c4d8b0fcd4c 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 55 diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt similarity index 79% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt index 8682c140a4c0..c5f336bc2da2 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt @@ -20,5 +20,4 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/input.mjs] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json index 6c2922e8970d..45070b4e0e3f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt similarity index 84% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt index 170f5231957f..ce78b1615fa3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/input.js] Added following core-js polyfills: es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } es.map { "firefox":"50", "ie":"11" } es.object.to-string { "firefox":"50", "ie":"11" } @@ -51,11 +51,3 @@ Using polyfills with `usage` option: es.string.iterator { "ie":"11" } web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } web.queue-microtask { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfills: - es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - es.string.iterator { "ie":"11" } - web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-chrome-71/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json index 6c2922e8970d..45070b4e0e3f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, 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 new file mode 100644 index 000000000000..4545ec9ddac5 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/input.js] Added following core-js polyfills: + es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + es.string.iterator { "ie":"11" } + web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json new file mode 100644 index 000000000000..6500390af0ba --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json @@ -0,0 +1,14 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt similarity index 65% rename from packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt index 26521e3ce411..7e9cc063c496 100644 --- a/packages/babel-preset-env/test/debug-fixtures/entry-corejs3-runtime-only/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt @@ -15,9 +15,6 @@ Using plugins: transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } -Using polyfills with `entry` option: +Using polyfills with `usage` option: -[/src/in.js] Import of core-js was not found. - -[/src/in.js] Based on your targets, regenerator-runtime import excluded. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json new file mode 100644 index 000000000000..6500390af0ba --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json @@ -0,0 +1,14 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt new file mode 100644 index 000000000000..9aaf62342062 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt @@ -0,0 +1,20 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "71" +} + +Using modules transform: auto + +Using plugins: + syntax-async-generators { "chrome":"71" } + syntax-object-rest-spread { "chrome":"71" } + syntax-json-strings { "chrome":"71" } + syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json new file mode 100644 index 000000000000..45070b4e0e3f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt similarity index 89% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt index 5f82e7187c64..5effbeed1198 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-none/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/stdout.txt @@ -43,7 +43,4 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. - -[/src/in2.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 2 files with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-none/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json new file mode 100644 index 000000000000..45070b4e0e3f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + }] + ] +} 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 new file mode 100644 index 000000000000..999084137006 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/stdout.txt @@ -0,0 +1,46 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json similarity index 78% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json index 437b707652d3..5068dd30cfe3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt similarity index 89% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt index 201d4da1235c..4f5e93bc1d2a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/input.js] Added following core-js polyfills: es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } es.map { "firefox":"50", "ie":"11" } es.object.to-string { "firefox":"50", "ie":"11" } @@ -67,11 +67,3 @@ Using polyfills with `usage` option: esnext.symbol.observable { "chrome":"52", "firefox":"50", "ie":"11" } web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } web.queue-microtask { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfills: - es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - es.string.iterator { "ie":"11" } - web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json new file mode 100644 index 000000000000..5068dd30cfe3 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + }] + ] +} 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 new file mode 100644 index 000000000000..c7b2d3da53a4 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/input.js] Added following core-js polyfills: + es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + es.string.iterator { "ie":"11" } + web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json similarity index 74% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json index 24bc77a0d5e0..fd394abdc7c6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 71 diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt similarity index 84% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt index c1e4baec7483..6000e5d705cd 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt @@ -17,7 +17,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/input.js] Added following core-js polyfills: esnext.map.delete-all { "chrome":"71" } esnext.map.every { "chrome":"71" } esnext.map.filter { "chrome":"71" } @@ -33,6 +33,3 @@ Using polyfills with `usage` option: esnext.map.update { "chrome":"71" } esnext.observable { "chrome":"71" } esnext.symbol.observable { "chrome":"71" } - -[/src/in2.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json new file mode 100644 index 000000000000..fd394abdc7c6 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json @@ -0,0 +1,14 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + }] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt new file mode 100644 index 000000000000..c12a9314e829 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt @@ -0,0 +1,20 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "71" +} + +Using modules transform: auto + +Using plugins: + syntax-async-generators { "chrome":"71" } + syntax-object-rest-spread { "chrome":"71" } + syntax-json-strings { "chrome":"71" } + syntax-optional-catch-binding { "chrome":"71" } + transform-modules-commonjs { "chrome":"71" } + proposal-dynamic-import { "chrome":"71" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json similarity index 78% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json index 0c80d936a7fb..b73965bf5e2f 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt similarity index 85% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt index dcf94e17e1d4..3186c00e2458 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/input.js] Added following core-js polyfills: es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } es.map { "firefox":"50", "ie":"11" } es.object.to-string { "firefox":"50", "ie":"11" } @@ -52,11 +52,3 @@ Using polyfills with `usage` option: web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } web.queue-microtask { "chrome":"52", "firefox":"50", "ie":"11" } esnext.global-this { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfills: - es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - es.string.iterator { "ie":"11" } - web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json new file mode 100644 index 000000000000..b73965bf5e2f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json @@ -0,0 +1,17 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 3 + }] + ] +} 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 new file mode 100644 index 000000000000..ed270ec46b29 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/input.js] Added following core-js polyfills: + es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + es.string.iterator { "ie":"11" } + web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json index b0adb5c0910f..fc2f3d3fd375 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt similarity index 84% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt index 170f5231957f..1fcbf70cef28 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/input.js] Added following core-js polyfills: es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } es.map { "firefox":"50", "ie":"11" } es.object.to-string { "firefox":"50", "ie":"11" } @@ -51,11 +51,3 @@ Using polyfills with `usage` option: es.string.iterator { "ie":"11" } web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } web.queue-microtask { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfills: - es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - es.string.iterator { "ie":"11" } - web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json new file mode 100644 index 000000000000..fc2f3d3fd375 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.0" + }] + ] +} 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 new file mode 100644 index 000000000000..1b7bf00896fb --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/input.js] Added following core-js polyfills: + es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + es.string.iterator { "ie":"11" } + web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json similarity index 75% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json index c2e64be32390..9da4542cd86a 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt similarity index 84% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt index 170f5231957f..7df78cdbe879 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-versions-strings-minor-3.0/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/stdout.txt @@ -43,7 +43,7 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/input.js] Added following core-js polyfills: es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } es.map { "firefox":"50", "ie":"11" } es.object.to-string { "firefox":"50", "ie":"11" } @@ -51,11 +51,3 @@ Using polyfills with `usage` option: es.string.iterator { "ie":"11" } web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } web.queue-microtask { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfills: - es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - es.string.iterator { "ie":"11" } - web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json new file mode 100644 index 000000000000..9da4542cd86a --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json @@ -0,0 +1,16 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.1" + }] + ] +} 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 new file mode 100644 index 000000000000..2dba4464ffa8 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/input.js] Added following core-js polyfills: + es.array.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + es.string.iterator { "ie":"11" } + web.dom-collections.iterator { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/input.mjs similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/input.mjs diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json similarity index 70% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json index 66118c78ad68..0b979140c068 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 55 diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs3-with-import/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt similarity index 79% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt index 8682c140a4c0..b6e9e3ab1f49 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-with-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt @@ -20,5 +20,4 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Based on your code and targets, core-js polyfills were not added. -Successfully compiled 1 file with Babel. \ No newline at end of file +[/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/input.mjs] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json new file mode 100644 index 000000000000..9f7218d01009 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt similarity index 88% rename from packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt index 430a23ee87e9..211854dc7a12 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-corejs2-proposals/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stdout.txt @@ -43,16 +43,10 @@ Using plugins: Using polyfills with `usage` option: -[/src/in.js] Added following core-js polyfills: +[/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/input.js] Added following core-js polyfills: es6.object.to-string { "chrome":"52", "firefox":"50", "ie":"11" } es6.promise { "ie":"11" } es6.map { "firefox":"50", "ie":"11" } es6.string.iterator { "ie":"11" } es6.array.iterator { "ie":"11" } web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Added following core-js polyfill: - web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } - -[/src/in2.js] Based on your code and targets, added regenerator-runtime. -Successfully compiled 2 files with Babel. \ No newline at end of file diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/input.js diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json new file mode 100644 index 000000000000..9f7218d01009 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + ["env", { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + }] + ] +} diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/stderr.txt rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt 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 new file mode 100644 index 000000000000..90c9d87ef822 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stdout.txt @@ -0,0 +1,49 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/input.js] Added following core-js polyfill: + web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } + +[/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/input.js] Based on your code and targets, added regenerator-runtime. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/in/in.js b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/in/in.js rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json similarity index 73% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json index f1f5db8b10f6..d590e4deffa5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt new file mode 100644 index 000000000000..dbee5e8f3eb3 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt @@ -0,0 +1,6 @@ +WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. + +You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: + + npm install --save core-js@2 npm install --save core-js@3 + yarn add core-js@2 yarn add core-js@3 \ No newline at end of file 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 new file mode 100644 index 000000000000..6afbb5cd98f5 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stdout.txt @@ -0,0 +1,46 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/input.js] Based on your code and targets, core-js polyfills were not added. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/in/in2.js b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/input.js similarity index 100% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs-none/in/in2.js rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/input.js diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json similarity index 73% rename from packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/options.json rename to packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json index f1f5db8b10f6..d590e4deffa5 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-no-corejs/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json @@ -1,6 +1,8 @@ { + "validateLogs": true, + "ignoreOutput": true, "presets": [ - ["../../lib", { + ["env", { "debug": true, "targets": { "chrome": 52, diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt new file mode 100644 index 000000000000..dbee5e8f3eb3 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt @@ -0,0 +1,6 @@ +WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. + +You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: + + npm install --save core-js@2 npm install --save core-js@3 + yarn add core-js@2 yarn add core-js@3 \ No newline at end of file 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 new file mode 100644 index 000000000000..5d3445c8f14f --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stdout.txt @@ -0,0 +1,46 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "chrome": "52", + "firefox": "50", + "ie": "11" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11" } + transform-literals { "firefox":"50", "ie":"11" } + transform-function-name { "firefox":"50", "ie":"11" } + transform-arrow-functions { "ie":"11" } + transform-classes { "ie":"11" } + transform-object-super { "ie":"11" } + transform-shorthand-properties { "ie":"11" } + transform-duplicate-keys { "ie":"11" } + transform-computed-properties { "ie":"11" } + transform-for-of { "firefox":"50", "ie":"11" } + transform-sticky-regex { "ie":"11" } + transform-dotall-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-unicode-regex { "ie":"11" } + transform-spread { "ie":"11" } + transform-parameters { "firefox":"50", "ie":"11" } + transform-destructuring { "firefox":"50", "ie":"11" } + transform-block-scoping { "firefox":"50", "ie":"11" } + transform-typeof-symbol { "ie":"11" } + 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" } + proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } + +Using polyfills with `usage` option: + +[/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/input.js] Based on your code and targets, core-js polyfills were not added. From b02e35c19a23d5092591a818551f5beaf4dd8d5a Mon Sep 17 00:00:00 2001 From: Vivek Nayyar Date: Fri, 6 Sep 2019 22:35:44 +0700 Subject: [PATCH 042/965] Fix parenthesis for nullish coalescing (#10269) * :recycle: added condition to check for left and right of nullish coalescing operator and if any is a logical expression without a paren then throw an error * :bug: bugs fixed and test cases updated for babel parser * :recycle: code comments added * :bug: spell error rectified * :recycle: failing test updated * :bug: push tests after make build * Skip nullish-coalescing flow precedence tests They're now incorrect * :recycle: error message updated, binop priority of other logical operators +1 from ?? and * :recycle: increaed the binOp for in and instanceOf, added logic to print the brackets in an ?? && || expression, test cases added * :bug: failing test fixed and comments updated * :recycle: new lines added between tests * :recycle: basic tests for checking the binOp of instanceOf, in and relational operators to be equal added * :recycle: new lines added in between tests --- packages/babel-generator/src/node/index.js | 13 +++ .../fixtures/types/LogicalExpression/input.js | 3 +- .../types/LogicalExpression/options.json | 3 + .../types/LogicalExpression/output.js | 4 +- packages/babel-generator/test/index.js | 25 ++++++ .../babel-parser/src/parser/expression.js | 33 +++++++ packages/babel-parser/src/tokenizer/types.js | 30 +++---- .../core/opts/tokens-true/output.json | 2 +- .../and-nullish/input.js | 2 +- .../and-nullish/output.json | 52 +++++------ .../no-paren-and-nullish/input.js | 1 + .../no-paren-and-nullish/options.json | 7 ++ .../no-paren-nullish-and/input.js | 1 + .../no-paren-nullish-and/options.json | 6 ++ .../no-paren-nullish-or/input.js | 1 + .../no-paren-nullish-or/options.json | 6 ++ .../no-paren-or-nullish/input.js | 1 + .../no-paren-or-nullish/options.json | 7 ++ .../nullish-and/input.js | 2 +- .../nullish-and/output.json | 44 +++++----- .../nullish-or/input.js | 2 +- .../nullish-or/output.json | 86 ++++++++++--------- .../or-nullish/input.js | 2 +- .../or-nullish/output.json | 52 +++++------ .../babel-parser/test/unit/tokenizer/types.js | 15 ++++ scripts/tests/flow/flow_tests_whitelist.txt | 2 + 26 files changed, 271 insertions(+), 131 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/types/LogicalExpression/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json create mode 100644 packages/babel-parser/test/unit/tokenizer/types.js diff --git a/packages/babel-generator/src/node/index.js b/packages/babel-generator/src/node/index.js index 394e63b5cbdd..faf700dc681b 100644 --- a/packages/babel-generator/src/node/index.js +++ b/packages/babel-generator/src/node/index.js @@ -97,5 +97,18 @@ export function needsParens(node, parent, printStack) { if (isOrHasCallExpression(node)) return true; } + /* this check is for NullishCoalescing being used with LogicalOperators like && and || + * For example when someone creates an ast programmaticaly like this + * t.logicalExpression( + * "??", + * t.logicalExpression("||", t.identifier("a"), t.identifier("b")), + * t.identifier("c"), + * ); + * In the example above the AST is equivalent to writing a || b ?? c + * This is incorrect because NullishCoalescing when used with LogicalExpressions should have parenthesis + * The correct syntax is (a || b) ?? c, that is why we need parenthesis in this case + */ + if (t.isLogicalExpression(node) && parent.operator === "??") return true; + return find(expandedParens, node, parent, printStack); } diff --git a/packages/babel-generator/test/fixtures/types/LogicalExpression/input.js b/packages/babel-generator/test/fixtures/types/LogicalExpression/input.js index 08cae4f71732..3ff8c4d4040e 100644 --- a/packages/babel-generator/test/fixtures/types/LogicalExpression/input.js +++ b/packages/babel-generator/test/fixtures/types/LogicalExpression/input.js @@ -1,4 +1,5 @@ foo ||bar; (x => x)|| bar; (function a(x){return x;})|| 2; -0||(function(){return alpha;}); \ No newline at end of file +0||(function(){return alpha;}); +a ?? (b || c); diff --git a/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json b/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json new file mode 100644 index 000000000000..1bb4736991a4 --- /dev/null +++ b/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["nullishCoalescingOperator"] +} diff --git a/packages/babel-generator/test/fixtures/types/LogicalExpression/output.js b/packages/babel-generator/test/fixtures/types/LogicalExpression/output.js index a27aa9ac1833..994dc9ec1b59 100644 --- a/packages/babel-generator/test/fixtures/types/LogicalExpression/output.js +++ b/packages/babel-generator/test/fixtures/types/LogicalExpression/output.js @@ -7,4 +7,6 @@ foo || bar; 0 || function () { return alpha; -}; \ No newline at end of file +}; + +a ?? (b || c); diff --git a/packages/babel-generator/test/index.js b/packages/babel-generator/test/index.js index 80bee85f9eaf..826610d2b85d 100644 --- a/packages/babel-generator/test/index.js +++ b/packages/babel-generator/test/index.js @@ -298,6 +298,31 @@ describe("generation", function() { }); describe("programmatic generation", function() { + it("should add parenthesis when NullishCoalescing is used along with ||", function() { + // https://github.com/babel/babel/issues/10260 + const nullishCoalesc = t.logicalExpression( + "??", + t.logicalExpression("||", t.identifier("a"), t.identifier("b")), + t.identifier("c"), + ); + const output = generate(nullishCoalesc).code; + expect(output).toBe(`(a || b) ?? c`); + }); + + it("should add parenthesis when NullishCoalesing is used with &&", function() { + const nullishCoalesc = t.logicalExpression( + "??", + t.identifier("a"), + t.logicalExpression( + "&&", + t.identifier("b"), + t.logicalExpression("&&", t.identifier("c"), t.identifier("d")), + ), + ); + const output = generate(nullishCoalesc).code; + expect(output).toBe(`a ?? (b && c && d)`); + }); + it("numeric member expression", function() { // Should not generate `0.foo` const mem = t.memberExpression( diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index ae60b1746ba7..05580e017a32 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -380,6 +380,39 @@ export default class ExpressionParser extends LValParser { node.right = this.parseExprOpRightExpr(op, prec, noIn); + /* this check is for all ?? operators + * a ?? b && c for this example + * b && c => This is considered as a logical expression in the ast tree + * a => Identifier + * so for ?? operator we need to check in this case the right expression to have parenthesis + * second case a && b ?? c + * here a && b => This is considered as a logical expression in the ast tree + * c => identifer + * so now here for ?? operator we need to check the left expression to have parenthesis + * if the parenthesis is missing we raise an error and throw it + */ + if (op === tt.nullishCoalescing) { + if ( + left.type === "LogicalExpression" && + left.operator !== "??" && + !(left.extra && left.extra.parenthesized) + ) { + throw this.raise( + left.start, + `Nullish coalescing operator(??) requires parens when mixing with logical operators`, + ); + } else if ( + node.right.type === "LogicalExpression" && + node.right.operator !== "??" && + !(node.right.extra && node.right.extra.parenthesized) + ) { + throw this.raise( + node.right.start, + `Nullish coalescing operator(??) requires parens when mixing with logical operators`, + ); + } + } + this.finishNode( node, op === tt.logicalOR || diff --git a/packages/babel-parser/src/tokenizer/types.js b/packages/babel-parser/src/tokenizer/types.js index 34fd891c9256..47b4ced9f14e 100644 --- a/packages/babel-parser/src/tokenizer/types.js +++ b/packages/babel-parser/src/tokenizer/types.js @@ -139,21 +139,21 @@ export const types: { [name: string]: TokenType } = { tilde: new TokenType("~", { beforeExpr, prefix, startsExpr }), pipeline: createBinop("|>", 0), nullishCoalescing: createBinop("??", 1), - logicalOR: createBinop("||", 1), - logicalAND: createBinop("&&", 2), - bitwiseOR: createBinop("|", 3), - bitwiseXOR: createBinop("^", 4), - bitwiseAND: createBinop("&", 5), - equality: createBinop("==/!=/===/!==", 6), - relational: createBinop("/<=/>=", 7), - bitShift: createBinop("<>/>>>", 8), - plusMin: new TokenType("+/-", { beforeExpr, binop: 9, prefix, startsExpr }), - modulo: createBinop("%", 10), - star: createBinop("*", 10), - slash: createBinop("/", 10), + logicalOR: createBinop("||", 2), + logicalAND: createBinop("&&", 3), + bitwiseOR: createBinop("|", 4), + bitwiseXOR: createBinop("^", 5), + bitwiseAND: createBinop("&", 6), + equality: createBinop("==/!=/===/!==", 7), + relational: createBinop("/<=/>=", 8), + bitShift: createBinop("<>/>>>", 9), + plusMin: new TokenType("+/-", { beforeExpr, binop: 10, prefix, startsExpr }), + modulo: createBinop("%", 11), + star: createBinop("*", 11), + slash: createBinop("/", 11), exponent: new TokenType("**", { beforeExpr, - binop: 11, + binop: 12, rightAssociative: true, }), @@ -188,8 +188,8 @@ export const types: { [name: string]: TokenType } = { _null: createKeyword("null", { startsExpr }), _true: createKeyword("true", { startsExpr }), _false: createKeyword("false", { startsExpr }), - _in: createKeyword("in", { beforeExpr, binop: 7 }), - _instanceof: createKeyword("instanceof", { beforeExpr, binop: 7 }), + _in: createKeyword("in", { beforeExpr, binop: 8 }), + _instanceof: createKeyword("instanceof", { beforeExpr, binop: 8 }), _typeof: createKeyword("typeof", { beforeExpr, prefix, startsExpr }), _void: createKeyword("void", { beforeExpr, prefix, startsExpr }), _delete: createKeyword("delete", { beforeExpr, prefix, startsExpr }), diff --git a/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json b/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json index 47117344de0f..a21bf5e27309 100644 --- a/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json @@ -457,7 +457,7 @@ "isAssign": false, "prefix": true, "postfix": false, - "binop": 9, + "binop": 10, "updateContext": null }, "value": "+", diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js index 2b0c8c8ff80a..4080eadc3962 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js @@ -1 +1 @@ -a && b ?? c; +(a && b) ?? c; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json index 779d2ccfbcc8..31a372d44df5 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "program": { "type": "Program", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "expression": { "type": "LogicalExpression", "start": 0, - "end": 11, + "end": 13, "loc": { "start": { "line": 1, @@ -54,35 +54,35 @@ }, "end": { "line": 1, - "column": 11 + "column": 13 } }, "left": { "type": "LogicalExpression", - "start": 0, - "end": 6, + "start": 1, + "end": 7, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 6 + "column": 7 } }, "left": { "type": "Identifier", - "start": 0, - "end": 1, + "start": 1, + "end": 2, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 1 + "column": 2 }, "identifierName": "a" }, @@ -91,35 +91,39 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 5, - "end": 6, + "start": 6, + "end": 7, "loc": { "start": { "line": 1, - "column": 5 + "column": 6 }, "end": { "line": 1, - "column": 6 + "column": 7 }, "identifierName": "b" }, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "operator": "??", "right": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 12, + "end": 13, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, - "column": 11 + "column": 13 }, "identifierName": "c" }, diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js new file mode 100644 index 000000000000..650d93b39a30 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js @@ -0,0 +1 @@ +c && d ?? e; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json new file mode 100644 index 000000000000..b79520d826a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "nullishCoalescingOperator", + "estree" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js new file mode 100644 index 000000000000..b8805af4953d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js @@ -0,0 +1 @@ +a ?? b && c; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json new file mode 100644 index 000000000000..e95e6eb0b428 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "nullishCoalescingOperator" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:5)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js new file mode 100644 index 000000000000..1fd223be11f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js @@ -0,0 +1 @@ +e ?? f ?? g || h; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json new file mode 100644 index 000000000000..dc240a52b3ad --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "nullishCoalescingOperator" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:10)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js new file mode 100644 index 000000000000..5647ff20498f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js @@ -0,0 +1 @@ +h || i ?? j; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json new file mode 100644 index 000000000000..b79520d826a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "nullishCoalescingOperator", + "estree" + ], + "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js index b8805af4953d..886259bfb68d 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js @@ -1 +1 @@ -a ?? b && c; +a ?? (b && c); diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json index 2e4c3bf5553f..b01e3ccaf935 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "program": { "type": "Program", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "expression": { "type": "LogicalExpression", "start": 0, - "end": 11, + "end": 13, "loc": { "start": { "line": 1, @@ -54,7 +54,7 @@ }, "end": { "line": 1, - "column": 11 + "column": 13 } }, "left": { @@ -77,30 +77,30 @@ "operator": "??", "right": { "type": "LogicalExpression", - "start": 5, - "end": 11, + "start": 6, + "end": 12, "loc": { "start": { "line": 1, - "column": 5 + "column": 6 }, "end": { "line": 1, - "column": 11 + "column": 12 } }, "left": { "type": "Identifier", - "start": 5, - "end": 6, + "start": 6, + "end": 7, "loc": { "start": { "line": 1, - "column": 5 + "column": 6 }, "end": { "line": 1, - "column": 6 + "column": 7 }, "identifierName": "b" }, @@ -109,20 +109,24 @@ "operator": "&&", "right": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 11, + "end": 12, "loc": { "start": { "line": 1, - "column": 10 + "column": 11 }, "end": { "line": 1, - "column": 11 + "column": 12 }, "identifierName": "c" }, "name": "c" + }, + "extra": { + "parenthesized": true, + "parenStart": 5 } } } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js index 40ec9c39d17f..12162ba162d9 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js @@ -1 +1 @@ -a ?? b || c; +a ?? (b || c); diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json index 5ab0fcc1a530..6947e6097892 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "program": { "type": "Program", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "expression": { "type": "LogicalExpression", "start": 0, - "end": 11, + "end": 13, "loc": { "start": { "line": 1, @@ -54,76 +54,80 @@ }, "end": { "line": 1, - "column": 11 + "column": 13 } }, "left": { - "type": "LogicalExpression", + "type": "Identifier", "start": 0, - "end": 6, + "end": 1, "loc": { "start": { "line": 1, "column": 0 }, "end": { + "line": 1, + "column": 1 + }, + "identifierName": "a" + }, + "name": "a" + }, + "operator": "??", + "right": { + "type": "LogicalExpression", + "start": 6, + "end": 12, + "loc": { + "start": { "line": 1, "column": 6 + }, + "end": { + "line": 1, + "column": 12 } }, "left": { "type": "Identifier", - "start": 0, - "end": 1, + "start": 6, + "end": 7, "loc": { "start": { "line": 1, - "column": 0 + "column": 6 }, "end": { "line": 1, - "column": 1 + "column": 7 }, - "identifierName": "a" + "identifierName": "b" }, - "name": "a" + "name": "b" }, - "operator": "??", + "operator": "||", "right": { "type": "Identifier", - "start": 5, - "end": 6, + "start": 11, + "end": 12, "loc": { "start": { "line": 1, - "column": 5 + "column": 11 }, "end": { "line": 1, - "column": 6 + "column": 12 }, - "identifierName": "b" + "identifierName": "c" }, - "name": "b" - } - }, - "operator": "||", - "right": { - "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "c" + "name": "c" }, - "name": "c" + "extra": { + "parenthesized": true, + "parenStart": 5 + } } } } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js index b74eae4c99e2..a8204525df1a 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js @@ -1 +1 @@ -a || b ?? c; +(a || b) ?? c; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json index 0db4055d3a89..f2e2798e4046 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -9,13 +9,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "program": { "type": "Program", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -23,7 +23,7 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "sourceType": "script", @@ -32,7 +32,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 12, + "end": 14, "loc": { "start": { "line": 1, @@ -40,13 +40,13 @@ }, "end": { "line": 1, - "column": 12 + "column": 14 } }, "expression": { "type": "LogicalExpression", "start": 0, - "end": 11, + "end": 13, "loc": { "start": { "line": 1, @@ -54,35 +54,35 @@ }, "end": { "line": 1, - "column": 11 + "column": 13 } }, "left": { "type": "LogicalExpression", - "start": 0, - "end": 6, + "start": 1, + "end": 7, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 6 + "column": 7 } }, "left": { "type": "Identifier", - "start": 0, - "end": 1, + "start": 1, + "end": 2, "loc": { "start": { "line": 1, - "column": 0 + "column": 1 }, "end": { "line": 1, - "column": 1 + "column": 2 }, "identifierName": "a" }, @@ -91,35 +91,39 @@ "operator": "||", "right": { "type": "Identifier", - "start": 5, - "end": 6, + "start": 6, + "end": 7, "loc": { "start": { "line": 1, - "column": 5 + "column": 6 }, "end": { "line": 1, - "column": 6 + "column": 7 }, "identifierName": "b" }, "name": "b" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 } }, "operator": "??", "right": { "type": "Identifier", - "start": 10, - "end": 11, + "start": 12, + "end": 13, "loc": { "start": { "line": 1, - "column": 10 + "column": 12 }, "end": { "line": 1, - "column": 11 + "column": 13 }, "identifierName": "c" }, diff --git a/packages/babel-parser/test/unit/tokenizer/types.js b/packages/babel-parser/test/unit/tokenizer/types.js new file mode 100644 index 000000000000..64a69051963b --- /dev/null +++ b/packages/babel-parser/test/unit/tokenizer/types.js @@ -0,0 +1,15 @@ +import { types } from "../../../src/tokenizer/types"; + +describe("token types", () => { + it("should check if the binOp for relational === in", () => { + expect(types.relational.binop).toEqual(types._in.binop); + }); + + it("should check if the binOp for relational === instanceOf", () => { + expect(types.relational.binop).toEqual(types._instanceof.binop); + }); + + it("should check if the binOp for in === instanceOf", () => { + expect(types._in.binop).toEqual(types._instanceof.binop); + }); +}); diff --git a/scripts/tests/flow/flow_tests_whitelist.txt b/scripts/tests/flow/flow_tests_whitelist.txt index 7549e6a49ae1..43f45ad565ad 100644 --- a/scripts/tests/flow/flow_tests_whitelist.txt +++ b/scripts/tests/flow/flow_tests_whitelist.txt @@ -29,3 +29,5 @@ class_method_kinds/polymorphic_getter.js ES6/modules/migrated_0020.js export_import_reserved_words/migrated_0003.js export_statements/export_trailing_comma.js +nullish_coalescing/precedence_and.js +nullish_coalescing/precedence_or.js From da0af5fd99a9b747370a2240df3abf2940b9649c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 6 Sep 2019 11:43:19 -0400 Subject: [PATCH 043/965] V8intrinsic syntax plugin (#10148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: v8intrinsic syntax plugin Implement V8 Intrinsic Syntax Extension. Here we check the execution branch inside the parseSubscript to make sure the V8IntrinsicIdentifier is immediately followed by a call expression. * feat: disable combining placeholders and v8intrisic per https://github.com/babel/babel/issues/10104#issuecomment-506950969 * test: add more error cases * refactor: parse v8 intrinsic in parseExprAtom This approach is identical to V8’s implementation. Move the test cases as the behaviour changes. * fix: plugin-name typo * test: add yield-expression test case * feat: require startsExpr on modulo for v8intrinsic * perf: skip eof and braceR check as they must return false * Print V8IntrinsicIdentifier * feat: add v8intrinsic to parser typings * Add generated type helpers * fix: incorrect type definition * fix: allow V8IntrinsicIdentifier to be callee --- .../src/generators/expressions.js | 5 + .../misc/V8IntrinsicIdentifier/input.js | 1 + .../misc/V8IntrinsicIdentifier/options.json | 3 + .../misc/V8IntrinsicIdentifier/output.js | 1 + .../babel-parser/src/parser/expression.js | 2 +- packages/babel-parser/src/plugin-utils.js | 6 + .../babel-parser/src/plugins/v8intrinsic.js | 32 +++ packages/babel-parser/src/tokenizer/types.js | 3 +- .../_errors/in-bind-expression/input.js | 1 + .../_errors/in-bind-expression/options.json | 6 + .../_errors/in-member-expression/input.js | 1 + .../_errors/in-member-expression/options.json | 6 + .../v8intrinsic/_errors/no-plugin/input.js | 1 + .../_errors/no-plugin/options.json | 4 + .../_errors/not-in-call-expression/input.js | 2 + .../not-in-call-expression/options.json | 4 + .../_errors/optional-call-expression/input.js | 1 + .../optional-call-expression/options.json | 7 + .../expression/await-expression/input.js | 1 + .../expression/await-expression/output.json | 191 +++++++++++++++++ .../expression/call-expression/input.js | 1 + .../expression/call-expression/output.json | 101 +++++++++ .../expression/in-new-expression/input.js | 1 + .../expression/in-new-expression/output.json | 99 +++++++++ .../expression/multiple-arguments/input.js | 1 + .../expression/multiple-arguments/output.json | 124 +++++++++++ .../expression/yield-expression/input.js | 3 + .../expression/yield-expression/output.json | 193 ++++++++++++++++++ .../fixtures/v8intrinsic/modulo/01/input.js | 1 + .../v8intrinsic/modulo/01/output.json | 116 +++++++++++ .../test/fixtures/v8intrinsic/options.json | 3 + .../babel-parser/typings/babel-parser.d.ts | 1 + .../scripts/utils/formatBuilderName.js | 3 +- .../src/asserts/generated/index.js | 6 + .../src/builders/generated/index.js | 4 + packages/babel-types/src/definitions/core.js | 2 +- packages/babel-types/src/definitions/misc.js | 15 +- .../src/validators/generated/index.js | 14 ++ 38 files changed, 961 insertions(+), 5 deletions(-) create mode 100644 packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/input.js create mode 100644 packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/options.json create mode 100644 packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/output.js create mode 100644 packages/babel-parser/src/plugins/v8intrinsic.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/options.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/input.js create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json create mode 100644 packages/babel-parser/test/fixtures/v8intrinsic/options.json diff --git a/packages/babel-generator/src/generators/expressions.js b/packages/babel-generator/src/generators/expressions.js index 4f9a525bd05e..62c3aca83bc0 100644 --- a/packages/babel-generator/src/generators/expressions.js +++ b/packages/babel-generator/src/generators/expressions.js @@ -264,3 +264,8 @@ export function PrivateName(node: Object) { this.token("#"); this.print(node.id, node); } + +export function V8IntrinsicIdentifier(node: Object) { + this.token("%"); + this.word(node.name); +} diff --git a/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/input.js b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/input.js new file mode 100644 index 000000000000..613a26cd98c7 --- /dev/null +++ b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/input.js @@ -0,0 +1 @@ +%DebugPrint(foo); diff --git a/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/options.json b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/options.json new file mode 100644 index 000000000000..609458c2c65e --- /dev/null +++ b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["v8intrinsic"] +} diff --git a/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/output.js b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/output.js new file mode 100644 index 000000000000..613a26cd98c7 --- /dev/null +++ b/packages/babel-generator/test/fixtures/misc/V8IntrinsicIdentifier/output.js @@ -0,0 +1 @@ +%DebugPrint(foo); diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 05580e017a32..565d75e77a52 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2191,7 +2191,7 @@ export default class ExpressionParser extends LValParser { if ( this.match(tt.semi) || (!this.match(tt.star) && !this.state.type.startsExpr) || - this.canInsertSemicolon() + this.hasPrecedingLineBreak() ) { node.delegate = false; node.argument = null; diff --git a/packages/babel-parser/src/plugin-utils.js b/packages/babel-parser/src/plugin-utils.js index c1cb6a6b7e92..2cf522532197 100644 --- a/packages/babel-parser/src/plugin-utils.js +++ b/packages/babel-parser/src/plugin-utils.js @@ -69,6 +69,10 @@ export function validatePlugins(plugins: PluginList) { throw new Error("Cannot combine flow and typescript plugins."); } + if (hasPlugin(plugins, "placeholders") && hasPlugin(plugins, "v8intrinsic")) { + throw new Error("Cannot combine placeholders and v8intrinsic plugins."); + } + if ( hasPlugin(plugins, "pipelineOperator") && !PIPELINE_PROPOSALS.includes( @@ -89,6 +93,7 @@ import flow from "./plugins/flow"; import jsx from "./plugins/jsx"; import typescript from "./plugins/typescript"; import placeholders from "./plugins/placeholders"; +import v8intrinsic from "./plugins/v8intrinsic"; // NOTE: order is important. estree must come first; placeholders must come last. export const mixinPlugins: { [name: string]: MixinPlugin } = { @@ -96,6 +101,7 @@ export const mixinPlugins: { [name: string]: MixinPlugin } = { jsx, flow, typescript, + v8intrinsic, placeholders, }; diff --git a/packages/babel-parser/src/plugins/v8intrinsic.js b/packages/babel-parser/src/plugins/v8intrinsic.js new file mode 100644 index 000000000000..be3a1fbaae0d --- /dev/null +++ b/packages/babel-parser/src/plugins/v8intrinsic.js @@ -0,0 +1,32 @@ +import type Parser from "../parser"; +import { types as tt } from "../tokenizer/types"; +import * as N from "../types"; + +export default (superClass: Class): Class => + class extends superClass { + parseV8Intrinsic(): N.Expression { + if (this.match(tt.modulo)) { + const v8IntrinsicStart = this.state.start; + // let the `loc` of Identifier starts from `%` + const node = this.startNode(); + this.eat(tt.modulo); + if (this.match(tt.name)) { + const name = this.parseIdentifierName(this.state.start); + const identifier = this.createIdentifier(node, name); + identifier.type = "V8IntrinsicIdentifier"; + if (this.match(tt.parenL)) { + return identifier; + } + } + this.unexpected(v8IntrinsicStart); + } + } + + /* ============================================================ * + * parser/expression.js * + * ============================================================ */ + + parseExprAtom(): N.Expression { + return this.parseV8Intrinsic() || super.parseExprAtom(...arguments); + } + }; diff --git a/packages/babel-parser/src/tokenizer/types.js b/packages/babel-parser/src/tokenizer/types.js index 47b4ced9f14e..ecb1e8376571 100644 --- a/packages/babel-parser/src/tokenizer/types.js +++ b/packages/babel-parser/src/tokenizer/types.js @@ -148,7 +148,8 @@ export const types: { [name: string]: TokenType } = { relational: createBinop("/<=/>=", 8), bitShift: createBinop("<>/>>>", 9), plusMin: new TokenType("+/-", { beforeExpr, binop: 10, prefix, startsExpr }), - modulo: createBinop("%", 11), + // startsExpr: required by v8intrinsic plugin + modulo: new TokenType("%", { beforeExpr, binop: 11, startsExpr }), star: createBinop("*", 11), slash: createBinop("/", 11), exponent: new TokenType("**", { diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/input.js new file mode 100644 index 000000000000..2828ef73abc6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/input.js @@ -0,0 +1 @@ +::%DebugPrint(null) diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json new file mode 100644 index 000000000000..8df61c77cf09 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "v8intrinsic" + ], + "throws": "Unexpected token (1:0)" +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/input.js new file mode 100644 index 000000000000..11f5e1b795e5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/input.js @@ -0,0 +1 @@ +a.%DebugPrint(); diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json new file mode 100644 index 000000000000..2339aca027fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "v8intrinsic" + ], + "throws": "Unexpected token (1:2)" +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/input.js new file mode 100644 index 000000000000..3f654b116269 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/input.js @@ -0,0 +1 @@ +%DebugPrint(foo) diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/options.json new file mode 100644 index 000000000000..550f9f8667f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/no-plugin/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [], + "throws": "Unexpected token (1:0)" +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/input.js new file mode 100644 index 000000000000..1743e18ef4f1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/input.js @@ -0,0 +1,2 @@ +const i = %DebugPrint; +i(foo); diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json new file mode 100644 index 000000000000..9f69797fc3b1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/not-in-call-expression/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["v8intrinsic"], + "throws": "Unexpected token (1:10)" +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/input.js new file mode 100644 index 000000000000..0f2bb372f3f4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/input.js @@ -0,0 +1 @@ +%DebugPrint?.(null) diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json new file mode 100644 index 000000000000..5a3c25f8b9cc --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "optionalChaining", + "v8intrinsic" + ], + "throws": "Unexpected token (1:0)" +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/input.js new file mode 100644 index 000000000000..43d5cb818781 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/input.js @@ -0,0 +1 @@ +async () => { await %StringParseInt("42", 10) } diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json new file mode 100644 index 000000000000..417906511ce0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 14, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 14, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "argument": { + "type": "CallExpression", + "start": 20, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "callee": { + "type": "V8IntrinsicIdentifier", + "start": 20, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "StringParseInt" + }, + "name": "StringParseInt" + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 40 + } + }, + "extra": { + "rawValue": "42", + "raw": "\"42\"" + }, + "value": "42" + }, + { + "type": "NumericLiteral", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 44 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + ], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/input.js new file mode 100644 index 000000000000..3f654b116269 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/input.js @@ -0,0 +1 @@ +%DebugPrint(foo) diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json new file mode 100644 index 000000000000..e44d316e19ce --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json @@ -0,0 +1,101 @@ +{ + "type": "File", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "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": "CallExpression", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callee": { + "type": "V8IntrinsicIdentifier", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "DebugPrint" + }, + "name": "DebugPrint" + }, + "arguments": [ + { + "type": "Identifier", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "foo" + }, + "name": "foo" + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/input.js new file mode 100644 index 000000000000..cacf4eb63800 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/input.js @@ -0,0 +1 @@ +new %DebugPrint(null); diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json new file mode 100644 index 000000000000..c02efb12aecc --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json @@ -0,0 +1,99 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 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": "ExpressionStatement", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "expression": { + "type": "NewExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "callee": { + "type": "V8IntrinsicIdentifier", + "start": 4, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "DebugPrint" + }, + "name": "DebugPrint" + }, + "arguments": [ + { + "type": "NullLiteral", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/input.js new file mode 100644 index 000000000000..82600e018602 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/input.js @@ -0,0 +1 @@ +%StringParseInt("42", 10); diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json new file mode 100644 index 000000000000..3843e6652fc3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json @@ -0,0 +1,124 @@ +{ + "type": "File", + "start": 0, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "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": "CallExpression", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "callee": { + "type": "V8IntrinsicIdentifier", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "StringParseInt" + }, + "name": "StringParseInt" + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "extra": { + "rawValue": "42", + "raw": "\"42\"" + }, + "value": "42" + }, + { + "type": "NumericLiteral", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/input.js new file mode 100644 index 000000000000..da2dc0b2bf49 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/input.js @@ -0,0 +1,3 @@ +function *foo() { + yield %StringParseInt("42", 10) +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json new file mode 100644 index 000000000000..50294da42d99 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json @@ -0,0 +1,193 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "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": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "generator": true, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 16, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 20, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "expression": { + "type": "YieldExpression", + "start": 20, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "delegate": false, + "argument": { + "type": "CallExpression", + "start": 26, + "end": 51, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "callee": { + "type": "V8IntrinsicIdentifier", + "start": 26, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "StringParseInt" + }, + "name": "StringParseInt" + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "extra": { + "rawValue": "42", + "raw": "\"42\"" + }, + "value": "42" + }, + { + "type": "NumericLiteral", + "start": 48, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "extra": { + "rawValue": 10, + "raw": "10" + }, + "value": 10 + } + ] + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/input.js b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/input.js new file mode 100644 index 000000000000..72f7312444c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/input.js @@ -0,0 +1 @@ +foo%bar() diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json new file mode 100644 index 000000000000..6233a3f2dd7d --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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": "BinaryExpression", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "left": { + "type": "Identifier", + "start": 0, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "operator": "%", + "right": { + "type": "CallExpression", + "start": 4, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "callee": { + "type": "Identifier", + "start": 4, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "arguments": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/options.json new file mode 100644 index 000000000000..609458c2c65e --- /dev/null +++ b/packages/babel-parser/test/fixtures/v8intrinsic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["v8intrinsic"] +} diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 799e9e8945d1..371b9a4633da 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -124,6 +124,7 @@ export type ParserPlugin = 'placeholders' | 'throwExpressions' | 'typescript' | + 'v8intrinsic' | ParserPluginWithOptions; export type ParserPluginWithOptions = diff --git a/packages/babel-types/scripts/utils/formatBuilderName.js b/packages/babel-types/scripts/utils/formatBuilderName.js index 1b543a9bfaf5..621c46821951 100644 --- a/packages/babel-types/scripts/utils/formatBuilderName.js +++ b/packages/babel-types/scripts/utils/formatBuilderName.js @@ -5,5 +5,6 @@ const toLowerCase = Function.call.bind("".toLowerCase); module.exports = function formatBuilderName(type) { // FunctionExpression -> functionExpression // JSXIdentifier -> jsxIdentifier - return type.replace(/^([A-Z](?=[a-z])|[A-Z]+(?=[A-Z]))/, toLowerCase); + // V8IntrinsicIdentifier -> v8IntrinsicIdentifier + return type.replace(/^([A-Z](?=[a-z0-9])|[A-Z]+(?=[A-Z]))/, toLowerCase); }; diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index 93c911d9004f..60a91b88178d 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -662,6 +662,12 @@ export function assertNoop(node: Object, opts?: Object = {}): void { export function assertPlaceholder(node: Object, opts?: Object = {}): void { assert("Placeholder", node, opts); } +export function assertV8IntrinsicIdentifier( + node: Object, + opts?: Object = {}, +): void { + assert("V8IntrinsicIdentifier", node, opts); +} export function assertArgumentPlaceholder( node: Object, opts?: Object = {}, diff --git a/packages/babel-types/src/builders/generated/index.js b/packages/babel-types/src/builders/generated/index.js index af48f24ec876..2cb9d5490c9d 100644 --- a/packages/babel-types/src/builders/generated/index.js +++ b/packages/babel-types/src/builders/generated/index.js @@ -600,6 +600,10 @@ export function Placeholder(...args: Array): Object { return builder("Placeholder", ...args); } export { Placeholder as placeholder }; +export function V8IntrinsicIdentifier(...args: Array): Object { + return builder("V8IntrinsicIdentifier", ...args); +} +export { V8IntrinsicIdentifier as v8IntrinsicIdentifier }; export function ArgumentPlaceholder(...args: Array): Object { return builder("ArgumentPlaceholder", ...args); } diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js index 1e4de3ebbfa0..09c41c9119a9 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -132,7 +132,7 @@ defineType("CallExpression", { aliases: ["Expression"], fields: { callee: { - validate: assertNodeType("Expression"), + validate: assertNodeType("Expression", "V8IntrinsicIdentifier"), }, arguments: { validate: chain( diff --git a/packages/babel-types/src/definitions/misc.js b/packages/babel-types/src/definitions/misc.js index e319235b2c15..da67c68706fc 100644 --- a/packages/babel-types/src/definitions/misc.js +++ b/packages/babel-types/src/definitions/misc.js @@ -1,5 +1,9 @@ // @flow -import defineType, { assertNodeType, assertOneOf } from "./utils"; +import defineType, { + assertNodeType, + assertOneOf, + assertValueType, +} from "./utils"; import { PLACEHOLDERS } from "./placeholders"; defineType("Noop", { @@ -19,3 +23,12 @@ defineType("Placeholder", { }, }, }); + +defineType("V8IntrinsicIdentifier", { + builder: ["name"], + fields: { + name: { + validate: assertValueType("string"), + }, + }, +}); diff --git a/packages/babel-types/src/validators/generated/index.js b/packages/babel-types/src/validators/generated/index.js index 259e37d90430..84f44ef882cd 100644 --- a/packages/babel-types/src/validators/generated/index.js +++ b/packages/babel-types/src/validators/generated/index.js @@ -2107,6 +2107,20 @@ export function isPlaceholder(node: ?Object, opts?: Object): boolean { return false; } +export function isV8IntrinsicIdentifier(node: ?Object, opts?: Object): boolean { + if (!node) return false; + + const nodeType = node.type; + if (nodeType === "V8IntrinsicIdentifier") { + if (typeof opts === "undefined") { + return true; + } else { + return shallowEqual(node, opts); + } + } + + return false; +} export function isArgumentPlaceholder(node: ?Object, opts?: Object): boolean { if (!node) return false; From 3e4889d649802f592b4c4d16f9fc8b6cee945783 Mon Sep 17 00:00:00 2001 From: Tim McClure Date: Fri, 6 Sep 2019 12:08:10 -0400 Subject: [PATCH 044/965] Class Private Static Accessors (#10217) * Remove error for static private accessors * Private static accessors strict * Add loose mode support * Move `value` decl for early return * Reuse getter/setter template * Reuse getter/setter templates * Use `buildUndefinedNode` in accessor templates * Extract `isAccessor` variable --- .../src/features.js | 6 - .../src/fields.js | 154 ++++++++++-------- packages/babel-helpers/src/helpers.js | 20 ++- .../accessors-loose/get-only-setter/output.js | 1 + .../accessors-loose/set-only-getter/output.js | 3 +- .../accessors/get-only-setter/output.js | 1 + .../accessors/set-only-getter/output.js | 3 +- .../this/output.js | 9 +- .../private-static-method/this/output.js | 8 +- .../static-accessors-loose/basic/exec.js | 23 +++ .../static-accessors-loose/basic/input.js | 19 +++ .../static-accessors-loose/basic/output.js | 31 ++++ .../get-only-setter/exec.js | 13 ++ .../get-only-setter/input.js | 11 ++ .../get-only-setter/output.js | 23 +++ .../static-accessors-loose/options.json | 14 ++ .../set-only-getter/exec.js | 13 ++ .../set-only-getter/input.js | 11 ++ .../set-only-getter/output.js | 23 +++ .../static-accessors-loose/updates/exec.js | 46 ++++++ .../static-accessors-loose/updates/input.js | 44 +++++ .../static-accessors-loose/updates/output.js | 53 ++++++ .../fixtures/static-accessors/basic/exec.js | 23 +++ .../fixtures/static-accessors/basic/input.js | 19 +++ .../fixtures/static-accessors/basic/output.js | 27 +++ .../static-accessors/get-only-setter/exec.js | 13 ++ .../static-accessors/get-only-setter/input.js | 11 ++ .../get-only-setter/output.js | 19 +++ .../fixtures/static-accessors/options.json | 14 ++ .../static-accessors/set-only-getter/exec.js | 13 ++ .../static-accessors/set-only-getter/input.js | 11 ++ .../set-only-getter/output.js | 19 +++ .../fixtures/static-accessors/updates/exec.js | 46 ++++++ .../static-accessors/updates/input.js | 44 +++++ .../static-accessors/updates/output.js | 51 ++++++ 35 files changed, 749 insertions(+), 90 deletions(-) create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/options.json create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/options.json create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/output.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/exec.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/input.js create mode 100644 packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/output.js diff --git a/packages/babel-helper-create-class-features-plugin/src/features.js b/packages/babel-helper-create-class-features-plugin/src/features.js index fffc0d0014e0..4fc528bff185 100644 --- a/packages/babel-helper-create-class-features-plugin/src/features.js +++ b/packages/babel-helper-create-class-features-plugin/src/features.js @@ -66,12 +66,6 @@ export function verifyUsedFeatures(path, file) { if (!hasFeature(file, FEATURES.privateMethods)) { throw path.buildCodeFrameError("Class private methods are not enabled."); } - - if (path.node.static && path.node.kind !== "method") { - throw path.buildCodeFrameError( - "@babel/plugin-class-features doesn't support class static private accessors yet.", - ); - } } if ( 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 c6fb3da40ded..4cdaccd1bbb5 100644 --- a/packages/babel-helper-create-class-features-plugin/src/fields.js +++ b/packages/babel-helper-create-class-features-plugin/src/fields.js @@ -44,6 +44,7 @@ export function buildPrivateNamesNodes(privateNamesMap, loose, state) { // because static fields are directly assigned to a variable in the // buildPrivateStaticFieldInitSpec function. const { id, static: isStatic, method: isMethod, getId, setId } = value; + const isAccessor = getId || setId; if (loose) { initNodes.push( template.statement.ast` @@ -51,7 +52,7 @@ export function buildPrivateNamesNodes(privateNamesMap, loose, state) { `, ); } else if (isMethod && !isStatic) { - if (getId || setId) { + if (isAccessor) { initNodes.push(template.statement.ast`var ${id} = new WeakMap();`); } else { initNodes.push(template.statement.ast`var ${id} = new WeakSet();`); @@ -140,11 +141,13 @@ const privateNameHandlerSpec = { getId, setId, } = privateNamesMap.get(name); + const isAccessor = getId || setId; if (isStatic) { - const helperName = isMethod - ? "classStaticPrivateMethodGet" - : "classStaticPrivateFieldSpecGet"; + const helperName = + isMethod && !isAccessor + ? "classStaticPrivateMethodGet" + : "classStaticPrivateFieldSpecGet"; return t.callExpression(file.addHelper(helperName), [ this.receiver(member), @@ -154,7 +157,7 @@ const privateNameHandlerSpec = { } if (isMethod) { - if (getId || setId) { + if (isAccessor) { return t.callExpression(file.addHelper("classPrivateFieldGet"), [ this.receiver(member), t.cloneNode(id), @@ -180,12 +183,15 @@ const privateNameHandlerSpec = { static: isStatic, method: isMethod, setId, + getId, } = privateNamesMap.get(name); + const isAccessor = getId || setId; if (isStatic) { - const helperName = isMethod - ? "classStaticPrivateMethodSet" - : "classStaticPrivateFieldSpecSet"; + const helperName = + isMethod && !isAccessor + ? "classStaticPrivateMethodSet" + : "classStaticPrivateFieldSpecSet"; return t.callExpression(file.addHelper(helperName), [ this.receiver(member), @@ -300,9 +306,30 @@ function buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap) { } function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) { - const { id } = privateNamesMap.get(prop.node.key.id.name); - const value = prop.node.value || prop.scope.buildUndefinedNode(); + const privateName = privateNamesMap.get(prop.node.key.id.name); + const { id, getId, setId, initAdded } = privateName; + const isAccessor = getId || setId; + if (!prop.isProperty() && (initAdded || !isAccessor)) return; + + if (isAccessor) { + privateNamesMap.set(prop.node.key.id.name, { + ...privateName, + initAdded: true, + }); + + return template.statement.ast` + var ${id.name} = { + // configurable is false by default + // enumerable is false by default + // writable is false by default + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + } + `; + } + + const value = prop.node.value || prop.scope.buildUndefinedNode(); return template.statement.ast` var ${id} = { // configurable is false by default @@ -328,76 +355,44 @@ function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) { }); `; } - - if (getId || setId) { + const isAccessor = getId || setId; + if (isAccessor) { privateNamesMap.set(prop.node.key.id.name, { ...privateName, initAdded: true, }); - if (getId && setId) { - return template.statement.ast` - Object.defineProperty(${ref}, ${id}, { - // configurable is false by default - // enumerable is false by default - // writable is false by default - get: ${getId.name}, - set: ${setId.name} - }); - `; - } else if (getId && !setId) { - return template.statement.ast` - Object.defineProperty(${ref}, ${id}, { - // configurable is false by default - // enumerable is false by default - // writable is false by default - get: ${getId.name} - }); - `; - } else if (!getId && setId) { - return template.statement.ast` - Object.defineProperty(${ref}, ${id}, { - // configurable is false by default - // enumerable is false by default - // writable is false by default - set: ${setId.name} - }); - `; - } + return template.statement.ast` + Object.defineProperty(${ref}, ${id}, { + // configurable is false by default + // enumerable is false by default + // writable is false by default + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + }); + `; } } function buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap) { const privateName = privateNamesMap.get(prop.node.key.id.name); const { id, getId, setId, initAdded } = privateName; + if (initAdded) return; - if (getId || setId) { + const isAccessor = getId || setId; + if (isAccessor) { privateNamesMap.set(prop.node.key.id.name, { ...privateName, initAdded: true, }); - if (getId && setId) { - return template.statement.ast` - ${id}.set(${ref}, { - get: ${getId.name}, - set: ${setId.name} - }); - `; - } else if (getId && !setId) { - return template.statement.ast` - ${id}.set(${ref}, { - get: ${getId.name} - }); - `; - } else if (!getId && setId) { - return template.statement.ast` - ${id}.set(${ref}, { - set: ${setId.name} - }); - `; - } + return template.statement.ast` + ${id}.set(${ref}, { + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + }); + `; } return template.statement.ast`${id}.add(${ref})`; } @@ -429,7 +424,29 @@ function buildPublicFieldInitSpec(ref, prop, state) { } function buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) { - const { id, methodId } = privateNamesMap.get(prop.node.key.id.name); + const privateName = privateNamesMap.get(prop.node.key.id.name); + const { id, methodId, getId, setId, initAdded } = privateName; + + if (initAdded) return; + + const isAccessor = getId || setId; + if (isAccessor) { + privateNamesMap.set(prop.node.key.id.name, { + ...privateName, + initAdded: true, + }); + + return template.statement.ast` + Object.defineProperty(${ref}, ${id}, { + // configurable is false by default + // enumerable is false by default + // writable is false by default + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + }) + `; + } + return template.statement.ast` Object.defineProperty(${ref}, ${id}, { // configurable is false by default @@ -615,14 +632,14 @@ export function buildFieldsInitNodes( case isStatic && isPrivate && isMethod && !loose: needsClassRef = true; staticNodes.push( + buildPrivateStaticFieldInitSpec(prop, privateNamesMap), + ); + staticNodes.unshift( buildPrivateMethodDeclaration(prop, privateNamesMap, loose), ); break; case isStatic && isPrivate && isMethod && loose: needsClassRef = true; - staticNodes.push( - buildPrivateMethodDeclaration(prop, privateNamesMap, loose), - ); staticNodes.push( buildPrivateStaticMethodInitLoose( t.cloneNode(ref), @@ -631,6 +648,9 @@ export function buildFieldsInitNodes( privateNamesMap, ), ); + staticNodes.unshift( + buildPrivateMethodDeclaration(prop, privateNamesMap, loose), + ); break; case isInstance && isPublic && isField && loose: instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop)); @@ -646,7 +666,7 @@ export function buildFieldsInitNodes( } return { - staticNodes, + staticNodes: staticNodes.filter(Boolean), instanceNodes: instanceNodes.filter(Boolean), wrapClass(path) { for (const prop of props) { diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index ef9231df6ff4..29ed9d82264d 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -1177,6 +1177,9 @@ helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")` if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } + if (descriptor.get) { + return descriptor.get.call(receiver); + } return descriptor.value; } `; @@ -1186,13 +1189,18 @@ helpers.classStaticPrivateFieldSpecSet = helper("7.0.2")` if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } - if (!descriptor.writable) { - // This should only throw in strict mode, but class bodies are - // always strict and private fields can only be used inside - // class bodies. - throw new TypeError("attempted to set read only private field"); + if (descriptor.set) { + descriptor.set.call(receiver, value); + } else { + if (!descriptor.writable) { + // This should only throw in strict mode, but class bodies are + // always strict and private fields can only be used inside + // class bodies. + throw new TypeError("attempted to set read only private field"); + } + descriptor.value = value; } - descriptor.value = value; + return value; } `; diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/get-only-setter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/get-only-setter/output.js index 05866e2142fb..9d7d52b847b8 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/get-only-setter/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/get-only-setter/output.js @@ -1,6 +1,7 @@ class Cl { constructor() { Object.defineProperty(this, _privateFieldValue, { + get: void 0, set: _set_privateFieldValue }); Object.defineProperty(this, _privateField, { diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/set-only-getter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/set-only-getter/output.js index 57a8789016fa..eb046676cf54 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/set-only-getter/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors-loose/set-only-getter/output.js @@ -1,7 +1,8 @@ class Cl { constructor() { Object.defineProperty(this, _privateFieldValue, { - get: _get_privateFieldValue + get: _get_privateFieldValue, + set: void 0 }); Object.defineProperty(this, _privateField, { writable: true, diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/get-only-setter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/get-only-setter/output.js index 0906668c51fe..15691ee34a50 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/get-only-setter/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/get-only-setter/output.js @@ -1,6 +1,7 @@ class Cl { constructor() { _privateFieldValue.set(this, { + get: void 0, set: _set_privateFieldValue }); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/set-only-getter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/set-only-getter/output.js index 4ea497e71a17..e301c07805de 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/set-only-getter/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/accessors/set-only-getter/output.js @@ -1,7 +1,8 @@ class Cl { constructor() { _privateFieldValue.set(this, { - get: _get_privateFieldValue + get: _get_privateFieldValue, + set: void 0 }); _privateField.set(this, { diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/this/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/this/output.js index 4a5cddf8618c..0bccfda42bec 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/this/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method-loose/this/output.js @@ -20,6 +20,10 @@ var _getA = babelHelpers.classPrivateFieldLooseKey("getA"); var _getB = babelHelpers.classPrivateFieldLooseKey("getB"); +var _getB2 = function _getB2() { + return this.b; +}; + var _getA2 = function _getA2() { return A.a; }; @@ -27,11 +31,6 @@ var _getA2 = function _getA2() { Object.defineProperty(B, _getA, { value: _getA2 }); - -var _getB2 = function _getB2() { - return this.b; -}; - Object.defineProperty(B, _getB, { value: _getB2 }); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method/this/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method/this/output.js index e440955ecc99..49a4f4a7c600 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method/this/output.js +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/private-static-method/this/output.js @@ -16,12 +16,12 @@ class B extends A { } -var _getA = function _getA() { - return babelHelpers.get(babelHelpers.getPrototypeOf(B), "a", this); -}; - var _getB = function _getB() { return this.b; }; +var _getA = function _getA() { + return babelHelpers.get(babelHelpers.getPrototypeOf(B), "a", this); +}; + var [getA, getB] = B.extract(); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/exec.js new file mode 100644 index 000000000000..791a59034af9 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/exec.js @@ -0,0 +1,23 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = "top secret string"; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = `Updated: ${newValue}`; + } + + static getValue() { + return Cl.#privateStaticFieldValue; + } + + static setValue() { + Cl.#privateStaticFieldValue = "dank"; + } +} + +expect(Cl.getValue()).toEqual("top secret string"); +Cl.setValue(); +expect(Cl.getValue()).toEqual("Updated: dank"); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/input.js new file mode 100644 index 000000000000..c79cdbe5ff0e --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/input.js @@ -0,0 +1,19 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = "top secret string"; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = `Updated: ${newValue}`; + } + + static getValue() { + return Cl.#privateStaticFieldValue; + } + + static setValue() { + Cl.#privateStaticFieldValue = "dank"; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/output.js new file mode 100644 index 000000000000..83619d5323e6 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/basic/output.js @@ -0,0 +1,31 @@ +class Cl { + static getValue() { + return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue]; + } + + static setValue() { + babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = "dank"; + } + +} + +var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); + +var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); + +var _set_privateStaticFieldValue = function (newValue) { + babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`; +}; + +var _get_privateStaticFieldValue = function () { + return babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; +}; + +Object.defineProperty(Cl, _PRIVATE_STATIC_FIELD, { + writable: true, + value: "top secret string" +}); +Object.defineProperty(Cl, _privateStaticFieldValue, { + get: _get_privateStaticFieldValue, + set: _set_privateStaticFieldValue +}); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/exec.js new file mode 100644 index 000000000000..0c14f25c0938 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/exec.js @@ -0,0 +1,13 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = newValue; + } + + static getPrivateStaticFieldValue() { + return Cl.#privateStaticFieldValue; + } +} + +expect(Cl.getPrivateStaticFieldValue()).toBeUndefined(); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/input.js new file mode 100644 index 000000000000..ab8771074ec7 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/input.js @@ -0,0 +1,11 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = newValue; + } + + static getPrivateStaticFieldValue() { + return Cl.#privateStaticFieldValue; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js new file mode 100644 index 000000000000..adb85a9ead8c --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/get-only-setter/output.js @@ -0,0 +1,23 @@ +class Cl { + static getPrivateStaticFieldValue() { + return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue]; + } + +} + +var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); + +var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); + +var _set_privateStaticFieldValue = function (newValue) { + babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue; +}; + +Object.defineProperty(Cl, _PRIVATE_STATIC_FIELD, { + writable: true, + value: 0 +}); +Object.defineProperty(Cl, _privateStaticFieldValue, { + get: void 0, + set: _set_privateStaticFieldValue +}); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/options.json new file mode 100644 index 000000000000..50c7612f8387 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/options.json @@ -0,0 +1,14 @@ +{ + "plugins": [ + [ + "external-helpers", + { + "helperVersion": "7.1000.0" + } + ], + ["proposal-private-methods", { "loose": true }], + ["proposal-class-properties", { "loose": true }], + "transform-block-scoping", + "syntax-class-properties" + ] +} diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/exec.js new file mode 100644 index 000000000000..7069abfadc9d --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/exec.js @@ -0,0 +1,13 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static setPrivateStaticFieldValue() { + Cl.#privateStaticFieldValue = 1; + } +} + +expect(() => Cl.setPrivateStaticFieldValue()).toThrow(TypeError); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/input.js new file mode 100644 index 000000000000..d54ce4e2c2d0 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/input.js @@ -0,0 +1,11 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static setPrivateStaticFieldValue() { + Cl.#privateStaticFieldValue = 1; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/output.js new file mode 100644 index 000000000000..73e658037394 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/set-only-getter/output.js @@ -0,0 +1,23 @@ +class Cl { + static setPrivateStaticFieldValue() { + babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = 1; + } + +} + +var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD"); + +var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue"); + +var _get_privateStaticFieldValue = function () { + return babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD]; +}; + +Object.defineProperty(Cl, _PRIVATE_STATIC_FIELD, { + writable: true, + value: 0 +}); +Object.defineProperty(Cl, _privateStaticFieldValue, { + get: _get_privateStaticFieldValue, + set: void 0 +}); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/exec.js new file mode 100644 index 000000000000..05f70aecceec --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/exec.js @@ -0,0 +1,46 @@ +class Cl { + static #privateField = "top secret string"; + static publicField = "not secret string"; + + static get #privateFieldValue() { + return Cl.#privateField; + } + + static set #privateFieldValue(newValue) { + Cl.#privateField = newValue; + } + + static publicGetPrivateField() { + return Cl.#privateFieldValue; + } + + static publicSetPrivateField(newValue) { + Cl.#privateFieldValue = newValue; + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + Cl.#privateField = 0; + Cl.publicField = 0; + Cl.#privateFieldValue = Cl.#privateFieldValue++; + Cl.publicFieldValue = Cl.publicFieldValue++; + expect(Cl.#privateField).toEqual(Cl.publicField); + + ++Cl.#privateFieldValue; + ++Cl.publicFieldValue; + expect(Cl.#privateField).toEqual(Cl.publicField); + + Cl.#privateFieldValue += 1; + Cl.publicFieldValue += 1; + expect(Cl.#privateField).toEqual(Cl.publicField); + } +} + +Cl.testUpdates(); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/input.js new file mode 100644 index 000000000000..33c7b39d9cb4 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/input.js @@ -0,0 +1,44 @@ +class Cl { + static #privateField = "top secret string"; + static publicField = "not secret string"; + + static get #privateFieldValue() { + return Cl.#privateField; + } + + static set #privateFieldValue(newValue) { + Cl.#privateField = newValue; + } + + static publicGetPrivateField() { + return Cl.#privateFieldValue; + } + + static publicSetPrivateField(newValue) { + Cl.#privateFieldValue = newValue; + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + Cl.#privateField = 0; + Cl.publicField = 0; + Cl.#privateFieldValue = Cl.#privateFieldValue++; + Cl.publicFieldValue = Cl.publicFieldValue++; + + ++Cl.#privateFieldValue; + ++Cl.publicFieldValue; + + Cl.#privateFieldValue += 1; + Cl.publicFieldValue += 1; + + Cl.#privateFieldValue = -(Cl.#privateFieldValue ** Cl.#privateFieldValue); + Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/output.js new file mode 100644 index 000000000000..b75fa4a4d18c --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors-loose/updates/output.js @@ -0,0 +1,53 @@ +class Cl { + static publicGetPrivateField() { + return babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue]; + } + + static publicSetPrivateField(newValue) { + babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue] = newValue; + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + babelHelpers.classPrivateFieldLooseBase(Cl, _privateField)[_privateField] = 0; + Cl.publicField = 0; + babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue] = babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue]++; + Cl.publicFieldValue = Cl.publicFieldValue++; + ++babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue]; + ++Cl.publicFieldValue; + babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue] += 1; + Cl.publicFieldValue += 1; + babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue] = -(babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue] ** babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue]); + Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); + } + +} + +var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField"); + +var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue"); + +var _set_privateFieldValue = function (newValue) { + babelHelpers.classPrivateFieldLooseBase(Cl, _privateField)[_privateField] = newValue; +}; + +var _get_privateFieldValue = function () { + return babelHelpers.classPrivateFieldLooseBase(Cl, _privateField)[_privateField]; +}; + +Object.defineProperty(Cl, _privateField, { + writable: true, + value: "top secret string" +}); +Cl.publicField = "not secret string"; +Object.defineProperty(Cl, _privateFieldValue, { + get: _get_privateFieldValue, + set: _set_privateFieldValue +}); diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/exec.js new file mode 100644 index 000000000000..791a59034af9 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/exec.js @@ -0,0 +1,23 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = "top secret string"; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = `Updated: ${newValue}`; + } + + static getValue() { + return Cl.#privateStaticFieldValue; + } + + static setValue() { + Cl.#privateStaticFieldValue = "dank"; + } +} + +expect(Cl.getValue()).toEqual("top secret string"); +Cl.setValue(); +expect(Cl.getValue()).toEqual("Updated: dank"); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/input.js new file mode 100644 index 000000000000..c79cdbe5ff0e --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/input.js @@ -0,0 +1,19 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = "top secret string"; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = `Updated: ${newValue}`; + } + + static getValue() { + return Cl.#privateStaticFieldValue; + } + + static setValue() { + Cl.#privateStaticFieldValue = "dank"; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/output.js new file mode 100644 index 000000000000..7dc0b26977eb --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/basic/output.js @@ -0,0 +1,27 @@ +class Cl { + static getValue() { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); + } + + static setValue() { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateStaticFieldValue, "dank"); + } + +} + +var _set_privateStaticFieldValue = function (newValue) { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _PRIVATE_STATIC_FIELD, `Updated: ${newValue}`); +}; + +var _get_privateStaticFieldValue = function () { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _PRIVATE_STATIC_FIELD); +}; + +var _PRIVATE_STATIC_FIELD = { + writable: true, + value: "top secret string" +}; +var _privateStaticFieldValue = { + get: _get_privateStaticFieldValue, + set: _set_privateStaticFieldValue +}; diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/exec.js new file mode 100644 index 000000000000..0c14f25c0938 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/exec.js @@ -0,0 +1,13 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = newValue; + } + + static getPrivateStaticFieldValue() { + return Cl.#privateStaticFieldValue; + } +} + +expect(Cl.getPrivateStaticFieldValue()).toBeUndefined(); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/input.js new file mode 100644 index 000000000000..ab8771074ec7 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/input.js @@ -0,0 +1,11 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static set #privateStaticFieldValue(newValue) { + Cl.#PRIVATE_STATIC_FIELD = newValue; + } + + static getPrivateStaticFieldValue() { + return Cl.#privateStaticFieldValue; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/output.js new file mode 100644 index 000000000000..31c1bf46873e --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/get-only-setter/output.js @@ -0,0 +1,19 @@ +class Cl { + static getPrivateStaticFieldValue() { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); + } + +} + +var _set_privateStaticFieldValue = function (newValue) { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _PRIVATE_STATIC_FIELD, newValue); +}; + +var _PRIVATE_STATIC_FIELD = { + writable: true, + value: 0 +}; +var _privateStaticFieldValue = { + get: void 0, + set: _set_privateStaticFieldValue +}; diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/options.json new file mode 100644 index 000000000000..c5e6649e4ea8 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/options.json @@ -0,0 +1,14 @@ +{ + "plugins": [ + [ + "external-helpers", + { + "helperVersion": "7.1000.0" + } + ], + "proposal-private-methods", + "proposal-class-properties", + "transform-block-scoping", + "syntax-class-properties" + ] +} diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/exec.js new file mode 100644 index 000000000000..7069abfadc9d --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/exec.js @@ -0,0 +1,13 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static setPrivateStaticFieldValue() { + Cl.#privateStaticFieldValue = 1; + } +} + +expect(() => Cl.setPrivateStaticFieldValue()).toThrow(TypeError); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/input.js new file mode 100644 index 000000000000..d54ce4e2c2d0 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/input.js @@ -0,0 +1,11 @@ +class Cl { + static #PRIVATE_STATIC_FIELD = 0; + + static get #privateStaticFieldValue() { + return Cl.#PRIVATE_STATIC_FIELD; + } + + static setPrivateStaticFieldValue() { + Cl.#privateStaticFieldValue = 1; + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/output.js new file mode 100644 index 000000000000..fa3aebd45bfc --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/set-only-getter/output.js @@ -0,0 +1,19 @@ +class Cl { + static setPrivateStaticFieldValue() { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateStaticFieldValue, 1); + } + +} + +var _get_privateStaticFieldValue = function () { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _PRIVATE_STATIC_FIELD); +}; + +var _PRIVATE_STATIC_FIELD = { + writable: true, + value: 0 +}; +var _privateStaticFieldValue = { + get: _get_privateStaticFieldValue, + set: void 0 +}; diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/exec.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/exec.js new file mode 100644 index 000000000000..05f70aecceec --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/exec.js @@ -0,0 +1,46 @@ +class Cl { + static #privateField = "top secret string"; + static publicField = "not secret string"; + + static get #privateFieldValue() { + return Cl.#privateField; + } + + static set #privateFieldValue(newValue) { + Cl.#privateField = newValue; + } + + static publicGetPrivateField() { + return Cl.#privateFieldValue; + } + + static publicSetPrivateField(newValue) { + Cl.#privateFieldValue = newValue; + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + Cl.#privateField = 0; + Cl.publicField = 0; + Cl.#privateFieldValue = Cl.#privateFieldValue++; + Cl.publicFieldValue = Cl.publicFieldValue++; + expect(Cl.#privateField).toEqual(Cl.publicField); + + ++Cl.#privateFieldValue; + ++Cl.publicFieldValue; + expect(Cl.#privateField).toEqual(Cl.publicField); + + Cl.#privateFieldValue += 1; + Cl.publicFieldValue += 1; + expect(Cl.#privateField).toEqual(Cl.publicField); + } +} + +Cl.testUpdates(); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/input.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/input.js new file mode 100644 index 000000000000..33c7b39d9cb4 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/input.js @@ -0,0 +1,44 @@ +class Cl { + static #privateField = "top secret string"; + static publicField = "not secret string"; + + static get #privateFieldValue() { + return Cl.#privateField; + } + + static set #privateFieldValue(newValue) { + Cl.#privateField = newValue; + } + + static publicGetPrivateField() { + return Cl.#privateFieldValue; + } + + static publicSetPrivateField(newValue) { + Cl.#privateFieldValue = newValue; + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + Cl.#privateField = 0; + Cl.publicField = 0; + Cl.#privateFieldValue = Cl.#privateFieldValue++; + Cl.publicFieldValue = Cl.publicFieldValue++; + + ++Cl.#privateFieldValue; + ++Cl.publicFieldValue; + + Cl.#privateFieldValue += 1; + Cl.publicFieldValue += 1; + + Cl.#privateFieldValue = -(Cl.#privateFieldValue ** Cl.#privateFieldValue); + Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/output.js b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/output.js new file mode 100644 index 000000000000..1869c5b6ead8 --- /dev/null +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/static-accessors/updates/output.js @@ -0,0 +1,51 @@ +class Cl { + static publicGetPrivateField() { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue); + } + + static publicSetPrivateField(newValue) { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, newValue); + } + + static get publicFieldValue() { + return Cl.publicField; + } + + static set publicFieldValue(newValue) { + Cl.publicField = newValue; + } + + static testUpdates() { + var _Cl$privateFieldValue, _Cl$privateFieldValue2; + + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateField, 0); + Cl.publicField = 0; + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, (babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, (_Cl$privateFieldValue2 = +babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue)) + 1), _Cl$privateFieldValue2)); + Cl.publicFieldValue = Cl.publicFieldValue++; + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, +babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue) + 1); + ++Cl.publicFieldValue; + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue) + 1); + Cl.publicFieldValue += 1; + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, -(babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue) ** babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue))); + Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); + } + +} + +var _set_privateFieldValue = function (newValue) { + babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateField, newValue); +}; + +var _get_privateFieldValue = function () { + return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateField); +}; + +var _privateField = { + writable: true, + value: "top secret string" +}; +babelHelpers.defineProperty(Cl, "publicField", "not secret string"); +var _privateFieldValue = { + get: _get_privateFieldValue, + set: _set_privateFieldValue +}; From 8da9d8b4b8b5ff485bd84588d3022930b4e71575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 6 Sep 2019 12:09:19 -0400 Subject: [PATCH 045/965] feat(errors): validate preset when filename is absent (#10181) * feat(errors): validate preset when filename is absent Closes #10154 * fix: test overrides for filename compulsory * docs: rewrite validate error message per https://github.com/babel/babel/pull/10181#discussion_r301607986 * polish error message --- packages/babel-core/src/config/full.js | 44 +++++++++++++++++-- packages/babel-core/test/config-chain.js | 22 ++++++++++ .../test/fixtures/config-loading/preset4.js | 6 +++ .../test/fixtures/config-loading/preset5.js | 8 ++++ 4 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 packages/babel-core/test/fixtures/config-loading/preset4.js create mode 100644 packages/babel-core/test/fixtures/config-loading/preset5.js diff --git a/packages/babel-core/src/config/full.js b/packages/babel-core/src/config/full.js index 88c65ff882be..d38aec4ba698 100644 --- a/packages/babel-core/src/config/full.js +++ b/packages/babel-core/src/config/full.js @@ -18,6 +18,7 @@ import { validatePluginObject } from "./validation/plugins"; import makeAPI from "./helpers/config-api"; import loadPrivatePartialConfig from "./partial"; +import type { ValidatedOptions } from "./validation/options"; type LoadedDescriptor = { value: {}, @@ -278,6 +279,42 @@ const instantiatePlugin = makeWeakCache( }, ); +const validateIfOptionNeedsFilename = ( + options: ValidatedOptions, + descriptor: UnloadedDescriptor, +): void => { + if (options.test || options.include || options.exclude) { + const formattedPresetName = descriptor.name + ? `"${descriptor.name}"` + : "/* your preset */"; + throw new Error( + [ + `Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`, + `\`\`\``, + `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`, + `\`\`\``, + `See https://babeljs.io/docs/en/options#filename for more information.`, + ].join("\n"), + ); + } +}; + +const validatePreset = ( + preset: PresetInstance, + context: ConfigContext, + descriptor: UnloadedDescriptor, +): void => { + if (!context.filename) { + const { options } = preset; + validateIfOptionNeedsFilename(options, descriptor); + if (options.overrides) { + options.overrides.forEach(overrideOptions => + validateIfOptionNeedsFilename(overrideOptions, descriptor), + ); + } + } +}; + /** * Generate a config object that will act as the root of a new nested config. */ @@ -285,10 +322,9 @@ const loadPresetDescriptor = ( descriptor: UnloadedDescriptor, context: ConfigContext, ): ConfigChain | null => { - return buildPresetChain( - instantiatePreset(loadDescriptor(descriptor, context)), - context, - ); + const preset = instantiatePreset(loadDescriptor(descriptor, context)); + validatePreset(preset, context, descriptor); + return buildPresetChain(preset, context); }; const instantiatePreset = makeWeakCache( diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js index 849da38cfc02..32ee13867568 100644 --- a/packages/babel-core/test/config-chain.js +++ b/packages/babel-core/test/config-chain.js @@ -1049,5 +1049,27 @@ describe("buildConfigChain", function() { loadOptions({ filename, cwd: path.dirname(filename) }), ).toThrow(/Error while parsing JSON - /); }); + + it("should throw when `test` presents but `filename` is not passed", () => { + expect(() => loadOptions({ test: /\.ts$/, plugins: [] })).toThrow( + /Configuration contains string\/RegExp pattern/, + ); + }); + + it("should throw when `preset` requires `filename` but it was not passed", () => { + expect(() => { + loadOptions({ + presets: [require("./fixtures/config-loading/preset4")], + }); + }).toThrow(/Preset \/\* your preset \*\/ requires a filename/); + }); + + it("should throw when `preset.overrides` requires `filename` but it was not passed", () => { + expect(() => { + loadOptions({ + presets: [require("./fixtures/config-loading/preset5")], + }); + }).toThrow(/Preset \/\* your preset \*\/ requires a filename/); + }); }); }); diff --git a/packages/babel-core/test/fixtures/config-loading/preset4.js b/packages/babel-core/test/fixtures/config-loading/preset4.js new file mode 100644 index 000000000000..1698ff05edd1 --- /dev/null +++ b/packages/babel-core/test/fixtures/config-loading/preset4.js @@ -0,0 +1,6 @@ +module.exports = function() { + return { + test: /\.ts$/, + plugins: [] + } +}; diff --git a/packages/babel-core/test/fixtures/config-loading/preset5.js b/packages/babel-core/test/fixtures/config-loading/preset5.js new file mode 100644 index 000000000000..65ecb47f93c8 --- /dev/null +++ b/packages/babel-core/test/fixtures/config-loading/preset5.js @@ -0,0 +1,8 @@ +module.exports = function() { + return { + overrides: [{ + test: /\.ts$/, + plugins: [] + }] + } +}; From b64cb9aaf10b54fad8b718b15cfdec63547ba92b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 6 Sep 2019 12:09:57 -0400 Subject: [PATCH 046/965] fix: early return when instance is not iterable (#10396) * fix: early return when instance is not iterable * chore: update test fixtures * fix: gaurd against arguments for old browsers --- packages/babel-helpers/src/helpers.js | 7 ++++++- .../test/fixtures/destructuring/non-iterable/exec.js | 9 +++++++++ .../test/fixtures/regression/T7199/output.js | 2 +- .../preset-options/browserslist-defaults-2/output.js | 2 +- .../test/fixtures/sanity/block-scoping-for-of/output.js | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/non-iterable/exec.js diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index 29ed9d82264d..37485fdf705d 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -943,7 +943,9 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` // _e = _iteratorError // _i = _iterator // _s = _step - + if (!( + Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" + )) { return } var _arr = []; var _n = true; var _d = false; @@ -969,6 +971,9 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")` export default function _iterableToArrayLimitLoose(arr, i) { + if (!( + Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]" + )) { return } var _arr = []; for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { _arr.push(_step.value); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/non-iterable/exec.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/non-iterable/exec.js new file mode 100644 index 000000000000..83099c46c4f4 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/non-iterable/exec.js @@ -0,0 +1,9 @@ +expect( + () => { + var [foo, bar] = undefined; + }).toThrow("Invalid attempt to destructure non-iterable instance"); + +expect( + () => { + var foo = [ ...undefined ]; + }).toThrow("Invalid attempt to spread non-iterable instance"); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/output.js index 563d49889bff..cbe323d57d81 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/output.js @@ -8,7 +8,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js index f894dda6a490..27a1db8f8775 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js @@ -4,7 +4,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } diff --git a/packages/babel-preset-env/test/fixtures/sanity/block-scoping-for-of/output.js b/packages/babel-preset-env/test/fixtures/sanity/block-scoping-for-of/output.js index 391887c3e15c..6fc0a62bd42f 100644 --- a/packages/babel-preset-env/test/fixtures/sanity/block-scoping-for-of/output.js +++ b/packages/babel-preset-env/test/fixtures/sanity/block-scoping-for-of/output.js @@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } -function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } +function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } From aa7678f32a544057b8d5b13239a59181412e841d Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 6 Sep 2019 12:11:38 -0400 Subject: [PATCH 047/965] Remove core-js from @babel/register. (#9847) This module doesn't use core-js at all. --- packages/babel-register/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 28923cfdd186..bc9032c24801 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -13,7 +13,6 @@ "./lib/node.js": "./lib/browser.js" }, "dependencies": { - "core-js": "^3.0.0", "find-cache-dir": "^2.0.0", "lodash": "^4.17.13", "mkdirp": "^0.5.1", From 735abc0ed8dfbcfbfb46b1862d6f2c3c28052b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Sep 2019 18:40:06 +0200 Subject: [PATCH 048/965] Update lerna v3.16 includes https://github.com/lerna/lerna/pull/2185, which fixes an issue we had in the v7.5 releases --- package.json | 5 +- yarn.lock | 1335 ++++++++++++++++++++++++++++---------------------- 2 files changed, 759 insertions(+), 581 deletions(-) diff --git a/package.json b/package.json index a329e7667326..66a62cd801a9 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "gulp-watch": "^5.0.1", "husky": "^3.0.0", "jest": "^24.8.0", - "lerna": "^3.14.2", + "lerna": "^3.16.0", "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", "lodash": "^4.17.13", @@ -134,6 +134,5 @@ "moduleNameMapper": { "^@babel/([a-zA-Z0-9_-]+)$": "/packages/babel-$1/" } - }, - "dependencies": {} + } } diff --git a/yarn.lock b/yarn.lock index 04555a378a69..fb273997428e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -770,23 +770,23 @@ exec-sh "^0.3.2" minimist "^1.2.0" -"@evocateur/libnpmaccess@^3.1.0": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.1.tgz#e998466d9398dbc8e429a9640bb668924bef203d" - integrity sha512-sGRA6pDmlhQaRXH44tLLa6SlDF+Ws1gdEa0aeFJwJfeN8nV2oUpMbpJiIHDF2OxZnSkjOiyg/OAbNEeGzwL1/g== +"@evocateur/libnpmaccess@^3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmaccess/-/libnpmaccess-3.1.2.tgz#ecf7f6ce6b004e9f942b098d92200be4a4b1c845" + integrity sha512-KSCAHwNWro0CF2ukxufCitT9K5LjL/KuMmNzSu8wuwN2rjyKHD8+cmOsiybK+W5hdnwc5M1SmRlVCaMHQo+3rg== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.2" + "@evocateur/npm-registry-fetch" "^4.0.0" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" npm-package-arg "^6.1.0" -"@evocateur/libnpmpublish@^1.2.0": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.1.tgz#db6c69f3a0417c6477c4b9a273b2c4314bf82713" - integrity sha512-aQ1IyvOmwwXie2TTkSuXC8H1EJU7b3GUWgefW49vgTzENEhvt8OOcoFg8pp5vvEe6Ty7YOUarEL/Wz+T/GQYHA== +"@evocateur/libnpmpublish@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@evocateur/libnpmpublish/-/libnpmpublish-1.2.2.tgz#55df09d2dca136afba9c88c759ca272198db9f1a" + integrity sha512-MJrrk9ct1FeY9zRlyeoyMieBjGDG9ihyyD9/Ft6MMrTxql9NyoEx2hw9casTIP4CdqEVu+3nQ2nXxoJ8RCXyFg== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.2" + "@evocateur/npm-registry-fetch" "^4.0.0" aproba "^2.0.0" figgy-pudding "^3.5.1" get-stream "^4.0.0" @@ -796,32 +796,34 @@ semver "^5.5.1" ssri "^6.0.1" -"@evocateur/npm-registry-fetch@^3.9.1", "@evocateur/npm-registry-fetch@^3.9.2": - version "3.9.2" - resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-3.9.2.tgz#4e23b8b6c812c34828520ce42b31fcdb927c77a3" - integrity sha512-lz4cWdC32z6iI05YT9y79YuJtp4IXUu9lAP5JA/Z/difUXJRLAKlemboY64ELa8BKDav/ktjeCKUUJL8jxNTig== +"@evocateur/npm-registry-fetch@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@evocateur/npm-registry-fetch/-/npm-registry-fetch-4.0.0.tgz#8c4c38766d8d32d3200fcb0a83f064b57365ed66" + integrity sha512-k1WGfKRQyhJpIr+P17O5vLIo2ko1PFLKwoetatdduUSt/aQ4J2sJrJwwatdI5Z3SiYk/mRH9S3JpdmMFd/IK4g== dependencies: JSONStream "^1.3.4" bluebird "^3.5.1" figgy-pudding "^3.4.1" lru-cache "^5.1.1" - make-fetch-happen "^4.0.2" + make-fetch-happen "^5.0.0" npm-package-arg "^6.1.0" safe-buffer "^5.1.2" -"@evocateur/pacote@^9.6.0": - version "9.6.1" - resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.1.tgz#51770f22735ffd73224fe98dd9660c6f7b725b88" - integrity sha512-5G3LlCSmqELvR0b7uJOo8M4eYlmnA25Efft6s8kMeS6N0YZrDcqveRXr1B7BNAeFlXi80pHAA7kFJ1Hcy+427Q== +"@evocateur/pacote@^9.6.3": + version "9.6.5" + resolved "https://registry.yarnpkg.com/@evocateur/pacote/-/pacote-9.6.5.tgz#33de32ba210b6f17c20ebab4d497efc6755f4ae5" + integrity sha512-EI552lf0aG2nOV8NnZpTxNo2PcXKPmDbF9K8eCBFQdIZwHNGN/mi815fxtmUMa2wTa1yndotICIDt/V0vpEx2w== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.2" - bluebird "^3.5.5" - cacache "^11.3.3" + "@evocateur/npm-registry-fetch" "^4.0.0" + bluebird "^3.5.3" + cacache "^12.0.3" + chownr "^1.1.2" figgy-pudding "^3.5.1" get-stream "^4.1.0" glob "^7.1.4" + infer-owner "^1.0.4" lru-cache "^5.1.1" - make-fetch-happen "^4.0.2" + make-fetch-happen "^5.0.0" minimatch "^3.0.4" minipass "^2.3.5" mississippi "^3.0.0" @@ -829,7 +831,7 @@ normalize-package-data "^2.5.0" npm-package-arg "^6.1.0" npm-packlist "^1.4.4" - npm-pick-manifest "^2.2.3" + npm-pick-manifest "^3.0.0" osenv "^0.1.5" promise-inflight "^1.0.1" promise-retry "^1.1.1" @@ -988,70 +990,70 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^12.0.9" -"@lerna/add@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.15.0.tgz#10be562f43cde59b60f299083d54ac39520ec60a" - integrity sha512-+KrG4GFy/6FISZ+DwWf5Fj5YB4ESa4VTnSn/ujf3VEda6dxngHPN629j+TcPbsdOxUYVah+HuZbC/B8NnkrKpQ== - dependencies: - "@evocateur/pacote" "^9.6.0" - "@lerna/bootstrap" "3.15.0" - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" - "@lerna/npm-conf" "3.13.0" +"@lerna/add@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.16.2.tgz#90ecc1be7051cfcec75496ce122f656295bd6e94" + integrity sha512-RAAaF8aODPogj2Ge9Wj3uxPFIBGpog9M+HwSuq03ZnkkO831AmasCTJDqV+GEpl1U2DvnhZQEwHpWmTT0uUeEw== + dependencies: + "@evocateur/pacote" "^9.6.3" + "@lerna/bootstrap" "3.16.2" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" + "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" npm-package-arg "^6.1.0" - p-map "^1.2.0" - semver "^5.5.0" + p-map "^2.1.0" + semver "^6.2.0" -"@lerna/batch-packages@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.14.0.tgz#0208663bab3ddbf57956b370aaec4c9ebee6c800" - integrity sha512-RlBkQVNTqk1qvn6PFWiWNiskllUHh6tXbTVm43mZRNd+vhAyvrQC8RWJxH0ECVvnFAt9rSNGRIVbEJ31WnNQLg== +"@lerna/batch-packages@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.16.0.tgz#1c16cb697e7d718177db744cbcbdac4e30253c8c" + integrity sha512-7AdMkANpubY/FKFI01im01tlx6ygOBJ/0JcixMUWoWP/7Ds3SWQF22ID6fbBr38jUWptYLDs2fagtTDL7YUPuA== dependencies: - "@lerna/package-graph" "3.14.0" + "@lerna/package-graph" "3.16.0" npmlog "^4.1.2" -"@lerna/bootstrap@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.15.0.tgz#f53e0bbbbfb8367e609a06378409bfc673ff2930" - integrity sha512-4AxsPKKbgj2Ju03qDddQTpOHvpqnwd0yaiEU/aCcWv/4tDTe79NqUne2Z3+P2WZY0Zzb8+nUKcskwYBMTeq+Mw== - dependencies: - "@lerna/batch-packages" "3.14.0" - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" - "@lerna/has-npm-version" "3.14.2" - "@lerna/npm-install" "3.14.2" - "@lerna/package-graph" "3.14.0" +"@lerna/bootstrap@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.16.2.tgz#be268d940221d3c3270656b9b791b492559ad9d8" + integrity sha512-I+gs7eh6rv9Vyd+CwqL7sftRfOOsSzCle8cv/CGlMN7/p7EAVhxEdAw8SYoHIKHzipXszuqqy1Y3opyleD0qdA== + dependencies: + "@lerna/batch-packages" "3.16.0" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" + "@lerna/has-npm-version" "3.16.0" + "@lerna/npm-install" "3.16.0" + "@lerna/package-graph" "3.16.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/rimraf-dir" "3.14.2" - "@lerna/run-lifecycle" "3.14.0" - "@lerna/run-parallel-batches" "3.13.0" - "@lerna/symlink-binary" "3.14.2" - "@lerna/symlink-dependencies" "3.14.2" + "@lerna/run-lifecycle" "3.16.2" + "@lerna/run-parallel-batches" "3.16.0" + "@lerna/symlink-binary" "3.16.2" + "@lerna/symlink-dependencies" "3.16.2" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" - get-port "^3.2.0" - multimatch "^2.1.0" + get-port "^4.2.0" + multimatch "^3.0.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" p-finally "^1.0.0" - p-map "^1.2.0" + p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" read-package-tree "^5.1.6" - semver "^5.5.0" + semver "^6.2.0" -"@lerna/changed@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.15.0.tgz#20db9d992d697e4288c260aa38b989dcb93f4b40" - integrity sha512-Hns1ssI9T9xOTGVc7PT2jUaqzsSkxV3hV/Y7iFO0uKTk+fduyTwGTHU9A/ybQ/xi/9iaJbvaXyjxKiGoEnzmhg== +"@lerna/changed@3.16.4": + version "3.16.4" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.16.4.tgz#c3e727d01453513140eee32c94b695de577dc955" + integrity sha512-NCD7XkK744T23iW0wqKEgF4R9MYmReUbyHCZKopFnsNpQdqumc3SOIvQUAkKCP6hQJmYvxvOieoVgy/CVDpZ5g== dependencies: - "@lerna/collect-updates" "3.14.2" - "@lerna/command" "3.15.0" - "@lerna/listable" "3.14.0" + "@lerna/collect-updates" "3.16.0" + "@lerna/command" "3.16.0" + "@lerna/listable" "3.16.0" "@lerna/output" "3.13.0" - "@lerna/version" "3.15.0" + "@lerna/version" "3.16.4" "@lerna/check-working-tree@3.14.2": version "3.14.2" @@ -1071,17 +1073,17 @@ execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.15.0.tgz#a94da50908a80ba443a0a682706aca79ac2ecf27" - integrity sha512-D1BN7BnJk6YjrSR7E7RiCmWiFVWDo3L+OSe6zDq6rNNYexPBtSi2JOCeF/Dibi3jd2luVu0zkVpUtuEEdPiD+A== +"@lerna/clean@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.16.0.tgz#1c134334cacea1b1dbeacdc580e8b9240db8efa1" + integrity sha512-5P9U5Y19WmYZr7UAMGXBpY7xCRdlR7zhHy8MAPDKVx70rFIBS6nWXn5n7Kntv74g7Lm1gJ2rsiH5tj1OPcRJgg== dependencies: - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/rimraf-dir" "3.14.2" - p-map "^1.2.0" + p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" @@ -1105,77 +1107,78 @@ figgy-pudding "^3.5.1" npmlog "^4.1.2" -"@lerna/collect-updates@3.14.2", "@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": - version "3.14.2" - resolved "https://github.com/babel/lerna.git#ece37c645b84227edd4d10fdcf056acf8a2a4183" +"@lerna/collect-updates@3.16.0", "@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": + version "3.16.0" + resolved "https://github.com/babel/lerna.git#ae87fff020c5ad00366878c14b749e8ee0a34145" dependencies: "@lerna/child-process" "^3.3.0" "@lerna/describe-ref" "^3.6.0" minimatch "^3.0.4" npmlog "^4.1.2" - slash "^1.0.0" + slash "^2.0.0" -"@lerna/command@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.15.0.tgz#e1dc1319054f1cf0b135aa0c5730f3335641a0ca" - integrity sha512-dZqr4rKFN+veuXakIQ1DcGUpzBgcWKaYFNN4O6/skOdVQaEfGefzo1sZET+q7k/BkypxkhXHXpv5UqqSuL/EHQ== +"@lerna/command@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.16.0.tgz#ba3dba49cb5ce4d11b48269cf95becd86e30773f" + integrity sha512-u7tE4GC4/gfbPA9eQg+0ulnoJ+PMoMqomx033r/IxqZrHtmJR9+pF/37S0fsxJ2hX/RMFPC7c9Q/i8NEufSpdQ== dependencies: "@lerna/child-process" "3.14.2" - "@lerna/package-graph" "3.14.0" - "@lerna/project" "3.15.0" + "@lerna/package-graph" "3.16.0" + "@lerna/project" "3.16.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" dedent "^0.7.0" execa "^1.0.0" - is-ci "^1.0.10" - lodash "^4.17.5" + is-ci "^2.0.0" + lodash "^4.17.14" npmlog "^4.1.2" -"@lerna/conventional-commits@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.14.0.tgz#24f643550dc29d4f1249cc26d0eb453d7a1c513d" - integrity sha512-hGZ2qQZ9uEGf2eeIiIpEodSs9Qkkf/2uYEtNT7QN1RYISPUh6/lKGBssc5dpbCF64aEuxmemWLdlDf1ogG6++w== +"@lerna/conventional-commits@3.16.4": + version "3.16.4" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.16.4.tgz#bf464f11b2f6534dad204db00430e1651b346a04" + integrity sha512-QSZJ0bC9n6FVaf+7KDIq5zMv8WnHXnwhyL5jG1Nyh3SgOg9q2uflqh7YsYB+G6FwaRfnPaKosh6obijpYg0llA== dependencies: "@lerna/validation-error" "3.13.0" conventional-changelog-angular "^5.0.3" conventional-changelog-core "^3.1.6" - conventional-recommended-bump "^4.0.4" - fs-extra "^7.0.0" + conventional-recommended-bump "^5.0.0" + fs-extra "^8.1.0" get-stream "^4.0.0" + lodash.template "^4.5.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" - pify "^3.0.0" - semver "^5.5.0" + pify "^4.0.1" + semver "^6.2.0" -"@lerna/create-symlink@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.14.0.tgz#f40ae06e8cebe70c694368ebf9a4af5ab380fbea" - integrity sha512-Kw51HYOOi6UfCKncqkgEU1k/SYueSBXgkNL91FR8HAZH7EPSRTEtp9mnJo568g0+Hog5C+3cOaWySwhHpRG29A== +"@lerna/create-symlink@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-3.16.2.tgz#412cb8e59a72f5a7d9463e4e4721ad2070149967" + integrity sha512-pzXIJp6av15P325sgiIRpsPXLFmkisLhMBCy4764d+7yjf2bzrJ4gkWVMhsv4AdF0NN3OyZ5jjzzTtLNqfR+Jw== dependencies: - cmd-shim "^2.0.2" - fs-extra "^7.0.0" + "@zkochan/cmd-shim" "^3.1.0" + fs-extra "^8.1.0" npmlog "^4.1.2" -"@lerna/create@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.15.0.tgz#27bfadcbdf71d34226aa82432293f5290f7ab1aa" - integrity sha512-doXGt0HTwTQl8GkC2tOrraA/5OWbz35hJqi7Dsl3Fl0bAxiv9XmF3LykHFJ+YTDHfGpdoJ8tKu66f/VKP16G0w== +"@lerna/create@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.16.0.tgz#4de841ec7d98b29bb19fb7d6ad982e65f7a150e8" + integrity sha512-OZApR1Iz7awutbmj4sAArwhqCyKgcrnw9rH0aWAUrkYWrD1w4TwkvAcYAsfx5GpQGbLQwoXhoyyPwPfZRRWz3Q== dependencies: - "@evocateur/pacote" "^9.6.0" + "@evocateur/pacote" "^9.6.3" "@lerna/child-process" "3.14.2" - "@lerna/command" "3.15.0" - "@lerna/npm-conf" "3.13.0" + "@lerna/command" "3.16.0" + "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" dedent "^0.7.0" - fs-extra "^7.0.0" - globby "^8.0.1" + fs-extra "^8.1.0" + globby "^9.2.0" init-package-json "^1.10.3" npm-package-arg "^6.1.0" p-reduce "^1.0.0" - pify "^3.0.0" - semver "^5.5.0" - slash "^1.0.0" + pify "^4.0.1" + semver "^6.2.0" + slash "^2.0.0" validate-npm-package-license "^3.0.3" validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" @@ -1188,44 +1191,44 @@ "@lerna/child-process" "3.14.2" npmlog "^4.1.2" -"@lerna/diff@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.15.0.tgz#573d6f58f6809d16752dcfab74c5e286b6678371" - integrity sha512-N1Pr0M554Bt+DlVoD+DXWGh92gcq6G9icn8sH5GSqfwi0XCpPNJ2i1BNEZpUQ6ulLWOMa1YHR4PypPxecRGBjA== +"@lerna/diff@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.16.0.tgz#6d09a786f9f5b343a2fdc460eb0be08a05b420aa" + integrity sha512-QUpVs5TPl8vBIne10/vyjUxanQBQQp7Lk3iaB8MnCysKr0O+oy7trWeFVDPEkBTCD177By7yPGyW5Yey1nCBbA== dependencies: "@lerna/child-process" "3.14.2" - "@lerna/command" "3.15.0" + "@lerna/command" "3.16.0" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" -"@lerna/exec@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.15.0.tgz#b31510f47255367eb0d3e4a4f7b6ef8f7e41b985" - integrity sha512-YuXPd64TNG9wbb3lRvyMARQbdlbMZ1bJZ+GCm0enivnIWUyg0qtBDcfPY2dWpIgOif04zx+K/gmOX4lCaGM4UQ== +"@lerna/exec@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.16.0.tgz#2b6c033cee46181b6eede0eb12aad5c2c0181e89" + integrity sha512-mH3O5NXf/O88jBaBBTUf+d56CUkxpg782s3Jxy7HWbVuSUULt3iMRPTh+zEXO5/555etsIVVDDyUR76meklrJA== dependencies: "@lerna/child-process" "3.14.2" - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" - "@lerna/run-topologically" "3.14.0" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" + "@lerna/run-topologically" "3.16.0" "@lerna/validation-error" "3.13.0" - p-map "^1.2.0" + p-map "^2.1.0" -"@lerna/filter-options@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.14.2.tgz#7ba91cb54ff3fd9f4650ad8d7c40bc1075e44c2d" - integrity sha512-Ct8oYvRttbYB9JalngHhirb8o9ZVyLm5a9MpXNevXoHiu6j0vNhI19BQCwNnrL6wZvEHJnzPuUl/jO23tWxemg== +"@lerna/filter-options@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.16.0.tgz#b1660b4480c02a5c6efa4d0cd98b9afde4ed0bba" + integrity sha512-InIi1fF8+PxpCwir9bIy+pGxrdE6hvN0enIs1eNGCVS1TTE8osNgiZXa838bMQ1yaEccdcnVX6Z03BNKd56kNg== dependencies: - "@lerna/collect-updates" "3.14.2" - "@lerna/filter-packages" "3.13.0" + "@lerna/collect-updates" "3.16.0" + "@lerna/filter-packages" "3.16.0" dedent "^0.7.0" -"@lerna/filter-packages@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.13.0.tgz#f5371249e7e1a15928e5e88c544a242e0162c21c" - integrity sha512-RWiZWyGy3Mp7GRVBn//CacSnE3Kw82PxE4+H6bQ3pDUw/9atXn7NRX+gkBVQIYeKamh7HyumJtyOKq3Pp9BADQ== +"@lerna/filter-packages@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.16.0.tgz#7d34dc8530c71016263d6f67dc65308ecf11c9fc" + integrity sha512-eGFzQTx0ogkGDCnbTuXqssryR6ilp8+dcXt6B+aq1MaqL/vOJRZyqMm4TY3CUOUnzZCi9S2WWyMw3PnAJOF+kg== dependencies: "@lerna/validation-error" "3.13.0" - multimatch "^2.1.0" + multimatch "^3.0.0" npmlog "^4.1.2" "@lerna/get-npm-exec-opts@3.13.0": @@ -1235,23 +1238,23 @@ dependencies: npmlog "^4.1.2" -"@lerna/get-packed@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-3.13.0.tgz#335e40d77f3c1855aa248587d3e0b2d8f4b06e16" - integrity sha512-EgSim24sjIjqQDC57bgXD9l22/HCS93uQBbGpkzEOzxAVzEgpZVm7Fm1t8BVlRcT2P2zwGnRadIvxTbpQuDPTg== +"@lerna/get-packed@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-3.16.0.tgz#1b316b706dcee86c7baa55e50b087959447852ff" + integrity sha512-AjsFiaJzo1GCPnJUJZiTW6J1EihrPkc2y3nMu6m3uWFxoleklsSCyImumzVZJssxMi3CPpztj8LmADLedl9kXw== dependencies: - fs-extra "^7.0.0" + fs-extra "^8.1.0" ssri "^6.0.1" tar "^4.4.8" -"@lerna/github-client@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.14.2.tgz#a743792b51cd9bdfb785186e429568827a6372eb" - integrity sha512-+2Xh7t4qVmXiXE2utPnh5T7YwSltG74JP7c+EiooRY5+3zjh9MpPOcTKxVY3xKclzpsyXMohk2KpTF4tzA5rrg== +"@lerna/github-client@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.16.0.tgz#619874e461641d4f59ab1b3f1a7ba22dba88125d" + integrity sha512-IVJjcKjkYaUEPJsDyAblHGEFFNKCRyMagbIDm14L7Ab94ccN6i4TKOqAFEJn2SJHYvKKBdp3Zj2zNlASOMe3DA== dependencies: "@lerna/child-process" "3.14.2" - "@octokit/plugin-enterprise-rest" "^2.1.1" - "@octokit/rest" "^16.16.0" + "@octokit/plugin-enterprise-rest" "^3.6.1" + "@octokit/rest" "^16.28.4" git-url-parse "^11.1.2" npmlog "^4.1.2" @@ -1269,124 +1272,124 @@ resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== -"@lerna/has-npm-version@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.14.2.tgz#ac17f7c68e92114b8332b95ae6cffec9c0d67a7b" - integrity sha512-cG+z5bB8JPd5f+nT2eLN2LmKg06O11AxlnUxgw2W7cLyc7cnsmMSp/rxt2JBMwW2r4Yn+CLLJIRwJZ2Es8jFSw== +"@lerna/has-npm-version@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.16.0.tgz#55764a4ce792f0c8553cf996a17f554b9e843288" + integrity sha512-TIY036dA9J8OyTrZq9J+it2DVKifL65k7hK8HhkUPpitJkw6jwbMObA/8D40LOGgWNPweJWqmlrTbRSwsR7DrQ== dependencies: "@lerna/child-process" "3.14.2" - semver "^5.5.0" + semver "^6.2.0" -"@lerna/import@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.15.0.tgz#47f2da52059a96bb08a4c09e18d985258fce9ce1" - integrity sha512-4GKQgeTXBTwMbZNkYyPdQIVA41HIISD7D6XRNrDaG0falUfvoPsknijQPCBmGqeh66u1Fcn2+4lkL3OCTj2FMg== +"@lerna/import@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.16.0.tgz#b57cb453f4acfc60f6541fcbba10674055cb179d" + integrity sha512-trsOmGHzw0rL/f8BLNvd+9PjoTkXq2Dt4/V2UCha254hMQaYutbxcYu8iKPxz9x86jSPlH7FpbTkkHXDsoY7Yg== dependencies: "@lerna/child-process" "3.14.2" - "@lerna/command" "3.15.0" + "@lerna/command" "3.16.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" - fs-extra "^7.0.0" + fs-extra "^8.1.0" p-map-series "^1.0.0" -"@lerna/init@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.15.0.tgz#bda36de44c365972f87cbd287fe85b6fb7bb1070" - integrity sha512-VOqH6kFbFtfUbXxhSqXKY6bjnVp9nLuLRI6x9tVHOANX2LmSlXm17OUGBnNt+eM4uJLuiUsAR8nTlpCiz//lPQ== +"@lerna/init@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.16.0.tgz#31e0d66bbededee603338b487a42674a072b7a7d" + integrity sha512-Ybol/x5xMtBgokx4j7/Y3u0ZmNh0NiSWzBFVaOs2NOJKvuqrWimF67DKVz7yYtTYEjtaMdug64ohFF4jcT/iag== dependencies: "@lerna/child-process" "3.14.2" - "@lerna/command" "3.15.0" - fs-extra "^7.0.0" - p-map "^1.2.0" - write-json-file "^2.3.0" + "@lerna/command" "3.16.0" + fs-extra "^8.1.0" + p-map "^2.1.0" + write-json-file "^3.2.0" + +"@lerna/link@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.16.2.tgz#6c3a5658f6448a64dddca93d9348ac756776f6f6" + integrity sha512-eCPg5Lo8HT525fIivNoYF3vWghO3UgEVFdbsiPmhzwI7IQyZro5HWYzLtywSAdEog5XZpd2Bbn0CsoHWBB3gww== + dependencies: + "@lerna/command" "3.16.0" + "@lerna/package-graph" "3.16.0" + "@lerna/symlink-dependencies" "3.16.2" + p-map "^2.1.0" + slash "^2.0.0" -"@lerna/link@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.15.0.tgz#718b4116a8eacb3fc73414ae8d97f8fdaf8125da" - integrity sha512-yKHuifADINobvDOLljBGkVGpVwy6J3mg5p9lQXBdOLXBoIKC8o/UKBR9JvZMFvT/Iy6zn6FPy1v5lz9iU1Ib0Q== +"@lerna/list@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.16.0.tgz#883c00b2baf1e03c93e54391372f67a01b773c2f" + integrity sha512-TkvstoPsgKqqQ0KfRumpsdMXfRSEhdXqOLq519XyI5IRWYxhoqXqfi8gG37UoBPhBNoe64japn5OjphF3rOmQA== dependencies: - "@lerna/command" "3.15.0" - "@lerna/package-graph" "3.14.0" - "@lerna/symlink-dependencies" "3.14.2" - p-map "^1.2.0" - slash "^1.0.0" - -"@lerna/list@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.15.0.tgz#4e401c1ad990bb12bd38298cb61d21136420ff68" - integrity sha512-8SvxnlfAnbEzQDf2NL0IxWyUuqWTykF9cHt5/f5TOzgESClpaOkDtqwh/UlE8nVTzWMnxnQUPQi3UTKyJD3i3g== - dependencies: - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" - "@lerna/listable" "3.14.0" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" + "@lerna/listable" "3.16.0" "@lerna/output" "3.13.0" -"@lerna/listable@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.14.0.tgz#08f4c78e0466568e8e8a57d4ad09537f2bb7bbb9" - integrity sha512-ZK44Mo8xf/N97eQZ236SPSq0ek6+gk4HqHIx05foEMZVV1iIDH4a/nblLsJNjGQVsIdMYFPaqNJ0z+ZQfiJazQ== +"@lerna/listable@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.16.0.tgz#e6dc47a2d5a6295222663486f50e5cffc580f043" + integrity sha512-mtdAT2EEECqrJSDm/aXlOUFr1MRE4p6hppzY//Klp05CogQy6uGaKk+iKG5yyCLaOXFFZvG4HfO11CmoGSDWzw== dependencies: - "@lerna/query-graph" "3.14.0" + "@lerna/query-graph" "3.16.0" chalk "^2.3.1" columnify "^1.5.4" -"@lerna/log-packed@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-3.13.0.tgz#497b5f692a8d0e3f669125da97b0dadfd9e480f3" - integrity sha512-Rmjrcz+6aM6AEcEVWmurbo8+AnHOvYtDpoeMMJh9IZ9SmZr2ClXzmD7wSvjTQc8BwOaiWjjC/ukcT0UYA2m7wg== +"@lerna/log-packed@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-3.16.0.tgz#f83991041ee77b2495634e14470b42259fd2bc16" + integrity sha512-Fp+McSNBV/P2mnLUYTaSlG8GSmpXM7krKWcllqElGxvAqv6chk2K3c2k80MeVB4WvJ9tRjUUf+i7HUTiQ9/ckQ== dependencies: - byte-size "^4.0.3" + byte-size "^5.0.1" columnify "^1.5.4" has-unicode "^2.0.1" npmlog "^4.1.2" -"@lerna/npm-conf@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-3.13.0.tgz#6b434ed75ff757e8c14381b9bbfe5d5ddec134a7" - integrity sha512-Jg2kANsGnhg+fbPEzE0X9nX5oviEAvWj0nYyOkcE+cgWuT7W0zpnPXC4hA4C5IPQGhwhhh0IxhWNNHtjTuw53g== +"@lerna/npm-conf@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-3.16.0.tgz#1c10a89ae2f6c2ee96962557738685300d376827" + integrity sha512-HbO3DUrTkCAn2iQ9+FF/eisDpWY5POQAOF1m7q//CZjdC2HSW3UYbKEGsSisFxSfaF9Z4jtrV+F/wX6qWs3CuA== dependencies: config-chain "^1.1.11" - pify "^3.0.0" + pify "^4.0.1" -"@lerna/npm-dist-tag@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.15.0.tgz#262dd1e67a4cf82ae78fadfe02622ebce4add078" - integrity sha512-lnbdwc4Ebs7/EI9fTIgbH3dxXnP+SuCcGhG7P5ZjOqo67SY09sRZGcygEzabpvIwXvKpBF8vCd4xxzjnF2u+PA== +"@lerna/npm-dist-tag@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.16.0.tgz#b2184cee5e1f291277396854820e1117a544b7ee" + integrity sha512-MQrBkqJJB9+eNphuj9w90QPMOs4NQXMuSRk9NqzeFunOmdDopPCV0Q7IThSxEuWnhJ2n3B7G0vWUP7tNMPdqIQ== dependencies: - "@evocateur/npm-registry-fetch" "^3.9.1" - "@lerna/otplease" "3.14.0" + "@evocateur/npm-registry-fetch" "^4.0.0" + "@lerna/otplease" "3.16.0" figgy-pudding "^3.5.1" npm-package-arg "^6.1.0" npmlog "^4.1.2" -"@lerna/npm-install@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.14.2.tgz#fd22ff432f8b7cbe05bedfd36b0506482f1a4732" - integrity sha512-JYJJRtLETrGpcQZa8Rj16vbye399RqnaXmJlZuZ2twjJ2DYVYtwkfsGEOdvdaKw5KVOEpWcAxBA9OMmKQtCLQw== +"@lerna/npm-install@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.16.0.tgz#8ec76a7a13b183bde438fd46296bf7a0d6f86017" + integrity sha512-APUOIilZCzDzce92uLEwzt1r7AEMKT/hWA1ThGJL+PO9Rn8A95Km3o2XZAYG4W0hR+P4O2nSVuKbsjQtz8CjFQ== dependencies: "@lerna/child-process" "3.14.2" "@lerna/get-npm-exec-opts" "3.13.0" - fs-extra "^7.0.0" + fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" signal-exit "^3.0.2" write-pkg "^3.1.0" -"@lerna/npm-publish@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.15.0.tgz#89126d74ec97186475767b852954a5f55b732a71" - integrity sha512-G7rcNcSGjG0La8eHPXDvCvoNXbwNnP6XJ+GPh3CH5xiR/nikfLOa+Bfm4ytdjVWWxnKfCT4qyMTCoV1rROlqQQ== +"@lerna/npm-publish@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.16.2.tgz#a850b54739446c4aa766a0ceabfa9283bb0be676" + integrity sha512-tGMb9vfTxP57vUV5svkBQxd5Tzc+imZbu9ZYf8Mtwe0+HYfDjNiiHLIQw7G95w4YRdc5KsCE8sQ0uSj+f2soIg== dependencies: - "@evocateur/libnpmpublish" "^1.2.0" - "@lerna/otplease" "3.14.0" - "@lerna/run-lifecycle" "3.14.0" + "@evocateur/libnpmpublish" "^1.2.2" + "@lerna/otplease" "3.16.0" + "@lerna/run-lifecycle" "3.16.2" figgy-pudding "^3.5.1" - fs-extra "^7.0.0" + fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" - pify "^3.0.0" + pify "^4.0.1" read-package-json "^2.0.13" "@lerna/npm-run-script@3.14.2": @@ -1398,10 +1401,10 @@ "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" -"@lerna/otplease@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-3.14.0.tgz#b539fd3e7a08452fc0db3b10010ca3cf0e4a73e7" - integrity sha512-rYAWzaYZ81bwnrmTkYWGgcc13bl/6DlG7pjWQWNGAJNLzO5zzj0xmXN5sMFJnNvDpSiS/ZS1sIuPvb4xnwLUkg== +"@lerna/otplease@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-3.16.0.tgz#de66aec4f3e835a465d7bea84b58a4ab6590a0fa" + integrity sha512-uqZ15wYOHC+/V0WnD2iTLXARjvx3vNrpiIeyIvVlDB7rWse9mL4egex/QSgZ+lDx1OID7l2kgvcUD9cFpbqB7Q== dependencies: "@lerna/prompt" "3.13.0" figgy-pudding "^3.5.1" @@ -1413,64 +1416,64 @@ dependencies: npmlog "^4.1.2" -"@lerna/pack-directory@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.14.2.tgz#577b8ebf867c9b636a2e4659a27552ee24d83b9d" - integrity sha512-b3LnJEmIml3sDj94TQT8R+kVyrDlmE7Su0WwcBYZDySXPMSZ38WA2/2Xjy/EWhXlFxp/nUJKyUG78nDrZ/00Uw== +"@lerna/pack-directory@3.16.4": + version "3.16.4" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-3.16.4.tgz#3eae5f91bdf5acfe0384510ed53faddc4c074693" + integrity sha512-uxSF0HZeGyKaaVHz5FroDY9A5NDDiCibrbYR6+khmrhZtY0Bgn6hWq8Gswl9iIlymA+VzCbshWIMX4o2O8C8ng== dependencies: - "@lerna/get-packed" "3.13.0" - "@lerna/package" "3.14.2" - "@lerna/run-lifecycle" "3.14.0" + "@lerna/get-packed" "3.16.0" + "@lerna/package" "3.16.0" + "@lerna/run-lifecycle" "3.16.2" figgy-pudding "^3.5.1" - npm-packlist "^1.4.1" + npm-packlist "^1.4.4" npmlog "^4.1.2" - tar "^4.4.8" + tar "^4.4.10" temp-write "^3.4.0" -"@lerna/package-graph@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.14.0.tgz#4ccdf446dccedfbbeb4efff3eb720cb6fcb109fc" - integrity sha512-dNpA/64STD5YXhaSlg4gT6Z474WPJVCHoX1ibsVIFu0fVgH609Y69bsdmbvTRdI7r6Dcu4ZfGxdR636RTrH+Eg== +"@lerna/package-graph@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.16.0.tgz#909c90fb41e02f2c19387342d2a5eefc36d56836" + integrity sha512-A2mum/gNbv7zCtAwJqoxzqv89As73OQNK2MgSX1SHWya46qoxO9a9Z2c5lOFQ8UFN5ZxqWMfFYXRCz7qzwmFXw== dependencies: - "@lerna/prerelease-id-from-version" "3.14.0" + "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/validation-error" "3.13.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" - semver "^5.5.0" + semver "^6.2.0" -"@lerna/package@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.14.2.tgz#f893cb42e26c869df272dafbe1dd5a3473b0bd4d" - integrity sha512-YR/+CzYdufJYfsUlrfuhTjA35iSZpXK7mVOZmeR9iRWhSaqesm4kq2zfxm9vCpZV2oAQQZOwi4eo5h0rQBtdiw== +"@lerna/package@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-3.16.0.tgz#7e0a46e4697ed8b8a9c14d59c7f890e0d38ba13c" + integrity sha512-2lHBWpaxcBoiNVbtyLtPUuTYEaB/Z+eEqRS9duxpZs6D+mTTZMNy6/5vpEVSCBmzvdYpyqhqaYjjSLvjjr5Riw== dependencies: - load-json-file "^4.0.0" + load-json-file "^5.3.0" npm-package-arg "^6.1.0" write-pkg "^3.1.0" -"@lerna/prerelease-id-from-version@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.14.0.tgz#d5da9c26ac4a0d0ecde09018f06e41ca4dd444c2" - integrity sha512-Ap3Z/dNhqQuSrKmK+JmzYvQYI2vowxHvUVxZJiDVilW8dyNnxkCsYFmkuZytk5sxVz4VeGLNPS2RSsU5eeSS+Q== +"@lerna/prerelease-id-from-version@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-3.16.0.tgz#b24bfa789f5e1baab914d7b08baae9b7bd7d83a1" + integrity sha512-qZyeUyrE59uOK8rKdGn7jQz+9uOpAaF/3hbslJVFL1NqF9ELDTqjCPXivuejMX/lN4OgD6BugTO4cR7UTq/sZA== dependencies: - semver "^5.5.0" + semver "^6.2.0" -"@lerna/project@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.15.0.tgz#733b0993a849dcf5b68fcd0ec11d8f7de38a6999" - integrity sha512-eNGUWiMbQ9kh9kGkomtMnsLypS0rfLqxKgZP2+VnNVtIXjnLv4paeTm+1lkL+naNJUwhnpMk2NSLEeoxT/20QA== +"@lerna/project@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.16.0.tgz#2469a4e346e623fd922f38f5a12931dfb8f2a946" + integrity sha512-NrKcKK1EqXqhrGvslz6Q36+ZHuK3zlDhGdghRqnxDcHxMPT01NgLcmsnymmQ+gjMljuLRmvKYYCuHrknzX8VrA== dependencies: - "@lerna/package" "3.14.2" + "@lerna/package" "3.16.0" "@lerna/validation-error" "3.13.0" cosmiconfig "^5.1.0" dedent "^0.7.0" dot-prop "^4.2.0" - glob-parent "^3.1.0" - globby "^8.0.1" - load-json-file "^4.0.0" + glob-parent "^5.0.0" + globby "^9.2.0" + load-json-file "^5.3.0" npmlog "^4.1.2" - p-map "^1.2.0" + p-map "^2.1.0" resolve-from "^4.0.0" - write-json-file "^2.3.0" + write-json-file "^3.2.0" "@lerna/prompt@3.13.0": version "3.13.0" @@ -1480,40 +1483,41 @@ inquirer "^6.2.0" npmlog "^4.1.2" -"@lerna/publish@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.15.0.tgz#54f93f8f0820d2d419d0b65df1eb55d8277090c9" - integrity sha512-6tRRBJ8olLSXfrUsR4f7vSfx0cT1oPi6/v06yI3afDSsUX6eQ3ooZh7gMY4RWmd+nM/IJHTUzhlKF6WhTvo+9g== +"@lerna/publish@3.16.4": + version "3.16.4" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.16.4.tgz#4cd55d8be9943d9a68e316e930a90cda8590500e" + integrity sha512-XZY+gRuF7/v6PDQwl7lvZaGWs8CnX6WIPIu+OCcyFPSL/rdWegdN7HieKBHskgX798qRQc2GrveaY7bNoTKXAw== dependencies: - "@evocateur/libnpmaccess" "^3.1.0" - "@evocateur/npm-registry-fetch" "^3.9.1" - "@evocateur/pacote" "^9.6.0" + "@evocateur/libnpmaccess" "^3.1.2" + "@evocateur/npm-registry-fetch" "^4.0.0" + "@evocateur/pacote" "^9.6.3" "@lerna/check-working-tree" "3.14.2" "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.14.2" - "@lerna/command" "3.15.0" + "@lerna/collect-updates" "3.16.0" + "@lerna/command" "3.16.0" "@lerna/describe-ref" "3.14.2" - "@lerna/log-packed" "3.13.0" - "@lerna/npm-conf" "3.13.0" - "@lerna/npm-dist-tag" "3.15.0" - "@lerna/npm-publish" "3.15.0" + "@lerna/log-packed" "3.16.0" + "@lerna/npm-conf" "3.16.0" + "@lerna/npm-dist-tag" "3.16.0" + "@lerna/npm-publish" "3.16.2" + "@lerna/otplease" "3.16.0" "@lerna/output" "3.13.0" - "@lerna/pack-directory" "3.14.2" - "@lerna/prerelease-id-from-version" "3.14.0" + "@lerna/pack-directory" "3.16.4" + "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/prompt" "3.13.0" "@lerna/pulse-till-done" "3.13.0" - "@lerna/run-lifecycle" "3.14.0" - "@lerna/run-topologically" "3.14.0" + "@lerna/run-lifecycle" "3.16.2" + "@lerna/run-topologically" "3.16.0" "@lerna/validation-error" "3.13.0" - "@lerna/version" "3.15.0" + "@lerna/version" "3.16.4" figgy-pudding "^3.5.1" - fs-extra "^7.0.0" + fs-extra "^8.1.0" npm-package-arg "^6.1.0" npmlog "^4.1.2" p-finally "^1.0.0" - p-map "^1.2.0" + p-map "^2.1.0" p-pipe "^1.2.0" - semver "^5.5.0" + semver "^6.2.0" "@lerna/pulse-till-done@3.13.0": version "3.13.0" @@ -1522,20 +1526,20 @@ dependencies: npmlog "^4.1.2" -"@lerna/query-graph@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.14.0.tgz#2abb36f445bd924d0f85ac7aec1445e9ef1e2c6c" - integrity sha512-6YTh3vDMW2hUxHdKeRvx4bosc9lZClKaN+DzC1XKTkwDbWrsjmEzLcemKL6QnyyeuryN2f/eto7P9iSe3z3pQQ== +"@lerna/query-graph@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.16.0.tgz#e6a46ebcd9d5b03f018a06eca2b471735353953c" + integrity sha512-p0RO+xmHDO95ChJdWkcy9TNLysLkoDARXeRHzY5U54VCwl3Ot/2q8fMCVlA5UeGXDutEyyByl3URqEpcQCWI7Q== dependencies: - "@lerna/package-graph" "3.14.0" + "@lerna/package-graph" "3.16.0" figgy-pudding "^3.5.1" -"@lerna/resolve-symlink@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.13.0.tgz#3e6809ef53b63fe914814bfa071cd68012e22fbb" - integrity sha512-Lc0USSFxwDxUs5JvIisS8JegjA6SHSAWJCMvi2osZx6wVRkEDlWG2B1JAfXUzCMNfHoZX0/XX9iYZ+4JIpjAtg== +"@lerna/resolve-symlink@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-3.16.0.tgz#37fc7095fabdbcf317c26eb74e0d0bde8efd2386" + integrity sha512-Ibj5e7njVHNJ/NOqT4HlEgPFPtPLWsO7iu59AM5bJDcAJcR96mLZ7KGVIsS2tvaO7akMEJvt2P+ErwCdloG3jQ== dependencies: - fs-extra "^7.0.0" + fs-extra "^8.1.0" npmlog "^4.1.2" read-cmd-shim "^1.0.1" @@ -1549,68 +1553,68 @@ path-exists "^3.0.0" rimraf "^2.6.2" -"@lerna/run-lifecycle@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.14.0.tgz#0499eca0e7f393faf4e24e6c8737302a9059c22b" - integrity sha512-GUM3L9MzGRSW0WQ8wbLW1+SYStU1OFjW0GBzShhBnFrO4nGRrU7VchsLpcLu0hk2uCzyhsrDKzifEdOdUyMoEQ== +"@lerna/run-lifecycle@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-3.16.2.tgz#67b288f8ea964db9ea4fb1fbc7715d5bbb0bce00" + integrity sha512-RqFoznE8rDpyyF0rOJy3+KjZCeTkO8y/OB9orPauR7G2xQ7PTdCpgo7EO6ZNdz3Al+k1BydClZz/j78gNCmL2A== dependencies: - "@lerna/npm-conf" "3.13.0" + "@lerna/npm-conf" "3.16.0" figgy-pudding "^3.5.1" - npm-lifecycle "^2.1.1" + npm-lifecycle "^3.1.2" npmlog "^4.1.2" -"@lerna/run-parallel-batches@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.13.0.tgz#0276bb4e7cd0995297db82d134ca2bd08d63e311" - integrity sha512-bICFBR+cYVF1FFW+Tlm0EhWDioTUTM6dOiVziDEGE1UZha1dFkMYqzqdSf4bQzfLS31UW/KBd/2z8jy2OIjEjg== +"@lerna/run-parallel-batches@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.16.0.tgz#5ace7911a2dd31dfd1e53c61356034e27df0e1fb" + integrity sha512-2J/Nyv+MvogmQEfC7VcS21ifk7w0HVvzo2yOZRPvkCzGRu/rducxtB4RTcr58XCZ8h/Bt1aqQYKExu3c/3GXwg== dependencies: - p-map "^1.2.0" + p-map "^2.1.0" p-map-series "^1.0.0" -"@lerna/run-topologically@3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.14.0.tgz#2a560cb657f0ef1565c680b6001b4b01b872dc07" - integrity sha512-y+KBpC1YExFzGynovt9MY4O/bc3RrJaKeuXieiPfKGKxrdtmZe/r33oj/xePTXZq65jnw3SaU3H8S5CrrdkwDg== +"@lerna/run-topologically@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.16.0.tgz#39e29cfc628bbc8e736d8e0d0e984997ac01bbf5" + integrity sha512-4Hlpv4zDtKWa5Z0tPkeu0sK+bxZEKgkNESMGmWrUCNfj7xwvAJurcraK8+a2Y0TFYwf0qjSLY/MzX+ZbJA3Cgw== dependencies: - "@lerna/query-graph" "3.14.0" + "@lerna/query-graph" "3.16.0" figgy-pudding "^3.5.1" p-queue "^4.0.0" -"@lerna/run@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.15.0.tgz#465028b5b561a050bd760924e4a0749de3f43172" - integrity sha512-KQBkzZYoEKmzILKjbjsm1KKVWFBXwAdwzqJWj/lfxxd3V5LRF8STASk8aiw8bSpB0bUL9TU/pbXakRxiNzjDwQ== +"@lerna/run@3.16.0": + version "3.16.0" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.16.0.tgz#1ea568c6f303e47fa00b3403a457836d40738fd2" + integrity sha512-woTeLlB1OAAz4zzjdI6RyIxSGuxiUPHJZm89E1pDEPoWwtQV6HMdMgrsQd9ATsJ5Ez280HH4bF/LStAlqW8Ufg== dependencies: - "@lerna/command" "3.15.0" - "@lerna/filter-options" "3.14.2" + "@lerna/command" "3.16.0" + "@lerna/filter-options" "3.16.0" "@lerna/npm-run-script" "3.14.2" "@lerna/output" "3.13.0" - "@lerna/run-topologically" "3.14.0" + "@lerna/run-topologically" "3.16.0" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" - p-map "^1.2.0" - -"@lerna/symlink-binary@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.14.2.tgz#a832fdc6c4b1e5aaf9e6ac9c7e6c322746965eb0" - integrity sha512-tqMwuWi6z1da0AFFbleWyu3H9fqayiV50rjj4anFTfayel9jSjlA1xPG+56sGIP6zUUNuUSc9kLh7oRRmlauoA== - dependencies: - "@lerna/create-symlink" "3.14.0" - "@lerna/package" "3.14.2" - fs-extra "^7.0.0" - p-map "^1.2.0" - -"@lerna/symlink-dependencies@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.14.2.tgz#e6b2a9544ff26addc1f4324734595e2f71dfc795" - integrity sha512-Ox7WKXnHZ7IwWlejcCq3n0Hd/yMLv8AwIryhvWxM/RauAge+ML4wg578SsdCyKob8ecgm/R0ytHiU06j81iL1w== - dependencies: - "@lerna/create-symlink" "3.14.0" - "@lerna/resolve-symlink" "3.13.0" - "@lerna/symlink-binary" "3.14.2" - fs-extra "^7.0.0" + p-map "^2.1.0" + +"@lerna/symlink-binary@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.16.2.tgz#f98a3d9da9e56f1d302dc0d5c2efeb951483ee66" + integrity sha512-kz9XVoFOGSF83gg4gBqH+mG6uxfJfTp8Uy+Cam40CvMiuzfODrGkjuBEFoM/uO2QOAwZvbQDYOBpKUa9ZxHS1Q== + dependencies: + "@lerna/create-symlink" "3.16.2" + "@lerna/package" "3.16.0" + fs-extra "^8.1.0" + p-map "^2.1.0" + +"@lerna/symlink-dependencies@3.16.2": + version "3.16.2" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.16.2.tgz#91d9909d35897aebd76a03644a00cd03c4128240" + integrity sha512-wnZqGJQ+Jvr1I3inxrkffrFZfmQI7Ta8gySw/UWCy95QtZWF/f5yk8zVIocCAsjzD0wgb3jJE3CFJ9W5iwWk1A== + dependencies: + "@lerna/create-symlink" "3.16.2" + "@lerna/resolve-symlink" "3.16.0" + "@lerna/symlink-binary" "3.16.2" + fs-extra "^8.1.0" p-finally "^1.0.0" - p-map "^1.2.0" + p-map "^2.1.0" p-map-series "^1.0.0" "@lerna/timer@3.13.0": @@ -1625,34 +1629,34 @@ dependencies: npmlog "^4.1.2" -"@lerna/version@3.15.0": - version "3.15.0" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.15.0.tgz#3c65d223d94f211312995266abb07ee6606d5f73" - integrity sha512-vReYX1NMXZ9PwzTZm97wAl/k3bmRnRZhnQi3mq/m49xTnDavq7p4sbUdFpvu8cVZNKnYS02pNIVGHrQw+K8ZCw== +"@lerna/version@3.16.4": + version "3.16.4" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.16.4.tgz#b5cc37f3ad98358d599c6196c30b6efc396d42bf" + integrity sha512-ikhbMeIn5ljCtWTlHDzO4YvTmpGTX1lWFFIZ79Vd1TNyOr+OUuKLo/+p06mCl2WEdZu0W2s5E9oxfAAQbyDxEg== dependencies: "@lerna/check-working-tree" "3.14.2" "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.14.2" - "@lerna/command" "3.15.0" - "@lerna/conventional-commits" "3.14.0" - "@lerna/github-client" "3.14.2" + "@lerna/collect-updates" "3.16.0" + "@lerna/command" "3.16.0" + "@lerna/conventional-commits" "3.16.4" + "@lerna/github-client" "3.16.0" "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" - "@lerna/prerelease-id-from-version" "3.14.0" + "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/prompt" "3.13.0" - "@lerna/run-lifecycle" "3.14.0" - "@lerna/run-topologically" "3.14.0" + "@lerna/run-lifecycle" "3.16.2" + "@lerna/run-topologically" "3.16.0" "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" minimatch "^3.0.4" npmlog "^4.1.2" - p-map "^1.2.0" + p-map "^2.1.0" p-pipe "^1.2.0" p-reduce "^1.0.0" p-waterfall "^1.0.0" - semver "^5.5.0" - slash "^1.0.0" + semver "^6.2.0" + slash "^2.0.0" temp-write "^3.4.0" "@lerna/write-log-file@3.13.0": @@ -1677,19 +1681,17 @@ integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== "@octokit/endpoint@^5.1.0": - version "5.2.2" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.2.2.tgz#8fbb2e99ae0d8e6b30099f73063801e64467e761" - integrity sha512-VhKxM4CQanIUZDffExqpdpgqu3heF51qbY1wazoNtvIKXAAVoFjqLq2BOhesXkTqxXMO1Ze1XbS8DkIjUxAB+g== + version "5.3.5" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.5.tgz#2822c3b01107806dbdce3863b6205e3eff4289ed" + integrity sha512-f8KqzIrnzPLiezDsZZPB+K8v8YSv6aKFl7eOu59O46lmlW4HagWl1U6NWl6LmT8d1w7NsKBI3paVtzcnRGO1gw== dependencies: - deepmerge "4.0.0" is-plain-object "^3.0.0" - universal-user-agent "^3.0.0" - url-template "^2.0.8" + universal-user-agent "^4.0.0" -"@octokit/plugin-enterprise-rest@^2.1.1": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-2.2.2.tgz#c0e22067a043e19f96ff9c7832e2a3019f9be75c" - integrity sha512-CTZr64jZYhGWNTDGlSJ2mvIlFsm9OEO3LqWn9I/gmoHI4jRBp4kpHoFYNemG4oA75zUAcmbuWblb7jjP877YZw== +"@octokit/plugin-enterprise-rest@^3.6.1": + version "3.6.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-3.6.2.tgz#74de25bef21e0182b4fa03a8678cd00a4e67e561" + integrity sha512-3wF5eueS5OHQYuAEudkpN+xVeUsg8vYEMMenEzLphUZ7PRZ8OJtDcsreL3ad9zxXmBbaFWzLmFcdob5CLyZftA== "@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2": version "1.0.4" @@ -1700,9 +1702,9 @@ once "^1.4.0" "@octokit/request@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.0.1.tgz#6705c9a883db0ac0f58cee717e806b6575d4a199" - integrity sha512-SHOk/APYpfrzV1RNf7Ux8SZi+vZXhMIB2dBr4TQR6ExMX8R4jcy/0gHw26HLe1dWV7Wxe9WzYyDSEC0XwnoCSQ== + version "5.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.1.0.tgz#5609dcc7b5323e529f29d535214383d9eaf0c05c" + integrity sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg== dependencies: "@octokit/endpoint" "^5.1.0" "@octokit/request-error" "^1.0.1" @@ -1710,12 +1712,12 @@ is-plain-object "^3.0.0" node-fetch "^2.3.0" once "^1.4.0" - universal-user-agent "^3.0.0" + universal-user-agent "^4.0.0" -"@octokit/rest@^16.16.0": - version "16.28.4" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.4.tgz#2f8ef08305033bc91256530d6a3c98eada700660" - integrity sha512-ZBsfD46t3VNkwealxm5zloVgQta8d8o4KYBR/hMAZ582IgjmSDKZdkjyv5w37IUCM3tcPZWKUT+kml9pEIC2GA== +"@octokit/rest@^16.28.4": + version "16.28.9" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.9.tgz#ac8c5f3ff305e9e0a0989a5245e4286f057a95d7" + integrity sha512-IKGnX+Tvzt7XHhs8f4ajqxyJvYAMNX5nWfoJm4CQj8LZToMiaJgutf5KxxpxoC3y5w7JTJpW5rnWnF4TsIvCLA== dependencies: "@octokit/request" "^5.0.0" "@octokit/request-error" "^1.0.2" @@ -1728,8 +1730,7 @@ lodash.uniq "^4.5.0" octokit-pagination-methods "^1.1.0" once "^1.4.0" - universal-user-agent "^3.0.0" - url-template "^2.0.8" + universal-user-agent "^4.0.0" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" @@ -1916,6 +1917,15 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== +"@zkochan/cmd-shim@^3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@zkochan/cmd-shim/-/cmd-shim-3.1.0.tgz#2ab8ed81f5bb5452a85f25758eb9b8681982fd2e" + integrity sha512-o8l0+x7C7sMZU3v9GuJIAU10qQLtwR1dtRQIOmlNMtyaqhmpXOzx1HWiYoWfmmf9HHZoAkXpc9TM9PQYF9d4Jg== + dependencies: + is-windows "^1.0.0" + mkdirp-promise "^5.0.1" + mz "^2.5.0" + JSONStream@^1.0.3, JSONStream@^1.0.4, JSONStream@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -2109,6 +2119,11 @@ any-observable@^0.3.0: resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha1-q8av7tzqUugJzcA3au0845Y10X8= + anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" @@ -2216,6 +2231,11 @@ array-differ@^1.0.0: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= +array-differ@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1" + integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w== + array-each@^1.0.0, array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" @@ -2293,7 +2313,7 @@ array-sort@^1.0.0: get-value "^2.0.6" kind-of "^5.0.2" -array-union@^1.0.1: +array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= @@ -2559,7 +2579,7 @@ binary-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== -bluebird@^3.5.1, bluebird@^3.5.5: +bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.5.5" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== @@ -2861,21 +2881,22 @@ byline@^5.0.0: resolved "https://registry.yarnpkg.com/byline/-/byline-5.0.0.tgz#741c5216468eadc457b03410118ad77de8c1ddb1" integrity sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE= -byte-size@^4.0.3: - version "4.0.4" - resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-4.0.4.tgz#29d381709f41aae0d89c631f1c81aec88cd40b23" - integrity sha512-82RPeneC6nqCdSwCX2hZUz3JPOvN5at/nTEw/CMf05Smu3Hrpo9Psb7LjN+k+XndNArG1EY8L4+BM3aTM4BCvw== +byte-size@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/byte-size/-/byte-size-5.0.1.tgz#4b651039a5ecd96767e71a3d7ed380e48bed4191" + integrity sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw== -cacache@^11.3.3: - version "11.3.3" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-11.3.3.tgz#8bd29df8c6a718a6ebd2d010da4d7972ae3bbadc" - integrity sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA== +cacache@^12.0.0, cacache@^12.0.3: + version "12.0.3" + resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.3.tgz#be99abba4e1bf5df461cd5a2c1071fc432573390" + integrity sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw== dependencies: bluebird "^3.5.5" chownr "^1.1.1" figgy-pudding "^3.5.1" glob "^7.1.4" graceful-fs "^4.1.15" + infer-owner "^1.0.3" lru-cache "^5.1.1" mississippi "^3.0.0" mkdirp "^0.5.1" @@ -3071,16 +3092,11 @@ chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: optionalDependencies: fsevents "^1.2.7" -chownr@^1.1.1: +chownr@^1.1.1, chownr@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== -ci-info@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" - integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== - ci-info@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" @@ -3192,14 +3208,6 @@ cloneable-readable@^1.0.0: process-nextick-args "^2.0.0" readable-stream "^2.3.5" -cmd-shim@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-2.0.2.tgz#6fcbda99483a8fd15d7d30a196ca69d688a2efdb" - integrity sha1-b8vamUg6j9FdfTChlspp1oii79s= - dependencies: - graceful-fs "^4.1.2" - mkdirp "~0.5.0" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -3376,17 +3384,17 @@ conventional-changelog-angular@^5.0.3: q "^1.5.1" conventional-changelog-core@^3.1.6: - version "3.2.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz#de41e6b4a71011a18bcee58e744f6f8f0e7c29c0" - integrity sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g== + version "3.2.3" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz#b31410856f431c847086a7dcb4d2ca184a7d88fb" + integrity sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ== dependencies: - conventional-changelog-writer "^4.0.5" - conventional-commits-parser "^3.0.2" + conventional-changelog-writer "^4.0.6" + conventional-commits-parser "^3.0.3" dateformat "^3.0.0" get-pkg-repo "^1.0.0" git-raw-commits "2.0.0" git-remote-origin-url "^2.0.0" - git-semver-tags "^2.0.2" + git-semver-tags "^2.0.3" lodash "^4.2.1" normalize-package-data "^2.3.5" q "^1.5.1" @@ -3395,19 +3403,19 @@ conventional-changelog-core@^3.1.6: through2 "^3.0.0" conventional-changelog-preset-loader@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4" - integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA== + version "2.2.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz#571e2b3d7b53d65587bea9eedf6e37faa5db4fcc" + integrity sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ== -conventional-changelog-writer@^4.0.5: - version "4.0.6" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148" - integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag== +conventional-changelog-writer@^4.0.6: + version "4.0.7" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz#e4b7d9cbea902394ad671f67108a71fa90c7095f" + integrity sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" dateformat "^3.0.0" - handlebars "^4.1.0" + handlebars "^4.1.2" json-stringify-safe "^5.0.1" lodash "^4.2.1" meow "^4.0.0" @@ -3423,7 +3431,7 @@ conventional-commits-filter@^2.0.2: lodash.ismatch "^4.4.0" modify-values "^1.0.0" -conventional-commits-parser@^3.0.2: +conventional-commits-parser@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== @@ -3436,17 +3444,17 @@ conventional-commits-parser@^3.0.2: through2 "^3.0.0" trim-off-newlines "^1.0.0" -conventional-recommended-bump@^4.0.4: - version "4.1.1" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-4.1.1.tgz#37014fadeda267d0607e2fc81124da840a585127" - integrity sha512-JT2vKfSP9kR18RXXf55BRY1O3AHG8FPg5btP3l7LYfcWJsiXI6MCf30DepQ98E8Qhowvgv7a8iev0J1bEDkTFA== +conventional-recommended-bump@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-5.0.1.tgz#5af63903947b6e089e77767601cb592cabb106ba" + integrity sha512-RVdt0elRcCxL90IrNP0fYCpq1uGt2MALko0eyeQ+zQuDVWtMGAy9ng6yYn3kax42lCj9+XBxQ8ZN6S9bdKxDhQ== dependencies: concat-stream "^2.0.0" conventional-changelog-preset-loader "^2.1.1" conventional-commits-filter "^2.0.2" - conventional-commits-parser "^3.0.2" + conventional-commits-parser "^3.0.3" git-raw-commits "2.0.0" - git-semver-tags "^2.0.2" + git-semver-tags "^2.0.3" meow "^4.0.0" q "^1.5.1" @@ -3623,10 +3631,10 @@ currently-unhandled@^0.4.1: dependencies: array-find-index "^1.0.1" -cyclist@~0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640" - integrity sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA= +cyclist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" + integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= d@1: version "1.0.1" @@ -3745,11 +3753,6 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.0.0.tgz#3e3110ca29205f120d7cb064960a39c3d2087c09" - integrity sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww== - default-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" @@ -3911,12 +3914,11 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -dir-glob@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" - integrity sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag== +dir-glob@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" + integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== dependencies: - arrify "^1.0.1" path-type "^3.0.0" doctrine@1.5.0: @@ -4106,6 +4108,11 @@ entities@^1.1.1, entities@~1.1.1: resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== +env-paths@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" + integrity sha1-QWgTO0K7BcOKNbGuQ5fIKYqzaeA= + err-code@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" @@ -4125,7 +4132,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: +es-abstract@^1.4.3, es-abstract@^1.7.0: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== @@ -4137,6 +4144,22 @@ es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: is-regex "^1.0.4" object-keys "^1.0.12" +es-abstract@^1.5.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.1.tgz#6e8d84b445ec9c610781e74a6d52cc31aac5b4ca" + integrity sha512-cp/Tb1oA/rh2X7vqeSOvM+TSo3UkJLX70eNihgVEvnzwAgikjkTFr/QVgRCaxjm0knCNQzNoxxxcw2zO2LJdZA== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.0" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-inspect "^1.6.0" + object-keys "^1.1.1" + string.prototype.trimleft "^2.0.0" + string.prototype.trimright "^2.0.0" + es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -4656,7 +4679,7 @@ fast-diff@^1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== -fast-glob@^2.0.2: +fast-glob@^2.2.6: version "2.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== @@ -4917,12 +4940,12 @@ from2@^2.1.0: inherits "^2.0.1" readable-stream "^2.0.0" -fs-extra@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" - integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== dependencies: - graceful-fs "^4.1.2" + graceful-fs "^4.2.0" jsonfile "^4.0.0" universalify "^0.1.0" @@ -5024,10 +5047,10 @@ get-pkg-repo@^1.0.0: parse-github-repo-url "^1.3.0" through2 "^2.0.0" -get-port@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" - integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= +get-port@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-4.2.0.tgz#e37368b1e863b7629c43c5a323625f95cf24b119" + integrity sha512-/b3jarXkH8KJoOMQc3uVGHASwGLPq3gSFJ7tgJm2diza+bydJPTGOibin2steecKeOylE8oY2JERlVWkAJO6yw== get-stdin@^4.0.1: version "4.0.1" @@ -5089,13 +5112,13 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3" - integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w== +git-semver-tags@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34" + integrity sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA== dependencies: meow "^4.0.0" - semver "^5.5.0" + semver "^6.0.0" git-up@^4.0.0: version "4.0.1" @@ -5142,6 +5165,13 @@ glob-parent@^3.0.1, glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + glob-stream@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-6.1.0.tgz#7045c99413b3eb94888d83ab46d0b404cc7bdde4" @@ -5223,18 +5253,19 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^8.0.1: - version "8.0.2" - resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" - integrity sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w== +globby@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" + integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== dependencies: - array-union "^1.0.1" - dir-glob "2.0.0" - fast-glob "^2.0.2" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" + "@types/glob" "^7.1.1" + array-union "^1.0.2" + dir-glob "^2.2.2" + fast-glob "^2.2.6" + glob "^7.1.3" + ignore "^4.0.3" + pify "^4.0.1" + slash "^2.0.0" glogg@^1.0.0: version "1.0.2" @@ -5243,11 +5274,16 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: +graceful-fs@^4.0.0, graceful-fs@^4.1.15, graceful-fs@^4.1.9: version "4.2.0" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" + integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== + growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" @@ -5371,7 +5407,7 @@ gulplog@^1.0.0: dependencies: glogg "^1.0.0" -handlebars@^4.1.0, handlebars@^4.1.2: +handlebars@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== @@ -5504,10 +5540,10 @@ homedir-polyfill@^1.0.1: dependencies: parse-passwd "^1.0.0" -hosted-git-info@^2.1.4, hosted-git-info@^2.6.0: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== +hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: + version "2.8.4" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" + integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== html-encoding-sniffer@^1.0.2: version "1.0.2" @@ -5639,12 +5675,7 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.3.5: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== - -ignore@^4.0.6: +ignore@^4.0.3, ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== @@ -5665,14 +5696,6 @@ import-fresh@^3.0.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-local@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" - integrity sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ== - dependencies: - pkg-dir "^2.0.0" - resolve-cwd "^2.0.0" - import-local@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -5698,6 +5721,11 @@ indent-string@^3.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +infer-owner@^1.0.3, infer-owner@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" + integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -5754,7 +5782,26 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@^6.2.0, inquirer@^6.2.2: +inquirer@^6.2.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +inquirer@^6.2.2: version "6.5.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== @@ -5860,13 +5907,6 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -5993,7 +6033,7 @@ is-glob@^3.1.0: dependencies: is-extglob "^2.1.0" -is-glob@^4.0.0: +is-glob@^4.0.0, is-glob@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== @@ -6171,7 +6211,7 @@ is-valid-glob@^1.0.0: resolved "https://registry.yarnpkg.com/is-valid-glob/-/is-valid-glob-1.0.0.tgz#29bf3eff701be2d4d315dbacc39bc39fe8f601aa" integrity sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao= -is-windows@^1.0.1, is-windows@^1.0.2: +is-windows@^1.0.0, is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== @@ -6881,27 +6921,27 @@ lerna-changelog@^0.5.0: string.prototype.padend "^3.0.0" yargs "^6.6.0" -lerna@^3.14.2: - version "3.15.0" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.15.0.tgz#b044dba8138d7a1a8dd48ac1d80e7541bdde0d1f" - integrity sha512-kRIQ3bgzkmew5/WZQ0C9WjH0IUf3ZmTNnBwTHfXgLkVY7td0lbwMQFD7zehflUn0zG4ou54o/gn+IfjF0ti/5A== +lerna@^3.16.0: + version "3.16.4" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.16.4.tgz#158cb4f478b680f46f871d5891f531f3a2cb31ec" + integrity sha512-0HfwXIkqe72lBLZcNO9NMRfylh5Ng1l8tETgYQ260ZdHRbPuaLKE3Wqnd2YYRRkWfwPyEyZO8mZweBR+slVe1A== dependencies: - "@lerna/add" "3.15.0" - "@lerna/bootstrap" "3.15.0" - "@lerna/changed" "3.15.0" - "@lerna/clean" "3.15.0" + "@lerna/add" "3.16.2" + "@lerna/bootstrap" "3.16.2" + "@lerna/changed" "3.16.4" + "@lerna/clean" "3.16.0" "@lerna/cli" "3.13.0" - "@lerna/create" "3.15.0" - "@lerna/diff" "3.15.0" - "@lerna/exec" "3.15.0" - "@lerna/import" "3.15.0" - "@lerna/init" "3.15.0" - "@lerna/link" "3.15.0" - "@lerna/list" "3.15.0" - "@lerna/publish" "3.15.0" - "@lerna/run" "3.15.0" - "@lerna/version" "3.15.0" - import-local "^1.0.0" + "@lerna/create" "3.16.0" + "@lerna/diff" "3.16.0" + "@lerna/exec" "3.16.0" + "@lerna/import" "3.16.0" + "@lerna/init" "3.16.0" + "@lerna/link" "3.16.2" + "@lerna/list" "3.16.0" + "@lerna/publish" "3.16.4" + "@lerna/run" "3.16.0" + "@lerna/version" "3.16.4" + import-local "^2.0.0" npmlog "^4.1.2" leven@^2.1.0: @@ -7030,6 +7070,17 @@ load-json-file@^4.0.0: pify "^3.0.0" strip-bom "^3.0.0" +load-json-file@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-5.3.0.tgz#4d3c1e01fa1c03ea78a60ac7af932c9ce53403f3" + integrity sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw== + dependencies: + graceful-fs "^4.1.15" + parse-json "^4.0.0" + pify "^4.0.1" + strip-bom "^3.0.0" + type-fest "^0.3.0" + loader-runner@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" @@ -7112,7 +7163,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash.template@^4.0.2: +lodash.template@^4.0.2, lodash.template@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.5.0.tgz#f976195cf3f347d0d5f52483569fe8031ccce8ab" integrity sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A== @@ -7132,11 +7183,16 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1: +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4: version "4.17.14" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== +lodash@^4.17.12, lodash@^4.2.1: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" @@ -7239,13 +7295,13 @@ make-error@^1.2.0: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== -make-fetch-happen@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-4.0.2.tgz#2d156b11696fb32bffbafe1ac1bc085dd6c78a79" - integrity sha512-YMJrAjHSb/BordlsDEcVcPyTbiJKkzqMf48N8dAJZT9Zjctrkb6Yg4TY9Sq2AwSIQJFn5qBBKVTYt3vP5FMIHA== +make-fetch-happen@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz#a8e3fe41d3415dd656fe7b8e8172e1fb4458b38d" + integrity sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA== dependencies: agentkeepalive "^3.4.1" - cacache "^11.3.3" + cacache "^12.0.0" http-cache-semantics "^3.8.1" http-proxy-agent "^2.1.0" https-proxy-agent "^2.2.1" @@ -7391,9 +7447,9 @@ merge-stream@^2.0.0: integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" - integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + version "1.2.4" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.4.tgz#c9269589e6885a60cf80605d9522d4b67ca646e3" + integrity sha512-FYE8xI+6pjFOhokZu0We3S5NKCirLbCzSh2Usf3qEyr4X8U+0jNg9P8RZ4qz+V2UoECLVwSyzU3LxXBaLGtD3A== micromatch@^2.1.5: version "2.3.11" @@ -7512,9 +7568,9 @@ minimist@~0.0.1: integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= minipass@^2.2.1, minipass@^2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" - integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + version "2.5.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.5.0.tgz#dddb1d001976978158a05badfcbef4a771612857" + integrity sha512-9FwMVYhn6ERvMR8XFdOavRz4QK/VJV8elU1x50vYexf9lslDcWe/f4HBRxCPd185ekRSjU6CfYyJCECa/CQy7Q== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" @@ -7550,7 +7606,14 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp-promise@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mkdirp-promise/-/mkdirp-promise-5.0.1.tgz#e9b8f68e552c68a9c1713b84883f7a1dd039b8a1" + integrity sha1-6bj2jlUsaKnBcTuEiD96HdA5uKE= + dependencies: + mkdirp "*" + +mkdirp@*, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -7605,7 +7668,7 @@ ms@^2.0.0, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -multimatch@^2.0.0, multimatch@^2.1.0: +multimatch@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" integrity sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis= @@ -7615,6 +7678,16 @@ multimatch@^2.0.0, multimatch@^2.1.0: arrify "^1.0.0" minimatch "^3.0.0" +multimatch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-3.0.0.tgz#0e2534cc6bc238d9ab67e1b9cd5fcd85a6dbf70b" + integrity sha512-22foS/gqQfANZ3o+W7ST2x25ueHDVNWl/b9OlGcLpy/iKxjCpvcNCM51YCenUi7Mt/jAjjqv8JwZRs8YP5sRjA== + dependencies: + array-differ "^2.0.3" + array-union "^1.0.2" + arrify "^1.0.1" + minimatch "^3.0.4" + mute-stdout@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" @@ -7630,6 +7703,15 @@ mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mz@^2.5.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + nan@^2.12.1: version "2.14.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" @@ -7710,17 +7792,17 @@ node-fetch@^2.3.0, node-fetch@^2.5.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-gyp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-4.0.0.tgz#972654af4e5dd0cd2a19081b4b46fe0442ba6f45" - integrity sha512-2XiryJ8sICNo6ej8d0idXDEMKfVfFK7kekGCtJAuelGsYHQxhj13KTf95swTCN2dZ/4lTfZ84Fu31jqJEEgjWA== +node-gyp@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.0.3.tgz#80d64c23790244991b6d44532f0a351bedd3dd45" + integrity sha512-z/JdtkFGUm0QaQUusvloyYuGDub3nUbOo5de1Fz57cM++osBTvQatBUSTlF1k/w8vFHPxxXW6zxGvkxXSpaBkQ== dependencies: + env-paths "^1.0.0" glob "^7.0.3" graceful-fs "^4.1.2" mkdirp "^0.5.0" nopt "2 || 3" npmlog "0 || 1 || 2 || 3 || 4" - osenv "0" request "^2.87.0" rimraf "2" semver "~5.3.0" @@ -7854,14 +7936,14 @@ npm-bundled@^1.0.1: resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== -npm-lifecycle@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-2.1.1.tgz#0027c09646f0fd346c5c93377bdaba59c6748fdf" - integrity sha512-+Vg6I60Z75V/09pdcH5iUo/99Q/vop35PaI99elvxk56azSVVsdsSsS/sXqKDNwbRRNN1qSxkcO45ZOu0yOWew== +npm-lifecycle@^3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.3.tgz#09e9b0b6686e85fd53bab82364386222d97a3730" + integrity sha512-M0QmmqbEHBXxDrmc6X3+eKjW9+F7Edg1ENau92WkYw1sox6wojHzEZJIRm1ItljEiaigZlKL8mXni/4ylAy1Dg== dependencies: byline "^5.0.0" graceful-fs "^4.1.15" - node-gyp "^4.0.0" + node-gyp "^5.0.2" resolve-from "^4.0.0" slide "^1.1.6" uid-number "0.0.6" @@ -7869,16 +7951,16 @@ npm-lifecycle@^2.1.1: which "^1.3.1" "npm-package-arg@^4.0.0 || ^5.0.0 || ^6.0.0", npm-package-arg@^6.0.0, npm-package-arg@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.0.tgz#15ae1e2758a5027efb4c250554b85a737db7fcc1" - integrity sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA== + version "6.1.1" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-6.1.1.tgz#02168cb0a49a2b75bf988a28698de7b529df5cb7" + integrity sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg== dependencies: - hosted-git-info "^2.6.0" + hosted-git-info "^2.7.1" osenv "^0.1.5" - semver "^5.5.0" + semver "^5.6.0" validate-npm-package-name "^3.0.0" -npm-packlist@^1.1.6, npm-packlist@^1.4.1, npm-packlist@^1.4.4: +npm-packlist@^1.1.6, npm-packlist@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== @@ -7886,10 +7968,10 @@ npm-packlist@^1.1.6, npm-packlist@^1.4.1, npm-packlist@^1.4.4: ignore-walk "^3.0.1" npm-bundled "^1.0.1" -npm-pick-manifest@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz#32111d2a9562638bb2c8f2bf27f7f3092c8fae40" - integrity sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA== +npm-pick-manifest@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz#f4d9e5fd4be2153e5f4e5f9b7be8dc419a99abb7" + integrity sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw== dependencies: figgy-pudding "^3.5.1" npm-package-arg "^6.0.0" @@ -7955,7 +8037,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6: +object-inspect@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -8119,7 +8206,7 @@ os-locale@^3.0.0: lcid "^2.0.0" mem "^4.0.0" -os-name@^3.0.0: +os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" integrity sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg== @@ -8132,7 +8219,7 @@ os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -osenv@0, osenv@^0.1.4, osenv@^0.1.5: +osenv@^0.1.4, osenv@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== @@ -8183,7 +8270,14 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0, p-limit@^2.2.0: +p-limit@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" + integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== + dependencies: + p-try "^2.0.0" + +p-limit@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== @@ -8218,12 +8312,12 @@ p-map-series@^1.0.0: dependencies: p-reduce "^1.0.0" -p-map@^1.1.1, p-map@^1.2.0: +p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== -p-map@^2.0.0: +p-map@^2.0.0, p-map@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== @@ -8268,11 +8362,11 @@ pako@~1.0.5: integrity sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw== parallel-transform@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.1.0.tgz#d410f065b05da23081fcd10f28854c29bda33b06" - integrity sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY= + version "1.2.0" + resolved "https://registry.yarnpkg.com/parallel-transform/-/parallel-transform-1.2.0.tgz#9049ca37d6cb2182c3b1d2c720be94d14a5814fc" + integrity sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg== dependencies: - cyclist "~0.2.2" + cyclist "^1.0.1" inherits "^2.0.3" readable-stream "^2.1.5" @@ -8726,7 +8820,12 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24, psl@^1.1.28: +psl@^1.1.24: + version "1.3.1" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.3.1.tgz#d5aa3873a35ec450bc7db9012ad5a7246f6fc8bd" + integrity sha512-2KLd5fKOdAfShtY2d/8XDWVRnmp3zp40Qt6ge2zBPFARLXOGUf2fHD5eg+TV/5oxBtQKVhjUaKFsAaE4HnwfSA== + +psl@^1.1.28: version "1.2.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== @@ -8848,9 +8947,9 @@ react-is@^16.8.4: integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== read-cmd-shim@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz#2d5d157786a37c055d22077c32c53f8329e91c7b" - integrity sha1-LV0Vd4ajfAVdIgd8MsU/gynpHHs= + version "1.0.4" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.4.tgz#b4a53d43376211b45243f0072b6e603a8e37640d" + integrity sha512-Pqpl3qJ/QdOIjRYA0q5DND/gLvGOfpIz/fYVDGYpOXfW/lFrIttmLsBnd6IkyK10+JHU9zhsaudfvrQTBB9YFQ== dependencies: graceful-fs "^4.1.2" @@ -8862,9 +8961,9 @@ read-only-stream@^2.0.0: readable-stream "^2.0.2" "read-package-json@1 || 2", read-package-json@^2.0.0, read-package-json@^2.0.13: - version "2.0.13" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.0.13.tgz#2e82ebd9f613baa6d2ebe3aa72cefe3f68e41f4a" - integrity sha512-/1dZ7TRZvGrYqE0UAfN6qQb5GYBsNcqS1C0tNK601CFOJmtHI7NIGXwetEPU/OtoFHZL3hDxm4rolFFVE9Bnmg== + version "2.1.0" + resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-2.1.0.tgz#e3d42e6c35ea5ae820d9a03ab0c7291217fc51d5" + integrity sha512-KLhu8M1ZZNkMcrq1+0UJbR8Dii8KZUqB0Sha4mOx/bknfKI/fyrQVrG/YIt2UOtG667sD8+ee4EXMM91W9dC+A== dependencies: glob "^7.1.1" json-parse-better-errors "^1.0.1" @@ -9284,13 +9383,20 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: version "1.11.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: path-parse "^1.0.6" +resolve@^1.10.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" + integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== + dependencies: + path-parse "^1.0.6" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -9316,7 +9422,14 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +rimraf@2, rimraf@^2.5.4, rimraf@^2.6.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -9398,14 +9511,21 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.3.3, rxjs@^6.4.0: +rxjs@^6.3.3: version "6.5.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: +rxjs@^6.4.0: + version "6.5.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" + integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== + dependencies: + tslib "^1.9.0" + +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -9459,12 +9579,22 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.7.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^5.3.0, semver@^5.6.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -semver@^6.0.0, semver@^6.1.1: +semver@^6.0.0, semver@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^6.1.1: version "6.2.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== @@ -9905,13 +10035,36 @@ string.prototype.padend@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" -string_decoder@^1.0.0, string_decoder@^1.1.1: +string.prototype.trimleft@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.0.0.tgz#68b6aa8e162c6a80e76e3a8a0c2e747186e271ff" + integrity sha1-aLaqjhYsaoDnbjqKDC50cYbicf8= + dependencies: + define-properties "^1.1.2" + function-bind "^1.0.2" + +string.prototype.trimright@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.0.0.tgz#ab4a56d802a01fbe7293e11e84f24dc8164661dd" + integrity sha1-q0pW2AKgH75yk+EehPJNyBZGYd0= + dependencies: + define-properties "^1.1.2" + function-bind "^1.0.2" + +string_decoder@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== dependencies: safe-buffer "~5.1.0" +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -10141,6 +10294,20 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY= + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.0" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" + integrity sha1-5p44obq+lpsBCCB5eLn2K4hgSDk= + dependencies: + any-promise "^1.0.0" + throat@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" @@ -10347,6 +10514,11 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +type-fest@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.3.1.tgz#63d00d204e059474fe5e1b7c011112bbd1dc29e1" + integrity sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ== + type-fest@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" @@ -10508,12 +10680,12 @@ unique-stream@^2.0.2: json-stable-stringify-without-jsonify "^1.0.1" through2-filter "^3.0.0" -universal-user-agent@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-3.0.0.tgz#4cc88d68097bffd7ac42e3b7c903e7481424b4b9" - integrity sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA== +universal-user-agent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16" + integrity sha512-eM8knLpev67iBDizr/YtqkJsF3GK8gzDc6st/WKzrTuPtcsOKW/0IdL4cnMBsU69pOx0otavLWBDGTwg+dB0aA== dependencies: - os-name "^3.0.0" + os-name "^3.1.0" universalify@^0.1.0: version "0.1.2" @@ -10550,11 +10722,6 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url-template@^2.0.8: - version "2.0.8" - resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21" - integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE= - url@^0.11.0, url@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" @@ -10610,9 +10777,9 @@ util@~0.10.1: inherits "2.0.3" uuid@^3.0.1, uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + version "3.3.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" + integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== v8flags@^3.0.1: version "3.1.3" @@ -10958,7 +11125,7 @@ write-file-atomic@2.4.1: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: +write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: version "2.4.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.3.tgz#1fd2e9ae1df3e75b8d8c367443c692d4ca81f481" integrity sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ== @@ -10967,7 +11134,7 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-json-file@^2.2.0, write-json-file@^2.3.0: +write-json-file@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" integrity sha1-K2TIozAE1UuGmMdtWFp3zrYdoy8= @@ -10979,6 +11146,18 @@ write-json-file@^2.2.0, write-json-file@^2.3.0: sort-keys "^2.0.0" write-file-atomic "^2.0.0" +write-json-file@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-3.2.0.tgz#65bbdc9ecd8a1458e15952770ccbadfcff5fe62a" + integrity sha512-3xZqT7Byc2uORAatYiP3DHUUAVEkNOswEWNs9H5KXiicRTvzYzYqKjYc4G7p+8pltvAw641lVByKVtMpf+4sYQ== + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.15" + make-dir "^2.1.0" + pify "^4.0.1" + sort-keys "^2.0.0" + write-file-atomic "^2.4.2" + write-pkg@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/write-pkg/-/write-pkg-3.2.0.tgz#0e178fe97820d389a8928bc79535dbe68c2cff21" From 42e5974fd4dff5338366738cb05dbaf9ff12d38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Sep 2019 19:24:15 +0200 Subject: [PATCH 049/965] Remove old uglify option It's false by default --- packages/babel-polyfill/scripts/build-dist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-polyfill/scripts/build-dist.sh b/packages/babel-polyfill/scripts/build-dist.sh index db5b2bd2ed0a..0128c59321c6 100755 --- a/packages/babel-polyfill/scripts/build-dist.sh +++ b/packages/babel-polyfill/scripts/build-dist.sh @@ -12,6 +12,6 @@ node $BROWSERIFY_CMD lib/index.js \ --plugin derequire/plugin \ >dist/polyfill.js node $UGLIFY_CMD dist/polyfill.js \ - --compress keep_fnames,keep_fargs,warnings=false \ + --compress keep_fnames,keep_fargs \ --mangle keep_fnames \ >dist/polyfill.min.js From cbd5a26e57758e3f748174ff84aa570e8780e85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Sep 2019 19:25:16 +0200 Subject: [PATCH 050/965] v7.6.0 --- lerna.json | 2 +- packages/babel-cli/package.json | 6 ++-- packages/babel-core/package.json | 18 ++++++------ packages/babel-generator/package.json | 8 +++--- .../package.json | 4 +-- packages/babel-helper-fixtures/package.json | 2 +- .../package.json | 8 +++--- packages/babel-helpers/package.json | 8 +++--- packages/babel-node/package.json | 10 +++---- packages/babel-parser/package.json | 4 +-- .../package.json | 6 ++-- .../package.json | 4 +-- .../package.json | 6 ++-- .../package.json | 6 ++-- .../package.json | 4 +-- .../package.json | 4 +-- .../package.json | 6 ++-- .../package.json | 4 +-- .../package.json | 4 +-- .../package.json | 4 +-- .../package.json | 14 +++++----- .../package.json | 6 ++-- packages/babel-polyfill/package.json | 2 +- .../babel-preset-env-standalone/package.json | 8 +++--- packages/babel-preset-env/package.json | 18 ++++++------ packages/babel-preset-typescript/package.json | 6 ++-- packages/babel-register/package.json | 4 +-- packages/babel-runtime-corejs2/package.json | 4 +-- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 4 +-- packages/babel-standalone/package.json | 28 +++++++++---------- packages/babel-template/package.json | 6 ++-- packages/babel-traverse/package.json | 8 +++--- packages/babel-types/package.json | 6 ++-- 34 files changed, 117 insertions(+), 117 deletions(-) diff --git a/lerna.json b/lerna.json index 10d091d9337f..65618bffc087 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.5.5", + "version": "7.6.0", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 9adbc4cdd984..c88110dae32e 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.5.5", + "version": "7.6.0", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -36,8 +36,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5" + "@babel/core": "^7.6.0", + "@babel/helper-fixtures": "^7.6.0" }, "bin": { "babel": "./bin/babel.js", diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 56efb4a95fc5..d6e368cc0d62 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.5.5", + "version": "7.6.0", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,12 +34,12 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", - "@babel/helpers": "^7.5.5", - "@babel/parser": "^7.5.5", - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5", + "@babel/generator": "^7.6.0", + "@babel/helpers": "^7.6.0", + "@babel/parser": "^7.6.0", + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.0", + "@babel/types": "^7.6.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -49,7 +49,7 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.5.5", - "@babel/register": "^7.5.5" + "@babel/helper-transform-fixture-test-runner": "^7.6.0", + "@babel/register": "^7.6.0" } } diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 815171acf262..ccc7eab8cc86 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.5.5", + "version": "7.6.0", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,14 +14,14 @@ "lib" ], "dependencies": { - "@babel/types": "^7.5.5", + "@babel/types": "^7.6.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, "devDependencies": { - "@babel/helper-fixtures": "^7.5.5", - "@babel/parser": "^7.5.5" + "@babel/helper-fixtures": "^7.6.0", + "@babel/parser": "^7.6.0" } } diff --git a/packages/babel-helper-create-class-features-plugin/package.json b/packages/babel-helper-create-class-features-plugin/package.json index a5c46704a7db..3884dece47f5 100644 --- a/packages/babel-helper-create-class-features-plugin/package.json +++ b/packages/babel-helper-create-class-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-class-features-plugin", - "version": "7.5.5", + "version": "7.6.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile class public and private fields, private methods and decorators to ES6", @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index 809a91b81c73..0c102680e135 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-fixtures", - "version": "7.5.5", + "version": "7.6.0", "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index f1e766baff50..7e18f760bd5e 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.5.5", + "version": "7.6.0", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,9 +12,9 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5", - "@babel/polyfill": "^7.4.4", + "@babel/core": "^7.6.0", + "@babel/helper-fixtures": "^7.6.0", + "@babel/polyfill": "^7.6.0", "babel-check-duplicated-nodes": "^1.0.0", "jest": "^24.8.0", "jest-diff": "^24.8.0", diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 54db360349b1..34d842797af1 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.5.5", + "version": "7.6.0", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -11,9 +11,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.4.4", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.0", + "@babel/types": "^7.6.0" }, "devDependencies": { "@babel/helper-plugin-test-runner": "^7.0.0" diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index d613965164c4..f2063d1227b4 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.5.5", + "version": "7.6.0", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -19,8 +19,8 @@ "compiler" ], "dependencies": { - "@babel/polyfill": "^7.0.0", - "@babel/register": "^7.5.5", + "@babel/polyfill": "^7.6.0", + "@babel/register": "^7.6.0", "commander": "^2.8.1", "lodash": "^4.17.13", "node-environment-flags": "^1.0.5", @@ -30,8 +30,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5", + "@babel/core": "^7.6.0", + "@babel/helper-fixtures": "^7.6.0", "fs-readdir-recursive": "^1.0.0", "output-file-sync": "^2.0.0" }, diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 5fa40c1ff68c..f6e87447934d 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.5.5", + "version": "7.6.0", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -29,7 +29,7 @@ }, "devDependencies": { "@babel/code-frame": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5", + "@babel/helper-fixtures": "^7.6.0", "charcodes": "^0.2.0", "unicode-12.0.0": "^0.7.9" }, diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index bc14d4ebea01..6278dff8e544 100644 --- a/packages/babel-plugin-proposal-decorators/package.json +++ b/packages/babel-plugin-proposal-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-decorators", - "version": "7.4.4", + "version": "7.6.0", "author": "Logan Smyth ", "license": "MIT", "publishConfig": { @@ -15,7 +15,7 @@ "decorators" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.4.4", + "@babel/helper-create-class-features-plugin": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-decorators": "^7.2.0" }, @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-do-expressions/package.json b/packages/babel-plugin-proposal-do-expressions/package.json index 8293f38f0326..3e5a41f94936 100644 --- a/packages/babel-plugin-proposal-do-expressions/package.json +++ b/packages/babel-plugin-proposal-do-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-do-expressions", - "version": "7.5.0", + "version": "7.6.0", "description": "Compile do expressions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-do-expressions", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index fb71c57cf9a3..0f1b1586b077 100644 --- a/packages/babel-plugin-proposal-optional-chaining/package.json +++ b/packages/babel-plugin-proposal-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-chaining", - "version": "7.2.0", + "version": "7.6.0", "description": "Transform optional chaining operators into a series of nil checks", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining", "license": "MIT", @@ -19,8 +19,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-transform-block-scoping": "^7.2.0" + "@babel/plugin-transform-block-scoping": "^7.6.0" } } diff --git a/packages/babel-plugin-proposal-private-methods/package.json b/packages/babel-plugin-proposal-private-methods/package.json index cd9cef01e36b..1095dc809d44 100644 --- a/packages/babel-plugin-proposal-private-methods/package.json +++ b/packages/babel-plugin-proposal-private-methods/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-private-methods", - "version": "7.4.4", + "version": "7.6.0", "description": "This plugin transforms private class methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-private-methods", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.4.4", + "@babel/helper-create-class-features-plugin": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index d942568230ab..359b68d14cdf 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.5.5", + "version": "7.6.0", "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-destructuring/package.json b/packages/babel-plugin-transform-destructuring/package.json index fde64105a8bc..5e0b750bd541 100644 --- a/packages/babel-plugin-transform-destructuring/package.json +++ b/packages/babel-plugin-transform-destructuring/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-destructuring", - "version": "7.5.0", + "version": "7.6.0", "description": "Compile ES2015 destructuring to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index 34123bbcc748..8b2e1a0b1c45 100644 --- a/packages/babel-plugin-transform-flow-comments/package.json +++ b/packages/babel-plugin-transform-flow-comments/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-comments", - "version": "7.5.5", + "version": "7.6.0", "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", @@ -12,7 +12,7 @@ "babel-plugin" ], "dependencies": { - "@babel/generator": "^7.5.5", + "@babel/generator": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-flow": "^7.2.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index 00a0df0c6201..e6f010f39412 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.5.0", + "version": "7.6.0", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0" } 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 faf1eb48cd24..3c878b3363e3 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.4.5", + "version": "7.6.0", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.4.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", "core-js-pure": "^3.0.0" } diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index fd4533b2adba..a596b388ba1a 100644 --- a/packages/babel-plugin-transform-react-constant-elements/package.json +++ b/packages/babel-plugin-transform-react-constant-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-constant-elements", - "version": "7.5.0", + "version": "7.6.0", "description": "Treat React JSX elements as value types and hoist them to the highest scope", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index d6881ae6fb63..152b4ff09b98 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.5.5", + "version": "7.6.0", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -21,13 +21,13 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/helpers": "^7.5.5", - "@babel/plugin-transform-runtime": "^7.5.5", - "@babel/preset-env": "^7.5.5", - "@babel/runtime": "^7.5.5", - "@babel/template": "^7.4.4", + "@babel/helpers": "^7.6.0", + "@babel/plugin-transform-runtime": "^7.6.0", + "@babel/preset-env": "^7.6.0", + "@babel/runtime": "^7.6.0", + "@babel/template": "^7.6.0", "@babel/types": "7.0.0-beta.53" } } diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index 7f146e81339b..1ea526e123c4 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.5.5", + "version": "7.6.0", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -13,7 +13,7 @@ "typescript" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.5.5", + "@babel/helper-create-class-features-plugin": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-typescript": "^7.2.0" }, @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index 9fb6d4b92eea..525bcdcf3954 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@babel/polyfill", - "version": "7.4.4", + "version": "7.6.0", "description": "Provides polyfills necessary for a full ES2015+ environment", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 410419bb4d58..b6d5a61b578f 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.5.5", + "version": "7.6.0", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -11,10 +11,10 @@ "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.5.0", "@babel/plugin-proposal-json-strings": "^7.0.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.5.5", - "@babel/standalone": "^7.5.5" + "@babel/preset-env": "^7.6.0", + "@babel/standalone": "^7.6.0" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 0e4230400a87..c9cb0b36027a 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.5.5", + "version": "7.6.0", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -30,10 +30,10 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.5.5", + "@babel/plugin-transform-block-scoping": "^7.6.0", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.5.0", + "@babel/plugin-transform-destructuring": "^7.6.0", "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", @@ -42,10 +42,10 @@ "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.5.0", + "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@babel/plugin-transform-modules-systemjs": "^7.5.0", "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.4.5", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", @@ -58,7 +58,7 @@ "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-unicode-regex": "^7.4.4", - "@babel/types": "^7.5.5", + "@babel/types": "^7.6.0", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", @@ -69,9 +69,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.5.5", - "@babel/core": "^7.5.5", - "@babel/helper-fixtures": "^7.5.5", + "@babel/cli": "^7.6.0", + "@babel/core": "^7.6.0", + "@babel/helper-fixtures": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index b4db8bc25602..fb48e54dc063 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.3.3", + "version": "7.6.0", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -14,13 +14,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.3.2" + "@babel/plugin-transform-typescript": "^7.6.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.3.3", + "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index bc9032c24801..155b7f741709 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.5.5", + "version": "7.6.0", "description": "babel require hook", "license": "MIT", "publishConfig": { @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "default-require-extensions": "^2.0.0" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 5ae56e822e16..a884db635038 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.5.5", + "version": "7.6.0", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { @@ -13,6 +13,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.5.5" + "@babel/helpers": "^7.6.0" } } diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 5a0f640973d6..71c3504694b5 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.5.5", + "version": "7.6.0", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index bb097bddded6..9bd7b6da37dd 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.5.5", + "version": "7.6.0", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { @@ -12,6 +12,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.5.5" + "@babel/helpers": "^7.6.0" } } diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 7d94b31d7a1c..50b3c5796164 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.5.5", + "version": "7.6.0", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -9,13 +9,13 @@ "src" ], "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-decorators": "^7.4.4", - "@babel/plugin-proposal-do-expressions": "^7.5.0", + "@babel/plugin-proposal-decorators": "^7.6.0", + "@babel/plugin-proposal-do-expressions": "^7.6.0", "@babel/plugin-proposal-export-default-from": "^7.5.2", "@babel/plugin-proposal-export-namespace-from": "^7.5.2", "@babel/plugin-proposal-function-bind": "^7.2.0", @@ -26,9 +26,9 @@ "@babel/plugin-proposal-numeric-separator": "^7.2.0", "@babel/plugin-proposal-object-rest-spread": "^7.5.5", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-optional-chaining": "^7.2.0", + "@babel/plugin-proposal-optional-chaining": "^7.6.0", "@babel/plugin-proposal-pipeline-operator": "^7.5.0", - "@babel/plugin-proposal-private-methods": "^7.4.4", + "@babel/plugin-proposal-private-methods": "^7.6.0", "@babel/plugin-proposal-throw-expressions": "^7.2.0", "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", "@babel/plugin-syntax-async-generators": "^7.2.0", @@ -50,14 +50,14 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.5.5", + "@babel/plugin-transform-block-scoping": "^7.6.0", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.5.0", + "@babel/plugin-transform-destructuring": "^7.6.0", "@babel/plugin-transform-dotall-regex": "^7.4.4", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-flow-comments": "^7.5.5", + "@babel/plugin-transform-flow-comments": "^7.6.0", "@babel/plugin-transform-flow-strip-types": "^7.4.4", "@babel/plugin-transform-for-of": "^7.4.4", "@babel/plugin-transform-function-name": "^7.4.4", @@ -66,7 +66,7 @@ "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.5.0", + "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@babel/plugin-transform-modules-systemjs": "^7.5.0", "@babel/plugin-transform-modules-umd": "^7.2.0", "@babel/plugin-transform-new-target": "^7.4.4", @@ -77,7 +77,7 @@ "@babel/plugin-transform-property-literals": "^7.2.0", "@babel/plugin-transform-property-mutators": "^7.2.0", "@babel/plugin-transform-proto-to-assign": "^7.5.5", - "@babel/plugin-transform-react-constant-elements": "^7.5.0", + "@babel/plugin-transform-react-constant-elements": "^7.6.0", "@babel/plugin-transform-react-display-name": "^7.2.0", "@babel/plugin-transform-react-inline-elements": "^7.2.0", "@babel/plugin-transform-react-jsx": "^7.3.0", @@ -86,18 +86,18 @@ "@babel/plugin-transform-react-jsx-source": "^7.5.0", "@babel/plugin-transform-regenerator": "^7.4.5", "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.5.5", + "@babel/plugin-transform-runtime": "^7.6.0", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.2.2", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-strict-mode": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-typescript": "^7.5.5", + "@babel/plugin-transform-typescript": "^7.6.0", "@babel/plugin-transform-unicode-regex": "^7.4.4", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@babel/preset-typescript": "^7.3.3" + "@babel/preset-typescript": "^7.6.0" }, "keywords": [ "babel", diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index 40c19ddee051..5b0bc20c5ed1 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -1,6 +1,6 @@ { "name": "@babel/template", - "version": "7.4.4", + "version": "7.6.0", "description": "Generate an AST from a string template.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" } } diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index ea0fee988408..2e9d009261bc 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.5.5", + "version": "7.6.0", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.5.5", + "@babel/generator": "^7.6.0", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.5.5", - "@babel/types": "^7.5.5", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 66694f3b90f6..8abc33b1d1fa 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.5.5", + "version": "7.6.0", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,7 +14,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.5.5", - "@babel/parser": "^7.5.5" + "@babel/generator": "^7.6.0", + "@babel/parser": "^7.6.0" } } From 7e4f48139c4046a789179f9868e6a7d347e7133e Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Fri, 6 Sep 2019 17:36:19 +0000 Subject: [PATCH 051/965] Add v7.6.0 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce2fc517e3d..174319a16df7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,93 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.6.0 (2019-09-06) + +#### :eyeglasses: Spec Compliance +* `babel-generator`, `babel-parser` + * [#10269](https://github.com/babel/babel/pull/10269) Fix parenthesis for nullish coalescing ([@vivek12345](https://github.com/vivek12345)) +* `babel-helpers`, `babel-plugin-transform-block-scoping`, `babel-traverse` + * [#9498](https://github.com/babel/babel/pull/9498) Fix tdz checks in transform-block-scoping plugin ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :rocket: New Feature +* `babel-core` + * [#10181](https://github.com/babel/babel/pull/10181) feat(errors): validate preset when filename is absent ([@JLHwung](https://github.com/JLHwung)) +* `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-private-methods` + * [#10217](https://github.com/babel/babel/pull/10217) Class Private Static Accessors ([@tim-mc](https://github.com/tim-mc)) +* `babel-generator`, `babel-parser`, `babel-types` + * [#10148](https://github.com/babel/babel/pull/10148) V8intrinsic syntax plugin ([@JLHwung](https://github.com/JLHwung)) +* `babel-preset-typescript` + * [#10382](https://github.com/babel/babel/pull/10382) Allow setting 'allowNamespaces' in typescript preset ([@dsgkirkby](https://github.com/dsgkirkby)) +* `babel-parser` + * [#10352](https://github.com/babel/babel/pull/10352) Do not register ambient classes to the TS scope ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-types` + * [#10248](https://github.com/babel/babel/pull/10248) Add static to class property builder ([@yuri-karadzhov](https://github.com/yuri-karadzhov)) + +#### :bug: Bug Fix +* `babel-helpers`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env` + * [#10396](https://github.com/babel/babel/pull/10396) fix: early return when instance is not iterable ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-transform-runtime` + * [#10398](https://github.com/babel/babel/pull/10398) Add supports for polyfill computed methods ([@rhyzx](https://github.com/rhyzx)) +* `babel-preset-env` + * [#10397](https://github.com/babel/babel/pull/10397) Don't polyfill when evaluation is not confident ([@rhyzx](https://github.com/rhyzx)) + * [#10218](https://github.com/babel/babel/pull/10218) [preset-env] Include / exclude module plugins properly ([@AdamRamberg](https://github.com/AdamRamberg)) + * [#10284](https://github.com/babel/babel/pull/10284) Replace es.string.reverse with es.array.reverse ([@epicfaace](https://github.com/epicfaace)) +* `babel-plugin-transform-named-capturing-groups-regex` + * [#10395](https://github.com/babel/babel/pull/10395) fix: transform name capturing regex once ([@JLHwung](https://github.com/JLHwung)) +* `babel-types` + * [#10098](https://github.com/babel/babel/pull/10098) fix typescript for babel-types ([@tanhauhau](https://github.com/tanhauhau)) + * [#10319](https://github.com/babel/babel/pull/10319) Add a builder definition including name for tsTypeParameter ([@deificx](https://github.com/deificx)) +* `babel-parser` + * [#10380](https://github.com/babel/babel/pull/10380) Refactor trailing comment adjustment ([@banga](https://github.com/banga)) + * [#10369](https://github.com/babel/babel/pull/10369) Retain trailing comments in array expressions ([@banga](https://github.com/banga)) + * [#10292](https://github.com/babel/babel/pull/10292) fix: assign trailing comment to ObjectProperty only when inside an ObjectExpression ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser`, `babel-types` + * [#10366](https://github.com/babel/babel/pull/10366) Don't allow JSXNamespacedName to chain ([@jridgewell](https://github.com/jridgewell)) +* `babel-generator`, `babel-plugin-transform-typescript`, `babel-types` + * [#10341](https://github.com/babel/babel/pull/10341) Add TSBigIntKeyword to @babel/types ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core`, `babel-types` + * [#9960](https://github.com/babel/babel/pull/9960) Do not delete "fake" source map comments from strings ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-transform-flow-comments` + * [#10329](https://github.com/babel/babel/pull/10329) Fix flow comments plugin issues ([@zaygraveyard](https://github.com/zaygraveyard)) +* `babel-helpers`, `babel-plugin-transform-react-constant-elements` + * [#10307](https://github.com/babel/babel/pull/10307) [fix] jsx helper calls order ([@Sinewyk](https://github.com/Sinewyk)) +* `babel-plugin-proposal-decorators` + * [#10302](https://github.com/babel/babel/pull/10302) fix: register inserted class declaration ([@thiagoarrais](https://github.com/thiagoarrais)) +* `babel-plugin-proposal-do-expressions`, `babel-traverse` + * [#10070](https://github.com/babel/babel/pull/10070) Do expressions transform for switch statements ([@tanhauhau](https://github.com/tanhauhau)) + * [#10277](https://github.com/babel/babel/pull/10277) remove finally from completion record in try statement ([@tanhauhau](https://github.com/tanhauhau)) +* `babel-helpers`, `babel-plugin-transform-named-capturing-groups-regex` + * [#10136](https://github.com/babel/babel/pull/10136) fix capturing group for matchAll ([@tanhauhau](https://github.com/tanhauhau)) + +#### :nail_care: Polish +* `babel-plugin-transform-runtime`, `babel-preset-env` + * [#10372](https://github.com/babel/babel/pull/10372) Don't allow instance properties transformation on namespace ([@rhyzx](https://github.com/rhyzx)) + +#### :memo: Documentation +* [#10313](https://github.com/babel/babel/pull/10313) Adds note about two approval policy to PR template ([@thiagoarrais](https://github.com/thiagoarrais)) + +#### :house: Internal +* `babel-register` + * [#9847](https://github.com/babel/babel/pull/9847) Remove core-js dependency from @babel/register ([@coreyfarrell](https://github.com/coreyfarrell)) +* `babel-helper-fixtures`, `babel-helper-transform-fixture-test-runner`, `babel-preset-env` + * [#10401](https://github.com/babel/babel/pull/10401) Use "validateLogs" for preset-env's debug fixtures ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-parser` + * [#10380](https://github.com/babel/babel/pull/10380) Refactor trailing comment adjustment ([@banga](https://github.com/banga)) +* `babel-helper-fixtures`, `babel-helper-transform-fixture-test-runner`, `babel-plugin-proposal-dynamic-import`, `babel-preset-env` + * [#10326](https://github.com/babel/babel/pull/10326) Allow testing logs with `@babel/helper-transform-fixture-test-runner` ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-runtime-corejs2`, `babel-runtime`, `babel-types` + * [#10331](https://github.com/babel/babel/pull/10331) Commit generated code ([@JLHwung](https://github.com/JLHwung)) +* `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-create-class-features-plugin`, `babel-helper-fixtures`, `babel-node`, `babel-parser`, `babel-plugin-proposal-do-expressions`, `babel-plugin-proposal-pipeline-operator`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-standalone`, `babel-template`, `babel-traverse`, `babel-types` + * [#10228](https://github.com/babel/babel/pull/10228) Update dev dependencies and fix linting errors ([@danez](https://github.com/danez)) +* `babel-cli` + * [#10244](https://github.com/babel/babel/pull/10244) added flow to babel cli ([@Letladi](https://github.com/Letladi)) + +#### :running_woman: Performance +* `babel-helpers`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env` + * [#10161](https://github.com/babel/babel/pull/10161) Improves the logic to import objects in helpers ([@ifsnow](https://github.com/ifsnow)) +* `babel-traverse` + * [#10243](https://github.com/babel/babel/pull/10243) perf: always return `void 0` as undefined node ([@JLHwung](https://github.com/JLHwung)) + ## v7.5.5 (2019-07-17) #### :bug: Bug Fix From fc8e14264c91d29348219bd66c9e87882e171b1c Mon Sep 17 00:00:00 2001 From: Dword Date: Fri, 6 Sep 2019 20:32:45 +0200 Subject: [PATCH 052/965] Remove process.exit(1) from babel-node (#9758) Because it breaked graceful shutdown of the sub process. --- packages/babel-node/src/babel-node.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/babel-node/src/babel-node.js b/packages/babel-node/src/babel-node.js index d143e4f756b4..6d6001f96c7e 100755 --- a/packages/babel-node/src/babel-node.js +++ b/packages/babel-node/src/babel-node.js @@ -93,9 +93,6 @@ getV8Flags(function(err, v8Flags) { } }); }); - process.on("SIGINT", () => { - proc.kill("SIGINT"); - process.exit(1); - }); + process.on("SIGINT", () => proc.kill("SIGINT")); } }); From 15b63bc89ea3e5e4814834b575471998247caa3e Mon Sep 17 00:00:00 2001 From: Matt Forster Date: Fri, 6 Sep 2019 12:54:03 -0600 Subject: [PATCH 053/965] fix(types): correct typescript function headers (#10404) Flow maybe types state; > Maybe types accept the provided type as well as null or undefined. So ?number would mean number, null, or undefined. So in this case, explicitly allow the type, null, or undefined in the typescript definition. Fixes #10403 --- packages/babel-types/scripts/generators/flow.js | 2 +- packages/babel-types/scripts/generators/typescript.js | 6 +++--- packages/babel-types/src/validators/isPlaceholderType.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/babel-types/scripts/generators/flow.js b/packages/babel-types/scripts/generators/flow.js index d82ced365c66..f3d8a85233fd 100644 --- a/packages/babel-types/scripts/generators/flow.js +++ b/packages/babel-types/scripts/generators/flow.js @@ -146,7 +146,7 @@ lines.push( `declare function isLet(node: BabelNode): boolean`, `declare function isNode(node: ?Object): boolean`, `declare function isNodesEquivalent(a: any, b: any): boolean`, - `declare function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `declare function isPlaceholderType(placeholderType: string, targetType: string): boolean`, `declare function isReferenced(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, `declare function isScope(node: BabelNode, parent: BabelNode): boolean`, `declare function isSpecifierDefault(specifier: BabelNodeModuleSpecifier): boolean`, diff --git a/packages/babel-types/scripts/generators/typescript.js b/packages/babel-types/scripts/generators/typescript.js index 35696923e1ae..6666a277d37e 100644 --- a/packages/babel-types/scripts/generators/typescript.js +++ b/packages/babel-types/scripts/generators/typescript.js @@ -153,13 +153,13 @@ lines.push( `export function isBlockScoped(node: Node): boolean`, `export function isImmutable(node: Node): boolean`, `export function isLet(node: Node): boolean`, - `export function isNode(node: ?object): boolean`, + `export function isNode(node: object | null | undefined): boolean`, `export function isNodesEquivalent(a: any, b: any): boolean`, - `export function isPlaceholderType(placeholderType: ?string, targetType: string): boolean`, + `export function isPlaceholderType(placeholderType: string, targetType: string): boolean`, `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, `export function isScope(node: Node, parent: Node): boolean`, `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, - `export function isType(nodetype: ?string, targetType: string): boolean`, + `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, `export function isValidES3Identifier(name: string): boolean`, `export function isValidES3Identifier(name: string): boolean`, `export function isValidIdentifier(name: string): boolean`, diff --git a/packages/babel-types/src/validators/isPlaceholderType.js b/packages/babel-types/src/validators/isPlaceholderType.js index fa775b7ed803..fac93b274532 100644 --- a/packages/babel-types/src/validators/isPlaceholderType.js +++ b/packages/babel-types/src/validators/isPlaceholderType.js @@ -5,7 +5,7 @@ import { PLACEHOLDERS_ALIAS } from "../definitions"; * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`. */ export default function isPlaceholderType( - placeholderType: ?string, + placeholderType: string, targetType: string, ): boolean { if (placeholderType === targetType) return true; From 381b066bd0260e4ac3a20b315403267c8f8f96d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Sep 2019 22:50:54 +0200 Subject: [PATCH 054/965] v7.6.1 --- lerna.json | 2 +- packages/babel-node/package.json | 2 +- packages/babel-types/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lerna.json b/lerna.json index 65618bffc087..f85e37844198 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.6.0", + "version": "7.6.1", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index f2063d1227b4..89d7cdb0791a 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.6.0", + "version": "7.6.1", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 8abc33b1d1fa..6b1293a88e9d 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.6.0", + "version": "7.6.1", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From a79fbe62e4bfdf0434466ff70e57ed037399b608 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Fri, 6 Sep 2019 20:55:50 +0000 Subject: [PATCH 055/965] Add v7.6.1 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 174319a16df7..9e3ff912fbc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,14 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.6.1 (2019-09-06) + +#### :bug: Bug Fix +* `babel-types` + * [#10404](https://github.com/babel/babel/pull/10404) fix(types): correct typescript function headers ([@forstermatth](https://github.com/forstermatth)) +* `babel-node` + * [#9758](https://github.com/babel/babel/pull/9758) Remove process.exit(1) from babel-node ([@dword-design](https://github.com/dword-design)) + ## v7.6.0 (2019-09-06) #### :eyeglasses: Spec Compliance From 2096d0cfcbef661e6bceb70a2a5364f702cee1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 8 Sep 2019 22:53:20 +0200 Subject: [PATCH 056/965] Update @babel deps (#10407) * Update @babel deps * Add core-js to transform-named-capturing-groups-regex devDeps * Don't use fixed deps (they were added by yarn) * Lockfile --- package.json | 18 +- .../package.json | 3 +- yarn.lock | 546 ++++++++---------- 3 files changed, 236 insertions(+), 331 deletions(-) diff --git a/package.json b/package.json index 66a62cd801a9..3cdf83c27715 100644 --- a/package.json +++ b/package.json @@ -9,18 +9,18 @@ "test": "make test" }, "devDependencies": { - "@babel/cli": "^7.4.4", - "@babel/core": "^7.4.5", + "@babel/cli": "^7.6.0", + "@babel/core": "^7.6.0", "@babel/eslint-plugin-development": "^1.0.1", - "@babel/plugin-proposal-class-properties": "^7.4.4", - "@babel/plugin-proposal-export-namespace-from": "^7.2.0", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-export-namespace-from": "^7.5.2", "@babel/plugin-proposal-numeric-separator": "^7.2.0", - "@babel/plugin-transform-modules-commonjs": "^7.4.4", - "@babel/plugin-transform-runtime": "^7.4.4", - "@babel/preset-env": "^7.4.5", + "@babel/plugin-transform-modules-commonjs": "^7.6.0", + "@babel/plugin-transform-runtime": "^7.6.0", + "@babel/preset-env": "^7.6.0", "@babel/preset-flow": "^7.0.0", - "@babel/register": "^7.4.4", - "@babel/runtime": "^7.4.5", + "@babel/register": "^7.6.0", + "@babel/runtime": "^7.6.0", "babel-eslint": "^11.0.0-beta.0", "babel-jest": "^24.8.0", "babel-loader": "^8.0.6", 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 3c878b3363e3..257f7e8f8a15 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -22,6 +22,7 @@ "devDependencies": { "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", - "core-js-pure": "^3.0.0" + "core-js-pure": "^3.2.1", + "core-js": "^3.2.1" } } diff --git a/yarn.lock b/yarn.lock index fb273997428e..4baaf3fe85ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,46 +2,46 @@ # yarn lockfile v1 -"@babel/cli@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.5.0.tgz#f403c930692e28ecfa3bf02a9e7562b474f38271" - integrity sha512-qNH55fWbKrEsCwID+Qc/3JDPnsSGpIIiMDbppnR8Z6PxLAqMQCFNqBctkIkBrMH49Nx+qqVTrHRWUR+ho2k+qQ== +"@babel/cli@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.6.0.tgz#1470a04394eaf37862989ea4912adf440fa6ff8d" + integrity sha512-1CTDyGUjQqW3Mz4gfKZ04KGOckyyaNmKneAMlABPS+ZyuxWv3FrVEVz7Ag08kNIztVx8VaJ8YgvYLSNlMKAT5Q== dependencies: commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.1.0" glob "^7.0.0" - lodash "^4.17.11" + lodash "^4.17.13" mkdirp "^0.5.1" output-file-sync "^2.0.0" slash "^2.0.0" source-map "^0.5.0" optionalDependencies: - chokidar "^2.0.4" + chokidar "^2.1.8" -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.4.5": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" - integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" - "@babel/helpers" "^7.5.4" - "@babel/parser" "^7.5.0" - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" +"@babel/core@^7.1.0", "@babel/core@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.0.tgz#9b00f73554edd67bebc86df8303ef678be3d7b48" + integrity sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw== + dependencies: + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.6.0" + "@babel/helpers" "^7.6.0" + "@babel/parser" "^7.6.0" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.0" + "@babel/types" "^7.6.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" - lodash "^4.17.11" + lodash "^4.17.13" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" @@ -51,14 +51,14 @@ resolved "https://registry.yarnpkg.com/@babel/eslint-plugin-development/-/eslint-plugin-development-1.0.1.tgz#1f5206ae95795db09b65e7dbc2b158d66497a44c" integrity sha512-ioEhN8HgKr4Yx8ef+XryNpKN4FimSFceb0qVVxvoUzpFn3xyq17MlY5AquEqtXObE7Nu7WKq7QL9INzjCrugyw== -"@babel/generator@^7.4.0", "@babel/generator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" - integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== +"@babel/generator@^7.4.0", "@babel/generator@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.0.tgz#e2c21efbfd3293ad819a2359b448f002bfdfda56" + integrity sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA== dependencies: - "@babel/types" "^7.5.0" + "@babel/types" "^7.6.0" jsesc "^2.5.1" - lodash "^4.17.11" + lodash "^4.17.13" source-map "^0.5.0" trim-right "^1.0.1" @@ -86,26 +86,26 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz#02edb97f512d44ba23b3227f1bf2ed43454edac5" - integrity sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA== +"@babel/helper-create-class-features-plugin@^7.5.5": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz#769711acca889be371e9bc2eb68641d55218021f" + integrity sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng== dependencies: "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" "@babel/helper-optimise-call-expression" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-replace-supers" "^7.5.5" "@babel/helper-split-export-declaration" "^7.4.4" -"@babel/helper-define-map@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" - integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== +"@babel/helper-define-map@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" + integrity sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg== dependencies: "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.4.4" - lodash "^4.17.11" + "@babel/types" "^7.5.5" + lodash "^4.17.13" "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" @@ -138,12 +138,12 @@ dependencies: "@babel/types" "^7.4.4" -"@babel/helper-member-expression-to-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" - integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== +"@babel/helper-member-expression-to-functions@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" + integrity sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.5.5" "@babel/helper-module-imports@^7.0.0": version "7.0.0" @@ -153,16 +153,16 @@ "@babel/types" "^7.0.0" "@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" - integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz#f84ff8a09038dcbca1fd4355661a500937165b4a" + integrity sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" "@babel/template" "^7.4.4" - "@babel/types" "^7.4.4" - lodash "^4.17.11" + "@babel/types" "^7.5.5" + lodash "^4.17.13" "@babel/helper-optimise-call-expression@^7.0.0": version "7.0.0" @@ -177,11 +177,11 @@ integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== "@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" - integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.5.5.tgz#0aa6824f7100a2e0e89c1527c23936c152cab351" + integrity sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw== dependencies: - lodash "^4.17.11" + lodash "^4.17.13" "@babel/helper-remap-async-to-generator@^7.1.0": version "7.1.0" @@ -194,15 +194,15 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" - integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== +"@babel/helper-replace-supers@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" + integrity sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg== dependencies: - "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-member-expression-to-functions" "^7.5.5" "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/traverse" "^7.5.5" + "@babel/types" "^7.5.5" "@babel/helper-simple-access@^7.1.0": version "7.1.0" @@ -229,14 +229,14 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.2.0" -"@babel/helpers@^7.5.4": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" - integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== +"@babel/helpers@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.0.tgz#21961d16c6a3c3ab597325c34c465c0887d31c6e" + integrity sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ== dependencies: - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" + "@babel/template" "^7.6.0" + "@babel/traverse" "^7.6.0" + "@babel/types" "^7.6.0" "@babel/highlight@^7.0.0": version "7.5.0" @@ -247,10 +247,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" - integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.0.tgz#3e05d0647432a8326cb28d0de03895ae5a57f39b" + integrity sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ== "@babel/plugin-proposal-async-generator-functions@^7.2.0": version "7.2.0" @@ -261,12 +261,12 @@ "@babel/helper-remap-async-to-generator" "^7.1.0" "@babel/plugin-syntax-async-generators" "^7.2.0" -"@babel/plugin-proposal-class-properties@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.0.tgz#5bc6a0537d286fcb4fd4e89975adbca334987007" - integrity sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ== +"@babel/plugin-proposal-class-properties@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" + integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.0" + "@babel/helper-create-class-features-plugin" "^7.5.5" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-dynamic-import@^7.5.0": @@ -277,7 +277,7 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0" -"@babel/plugin-proposal-export-namespace-from@^7.2.0": +"@babel/plugin-proposal-export-namespace-from@^7.5.2": version "7.5.2" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.5.2.tgz#ccd5ed05b06d700688ff1db01a9dd27155e0d2a0" integrity sha512-TKUdOL07anjZEbR1iSxb5WFh810KyObdd29XLFLGo1IDsSuGrjH3ouWSbAxHNmrVKzr9X71UYl2dQ7oGGcRp0g== @@ -301,10 +301,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.5.4": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.4.tgz#250de35d867ce8260a31b1fdac6c4fc1baa99331" - integrity sha512-KCx0z3y7y8ipZUMAEEJOyNi11lMb/FOPUjjB113tfowgw0c16EGYos7worCKBcUAh2oG+OBnoUhsnTSoLpV9uA== +"@babel/plugin-proposal-object-rest-spread@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" + integrity sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -405,25 +405,25 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" - integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== +"@babel/plugin-transform-block-scoping@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.0.tgz#c49e21228c4bbd4068a35667e6d951c75439b1dc" + integrity sha512-tIt4E23+kw6TgL/edACZwP1OUKrjOTyMrFMLoT5IOFrfMRabCgekjqFd5o6PaAMildBu46oFkekIdMuGkkPEpA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.11" + lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" - integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== +"@babel/plugin-transform-classes@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" + integrity sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.4" + "@babel/helper-define-map" "^7.5.5" "@babel/helper-function-name" "^7.1.0" "@babel/helper-optimise-call-expression" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-replace-supers" "^7.5.5" "@babel/helper-split-export-declaration" "^7.4.4" globals "^11.1.0" @@ -434,10 +434,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" - integrity sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ== +"@babel/plugin-transform-destructuring@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" + integrity sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -511,10 +511,10 @@ "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.4.4", "@babel/plugin-transform-modules-commonjs@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" - integrity sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ== +"@babel/plugin-transform-modules-commonjs@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz#39dfe957de4420445f1fcf88b68a2e4aa4515486" + integrity sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g== dependencies: "@babel/helper-module-transforms" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" @@ -538,12 +538,12 @@ "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" - integrity sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.0.tgz#1e6e663097813bb4f53d42df0750cf28ad3bb3f1" + integrity sha512-jem7uytlmrRl3iCAuQyw8BpB4c4LWvSpvIeXKpMb+7j84lkx4m4mYr5ErAcmN5KM7B6BqrAvRGjBIbbzqCczew== dependencies: - regexp-tree "^0.1.6" + regexp-tree "^0.1.13" "@babel/plugin-transform-new-target@^7.4.4": version "7.4.4" @@ -552,13 +552,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" - integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== +"@babel/plugin-transform-object-super@^7.5.5": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" + integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-replace-supers" "^7.5.5" "@babel/plugin-transform-parameters@^7.4.4": version "7.4.4" @@ -590,10 +590,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-runtime@^7.4.4": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.5.0.tgz#45242c2c9281158c5f06d25beebac63e498a284e" - integrity sha512-LmPIZOAgTLl+86gR9KjLXex6P/lRz1fWEjTz6V6QZMmKie51ja3tvzdwORqhHc4RWR8TcZ5pClpRWs0mlaA2ng== +"@babel/plugin-transform-runtime@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.0.tgz#85a3cce402b28586138e368fce20ab3019b9713e" + integrity sha512-Da8tMf7uClzwUm/pnJ1S93m/aRXmoYNDD7TkHua8xBDdaAs54uZpTWvEt6NGwmoVMb9mZbntfTqmG2oSzN/7Vg== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -646,17 +646,17 @@ "@babel/helper-regex" "^7.4.4" regexpu-core "^4.5.4" -"@babel/preset-env@^7.4.5": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.4.tgz#64bc15041a3cbb0798930319917e70fcca57713d" - integrity sha512-hFnFnouyRNiH1rL8YkX1ANCNAUVC8Djwdqfev8i1415tnAG+7hlA5zhZ0Q/3Q5gkop4HioIPbCEWAalqcbxRoQ== +"@babel/preset-env@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.6.0.tgz#aae4141c506100bb2bfaa4ac2a5c12b395619e50" + integrity sha512-1efzxFv/TcPsNXlRhMzRnkBFMeIqBBgzwmZwlFDw5Ubj0AGLeufxugirwZmkkX/ayi3owsSqoQ4fw8LkfK9SYg== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-proposal-async-generator-functions" "^7.2.0" "@babel/plugin-proposal-dynamic-import" "^7.5.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.5.4" + "@babel/plugin-proposal-object-rest-spread" "^7.5.5" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" "@babel/plugin-syntax-async-generators" "^7.2.0" @@ -667,10 +667,10 @@ "@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" - "@babel/plugin-transform-block-scoping" "^7.4.4" - "@babel/plugin-transform-classes" "^7.4.4" + "@babel/plugin-transform-block-scoping" "^7.6.0" + "@babel/plugin-transform-classes" "^7.5.5" "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.5.0" + "@babel/plugin-transform-destructuring" "^7.6.0" "@babel/plugin-transform-dotall-regex" "^7.4.4" "@babel/plugin-transform-duplicate-keys" "^7.5.0" "@babel/plugin-transform-exponentiation-operator" "^7.2.0" @@ -679,12 +679,12 @@ "@babel/plugin-transform-literals" "^7.2.0" "@babel/plugin-transform-member-expression-literals" "^7.2.0" "@babel/plugin-transform-modules-amd" "^7.5.0" - "@babel/plugin-transform-modules-commonjs" "^7.5.0" + "@babel/plugin-transform-modules-commonjs" "^7.6.0" "@babel/plugin-transform-modules-systemjs" "^7.5.0" "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.6.0" "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-object-super" "^7.5.5" "@babel/plugin-transform-parameters" "^7.4.4" "@babel/plugin-transform-property-literals" "^7.2.0" "@babel/plugin-transform-regenerator" "^7.4.5" @@ -695,7 +695,7 @@ "@babel/plugin-transform-template-literals" "^7.4.4" "@babel/plugin-transform-typeof-symbol" "^7.2.0" "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.5.0" + "@babel/types" "^7.6.0" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -710,56 +710,55 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.0.0" -"@babel/register@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.4.4.tgz#370a68ba36f08f015a8b35d4864176c6b65d7a23" - integrity sha512-sn51H88GRa00+ZoMqCVgOphmswG4b7mhf9VOB0LUBAieykq2GnRFerlN+JQkO/ntT7wz4jaHNSRPg9IdMPEUkA== +"@babel/register@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.6.0.tgz#76b6f466714680f4becafd45beeb2a7b87431abf" + integrity sha512-78BomdN8el+x/nkup9KwtjJXuptW5oXMFmP11WoM2VJBjxrKv4grC3qjpLL8RGGUYUGsm57xnjYFM2uom+jWUQ== dependencies: - core-js "^3.0.0" find-cache-dir "^2.0.0" - lodash "^4.17.11" + lodash "^4.17.13" mkdirp "^0.5.1" pirates "^4.0.0" source-map-support "^0.5.9" -"@babel/runtime@^7.4.5": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.4.tgz#cb7d1ad7c6d65676e66b47186577930465b5271b" - integrity sha512-Na84uwyImZZc3FKf4aUF1tysApzwf3p2yuFBIyBfbzT5glzKTdvYI4KVW4kcgjrzoGUjC7w3YyCHcJKaRxsr2Q== +"@babel/runtime@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.0.tgz#4fc1d642a9fd0299754e8b5de62c631cf5568205" + integrity sha512-89eSBLJsxNxOERC0Op4vd+0Bqm6wRMqMbFtV3i0/fbaWw/mJ8Q3eBvgX0G4SyrOOLCtbu98HspF8o09MRT+KzQ== dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" - integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" + integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/parser" "^7.6.0" + "@babel/types" "^7.6.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" - integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.0.tgz#389391d510f79be7ce2ddd6717be66d3fed4b516" + integrity sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" + "@babel/code-frame" "^7.5.5" + "@babel/generator" "^7.6.0" "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.5.0" - "@babel/types" "^7.5.0" + "@babel/parser" "^7.6.0" + "@babel/types" "^7.6.0" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.11" + lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" - integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5", "@babel/types@^7.6.0": + version "7.6.1" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.1.tgz#53abf3308add3ac2a2884d539151c57c4b3ac648" + integrity sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g== dependencies: esutils "^2.0.2" - lodash "^4.17.11" + lodash "^4.17.13" to-fast-properties "^2.0.0" "@cnakazawa/watch@^1.0.3": @@ -2796,14 +2795,14 @@ browserify@^16.2.3: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.6.0, browserslist@^4.6.2: - version "4.6.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" - integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== +browserslist@^4.6.0, browserslist@^4.6.6: + version "4.7.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" + integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== dependencies: - caniuse-lite "^1.0.30000984" - electron-to-chromium "^1.3.191" - node-releases "^1.1.25" + caniuse-lite "^1.0.30000989" + electron-to-chromium "^1.3.247" + node-releases "^1.1.29" bser@^2.0.0: version "2.1.0" @@ -3006,10 +3005,10 @@ camelcase@^5.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000984: - version "1.0.30000984" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz#dc96c3c469e9bcfc6ad5bdd24c77ec918ea76fe0" - integrity sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA== +caniuse-lite@^1.0.30000989: + version "1.0.30000989" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz#b9193e293ccf7e4426c5245134b8f2a56c0ac4b9" + integrity sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw== capture-exit@^2.0.0: version "2.0.0" @@ -3073,10 +3072,10 @@ cheerio@^1.0.0-rc.1: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.0.4: - version "2.1.6" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" - integrity sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g== +chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.1.8: + version "2.1.8" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" + integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== dependencies: anymatch "^2.0.0" async-each "^1.0.1" @@ -3496,23 +3495,12 @@ copy-props@^2.0.1: is-plain-object "^2.0.1" core-js-compat@^3.1.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.4.tgz#e4d0c40fbd01e65b1d457980fe4112d4358a7408" - integrity sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg== + version "3.2.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.2.1.tgz#0cbdbc2e386e8e00d3b85dc81c848effec5b8150" + integrity sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A== dependencies: - browserslist "^4.6.2" - core-js-pure "3.1.4" - semver "^6.1.1" - -core-js-pure@3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.4.tgz#5fa17dc77002a169a3566cc48dc774d2e13e3769" - integrity sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA== - -core-js@^3.0.0: - version "3.1.4" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.1.4.tgz#3a2837fc48e582e1ae25907afcd6cf03b0cc7a07" - integrity sha512-YNZN8lt82XIMLnLirj9MhKDFZHalwzzrL9YLt6eb0T5D0EDl4IQ90IGkua8mHbnxNrkj1d8hbdizMc0Qmg1WnQ== + browserslist "^4.6.6" + semver "^6.3.0" core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" @@ -4046,10 +4034,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.191: - version "1.3.191" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.191.tgz#c451b422cd8b2eab84dedabab5abcae1eaefb6f0" - integrity sha512-jasjtY5RUy/TOyiUYM2fb4BDaPZfm6CXRFeJDMfFsXYADGxUN49RBqtgB7EL2RmJXeIRUk9lM1U6A5yk2YJMPQ== +electron-to-chromium@^1.3.247: + version "1.3.252" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.252.tgz#5b6261965b564a0f4df0f1c86246487897017f52" + integrity sha512-NWJ5TztDnjExFISZHFwpoJjMbLUifsNBnx7u2JI0gCw6SbKyQYYWWtBHasO/jPtHym69F4EZuTpRNGN11MT/jg== elegant-spinner@^1.0.1: version "1.0.1" @@ -4132,19 +4120,7 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3, es-abstract@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-keys "^1.0.12" - -es-abstract@^1.5.1: +es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: version "1.14.1" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.1.tgz#6e8d84b445ec9c610781e74a6d52cc31aac5b4ca" integrity sha512-cp/Tb1oA/rh2X7vqeSOvM+TSo3UkJLX70eNihgVEvnzwAgikjkTFr/QVgRCaxjm0knCNQzNoxxxcw2zO2LJdZA== @@ -4441,9 +4417,9 @@ estree-walker@^0.6.1: integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== event-emitter@~0.3.5: version "0.3.5" @@ -5274,12 +5250,7 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.15, graceful-fs@^4.1.9: - version "4.2.0" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" - integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== - -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== @@ -5669,9 +5640,9 @@ iferr@^0.1.5: integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore-walk@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" - integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + version "3.0.2" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.2.tgz#99d83a246c196ea5c93ef9315ad7b0819c35069b" + integrity sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw== dependencies: minimatch "^3.0.4" @@ -5782,7 +5753,7 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@^6.2.0: +inquirer@^6.2.0, inquirer@^6.2.2: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -5801,25 +5772,6 @@ inquirer@^6.2.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^6.2.2: - version "6.5.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" - integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - insert-module-globals@^7.0.0: version "7.2.0" resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.0.tgz#ec87e5b42728479e327bd5c5c71611ddfb4752ba" @@ -7183,12 +7135,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4: - version "4.17.14" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" - integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== - -lodash@^4.17.12, lodash@^4.2.1: +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -7875,10 +7822,10 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.25: - version "1.1.25" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" - integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== +node-releases@^1.1.29: + version "1.1.29" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.29.tgz#86a57c6587a30ecd6726449e5d293466b0a0bb86" + integrity sha512-R5bDhzh6I+tpi/9i2hrrvGJ3yKPYzlVOORDkXhnZuwi5D3q1I5w4vYy24PJXTcLk9Q0kws9TO77T75bcK8/ysQ== dependencies: semver "^5.3.0" @@ -8270,20 +8217,13 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" -p-limit@^2.0.0: +p-limit@^2.0.0, p-limit@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.1.tgz#aa07a788cc3151c939b5131f63570f0dd2009537" integrity sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg== dependencies: p-try "^2.0.0" -p-limit@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== - dependencies: - p-try "^2.0.0" - p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" @@ -8820,16 +8760,11 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24: +psl@^1.1.24, psl@^1.1.28: version "1.3.1" resolved "https://registry.yarnpkg.com/psl/-/psl-1.3.1.tgz#d5aa3873a35ec450bc7db9012ad5a7246f6fc8bd" integrity sha512-2KLd5fKOdAfShtY2d/8XDWVRnmp3zp40Qt6ge2zBPFARLXOGUf2fHD5eg+TV/5oxBtQKVhjUaKFsAaE4HnwfSA== -psl@^1.1.28: - version "1.2.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6" - integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA== - public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -9148,7 +9083,7 @@ redent@^2.0.0: indent-string "^3.0.0" strip-indent "^2.0.0" -regenerate-unicode-properties@^8.0.2: +regenerate-unicode-properties@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== @@ -9161,14 +9096,14 @@ regenerate@^1.4.0: integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== regenerator-runtime@^0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447" - integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA== + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" + integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== regenerator-transform@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.0.tgz#2ca9aaf7a2c239dd32e4761218425b8c7a86ecaf" - integrity sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w== + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.1.tgz#3b2fce4e1ab7732c08f665dfdb314749c7ddd2fb" + integrity sha512-flVuee02C3FKRISbxhXl9mGzdbWUVHubl1SMaknjxkFB1/iqpJhArQUvRxOOPEc/9tAiX0BaQ28FJH10E4isSQ== dependencies: private "^0.1.6" @@ -9187,10 +9122,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp-tree@^0.1.6: - version "0.1.11" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" - integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== +regexp-tree@^0.1.13: + version "0.1.13" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.13.tgz#5b19ab9377edc68bc3679256840bb29afc158d7f" + integrity sha512-hwdV/GQY5F8ReLZWO+W1SRoN5YfpOKY6852+tBFcma72DKBIcHjPRIlIvQN35bCOljuAfP2G2iB0FC/w236mUw== regexpp@^2.0.1: version "2.0.1" @@ -9198,12 +9133,12 @@ regexpp@^2.0.1: integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" - integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== + version "4.5.5" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.5.tgz#aaffe61c2af58269b3e516b61a73790376326411" + integrity sha512-FpI67+ky9J+cDizQUJlIlNZFKual/lUkFr1AG6zOCpwZ9cLrg8UUVakyUQJD7fCDIe9Z2nwTQJNPyonatNmDFQ== dependencies: regenerate "^1.4.0" - regenerate-unicode-properties "^8.0.2" + regenerate-unicode-properties "^8.1.0" regjsgen "^0.5.0" regjsparser "^0.6.0" unicode-match-property-ecmascript "^1.0.4" @@ -9383,14 +9318,7 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" - integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== - dependencies: - path-parse "^1.0.6" - -resolve@^1.10.0: +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: version "1.12.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== @@ -9422,14 +9350,14 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.4, rimraf@^2.6.2: +rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.7.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" -rimraf@2.6.3, rimraf@^2.6.1, rimraf@^2.6.3: +rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -9511,14 +9439,7 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.3.3: - version "6.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" - integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== - dependencies: - tslib "^1.9.0" - -rxjs@^6.4.0: +rxjs@^6.3.3, rxjs@^6.4.0: version "6.5.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" integrity sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA== @@ -9579,26 +9500,16 @@ semver-greatest-satisfied-range@^1.1.0: dependencies: sver-compat "^1.5.0" -"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", "semver@2.x || 3.x || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^5.3.0, semver@^5.6.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@^6.0.0, semver@^6.2.0: +semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" - integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== - semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -9791,9 +9702,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@^0.5.6, source-map-support@^0.5.9: - version "0.5.12" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.12.tgz#b4f3b10d51857a5af0138d3ce8003b201613d599" - integrity sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ== + version "0.5.13" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" + integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -10051,14 +9962,7 @@ string.prototype.trimright@^2.0.0: define-properties "^1.1.2" function-bind "^1.0.2" -string_decoder@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" - integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== - dependencies: - safe-buffer "~5.1.0" - -string_decoder@^1.1.1: +string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -10701,9 +10605,9 @@ unset-value@^1.0.0: isobject "^3.0.0" upath@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.2.tgz#3db658600edaeeccbe6db5e684d67ee8c2acd068" - integrity sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q== + version "1.2.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" + integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== upper-case@^1.1.1: version "1.1.3" From 6a5cee8f2724920c08cdae8e6595443c49f5b2e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 8 Sep 2019 22:53:42 +0200 Subject: [PATCH 057/965] Remove circular dependency (#10405) * Remove circular dependency * Move @babel/runtime test to @babel/runtime --- packages/babel-core/package.json | 3 +-- packages/babel-plugin-transform-runtime/package.json | 1 - packages/{babel-core => babel-register}/test/browserify.js | 0 .../test/{__data__ => fixtures/babelrc}/.babelrc | 0 .../test/{__data__ => fixtures/babelrc}/es2015.js | 0 .../test/fixtures/browserify/register.js | 0 packages/babel-register/test/index.js | 2 +- 7 files changed, 2 insertions(+), 4 deletions(-) rename packages/{babel-core => babel-register}/test/browserify.js (100%) rename packages/babel-register/test/{__data__ => fixtures/babelrc}/.babelrc (100%) rename packages/babel-register/test/{__data__ => fixtures/babelrc}/es2015.js (100%) rename packages/{babel-core => babel-register}/test/fixtures/browserify/register.js (100%) diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index d6e368cc0d62..2242dbe93841 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -49,7 +49,6 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.6.0", - "@babel/register": "^7.6.0" + "@babel/helper-transform-fixture-test-runner": "^7.6.0" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 152b4ff09b98..26a0aa357220 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -24,7 +24,6 @@ "@babel/core": "^7.6.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/helpers": "^7.6.0", - "@babel/plugin-transform-runtime": "^7.6.0", "@babel/preset-env": "^7.6.0", "@babel/runtime": "^7.6.0", "@babel/template": "^7.6.0", diff --git a/packages/babel-core/test/browserify.js b/packages/babel-register/test/browserify.js similarity index 100% rename from packages/babel-core/test/browserify.js rename to packages/babel-register/test/browserify.js diff --git a/packages/babel-register/test/__data__/.babelrc b/packages/babel-register/test/fixtures/babelrc/.babelrc similarity index 100% rename from packages/babel-register/test/__data__/.babelrc rename to packages/babel-register/test/fixtures/babelrc/.babelrc diff --git a/packages/babel-register/test/__data__/es2015.js b/packages/babel-register/test/fixtures/babelrc/es2015.js similarity index 100% rename from packages/babel-register/test/__data__/es2015.js rename to packages/babel-register/test/fixtures/babelrc/es2015.js diff --git a/packages/babel-core/test/fixtures/browserify/register.js b/packages/babel-register/test/fixtures/browserify/register.js similarity index 100% rename from packages/babel-core/test/fixtures/browserify/register.js rename to packages/babel-register/test/fixtures/browserify/register.js diff --git a/packages/babel-register/test/index.js b/packages/babel-register/test/index.js index 1f54094e9d9a..a61a8cb19163 100644 --- a/packages/babel-register/test/index.js +++ b/packages/babel-register/test/index.js @@ -6,7 +6,7 @@ let currentOptions; let sourceMapSupport = false; const registerFile = require.resolve("../lib/node"); -const testFile = require.resolve("./__data__/es2015"); +const testFile = require.resolve("./fixtures/babelrc/es2015"); const testFileContent = fs.readFileSync(testFile); jest.mock("pirates", () => { From daf25af47c4161025dfa552fd41b837f062efe47 Mon Sep 17 00:00:00 2001 From: FND Date: Mon, 9 Sep 2019 09:22:33 +0200 Subject: [PATCH 058/965] Fix typo in changelog (#10409) [skip ci] s/compliancy/compliancy/g - seems both correct and consistent with more recent occurrences --- .github/CHANGELOG-6to5.md | 10 +++--- .github/CHANGELOG-v4.md | 6 ++-- .github/CHANGELOG-v5.md | 8 ++--- .github/CHANGELOG-v6.md | 22 ++++++------- CHANGELOG.md | 46 +++++++++++++-------------- packages/babel-helpers/src/helpers.js | 2 +- packages/babel-parser/CHANGELOG.md | 26 +++++++-------- 7 files changed, 60 insertions(+), 60 deletions(-) diff --git a/.github/CHANGELOG-6to5.md b/.github/CHANGELOG-6to5.md index 45afe2368d8d..88016f402214 100644 --- a/.github/CHANGELOG-6to5.md +++ b/.github/CHANGELOG-6to5.md @@ -122,7 +122,7 @@ * Restructure transformers so they're only ran if the AST contains nodes that they need to worry about. Improves transpilation speed significantly. * **Bug Fix** * Fix source maps not tracking end of node locations. - * **Spec Compliancy** + * **Spec Compliance** * Use static super references as the home object is actually done at definition time. * **Polish** * Force the `es6.destructuring` transformer to be whitelisted when the `es7.objectSpread` transformer is. @@ -479,7 +479,7 @@ ## 2.12.3 - * **Spec Compliancy** + * **Spec Compliance** * Optional `typeof` transformer checks for `undefined` before passing it to the helper. * Class methods are now named. @@ -551,7 +551,7 @@ * Add `classesFastSuper` optional transformer that doesn't support parent getters and prototype changing. * Add `forOfFast` transformer that speeds up `for...of` on arrays but produces more code. * Add `--react-compat` to `bin/6to5`. - * **Spec Compliancy** + * **Spec Compliance** * Disallow setters without a single parameter. * Add `configurable` and `writable` to defined properties. * Use define instead of assignment for class methods. @@ -619,7 +619,7 @@ ## 2.7.0 - * **Spec Compliancy** + * **Spec Compliance** * Disallow reassignments of imports. * **New Feature** * `reactCompat` option to enable pre-v0.12 react components. @@ -662,7 +662,7 @@ * **Polish** * Move `"use strict";` to inside module bodies instead of at the top of the file. * Better handling of dynamic imports. - * **Spec Compliancy** + * **Spec Compliance** * Class inheritance now has a `function` or `null` type check. * Add `interopRequireWildcard` around wildcard imports and exports to handle non-object exports. diff --git a/.github/CHANGELOG-v4.md b/.github/CHANGELOG-v4.md index 7a06b2c93eee..ea6c1d496f50 100644 --- a/.github/CHANGELOG-v4.md +++ b/.github/CHANGELOG-v4.md @@ -110,7 +110,7 @@ * Throw an error on different `babel` and `babel-runtime` versions. * Replicate module environment for `babel-node` eval. * Clean up classes output. - * **Spec Compliancy** + * **Spec Compliance** * Make it illegal to use a rest parameter on a setter. ## 4.6.6 @@ -150,8 +150,8 @@ * **New Feature** * Desugar sticky regexes to a new constructor expression so it can be handled by a polyfill. - * **Spec Compliancy** - * `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliancy in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information. + * **Spec Compliance** + * `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliance in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information. * **Polish** * Rest parameters that are only referred to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)! * `$ babel` no longer exits on syntax errors. diff --git a/.github/CHANGELOG-v5.md b/.github/CHANGELOG-v5.md index 64d4999d58df..30d9f2d051ff 100644 --- a/.github/CHANGELOG-v5.md +++ b/.github/CHANGELOG-v5.md @@ -12,7 +12,7 @@ ## 5.8.24 - * **Spec Compliancy** + * **Spec Compliance** * Updated `optimisation.react.inlineElements` transformer to React 0.14 output. Thanks [@spicyj](https://github.com/spicyj)! * **Polish** * Add support for evaluating more static nodes. Thanks [@hzoo](https://github.com/hzoo)! @@ -451,7 +451,7 @@ Issues with publish process. ![gifs lol](https://31.media.tumblr.com/568205a0e37ae15eca510fa639589a59/tumblr_n8kw8kpcSb1sg6cg8o1_500.gif) - * **Spec Compliancy** + * **Spec Compliance** * Allow trailing param commas for methods when using the `es7.trailingCommas` transformer. * **Bug Fix** * Fix `es6.blockScoping` transformer not properly ignoring `break` in `SwitchCase`. @@ -481,7 +481,7 @@ Issues with publish process. * Fix correct function scope being passed to `nameMethod.property` when inferring the function name for class methods. * Fix incorrect extensions reference causing weird issues when using the Babel CLI. * Fix destructuring param reference replacements not inheriting from their original param. - * **Spec Compliancy** + * **Spec Compliance** * Fix order that method decorators are ran in. ## 5.2.15 @@ -616,7 +616,7 @@ Issues with publish process. * Fix `externalHelpers` option being incorrectly listed as type `string`. * **Internal** * Upgrade `core-js` to `0.9.0`. - * **Spec Compliancy** + * **Spec Compliance** * Fix object decorators not using the `initializer` pattern. * Remove property initializer descriptor reflection. diff --git a/.github/CHANGELOG-v6.md b/.github/CHANGELOG-v6.md index 92d9173db5b8..4094b38395a1 100644 --- a/.github/CHANGELOG-v6.md +++ b/.github/CHANGELOG-v6.md @@ -22,7 +22,7 @@ > Backports for some folks (also other's when we accidentally merged PRs from both 6.x/master) > Lesson learned: just use `master` and backport on another branch. -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-core`, `babel-generator`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-traverse`, `babel-types` * [#6081](https://github.com/babel/babel/pull/6081) Flow opaque type 6.x backport. ([@jbrown215](https://github.com/jbrown215)) @@ -1468,7 +1468,7 @@ It's a one-time use tool (helpful after the initial release when upgrading from ## v6.17.0 (2016-10-01) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-preset-stage-2`, `babel-preset-stage-3` * [#4617](https://github.com/babel/babel/pull/4617) Move async-generators to stage-3. ([@hzoo](https://github.com/hzoo)) @@ -1476,7 +1476,7 @@ It's a one-time use tool (helpful after the initial release when upgrading from Specification repo: https://github.com/tc39/proposal-async-iteration -Asynchronous Iteration was already added in [6.16.0](http://babeljs.io/blog/2016/09/28/6.16.0#spec-compliancy) under stage-2 but it was moved to stage-3 at the [latest TC-39 meeting](https://github.com/tc39/agendas/blob/master/2016/09.md#agenda-for-the-54th-meeting-of-ecma-tc39). +Asynchronous Iteration was already added in [6.16.0](http://babeljs.io/blog/2016/09/28/6.16.0#spec-compliance) under stage-2 but it was moved to stage-3 at the [latest TC-39 meeting](https://github.com/tc39/agendas/blob/master/2016/09.md#agenda-for-the-54th-meeting-of-ecma-tc39). ```js // async generator syntax @@ -1569,7 +1569,7 @@ First PR! Babel 6.16: Happy 2nd Birthday 🎂! -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-core`, `babel-generator`, `babel-helper-remap-async-to-generator`, `babel-helpers`, `babel-plugin-transform-async-generator-functions`, `babel-types`, `babel-preset-stage-2`, ... * [#3473](https://github.com/babel/babel/pull/3473) via [#4576](https://github.com/babel/babel/pull/4576) Implement support for async generator functions and for-await statements. ([@zenparsing](https://github.com/zenparsing)) @@ -2036,7 +2036,7 @@ It's also a lot folk's first PR (or first code PR)! * `babel-generator`, `babel-types` * [#3570](https://github.com/babel/babel/pull/3570) Add support for the new declare module.exports of flow. ([@danez](https://github.com/danez)) -#### Spec Compliancy +#### Spec Compliance * `babel-plugin-transform-es2015-modules-amd`, `babel-plugin-transform-es2015-modules-commonjs`, `babel-plugin-transform-es2015-modules-umd` * [#3518](https://github.com/babel/babel/pull/3518) Throw error for multiple exports default. ([@kaicataldo](https://github.com/kaicataldo)) @@ -2332,7 +2332,7 @@ Length: The number of characters in the output code * `babel-plugin-transform-react-jsx-self`, `babel-preset-react` * [#3540](https://github.com/babel/babel/pull/3540) Added jsx-self babel transform plugin. ([@jimfb](https://github.com/jimfb)) -#### Spec Compliancy +#### Spec Compliance * `babel-plugin-transform-es2015-unicode-regex` * [#3338](https://github.com/babel/babel/pull/3338) Update to `regexpu-core@2.0.0` for ES2016 compliance. ([@mathiasbynens](https://github.com/mathiasbynens)) @@ -3206,7 +3206,7 @@ Changes to note: - Reverting the class properties semicolon parser error. - Fix regression with plugin ordering with `babel-register`. -#### Spec Compliancy +#### Spec Compliance * `babel-plugin-transform-class-properties`, `babylon` * [#3332](https://github.com/babel/babel/pull/3332) Revert to standard ASI behavior for class properties. ([@loganfsmyth](https://github.com/loganfsmyth)) @@ -3628,7 +3628,7 @@ Thanks to @samwgoldman for all the new flow support! * `babel-plugin-transform-es2015-parameters`: [#3191](https://github.com/babel/babel/pull/3191) Fix the order of arguments initialization (fixes [T6809](http://phabricator.babeljs.io/T6809)) * `babel-traverse`: [#3198](https://github.com/babel/babel/pull/3198) In `evaluate()`, it should not mistake lack of confidence for falsy -* **Spec Compliancy** +* **Spec Compliance** * `babylon`, `babel-generator`, `babel-plugin-transform-regenerator`: [#3190](https://github.com/babel/babel/pull/3190): Remove `await *` from `babylon` and raise an error for that syntax since it was removed from the proposal and was causing an issue at runtime but not at compile time (fixes [T6688](http://phabricator.babeljs.io/T6688)). * **Internal** @@ -3863,7 +3863,7 @@ Thanks to @samwgoldman for all the new flow support! * Move `children` prop pushing to after props to ensure correct order in the react inline elements plugin. * Fix `buildExternalHelpers` script ignoring non-underscored helpers. * Fix exported classes with static class properties. - * **Spec Compliancy** + * **Spec Compliance** * Add support for computed mutators in `babel-plugin-transform-es2015-computed-properties`. * **Polish** * Make interop for plugins with the `__esModule` work for all plugins no matter how they're imported/specified. @@ -3904,7 +3904,7 @@ Thanks to @samwgoldman for all the new flow support! * **Polish** * Add npm 3 check to `babel-doctor`. * Autoclear the `babel/register` cache when it gets too big to be serialised. - * **Spec Compliancy** + * **Spec Compliance** * Add support for flow existential type parameters. ## 6.1.1 @@ -3969,7 +3969,7 @@ Thanks to @samwgoldman for all the new flow support! ## 6.0.14 - * **Spec Compliancy** + * **Spec Compliance** * Update exponentiation operator precedence. * Fix parser bug where arrow functions have a higher precedence than they should. * **Bug Fix** diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e3ff912fbc1..d51eaca1b7d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ > **Tags:** > - :boom: [Breaking Change] -> - :eyeglasses: [Spec Compliancy] +> - :eyeglasses: [Spec Compliance] > - :rocket: [New Feature] > - :bug: [Bug Fix] > - :memo: [Documentation] @@ -484,7 +484,7 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 ## v7.3.3 (2019-02-15) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-generator` * [#9501](https://github.com/babel/babel/pull/9501) Correctly output escapes in directives ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) @@ -506,11 +506,11 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 * [#9491](https://github.com/babel/babel/pull/9491) Better error output in parser tests ([@danez](https://github.com/danez)) ## v7.3.2 (2019-02-04) -Various spec compliancy fixes and better support for smart pipelines and private methods. +Various spec compliance fixes and better support for smart pipelines and private methods. Thanks @gverni, @naffiq, @spondbob and @dstaley for their first PRs! -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-parser` * [#9403](https://github.com/babel/babel/pull/9403) Fix line continuation with Unicode line terminators. ([@danez](https://github.com/danez)) * [#9400](https://github.com/babel/babel/pull/9400) Make yield a contextual keyword. ([@danez](https://github.com/danez)) @@ -558,7 +558,7 @@ This release fixes some regressions introduced in v7.3.0 Thanks to @jamesgeorge007 and @armano2 for their first PR! -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-parser` * [#9314](https://github.com/babel/babel/pull/9314) Disallow async functions as loop body. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) * [#9315](https://github.com/babel/babel/pull/9315) Parse class heritage as strict mode code. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) @@ -779,7 +779,7 @@ You can read more about this release at https://babeljs.io/blog/2018/12/03/7.2.0 ## v7.1.5 (2018-11-06) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-parser`, `babylon` * [#7727](https://github.com/babel/babel/pull/7727) Fix await in function name and parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) @@ -1242,7 +1242,7 @@ Fixed a peerDep issue Mostly bug fixes and some decorator updates -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-proposal-unicode-property-regex` * [#8127](https://github.com/babel/babel/pull/8127) Update plugin-proposal-unicode-property-regex for Unicode v11. ([@mathiasbynens](https://github.com/mathiasbynens)) * `babel-parser` @@ -1342,7 +1342,7 @@ Mostly bugfix release for a regression in decorators, and a quick fix for some n - Fix IE10 class regression - Various fixes, many TS fixes -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-parser`, `babel-plugin-proposal-json-strings`, `babel-plugin-syntax-json-strings`, `babel-preset-stage-3` * [#7985](https://github.com/babel/babel/pull/7985) Subsume json. ([@jridgewell](https://github.com/jridgewell)) @@ -1532,7 +1532,7 @@ Mostly bugfix release for a regression in decorators, and a quick fix for some n * `babel-generator`, `babel-helper-define-map`, `babel-plugin-syntax-class-properties`, `babel-plugin-transform-parameters`, `babel-plugin-transform-react-constant-elements`, `babel-traverse`, `babel-types` * [#7666](https://github.com/babel/babel/pull/7666) Private Properties phase 1. ([@jridgewell](https://github.com/jridgewell)) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-helper-simple-access`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs` * [#7766](https://github.com/babel/babel/pull/7766) Correct update expression Number coercion. ([@jridgewell](https://github.com/jridgewell)) * `babel-core`, `babel-generator`, `babel-plugin-proposal-decorators`, `babel-types`, `babylon` @@ -1620,7 +1620,7 @@ Mostly bugfix release for a regression in decorators, and a quick fix for some n Various fixes, also lazy-load `@babel/core` dependencies (should make config lookup and other API methods fast for other projects to use). -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-proposal-logical-assignment-operators` * [#7604](https://github.com/babel/babel/pull/7604) Logical Assignment: ensure computed key isn't recomputed. ([@jridgewell](https://github.com/jridgewell)) @@ -1719,7 +1719,7 @@ We'll need to update tooling for this ^. Also published `gulp-babel@8.0.0-beta.2 * `babel-register` * [#7416](https://github.com/babel/babel/pull/7416) Replace instead of merging babel-register options, and resolve cwd up front. ([@loganfsmyth](https://github.com/loganfsmyth)) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babylon` * [#7503](https://github.com/babel/babel/pull/7503) Update test262 test script and a few keyword escape fixes. ([@existentialism](https://github.com/existentialism)) * [#7498](https://github.com/babel/babel/pull/7498) Disallow setters to have RestElement. ([@danez](https://github.com/danez)) @@ -1867,7 +1867,7 @@ We'll need to update tooling for this ^. Also published `gulp-babel@8.0.0-beta.2 ## v7.0.0-beta.39 (2018-01-30) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-proposal-optional-chaining` * [#6345](https://github.com/babel/babel/pull/6345) Remove old optional chain features. ([@jridgewell](https://github.com/jridgewell)) @@ -2080,7 +2080,7 @@ Fixes + [overrides](https://github.com/babel/babel/pull/7091) config feature Various bug fixes, first version of Babel to use the MIT version of `regenerator` -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babylon` * [#6986](https://github.com/babel/babel/pull/6986) Fix destructuring assignment spec violation. ([@ksashikumar](https://github.com/ksashikumar)) * `babel-helper-replace-supers`, `babel-helpers`, `babel-plugin-proposal-class-properties`, `babel-plugin-transform-classes`, `babel-plugin-transform-parameters` @@ -2133,7 +2133,7 @@ Various bug fixes, first version of Babel to use the MIT version of `regenerator * `babel-preset-stage-1`, `babel-preset-stage-2` * [#6949](https://github.com/babel/babel/pull/6949) Fix stage refs to exportNamespaceFrom and exportDefaultFrom. ([@existentialism](https://github.com/existentialism)) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-preset-stage-0`, `babel-preset-stage-1` * [#6943](https://github.com/babel/babel/pull/6943) Moving Do expression to stage 1. ([@rajzshkr](https://github.com/rajzshkr)) @@ -2147,7 +2147,7 @@ Various bug fixes, first version of Babel to use the MIT version of `regenerator ## v7.0.0-beta.33 (2017-12-01) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-generator`, `babel-plugin-proposal-export-default-from`, `babel-plugin-proposal-export-default`, `babel-plugin-proposal-export-namespace-from`, `babel-plugin-proposal-export-namespace`, `babel-plugin-syntax-export-default-from`, `babel-plugin-syntax-export-extensions`, `babel-plugin-syntax-export-namespace-from`, `babel-standalone`, `babylon` * [#6920](https://github.com/babel/babel/pull/6920) Split exportExtensions into exportDefault and exportNamespace plugins…. ([@existentialism](https://github.com/existentialism)) * `babylon` @@ -2332,7 +2332,7 @@ Various bug fixes, first version of Babel to use the MIT version of `regenerator > Note: don't use ^ in your dependencies when using a beta. It can still break between (we should try not to do it but it can), so pin all the packages like `"@babel/cli" : "7.0.0-beta.4"` -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-transform-optional-chaining` * [#6525](https://github.com/babel/babel/pull/6525) Optional Chaining: Account for document.all. ([@azz](https://github.com/azz)) * `babel-preset-env`, `babel-helper-remap-async-to-generator`, `babel-helpers`, `babel-plugin-transform-async-generator-functions`, `babel-plugin-transform-async-to-generator`, `babel-plugin-transform-function-sent` @@ -2612,7 +2612,7 @@ let {...{}} = {}; let {...[]} = {}; - Add `--config-file` CLI flag to explicitly pass a config location - Move `babel-standalone` into the repo (another form of this used to be `babel-browser`) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-transform-async-to-generator`, `babel-*` * [#6094](https://github.com/babel/babel/pull/6094) Spec compatibility for iteratorClose condition.. ([@yavorsky](https://github.com/yavorsky)) * `babel-helpers`, `babel-plugin-transform-es2015-computed-properties` @@ -2748,7 +2748,7 @@ Initial release of typescript equivalent of how Babel handles flow with a new `b ## v7.0.0-alpha.18 (2017-08-03) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-generator`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-types` * [#5990](https://github.com/babel/babel/pull/5990) Flow opaque type aliases. ([@jbrown215](https://github.com/jbrown215)) * `babel-preset-stage-3` @@ -2797,9 +2797,9 @@ Initial release of typescript equivalent of how Babel handles flow with a new `b - Optional catch binding `try {} catch {}`: `babel-plugin-transform-optional-catch-binding` - es2015-parameters `loose` mode that doesn't use `arguments` -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-plugin-check-es2015-constants` - * [#5930](https://github.com/babel/babel/pull/5930) Spec compliancy of check-es2015-constants plugin. ([@maurobringolf](https://github.com/maurobringolf)) + * [#5930](https://github.com/babel/babel/pull/5930) Spec compliance of check-es2015-constants plugin. ([@maurobringolf](https://github.com/maurobringolf)) > Instead of throwing a compile time error when const is violated, Babel should insert a throw statement before the violation. @@ -3104,7 +3104,7 @@ var A = function A() { ## v7.0.0-alpha.12 (2017-05-31) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-core`, `babel-generator`, `babel-plugin-syntax-numeric-separator`, `babel-plugin-transform-numeric-separator`, `babel-preset-stage-1`, `babel-template`, `babel-traverse`, `babel-types` * [#5793](https://github.com/babel/babel/pull/5793) Support for NumericLiteralSeparator, Stage 1 feature. ([@rwaldron](https://github.com/rwaldron)) @@ -3145,7 +3145,7 @@ var A = function A() { Update Babylon: https://github.com/babel/babylon/releases/tag/v7.0.0-beta.9, https://github.com/babel/babylon/releases/tag/v7.0.0-beta.10 -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-generator`, `babel-plugin-transform-flow-strip-types`, `babel-types` * [#5525](https://github.com/babel/babel/pull/5525) Add support for object type spread. ([@conartist6](https://github.com/conartist6)) @@ -3219,7 +3219,7 @@ Update Babylon: https://github.com/babel/babylon/releases/tag/v7.0.0-beta.9, htt ## v7.0.0-alpha.8 (2017-04-17) -#### :eyeglasses: Spec Compliancy +#### :eyeglasses: Spec Compliance * `babel-preset-stage-2`, `babel-preset-stage-3` * [#5610](https://github.com/babel/babel/pull/5610) Move syntax-dynamic-import to stage-3. ([@dkaoster](https://github.com/dkaoster)) diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index 37485fdf705d..e54dd6444558 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -936,7 +936,7 @@ helpers.iterableToArrayLimit = helper("7.0.0-beta.0")` export default function _iterableToArrayLimit(arr, i) { // this is an expanded form of \`for...of\` that properly supports abrupt completions of // iterators etc. variable names have been minimised to reduce the size of this massive - // helper. sometimes spec compliancy is annoying :( + // helper. sometimes spec compliance is annoying :( // // _n = _iteratorNormalCompletion // _d = _didIteratorError diff --git a/packages/babel-parser/CHANGELOG.md b/packages/babel-parser/CHANGELOG.md index 6ddd17fb8800..8a43406dd600 100644 --- a/packages/babel-parser/CHANGELOG.md +++ b/packages/babel-parser/CHANGELOG.md @@ -2,7 +2,7 @@ > **Tags:** > - :boom: [Breaking Change] -> - :eyeglasses: [Spec Compliancy] +> - :eyeglasses: [Spec Compliance] > - :rocket: [New Feature] > - :bug: [Bug Fix] > - :memo: [Documentation] @@ -56,7 +56,7 @@ See the [Babel Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.m ## 7.0.0-beta.7 (2017-03-22) -### Spec Compliancy +### Spec Compliance * Remove babylon plugin for template revision since it's stage-4 (#426) (Henry Zhu) ### Bug Fix @@ -200,7 +200,7 @@ declare module "C" { } ``` -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Forbid semicolons after decorators in classes ([#352](https://github.com/babel/babylon/pull/352)) (Kevin Gibbons) @@ -305,7 +305,7 @@ AST spec: fix casing of `RegExpLiteral` ([#318](https://github.com/babel/babylon ## 6.15.0 (2017-01-10) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Add support for Flow shorthand import type ([#267](https://github.com/babel/babylon/pull/267)) (Jeff Morrison) @@ -411,7 +411,7 @@ Will include all parser plugins instead of specifying each one individually. Use ## 6.14.0 (2016-11-16) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Throw error for reserved words `enum` and `await` ([#195](https://github.com/babel/babylon/pull/195)) (Kai Cataldo) @@ -491,7 +491,7 @@ With that test case, there was a ~95ms savings by removing the need for node to ## v6.13.0 (2016-10-21) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Property variance type annotations for Flow plugin ([#161](https://github.com/babel/babylon/pull/161)) (Sam Goldman) @@ -549,7 +549,7 @@ Fixes two tests that are failing after the merge of #172 ([#177](https://github. ## v6.12.0 (2016-10-14) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Implement import() syntax ([#163](https://github.com/babel/babylon/pull/163)) (Jordan Gensler) @@ -643,7 +643,7 @@ export const { foo: [ ,, qux7 ] } = bar; ## v6.11.5 (2016-10-12) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Fix: Check for duplicate named exports in exported destructuring assignments ([#144](https://github.com/babel/babylon/pull/144)) (Kai Cataldo) @@ -689,7 +689,7 @@ Temporary rollback for erroring on trailing comma with spread (#154) (Henry Zhu) ## v6.11.3 (2016-10-01) -### :eyeglasses: Spec Compliancy +### :eyeglasses: Spec Compliance Add static errors for object rest (#149) ([@danez](https://github.com/danez)) @@ -782,7 +782,7 @@ export toString from './toString'; ## 6.11.0 (2016-09-22) -### Spec Compliancy (will break CI) +### Spec Compliance (will break CI) - Disallow duplicate named exports ([#107](https://github.com/babel/babylon/pull/107)) @kaicataldo @@ -862,9 +862,9 @@ for (+i in {}); ## 6.10.0 (2016-09-19) -> We plan to include some spec compliancy bugs in patch versions. An example was the multiple default exports issue. +> We plan to include some spec compliance bugs in patch versions. An example was the multiple default exports issue. -### Spec Compliancy +### Spec Compliance * Implement ES2016 check for simple parameter list in strict mode ([#106](https://github.com/babel/babylon/pull/106)) (Timothy Gu) @@ -1023,7 +1023,7 @@ declare module "foo" { - The existential type `*` is not a valid type parameter. - The existential type `*` is a primary type -### Spec Compliancy +### Spec Compliance - The param list for type parameter declarations now consists of `TypeParameter` nodes - New `TypeParameter` AST Node (replaces using the `Identifier` node before) From 81831032c3ab4424d51353bf5f871badc52ef131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 10 Sep 2019 09:17:22 -0400 Subject: [PATCH 059/965] chore: remove trim-right dependency (#10420) --- packages/babel-generator/package.json | 3 +-- packages/babel-generator/src/buffer.js | 3 +-- packages/babel-helper-fixtures/src/index.js | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index ccc7eab8cc86..31f7bf70785d 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -17,8 +17,7 @@ "@babel/types": "^7.6.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", - "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.0", diff --git a/packages/babel-generator/src/buffer.js b/packages/babel-generator/src/buffer.js index fd64201a921b..d9af9a167a14 100644 --- a/packages/babel-generator/src/buffer.js +++ b/packages/babel-generator/src/buffer.js @@ -1,5 +1,4 @@ import type SourceMap from "./source-map"; -import trimRight from "trim-right"; const SPACES_RE = /^[ \t]+$/; @@ -43,7 +42,7 @@ export default class Buffer { const result = { // Whatever trim is used here should not execute a regex against the // source string since it may be arbitrarily large after all transformations - code: trimRight(this._buf.join("")), + code: this._buf.join("").trimRight(), map: null, rawMappings: map && map.getRawMappings(), }; diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index 991975fcadf3..099fa9fa6e2d 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -1,5 +1,4 @@ import cloneDeep from "lodash/cloneDeep"; -import trimEnd from "lodash/trimEnd"; import resolve from "try-resolve"; import clone from "lodash/clone"; import extend from "lodash/extend"; @@ -275,7 +274,7 @@ export function multiple(entryLoc, ignore?: Array) { export function readFile(filename) { if (fs.existsSync(filename)) { - let file = trimEnd(fs.readFileSync(filename, "utf8")); + let file = fs.readFileSync(filename, "utf8").trimRight(); file = file.replace(/\r\n/g, "\n"); return file; } else { From 8027dca501721718f95877f468c72f0206386e02 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Tue, 10 Sep 2019 21:18:45 +0800 Subject: [PATCH 060/965] fix object rest in array pattern (#10275) * fix object rest in array pattern * update test fixtures * early return * use path.stop() at the right path --- .../src/index.js | 86 ++++++++++++++----- .../object-rest/for-x-array-pattern/input.js | 19 ++++ .../object-rest/for-x-array-pattern/output.js | 49 +++++++++++ .../object-rest/nested-array-2/input.js | 1 + .../object-rest/nested-array-2/output.js | 19 ++++ .../object-rest/nested-array/input.js | 6 ++ .../object-rest/nested-array/output.js | 15 ++++ .../usage-for-of-destructure-with/output.mjs | 7 +- .../usage-for-of-destructure-with/output.mjs | 7 +- 9 files changed, 179 insertions(+), 30 deletions(-) create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/input.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/input.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/input.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/output.js diff --git a/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/packages/babel-plugin-proposal-object-rest-spread/src/index.js index 39fcfe42a21c..9263fbd56d5e 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/src/index.js +++ b/packages/babel-plugin-proposal-object-rest-spread/src/index.js @@ -30,9 +30,20 @@ export default declare((api, opts) => { function hasRestElement(path) { let foundRestElement = false; - visitRestElements(path, () => { + visitRestElements(path, restElement => { foundRestElement = true; - path.stop(); + restElement.stop(); + }); + return foundRestElement; + } + + function hasObjectPatternRestElement(path) { + let foundRestElement = false; + visitRestElements(path, restElement => { + if (restElement.parentPath.isObjectPattern()) { + foundRestElement = true; + restElement.stop(); + } }); return foundRestElement; } @@ -163,9 +174,9 @@ export default declare((api, opts) => { ]; } - function replaceRestElement(parentPath, paramPath, i, numParams) { + function replaceRestElement(parentPath, paramPath) { if (paramPath.isAssignmentPattern()) { - replaceRestElement(parentPath, paramPath.get("left"), i, numParams); + replaceRestElement(parentPath, paramPath.get("left")); return; } @@ -173,7 +184,7 @@ export default declare((api, opts) => { const elements = paramPath.get("elements"); for (let i = 0; i < elements.length; i++) { - replaceRestElement(parentPath, elements[i], i, elements.length); + replaceRestElement(parentPath, elements[i]); } } @@ -200,7 +211,7 @@ export default declare((api, opts) => { Function(path) { const params = path.get("params"); for (let i = params.length - 1; i >= 0; i--) { - replaceRestElement(params[i].parentPath, params[i], i, params.length); + replaceRestElement(params[i].parentPath, params[i]); } }, // adapted from transform-destructuring/src/index.js#pushObjectRest @@ -380,8 +391,12 @@ export default declare((api, opts) => { const leftPath = path.get("left"); const left = node.left; - // for ({a, ...b} of []) {} - if (t.isObjectPattern(left) && hasRestElement(leftPath)) { + if (!hasObjectPatternRestElement(leftPath)) { + return; + } + + if (!t.isVariableDeclaration(left)) { + // for ({a, ...b} of []) {} const temp = scope.generateUidIdentifier("ref"); node.left = t.variableDeclaration("var", [ @@ -401,27 +416,54 @@ export default declare((api, opts) => { t.assignmentExpression("=", left, t.cloneNode(temp)), ), ); + } else { + // for (var {a, ...b} of []) {} + const pattern = left.declarations[0].id; - return; + const key = scope.generateUidIdentifier("ref"); + node.left = t.variableDeclaration(left.kind, [ + t.variableDeclarator(key, null), + ]); + + path.ensureBlock(); + + node.body.body.unshift( + t.variableDeclaration(node.left.kind, [ + t.variableDeclarator(pattern, t.cloneNode(key)), + ]), + ); } + }, + // [{a, ...b}] = c; + ArrayPattern(path) { + const objectPatterns = []; - if (!t.isVariableDeclaration(left)) return; + visitRestElements(path, path => { + if (!path.parentPath.isObjectPattern()) { + // Return early if the parent is not an ObjectPattern, but + // (for example) an ArrayPattern or Function, because that + // means this RestElement is an not an object property. + return; + } - const pattern = left.declarations[0].id; - if (!t.isObjectPattern(pattern)) return; + const objectPattern = path.parentPath; - const key = scope.generateUidIdentifier("ref"); - node.left = t.variableDeclaration(left.kind, [ - t.variableDeclarator(key, null), - ]); + const uid = path.scope.generateUidIdentifier("ref"); + objectPatterns.push(t.variableDeclarator(objectPattern.node, uid)); - path.ensureBlock(); + objectPattern.replaceWith(t.cloneNode(uid)); + path.skip(); + }); - node.body.body.unshift( - t.variableDeclaration(node.left.kind, [ - t.variableDeclarator(pattern, t.cloneNode(key)), - ]), - ); + if (objectPatterns.length > 0) { + const statementPath = path.getStatementParent(); + statementPath.insertAfter( + t.variableDeclaration( + statementPath.node.kind || "var", + objectPatterns, + ), + ); + } }, // var a = { ...b, ...c } ObjectExpression(path, file) { diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/input.js new file mode 100644 index 000000000000..8ab978fb9402 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/input.js @@ -0,0 +1,19 @@ +// ForXStatement +for (const [{a, ...b}] of []) {} +for ([{a, ...b}] of []) {} +async function a() { + for await ([{a, ...b}] of []) {} +} + +// skip +for ([{a}] in {}) {} +for ([{a}] of []) {} +async function a() { + for await ([{a}] of []) {} +} + +for ([a, ...b] in {}) {} +for ([a, ...b] of []) {} +async function a() { + for await ([a, ...b] of []) {} +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js new file mode 100644 index 000000000000..d4b3f61d7efd --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/for-x-array-pattern/output.js @@ -0,0 +1,49 @@ +// ForXStatement +for (const _ref of []) { + const [_ref2] = _ref; + const { + a + } = _ref2, + b = babelHelpers.objectWithoutProperties(_ref2, ["a"]); +} + +for (var _ref3 of []) { + [_ref4] = _ref3; + var { + a + } = _ref4, + b = babelHelpers.objectWithoutProperties(_ref4, ["a"]); +} + +async function a() { + for await (var _ref5 of []) { + [_ref6] = _ref5; + var { + a + } = _ref6, + b = babelHelpers.objectWithoutProperties(_ref6, ["a"]); + } +} // skip + + +for ([{ + a +}] in {}) {} + +for ([{ + a +}] of []) {} + +async function a() { + for await ([{ + a + }] of []) {} +} + +for ([a, ...b] in {}) {} + +for ([a, ...b] of []) {} + +async function a() { + for await ([a, ...b] of []) {} +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/input.js new file mode 100644 index 000000000000..08cf30b7ab32 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/input.js @@ -0,0 +1 @@ +const [a, [{b, ...c}], {d, ...e}, [{ f, ...g}, {h: [i, {j, ...k}] }]] = x; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js new file mode 100644 index 000000000000..6c688a3b4bff --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js @@ -0,0 +1,19 @@ +const [a, [_ref], _ref2, [_ref3, { + h: [i, _ref4] +}]] = x; +const { + b +} = _ref, + c = babelHelpers.objectWithoutProperties(_ref, ["b"]), + { + d +} = _ref2, + e = babelHelpers.objectWithoutProperties(_ref2, ["d"]), + { + f +} = _ref3, + g = babelHelpers.objectWithoutProperties(_ref3, ["f"]), + { + j +} = _ref4, + k = babelHelpers.objectWithoutProperties(_ref4, ["j"]); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/input.js new file mode 100644 index 000000000000..0845134f7dbc --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/input.js @@ -0,0 +1,6 @@ +const [a, {b, ...c}] = x; + +let [d, {e, ...f}] = x; + +[g, {h, ...i}] = x; + diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/output.js new file mode 100644 index 000000000000..bd3be0a9f607 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-array/output.js @@ -0,0 +1,15 @@ +const [a, _ref] = x; +const { + b +} = _ref, + c = babelHelpers.objectWithoutProperties(_ref, ["b"]); +let [d, _ref2] = x; +let { + e +} = _ref2, + f = babelHelpers.objectWithoutProperties(_ref2, ["e"]); +[g, _ref3] = x; +var { + h +} = _ref3, + i = babelHelpers.objectWithoutProperties(_ref3, ["h"]); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs index 18b1bb0bfb15..6762f8384120 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs @@ -1,9 +1,8 @@ import "core-js/modules/es7.string.pad-end"; import "core-js/modules/es7.string.pad-start"; -for (const _ref of foo) { - const { - padStart - } = _ref; +for (const { + padStart +} of foo) { console.log('b'.padEnd(5)); } diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs index 5237617a6e67..2769d6c95b21 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs @@ -2,9 +2,8 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.string.pad-end"; import "core-js/modules/es.string.pad-start"; -for (const _ref of foo) { - const { - padStart - } = _ref; +for (const { + padStart +} of foo) { console.log('b'.padEnd(5)); } From 610d6bdc627244c196cd800741f9949f54ed719b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 10 Sep 2019 19:47:27 +0200 Subject: [PATCH 061/965] Do not guess relative execution status for exported fns (#10417) --- .../test/fixtures/tdz/exported-fn/input.mjs | 14 ++++++++++++++ .../test/fixtures/tdz/exported-fn/output.mjs | 10 ++++++++++ .../test/fixtures/regression/10416/input.mjs | 6 ++++++ .../test/fixtures/regression/10416/output.mjs | 5 +++++ packages/babel-traverse/src/path/introspection.js | 7 ++++++- 5 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/input.mjs create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/output.mjs create mode 100644 packages/babel-plugin-transform-spread/test/fixtures/regression/10416/input.mjs create mode 100644 packages/babel-plugin-transform-spread/test/fixtures/regression/10416/output.mjs diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/input.mjs b/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/input.mjs new file mode 100644 index 000000000000..ce79efd8d1e2 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/input.mjs @@ -0,0 +1,14 @@ +import { foo } from "somewhere"; + +// foo might call "bar" +foo(); + +a; + +let a; + +a; + +export function bar() { + return a; +} diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/output.mjs b/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/output.mjs new file mode 100644 index 000000000000..b7679ea67438 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/tdz/exported-fn/output.mjs @@ -0,0 +1,10 @@ +var a = babelHelpers.temporalUndefined; +import { foo } from "somewhere"; // foo might call "bar" + +foo(); +babelHelpers.tdz("a"); +a = void 0; +a; +export function bar() { + return babelHelpers.temporalRef(a, "a"); +} diff --git a/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/input.mjs b/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/input.mjs new file mode 100644 index 000000000000..9aed42e1cc6c --- /dev/null +++ b/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/input.mjs @@ -0,0 +1,6 @@ +const E_ARR = []; + +export default function () { + const someVar = E_ARR; + return [...someVar]; +} \ No newline at end of file diff --git a/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/output.mjs b/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/output.mjs new file mode 100644 index 000000000000..9593cc5ad0ba --- /dev/null +++ b/packages/babel-plugin-transform-spread/test/fixtures/regression/10416/output.mjs @@ -0,0 +1,5 @@ +const E_ARR = []; +export default function () { + const someVar = E_ARR; + return babelHelpers.toConsumableArray(someVar); +} diff --git a/packages/babel-traverse/src/path/introspection.js b/packages/babel-traverse/src/path/introspection.js index 5089b0a1d461..b660cf666e94 100644 --- a/packages/babel-traverse/src/path/introspection.js +++ b/packages/babel-traverse/src/path/introspection.js @@ -370,7 +370,12 @@ const executionOrderCheckedNodes = new WeakSet(); export function _guessExecutionStatusRelativeToDifferentFunctions( target: NodePath, ): RelativeExecutionStatus { - if (!target.isFunctionDeclaration()) return "unknown"; + if ( + !target.isFunctionDeclaration() || + target.parentPath.isExportDeclaration() + ) { + return "unknown"; + } // so we're in a completely different function, if this is a function declaration // then we can be a bit smarter and handle cases where the function is either From 4395c22f3a10a7378ce708836db774a75a2e5364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 10 Sep 2019 13:47:52 -0400 Subject: [PATCH 062/965] Miscellaneous perf tweak (#10421) * refactor: early return on hot path * refactor: read next2 only when next is dot * perf: mini refactor --- packages/babel-parser/src/parser/comments.js | 5 +++-- packages/babel-parser/src/tokenizer/index.js | 14 ++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index bdeac9c140cb..2f512ed904e9 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -39,10 +39,11 @@ export default class CommentsParser extends BaseParser { } adjustCommentsAfterTrailingComma(node: Node, elements: Node[]) { - if (elements.length === 0) { + if (this.state.leadingComments.length === 0) { return; } - if (this.state.leadingComments.length === 0) { + + if (elements.length === 0) { return; } diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index ffb8cba8ca6f..f3e9a0438023 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -234,8 +234,8 @@ export default class Tokenizer extends LocationParser { skipBlockComment(): void { const startLoc = this.state.curPosition(); const start = this.state.pos; - const end = this.input.indexOf("*/", (this.state.pos += 2)); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); + const end = this.input.indexOf("*/", this.state.pos + 2); + if (end === -1) this.raise(start, "Unterminated comment"); this.state.pos = end + 2; lineBreakG.lastIndex = start; @@ -404,8 +404,10 @@ export default class Tokenizer extends LocationParser { return; } - const next2 = this.input.charCodeAt(this.state.pos + 2); - if (next === charCodes.dot && next2 === charCodes.dot) { + if ( + next === charCodes.dot && + this.input.charCodeAt(this.state.pos + 2) === charCodes.dot + ) { this.state.pos += 3; this.finishToken(tt.ellipsis); } else { @@ -900,9 +902,9 @@ export default class Tokenizer extends LocationParser { let val; if (this.hasPlugin("numericSeparator")) { - const prev = this.input.charCodeAt(this.state.pos - 1); - const next = this.input.charCodeAt(this.state.pos + 1); if (code === charCodes.underscore) { + 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"); } From 98b14843ba3f6ba7e4bd4c9bc3ceadf119283e0d Mon Sep 17 00:00:00 2001 From: Bryan Wain Date: Tue, 10 Sep 2019 18:57:44 -0500 Subject: [PATCH 063/965] Remove babel polyfill dependency of babel-node (#10429) --- packages/babel-node/package.json | 3 ++- packages/babel-node/src/_babel-node.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 89d7cdb0791a..9b2c283c50bd 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -19,11 +19,12 @@ "compiler" ], "dependencies": { - "@babel/polyfill": "^7.6.0", "@babel/register": "^7.6.0", "commander": "^2.8.1", + "core-js": "^3.2.1", "lodash": "^4.17.13", "node-environment-flags": "^1.0.5", + "regenerator-runtime": "^0.13.3", "v8flags": "^3.1.1" }, "peerDependencies": { diff --git a/packages/babel-node/src/_babel-node.js b/packages/babel-node/src/_babel-node.js index ff908a56e6d2..6f39bb638529 100644 --- a/packages/babel-node/src/_babel-node.js +++ b/packages/babel-node/src/_babel-node.js @@ -5,7 +5,8 @@ import path from "path"; import repl from "repl"; import * as babel from "@babel/core"; import vm from "vm"; -import "@babel/polyfill"; +import "core-js/stable"; +import "regenerator-runtime/runtime"; import register from "@babel/register"; import pkg from "../package.json"; From af04f40ee0b053ab37b277ca04f050361c78abf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 Sep 2019 06:23:20 -0400 Subject: [PATCH 064/965] fix: pass optionLoc when validating plugin object (#10402) --- .../babel-core/src/config/validation/options.js | 3 ++- .../babel-core/src/config/validation/plugins.js | 11 ++++++++++- packages/babel-core/test/config-loading.js | 15 +++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/packages/babel-core/src/config/validation/options.js b/packages/babel-core/src/config/validation/options.js index 3ee072ae344f..02c51649a4cb 100644 --- a/packages/babel-core/src/config/validation/options.js +++ b/packages/babel-core/src/config/validation/options.js @@ -272,7 +272,8 @@ export type OptionsSource = | "configfile" | "babelrcfile" | "extendsfile" - | "preset"; + | "preset" + | "plugin"; type RootPath = $ReadOnly<{ type: "root", diff --git a/packages/babel-core/src/config/validation/plugins.js b/packages/babel-core/src/config/validation/plugins.js index 7800de965e31..ea1fc514306d 100644 --- a/packages/babel-core/src/config/validation/plugins.js +++ b/packages/babel-core/src/config/validation/plugins.js @@ -84,10 +84,19 @@ export type PluginObject = { }; export function validatePluginObject(obj: {}): PluginObject { + const rootPath: RootPath = { + type: "root", + source: "plugin", + }; Object.keys(obj).forEach(key => { const validator = VALIDATORS[key]; + const optLoc = { + type: "option", + name: key, + parent: rootPath, + }; - if (validator) validator(key, obj[key]); + if (validator) validator(optLoc, obj[key]); else throw new Error(`.${key} is not a valid Plugin property`); }); diff --git a/packages/babel-core/test/config-loading.js b/packages/babel-core/test/config-loading.js index b31eac8ed2d9..1014a10f8e71 100644 --- a/packages/babel-core/test/config-loading.js +++ b/packages/babel-core/test/config-loading.js @@ -322,6 +322,21 @@ describe("@babel/core config loading", () => { } } }); + + it("should thrown when plugin is not valid", () => { + const fooPlugin = { + inherits: "inhertis-should-not-be-string", + }; + const opts = { + cwd: path.dirname(FILEPATH), + filename: FILEPATH, + plugins: [fooPlugin], + }; + + expect(() => loadConfig(opts)).toThrow( + /\.inherits must be a function, or undefined/, + ); + }); }); describe("caller metadata", () => { From 53af9e8b7a8a32ff265688d0c918ef8f71002e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 Sep 2019 06:24:44 -0400 Subject: [PATCH 065/965] fix: allow the process to exit naturally (#10400) --- packages/babel-cli/src/babel/index.js | 14 +++++++++----- packages/babel-cli/src/babel/options.js | 4 ++-- packages/babel-cli/src/babel/util.js | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/babel-cli/src/babel/index.js b/packages/babel-cli/src/babel/index.js index f3194576072a..a740bcdedadf 100755 --- a/packages/babel-cli/src/babel/index.js +++ b/packages/babel-cli/src/babel/index.js @@ -6,8 +6,12 @@ import fileCommand from "./file"; const opts = parseArgv(process.argv); -const fn = opts.cliOptions.outDir ? dirCommand : fileCommand; -fn(opts).catch(err => { - console.error(err); - process.exit(1); -}); +if (opts) { + const fn = opts.cliOptions.outDir ? dirCommand : fileCommand; + fn(opts).catch(err => { + console.error(err); + process.exitCode = 1; + }); +} else { + process.exitCode = 2; +} diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 19ae7bfce878..897c05ba16da 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -158,7 +158,7 @@ export type CmdOptions = { cliOptions: Object, }; -export default function parseArgv(args: Array): CmdOptions { +export default function parseArgv(args: Array): CmdOptions | null { // commander.parse(args); @@ -223,7 +223,7 @@ export default function parseArgv(args: Array): CmdOptions { errors.forEach(function(e) { console.error(" " + e); }); - process.exit(2); + return null; } const opts = commander.opts(); diff --git a/packages/babel-cli/src/babel/util.js b/packages/babel-cli/src/babel/util.js index daacba53f0d2..9355c0ff85a4 100644 --- a/packages/babel-cli/src/babel/util.js +++ b/packages/babel-cli/src/babel/util.js @@ -112,7 +112,7 @@ export function deleteDir(path: string): void { process.on("uncaughtException", function(err) { console.error(err); - process.exit(1); + process.exitCode = 1; }); export function requireChokidar(): Object { From 1b352ca8a1771c21351835a96a6ff39393a6318b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 Sep 2019 06:25:18 -0400 Subject: [PATCH 066/965] chore: remove tryResolve dependency (#10428) --- packages/babel-helper-fixtures/package.json | 3 +-- packages/babel-helper-fixtures/src/index.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index 0c102680e135..31854ac575d0 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -11,7 +11,6 @@ "main": "lib/index.js", "dependencies": { "lodash": "^4.17.13", - "semver": "^5.3.0", - "try-resolve": "^1.0.0" + "semver": "^5.3.0" } } diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index 099fa9fa6e2d..4366d27e3322 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -1,5 +1,4 @@ import cloneDeep from "lodash/cloneDeep"; -import resolve from "try-resolve"; import clone from "lodash/clone"; import extend from "lodash/extend"; import semver from "semver"; @@ -35,6 +34,13 @@ type Suite = { filename: string, }; +function tryResolve(module) { + try { + return require.resolve(module); + } catch (e) { + return null; + } +} function assertDirectory(loc) { if (!fs.statSync(loc).isDirectory()) { throw new Error(`Expected ${loc} to be a directory.`); @@ -76,7 +82,7 @@ export default function get(entryLoc): Array { const suites = []; let rootOpts = {}; - const rootOptsLoc = resolve(entryLoc + "/options"); + const rootOptsLoc = tryResolve(entryLoc + "/options"); if (rootOptsLoc) rootOpts = require(rootOptsLoc); for (const suiteName of fs.readdirSync(entryLoc)) { @@ -92,7 +98,7 @@ export default function get(entryLoc): Array { assertDirectory(suite.filename); suites.push(suite); - const suiteOptsLoc = resolve(suite.filename + "/options"); + const suiteOptsLoc = tryResolve(suite.filename + "/options"); if (suiteOptsLoc) suite.options = require(suiteOptsLoc); for (const taskName of fs.readdirSync(suite.filename)) { @@ -139,7 +145,7 @@ export default function get(entryLoc): Array { const taskOpts = cloneDeep(suite.options); - const taskOptsLoc = resolve(taskDir + "/options"); + const taskOptsLoc = tryResolve(taskDir + "/options"); if (taskOptsLoc) extend(taskOpts, require(taskOptsLoc)); const test = { From 0ee2c42b55e1893f0ae6510916405eb273587844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 Sep 2019 14:24:08 -0400 Subject: [PATCH 067/965] chore: add lint-ts rule (#10427) --- Makefile | 7 ++++++- package.json | 1 + scripts/tests/typescript/lint.sh | 7 +++++++ yarn.lock | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 scripts/tests/typescript/lint.sh diff --git a/Makefile b/Makefile index 5fa5cb0cfdbf..e8fe2d667f01 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,14 @@ watch: clean clean-lib flow: ./node_modules/.bin/flow check --strip-root -lint: +lint: lint-js lint-ts + +lint-js: ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe +lint-ts: + ./scripts/tests/typescript/lint.sh + fix: fix-json ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix diff --git a/package.json b/package.json index 3cdf83c27715..82008898b833 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "rollup-plugin-replace": "^2.2.0", "test262-stream": "^1.2.0", "through2": "^2.0.0", + "typescript": "^3.6.3", "warnings-to-errors-webpack-plugin": "^2.0.0", "webpack": "^3.4.1", "webpack-dependency-suite": "^2.4.4", diff --git a/scripts/tests/typescript/lint.sh b/scripts/tests/typescript/lint.sh new file mode 100755 index 000000000000..7a5f9193287f --- /dev/null +++ b/scripts/tests/typescript/lint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +node="node" +tsFlags="--strict" + +$node ./node_modules/typescript/bin/tsc $tsFlags ./packages/babel-types/lib/index.d.ts diff --git a/yarn.lock b/yarn.lock index 4baaf3fe85ce..92f52fdd60b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10438,6 +10438,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typescript@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" + integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== + uglify-js@3.4.x: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" From 256fa5aa0455c6313e39f74d4675e676420336cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 13 Sep 2019 11:51:24 -0400 Subject: [PATCH 068/965] chore: bump regexpu-core to version 4.6.0 (#10439) * chore: update test fixtures * chore: test against regexpu-core 4.6.0 * chore: bump regexpu-core dependency --- .../package.json | 2 +- packages/babel-plugin-transform-dotall-regex/package.json | 2 +- .../test/fixtures/dotall-regex/simple/output.js | 2 +- packages/babel-plugin-transform-unicode-regex/package.json | 2 +- .../test/fixtures/sanity/regex-dot-all/output.js | 2 +- yarn.lock | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index 96bdc44c4698..72c7d31056bd 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -24,7 +24,7 @@ "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.6.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 2e36b5923586..62fd6be70bae 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -23,7 +23,7 @@ "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.6.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" diff --git a/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/simple/output.js b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/simple/output.js index dec34325752f..283718ce96ce 100644 --- a/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/simple/output.js +++ b/packages/babel-plugin-transform-dotall-regex/test/fixtures/dotall-regex/simple/output.js @@ -1,2 +1,2 @@ var a = /./; -var b = /[\0-\uFFFF]/; +var b = /[\s\S]/; diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index 32610f9c7d4b..834814432b0f 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -14,7 +14,7 @@ "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-regex": "^7.4.4", - "regexpu-core": "^4.5.4" + "regexpu-core": "^4.6.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" diff --git a/packages/babel-preset-env/test/fixtures/sanity/regex-dot-all/output.js b/packages/babel-preset-env/test/fixtures/sanity/regex-dot-all/output.js index a83a16174172..e11606be750b 100644 --- a/packages/babel-preset-env/test/fixtures/sanity/regex-dot-all/output.js +++ b/packages/babel-preset-env/test/fixtures/sanity/regex-dot-all/output.js @@ -1,2 +1,2 @@ -/[\0-\uFFFF]/; +/[\s\S]/; /(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/; diff --git a/yarn.lock b/yarn.lock index 92f52fdd60b0..c83319802dc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9133,9 +9133,9 @@ regexpp@^2.0.1: integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== regexpu-core@^4.5.4: - version "4.5.5" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.5.tgz#aaffe61c2af58269b3e516b61a73790376326411" - integrity sha512-FpI67+ky9J+cDizQUJlIlNZFKual/lUkFr1AG6zOCpwZ9cLrg8UUVakyUQJD7fCDIe9Z2nwTQJNPyonatNmDFQ== + version "4.6.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" + integrity sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg== dependencies: regenerate "^1.4.0" regenerate-unicode-properties "^8.1.0" From e4b48311004b70e0bfe90cddf13690c848d80d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 16 Sep 2019 22:38:12 +0200 Subject: [PATCH 069/965] Update GitHub actions to v2 (#10441) * Update GitHub actions to v2 [skip ci] * Only run when needed for issues [skip ci] --- .github/main.workflow | 76 ---------------------------- .github/workflows/issue-triage.yml | 81 ++++++++++++++++++++++++++++++ .github/workflows/release.yml | 53 +++++++++++++++++++ 3 files changed, 134 insertions(+), 76 deletions(-) delete mode 100644 .github/main.workflow create mode 100644 .github/workflows/issue-triage.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/main.workflow b/.github/main.workflow deleted file mode 100644 index 3267641c50ce..000000000000 --- a/.github/main.workflow +++ /dev/null @@ -1,76 +0,0 @@ -workflow "Release" { - on = "push" - resolves = ["Trigger GitHub release"] -} - -action "Is version tag" { - uses = "actions/bin/filter@0dbb077f64d0ec1068a644d25c71b1db66148a24" - args = "tag v*" -} - -action "Is tag from master" { - uses = "babel/actions/commit-matches-branch@master" - needs = [ - "Is version tag", - ] - args = "master" -} - -action "Trigger GitHub release" { - uses = "babel/actions/trigger-github-release@master" - secrets = ["GITHUB_TOKEN"] - env = { - COMMIT_AUTHOR_NAME = "Babel Bot" - COMMIT_AUTHOR_EMAIL = "babel-bot@users.noreply.github.com" - } - needs = [ - "Is version tag", - "Is tag from master", - ] -} - -workflow "Welcome" { - resolves = [ - "Create Welcome Comment" - ] - on = "issues" -} - -action "Is action 'opened'" { - uses = "actions/bin/filter@master" - args = "action opened" -} - -action "Create Welcome Comment" { - uses = "babel/actions/create-welcome-comment@master" - secrets = ["GITHUB_TOKEN", "BOT_TOKEN"] - needs = ["Is action 'opened'"] -} - -workflow "Needs Info" { - resolves = [ - "Create Needs Info Comment" - ] - on = "issues" -} - -action "Is action 'labeled'" { - uses = "actions/bin/filter@master" - args = "action labeled" -} - -action "Has label 'Needs Info'" { - uses = "actions/bin/filter@master" - needs = [ - "Is action 'labeled'" - ] - args = "label 'Needs Info'" -} - -action "Create Needs Info Comment" { - uses = "babel/actions/create-needs-info-comment@master" - needs = [ - "Has label 'Needs Info'", - ] - secrets = ["BOT_TOKEN", "GITHUB_TOKEN"] -} diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml new file mode 100644 index 000000000000..574fd4f550d4 --- /dev/null +++ b/.github/workflows/issue-triage.yml @@ -0,0 +1,81 @@ +name: Issue Triage + +on: + issues: + types: [opened, labeled] + +jobs: + welcome: + name: Welcome comment + runs-on: ubuntu-latest + steps: + - name: Check if Babel member + id: is_babel_member + if: github.event.action == 'opened' + uses: babel/actions/is-org-member@v2 + with: + org: babel + username: ${{ github.event.issue.user.login }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Create Welcome Comment + uses: babel/actions/create-comment@v2 + if: | + github.event.action == 'opened' && + steps.is_babel_member.outputs.result == 0 + with: + token: ${{ secrets.BOT_TOKEN }} + issue: ${{ github.event.issue.number }} + comment: > + Hey @${{ github.event.issue.user.login }}! + We really appreciate you taking the time to report an issue. The + collaborators on this project attempt to help as many people as + possible, but we're a limited number of volunteers, so it's + possible this won't be addressed swiftly. + + + If you need any help, or just have general Babel or JavaScript questions, we have a + vibrant [Slack community](https://babeljs.slack.com) that typically always has someone + willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite." + + needs_info: + name: Needs Info + runs-on: ubuntu-latest + steps: + - name: Create Needs Info Comment + uses: babel/actions/create-comment@v2 + if: | + github.event.action == 'labeled' && + github.event.label.name == 'Needs Info' + with: + token: ${{ secrets.BOT_TOKEN }} + issue: ${{ github.event.issue.number }} + comment: > + Hi @${{ github.event.issue.user.login }}! + This issue is missing some important information we'll need + to be able to reproduce this issue. + + + Please understand that we receive a high volume of issues, + and there are only a limited number of volunteers that help + maintain this project. The easier it is for us to decipher an + issue with the info provided, the more likely it is that we'll + be able to help. + + + Please make sure you have the following information documented in + this ticket: + + 1. Your Babel configuration (typically from `.babelrc` or `babel.config.js`) + + 2. The current (incorrect) behavior you're seeing + + 3. The behavior you expect + + 4. A [short, self-contained example](http://sscce.org/) + + + Please provide either a link to the problem via the + [`repl`](https://babeljs.io/repl/), or if the `repl` is + insufficient, a new and minimal repository with instructions on + how to build/replicate the issue. + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000000..f56849952c55 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + push: + tags: ["v*"] + +jobs: + github_release: + name: Trigger GitHub release + runs-on: ubuntu-latest + steps: + - name: Checkout the new tag + uses: actions/checkout@v1.0.0 + + - name: Get tag info + id: tags + uses: babel/actions/get-release-tags@v2 + + - name: Generate the changelog + id: changelog + uses: babel/actions/generate-lerna-changelog@v2 + with: + from: ${{ steps.tags.outputs.old }} + to: ${{ steps.tags.outputs.new }} + env: + GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }} + + - name: Create a draft GitHub release + uses: babel/actions/publish-github-release@v2 + with: + tag: ${{ steps.tags.outputs.new }} + changelog: ${{ steps.changelog.outputs.changelog }} + token: ${{ secrets.BOT_TOKEN }} + + - name: Check if releasing from master + id: is_master + uses: babel/actions/ref-matches-branch@v2 + with: + name: master + + - name: Update CHANGELOG.md + if: steps.is_master.outputs.result == 1 + uses: babel/actions/update-changelog@v2 + with: + changelog: ${{ steps.changelog.outputs.changelog }} + + - name: Commit CHANGELOG.md + if: steps.is_master.outputs.result == 1 + run: | + git add CHANGELOG.md + git -c user.name="Babel Bot" -c user.email="babel-bot@users.noreply.github.com" \ + commit -m "Add ${{ steps.tags.outputs.new }} to CHANGELOG.md [skip ci]" --no-verify --quiet + git push "https://babel-bot:${{ secrets.BOT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" master From 99f4f6c3b03c7f3f67cf1b9f1a21b80cfd5b0224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 17 Sep 2019 02:14:14 +0200 Subject: [PATCH 070/965] Update Test262 (#10448) --- Makefile | 2 +- scripts/tests/test262/test262_whitelist.txt | 549 +++++++++++++++++++- 2 files changed, 549 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e8fe2d667f01..a8415c927d0f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = de567d3aa5de4eaa11e00131d26b9fe77997dfb0 +TEST262_COMMIT = ef7fd2bc27e7c10b4a71d2edc632a2934742a13e # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 0bbef1b44eb0..8f929fd51b80 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -284,6 +284,108 @@ built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default) built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) +language/expressions/assignment/dstr/ident-name-prop-name-literal-break-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-case-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-catch-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-class-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-const-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-continue-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-debugger-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-default-escaped-ext.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-default-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-delete-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-do-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-else-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-export-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-extends-escaped-ext.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-extends-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-finally-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-for-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-function-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-if-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-import-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-in-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-instanceof-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-new-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-return-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-super-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-switch-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-this-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-throw-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-try-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-typeof-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-var-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-void-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-while-escaped.js(default) +language/expressions/assignment/dstr/ident-name-prop-name-literal-with-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-break-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-break-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-case-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-case-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-catch-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-catch-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-class-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-class-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-const-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-const-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-continue-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-continue-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-debugger-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-debugger-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-default-escaped-ext.js(default) +language/expressions/assignment/member-expr-ident-name-default-escaped-ext.js(strict mode) +language/expressions/assignment/member-expr-ident-name-default-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-default-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-delete-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-delete-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-do-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-do-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-else-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-else-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-export-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-export-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-extends-escaped-ext.js(default) +language/expressions/assignment/member-expr-ident-name-extends-escaped-ext.js(strict mode) +language/expressions/assignment/member-expr-ident-name-extends-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-extends-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-finally-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-finally-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-for-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-for-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-function-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-function-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-if-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-if-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-import-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-import-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-in-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-in-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-instanceof-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-instanceof-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-new-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-new-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-return-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-return-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-super-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-super-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-switch-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-switch-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-this-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-this-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-throw-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-throw-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-try-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-try-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-typeof-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-typeof-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-var-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-var-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-void-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-void-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-while-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-while-escaped.js(strict mode) +language/expressions/assignment/member-expr-ident-name-with-escaped.js(default) +language/expressions/assignment/member-expr-ident-name-with-escaped.js(strict mode) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(strict mode) language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js(default) @@ -302,8 +404,20 @@ language/expressions/class/elements/fields-string-name-static-propname-construct language/expressions/class/elements/fields-string-name-static-propname-constructor.js(strict mode) language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(default) language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(default) language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(default) @@ -324,6 +438,8 @@ language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-dupl language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(default) language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(strict mode) +language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(default) +language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(strict mode) language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(default) language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(strict mode) language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(default) @@ -374,17 +490,322 @@ language/expressions/class/elements/syntax/early-errors/invalid-names/method-out language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(default) language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) +language/expressions/class/ident-name-method-def-break-escaped.js(default) +language/expressions/class/ident-name-method-def-break-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-case-escaped.js(default) +language/expressions/class/ident-name-method-def-case-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-catch-escaped.js(default) +language/expressions/class/ident-name-method-def-catch-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-class-escaped.js(default) +language/expressions/class/ident-name-method-def-class-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-const-escaped.js(default) +language/expressions/class/ident-name-method-def-const-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-continue-escaped.js(default) +language/expressions/class/ident-name-method-def-continue-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-debugger-escaped.js(default) +language/expressions/class/ident-name-method-def-debugger-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-default-escaped-ext.js(default) +language/expressions/class/ident-name-method-def-default-escaped-ext.js(strict mode) +language/expressions/class/ident-name-method-def-default-escaped.js(default) +language/expressions/class/ident-name-method-def-default-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-delete-escaped.js(default) +language/expressions/class/ident-name-method-def-delete-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-do-escaped.js(default) +language/expressions/class/ident-name-method-def-do-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-else-escaped.js(default) +language/expressions/class/ident-name-method-def-else-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-export-escaped.js(default) +language/expressions/class/ident-name-method-def-export-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-extends-escaped-ext.js(default) +language/expressions/class/ident-name-method-def-extends-escaped-ext.js(strict mode) +language/expressions/class/ident-name-method-def-extends-escaped.js(default) +language/expressions/class/ident-name-method-def-extends-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-finally-escaped.js(default) +language/expressions/class/ident-name-method-def-finally-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-for-escaped.js(default) +language/expressions/class/ident-name-method-def-for-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-function-escaped.js(default) +language/expressions/class/ident-name-method-def-function-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-if-escaped.js(default) +language/expressions/class/ident-name-method-def-if-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-import-escaped.js(default) +language/expressions/class/ident-name-method-def-import-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-in-escaped.js(default) +language/expressions/class/ident-name-method-def-in-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-instanceof-escaped.js(default) +language/expressions/class/ident-name-method-def-instanceof-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-new-escaped.js(default) +language/expressions/class/ident-name-method-def-new-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-return-escaped.js(default) +language/expressions/class/ident-name-method-def-return-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-super-escaped.js(default) +language/expressions/class/ident-name-method-def-super-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-switch-escaped.js(default) +language/expressions/class/ident-name-method-def-switch-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-this-escaped.js(default) +language/expressions/class/ident-name-method-def-this-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-throw-escaped.js(default) +language/expressions/class/ident-name-method-def-throw-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-try-escaped.js(default) +language/expressions/class/ident-name-method-def-try-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-typeof-escaped.js(default) +language/expressions/class/ident-name-method-def-typeof-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-var-escaped.js(default) +language/expressions/class/ident-name-method-def-var-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-void-escaped.js(default) +language/expressions/class/ident-name-method-def-void-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-while-escaped.js(default) +language/expressions/class/ident-name-method-def-while-escaped.js(strict mode) +language/expressions/class/ident-name-method-def-with-escaped.js(default) +language/expressions/class/ident-name-method-def-with-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-break-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-break-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-case-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-case-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-catch-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-catch-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-class-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-class-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-const-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-const-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-continue-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-continue-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-debugger-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-debugger-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-default-escaped-ext.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-default-escaped-ext.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-default-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-default-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-delete-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-delete-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-do-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-do-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-else-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-else-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-export-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-export-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped-ext.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped-ext.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-finally-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-finally-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-for-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-for-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-function-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-function-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-if-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-if-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-import-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-import-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-in-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-in-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-instanceof-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-instanceof-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-new-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-new-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-return-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-return-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-super-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-super-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-switch-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-switch-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-this-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-this-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-throw-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-throw-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-try-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-try-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-typeof-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-typeof-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-var-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-var-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-void-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-void-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-while-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-while-escaped.js(strict mode) +language/expressions/object/covered-ident-name-prop-name-literal-with-escaped.js(default) +language/expressions/object/covered-ident-name-prop-name-literal-with-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-break-escaped.js(default) +language/expressions/object/ident-name-method-def-break-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-case-escaped.js(default) +language/expressions/object/ident-name-method-def-case-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-catch-escaped.js(default) +language/expressions/object/ident-name-method-def-catch-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-class-escaped.js(default) +language/expressions/object/ident-name-method-def-class-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-const-escaped.js(default) +language/expressions/object/ident-name-method-def-const-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-continue-escaped.js(default) +language/expressions/object/ident-name-method-def-continue-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-debugger-escaped.js(default) +language/expressions/object/ident-name-method-def-debugger-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-default-escaped-ext.js(default) +language/expressions/object/ident-name-method-def-default-escaped-ext.js(strict mode) +language/expressions/object/ident-name-method-def-default-escaped.js(default) +language/expressions/object/ident-name-method-def-default-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-delete-escaped.js(default) +language/expressions/object/ident-name-method-def-delete-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-do-escaped.js(default) +language/expressions/object/ident-name-method-def-do-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-else-escaped.js(default) +language/expressions/object/ident-name-method-def-else-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-export-escaped.js(default) +language/expressions/object/ident-name-method-def-export-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-extends-escaped-ext.js(default) +language/expressions/object/ident-name-method-def-extends-escaped-ext.js(strict mode) +language/expressions/object/ident-name-method-def-extends-escaped.js(default) +language/expressions/object/ident-name-method-def-extends-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-finally-escaped.js(default) +language/expressions/object/ident-name-method-def-finally-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-for-escaped.js(default) +language/expressions/object/ident-name-method-def-for-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-function-escaped.js(default) +language/expressions/object/ident-name-method-def-function-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-if-escaped.js(default) +language/expressions/object/ident-name-method-def-if-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-import-escaped.js(default) +language/expressions/object/ident-name-method-def-import-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-in-escaped.js(default) +language/expressions/object/ident-name-method-def-in-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-instanceof-escaped.js(default) +language/expressions/object/ident-name-method-def-instanceof-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-new-escaped.js(default) +language/expressions/object/ident-name-method-def-new-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-return-escaped.js(default) +language/expressions/object/ident-name-method-def-return-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-super-escaped.js(default) +language/expressions/object/ident-name-method-def-super-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-switch-escaped.js(default) +language/expressions/object/ident-name-method-def-switch-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-this-escaped.js(default) +language/expressions/object/ident-name-method-def-this-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-throw-escaped.js(default) +language/expressions/object/ident-name-method-def-throw-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-try-escaped.js(default) +language/expressions/object/ident-name-method-def-try-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-typeof-escaped.js(default) +language/expressions/object/ident-name-method-def-typeof-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-var-escaped.js(default) +language/expressions/object/ident-name-method-def-var-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-void-escaped.js(default) +language/expressions/object/ident-name-method-def-void-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-while-escaped.js(default) +language/expressions/object/ident-name-method-def-while-escaped.js(strict mode) +language/expressions/object/ident-name-method-def-with-escaped.js(default) +language/expressions/object/ident-name-method-def-with-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-break-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-break-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-case-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-case-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-catch-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-catch-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-class-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-class-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-const-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-const-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-continue-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-continue-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-debugger-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-debugger-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-default-escaped-ext.js(default) +language/expressions/object/ident-name-prop-name-literal-default-escaped-ext.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-default-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-default-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-delete-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-delete-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-do-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-do-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-else-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-else-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-export-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-export-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-extends-escaped-ext.js(default) +language/expressions/object/ident-name-prop-name-literal-extends-escaped-ext.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-extends-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-extends-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-finally-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-finally-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-for-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-for-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-function-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-function-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-if-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-if-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-import-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-import-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-in-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-in-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-instanceof-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-instanceof-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-new-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-new-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-return-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-return-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-super-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-super-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-switch-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-switch-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-this-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-this-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-throw-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-throw-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-try-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-try-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-typeof-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-typeof-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-var-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-var-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-void-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-void-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-while-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-while-escaped.js(strict mode) +language/expressions/object/ident-name-prop-name-literal-with-escaped.js(default) +language/expressions/object/ident-name-prop-name-literal-with-escaped.js(strict mode) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) +language/expressions/optional-chaining/call-expression.js(default) +language/expressions/optional-chaining/call-expression.js(strict mode) +language/expressions/optional-chaining/member-expression.js(default) +language/expressions/optional-chaining/member-expression.js(strict mode) +language/expressions/optional-chaining/optional-chain-expression-optional-expression.js(default) +language/expressions/optional-chaining/optional-chain-expression-optional-expression.js(strict mode) +language/expressions/optional-chaining/optional-chain.js(default) +language/expressions/optional-chaining/optional-chain.js(strict mode) +language/expressions/optional-chaining/optional-expression.js(default) +language/expressions/optional-chaining/optional-expression.js(strict mode) +language/expressions/optional-chaining/runtime-semantics-evaluation.js(default) +language/expressions/optional-chaining/runtime-semantics-evaluation.js(strict mode) +language/expressions/optional-chaining/short-circuiting.js(default) +language/expressions/optional-chaining/short-circuiting.js(strict mode) language/expressions/template-literal/unicode-escape-nls-err.js(default) language/expressions/template-literal/unicode-escape-nls-err.js(strict mode) language/identifiers/unicode-escape-nls-err.js(default) language/identifiers/unicode-escape-nls-err.js(strict mode) -language/literals/numeric/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) +language/literals/bigint/non-octal-like-invalid-0008n.js(default) +language/literals/bigint/non-octal-like-invalid-012348n.js(default) +language/literals/bigint/non-octal-like-invalid-08n.js(default) +language/literals/bigint/non-octal-like-invalid-09n.js(default) +language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-08-err.js(default) +language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-09-err.js(default) +language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) +language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) +language/literals/bigint/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-00-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-01-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-07-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_0-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_1-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_7-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-08-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-09-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) +language/literals/numeric/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) language/literals/regexp/early-err-pattern.js(default) language/literals/regexp/early-err-pattern.js(strict mode) language/literals/regexp/invalid-braced-quantifier-exact.js(default) @@ -567,12 +988,56 @@ 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-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/syntax/await-expr-array-literal.js(default) +language/module-code/top-level-await/syntax/await-expr-array-literal.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/await-expr-func-expression.js(default) +language/module-code/top-level-await/syntax/await-expr-func-expression.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-identifier.js(default) +language/module-code/top-level-await/syntax/await-expr-identifier.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-literal-number.js(default) +language/module-code/top-level-await/syntax/await-expr-literal-number.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-literal-string.js(default) +language/module-code/top-level-await/syntax/await-expr-literal-string.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-nested.js(default) +language/module-code/top-level-await/syntax/await-expr-nested.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-new-expr.js(default) +language/module-code/top-level-await/syntax/await-expr-new-expr.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-null.js(default) +language/module-code/top-level-await/syntax/await-expr-null.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-obj-literal.js(default) +language/module-code/top-level-await/syntax/await-expr-obj-literal.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-regexp.js(default) +language/module-code/top-level-await/syntax/await-expr-regexp.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-template-literal.js(default) +language/module-code/top-level-await/syntax/await-expr-template-literal.js(strict mode) +language/module-code/top-level-await/syntax/await-expr-this.js(default) +language/module-code/top-level-await/syntax/await-expr-this.js(strict mode) +language/module-code/top-level-await/syntax/block-await-expr.js(default) +language/module-code/top-level-await/syntax/block-await-expr.js(strict mode) +language/module-code/top-level-await/syntax/if-await-expr-boolean.js(default) +language/module-code/top-level-await/syntax/if-await-expr-boolean.js(strict mode) +language/module-code/top-level-await/syntax/try-await-expr.js(default) +language/module-code/top-level-await/syntax/try-await-expr.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/fields-literal-name-static-propname-constructor.js(default) language/statements/class/elements/fields-literal-name-static-propname-constructor.js(strict mode) language/statements/class/elements/fields-string-name-static-propname-constructor.js(default) language/statements/class/elements/fields-string-name-static-propname-constructor.js(strict mode) +language/statements/class/elements/private-field-is-visible-in-computed-properties.js(default) +language/statements/class/elements/private-field-is-visible-in-computed-properties.js(strict mode) +language/statements/class/elements/private-field-with-initialized-id-is-visible-in-computed-properties.js(default) +language/statements/class/elements/private-field-with-initialized-id-is-visible-in-computed-properties.js(strict mode) language/statements/class/elements/private-methods/prod-private-method-initialize-order.js(default) language/statements/class/elements/private-methods/prod-private-method-initialize-order.js(strict mode) language/statements/class/elements/privatename-not-valid-earlyerr-script-1.js(default) @@ -583,8 +1048,20 @@ language/statements/class/elements/privatename-not-valid-earlyerr-script-3.js(de language/statements/class/elements/privatename-not-valid-earlyerr-script-3.js(strict mode) language/statements/class/elements/privatename-not-valid-earlyerr-script-4.js(default) language/statements/class/elements/privatename-not-valid-earlyerr-script-4.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(default) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(default) +language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(strict mode) language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(default) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(default) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(default) +language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(strict mode) language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(default) language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(strict mode) language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(default) @@ -605,6 +1082,8 @@ language/statements/class/elements/syntax/early-errors/grammar-privatemeth-dupli language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(strict mode) language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(default) language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(strict mode) +language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(default) +language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(strict mode) language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(default) language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(strict mode) language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(default) @@ -655,6 +1134,74 @@ language/statements/class/elements/syntax/early-errors/invalid-names/method-outt language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(default) language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) +language/statements/class/ident-name-method-def-break-escaped.js(default) +language/statements/class/ident-name-method-def-break-escaped.js(strict mode) +language/statements/class/ident-name-method-def-case-escaped.js(default) +language/statements/class/ident-name-method-def-case-escaped.js(strict mode) +language/statements/class/ident-name-method-def-catch-escaped.js(default) +language/statements/class/ident-name-method-def-catch-escaped.js(strict mode) +language/statements/class/ident-name-method-def-class-escaped.js(default) +language/statements/class/ident-name-method-def-class-escaped.js(strict mode) +language/statements/class/ident-name-method-def-const-escaped.js(default) +language/statements/class/ident-name-method-def-const-escaped.js(strict mode) +language/statements/class/ident-name-method-def-continue-escaped.js(default) +language/statements/class/ident-name-method-def-continue-escaped.js(strict mode) +language/statements/class/ident-name-method-def-debugger-escaped.js(default) +language/statements/class/ident-name-method-def-debugger-escaped.js(strict mode) +language/statements/class/ident-name-method-def-default-escaped-ext.js(default) +language/statements/class/ident-name-method-def-default-escaped-ext.js(strict mode) +language/statements/class/ident-name-method-def-default-escaped.js(default) +language/statements/class/ident-name-method-def-default-escaped.js(strict mode) +language/statements/class/ident-name-method-def-delete-escaped.js(default) +language/statements/class/ident-name-method-def-delete-escaped.js(strict mode) +language/statements/class/ident-name-method-def-do-escaped.js(default) +language/statements/class/ident-name-method-def-do-escaped.js(strict mode) +language/statements/class/ident-name-method-def-else-escaped.js(default) +language/statements/class/ident-name-method-def-else-escaped.js(strict mode) +language/statements/class/ident-name-method-def-export-escaped.js(default) +language/statements/class/ident-name-method-def-export-escaped.js(strict mode) +language/statements/class/ident-name-method-def-extends-escaped-ext.js(default) +language/statements/class/ident-name-method-def-extends-escaped-ext.js(strict mode) +language/statements/class/ident-name-method-def-extends-escaped.js(default) +language/statements/class/ident-name-method-def-extends-escaped.js(strict mode) +language/statements/class/ident-name-method-def-finally-escaped.js(default) +language/statements/class/ident-name-method-def-finally-escaped.js(strict mode) +language/statements/class/ident-name-method-def-for-escaped.js(default) +language/statements/class/ident-name-method-def-for-escaped.js(strict mode) +language/statements/class/ident-name-method-def-function-escaped.js(default) +language/statements/class/ident-name-method-def-function-escaped.js(strict mode) +language/statements/class/ident-name-method-def-if-escaped.js(default) +language/statements/class/ident-name-method-def-if-escaped.js(strict mode) +language/statements/class/ident-name-method-def-import-escaped.js(default) +language/statements/class/ident-name-method-def-import-escaped.js(strict mode) +language/statements/class/ident-name-method-def-in-escaped.js(default) +language/statements/class/ident-name-method-def-in-escaped.js(strict mode) +language/statements/class/ident-name-method-def-instanceof-escaped.js(default) +language/statements/class/ident-name-method-def-instanceof-escaped.js(strict mode) +language/statements/class/ident-name-method-def-new-escaped.js(default) +language/statements/class/ident-name-method-def-new-escaped.js(strict mode) +language/statements/class/ident-name-method-def-return-escaped.js(default) +language/statements/class/ident-name-method-def-return-escaped.js(strict mode) +language/statements/class/ident-name-method-def-super-escaped.js(default) +language/statements/class/ident-name-method-def-super-escaped.js(strict mode) +language/statements/class/ident-name-method-def-switch-escaped.js(default) +language/statements/class/ident-name-method-def-switch-escaped.js(strict mode) +language/statements/class/ident-name-method-def-this-escaped.js(default) +language/statements/class/ident-name-method-def-this-escaped.js(strict mode) +language/statements/class/ident-name-method-def-throw-escaped.js(default) +language/statements/class/ident-name-method-def-throw-escaped.js(strict mode) +language/statements/class/ident-name-method-def-try-escaped.js(default) +language/statements/class/ident-name-method-def-try-escaped.js(strict mode) +language/statements/class/ident-name-method-def-typeof-escaped.js(default) +language/statements/class/ident-name-method-def-typeof-escaped.js(strict mode) +language/statements/class/ident-name-method-def-var-escaped.js(default) +language/statements/class/ident-name-method-def-var-escaped.js(strict mode) +language/statements/class/ident-name-method-def-void-escaped.js(default) +language/statements/class/ident-name-method-def-void-escaped.js(strict mode) +language/statements/class/ident-name-method-def-while-escaped.js(default) +language/statements/class/ident-name-method-def-while-escaped.js(strict mode) +language/statements/class/ident-name-method-def-with-escaped.js(default) +language/statements/class/ident-name-method-def-with-escaped.js(strict mode) language/statements/for-in/dstr/array-rest-before-elision.js(default) language/statements/for-in/dstr/array-rest-before-elision.js(strict mode) language/statements/for-in/dstr/array-rest-elision-invalid.js(default) From 45a484f0a2802a932a951fca2f9cf1ba63b0aed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 17 Sep 2019 19:10:57 +0200 Subject: [PATCH 071/965] Enable optional chaining in test262 (#10457) --- .../test262/run_babel_parser_test262_utils.js | 1 + scripts/tests/test262/test262_whitelist.txt | 14 -------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/scripts/tests/test262/run_babel_parser_test262_utils.js b/scripts/tests/test262/run_babel_parser_test262_utils.js index 974e4a88e795..6e29062e7639 100644 --- a/scripts/tests/test262/run_babel_parser_test262_utils.js +++ b/scripts/tests/test262/run_babel_parser_test262_utils.js @@ -120,6 +120,7 @@ const featuresToPlugins = { "export-star-as-namespace-from-module": "exportNamespaceFrom", "import.meta": "importMeta", "numeric-separator-literal": "numericSeparator", + "optional-chaining": "optionalChaining", }; function getPlugins(features) { diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 8f929fd51b80..0c077f550b25 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -768,20 +768,6 @@ language/expressions/object/method-definition/private-name-early-error-gen-insid language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/expressions/optional-chaining/call-expression.js(default) -language/expressions/optional-chaining/call-expression.js(strict mode) -language/expressions/optional-chaining/member-expression.js(default) -language/expressions/optional-chaining/member-expression.js(strict mode) -language/expressions/optional-chaining/optional-chain-expression-optional-expression.js(default) -language/expressions/optional-chaining/optional-chain-expression-optional-expression.js(strict mode) -language/expressions/optional-chaining/optional-chain.js(default) -language/expressions/optional-chaining/optional-chain.js(strict mode) -language/expressions/optional-chaining/optional-expression.js(default) -language/expressions/optional-chaining/optional-expression.js(strict mode) -language/expressions/optional-chaining/runtime-semantics-evaluation.js(default) -language/expressions/optional-chaining/runtime-semantics-evaluation.js(strict mode) -language/expressions/optional-chaining/short-circuiting.js(default) -language/expressions/optional-chaining/short-circuiting.js(strict mode) language/expressions/template-literal/unicode-escape-nls-err.js(default) language/expressions/template-literal/unicode-escape-nls-err.js(strict mode) language/identifiers/unicode-escape-nls-err.js(default) From cb881e6b3f430e10fc349e358f59ecb0d2c7a16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 18 Sep 2019 00:13:51 +0200 Subject: [PATCH 072/965] =?UTF-8?q?[parser]=20Report=20escapes=20in=20kws?= =?UTF-8?q?=20only=20if=20they=20won't=20be=20used=20as=20i=E2=80=A6=20(#1?= =?UTF-8?q?0455)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can do it by tokenizing escaped keywords as normal identifiers, so that they won't be accidentally used as real keywords. --- .../babel-parser/src/parser/expression.js | 5 + packages/babel-parser/src/tokenizer/index.js | 6 +- .../async/input.js | 0 .../async/output.json | 0 .../core/escape-keyword/invalid/input.js | 3 + .../core/escape-keyword/invalid/options.json | 3 + .../escape-keyword/used-as-property/input.js | 3 + .../used-as-property/output.json | 157 +++++++ scripts/tests/test262/test262_whitelist.txt | 442 ------------------ 9 files changed, 172 insertions(+), 447 deletions(-) rename packages/babel-parser/test/fixtures/core/{valid-escape => escape-keyword}/async/input.js (100%) rename packages/babel-parser/test/fixtures/core/{valid-escape => escape-keyword}/async/output.json (100%) create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/input.js create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/input.js create mode 100644 packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 565d75e77a52..5fd5c402efc9 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2066,6 +2066,11 @@ 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; diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index f3e9a0438023..c8773f9bbe2a 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1326,11 +1326,7 @@ export default class Tokenizer extends LocationParser { readWord(): void { const word = this.readWord1(); - const type = keywordTypes.get(word) || tt.name; - - if (type.keyword && this.state.containsEsc) { - this.raise(this.state.pos, `Escape sequence in keyword ${word}`); - } + const type = (!this.state.containsEsc && keywordTypes.get(word)) || tt.name; // Allow @@iterator and @@asyncIterator as a identifier only inside type if ( diff --git a/packages/babel-parser/test/fixtures/core/valid-escape/async/input.js b/packages/babel-parser/test/fixtures/core/escape-keyword/async/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/core/valid-escape/async/input.js rename to packages/babel-parser/test/fixtures/core/escape-keyword/async/input.js diff --git a/packages/babel-parser/test/fixtures/core/valid-escape/async/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/core/valid-escape/async/output.json rename to packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/input.js b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/input.js new file mode 100644 index 000000000000..d3f6f142b83a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/input.js @@ -0,0 +1,3 @@ +var a = { + br\u{65}ak +}; 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 new file mode 100644 index 000000000000..3ef90d2032d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/invalid/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected keyword 'break' (2:2)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/input.js b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/input.js new file mode 100644 index 000000000000..d5faad627616 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/input.js @@ -0,0 +1,3 @@ +var a = { + br\u{65}ak: 2 +}; diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json new file mode 100644 index 000000000000..894aebee85f1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json @@ -0,0 +1,157 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 2 + } + }, + "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": "a" + }, + "name": "a" + }, + "init": { + "type": "ObjectExpression", + "start": 8, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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": false, + "value": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 0c077f550b25..3bfb295e2aec 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -284,108 +284,6 @@ built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default) built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) -language/expressions/assignment/dstr/ident-name-prop-name-literal-break-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-case-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-catch-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-class-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-const-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-continue-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-debugger-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-default-escaped-ext.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-default-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-delete-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-do-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-else-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-export-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-extends-escaped-ext.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-extends-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-finally-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-for-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-function-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-if-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-import-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-in-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-instanceof-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-new-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-return-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-super-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-switch-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-this-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-throw-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-try-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-typeof-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-var-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-void-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-while-escaped.js(default) -language/expressions/assignment/dstr/ident-name-prop-name-literal-with-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-break-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-break-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-case-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-case-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-catch-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-catch-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-class-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-class-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-const-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-const-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-continue-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-continue-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-debugger-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-debugger-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-default-escaped-ext.js(default) -language/expressions/assignment/member-expr-ident-name-default-escaped-ext.js(strict mode) -language/expressions/assignment/member-expr-ident-name-default-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-default-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-delete-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-delete-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-do-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-do-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-else-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-else-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-export-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-export-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-extends-escaped-ext.js(default) -language/expressions/assignment/member-expr-ident-name-extends-escaped-ext.js(strict mode) -language/expressions/assignment/member-expr-ident-name-extends-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-extends-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-finally-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-finally-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-for-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-for-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-function-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-function-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-if-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-if-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-import-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-import-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-in-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-in-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-instanceof-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-instanceof-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-new-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-new-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-return-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-return-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-super-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-super-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-switch-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-switch-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-this-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-this-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-throw-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-throw-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-try-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-try-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-typeof-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-typeof-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-var-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-var-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-void-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-void-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-while-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-while-escaped.js(strict mode) -language/expressions/assignment/member-expr-ident-name-with-escaped.js(default) -language/expressions/assignment/member-expr-ident-name-with-escaped.js(strict mode) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(strict mode) language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js(default) @@ -490,278 +388,6 @@ language/expressions/class/elements/syntax/early-errors/invalid-names/method-out language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(default) language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) -language/expressions/class/ident-name-method-def-break-escaped.js(default) -language/expressions/class/ident-name-method-def-break-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-case-escaped.js(default) -language/expressions/class/ident-name-method-def-case-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-catch-escaped.js(default) -language/expressions/class/ident-name-method-def-catch-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-class-escaped.js(default) -language/expressions/class/ident-name-method-def-class-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-const-escaped.js(default) -language/expressions/class/ident-name-method-def-const-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-continue-escaped.js(default) -language/expressions/class/ident-name-method-def-continue-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-debugger-escaped.js(default) -language/expressions/class/ident-name-method-def-debugger-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-default-escaped-ext.js(default) -language/expressions/class/ident-name-method-def-default-escaped-ext.js(strict mode) -language/expressions/class/ident-name-method-def-default-escaped.js(default) -language/expressions/class/ident-name-method-def-default-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-delete-escaped.js(default) -language/expressions/class/ident-name-method-def-delete-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-do-escaped.js(default) -language/expressions/class/ident-name-method-def-do-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-else-escaped.js(default) -language/expressions/class/ident-name-method-def-else-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-export-escaped.js(default) -language/expressions/class/ident-name-method-def-export-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-extends-escaped-ext.js(default) -language/expressions/class/ident-name-method-def-extends-escaped-ext.js(strict mode) -language/expressions/class/ident-name-method-def-extends-escaped.js(default) -language/expressions/class/ident-name-method-def-extends-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-finally-escaped.js(default) -language/expressions/class/ident-name-method-def-finally-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-for-escaped.js(default) -language/expressions/class/ident-name-method-def-for-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-function-escaped.js(default) -language/expressions/class/ident-name-method-def-function-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-if-escaped.js(default) -language/expressions/class/ident-name-method-def-if-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-import-escaped.js(default) -language/expressions/class/ident-name-method-def-import-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-in-escaped.js(default) -language/expressions/class/ident-name-method-def-in-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-instanceof-escaped.js(default) -language/expressions/class/ident-name-method-def-instanceof-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-new-escaped.js(default) -language/expressions/class/ident-name-method-def-new-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-return-escaped.js(default) -language/expressions/class/ident-name-method-def-return-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-super-escaped.js(default) -language/expressions/class/ident-name-method-def-super-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-switch-escaped.js(default) -language/expressions/class/ident-name-method-def-switch-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-this-escaped.js(default) -language/expressions/class/ident-name-method-def-this-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-throw-escaped.js(default) -language/expressions/class/ident-name-method-def-throw-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-try-escaped.js(default) -language/expressions/class/ident-name-method-def-try-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-typeof-escaped.js(default) -language/expressions/class/ident-name-method-def-typeof-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-var-escaped.js(default) -language/expressions/class/ident-name-method-def-var-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-void-escaped.js(default) -language/expressions/class/ident-name-method-def-void-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-while-escaped.js(default) -language/expressions/class/ident-name-method-def-while-escaped.js(strict mode) -language/expressions/class/ident-name-method-def-with-escaped.js(default) -language/expressions/class/ident-name-method-def-with-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-break-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-break-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-case-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-case-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-catch-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-catch-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-class-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-class-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-const-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-const-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-continue-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-continue-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-debugger-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-debugger-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-default-escaped-ext.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-default-escaped-ext.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-default-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-default-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-delete-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-delete-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-do-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-do-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-else-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-else-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-export-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-export-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped-ext.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped-ext.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-extends-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-finally-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-finally-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-for-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-for-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-function-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-function-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-if-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-if-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-import-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-import-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-in-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-in-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-instanceof-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-instanceof-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-new-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-new-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-return-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-return-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-super-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-super-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-switch-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-switch-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-this-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-this-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-throw-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-throw-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-try-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-try-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-typeof-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-typeof-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-var-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-var-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-void-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-void-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-while-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-while-escaped.js(strict mode) -language/expressions/object/covered-ident-name-prop-name-literal-with-escaped.js(default) -language/expressions/object/covered-ident-name-prop-name-literal-with-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-break-escaped.js(default) -language/expressions/object/ident-name-method-def-break-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-case-escaped.js(default) -language/expressions/object/ident-name-method-def-case-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-catch-escaped.js(default) -language/expressions/object/ident-name-method-def-catch-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-class-escaped.js(default) -language/expressions/object/ident-name-method-def-class-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-const-escaped.js(default) -language/expressions/object/ident-name-method-def-const-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-continue-escaped.js(default) -language/expressions/object/ident-name-method-def-continue-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-debugger-escaped.js(default) -language/expressions/object/ident-name-method-def-debugger-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-default-escaped-ext.js(default) -language/expressions/object/ident-name-method-def-default-escaped-ext.js(strict mode) -language/expressions/object/ident-name-method-def-default-escaped.js(default) -language/expressions/object/ident-name-method-def-default-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-delete-escaped.js(default) -language/expressions/object/ident-name-method-def-delete-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-do-escaped.js(default) -language/expressions/object/ident-name-method-def-do-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-else-escaped.js(default) -language/expressions/object/ident-name-method-def-else-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-export-escaped.js(default) -language/expressions/object/ident-name-method-def-export-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-extends-escaped-ext.js(default) -language/expressions/object/ident-name-method-def-extends-escaped-ext.js(strict mode) -language/expressions/object/ident-name-method-def-extends-escaped.js(default) -language/expressions/object/ident-name-method-def-extends-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-finally-escaped.js(default) -language/expressions/object/ident-name-method-def-finally-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-for-escaped.js(default) -language/expressions/object/ident-name-method-def-for-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-function-escaped.js(default) -language/expressions/object/ident-name-method-def-function-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-if-escaped.js(default) -language/expressions/object/ident-name-method-def-if-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-import-escaped.js(default) -language/expressions/object/ident-name-method-def-import-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-in-escaped.js(default) -language/expressions/object/ident-name-method-def-in-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-instanceof-escaped.js(default) -language/expressions/object/ident-name-method-def-instanceof-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-new-escaped.js(default) -language/expressions/object/ident-name-method-def-new-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-return-escaped.js(default) -language/expressions/object/ident-name-method-def-return-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-super-escaped.js(default) -language/expressions/object/ident-name-method-def-super-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-switch-escaped.js(default) -language/expressions/object/ident-name-method-def-switch-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-this-escaped.js(default) -language/expressions/object/ident-name-method-def-this-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-throw-escaped.js(default) -language/expressions/object/ident-name-method-def-throw-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-try-escaped.js(default) -language/expressions/object/ident-name-method-def-try-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-typeof-escaped.js(default) -language/expressions/object/ident-name-method-def-typeof-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-var-escaped.js(default) -language/expressions/object/ident-name-method-def-var-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-void-escaped.js(default) -language/expressions/object/ident-name-method-def-void-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-while-escaped.js(default) -language/expressions/object/ident-name-method-def-while-escaped.js(strict mode) -language/expressions/object/ident-name-method-def-with-escaped.js(default) -language/expressions/object/ident-name-method-def-with-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-break-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-break-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-case-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-case-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-catch-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-catch-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-class-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-class-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-const-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-const-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-continue-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-continue-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-debugger-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-debugger-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-default-escaped-ext.js(default) -language/expressions/object/ident-name-prop-name-literal-default-escaped-ext.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-default-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-default-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-delete-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-delete-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-do-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-do-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-else-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-else-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-export-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-export-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-extends-escaped-ext.js(default) -language/expressions/object/ident-name-prop-name-literal-extends-escaped-ext.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-extends-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-extends-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-finally-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-finally-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-for-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-for-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-function-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-function-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-if-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-if-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-import-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-import-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-in-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-in-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-instanceof-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-instanceof-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-new-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-new-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-return-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-return-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-super-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-super-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-switch-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-switch-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-this-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-this-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-throw-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-throw-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-try-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-try-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-typeof-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-typeof-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-var-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-var-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-void-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-void-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-while-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-while-escaped.js(strict mode) -language/expressions/object/ident-name-prop-name-literal-with-escaped.js(default) -language/expressions/object/ident-name-prop-name-literal-with-escaped.js(strict mode) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(default) @@ -1120,74 +746,6 @@ language/statements/class/elements/syntax/early-errors/invalid-names/method-outt language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(default) language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) -language/statements/class/ident-name-method-def-break-escaped.js(default) -language/statements/class/ident-name-method-def-break-escaped.js(strict mode) -language/statements/class/ident-name-method-def-case-escaped.js(default) -language/statements/class/ident-name-method-def-case-escaped.js(strict mode) -language/statements/class/ident-name-method-def-catch-escaped.js(default) -language/statements/class/ident-name-method-def-catch-escaped.js(strict mode) -language/statements/class/ident-name-method-def-class-escaped.js(default) -language/statements/class/ident-name-method-def-class-escaped.js(strict mode) -language/statements/class/ident-name-method-def-const-escaped.js(default) -language/statements/class/ident-name-method-def-const-escaped.js(strict mode) -language/statements/class/ident-name-method-def-continue-escaped.js(default) -language/statements/class/ident-name-method-def-continue-escaped.js(strict mode) -language/statements/class/ident-name-method-def-debugger-escaped.js(default) -language/statements/class/ident-name-method-def-debugger-escaped.js(strict mode) -language/statements/class/ident-name-method-def-default-escaped-ext.js(default) -language/statements/class/ident-name-method-def-default-escaped-ext.js(strict mode) -language/statements/class/ident-name-method-def-default-escaped.js(default) -language/statements/class/ident-name-method-def-default-escaped.js(strict mode) -language/statements/class/ident-name-method-def-delete-escaped.js(default) -language/statements/class/ident-name-method-def-delete-escaped.js(strict mode) -language/statements/class/ident-name-method-def-do-escaped.js(default) -language/statements/class/ident-name-method-def-do-escaped.js(strict mode) -language/statements/class/ident-name-method-def-else-escaped.js(default) -language/statements/class/ident-name-method-def-else-escaped.js(strict mode) -language/statements/class/ident-name-method-def-export-escaped.js(default) -language/statements/class/ident-name-method-def-export-escaped.js(strict mode) -language/statements/class/ident-name-method-def-extends-escaped-ext.js(default) -language/statements/class/ident-name-method-def-extends-escaped-ext.js(strict mode) -language/statements/class/ident-name-method-def-extends-escaped.js(default) -language/statements/class/ident-name-method-def-extends-escaped.js(strict mode) -language/statements/class/ident-name-method-def-finally-escaped.js(default) -language/statements/class/ident-name-method-def-finally-escaped.js(strict mode) -language/statements/class/ident-name-method-def-for-escaped.js(default) -language/statements/class/ident-name-method-def-for-escaped.js(strict mode) -language/statements/class/ident-name-method-def-function-escaped.js(default) -language/statements/class/ident-name-method-def-function-escaped.js(strict mode) -language/statements/class/ident-name-method-def-if-escaped.js(default) -language/statements/class/ident-name-method-def-if-escaped.js(strict mode) -language/statements/class/ident-name-method-def-import-escaped.js(default) -language/statements/class/ident-name-method-def-import-escaped.js(strict mode) -language/statements/class/ident-name-method-def-in-escaped.js(default) -language/statements/class/ident-name-method-def-in-escaped.js(strict mode) -language/statements/class/ident-name-method-def-instanceof-escaped.js(default) -language/statements/class/ident-name-method-def-instanceof-escaped.js(strict mode) -language/statements/class/ident-name-method-def-new-escaped.js(default) -language/statements/class/ident-name-method-def-new-escaped.js(strict mode) -language/statements/class/ident-name-method-def-return-escaped.js(default) -language/statements/class/ident-name-method-def-return-escaped.js(strict mode) -language/statements/class/ident-name-method-def-super-escaped.js(default) -language/statements/class/ident-name-method-def-super-escaped.js(strict mode) -language/statements/class/ident-name-method-def-switch-escaped.js(default) -language/statements/class/ident-name-method-def-switch-escaped.js(strict mode) -language/statements/class/ident-name-method-def-this-escaped.js(default) -language/statements/class/ident-name-method-def-this-escaped.js(strict mode) -language/statements/class/ident-name-method-def-throw-escaped.js(default) -language/statements/class/ident-name-method-def-throw-escaped.js(strict mode) -language/statements/class/ident-name-method-def-try-escaped.js(default) -language/statements/class/ident-name-method-def-try-escaped.js(strict mode) -language/statements/class/ident-name-method-def-typeof-escaped.js(default) -language/statements/class/ident-name-method-def-typeof-escaped.js(strict mode) -language/statements/class/ident-name-method-def-var-escaped.js(default) -language/statements/class/ident-name-method-def-var-escaped.js(strict mode) -language/statements/class/ident-name-method-def-void-escaped.js(default) -language/statements/class/ident-name-method-def-void-escaped.js(strict mode) -language/statements/class/ident-name-method-def-while-escaped.js(default) -language/statements/class/ident-name-method-def-while-escaped.js(strict mode) -language/statements/class/ident-name-method-def-with-escaped.js(default) -language/statements/class/ident-name-method-def-with-escaped.js(strict mode) language/statements/for-in/dstr/array-rest-before-elision.js(default) language/statements/for-in/dstr/array-rest-before-elision.js(strict mode) language/statements/for-in/dstr/array-rest-elision-invalid.js(default) From 0ef49722959bd65c0e845e9f0b33a46a214c1056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 18 Sep 2019 00:14:27 +0200 Subject: [PATCH 073/965] Ignore regexp tests from test262 (#10458) --- .../test262/run_babel_parser_test262_utils.js | 4 + scripts/tests/test262/test262_whitelist.txt | 454 ------------------ 2 files changed, 4 insertions(+), 454 deletions(-) diff --git a/scripts/tests/test262/run_babel_parser_test262_utils.js b/scripts/tests/test262/run_babel_parser_test262_utils.js index 6e29062e7639..1434eedfd629 100644 --- a/scripts/tests/test262/run_babel_parser_test262_utils.js +++ b/scripts/tests/test262/run_babel_parser_test262_utils.js @@ -108,6 +108,8 @@ const ignoredFeatures = [ "well-formed-json-stringify", ]; +const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"]; + const featuresToPlugins = { BigInt: "bigInt", "class-fields-private": "classPrivateProperties", @@ -153,6 +155,8 @@ exports.getTests = function(testDir) { // strip test/ const fileName = test.file.substr(5); + if (ignoredTests.some(start => fileName.startsWith(start))) return; + tests.push({ contents: test.contents, fileName, diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 3bfb295e2aec..d3579a6eccef 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -1,287 +1,3 @@ -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_F-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_F-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_F.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_F.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Invalid-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Invalid-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Invalid.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Invalid.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_N-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_N-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_N.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_N.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_No-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_No-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_No.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_No.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_T-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_T-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_T.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_T.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Y-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Y-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Y.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Y.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Yes-negated.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Yes-negated.js(strict mode) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Yes.js(default) -built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_Yes.js(strict mode) -built-ins/RegExp/property-escapes/character-class-range-end.js(default) -built-ins/RegExp/property-escapes/character-class-range-end.js(strict mode) -built-ins/RegExp/property-escapes/character-class-range-no-dash-end.js(default) -built-ins/RegExp/property-escapes/character-class-range-no-dash-end.js(strict mode) -built-ins/RegExp/property-escapes/character-class-range-no-dash-start.js(default) -built-ins/RegExp/property-escapes/character-class-range-no-dash-start.js(strict mode) -built-ins/RegExp/property-escapes/character-class-range-start.js(default) -built-ins/RegExp/property-escapes/character-class-range-start.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Block-implicit-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Block-implicit-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Block-implicit.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Block-implicit.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-implicit-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-implicit-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-implicit.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-implicit.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script.js(default) -built-ins/RegExp/property-escapes/grammar-extension-In-prefix-Script.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-Is-prefix-Script-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-Is-prefix-Script-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-Is-prefix-Script.js(default) -built-ins/RegExp/property-escapes/grammar-extension-Is-prefix-Script.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-circumflex-negation-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-circumflex-negation-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-circumflex-negation.js(default) -built-ins/RegExp/property-escapes/grammar-extension-circumflex-negation.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-empty-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-empty-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-empty.js(default) -built-ins/RegExp/property-escapes/grammar-extension-empty.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-invalid-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-invalid-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-invalid.js(default) -built-ins/RegExp/property-escapes/grammar-extension-invalid.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-value-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-value-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-value.js(default) -built-ins/RegExp/property-escapes/grammar-extension-no-braces-value.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-no-braces.js(default) -built-ins/RegExp/property-escapes/grammar-extension-no-braces.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator-and-value-only-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator-and-value-only-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator-and-value-only.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator-and-value-only.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator-only-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator-only-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator-only.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator-only.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-separator.js(default) -built-ins/RegExp/property-escapes/grammar-extension-separator.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-unclosed-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-unclosed-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-unclosed.js(default) -built-ins/RegExp/property-escapes/grammar-extension-unclosed.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-unopened-negated.js(default) -built-ins/RegExp/property-escapes/grammar-extension-unopened-negated.js(strict mode) -built-ins/RegExp/property-escapes/grammar-extension-unopened.js(default) -built-ins/RegExp/property-escapes/grammar-extension-unopened.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-01-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-01-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-01.js(default) -built-ins/RegExp/property-escapes/loose-matching-01.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-02-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-02-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-02.js(default) -built-ins/RegExp/property-escapes/loose-matching-02.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-03-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-03-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-03.js(default) -built-ins/RegExp/property-escapes/loose-matching-03.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-04-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-04-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-04.js(default) -built-ins/RegExp/property-escapes/loose-matching-04.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-05-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-05-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-05.js(default) -built-ins/RegExp/property-escapes/loose-matching-05.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-06-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-06-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-06.js(default) -built-ins/RegExp/property-escapes/loose-matching-06.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-07-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-07-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-07.js(default) -built-ins/RegExp/property-escapes/loose-matching-07.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-08-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-08-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-08.js(default) -built-ins/RegExp/property-escapes/loose-matching-08.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-09-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-09-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-09.js(default) -built-ins/RegExp/property-escapes/loose-matching-09.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-10-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-10-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-10.js(default) -built-ins/RegExp/property-escapes/loose-matching-10.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-11-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-11-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-11.js(default) -built-ins/RegExp/property-escapes/loose-matching-11.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-12-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-12-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-12.js(default) -built-ins/RegExp/property-escapes/loose-matching-12.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-13-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-13-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-13.js(default) -built-ins/RegExp/property-escapes/loose-matching-13.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-14-negated.js(default) -built-ins/RegExp/property-escapes/loose-matching-14-negated.js(strict mode) -built-ins/RegExp/property-escapes/loose-matching-14.js(default) -built-ins/RegExp/property-escapes/loose-matching-14.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-equals-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-equals-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-equals.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-equals.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-General_Category.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-equals-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-equals-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-equals.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-equals.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-equals-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-equals-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-equals.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-equals.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-negated.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions.js(default) -built-ins/RegExp/property-escapes/non-binary-property-without-value-Script_Extensions.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-binary-property-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-binary-property-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-binary-property.js(default) -built-ins/RegExp/property-escapes/non-existent-binary-property.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-and-value-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-property-and-value-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-and-value.js(default) -built-ins/RegExp/property-escapes/non-existent-property-and-value.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-existing-value-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-property-existing-value-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-existing-value.js(default) -built-ins/RegExp/property-escapes/non-existent-property-existing-value.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-General_Category-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-General_Category-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-Script-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-Script-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-Script.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-Script.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-Script_Extensions-negated.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-Script_Extensions-negated.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-Script_Extensions.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-Script_Extensions.js(strict mode) -built-ins/RegExp/property-escapes/non-existent-property-value-general-category.js(default) -built-ins/RegExp/property-escapes/non-existent-property-value-general-category.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Composition_Exclusion-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Composition_Exclusion-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Composition_Exclusion.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Composition_Exclusion.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFC-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFC-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFC.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFC.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFD-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFD-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFD.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFD.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKC-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKC-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKC.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKC.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKD-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKD-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKD.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Expands_On_NFKD.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-FC_NFKC_Closure-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-FC_NFKC_Closure-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-FC_NFKC_Closure.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-FC_NFKC_Closure.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Full_Composition_Exclusion-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Full_Composition_Exclusion-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Full_Composition_Exclusion.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Full_Composition_Exclusion.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Grapheme_Link-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Grapheme_Link-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Grapheme_Link.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Grapheme_Link.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Hyphen-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Hyphen-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Hyphen.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Hyphen.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Alphabetic-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Alphabetic-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Alphabetic.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Alphabetic.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Default_Ignorable_Code_Point-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Default_Ignorable_Code_Point-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Default_Ignorable_Code_Point.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Default_Ignorable_Code_Point.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Grapheme_Extend-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Grapheme_Extend-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Grapheme_Extend.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Grapheme_Extend.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Continue-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Continue-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Continue.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Continue.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Start-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Start-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Start.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_ID_Start.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Lowercase-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Lowercase-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Lowercase.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Lowercase.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Math-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Math-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Math.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Math.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Uppercase-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Uppercase-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Uppercase.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Other_Uppercase.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Prepended_Concatenation_Mark-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Prepended_Concatenation_Mark-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-binary-property-Prepended_Concatenation_Mark.js(default) -built-ins/RegExp/property-escapes/unsupported-binary-property-Prepended_Concatenation_Mark.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Block-with-value-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Block-with-value-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Block-with-value.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Block-with-value.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-FC_NFKC_Closure-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-property-FC_NFKC_Closure-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-FC_NFKC_Closure.js(default) -built-ins/RegExp/property-escapes/unsupported-property-FC_NFKC_Closure.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value-negated.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value-negated.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break-with-value.js(strict mode) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(default) -built-ins/RegExp/property-escapes/unsupported-property-Line_Break.js(strict mode) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default) @@ -418,176 +134,6 @@ language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal- language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) -language/literals/regexp/early-err-pattern.js(default) -language/literals/regexp/early-err-pattern.js(strict mode) -language/literals/regexp/invalid-braced-quantifier-exact.js(default) -language/literals/regexp/invalid-braced-quantifier-exact.js(strict mode) -language/literals/regexp/invalid-braced-quantifier-lower.js(default) -language/literals/regexp/invalid-braced-quantifier-lower.js(strict mode) -language/literals/regexp/invalid-braced-quantifier-range.js(default) -language/literals/regexp/invalid-braced-quantifier-range.js(strict mode) -language/literals/regexp/invalid-optional-lookbehind.js(default) -language/literals/regexp/invalid-optional-lookbehind.js(strict mode) -language/literals/regexp/invalid-optional-negative-lookbehind.js(default) -language/literals/regexp/invalid-optional-negative-lookbehind.js(strict mode) -language/literals/regexp/invalid-range-lookbehind.js(default) -language/literals/regexp/invalid-range-lookbehind.js(strict mode) -language/literals/regexp/invalid-range-negative-lookbehind.js(default) -language/literals/regexp/invalid-range-negative-lookbehind.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-2.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-2.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-3.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-3.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-4.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-4.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-5.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-5.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-u.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-u.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js(strict mode) -language/literals/regexp/named-groups/invalid-dangling-groupname.js(default) -language/literals/regexp/named-groups/invalid-dangling-groupname.js(strict mode) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js(default) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js(strict mode) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js(default) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js(strict mode) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-empty-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-empty-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js(default) -language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js(strict mode) -language/literals/regexp/named-groups/invalid-incomplete-groupname.js(default) -language/literals/regexp/named-groups/invalid-incomplete-groupname.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js(default) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2.js(default) -language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2.js(strict mode) -language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js(strict mode) -language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js(default) -language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js(strict mode) -language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js(default) -language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js(strict mode) -language/literals/regexp/u-dec-esc.js(default) -language/literals/regexp/u-dec-esc.js(strict mode) -language/literals/regexp/u-invalid-class-escape.js(default) -language/literals/regexp/u-invalid-class-escape.js(strict mode) -language/literals/regexp/u-invalid-extended-pattern-char.js(default) -language/literals/regexp/u-invalid-extended-pattern-char.js(strict mode) -language/literals/regexp/u-invalid-identity-escape.js(default) -language/literals/regexp/u-invalid-identity-escape.js(strict mode) -language/literals/regexp/u-invalid-legacy-octal-escape.js(default) -language/literals/regexp/u-invalid-legacy-octal-escape.js(strict mode) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-a.js(default) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-a.js(strict mode) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-ab.js(default) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-ab.js(strict mode) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-b.js(default) -language/literals/regexp/u-invalid-non-empty-class-ranges-no-dash-b.js(strict mode) -language/literals/regexp/u-invalid-non-empty-class-ranges.js(default) -language/literals/regexp/u-invalid-non-empty-class-ranges.js(strict mode) -language/literals/regexp/u-invalid-oob-decimal-escape.js(default) -language/literals/regexp/u-invalid-oob-decimal-escape.js(strict mode) -language/literals/regexp/u-invalid-optional-lookahead.js(default) -language/literals/regexp/u-invalid-optional-lookahead.js(strict mode) -language/literals/regexp/u-invalid-optional-lookbehind.js(default) -language/literals/regexp/u-invalid-optional-lookbehind.js(strict mode) -language/literals/regexp/u-invalid-optional-negative-lookahead.js(default) -language/literals/regexp/u-invalid-optional-negative-lookahead.js(strict mode) -language/literals/regexp/u-invalid-optional-negative-lookbehind.js(default) -language/literals/regexp/u-invalid-optional-negative-lookbehind.js(strict mode) -language/literals/regexp/u-invalid-range-lookahead.js(default) -language/literals/regexp/u-invalid-range-lookahead.js(strict mode) -language/literals/regexp/u-invalid-range-lookbehind.js(default) -language/literals/regexp/u-invalid-range-lookbehind.js(strict mode) -language/literals/regexp/u-invalid-range-negative-lookahead.js(default) -language/literals/regexp/u-invalid-range-negative-lookahead.js(strict mode) -language/literals/regexp/u-invalid-range-negative-lookbehind.js(default) -language/literals/regexp/u-invalid-range-negative-lookbehind.js(strict mode) -language/literals/regexp/u-unicode-esc-bounds.js(default) -language/literals/regexp/u-unicode-esc-bounds.js(strict mode) -language/literals/regexp/u-unicode-esc-non-hex.js(default) -language/literals/regexp/u-unicode-esc-non-hex.js(strict mode) -language/literals/regexp/unicode-escape-nls-err.js(default) -language/literals/regexp/unicode-escape-nls-err.js(strict mode) language/literals/string/unicode-escape-nls-err-double.js(default) language/literals/string/unicode-escape-nls-err-double.js(strict mode) language/literals/string/unicode-escape-nls-err-single.js(default) From 87dc201411c75254f99097102385b7a59ff9a334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 17 Sep 2019 18:38:15 -0400 Subject: [PATCH 074/965] refactor: replace regexp-tree by regexpu (#10430) --- .../package.json | 8 +++++-- .../src/index.js | 22 ++++++++++--------- .../escape-no-unicode-flag/options.json | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) 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 257f7e8f8a15..70ecd949d527 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -11,10 +11,14 @@ "regexp", "regular expressions" ], - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-named-capturing-groups-regex", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-transform-named-capturing-groups-regex" + }, "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "regexp-tree": "^0.1.13" + "regexpu-core": "^4.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 d646101852e0..148da9e99a55 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,4 +1,4 @@ -import regexpTree from "regexp-tree"; +import rewritePattern from "regexpu-core"; export default function({ types: t }, options) { const { runtime = true } = options; @@ -19,16 +19,18 @@ export default function({ types: t }, options) { return; } - const result = regexpTree.compatTranspile(node.extra.raw, [ - "namedCapturingGroups", - ]); - const { namedCapturingGroups } = result.getExtra(); + 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 ( - namedCapturingGroups && - Object.keys(namedCapturingGroups).length > 0 - ) { - node.pattern = result.getSource(); + if (Object.keys(namedCapturingGroups).length > 0) { + node.pattern = result; if (runtime && !isRegExpTest(path)) { path.replaceWith( diff --git a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/syntax/escape-no-unicode-flag/options.json b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/syntax/escape-no-unicode-flag/options.json index 47dc981e754b..f41e9ff57d0e 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/syntax/escape-no-unicode-flag/options.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/test/fixtures/syntax/escape-no-unicode-flag/options.json @@ -1,3 +1,3 @@ { - "throws": "invalid group Unicode name \"\\u{41}\", use `u` flag." + "throws": "Invalid escape sequence at position 3" } From 9c1ad0a9f7f8c57e02a20e9f151fce8076d80725 Mon Sep 17 00:00:00 2001 From: Guy Waldman Date: Wed, 18 Sep 2019 02:19:45 +0300 Subject: [PATCH 075/965] [parser] Disallow static fields named `constructor` (#10461) * Disallow static fields named `constructor` in a class - Disallowed static fields named `constructor` in a class (previously only non-static were disallowed) - Updated the text for the error for one consolidated warning, for both static and non-static fields - Added a test - Updated an existing test in the `flow` test suite of the parser to reflect the parse error. Strangely, the test used to pass and started failing when inlining the `isNonstaticConstructor` method, without any changes. In that test, `constructor` was a field, so in theory it should never have passed. Would appreciate some feedback on this, as I'm not 100% sure if this is somehow related to Flow * Update test262 whitelist * Add comment and fix && operator --- packages/babel-parser/src/parser/statement.js | 11 +- .../class-properties/no-ctor-2/options.json | 2 +- .../class-properties/no-ctor/options.json | 2 +- .../static-field-named-constructor/input.js | 3 + .../options.json | 4 + .../options.json | 1 + .../output.json | 169 ------------------ scripts/tests/test262/test262_whitelist.txt | 8 - 8 files changed, 18 insertions(+), 182 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json delete mode 100644 packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 3e950d26578b..bb5702e7de34 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1498,13 +1498,18 @@ export default class StatementParser extends ExpressionParser { } pushClassProperty(classBody: N.ClassBody, prop: N.ClassProperty) { - // This only affects properties, not methods. - if (this.isNonstaticConstructor(prop)) { + if ( + !prop.computed && + (prop.key.name === "constructor" || prop.key.value === "constructor") + ) { + // Non-computed field, which is either an identifier named "constructor" + // or a string literal named "constructor" this.raise( prop.key.start, - "Classes may not have a non-static field named 'constructor'", + "Classes may not have a field named 'constructor'", ); } + classBody.body.push(this.parseClassProperty(prop)); } 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 9884529d32d7..5560d1052435 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,4 @@ { - "throws": "Classes may not have a non-static field named 'constructor' (2:2)", + "throws": "Classes may not have a field named 'constructor' (2:2)", "plugins": ["classProperties"] } 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 9884529d32d7..5560d1052435 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,4 @@ { - "throws": "Classes may not have a non-static field named 'constructor' (2:2)", + "throws": "Classes may not have a field named 'constructor' (2:2)", "plugins": ["classProperties"] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js new file mode 100644 index 000000000000..d9180dcec0cc --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/input.js @@ -0,0 +1,3 @@ +class Foo { + static constructor; +} 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 new file mode 100644 index 000000000000..36858dc626ae --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/options.json @@ -0,0 +1,4 @@ +{ + "throws": "Classes may not have a field named 'constructor' (2:11)", + "plugins": ["classProperties"] +} 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 3c8f72c90062..382ffd0c6970 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,3 +1,4 @@ { + "throws": "Classes may not have a field named 'constructor' (2:2)", "plugins": ["jsx", "flow", "classProperties"] } 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 deleted file mode 100644 index 38c7d603748f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "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/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index d3579a6eccef..01c45f11a59d 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -12,10 +12,6 @@ language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js(strict mode) language/expressions/class/elements/fields-duplicate-privatenames.js(default) language/expressions/class/elements/fields-duplicate-privatenames.js(strict mode) -language/expressions/class/elements/fields-literal-name-static-propname-constructor.js(default) -language/expressions/class/elements/fields-literal-name-static-propname-constructor.js(strict mode) -language/expressions/class/elements/fields-string-name-static-propname-constructor.js(default) -language/expressions/class/elements/fields-string-name-static-propname-constructor.js(strict mode) language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(default) language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) @@ -188,10 +184,6 @@ language/module-code/top-level-await/syntax/try-await-expr.js(default) language/module-code/top-level-await/syntax/try-await-expr.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/fields-literal-name-static-propname-constructor.js(default) -language/statements/class/elements/fields-literal-name-static-propname-constructor.js(strict mode) -language/statements/class/elements/fields-string-name-static-propname-constructor.js(default) -language/statements/class/elements/fields-string-name-static-propname-constructor.js(strict mode) language/statements/class/elements/private-field-is-visible-in-computed-properties.js(default) language/statements/class/elements/private-field-is-visible-in-computed-properties.js(strict mode) language/statements/class/elements/private-field-with-initialized-id-is-visible-in-computed-properties.js(default) From 3a7b6e1c22bd844f5e16bffd56938fec93762d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 20 Sep 2019 12:54:28 +0200 Subject: [PATCH 076/965] Force update of test262-stream v1.2.0 doesn't support Test262 v4 --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 82008898b833..023280c6f37c 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "rollup-plugin-babel": "^4.0.0", "rollup-plugin-node-resolve": "^5.0.0", "rollup-plugin-replace": "^2.2.0", - "test262-stream": "^1.2.0", + "test262-stream": "^1.3.0", "through2": "^2.0.0", "typescript": "^3.6.3", "warnings-to-errors-webpack-plugin": "^2.0.0", diff --git a/yarn.lock b/yarn.lock index c83319802dc5..973be865ace4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10180,7 +10180,7 @@ test-exclude@^5.2.3: read-pkg-up "^4.0.0" require-main-filename "^2.0.0" -test262-stream@^1.2.0: +test262-stream@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/test262-stream/-/test262-stream-1.3.0.tgz#98c4ab9f8e74c7f9478afcf52e071a89d319df61" integrity sha512-TSv+Z4hftmRuUJVJk7kaguWLlVLRfwyWm1DOt4kvTXAanATxv6A1HhjRTrSBI00XXEWQ+cUdsDii8tn+fkjXyw== From 46c70ad73460606eeb93371776e112f54d2f156a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 20 Sep 2019 17:27:49 +0200 Subject: [PATCH 077/965] Update PULL_REQUEST_TEMPLATE.md (#10473) [skip ci] --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a45e7ae92cfe..f805376b4926 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,7 +11,7 @@ If you are making a change that should have a docs update: submit another PR to | Q                       | A | ------------------------ | --- -| Fixed Issues? | `Fixes #1, Fixes #2` +| Fixed Issues? | `Fixes #1, Fixes #2` | Patch: Bug Fix? | | Major: Breaking Change? | | Minor: New Feature? | From b7333ea97ae50a2b5f2aa747c485579b28082f26 Mon Sep 17 00:00:00 2001 From: Vivek Nayyar Date: Sat, 21 Sep 2019 03:52:37 +0530 Subject: [PATCH 078/965] added check to disallow super.private variable access and test case added (#10472) * :rocket: added check to disallow super.private variable access and test case added * :recycle: change the other linting change back to how it was * :recycle: change the other linting change back to how it was * :recycle: added newline at the end test output.json file * :recycle: changed the linting style to the way it was * :recycle: updated error message, removed super private member access test cases from whitelist of flow and test 262 suite * :recycle: added newline in output.json --- packages/babel-parser/src/parser/expression.js | 6 ++++++ .../super-private-member-access/input.js | 7 +++++++ .../super-private-member-access/options.json | 6 ++++++ scripts/tests/flow/flow_tests_whitelist.txt | 1 - scripts/tests/test262/test262_whitelist.txt | 4 ---- 5 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 5fd5c402efc9..f7e75bfe5ea3 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -655,6 +655,12 @@ export default class ExpressionParser extends LValParser { node.object = base; node.property = this.parseMaybePrivateName(); node.computed = false; + if ( + node.property.type === "PrivateName" && + node.object.type === "Super" + ) { + this.raise(startPos, "Private fields can't be accessed on super"); + } if (state.optionalChainMember) { node.optional = false; return this.finishNode(node, "OptionalMemberExpression"); diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js new file mode 100644 index 000000000000..5cd2ffd252f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/input.js @@ -0,0 +1,7 @@ +class A extends B { + #x; + + method() { + super.#x; + } +} 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 new file mode 100644 index 000000000000..162c282e64a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "classPrivateProperties" + ], + "throws": "Private fields can't be accessed on super (5:4)" +} diff --git a/scripts/tests/flow/flow_tests_whitelist.txt b/scripts/tests/flow/flow_tests_whitelist.txt index 43f45ad565ad..f3704b19d867 100644 --- a/scripts/tests/flow/flow_tests_whitelist.txt +++ b/scripts/tests/flow/flow_tests_whitelist.txt @@ -19,7 +19,6 @@ class_properties/migrated_0021.js class_properties/migrated_0026.js decorators/migrated_0003.js private_class_properties/multiple.js -private_class_properties/super.js private_class_properties/getter_and_field.js private_class_properties/getter_duplicate.js private_class_properties/setter_and_field.js diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 01c45f11a59d..851b2ddb9f5e 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -98,8 +98,6 @@ language/expressions/class/elements/syntax/early-errors/invalid-names/method-out language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(default) -language/expressions/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(default) @@ -282,8 +280,6 @@ language/statements/class/elements/syntax/early-errors/invalid-names/method-outt language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(default) -language/statements/class/elements/syntax/early-errors/super-private-access-invalid.js(strict mode) language/statements/for-in/dstr/array-rest-before-elision.js(default) language/statements/for-in/dstr/array-rest-before-elision.js(strict mode) language/statements/for-in/dstr/array-rest-elision-invalid.js(default) From 962015f7e73a4ffcec4f77fa670b47682edf53b0 Mon Sep 17 00:00:00 2001 From: Tomer Aberbach Date: Sun, 22 Sep 2019 17:00:13 -0400 Subject: [PATCH 079/965] docs: updates docs of `findParent` and `find` (#10479) [skip ci] Makes the documentation of `findParent` and `find` consistent and documents their `null` cases. --- packages/babel-traverse/src/path/ancestry.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/babel-traverse/src/path/ancestry.js b/packages/babel-traverse/src/path/ancestry.js index 7cc341032255..e2667d1c8dd0 100644 --- a/packages/babel-traverse/src/path/ancestry.js +++ b/packages/babel-traverse/src/path/ancestry.js @@ -4,8 +4,10 @@ import * as t from "@babel/types"; import NodePath from "./index"; /** - * Call the provided `callback` with the `NodePath`s of all the parents. - * When the `callback` returns a truthy value, we return that node path. + * Starting at the parent path of the current `NodePath` and going up the + * tree, return the first `NodePath` that causes the provided `callback` + * to return a truthy value, or `null` if the `callback` never returns a + * truthy value. */ export function findParent(callback): ?NodePath { @@ -18,7 +20,8 @@ export function findParent(callback): ?NodePath { /** * Starting at current `NodePath` and going up the tree, return the first - * `NodePath` that causes the provided `callback` to return a truthy value. + * `NodePath` that causes the provided `callback` to return a truthy value, + * or `null` if the `callback` never returns a truthy value. */ export function find(callback): ?NodePath { From 3069747a81e232fccfd521376036ee9c4d585fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 23 Sep 2019 19:14:43 +0200 Subject: [PATCH 080/965] =?UTF-8?q?Leave=20trailing=20comments=20after=20h?= =?UTF-8?q?andling=20a=20possible=20trailing=20com=E2=80=A6=20(#10445)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Leave trailing comments aftre handling a possible trailing comma * perf --- packages/babel-parser/src/parser/comments.js | 41 +- .../output.json | 20 +- .../comments/regression/10230/output.json | 20 +- .../comments/regression/10432/input.js | 5 + .../comments/regression/10432/output.json | 431 ++++++++++++++++++ 5 files changed, 507 insertions(+), 10 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10432/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10432/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 2f512ed904e9..8554ffaf52cc 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -38,7 +38,19 @@ export default class CommentsParser extends BaseParser { this.state.leadingComments.push(comment); } - adjustCommentsAfterTrailingComma(node: Node, elements: Node[]) { + adjustCommentsAfterTrailingComma( + node: Node, + elements: Node[], + // When the current node is followed by a token which hasn't a respective AST node, we + // need to take all the trailing comments to prevent them from being attached to an + // unrelated node. e.g. in + // var { x } /* cmt */ = { y } + // we don't want /* cmt */ to be attached to { y }. + // On the other hand, in + // fn(x) [new line] /* cmt */ [new line] y + // /* cmt */ is both a trailing comment of fn(x) and a leading comment of y + takeAllComments?: boolean, + ) { if (this.state.leadingComments.length === 0) { return; } @@ -59,10 +71,16 @@ export default class CommentsParser extends BaseParser { } const newTrailingComments = []; - while (this.state.leadingComments.length) { - const leadingComment = this.state.leadingComments.shift(); + for (let i = 0; i < this.state.leadingComments.length; i++) { + const leadingComment = this.state.leadingComments[i]; if (leadingComment.end < node.end) { newTrailingComments.push(leadingComment); + + // Perf: we don't need to splice if we are going to reset the array anyway + if (!takeAllComments) { + this.state.leadingComments.splice(i, 1); + i--; + } } else { if (node.trailingComments === undefined) { node.trailingComments = []; @@ -70,6 +88,7 @@ export default class CommentsParser extends BaseParser { node.trailingComments.push(leadingComment); } } + if (takeAllComments) this.state.leadingComments = []; if (newTrailingComments.length > 0) { lastElement.trailingComments = newTrailingComments; @@ -130,16 +149,20 @@ export default class CommentsParser extends BaseParser { if (firstChild) { switch (node.type) { case "ObjectExpression": - case "ObjectPattern": this.adjustCommentsAfterTrailingComma(node, node.properties); break; + case "ObjectPattern": + this.adjustCommentsAfterTrailingComma(node, node.properties, true); + break; case "CallExpression": this.adjustCommentsAfterTrailingComma(node, node.arguments); break; case "ArrayExpression": - case "ArrayPattern": this.adjustCommentsAfterTrailingComma(node, node.elements); break; + case "ArrayPattern": + this.adjustCommentsAfterTrailingComma(node, node.elements, true); + break; } } else if ( this.state.commentPreviousNode && @@ -148,9 +171,11 @@ export default class CommentsParser extends BaseParser { (this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) ) { - this.adjustCommentsAfterTrailingComma(node, [ - this.state.commentPreviousNode, - ]); + this.adjustCommentsAfterTrailingComma( + node, + [this.state.commentPreviousNode], + true, + ); } if (lastChild) { diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json index 4452426a990f..f732250d6daa 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-function-call-no-semicolon/output.json @@ -250,7 +250,25 @@ "label": null } ], - "test": null + "test": null, + "leadingComments": [ + { + "type": "CommentLine", + "value": " comment", + "start": 47, + "end": 57, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 14 + } + } + } + ] } ] } diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json index 9e185da12f9c..f081d1ee65fd 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json @@ -215,7 +215,25 @@ "identifierName": "B" }, "name": "B" - } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " Two", + "start": 27, + "end": 33, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 6 + } + } + } + ] } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/comments/regression/10432/input.js b/packages/babel-parser/test/fixtures/comments/regression/10432/input.js new file mode 100644 index 000000000000..645dc4cde990 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10432/input.js @@ -0,0 +1,5 @@ +const socket = socketClient(address) +/* istanbul ignore next */ +socket.on('connect', function () { + debug('Connected to ' + address) +}) diff --git a/packages/babel-parser/test/fixtures/comments/regression/10432/output.json b/packages/babel-parser/test/fixtures/comments/regression/10432/output.json new file mode 100644 index 000000000000..075deef7bf64 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10432/output.json @@ -0,0 +1,431 @@ +{ + "type": "File", + "start": 0, + "end": 136, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 136, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 6, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "socket" + }, + "name": "socket" + }, + "init": { + "type": "CallExpression", + "start": 15, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "callee": { + "type": "Identifier", + "start": 15, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "socketClient" + }, + "name": "socketClient" + }, + "arguments": [ + { + "type": "Identifier", + "start": 28, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 35 + }, + "identifierName": "address" + }, + "name": "address" + } + ] + } + } + ], + "kind": "const", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " istanbul ignore next ", + "start": 37, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + } + } + ] + }, + { + "type": "ExpressionStatement", + "start": 64, + "end": 136, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "expression": { + "type": "CallExpression", + "start": 64, + "end": 136, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 2 + } + }, + "callee": { + "type": "MemberExpression", + "start": 64, + "end": 73, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "object": { + "type": "Identifier", + "start": 64, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "socket" + }, + "name": "socket" + }, + "property": { + "type": "Identifier", + "start": 71, + "end": 73, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + }, + "identifierName": "on" + }, + "name": "on" + }, + "computed": false + }, + "arguments": [ + { + "type": "StringLiteral", + "start": 74, + "end": 83, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "extra": { + "rawValue": "connect", + "raw": "'connect'" + }, + "value": "connect" + }, + { + "type": "FunctionExpression", + "start": 85, + "end": 135, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 97, + "end": 135, + "loc": { + "start": { + "line": 3, + "column": 33 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 101, + "end": 133, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "expression": { + "type": "CallExpression", + "start": 101, + "end": 133, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 34 + } + }, + "callee": { + "type": "Identifier", + "start": 101, + "end": 106, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 7 + }, + "identifierName": "debug" + }, + "name": "debug" + }, + "arguments": [ + { + "type": "BinaryExpression", + "start": 107, + "end": 132, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 33 + } + }, + "left": { + "type": "StringLiteral", + "start": 107, + "end": 122, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 23 + } + }, + "extra": { + "rawValue": "Connected to ", + "raw": "'Connected to '" + }, + "value": "Connected to " + }, + "operator": "+", + "right": { + "type": "Identifier", + "start": 125, + "end": 132, + "loc": { + "start": { + "line": 4, + "column": 26 + }, + "end": { + "line": 4, + "column": 33 + }, + "identifierName": "address" + }, + "name": "address" + } + } + ] + } + } + ], + "directives": [] + } + } + ] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": " istanbul ignore next ", + "start": 37, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " istanbul ignore next ", + "start": 37, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 26 + } + } + } + ] +} \ No newline at end of file From f339d2d034aadb01f4f0ccca74e0e99fed1f79b9 Mon Sep 17 00:00:00 2001 From: Ivan Medina Date: Mon, 23 Sep 2019 15:47:18 -0500 Subject: [PATCH 081/965] [parser] Disallow numeric separator in unicode scape sequences (#10468) * [parser] Disallow numeric separator in unicode scape sequences (#10460) * raise error only when numeric separator plugin is set * Adds argument for checking numeric separator * Fix condition for readability * Add test for hex escape sequence and rephrase error message * Remove exposure for allowNumSeparator in readHexChar method --- packages/babel-parser/src/tokenizer/index.js | 15 +++++++++++++-- .../numeric-separator/invalid-hex/input.js | 1 + .../numeric-separator/invalid-hex/options.json | 1 + .../numeric-separator/invalid-unicode-2/input.js | 1 + .../invalid-unicode-2/options.json | 1 + .../numeric-separator/invalid-unicode/input.js | 1 + .../invalid-unicode/options.json | 1 + scripts/tests/test262/test262_whitelist.txt | 8 -------- 8 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index c8773f9bbe2a..46d156efe7c8 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -880,7 +880,11 @@ export default class Tokenizer extends LocationParser { // were read, the integer value otherwise. When `len` is given, this // will return `null` unless the integer has exactly `len` digits. - readInt(radix: number, len?: number): number | null { + readInt( + radix: number, + len?: number, + allowNumSeparator: boolean = true, + ): number | null { const start = this.state.pos; const forbiddenSiblings = radix === 16 @@ -917,6 +921,13 @@ export default class Tokenizer extends LocationParser { this.raise(this.state.pos, "Invalid or unexpected token"); } + if (!allowNumSeparator) { + this.raise( + this.state.pos, + "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences", + ); + } + // Ignore this _ character ++this.state.pos; continue; @@ -1252,7 +1263,7 @@ export default class Tokenizer extends LocationParser { readHexChar(len: number, throwOnInvalid: boolean): number | null { const codePos = this.state.pos; - const n = this.readInt(16, len); + const n = this.readInt(16, len, false); if (n === null) { if (throwOnInvalid) { this.raise(codePos, "Bad character escape sequence"); diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/input.js new file mode 100644 index 000000000000..4027187fe79d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/input.js @@ -0,0 +1 @@ +"\x1_0"; 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 new file mode 100644 index 000000000000..fd0b1c7f0a7d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/input.js new file mode 100644 index 000000000000..7d45889c6dec --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/input.js @@ -0,0 +1 @@ +"\u12_34" 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 new file mode 100644 index 000000000000..ca0ceaeaaea6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/input.js new file mode 100644 index 000000000000..e670fc0c3264 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/input.js @@ -0,0 +1 @@ +"\u{1F_639}" 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 new file mode 100644 index 000000000000..e42d95d86acf --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)" } diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 851b2ddb9f5e..32c8348cb5af 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -104,10 +104,6 @@ language/expressions/object/method-definition/private-name-early-error-gen-insid language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/expressions/template-literal/unicode-escape-nls-err.js(default) -language/expressions/template-literal/unicode-escape-nls-err.js(strict mode) -language/identifiers/unicode-escape-nls-err.js(default) -language/identifiers/unicode-escape-nls-err.js(strict mode) language/literals/bigint/non-octal-like-invalid-0008n.js(default) language/literals/bigint/non-octal-like-invalid-012348n.js(default) language/literals/bigint/non-octal-like-invalid-08n.js(default) @@ -128,10 +124,6 @@ language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal- language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) -language/literals/string/unicode-escape-nls-err-double.js(default) -language/literals/string/unicode-escape-nls-err-double.js(strict mode) -language/literals/string/unicode-escape-nls-err-single.js(default) -language/literals/string/unicode-escape-nls-err-single.js(strict mode) language/module-code/privatename-not-valid-earlyerr-module-1.js(default) language/module-code/privatename-not-valid-earlyerr-module-1.js(strict mode) language/module-code/privatename-not-valid-earlyerr-module-2.js(default) From 69d00dc5b035eede17d24cc7211166e3d5bc600c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Rodr=C3=ADguez?= <13141462+gonzarodriguezt@users.noreply.github.com> Date: Mon, 23 Sep 2019 17:07:52 -0400 Subject: [PATCH 082/965] [parser] Invalid NonOctal Decimal (#10467) * Add test * Add nonOctalDecimal verification * Update regex and code style * Refactor non octal detection * Add numeric separator test * Disallow numeric separators in non octals * Update whitelist * Better test naming * Disallow numeric separators in non oct for all numbers * Specific error above the general error * Add test for invalid leading zero in num separator * Add start position to error --- packages/babel-parser/src/tokenizer/index.js | 22 +++++++++++++++++-- .../invalid-non-octal-decimal-int/input.js | 1 + .../options.json | 1 + .../invalid-leading-zero/input.js | 1 + .../invalid-leading-zero/options.json | 1 + .../invalid-non-octal-decimal-int/input.js | 1 + .../options.json | 1 + .../numeric-separator/options.json | 2 +- scripts/tests/test262/test262_whitelist.txt | 14 ------------ 9 files changed, 27 insertions(+), 17 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 46d156efe7c8..6d2c046457aa 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -993,6 +993,7 @@ export default class Tokenizer extends LocationParser { const start = this.state.pos; let isFloat = false; let isBigInt = false; + let isNonOctalDecimalInt = false; if (!startsWithDot && this.readInt(10) === null) { this.raise(start, "Invalid number"); @@ -1009,6 +1010,7 @@ export default class Tokenizer extends LocationParser { } if (/[89]/.test(this.input.slice(start, this.state.pos))) { octal = false; + isNonOctalDecimalInt = true; } } @@ -1033,10 +1035,26 @@ export default class Tokenizer extends LocationParser { next = this.input.charCodeAt(this.state.pos); } + // disallow numeric separators in non octal decimals + if (this.hasPlugin("numericSeparator") && isNonOctalDecimalInt) { + const underscorePos = this.input + .slice(start, this.state.pos) + .indexOf("_"); + if (underscorePos > 0) { + this.raise( + underscorePos + start, + "Numeric separator can not be used after leading 0", + ); + } + } + if (this.hasPlugin("bigInt")) { if (next === charCodes.lowercaseN) { - // disallow floats and legacy octal syntax, new style octal ("0o") is handled in this.readRadixNumber - if (isFloat || octal) this.raise(start, "Invalid BigIntLiteral"); + // disallow floats, legacy octal syntax and non octal decimals + // new style octal ("0o") is handled in this.readRadixNumber + if (isFloat || octal || isNonOctalDecimalInt) { + this.raise(start, "Invalid BigIntLiteral"); + } ++this.state.pos; isBigInt = true; } diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/input.js b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/input.js new file mode 100644 index 000000000000..488077f06c3f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/input.js @@ -0,0 +1 @@ +089n \ 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 new file mode 100644 index 000000000000..a1fd77a3341e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/invalid-non-octal-decimal-int/options.json @@ -0,0 +1 @@ +{ "throws": "Invalid BigIntLiteral (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/input.js new file mode 100644 index 000000000000..cf0bdcda2ea0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/input.js @@ -0,0 +1 @@ +0_8 \ 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 new file mode 100644 index 000000000000..57c99a94dbd6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separator can not be used after leading 0 (1:1)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/input.js new file mode 100644 index 000000000000..50e4a5af8a70 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/input.js @@ -0,0 +1 @@ +08_0n \ 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 new file mode 100644 index 000000000000..5a4fb4525d02 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separator can not be used after leading 0 (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/options.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/options.json index 7832463eea97..d6659f4863e6 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/options.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/options.json @@ -1,3 +1,3 @@ { - "plugins": ["numericSeparator"] + "plugins": ["bigInt", "numericSeparator"] } diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 32c8348cb5af..3eb50c7c2d4e 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -104,26 +104,12 @@ language/expressions/object/method-definition/private-name-early-error-gen-insid language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/literals/bigint/non-octal-like-invalid-0008n.js(default) -language/literals/bigint/non-octal-like-invalid-012348n.js(default) -language/literals/bigint/non-octal-like-invalid-08n.js(default) -language/literals/bigint/non-octal-like-invalid-09n.js(default) -language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-08-err.js(default) -language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-09-err.js(default) -language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) -language/literals/bigint/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) -language/literals/bigint/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-00-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-01-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-07-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_0-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_1-err.js(default) language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_7-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-08-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-09-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_8-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-nonoctal-0_9-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-nzd-nsl-dds-leading-zero-err.js(default) language/module-code/privatename-not-valid-earlyerr-module-1.js(default) language/module-code/privatename-not-valid-earlyerr-module-1.js(strict mode) language/module-code/privatename-not-valid-earlyerr-module-2.js(default) From b9cb4af953afb1a5aeed9b18526192ab15bb45c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 23 Sep 2019 23:14:37 +0200 Subject: [PATCH 083/965] v7.6.2 --- lerna.json | 2 +- packages/babel-cli/package.json | 6 ++--- packages/babel-core/package.json | 10 ++++----- packages/babel-generator/package.json | 6 ++--- packages/babel-helper-fixtures/package.json | 2 +- packages/babel-helpers/package.json | 4 ++-- packages/babel-node/package.json | 8 +++---- packages/babel-parser/package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 8 +++---- .../package.json | 10 ++++----- .../package.json | 4 ++-- .../package.json | 4 ++-- .../babel-preset-env-standalone/package.json | 8 +++---- packages/babel-preset-env/package.json | 22 +++++++++---------- packages/babel-register/package.json | 4 ++-- packages/babel-runtime-corejs2/package.json | 4 ++-- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 4 ++-- packages/babel-standalone/package.json | 18 +++++++-------- packages/babel-traverse/package.json | 6 ++--- 24 files changed, 76 insertions(+), 76 deletions(-) diff --git a/lerna.json b/lerna.json index f85e37844198..4c33226c52cb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.6.1", + "version": "7.6.2", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index c88110dae32e..af2314157a7f 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.6.0", + "version": "7.6.2", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -36,8 +36,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-fixtures": "^7.6.0" + "@babel/core": "^7.6.2", + "@babel/helper-fixtures": "^7.6.2" }, "bin": { "babel": "./bin/babel.js", diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 2242dbe93841..f828cfbf3b6f 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.6.0", + "version": "7.6.2", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,11 +34,11 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.0", - "@babel/helpers": "^7.6.0", - "@babel/parser": "^7.6.0", + "@babel/generator": "^7.6.2", + "@babel/helpers": "^7.6.2", + "@babel/parser": "^7.6.2", "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.0", + "@babel/traverse": "^7.6.2", "@babel/types": "^7.6.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 31f7bf70785d..126065dbe0c5 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.6.0", + "version": "7.6.2", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -20,7 +20,7 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-fixtures": "^7.6.0", - "@babel/parser": "^7.6.0" + "@babel/helper-fixtures": "^7.6.2", + "@babel/parser": "^7.6.2" } } diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index 31854ac575d0..cf47185a8b40 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-fixtures", - "version": "7.6.0", + "version": "7.6.2", "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 34d842797af1..5f3c0a7895d8 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.6.0", + "version": "7.6.2", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.0", + "@babel/traverse": "^7.6.2", "@babel/types": "^7.6.0" }, "devDependencies": { diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 9b2c283c50bd..58c66f24cbc7 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.6.1", + "version": "7.6.2", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -19,7 +19,7 @@ "compiler" ], "dependencies": { - "@babel/register": "^7.6.0", + "@babel/register": "^7.6.2", "commander": "^2.8.1", "core-js": "^3.2.1", "lodash": "^4.17.13", @@ -31,8 +31,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-fixtures": "^7.6.0", + "@babel/core": "^7.6.2", + "@babel/helper-fixtures": "^7.6.2", "fs-readdir-recursive": "^1.0.0", "output-file-sync": "^2.0.0" }, diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index f6e87447934d..bdf1c5eefb2a 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.6.0", + "version": "7.6.2", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -29,7 +29,7 @@ }, "devDependencies": { "@babel/code-frame": "^7.5.5", - "@babel/helper-fixtures": "^7.6.0", + "@babel/helper-fixtures": "^7.6.2", "charcodes": "^0.2.0", "unicode-12.0.0": "^0.7.9" }, diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index e2ac2b6934ad..6f02a07f0308 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/package.json +++ b/packages/babel-plugin-proposal-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-object-rest-spread", - "version": "7.5.5", + "version": "7.6.2", "description": "Compile object rest and spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index 72c7d31056bd..2fe4510857d1 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-unicode-property-regex", - "version": "7.4.4", + "version": "7.6.2", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -30,7 +30,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index 359b68d14cdf..d51f5c659d6a 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.6.0", + "version": "7.6.2", "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 62fd6be70bae..106ce8056802 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-dotall-regex", - "version": "7.4.4", + "version": "7.6.2", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -29,7 +29,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } 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 70ecd949d527..0b964d023c58 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.6.0", + "version": "7.6.2", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -24,9 +24,9 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0", - "core-js-pure": "^3.2.1", - "core-js": "^3.2.1" + "core-js": "^3.2.1", + "core-js-pure": "^3.2.1" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 26a0aa357220..68ab0c2d4ff3 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.6.0", + "version": "7.6.2", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -21,11 +21,11 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/helpers": "^7.6.0", - "@babel/preset-env": "^7.6.0", - "@babel/runtime": "^7.6.0", + "@babel/helpers": "^7.6.2", + "@babel/preset-env": "^7.6.2", + "@babel/runtime": "^7.6.2", "@babel/template": "^7.6.0", "@babel/types": "7.0.0-beta.53" } diff --git a/packages/babel-plugin-transform-spread/package.json b/packages/babel-plugin-transform-spread/package.json index 5c051240523d..75133a6987b3 100644 --- a/packages/babel-plugin-transform-spread/package.json +++ b/packages/babel-plugin-transform-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-spread", - "version": "7.2.2", + "version": "7.6.2", "description": "Compile ES2015 spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.2", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index 834814432b0f..a3a534041774 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-unicode-regex", - "version": "7.4.4", + "version": "7.6.2", "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index b6d5a61b578f..55b57afe542e 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.6.0", + "version": "7.6.2", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -11,10 +11,10 @@ "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.5.0", "@babel/plugin-proposal-json-strings": "^7.0.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.2", "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.6.0", - "@babel/standalone": "^7.6.0" + "@babel/preset-env": "^7.6.2", + "@babel/standalone": "^7.6.2" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index c9cb0b36027a..8e122f7e519d 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.6.0", + "version": "7.6.2", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -19,9 +19,9 @@ "@babel/plugin-proposal-async-generator-functions": "^7.2.0", "@babel/plugin-proposal-dynamic-import": "^7.5.0", "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", + "@babel/plugin-proposal-object-rest-spread": "^7.6.2", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.6.2", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-syntax-json-strings": "^7.2.0", @@ -30,11 +30,11 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.6.0", + "@babel/plugin-transform-block-scoping": "^7.6.2", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.6.2", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", "@babel/plugin-transform-for-of": "^7.4.4", @@ -45,7 +45,7 @@ "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@babel/plugin-transform-modules-systemjs": "^7.5.0", "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.2", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", @@ -53,11 +53,11 @@ "@babel/plugin-transform-regenerator": "^7.4.5", "@babel/plugin-transform-reserved-words": "^7.2.0", "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.2.0", + "@babel/plugin-transform-spread": "^7.6.2", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.4.4", + "@babel/plugin-transform-unicode-regex": "^7.6.2", "@babel/types": "^7.6.0", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", @@ -69,9 +69,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.6.0", - "@babel/core": "^7.6.0", - "@babel/helper-fixtures": "^7.6.0", + "@babel/cli": "^7.6.2", + "@babel/core": "^7.6.2", + "@babel/helper-fixtures": "^7.6.2", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 155b7f741709..6a768833622d 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.6.0", + "version": "7.6.2", "description": "babel require hook", "license": "MIT", "publishConfig": { @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.2", "default-require-extensions": "^2.0.0" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index a884db635038..2286dffe3dd9 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.6.0", + "version": "7.6.2", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { @@ -13,6 +13,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.6.0" + "@babel/helpers": "^7.6.2" } } diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 71c3504694b5..9e6ec873f718 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.6.0", + "version": "7.6.2", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 9bd7b6da37dd..84b8975759a8 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.6.0", + "version": "7.6.2", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { @@ -12,6 +12,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.6.0" + "@babel/helpers": "^7.6.2" } } diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 50b3c5796164..35a5e842c4a1 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.6.0", + "version": "7.6.2", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -9,7 +9,7 @@ "src" ], "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.2", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", @@ -24,13 +24,13 @@ "@babel/plugin-proposal-logical-assignment-operators": "^7.2.0", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-numeric-separator": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.5.5", + "@babel/plugin-proposal-object-rest-spread": "^7.6.2", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", "@babel/plugin-proposal-optional-chaining": "^7.6.0", "@babel/plugin-proposal-pipeline-operator": "^7.5.0", "@babel/plugin-proposal-private-methods": "^7.6.0", "@babel/plugin-proposal-throw-expressions": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.6.2", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-class-properties": "^7.2.0", "@babel/plugin-syntax-decorators": "^7.2.0", @@ -50,11 +50,11 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.6.0", + "@babel/plugin-transform-block-scoping": "^7.6.2", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.6.2", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", "@babel/plugin-transform-flow-comments": "^7.6.0", @@ -86,15 +86,15 @@ "@babel/plugin-transform-react-jsx-source": "^7.5.0", "@babel/plugin-transform-regenerator": "^7.4.5", "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.6.0", + "@babel/plugin-transform-runtime": "^7.6.2", "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.2.2", + "@babel/plugin-transform-spread": "^7.6.2", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-strict-mode": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-typescript": "^7.6.0", - "@babel/plugin-transform-unicode-regex": "^7.4.4", + "@babel/plugin-transform-unicode-regex": "^7.6.2", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.6.0" diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 2e9d009261bc..0762ff547d89 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.6.0", + "version": "7.6.2", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,10 +12,10 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.0", + "@babel/generator": "^7.6.2", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.0", + "@babel/parser": "^7.6.2", "@babel/types": "^7.6.0", "debug": "^4.1.0", "globals": "^11.1.0", From af66d521bd67d1fc714b1912815afa6c761ceaf9 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Mon, 23 Sep 2019 21:16:32 +0000 Subject: [PATCH 084/965] Add v7.6.2 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d51eaca1b7d0..58c1957fa12b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,17 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.6.2 (2019-09-23) + +#### :eyeglasses: Spec Compliance +* `babel-parser` + * [#10472](https://github.com/babel/babel/pull/10472) added check to disallow super.private variable access and test case added ([@vivek12345](https://github.com/vivek12345)) + +#### :bug: Bug Fix +* `babel-parser` + * [#10467](https://github.com/babel/babel/pull/10467) [parser] Invalid NonOctal Decimal ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) + * [#10468](https://github.com/babel/babel/pull/10468) [parser] Disallow numeric separator in unicode scape sequences ([@ivandevp](https://github.com/ivandevp)) + * [#10445](https://github.com/babel/babel/pull/10445) Leave trailing comments after handling a possible trailing comma ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.6.1 (2019-09-06) From a00f3716106a0811ff9b915783bb90f2949ef48a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 23 Sep 2019 23:27:03 +0200 Subject: [PATCH 085/965] Update v7.6.2 changelog [skip ci] --- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58c1957fa12b..e0f88e67e14e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,13 +21,42 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 #### :eyeglasses: Spec Compliance * `babel-parser` - * [#10472](https://github.com/babel/babel/pull/10472) added check to disallow super.private variable access and test case added ([@vivek12345](https://github.com/vivek12345)) + * [#10472](https://github.com/babel/babel/pull/10472) added check to disallow super.private variable access and test case added. ([@vivek12345](https://github.com/vivek12345)) + * [#10468](https://github.com/babel/babel/pull/10468) [parser] Disallow numeric separator in unicode scape sequences. ([@ivandevp](https://github.com/ivandevp)) + * [#10467](https://github.com/babel/babel/pull/10467) [parser] Invalid NonOctal Decimal. ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) + * [#10461](https://github.com/babel/babel/pull/10461) [parser] Disallow static fields named `constructor`. ([@guywaldman](https://github.com/guywaldman)) + * [#10455](https://github.com/babel/babel/pull/10455) [parser] Report escapes in kws only if they won't be used as identifiers. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) #### :bug: Bug Fix * `babel-parser` - * [#10467](https://github.com/babel/babel/pull/10467) [parser] Invalid NonOctal Decimal ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) - * [#10468](https://github.com/babel/babel/pull/10468) [parser] Disallow numeric separator in unicode scape sequences ([@ivandevp](https://github.com/ivandevp)) - * [#10445](https://github.com/babel/babel/pull/10445) Leave trailing comments after handling a possible trailing comma ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10445](https://github.com/babel/babel/pull/10445) Leave trailing comments after handling a possible trailing comma. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-cli` + * [#10400](https://github.com/babel/babel/pull/10400) fix: allow the process to exit naturally. ([@JLHwung](https://github.com/JLHwung)) +* `babel-core` + * [#10402](https://github.com/babel/babel/pull/10402) fix: pass optionLoc when validating plugin object. ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-transform-block-scoping`, `babel-plugin-transform-spread`, `babel-traverse` + * [#10417](https://github.com/babel/babel/pull/10417) Do not guess relative execution status for exported fns. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-proposal-object-rest-spread`, `babel-preset-env` + * [#10275](https://github.com/babel/babel/pull/10275) fix object rest in array pattern. ([@tanhauhau](https://github.com/tanhauhau)) + +#### :house: Internal +* `babel-plugin-transform-named-capturing-groups-regex` + * [#10430](https://github.com/babel/babel/pull/10430) refactor: replace regexp-tree by regexpu. ([@JLHwung](https://github.com/JLHwung)) +* Other + * [#10441](https://github.com/babel/babel/pull/10441) Update GitHub actions to v2. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10427](https://github.com/babel/babel/pull/10427) chore: add lint-ts rule. ([@JLHwung](https://github.com/JLHwung)) +* `babel-helper-fixtures` + * [#10428](https://github.com/babel/babel/pull/10428) chore: remove tryResolve dependency. ([@JLHwung](https://github.com/JLHwung)) +* `babel-node` + * [#10429](https://github.com/babel/babel/pull/10429) Remove babel polyfill dependency of babel-node. ([@bdwain](https://github.com/bdwain)) +* `babel-generator`, `babel-helper-fixtures` + * [#10420](https://github.com/babel/babel/pull/10420) chore: remove trim-right dependency. ([@JLHwung](https://github.com/JLHwung)) +* `babel-core`, `babel-plugin-transform-runtime`, `babel-register` + * [#10405](https://github.com/babel/babel/pull/10405) Remove circular dependency. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :running_woman: Performance +* `babel-parser` + * [#10421](https://github.com/babel/babel/pull/10421) Miscellaneous perf tweak. ([@JLHwung](https://github.com/JLHwung)) ## v7.6.1 (2019-09-06) From cc080417b995e2903352e7956890e0c74b23d4c9 Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Mon, 23 Sep 2019 20:01:32 -0400 Subject: [PATCH 086/965] chore: Upgrade source-map to 0.6.1 (#10446) --- packages/babel-cli/package.json | 2 +- packages/babel-core/package.json | 2 +- packages/babel-generator/package.json | 2 +- .../babel-helper-transform-fixture-test-runner/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index af2314157a7f..0c7af101f160 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -27,7 +27,7 @@ "mkdirp": "^0.5.1", "output-file-sync": "^2.0.0", "slash": "^2.0.0", - "source-map": "^0.5.0" + "source-map": "^0.6.1" }, "optionalDependencies": { "chokidar": "^2.1.8" diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index f828cfbf3b6f..e91fbcbe27a7 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -46,7 +46,7 @@ "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", - "source-map": "^0.5.0" + "source-map": "^0.6.1" }, "devDependencies": { "@babel/helper-transform-fixture-test-runner": "^7.6.0" diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 126065dbe0c5..eb5d9231bb9a 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -17,7 +17,7 @@ "@babel/types": "^7.6.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", - "source-map": "^0.5.0" + "source-map": "^0.6.1" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.2", diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 7e18f760bd5e..ca35190645ea 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -20,6 +20,6 @@ "jest-diff": "^24.8.0", "lodash": "^4.17.13", "resolve": "^1.3.2", - "source-map": "^0.5.0" + "source-map": "^0.6.1" } } From 6f3460c7679d1f05d2102ebc5f49697c3e926154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 24 Sep 2019 04:03:07 -0400 Subject: [PATCH 087/965] chore: add access: public to babel parser publish config (#10487) [skip ci] --- packages/babel-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index bdf1c5eefb2a..803192a3ee07 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -6,7 +6,7 @@ "homepage": "https://babeljs.io/", "license": "MIT", "publishConfig": { - "tag": "next" + "access": "public" }, "keywords": [ "babel", From 26be14b24d6b9367fdf3bedbf6b7022c2cdd90e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 24 Sep 2019 08:04:54 -0400 Subject: [PATCH 088/965] chore: add access: public where missing (#10489) [skip ci] * @babel/types * @babel/plugin-transform-named-capturing-groups-regex --- .../package.json | 3 +++ packages/babel-types/package.json | 3 +++ 2 files changed, 6 insertions(+) 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 0b964d023c58..c014d9a9c20a 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -4,6 +4,9 @@ "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", + "publishConfig": { + "access": "public" + }, "main": "lib/index.js", "keywords": [ "babel-plugin", diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 6b1293a88e9d..28681f00de9e 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -5,6 +5,9 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "publishConfig": { + "access": "public" + }, "repository": "https://github.com/babel/babel/tree/master/packages/babel-types", "main": "lib/index.js", "types": "lib/index.d.ts", From 0e9502685a3808a6651be0d9db51f7eb073375fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 24 Sep 2019 17:08:58 +0200 Subject: [PATCH 089/965] =?UTF-8?q?[parser]=20Don't=20crash=20on=20comment?= =?UTF-8?q?=20after=20trailing=20comma=20after=20eli=E2=80=A6=20(#10490)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/babel-parser/src/parser/comments.js | 11 +- .../comments/regression/10448/input.js | 2 + .../comments/regression/10448/output.json | 191 ++++++++++++++++++ 3 files changed, 200 insertions(+), 4 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10448/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10448/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 8554ffaf52cc..5a50c15c6414 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -40,7 +40,7 @@ export default class CommentsParser extends BaseParser { adjustCommentsAfterTrailingComma( node: Node, - elements: Node[], + elements: (Node | null)[], // When the current node is followed by a token which hasn't a respective AST node, we // need to take all the trailing comments to prevent them from being attached to an // unrelated node. e.g. in @@ -55,12 +55,15 @@ export default class CommentsParser extends BaseParser { return; } - if (elements.length === 0) { + let lastElement = null; + let i = elements.length; + while (lastElement === null && i > 0) { + lastElement = elements[--i]; + } + if (lastElement === null) { return; } - const lastElement = last(elements); - for (let j = 0; j < this.state.leadingComments.length; j++) { if ( this.state.leadingComments[j].end < this.state.commentPreviousNode.end diff --git a/packages/babel-parser/test/fixtures/comments/regression/10448/input.js b/packages/babel-parser/test/fixtures/comments/regression/10448/input.js new file mode 100644 index 000000000000..c0bd1ccbc1cc --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10448/input.js @@ -0,0 +1,2 @@ +function foo([foo, /* not used */, /* not used */]) { +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/regression/10448/output.json b/packages/babel-parser/test/fixtures/comments/regression/10448/output.json new file mode 100644 index 000000000000..ab6d764cc245 --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10448/output.json @@ -0,0 +1,191 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "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": "ArrayPattern", + "start": 13, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 50 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo", + "trailingComments": [ + { + "type": "CommentBlock", + "value": " not used ", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 33 + } + } + }, + { + "type": "CommentBlock", + "value": " not used ", + "start": 35, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 49 + } + } + } + ] + }, + null + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 52, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": " not used ", + "start": 19, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 33 + } + } + }, + { + "type": "CommentBlock", + "value": " not used ", + "start": 35, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 49 + } + } + } + ] +} \ No newline at end of file From eaa14745412008e216336e35dc956eaebaf9581e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 24 Sep 2019 23:11:56 +0200 Subject: [PATCH 090/965] Enable optional chaining and nullish coalescing plugins (#10494) * Add optional chaining plugin * Nullish coalescing --- .flowconfig | 2 ++ babel.config.js | 2 ++ package.json | 2 ++ yarn.lock | 30 ++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/.flowconfig b/.flowconfig index 694811e55964..4ba284f66add 100644 --- a/.flowconfig +++ b/.flowconfig @@ -24,4 +24,6 @@ suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore suppress_type=$FlowFixMe suppress_type=$FlowSubtype esproposal.export_star_as=enable +esproposal.optional_chaining=enable +esproposal.nullish_coalescing=enable module.name_mapper='^@babel\/\([a-zA-Z0-9_\-]+\)$' -> '/packages/babel-\1/src/index' diff --git a/babel.config.js b/babel.config.js index 82966a7f07ca..2aa9b1a306ee 100644 --- a/babel.config.js +++ b/babel.config.js @@ -77,6 +77,8 @@ module.exports = function(api) { "@babel/proposal-object-rest-spread", { useBuiltIns: true, loose: true }, ], + "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-proposal-nullish-coalescing-operator", // Explicitly use the lazy version of CommonJS modules. convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null, diff --git a/package.json b/package.json index 023280c6f37c..2f6b030afbe6 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,9 @@ "@babel/eslint-plugin-development": "^1.0.1", "@babel/plugin-proposal-class-properties": "^7.5.5", "@babel/plugin-proposal-export-namespace-from": "^7.5.2", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-numeric-separator": "^7.2.0", + "@babel/plugin-proposal-optional-chaining": "^7.6.0", "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@babel/plugin-transform-runtime": "^7.6.0", "@babel/preset-env": "^7.6.0", diff --git a/yarn.lock b/yarn.lock index 973be865ace4..42b1f996c88b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -293,6 +293,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-json-strings" "^7.2.0" +"@babel/plugin-proposal-nullish-coalescing-operator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz#41c360d59481d88e0ce3a3f837df10121a769b39" + integrity sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0" + "@babel/plugin-proposal-numeric-separator@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.2.0.tgz#646854daf4cd22fd6733f6076013a936310443ac" @@ -317,6 +325,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" +"@babel/plugin-proposal-optional-chaining@^7.6.0": + version "7.6.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.6.0.tgz#e9bf1f9b9ba10c77c033082da75f068389041af8" + integrity sha512-kj4gkZ6qUggkprRq3Uh5KP8XnE1MdIO0J7MhdDX8+rAbB6dJ2UrensGIS+0NPZAaaJ1Vr0PN6oLUgXMU1uMcSg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex@^7.4.4": version "7.4.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" @@ -361,6 +377,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-nullish-coalescing-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz#f75083dfd5ade73e783db729bbd87e7b9efb7624" + integrity sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-numeric-separator@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.2.0.tgz#7470fe070c2944469a756752a69a6963135018be" @@ -382,6 +405,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-optional-chaining@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" + integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-arrow-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" From 490798a26d713c51205c7a510ee0ca99ab84dd15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Rodr=C3=ADguez?= <13141462+gonzarodriguezt@users.noreply.github.com> Date: Tue, 24 Sep 2019 19:32:50 -0400 Subject: [PATCH 091/965] =?UTF-8?q?[parser]=20Disallow=20numeric=20separat?= =?UTF-8?q?ors=20in=20legacy=20octal=20like=20inte=E2=80=A6=20(#10493)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Disallow numeric separators in lols * Update whitelist * Rename test * Better syntax when checking --- packages/babel-parser/src/tokenizer/index.js | 4 ++-- .../numeric-separator/invalid-legacy-octal-literal/input.js | 1 + .../invalid-legacy-octal-literal/options.json | 1 + scripts/tests/test262/test262_whitelist.txt | 6 ------ 4 files changed, 4 insertions(+), 8 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 6d2c046457aa..3fdced8aaffd 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1035,8 +1035,8 @@ export default class Tokenizer extends LocationParser { next = this.input.charCodeAt(this.state.pos); } - // disallow numeric separators in non octal decimals - if (this.hasPlugin("numericSeparator") && isNonOctalDecimalInt) { + // disallow numeric separators in non octal decimals and legacy octal likes + if (this.hasPlugin("numericSeparator") && (octal || isNonOctalDecimalInt)) { const underscorePos = this.input .slice(start, this.state.pos) .indexOf("_"); diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/input.js b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/input.js new file mode 100644 index 000000000000..909c1baacf29 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/input.js @@ -0,0 +1 @@ +00_0 \ 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 new file mode 100644 index 000000000000..5a4fb4525d02 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/options.json @@ -0,0 +1 @@ +{ "throws": "Numeric separator can not be used after leading 0 (1:2)" } diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 3eb50c7c2d4e..1082e285e660 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -104,12 +104,6 @@ language/expressions/object/method-definition/private-name-early-error-gen-insid language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-00-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-01-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-07-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_0-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_1-err.js(default) -language/literals/numeric/numeric-separators/numeric-separator-literal-lol-0_7-err.js(default) language/module-code/privatename-not-valid-earlyerr-module-1.js(default) language/module-code/privatename-not-valid-earlyerr-module-1.js(strict mode) language/module-code/privatename-not-valid-earlyerr-module-2.js(default) From d0f093e716c721117bf5dcf11268a6af503d7f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 25 Sep 2019 02:03:58 +0200 Subject: [PATCH 092/965] Update test262 whitelist --- Makefile | 2 +- scripts/tests/test262/test262_whitelist.txt | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile b/Makefile index a8415c927d0f..fc54314de178 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = ef7fd2bc27e7c10b4a71d2edc632a2934742a13e +TEST262_COMMIT = ce2dfd49d13740e995c96c34686d45c7960e628c # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 1082e285e660..d448d79356d3 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -12,8 +12,6 @@ language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js(strict mode) language/expressions/class/elements/fields-duplicate-privatenames.js(default) language/expressions/class/elements/fields-duplicate-privatenames.js(strict mode) -language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(default) -language/expressions/class/elements/private-methods/prod-private-method-initialize-order.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(default) @@ -154,12 +152,6 @@ language/module-code/top-level-await/syntax/try-await-expr.js(default) language/module-code/top-level-await/syntax/try-await-expr.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/private-field-is-visible-in-computed-properties.js(default) -language/statements/class/elements/private-field-is-visible-in-computed-properties.js(strict mode) -language/statements/class/elements/private-field-with-initialized-id-is-visible-in-computed-properties.js(default) -language/statements/class/elements/private-field-with-initialized-id-is-visible-in-computed-properties.js(strict mode) -language/statements/class/elements/private-methods/prod-private-method-initialize-order.js(default) -language/statements/class/elements/private-methods/prod-private-method-initialize-order.js(strict mode) language/statements/class/elements/privatename-not-valid-earlyerr-script-1.js(default) language/statements/class/elements/privatename-not-valid-earlyerr-script-1.js(strict mode) language/statements/class/elements/privatename-not-valid-earlyerr-script-2.js(default) From 8d4f95de45db638131c200c9a014c57bb3449fc4 Mon Sep 17 00:00:00 2001 From: Phoenix Date: Thu, 26 Sep 2019 22:37:15 +1200 Subject: [PATCH 093/965] =?UTF-8?q?Fix=20grammar=20in=20doc/design/monorep?= =?UTF-8?q?o.md=20=F0=9F=A4=93=20(#10496)=20[skip=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/design/monorepo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/design/monorepo.md b/doc/design/monorepo.md index d10cc9741b76..0460dcd82b73 100644 --- a/doc/design/monorepo.md +++ b/doc/design/monorepo.md @@ -15,7 +15,7 @@ This is quite taboo but let's look at the pros and cons: * Easy to coordinate changes across modules. * Single place to report issues. * Easier to setup a development environment. - * Tests across modules are run together which finds bugs that touch multiple modules easier. + * Tests across modules are run together which finds bugs that touch multiple modules more easily. **Cons:** From 66062c2a8ce2122dd20b487ce46beee76ef14175 Mon Sep 17 00:00:00 2001 From: "Michael J. Currie" Date: Thu, 26 Sep 2019 12:58:36 -0500 Subject: [PATCH 094/965] Template literal validation (#10492) * add template literal validation * avoid null/undefined error when validating * simplify validation logic and fix tests Co-authored-by: Michael J. Currie --- .../babel-types/src/definitions/es2015.js | 10 ++++ .../__snapshots__/templateElement.js.snap | 58 +++++++++++++++++++ .../test/builders/es2015/templateElement.js | 29 ++++++++++ 3 files changed, 97 insertions(+) diff --git a/packages/babel-types/src/definitions/es2015.js b/packages/babel-types/src/definitions/es2015.js index 18649b1df19e..53f3c1f3df7d 100644 --- a/packages/babel-types/src/definitions/es2015.js +++ b/packages/babel-types/src/definitions/es2015.js @@ -574,6 +574,16 @@ defineType("TemplateLiteral", { validate: chain( assertValueType("array"), assertEach(assertNodeType("Expression")), + function(node, key, val) { + if (node.quasis.length !== val.length + 1) { + throw new TypeError( + `Number of ${ + node.type + } quasis should be exactly one more than the number of expressions.\nExpected ${val.length + + 1} quasis but got ${node.quasis.length}`, + ); + } + }, ), }, }, diff --git a/packages/babel-types/test/builders/es2015/__snapshots__/templateElement.js.snap b/packages/babel-types/test/builders/es2015/__snapshots__/templateElement.js.snap index a2f178169233..2915dd37948f 100644 --- a/packages/babel-types/test/builders/es2015/__snapshots__/templateElement.js.snap +++ b/packages/babel-types/test/builders/es2015/__snapshots__/templateElement.js.snap @@ -35,3 +35,61 @@ exports[`builders es2015 templateElement should validate 5`] = ` "Property value of TemplateElement expected to have the following: Property raw expected type of string but got undefined" `; + +exports[`builders es2015 templateLiteral should validate 1`] = ` +Object { + "expressions": Array [], + "quasis": Array [ + Object { + "tail": false, + "type": "TemplateElement", + "value": Object { + "raw": "foo", + }, + }, + ], + "type": "TemplateLiteral", +} +`; + +exports[`builders es2015 templateLiteral should validate 2`] = ` +Object { + "expressions": Array [ + Object { + "type": "StringLiteral", + "value": "baz", + }, + ], + "quasis": Array [ + Object { + "tail": false, + "type": "TemplateElement", + "value": Object { + "raw": "foo", + }, + }, + Object { + "tail": false, + "type": "TemplateElement", + "value": Object { + "raw": "bar", + }, + }, + ], + "type": "TemplateLiteral", +} +`; + +exports[`builders es2015 templateLiteral should validate 3`] = ` +"Number of TemplateLiteral quasis should be exactly one more than the number of expressions. +Expected 3 quasis but got 2" +`; + +exports[`builders es2015 templateLiteral should validate 4`] = ` +"Number of TemplateLiteral quasis should be exactly one more than the number of expressions. +Expected 1 quasis but got 2" +`; + +exports[`builders es2015 templateLiteral should validate 5`] = `"Property quasis expected type of array but got object"`; + +exports[`builders es2015 templateLiteral should validate 6`] = `"Property expressions expected type of array but got null"`; diff --git a/packages/babel-types/test/builders/es2015/templateElement.js b/packages/babel-types/test/builders/es2015/templateElement.js index 0a93e7c8662a..0e5985ae89de 100644 --- a/packages/babel-types/test/builders/es2015/templateElement.js +++ b/packages/babel-types/test/builders/es2015/templateElement.js @@ -21,5 +21,34 @@ describe("builders", function() { expect(() => t.templateElement("foo")).toThrowErrorMatchingSnapshot(); }); }); + describe("templateLiteral", function() { + it("should validate", function() { + const foo = t.templateElement({ raw: "foo" }); + const bar = t.templateElement({ raw: "bar" }); + + const baz = t.stringLiteral("baz"); + const qux = t.stringLiteral("qux"); + + expect(t.templateLiteral([foo], [])).toMatchSnapshot(); + + expect(t.templateLiteral([foo, bar], [baz])).toMatchSnapshot(); + + expect(() => + t.templateLiteral([foo, bar], [baz, qux]), + ).toThrowErrorMatchingSnapshot(); + + expect(() => + t.templateLiteral([foo, bar], []), + ).toThrowErrorMatchingSnapshot(); + + expect(() => + t.templateLiteral({}, [baz]), + ).toThrowErrorMatchingSnapshot(); + + expect(() => + t.templateLiteral([foo, bar]), + ).toThrowErrorMatchingSnapshot(); + }); + }); }); }); From b459f6a0a4fa5d45814158eb271e5aed66c001d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 26 Sep 2019 20:57:58 +0200 Subject: [PATCH 095/965] Add windows to travis (#10249) * Add windows to travis * Update * Do not use sh file on windows * Fix whitespace * Unify command * ./ doesn't work on windows * Remove all ./ usages * Run windows test before others * fix: normalize filename when generating sources sources should be URL. * fix: replace normalized path to cwd * chore: add nodePlatform task options * fix: normalize preset-env filename output * chore: replace normalized path to CWD on win32 platform * limit transform-react-source to run on linux and darwin * test: escapeRegExp on testcases * test: add test for babel --filename on windows * test: double babel-node/cli test timeout * chore: workaround windows build does not stop * chore: remove redundant condition * refactor: rename `nodePlatform` to `os` --- .travis.yml | 18 +++-- Makefile | 67 ++++++++++--------- .../stdin --filename windows/options.json | 5 ++ .../babel/stdin --filename windows/stderr.txt | 1 + .../babel/stdin --filename windows/stdin.txt | 3 + .../babel/stdin --filename/options.json | 3 +- packages/babel-cli/test/index.js | 26 ++++++- packages/babel-core/test/config-chain.js | 25 +++---- packages/babel-generator/src/source-map.js | 17 +++-- packages/babel-helper-fixtures/src/index.js | 20 ++++++ .../src/index.js | 12 +++- packages/babel-node/test/index.js | 2 +- .../react-source/basic-sample/options.json | 3 + .../react-source/with-source/options.json | 3 + .../fixtures/absoluteRuntime/options.json | 3 + packages/babel-preset-env/src/debug.js | 8 +++ .../src/polyfills/regenerator/entry-plugin.js | 7 +- .../src/polyfills/regenerator/usage-plugin.js | 7 +- .../development-windows/exec.js | 19 ++++++ .../development-windows/options.json | 4 ++ .../preset-options/development/options.json | 3 +- 21 files changed, 197 insertions(+), 59 deletions(-) create mode 100644 packages/babel-cli/test/fixtures/babel/stdin --filename windows/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt create mode 100644 packages/babel-cli/test/fixtures/babel/stdin --filename windows/stdin.txt create mode 100644 packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/options.json create mode 100644 packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/with-source/options.json create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/options.json create mode 100644 packages/babel-preset-react/test/fixtures/preset-options/development-windows/exec.js create mode 100644 packages/babel-preset-react/test/fixtures/preset-options/development-windows/options.json diff --git a/.travis.yml b/.travis.yml index 3957c277c102..1ae4cb229356 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,15 @@ git: language: node_js cache: yarn: true + +os: linux + node_js: # We test the latest version on circleci - - '11' - - '10' - - '8' - - '6' + - "11" + - "10" + - "8" + - "6" env: global: @@ -24,6 +27,7 @@ install: - if [ "$JOB" = "lint" ]; then make bootstrap; fi before_script: + - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi - if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi - if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi @@ -36,6 +40,12 @@ script: matrix: fast_finish: true include: + - os: windows + node_js: "node" + env: + - JOB=test + # https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/9 + - YARN_GPG=no - node_js: "node" env: JOB=lint - node_js: "node" diff --git a/Makefile b/Makefile index fc54314de178..1e88895bdd81 100644 --- a/Makefile +++ b/Makefile @@ -10,30 +10,30 @@ SOURCES = packages codemods .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap build: clean clean-lib - ./node_modules/.bin/gulp build - node ./packages/babel-standalone/scripts/generate.js - node ./packages/babel-types/scripts/generateTypeHelpers.js + yarn gulp build + node packages/babel-standalone/scripts/generate.js + node packages/babel-types/scripts/generateTypeHelpers.js # call build again as the generated files might need to be compiled again. - ./node_modules/.bin/gulp build + yarn gulp build # generate flow and typescript typings - node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow - node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts + node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow + node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts ifneq ("$(BABEL_COVERAGE)", "true") make build-standalone make build-preset-env-standalone endif build-standalone: - ./node_modules/.bin/gulp build-babel-standalone + yarn gulp build-babel-standalone build-preset-env-standalone: - ./node_modules/.bin/gulp build-babel-preset-env-standalone + yarn gulp build-babel-preset-env-standalone prepublish-build-standalone: - BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-standalone + BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-standalone prepublish-build-preset-env-standalone: - BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-preset-env-standalone + BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-preset-env-standalone build-dist: build cd packages/babel-polyfill; \ @@ -45,28 +45,28 @@ watch: clean clean-lib # Ensure that build artifacts for types are created during local # development too. - BABEL_ENV=development ./node_modules/.bin/gulp build-no-bundle - node ./packages/babel-types/scripts/generateTypeHelpers.js - node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow - node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts - BABEL_ENV=development ./node_modules/.bin/gulp watch + BABEL_ENV=development yarn gulp build-no-bundle + node packages/babel-types/scripts/generateTypeHelpers.js + node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow + node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts + BABEL_ENV=development yarn gulp watch flow: - ./node_modules/.bin/flow check --strip-root + yarn flow check --strip-root lint: lint-js lint-ts lint-js: - ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe + yarn eslint scripts $(SOURCES) '*.js' --format=codeframe lint-ts: - ./scripts/tests/typescript/lint.sh + scripts/tests/typescript/lint.sh fix: fix-json - ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix + yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix fix-json: - ./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn + yarn prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn clean: test-clean rm -f .npmrc @@ -79,14 +79,18 @@ test-clean: $(foreach source, $(SOURCES), \ $(call clean-source-test, $(source))) +# Does not work on Windows; use "yarn jest" instead test-only: BABEL_ENV=test ./scripts/test.sh make test-clean test: lint test-only -test-ci: bootstrap test-only +test-ci: bootstrap + BABEL_ENV=test yarn jest --maxWorkers=4 --ci + make test-clean +# Does not work on Windows test-ci-coverage: SHELL:=/bin/bash test-ci-coverage: BABEL_COVERAGE=true BABEL_ENV=test make bootstrap @@ -94,9 +98,9 @@ test-ci-coverage: bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json bootstrap-flow: - rm -rf ./build/flow - mkdir -p ./build - git clone --branch=master --single-branch --shallow-since=2018-11-01 https://github.com/facebook/flow.git ./build/flow + rm -rf build/flow + mkdir -p build + git clone --branch=master --single-branch --shallow-since=2018-11-01 https://github.com/facebook/flow.git build/flow cd build/flow && git checkout $(FLOW_COMMIT) test-flow: @@ -108,9 +112,9 @@ test-flow-update-whitelist: node scripts/tests/flow/run_babel_parser_flow_tests.js --update-whitelist bootstrap-test262: - rm -rf ./build/test262 - mkdir -p ./build - git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git ./build/test262 + rm -rf build/test262 + mkdir -p build + git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git build/test262 cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: @@ -121,6 +125,7 @@ test-test262-ci: bootstrap test-test262 test-test262-update-whitelist: node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist +# Does not work on Windows clone-license: ./scripts/clone-license.sh @@ -139,11 +144,11 @@ prepublish: new-version: git pull --rebase - ./node_modules/.bin/lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" + yarn lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" # NOTE: Run make new-version first publish: prepublish - ./node_modules/.bin/lerna publish from-git --require-scripts + yarn lerna publish from-git --require-scripts make clean publish-ci: prepublish @@ -153,13 +158,13 @@ else echo "Missing NPM_TOKEN env var" exit 1 endif - ./node_modules/.bin/lerna publish from-git --require-scripts --yes + yarn lerna publish from-git --require-scripts --yes rm -f .npmrc make clean bootstrap-only: clean-all yarn --ignore-engines - ./node_modules/.bin/lerna bootstrap -- --ignore-engines + yarn lerna bootstrap -- --ignore-engines bootstrap: bootstrap-only make build diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename windows/options.json b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/options.json new file mode 100644 index 000000000000..0c847447d595 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/options.json @@ -0,0 +1,5 @@ +{ + "args": ["--filename", "test.js"], + "stderrContains": true, + "os": ["win32"] +} diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt new file mode 100644 index 000000000000..1ca69db1084e --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stderr.txt @@ -0,0 +1 @@ +SyntaxError: \test.js: Unexpected token, expected ";" (2:10) diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stdin.txt b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stdin.txt new file mode 100644 index 000000000000..1d931c7e8559 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename windows/stdin.txt @@ -0,0 +1,3 @@ +arr.map(function () { + return $]!; +}); diff --git a/packages/babel-cli/test/fixtures/babel/stdin --filename/options.json b/packages/babel-cli/test/fixtures/babel/stdin --filename/options.json index 4274d9a29614..724c35ed8520 100644 --- a/packages/babel-cli/test/fixtures/babel/stdin --filename/options.json +++ b/packages/babel-cli/test/fixtures/babel/stdin --filename/options.json @@ -1,4 +1,5 @@ { "args": ["--filename", "test.js"], - "stderrContains": true + "stderrContains": true, + "os": ["linux", "darwin"] } diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 2787b5832355..9e8af0d9b947 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -185,7 +185,29 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { }; const optionsLoc = path.join(testLoc, "options.json"); - if (fs.existsSync(optionsLoc)) merge(opts, require(optionsLoc)); + if (fs.existsSync(optionsLoc)) { + const taskOpts = require(optionsLoc); + if (taskOpts.os) { + let os = taskOpts.os; + + if (!Array.isArray(os) && typeof os !== "string") { + throw new Error( + `'os' should be either string or string array: ${taskOpts.os}`, + ); + } + + if (typeof os === "string") { + os = [os]; + } + + if (!os.includes(process.platform)) { + return; + } + + delete taskOpts.os; + } + merge(opts, taskOpts); + } ["stdout", "stdin", "stderr"].forEach(function(key) { const loc = path.join(testLoc, key + ".txt"); @@ -205,7 +227,7 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { opts.inFiles[".babelrc"] = helper.readFile(babelrcLoc); } - it(testName, buildTest(binName, testName, opts)); + it(testName, buildTest(binName, testName, opts), 20000); }); }); }); diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js index 32ee13867568..32513b1a4519 100644 --- a/packages/babel-core/test/config-chain.js +++ b/packages/babel-core/test/config-chain.js @@ -1,5 +1,6 @@ import fs from "fs"; import path from "path"; +import escapeRegExp from "lodash/escapeRegExp"; import { loadOptions as loadOptionsOrig } from "../lib"; function fixture(...args) { @@ -33,7 +34,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - test: new RegExp(fixture("nonexistant-fake")), + test: new RegExp(escapeRegExp(fixture("nonexistant-fake"))), comments: true, }); @@ -69,7 +70,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - test: new RegExp(fixture("nonexistant-unknown")), + test: new RegExp(escapeRegExp(fixture("nonexistant-unknown"))), comments: true, }); @@ -107,7 +108,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - test: [new RegExp(fixture("nonexistant-fake"))], + test: [new RegExp(escapeRegExp(fixture("nonexistant-fake")))], comments: true, }); @@ -143,7 +144,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - test: [new RegExp(fixture("nonexistant-unknown"))], + test: [new RegExp(escapeRegExp(fixture("nonexistant-unknown")))], comments: true, }); @@ -183,7 +184,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - include: new RegExp(fixture("nonexistant-fake")), + include: new RegExp(escapeRegExp(fixture("nonexistant-fake"))), comments: true, }); @@ -219,7 +220,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - include: new RegExp(fixture("nonexistant-unknown")), + include: new RegExp(escapeRegExp(fixture("nonexistant-unknown"))), comments: true, }); @@ -257,7 +258,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - include: [new RegExp(fixture("nonexistant-fake"))], + include: [new RegExp(escapeRegExp(fixture("nonexistant-fake")))], comments: true, }); @@ -293,7 +294,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - include: [new RegExp(fixture("nonexistant-unknown"))], + include: [new RegExp(escapeRegExp(fixture("nonexistant-unknown")))], comments: true, }); @@ -333,7 +334,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - exclude: new RegExp(fixture("nonexistant-fake")), + exclude: new RegExp(escapeRegExp(fixture("nonexistant-fake"))), comments: true, }); @@ -369,7 +370,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - exclude: new RegExp(fixture("nonexistant-unknown")), + exclude: new RegExp(escapeRegExp(fixture("nonexistant-unknown"))), comments: true, }); @@ -407,7 +408,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - exclude: [new RegExp(fixture("nonexistant-fake"))], + exclude: [new RegExp(escapeRegExp(fixture("nonexistant-fake")))], comments: true, }); @@ -443,7 +444,7 @@ describe("buildConfigChain", function() { cwd: fixture("nonexistant-fake"), filename: fixture("nonexistant-fake", "src.js"), babelrc: false, - exclude: [new RegExp(fixture("nonexistant-unknown"))], + exclude: [new RegExp(escapeRegExp(fixture("nonexistant-unknown")))], comments: true, }); diff --git a/packages/babel-generator/src/source-map.js b/packages/babel-generator/src/source-map.js index d03628a5eb53..9c58d8b8c64b 100644 --- a/packages/babel-generator/src/source-map.js +++ b/packages/babel-generator/src/source-map.js @@ -24,14 +24,20 @@ export default class SourceMap { const code = this._code; if (typeof code === "string") { - map.setSourceContent(this._opts.sourceFileName, code); + map.setSourceContent( + this._opts.sourceFileName.replace(/\\/g, "/"), + code, + ); } else if (typeof code === "object") { Object.keys(code).forEach(sourceFileName => { - map.setSourceContent(sourceFileName, code[sourceFileName]); + map.setSourceContent( + sourceFileName.replace(/\\/g, "/"), + code[sourceFileName], + ); }); } - this._rawMappings.forEach(map.addMapping, map); + this._rawMappings.forEach(mapping => map.addMapping(mapping), map); } return this._cachedMap.toJSON(); @@ -83,7 +89,10 @@ export default class SourceMap { line: generatedLine, column: generatedColumn, }, - source: line == null ? undefined : filename || this._opts.sourceFileName, + source: + line == null + ? undefined + : (filename || this._opts.sourceFileName).replace(/\\/g, "/"), original: line == null ? undefined diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index 4366d27e3322..1cc630e3bcfc 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -192,6 +192,26 @@ export default function get(entryLoc): Array { delete taskOpts.minNodeVersion; } + if (taskOpts.os) { + let os = taskOpts.os; + + if (!Array.isArray(os) && typeof os !== "string") { + throw new Error( + `'os' should be either string or string array: ${taskOpts.os}`, + ); + } + + if (typeof os === "string") { + os = [os]; + } + + if (!os.includes(process.platform)) { + return; + } + + delete taskOpts.os; + } + // traceur checks if (test.exec.code.indexOf("// Async.") >= 0) { diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index 1af2fb868560..eed9dde11342 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -295,12 +295,22 @@ function validateFile(actualCode, expectedLoc, expectedCode) { } function normalizeOutput(code) { - return code + let result = code .trim() .replace( new RegExp(escapeRegExp(path.resolve(__dirname, "../../../")), "g"), "", ); + if (process.platform === "win32") { + result = result.replace( + new RegExp( + escapeRegExp(path.resolve(__dirname, "../../../").replace(/\\/g, "/")), + "g", + ), + "", + ); + } + return result; } const toEqualFile = () => ({ diff --git a/packages/babel-node/test/index.js b/packages/babel-node/test/index.js index a603204aea07..9fd61c73f81e 100644 --- a/packages/babel-node/test/index.js +++ b/packages/babel-node/test/index.js @@ -198,7 +198,7 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { opts.inFiles[".babelrc"] = helper.readFile(babelrcLoc); } - it(testName, buildTest(binName, testName, opts)); + it(testName, buildTest(binName, testName, opts), 20000); }); }); }); diff --git a/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/options.json b/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/options.json new file mode 100644 index 000000000000..d6180568ae8d --- /dev/null +++ b/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/options.json @@ -0,0 +1,3 @@ +{ + "os": ["linux", "darwin"] +} diff --git a/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/with-source/options.json b/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/with-source/options.json new file mode 100644 index 000000000000..d6180568ae8d --- /dev/null +++ b/packages/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/with-source/options.json @@ -0,0 +1,3 @@ +{ + "os": ["linux", "darwin"] +} diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/options.json b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/options.json new file mode 100644 index 000000000000..d6180568ae8d --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/options.json @@ -0,0 +1,3 @@ +{ + "os": ["linux", "darwin"] +} diff --git a/packages/babel-preset-env/src/debug.js b/packages/babel-preset-env/src/debug.js index db72cf0c3e3e..747b895a1067 100644 --- a/packages/babel-preset-env/src/debug.js +++ b/packages/babel-preset-env/src/debug.js @@ -56,6 +56,10 @@ export const logEntryPolyfills = ( polyfillTargets: Targets, allBuiltInsList: { [key: string]: Targets }, ) => { + // normalize filename to generate consistent preset-env test fixtures + if (process.env.BABEL_ENV === "test") { + filename = filename.replace(/\\/g, "/"); + } if (!importPolyfillIncluded) { console.log(`\n[${filename}] Import of ${polyfillName} was not found.`); return; @@ -83,6 +87,10 @@ export const logUsagePolyfills = ( polyfillTargets: Targets, allBuiltInsList: { [key: string]: Targets }, ) => { + // normalize filename to generate consistent preset-env test fixtures + if (process.env.BABEL_ENV === "test") { + filename = filename.replace(/\\/g, "/"); + } if (!polyfills.size) { console.log( `\n[${filename}] Based on your code and targets, core-js polyfills were not added.`, diff --git a/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js b/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js index ea0baffbf350..53db45877398 100644 --- a/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js +++ b/packages/babel-preset-env/src/polyfills/regenerator/entry-plugin.js @@ -33,8 +33,13 @@ export default function() { }, post() { if (this.opts.debug && this.regeneratorImportExcluded) { + let filename = this.file.opts.filename; + // normalize filename to generate consistent preset-env test fixtures + if (process.env.BABEL_ENV === "test") { + filename = filename.replace(/\\/g, "/"); + } console.log( - `\n[${this.file.opts.filename}] Based on your targets, regenerator-runtime import excluded.`, + `\n[${filename}] Based on your targets, regenerator-runtime import excluded.`, ); } }, diff --git a/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js b/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js index 2803e7be1231..f417cf248de8 100644 --- a/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/regenerator/usage-plugin.js @@ -21,8 +21,13 @@ export default function() { }, post() { if (this.opts.debug && this.usesRegenerator) { + let filename = this.file.opts.filename; + // normalize filename to generate consistent preset-env test fixtures + if (process.env.BABEL_ENV === "test") { + filename = filename.replace(/\\/g, "/"); + } console.log( - `\n[${this.file.opts.filename}] Based on your code and targets, added regenerator-runtime.`, + `\n[${filename}] Based on your code and targets, added regenerator-runtime.`, ); } }, diff --git a/packages/babel-preset-react/test/fixtures/preset-options/development-windows/exec.js b/packages/babel-preset-react/test/fixtures/preset-options/development-windows/exec.js new file mode 100644 index 000000000000..3b7eb0d8ede5 --- /dev/null +++ b/packages/babel-preset-react/test/fixtures/preset-options/development-windows/exec.js @@ -0,0 +1,19 @@ +const actual = transform( + '', + Object.assign({}, opts, { filename: 'C:\\fake\\path\\mock.js' }) +).code; + +const expected = multiline([ + 'var _jsxFileName = "C:\\\\fake\\\\path\\\\mock.js";', + 'React.createElement(Foo, {', + ' bar: "baz",', + ' __source: {', + ' fileName: _jsxFileName,', + ' lineNumber: 1', + ' },', + ' __self: this', + '});', +]); + + +expect(actual).toBe(expected); diff --git a/packages/babel-preset-react/test/fixtures/preset-options/development-windows/options.json b/packages/babel-preset-react/test/fixtures/preset-options/development-windows/options.json new file mode 100644 index 000000000000..6ca8659a61e3 --- /dev/null +++ b/packages/babel-preset-react/test/fixtures/preset-options/development-windows/options.json @@ -0,0 +1,4 @@ +{ + "presets": [["react", { "development": true }]], + "os": ["win32"] +} diff --git a/packages/babel-preset-react/test/fixtures/preset-options/development/options.json b/packages/babel-preset-react/test/fixtures/preset-options/development/options.json index 20fb8a7d4beb..69900e734466 100644 --- a/packages/babel-preset-react/test/fixtures/preset-options/development/options.json +++ b/packages/babel-preset-react/test/fixtures/preset-options/development/options.json @@ -1,3 +1,4 @@ { - "presets": [["react", { "development": true }]] + "presets": [["react", { "development": true }]], + "os": ["linux", "darwin"] } From 5f1970433d27916d7795c3877e94d831ff1d7371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 27 Sep 2019 16:53:27 -0400 Subject: [PATCH 096/965] chore: only apply lazy cjs module transform on cli and core (#10443) --- babel.config.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/babel.config.js b/babel.config.js index 2aa9b1a306ee..fe0f90d0bad8 100644 --- a/babel.config.js +++ b/babel.config.js @@ -80,8 +80,7 @@ module.exports = function(api) { "@babel/plugin-proposal-optional-chaining", "@babel/plugin-proposal-nullish-coalescing-operator", - // Explicitly use the lazy version of CommonJS modules. - convertESM ? ["@babel/transform-modules-commonjs", { lazy: true }] : null, + convertESM ? "@babel/transform-modules-commonjs" : null, ].filter(Boolean), overrides: [ { @@ -92,18 +91,17 @@ module.exports = function(api) { ], }, { - test: "./packages/babel-register", + test: ["./packages/babel-cli", "./packages/babel-core"], plugins: [ - // Override the root options to disable lazy imports for babel-register - // because otherwise the require hook will try to lazy-import things - // leading to dependency cycles. - convertESM ? "@babel/transform-modules-commonjs" : null, + // Explicitly use the lazy version of CommonJS modules. + convertESM + ? ["@babel/transform-modules-commonjs", { lazy: true }] + : null, ].filter(Boolean), }, { test: "./packages/babel-polyfill", presets: [["@babel/env", envOptsNoTargets]], - plugins: [["@babel/transform-modules-commonjs", { lazy: false }]], }, { // The vast majority of our src files are modules, but we use From 94fcabc4e3bed021e1a05d6c7a9b0a52261b2018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Sep 2019 11:37:09 -0400 Subject: [PATCH 097/965] Update test262 whitelist --- Makefile | 4 +- scripts/tests/test262/test262_whitelist.txt | 466 ++++++++++++++++++-- 2 files changed, 438 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 1e88895bdd81..ea76e1f02bed 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = ce2dfd49d13740e995c96c34686d45c7960e628c +TEST262_COMMIT = a1acc23cd85c552cde9c06cfed300c58d4b5b04c # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true @@ -114,7 +114,7 @@ test-flow-update-whitelist: bootstrap-test262: rm -rf build/test262 mkdir -p build - git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git build/test262 + git clone --branch=master --single-branch --shallow-since=2019-09-01 https://github.com/tc39/test262.git build/test262 cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index d448d79356d3..2320871427a1 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -110,6 +110,16 @@ 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) @@ -118,38 +128,434 @@ 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/syntax/await-expr-array-literal.js(default) -language/module-code/top-level-await/syntax/await-expr-array-literal.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/await-expr-func-expression.js(default) -language/module-code/top-level-await/syntax/await-expr-func-expression.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-identifier.js(default) -language/module-code/top-level-await/syntax/await-expr-identifier.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-literal-number.js(default) -language/module-code/top-level-await/syntax/await-expr-literal-number.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-literal-string.js(default) -language/module-code/top-level-await/syntax/await-expr-literal-string.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-nested.js(default) -language/module-code/top-level-await/syntax/await-expr-nested.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-new-expr.js(default) -language/module-code/top-level-await/syntax/await-expr-new-expr.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-null.js(default) -language/module-code/top-level-await/syntax/await-expr-null.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-obj-literal.js(default) -language/module-code/top-level-await/syntax/await-expr-obj-literal.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-regexp.js(default) -language/module-code/top-level-await/syntax/await-expr-regexp.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-template-literal.js(default) -language/module-code/top-level-await/syntax/await-expr-template-literal.js(strict mode) -language/module-code/top-level-await/syntax/await-expr-this.js(default) -language/module-code/top-level-await/syntax/await-expr-this.js(strict mode) -language/module-code/top-level-await/syntax/block-await-expr.js(default) -language/module-code/top-level-await/syntax/block-await-expr.js(strict mode) -language/module-code/top-level-await/syntax/if-await-expr-boolean.js(default) -language/module-code/top-level-await/syntax/if-await-expr-boolean.js(strict mode) -language/module-code/top-level-await/syntax/try-await-expr.js(default) -language/module-code/top-level-await/syntax/try-await-expr.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-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-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-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 80d99b4d4e7ebb7f7136ad35163329375173ed2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 1 Oct 2019 11:40:42 +0200 Subject: [PATCH 098/965] Do not allow member expressions to start async arrows (#10332) * Do not allow member expressions to start async arrows * Boolean -> boolean --- .../babel-parser/src/parser/expression.js | 20 +- packages/babel-parser/src/plugins/flow.js | 2 - .../src/plugins/typescript/index.js | 10 +- packages/babel-parser/src/types.js | 1 + .../flow/regression/issue-10314/input.js | 3 + .../flow/regression/issue-10314/output.json | 198 ++++++++++++++++++ 6 files changed, 210 insertions(+), 24 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-10314/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index f7e75bfe5ea3..8dcf3aabef05 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -578,21 +578,16 @@ export default class ExpressionParser extends LValParser { startLoc: Position, noCalls?: ?boolean, ): N.Expression { - const maybeAsyncArrow = this.atPossibleAsync(base); - const state = { optionalChainMember: false, + maybeAsyncArrow: this.atPossibleAsync(base), stop: false, }; do { - base = this.parseSubscript( - base, - startPos, - startLoc, - noCalls, - state, - maybeAsyncArrow, - ); + base = this.parseSubscript(base, startPos, startLoc, noCalls, state); + + // After parsing a subscript, this isn't "async" for sure. + state.maybeAsyncArrow = false; } while (!state.stop); return base; } @@ -607,7 +602,6 @@ export default class ExpressionParser extends LValParser { startLoc: Position, noCalls: ?boolean, state: N.ParseSubscriptState, - maybeAsyncArrow: boolean, ): N.Expression { if (!noCalls && this.eat(tt.doubleColon)) { const node = this.startNodeAt(startPos, startLoc); @@ -695,7 +689,7 @@ export default class ExpressionParser extends LValParser { node.arguments = this.parseCallExpressionArguments( tt.parenR, - maybeAsyncArrow, + state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", ); @@ -705,7 +699,7 @@ export default class ExpressionParser extends LValParser { this.finishOptionalCallExpression(node); } - if (maybeAsyncArrow && this.shouldParseAsyncArrow()) { + if (state.maybeAsyncArrow && this.shouldParseAsyncArrow()) { state.stop = true; this.checkCommaAfterRestFromSpread(); diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 024a21baa5ab..da11a4eccc0f 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2634,7 +2634,6 @@ export default (superClass: Class): Class => startLoc: Position, noCalls: ?boolean, subscriptState: N.ParseSubscriptState, - maybeAsyncArrow: boolean, ): N.Expression { if (this.match(tt.questionDot) && this.isLookaheadRelational("<")) { this.expectPlugin("optionalChaining"); @@ -2687,7 +2686,6 @@ export default (superClass: Class): Class => startLoc, noCalls, subscriptState, - maybeAsyncArrow, ); } diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 5d6922d329eb..3ac78d17474a 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -1568,7 +1568,6 @@ export default (superClass: Class): Class => startLoc: Position, noCalls: ?boolean, state: N.ParseSubscriptState, - maybeAsyncArrow: boolean, ): N.Expression { if (!this.hasPrecedingLineBreak() && this.match(tt.bang)) { this.state.exprAllowed = false; @@ -1631,14 +1630,7 @@ export default (superClass: Class): Class => if (result) return result; } - return super.parseSubscript( - base, - startPos, - startLoc, - noCalls, - state, - maybeAsyncArrow, - ); + return super.parseSubscript(base, startPos, startLoc, noCalls, state); } parseNewArguments(node: N.NewExpression): void { diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 2c5992d2ba6c..8560da3a3f73 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1447,5 +1447,6 @@ export type Placeholder = NodeBase & { export type ParseSubscriptState = { optionalChainMember: boolean, + maybeAsyncArrow: boolean, stop: boolean, }; diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-10314/input.js b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/input.js new file mode 100644 index 000000000000..3c830a898f38 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/input.js @@ -0,0 +1,3 @@ +// @flow + +true ? async.waterfall() : null; diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json new file mode 100644 index 000000000000..3742c1bbf74d --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10314/output.json @@ -0,0 +1,198 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 10, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 32 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 10, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 31 + } + }, + "test": { + "type": "BooleanLiteral", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "value": true + }, + "consequent": { + "type": "CallExpression", + "start": 17, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "callee": { + "type": "MemberExpression", + "start": 17, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 22 + } + }, + "object": { + "type": "Identifier", + "start": 17, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 12 + }, + "identifierName": "async" + }, + "name": "async" + }, + "property": { + "type": "Identifier", + "start": 23, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 22 + }, + "identifierName": "waterfall" + }, + "name": "waterfall" + }, + "computed": false + }, + "arguments": [] + }, + "alternate": { + "type": "NullLiteral", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 27 + }, + "end": { + "line": 3, + "column": 31 + } + } + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file From 298c9a6c3304cdf48b0a57f6787d9956d9548e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 1 Oct 2019 11:19:29 -0400 Subject: [PATCH 099/965] Add filename to transform error (#10511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * polish: use “unknown” as a default filename in buildCodeFrameError * feat: add filename to transform error * fix: incorrect warning message * fix: add filename to generate phrase error message * address review comment from Nicolò --- .../src/transformation/file/file.js | 2 +- .../src/transformation/file/generate.js | 2 +- .../babel-core/src/transformation/index.js | 26 ++++++++++++++++--- .../src/transformation/normalize-file.js | 3 ++- .../build-code-frame-error/options.json | 2 +- .../fixtures/plugins/transform-error/exec.js | 15 +++++++++++ .../plugins/transform-error/options.json | 4 +++ 7 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 packages/babel-core/test/fixtures/plugins/transform-error/exec.js create mode 100644 packages/babel-core/test/fixtures/plugins/transform-error/options.json diff --git a/packages/babel-core/src/transformation/file/file.js b/packages/babel-core/src/transformation/file/file.js index a0a9f65bcdf4..2adb6e775763 100644 --- a/packages/babel-core/src/transformation/file/file.js +++ b/packages/babel-core/src/transformation/file/file.js @@ -259,7 +259,7 @@ export default class File { ): Error { let loc = node && (node.loc || node._loc); - msg = `${this.opts.filename}: ${msg}`; + msg = `${this.opts.filename ?? "unknown"}: ${msg}`; if (!loc && node) { const state = { diff --git a/packages/babel-core/src/transformation/file/generate.js b/packages/babel-core/src/transformation/file/generate.js index 9aff0188405c..b07851fe9cba 100644 --- a/packages/babel-core/src/transformation/file/generate.js +++ b/packages/babel-core/src/transformation/file/generate.js @@ -41,7 +41,7 @@ export default function generateCode( if (typeof result.then === "function") { throw new Error( - `You appear to be using an async parser plugin, ` + + `You appear to be using an async codegen plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, ` + `you may need to upgrade your @babel/core version.`, diff --git a/packages/babel-core/src/transformation/index.js b/packages/babel-core/src/transformation/index.js index 2412dd9e4981..e2eccd894537 100644 --- a/packages/babel-core/src/transformation/index.js +++ b/packages/babel-core/src/transformation/index.js @@ -55,11 +55,29 @@ export function runSync( ast, ); - transformFile(file, config.passes); - const opts = file.opts; - const { outputCode, outputMap } = - opts.code !== false ? generateCode(config.passes, file) : {}; + try { + transformFile(file, config.passes); + } catch (e) { + e.message = `${opts.filename ?? "unknown"}: ${e.message}`; + if (!e.code) { + e.code = "BABEL_TRANSFORM_ERROR"; + } + throw e; + } + + let outputCode, outputMap; + try { + if (opts.code !== false) { + ({ outputCode, outputMap } = generateCode(config.passes, file)); + } + } catch (e) { + e.message = `${opts.filename ?? "unknown"}: ${e.message}`; + if (!e.code) { + e.code = "BABEL_GENERATE_ERROR"; + } + throw e; + } return { metadata: file.metadata, diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 0bc88c8a0c1b..6326dd385e66 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -107,7 +107,7 @@ function parser( } else if (results.length === 1) { if (typeof results[0].then === "function") { throw new Error( - `You appear to be using an async codegen plugin, ` + + `You appear to be using an async parser plugin, ` + `which your current version of Babel does not support. ` + `If you're using a published plugin, you may need to upgrade ` + `your @babel/core version.`, @@ -121,6 +121,7 @@ function parser( err.message += "\nConsider renaming the file to '.mjs', or setting sourceType:module " + "or sourceType:unambiguous in your Babel config for this file."; + // err.code will be changed to BABEL_PARSE_ERROR later. } const { loc, missingPlugin } = err; diff --git a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json b/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json index b24f27d786a8..96fe5df0c4e2 100644 --- a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json +++ b/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json @@ -1,3 +1,3 @@ { - "throws": "undefined: someMsg\n> 1 | function f() {}" + "throws": "unknown: someMsg\n> 1 | function f() {}" } diff --git a/packages/babel-core/test/fixtures/plugins/transform-error/exec.js b/packages/babel-core/test/fixtures/plugins/transform-error/exec.js new file mode 100644 index 000000000000..a5d11f514dea --- /dev/null +++ b/packages/babel-core/test/fixtures/plugins/transform-error/exec.js @@ -0,0 +1,15 @@ +var code = "function f() {}"; +transform(code, { + plugins: [ + function() { + return { + visitor: { + FunctionDeclaration: function(path) { + throw new Error("someMsg"); + }, + }, + }; + }, + ], + filename: "/fake/path/example.js" +}); diff --git a/packages/babel-core/test/fixtures/plugins/transform-error/options.json b/packages/babel-core/test/fixtures/plugins/transform-error/options.json new file mode 100644 index 000000000000..056950478dcf --- /dev/null +++ b/packages/babel-core/test/fixtures/plugins/transform-error/options.json @@ -0,0 +1,4 @@ +{ + "throws": "/fake/path/example.js: someMsg", + "os": ["linux", "darwin"] +} From b351f29033ac109c2140dc6762758ffbf88522c9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 1 Oct 2019 15:36:22 -0400 Subject: [PATCH 100/965] Try different name for used-by feature again [skip ci] (#10513) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2f6b030afbe6..6e54e051ab68 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "babel", + "name": "@babel/core", "private": true, "license": "MIT", "scripts": { From 02f2d17e83d7e7047f41863b75e7bceb862bf2d6 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 1 Oct 2019 22:29:04 -0500 Subject: [PATCH 101/965] Revert "Try different name for used-by feature again [skip ci]" (#10515) This reverts commit b351f29033ac109c2140dc6762758ffbf88522c9. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6e54e051ab68..2f6b030afbe6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@babel/core", + "name": "babel", "private": true, "license": "MIT", "scripts": { From fa5057f9fb42cac020f1d07b622ede5ca6e57eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 2 Oct 2019 01:32:42 -0400 Subject: [PATCH 102/965] Flow: interface identifier should be declared in the scope (#10220) * fix: typo * declare name for flow interface * add test case for export overload function, typescript * test: add test Fixes #10044 * test: update test * test(flow): add multiple declarations regression test * re-enable flow test case # Conflicts: # packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js # packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js # packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js # packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js * test: disable two flow dupl-decl test * fix: do not declare name for declare function until we figure out a better way * test: duplicate declare function and function would not throw --- .../fixtures/flow/declare-statements/input.js | 8 +- .../flow/declare-statements/output.js | 8 +- .../fixtures/flow/def-site-variance/input.js | 8 +- .../fixtures/flow/def-site-variance/output.js | 8 +- .../test/fixtures/flow/internal-slot/input.js | 4 +- .../fixtures/flow/internal-slot/output.js | 4 +- .../flow/iterator-inside-interface/input.js | 4 +- .../flow/iterator-inside-interface/output.js | 4 +- .../babel-parser/src/parser/expression.js | 2 +- packages/babel-parser/src/plugins/flow.js | 9 + .../implements-exports/input.js | 3 + .../implements-exports/output.json | 160 +++++ .../flow/multiple-declarations/class/input.js | 2 + .../multiple-declarations/class/options.json | 8 + .../declare-class/input.js | 6 + .../declare-class/output.json | 253 ++++++++ .../declare-function/input.js | 3 + .../declare-function/output.json | 249 ++++++++ .../declare-var/input.js | 3 + .../declare-var/output.json | 150 +++++ .../multiple-declarations/interface/input.js | 2 + .../interface/options.json | 8 + .../flow/multiple-declarations/type/input.js | 2 + .../multiple-declarations/type/options.json | 8 + .../flow/regression/issue-10044/input.js | 8 + .../flow/regression/issue-10044/output.json | 564 ++++++++++++++++++ .../options.json | 3 - .../.dupl-decl-declare-func-func/options.json | 3 - .../.dupl-decl-declare-var-let/options.json | 3 - .../.dupl-decl-var-declare-class/options.json | 3 - .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../output.json | 147 +++++ .../input.js | 0 .../options.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../output.json | 178 ++++++ .../input.js | 0 .../dupl-decl-declare-func-func/options.json | 7 + .../dupl-decl-declare-func-func/output.json | 168 ++++++ .../input.js | 0 .../options.json | 0 .../input.js | 0 .../output.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../input.js | 0 .../options.json | 0 .../const-violations/flow-declar/input.js | 2 +- .../const-violations/flow-declar/output.js | 2 +- .../flow-comments/declare-statements/input.js | 18 +- .../declare-statements/output.js | 18 +- .../strip-types/def-site-variance/input.js | 8 +- .../strip-declare-statements/input.js | 18 +- .../input.js | 8 +- .../strip-types/strip-iterator/input.js | 4 +- .../function/overloads-exports/input.mjs | 4 + .../function/overloads-exports/options.json | 4 + .../function/overloads-exports/output.mjs | 3 + 78 files changed, 2013 insertions(+), 76 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/class/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/type/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-10044/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/options.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-func/options.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-let/options.json delete mode 100644 packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-class/options.json rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-declare-class => dupl-decl-const-declare-class}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-declare-class => dupl-decl-const-declare-class}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-declare-interface => dupl-decl-const-declare-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-declare-interface => dupl-decl-const-declare-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-interface => dupl-decl-const-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-const-interface => dupl-decl-const-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-class-declare-class => dupl-decl-declare-class-declare-class}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-class-declare-interface => dupl-decl-declare-class-declare-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-class-declare-interface => dupl-decl-declare-class-declare-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-func-declare-func => dupl-decl-declare-func-declare-func}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-func-declare-func => dupl-decl-declare-func-declare-func}/output.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-func-declare-var => dupl-decl-declare-func-declare-var}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-func-func => dupl-decl-declare-func-func}/input.js (100%) create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-interface-declare-class => dupl-decl-declare-interface-declare-class}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-interface-declare-class => dupl-decl-declare-interface-declare-class}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-var-declare-var => dupl-decl-declare-var-declare-var}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-var-declare-var => dupl-decl-declare-var-declare-var}/output.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-var-let => dupl-decl-declare-var-let}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-declare-func-let => dupl-decl-declare-var-let}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-interface-interface => dupl-decl-interface-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-interface-interface => dupl-decl-interface-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-declare-class => dupl-decl-let-declare-class}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-declare-class => dupl-decl-let-declare-class}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-declare-interface => dupl-decl-let-declare-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-declare-interface => dupl-decl-let-declare-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-interface => dupl-decl-let-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-let-interface => dupl-decl-let-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-type-interface => dupl-decl-type-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-type-interface => dupl-decl-type-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-var-declare-interface => dupl-decl-var-declare-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-var-declare-interface => dupl-decl-var-declare-interface}/options.json (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-var-interface => dupl-decl-var-interface}/input.js (100%) rename packages/babel-parser/test/fixtures/flow/scope/{.dupl-decl-var-interface => dupl-decl-var-interface}/options.json (100%) create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/input.mjs create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/options.json create mode 100644 packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/output.mjs diff --git a/packages/babel-generator/test/fixtures/flow/declare-statements/input.js b/packages/babel-generator/test/fixtures/flow/declare-statements/input.js index a0874c4d44a4..3a2d2aa6a74e 100644 --- a/packages/babel-generator/test/fixtures/flow/declare-statements/input.js +++ b/packages/babel-generator/test/fixtures/flow/declare-statements/input.js @@ -11,13 +11,13 @@ declare class A { static [ indexer: number]: string } declare class A { static () : number } declare class B { (): number } declare class A mixins B, C {} -declare type A = string +declare type A1 = string declare type T = { [k:string]: U } -declare type B = { +declare type B1 = { fn?: (foo: string) => void, } -declare interface I { foo: string } -declare interface I { foo: T } +declare interface I1 { foo: string } +declare interface I2 { foo: T } declare module.exports: { foo: string } declare opaque type Foo: Bar; declare opaque type ID; diff --git a/packages/babel-generator/test/fixtures/flow/declare-statements/output.js b/packages/babel-generator/test/fixtures/flow/declare-statements/output.js index 7be6ae40cec7..c5f087d49ab0 100644 --- a/packages/babel-generator/test/fixtures/flow/declare-statements/output.js +++ b/packages/babel-generator/test/fixtures/flow/declare-statements/output.js @@ -22,17 +22,17 @@ declare class B { (): number } declare class A mixins B, C {} -declare type A = string; +declare type A1 = string; declare type T = { [k: string]: U }; -declare type B = { +declare type B1 = { fn?: (foo: string) => void }; -declare interface I { +declare interface I1 { foo: string } -declare interface I { +declare interface I2 { foo: T } declare module.exports: { diff --git a/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js b/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js index 9f00e80993d1..0891ba212de5 100644 --- a/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js +++ b/packages/babel-generator/test/fixtures/flow/def-site-variance/input.js @@ -5,10 +5,10 @@ type T2 = { +p: T }; type T3 = { -p: T }; type T4 = { +[k:K]: V }; type T5 = { -[k:K]: V }; -interface I { +p: T } -interface I { -p: T } -interface I { +[k:K]: V } -interface I { -[k:K]: V } +interface I1 { +p: T } +interface I2 { -p: T } +interface I3 { +[k:K]: V } +interface I4 { -[k:K]: V } declare class I { +p: T } declare class I { -p: T } declare class I { +[k:K]: V } diff --git a/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js b/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js index 5c2b69d1a6dd..66dd195d22e1 100644 --- a/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js +++ b/packages/babel-generator/test/fixtures/flow/def-site-variance/output.js @@ -15,16 +15,16 @@ type T4 = { type T5 = { -[k: K]: V }; -interface I { +interface I1 { +p: T } -interface I { +interface I2 { -p: T } -interface I { +interface I3 { +[k: K]: V } -interface I { +interface I4 { -[k: K]: V } declare class I { diff --git a/packages/babel-generator/test/fixtures/flow/internal-slot/input.js b/packages/babel-generator/test/fixtures/flow/internal-slot/input.js index b00d3bd76f22..6056da54458a 100644 --- a/packages/babel-generator/test/fixtures/flow/internal-slot/input.js +++ b/packages/babel-generator/test/fixtures/flow/internal-slot/input.js @@ -1,7 +1,7 @@ declare class C { static [[foo]]: T } declare class C { [[foo]]: T } -interface I { [[foo]]: X } -interface I { [[foo]](): X } +interface I1 { [[foo]]: X } +interface I2 { [[foo]](): X } type T1 = { [[foo]]: X } type T2 = { [[foo]](): X } type T3 = { [[foo]]?: X } diff --git a/packages/babel-generator/test/fixtures/flow/internal-slot/output.js b/packages/babel-generator/test/fixtures/flow/internal-slot/output.js index 2a48fb9f186a..3b2b5ece1a23 100644 --- a/packages/babel-generator/test/fixtures/flow/internal-slot/output.js +++ b/packages/babel-generator/test/fixtures/flow/internal-slot/output.js @@ -4,10 +4,10 @@ declare class C { declare class C { [[foo]]: T } -interface I { +interface I1 { [[foo]]: X } -interface I { +interface I2 { [[foo]]() => X } type T1 = { diff --git a/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/input.js b/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/input.js index dab9a962acf7..7e5fb6309d97 100644 --- a/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/input.js +++ b/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/input.js @@ -1,7 +1,7 @@ -interface A { +interface A1 { @@iterator(): Iterator; } -interface A { +interface A2 { @@asyncIterator(): Iterator; } diff --git a/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/output.js b/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/output.js index ef726ab2fc5b..57b22ad84495 100644 --- a/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/output.js +++ b/packages/babel-generator/test/fixtures/flow/iterator-inside-interface/output.js @@ -1,6 +1,6 @@ -interface A { +interface A1 { @@iterator(): Iterator } -interface A { +interface A2 { @@asyncIterator(): Iterator } \ No newline at end of file diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 8dcf3aabef05..9833f882ea15 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1975,7 +1975,7 @@ export default class ExpressionParser extends LValParser { node.params[i], BIND_VAR, allowDuplicates ? null : nameHash, - "function paramter list", + "function parameter list", ); } } diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index da11a4eccc0f..c54f7b633d74 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -14,6 +14,8 @@ import { type BindingTypes, BIND_NONE, BIND_LEXICAL, + BIND_VAR, + BIND_FUNCTION, SCOPE_ARROW, SCOPE_OTHER, } from "../util/scopeflags"; @@ -270,6 +272,7 @@ export default (superClass: Class): Class => node.id = this.flowParseTypeAnnotatableIdentifier( /*allowPrimitiveOverride*/ true, ); + this.scope.declareName(node.id.name, BIND_VAR, node.id.start); this.semicolon(); return this.finishNode(node, "DeclareVariable"); } @@ -462,6 +465,12 @@ export default (superClass: Class): Class => ): void { node.id = this.flowParseRestrictedIdentifier(/*liberal*/ !isClass); + this.scope.declareName( + node.id.name, + isClass ? BIND_FUNCTION : BIND_LEXICAL, + node.id.start, + ); + if (this.isRelational("<")) { node.typeParameters = this.flowParseTypeParameterDeclaration(); } else { diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/input.js b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/input.js new file mode 100644 index 000000000000..6e0495a39c96 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/input.js @@ -0,0 +1,3 @@ +interface Foo {} + +export type { Foo } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json new file mode 100644 index 000000000000..15c57d370772 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json @@ -0,0 +1,160 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 0, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 10, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 14, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "ExportNamedDeclaration", + "start": 18, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "local": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "Foo" + }, + "name": "Foo" + }, + "exported": { + "type": "Identifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "Foo" + }, + "name": "Foo" + } + } + ], + "source": null, + "exportKind": "type", + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/input.js new file mode 100644 index 000000000000..fa5ff14cb9be --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/input.js @@ -0,0 +1,2 @@ +declare class C1 {} +class C1 {} 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 new file mode 100644 index 000000000000..06ad6ded6032 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "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/declare-class/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/input.js new file mode 100644 index 000000000000..d9470b0fd596 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/input.js @@ -0,0 +1,6 @@ +declare class C1{} +declare class C1{} + +declare module M1 { + declare class C1 {} +} diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json new file mode 100644 index 000000000000..149ca744eb22 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json @@ -0,0 +1,253 @@ +{ + "type": "File", + "start": 0, + "end": 82, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 82, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "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": 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": 16, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareClass", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "C1" + }, + "name": "C1" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareModule", + "start": 39, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 54, + "end": 56, + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 17 + }, + "identifierName": "M1" + }, + "name": "M1" + }, + "body": { + "type": "BlockStatement", + "start": 57, + "end": 82, + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "DeclareClass", + "start": 61, + "end": 80, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 75, + "end": 77, + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 18 + }, + "identifierName": "C1" + }, + "name": "C1" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 78, + "end": 80, + "loc": { + "start": { + "line": 5, + "column": 19 + }, + "end": { + "line": 5, + "column": 21 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + } + ] + }, + "kind": "CommonJS" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/input.js new file mode 100644 index 000000000000..fb98eb970189 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/input.js @@ -0,0 +1,3 @@ +declare function F1(): void +declare function F1(): void +function F1() {} diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json new file mode 100644 index 000000000000..ad507ae14079 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json @@ -0,0 +1,249 @@ +{ + "type": "File", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 27 + }, + "identifierName": "F1" + }, + "name": "F1", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 23, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 23 + }, + "end": { + "line": 1, + "column": 27 + } + } + } + } + } + }, + "predicate": null + }, + { + "type": "DeclareFunction", + "start": 28, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 45, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "F1" + }, + "name": "F1", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 47, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 47, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 51, + "end": 55, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 27 + } + } + } + } + } + }, + "predicate": null + }, + { + "type": "FunctionDeclaration", + "start": 56, + "end": 72, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "id": { + "type": "Identifier", + "start": 65, + "end": 67, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "F1" + }, + "name": "F1" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 70, + "end": 72, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/input.js new file mode 100644 index 000000000000..21b4f11b204c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/input.js @@ -0,0 +1,3 @@ +declare var V1; +declare var V1; +var V1; diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json new file mode 100644 index 000000000000..b96badb7fe54 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json @@ -0,0 +1,150 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareVariable", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 12, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "V1" + }, + "name": "V1" + } + }, + { + "type": "DeclareVariable", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "V1" + }, + "name": "V1" + } + }, + { + "type": "VariableDeclaration", + "start": 32, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 7 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "V1" + }, + "name": "V1" + }, + "init": null + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/input.js new file mode 100644 index 000000000000..bca93948ce50 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/input.js @@ -0,0 +1,2 @@ +interface I {}; +interface I {}; 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 new file mode 100644 index 000000000000..5672ce1b6444 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "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/type/input.js b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/input.js new file mode 100644 index 000000000000..273aa1c7176c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/input.js @@ -0,0 +1,2 @@ +type T1 = string; +type T1 = number; 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 new file mode 100644 index 000000000000..946261f4e872 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "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/regression/issue-10044/input.js b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/input.js new file mode 100644 index 000000000000..4d3e8c48a837 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/input.js @@ -0,0 +1,8 @@ +declare class C1 {} +declare interface I1 {} +declare type T1 = number; + +interface I2 {} +type T2 = number; + +export type { C1, I1, I2, T1, T2 } diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json new file mode 100644 index 000000000000..5df63e757a77 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json @@ -0,0 +1,564 @@ +{ + "type": "File", + "start": 0, + "end": 140, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 140, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "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": "DeclareInterface", + "start": 20, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "I1" + }, + "name": "I1" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "DeclareTypeAlias", + "start": 44, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 25 + } + }, + "id": { + "type": "Identifier", + "start": 57, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "T1" + }, + "name": "T1" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 62, + "end": 68, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 24 + } + } + } + }, + { + "type": "InterfaceDeclaration", + "start": 71, + "end": 86, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 81, + "end": 83, + "loc": { + "start": { + "line": 5, + "column": 10 + }, + "end": { + "line": 5, + "column": 12 + }, + "identifierName": "I2" + }, + "name": "I2" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 84, + "end": 86, + "loc": { + "start": { + "line": 5, + "column": 13 + }, + "end": { + "line": 5, + "column": 15 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + } + }, + { + "type": "TypeAlias", + "start": 87, + "end": 104, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 17 + } + }, + "id": { + "type": "Identifier", + "start": 92, + "end": 94, + "loc": { + "start": { + "line": 6, + "column": 5 + }, + "end": { + "line": 6, + "column": 7 + }, + "identifierName": "T2" + }, + "name": "T2" + }, + "typeParameters": null, + "right": { + "type": "NumberTypeAnnotation", + "start": 97, + "end": 103, + "loc": { + "start": { + "line": 6, + "column": 10 + }, + "end": { + "line": 6, + "column": 16 + } + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 106, + "end": 140, + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 34 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 120, + "end": 122, + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 16 + } + }, + "local": { + "type": "Identifier", + "start": 120, + "end": 122, + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 16 + }, + "identifierName": "C1" + }, + "name": "C1" + }, + "exported": { + "type": "Identifier", + "start": 120, + "end": 122, + "loc": { + "start": { + "line": 8, + "column": 14 + }, + "end": { + "line": 8, + "column": 16 + }, + "identifierName": "C1" + }, + "name": "C1" + } + }, + { + "type": "ExportSpecifier", + "start": 124, + "end": 126, + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 20 + } + }, + "local": { + "type": "Identifier", + "start": 124, + "end": 126, + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 20 + }, + "identifierName": "I1" + }, + "name": "I1" + }, + "exported": { + "type": "Identifier", + "start": 124, + "end": 126, + "loc": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 8, + "column": 20 + }, + "identifierName": "I1" + }, + "name": "I1" + } + }, + { + "type": "ExportSpecifier", + "start": 128, + "end": 130, + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 24 + } + }, + "local": { + "type": "Identifier", + "start": 128, + "end": 130, + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 24 + }, + "identifierName": "I2" + }, + "name": "I2" + }, + "exported": { + "type": "Identifier", + "start": 128, + "end": 130, + "loc": { + "start": { + "line": 8, + "column": 22 + }, + "end": { + "line": 8, + "column": 24 + }, + "identifierName": "I2" + }, + "name": "I2" + } + }, + { + "type": "ExportSpecifier", + "start": 132, + "end": 134, + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "local": { + "type": "Identifier", + "start": 132, + "end": 134, + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 28 + }, + "identifierName": "T1" + }, + "name": "T1" + }, + "exported": { + "type": "Identifier", + "start": 132, + "end": 134, + "loc": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 28 + }, + "identifierName": "T1" + }, + "name": "T1" + } + }, + { + "type": "ExportSpecifier", + "start": 136, + "end": 138, + "loc": { + "start": { + "line": 8, + "column": 30 + }, + "end": { + "line": 8, + "column": 32 + } + }, + "local": { + "type": "Identifier", + "start": 136, + "end": 138, + "loc": { + "start": { + "line": 8, + "column": 30 + }, + "end": { + "line": 8, + "column": 32 + }, + "identifierName": "T2" + }, + "name": "T2" + }, + "exported": { + "type": "Identifier", + "start": 136, + "end": 138, + "loc": { + "start": { + "line": 8, + "column": 30 + }, + "end": { + "line": 8, + "column": 32 + }, + "identifierName": "T2" + }, + "name": "T2" + } + } + ], + "source": null, + "exportKind": "type", + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/options.json b/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/options.json deleted file mode 100644 index 81dc2c90799f..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/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-declare-func-func/options.json b/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-func/options.json deleted file mode 100644 index 5f6027f8dd3b..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-func/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:9)" -} 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 deleted file mode 100644 index b6ff3a4b0987..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-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-var-declare-class/options.json b/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-class/options.json deleted file mode 100644 index 4a1b4e5c5cd4..000000000000 --- a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "Identifier 'A' has already been declared (2:14)" -} diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-class/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-class/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-class/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-declare-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-const-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-class-declare-class/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-class-declare-class/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json new file mode 100644 index 000000000000..25358ef97ae7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json @@ -0,0 +1,147 @@ +{ + "type": "File", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "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": "DeclareClass", + "start": 19, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "A" + }, + "name": "A" + }, + "typeParameters": null, + "extends": [], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 35, + "end": 37, + "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-class-declare-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-class-declare-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-class-declare-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-func/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-func/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-func/output.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-declare-var/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json new file mode 100644 index 000000000000..5e5c135d5908 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "A" + }, + "name": "A", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + } + } + }, + "predicate": null + }, + { + "type": "DeclareVariable", + "start": 28, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "id": { + "type": "Identifier", + "start": 40, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 21 + }, + "identifierName": "A" + }, + "name": "A", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 41, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "typeAnnotation": { + "type": "NumberTypeAnnotation", + "start": 43, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 21 + } + } + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-func/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-func/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json new file mode 100644 index 000000000000..7c91792f0e9c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json @@ -0,0 +1,7 @@ +{ + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ] +} diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json new file mode 100644 index 000000000000..44114ec35913 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json @@ -0,0 +1,168 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "DeclareFunction", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 26 + }, + "identifierName": "A" + }, + "name": "A", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "typeAnnotation": { + "type": "FunctionTypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "typeParameters": null, + "params": [], + "rest": null, + "returnType": { + "type": "VoidTypeAnnotation", + "start": 22, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 26 + } + } + } + } + } + }, + "predicate": null + }, + { + "type": "FunctionDeclaration", + "start": 28, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "A" + }, + "name": "A" + }, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "body": [], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-interface-declare-class/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-interface-declare-class/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-interface-declare-class/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-declare-var/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-declare-var/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-declare-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-declare-var/output.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-let/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-var-let/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/input.js diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-let/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-declare-func-let/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-interface-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-interface-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-interface-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-class/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-class/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-class/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-declare-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-let-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-type-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-type-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-type-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-declare-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/options.json diff --git a/packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-interface/input.js b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-interface/input.js rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/flow/scope/.dupl-decl-var-interface/options.json rename to packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/options.json diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/input.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/input.js index e9ca299ae87e..666d38e3a4ed 100644 --- a/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/input.js +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/input.js @@ -1,2 +1,2 @@ declare class foo {} -const foo = 1; +const foo1 = 1; diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/output.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/output.js index 9375fc4abd22..0332cc0604b1 100644 --- a/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/output.js +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/const-violations/flow-declar/output.js @@ -1 +1 @@ -var foo = 1; +var foo1 = 1; diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/input.js index 7c2826479454..64db78b233dc 100644 --- a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/input.js +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/input.js @@ -4,13 +4,13 @@ declare function foo(): void declare function foo(): void; declare function foo(): void; declare function foo(x: number, y: string): void; -declare class A {} -declare class A extends B { x: number } -declare class A { static foo(): number, static x : string } -declare class A { static [ indexer: number]: string } -declare class A { static () : number } -declare class A mixins B, C {} -declare type A = string +declare class A1 {} +declare class A1 extends B { x: number } +declare class A1 { static foo(): number, static x : string } +declare class A1 { static [ indexer: number]: string } +declare class A1 { static () : number } +declare class A1 mixins B, C {} +declare type A2 = string declare type T = { [k:string]: U } -declare interface I { foo: string } -declare interface I { foo: T } +declare interface I1 { foo: string } +declare interface I2 { foo: T } diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/output.js index 3be48955c146..3feecb2a9347 100644 --- a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/output.js +++ b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/declare-statements/output.js @@ -10,22 +10,22 @@ /*:: declare function foo(x: number, y: string): void;*/ -/*:: declare class A {}*/ +/*:: declare class A1 {}*/ -/*:: declare class A extends B { x: number }*/ +/*:: declare class A1 extends B { x: number }*/ -/*:: declare class A { static foo(): number, static x : string }*/ +/*:: declare class A1 { static foo(): number, static x : string }*/ -/*:: declare class A { static [ indexer: number]: string }*/ +/*:: declare class A1 { static [ indexer: number]: string }*/ -/*:: declare class A { static () : number }*/ +/*:: declare class A1 { static () : number }*/ -/*:: declare class A mixins B, C {}*/ +/*:: declare class A1 mixins B, C {}*/ -/*:: declare type A = string*/ +/*:: declare type A2 = string*/ /*:: declare type T = { [k:string]: U }*/ -/*:: declare interface I { foo: string }*/ +/*:: declare interface I1 { foo: string }*/ -/*:: declare interface I { foo: T }*/ +/*:: declare interface I2 { foo: T }*/ diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js index eb188c5c908a..9cc374a5d523 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/def-site-variance/input.js @@ -5,10 +5,10 @@ type T1 = { +p: T } type T2 = { -p: T } type T3 = { +[k:K]: V } type T4 = { -[k:K]: V } -interface I { +p: T } -interface I { -p: T } -interface I { +[k:K]: V } -interface I { -[k:K]: V } +interface I1 { +p: T } +interface I2 { -p: T } +interface I3 { +[k:K]: V } +interface I4 { -[k:K]: V } declare class I { +p: T } declare class I { -p: T } declare class I { +[k:K]: V } diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js index 75b24828392c..10cce21e41f8 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-declare-statements/input.js @@ -4,14 +4,14 @@ declare function foo(): void declare function foo(): void; declare function foo(): void; declare function foo(x: number, y: string): void; -declare class A {} -declare class A extends B { x: number } -declare class A { static foo(): number; static x : string } -declare class A { static [ indexer: number]: string } -declare class A { static () : number } -declare class A mixins B, C {} -declare type A = string +declare class A1 {} +declare class A1 extends B { x: number } +declare class A1 { static foo(): number; static x : string } +declare class A1 { static [ indexer: number]: string } +declare class A1 { static () : number } +declare class A1 mixins B, C {} +declare type A2 = string declare type T = { [k:string]: U } -declare interface I { foo: string } -declare interface I { foo: T } +declare interface I1 { foo: string } +declare interface I2 { foo: T } declare module.exports: string; diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js index 2e37dfaf618d..1ee5de6c9ea3 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-interfaces-module-and-script/input.js @@ -1,7 +1,7 @@ -interface A {} -interface A extends B {} -interface A extends B, C {} -interface A { foo: () => number; } +interface A1 {} +interface A2 extends B {} +interface A3 extends B, C {} +interface A4 { foo: () => number; } interface Dictionary { [index: string]: string; length: number; } class Foo implements Bar {} class Foo2 extends Bar implements Bat, Man {} diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js index 741c23987d23..7a1d4011b35a 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-iterator/input.js @@ -6,10 +6,10 @@ declare class A { @@asyncIterator(): Iterator; } -interface A { +interface A1 { @@iterator(): Iterator; } -interface A { +interface A2 { @@asyncIterator(): Iterator; } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/input.mjs b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/input.mjs new file mode 100644 index 000000000000..d2e9958f6aaf --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/input.mjs @@ -0,0 +1,4 @@ +function f(): void; +function f(): void { +} +export { f } \ No newline at end of file diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/options.json new file mode 100644 index 000000000000..d5e8a7e4201b --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/options.json @@ -0,0 +1,4 @@ +{ + "plugins": ["transform-typescript"], + "sourceType": "module" +} diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/output.mjs b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/output.mjs new file mode 100644 index 000000000000..a7997dca3a66 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/function/overloads-exports/output.mjs @@ -0,0 +1,3 @@ +function f() {} + +export { f }; From a219b6de7abfd494bdcdb8af10893391a8a86131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 2 Oct 2019 07:37:40 +0200 Subject: [PATCH 103/965] Disallow await inside async arrow params (#10469) * Disallow await inside async arrow params * Use -1 as default for awaitPos/yieldPos --- .../babel-parser/src/parser/expression.js | 83 +++++-- packages/babel-parser/src/parser/statement.js | 7 +- packages/babel-parser/src/parser/util.js | 6 +- packages/babel-parser/src/tokenizer/state.js | 4 +- .../input.js | 1 + .../options.json | 3 + .../input.js | 3 + .../output.json | 224 +++++++++++++++++ .../input.js | 1 + .../output.json | 225 ++++++++++++++++++ scripts/tests/test262/test262_whitelist.txt | 10 - 11 files changed, 526 insertions(+), 41 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/input.js create 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-inside-async-call-inside-parameters-of-function-inside-async-function/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9833f882ea15..bf47b980ba1a 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -490,11 +490,7 @@ export default class ExpressionParser extends LValParser { // Parse unary operators, both prefix and postfix. parseMaybeUnary(refShorthandDefaultPos: ?Pos): N.Expression { - if ( - this.isContextual("await") && - (this.scope.inAsync || - (!this.scope.inFunction && this.options.allowAwaitOutsideFunction)) - ) { + if (this.isContextual("await") && this.isAwaitAllowed()) { return this.parseAwait(); } else if (this.state.type.prefix) { const node = this.startNode(); @@ -676,8 +672,8 @@ export default class ExpressionParser extends LValParser { const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.next(); @@ -716,8 +712,34 @@ export default class ExpressionParser extends LValParser { // We keep the old value if it isn't null, for cases like // (x = async(yield)) => {} - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; + // + // Hi developer of the future :) If you are implementing generator + // arrow functions, please read the note below about "await" and + // verify if the same logic is needed for yield. + if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos; + + // Await is trickier than yield. When parsing a possible arrow function + // (e.g. something starting with `async(`) we don't know if its possible + // parameters will actually be inside an async arrow function or if it is + // a normal call expression. + // If it ended up being a call expression, if we are in a context where + // await expression are disallowed (and thus "await" is an identifier) + // we must be careful not to leak this.state.awaitPos to an even outer + // context, where "await" could not be an identifier. + // For example, this code is valid because "await" isn't directly inside + // an async function: + // + // async function a() { + // function b(param = async (await)) { + // } + // } + // + if ( + (!this.isAwaitAllowed() && !oldMaybeInArrowParameters) || + oldAwaitPos !== -1 + ) { + this.state.awaitPos = oldAwaitPos; + } } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; @@ -1231,8 +1253,8 @@ export default class ExpressionParser extends LValParser { const oldAwaitPos = this.state.awaitPos; const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody; this.state.maybeInArrowParameters = true; - this.state.yieldPos = 0; - this.state.awaitPos = 0; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.state.inFSharpPipelineDirectBody = false; const innerStartPos = this.state.start; @@ -1310,8 +1332,8 @@ export default class ExpressionParser extends LValParser { // We keep the old value if it isn't null, for cases like // (x = (yield)) => {} - this.state.yieldPos = oldYieldPos || this.state.yieldPos; - this.state.awaitPos = oldAwaitPos || this.state.awaitPos; + if (oldYieldPos !== -1) this.state.yieldPos = oldYieldPos; + if (oldAwaitPos !== -1) this.state.awaitPos = oldAwaitPos; if (!exprList.length) { this.unexpected(this.state.lastTokStart); @@ -1804,8 +1826,8 @@ export default class ExpressionParser extends LValParser { ): T { const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; - this.state.yieldPos = 0; - this.state.awaitPos = 0; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.initFunction(node, isAsync); node.generator = !!isGenerator; @@ -1842,8 +1864,8 @@ export default class ExpressionParser extends LValParser { const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; + this.state.yieldPos = -1; + this.state.awaitPos = -1; if (params) this.setArrowFunctionParameters(node, params); this.parseFunctionBody(node, true); @@ -2117,11 +2139,18 @@ export default class ExpressionParser extends LValParser { ); } - if (this.scope.inAsync && word === "await") { - this.raise( - startLoc, - "Can not use 'await' as identifier inside an async function", - ); + if (word === "await") { + if (this.scope.inAsync) { + this.raise( + startLoc, + "Can not use 'await' as identifier inside an async function", + ); + } else if ( + this.state.awaitPos === -1 && + (this.state.maybeInArrowParameters || this.isAwaitAllowed()) + ) { + this.state.awaitPos = this.state.start; + } } if (this.state.inClassProperty && word === "arguments") { @@ -2151,10 +2180,16 @@ export default class ExpressionParser extends LValParser { } } + isAwaitAllowed(): boolean { + if (this.scope.inFunction) return this.scope.inAsync; + if (this.options.allowAwaitOutsideFunction) return true; + return false; + } + // Parses await expression inside async function. parseAwait(): N.AwaitExpression { - if (!this.state.awaitPos) { + if (this.state.awaitPos === -1) { this.state.awaitPos = this.state.start; } const node = this.startNode(); @@ -2183,7 +2218,7 @@ export default class ExpressionParser extends LValParser { // Parses yield expression inside generator. parseYield(noIn?: ?boolean): N.YieldExpression { - if (!this.state.yieldPos) { + if (this.state.yieldPos === -1) { this.state.yieldPos = this.state.start; } const node = this.startNode(); diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index bb5702e7de34..bfadb601dbcf 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1050,12 +1050,14 @@ export default class StatementParser extends ExpressionParser { node.id = this.parseFunctionId(requireId); } + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldInClassProperty = this.state.inClassProperty; const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; + this.state.maybeInArrowParameters = false; this.state.inClassProperty = false; - this.state.yieldPos = 0; - this.state.awaitPos = 0; + this.state.yieldPos = -1; + this.state.awaitPos = -1; this.scope.enter(functionFlags(node.async, node.generator)); if (!isStatement) { @@ -1084,6 +1086,7 @@ export default class StatementParser extends ExpressionParser { this.checkFunctionStatementId(node); } + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; this.state.inClassProperty = oldInClassProperty; this.state.yieldPos = oldYieldPos; this.state.awaitPos = oldAwaitPos; diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index bd6139a2480a..41e19c1a3c2e 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -159,15 +159,15 @@ export default class UtilParser extends Tokenizer { checkYieldAwaitInDefaultParams() { if ( - this.state.yieldPos && - (!this.state.awaitPos || this.state.yieldPos < this.state.awaitPos) + this.state.yieldPos !== -1 && + (this.state.awaitPos === -1 || this.state.yieldPos < this.state.awaitPos) ) { this.raise( this.state.yieldPos, "Yield cannot be used as name inside a generator function", ); } - if (this.state.awaitPos) { + if (this.state.awaitPos !== -1) { this.raise( this.state.awaitPos, "Await cannot be used as name inside an async function", diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index 80842fbc5103..a9dccb2bf0e6 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -97,8 +97,8 @@ export default class State { decoratorStack: Array> = [[]]; // Positions to delayed-check that yield/await does not exist in default parameters. - yieldPos: number = 0; - awaitPos: number = 0; + yieldPos: number = -1; + awaitPos: number = -1; // Token store. tokens: Array = []; diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/input.js new file mode 100644 index 000000000000..5b6e6b2866ae --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/input.js @@ -0,0 +1 @@ +async (a = ({ await }) => {}) => {}; 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 new file mode 100644 index 000000000000..c066100759e2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-binding-inside-arrow-params-inside-async-arrow-params/options.json @@ -0,0 +1,3 @@ +{ + "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-inside-async-call-inside-parameters-of-function-inside-async-function/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/input.js new file mode 100644 index 000000000000..1c99cb921526 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/input.js @@ -0,0 +1,3 @@ +async function f() { + function g(x = async(await)) {} +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json new file mode 100644 index 000000000000..41946b0a2bcb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 56, + "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": "f" + }, + "name": "f" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 56, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "FunctionDeclaration", + "start": 23, + "end": 54, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 12 + }, + "identifierName": "g" + }, + "name": "g" + }, + "generator": false, + "async": false, + "params": [ + { + "type": "AssignmentPattern", + "start": 34, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "left": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "x" + }, + "name": "x" + }, + "right": { + "type": "CallExpression", + "start": 38, + "end": 50, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "callee": { + "type": "Identifier", + "start": 38, + "end": 43, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "async" + }, + "name": "async" + }, + "arguments": [ + { + "type": "Identifier", + "start": 44, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 28 + }, + "identifierName": "await" + }, + "name": "await" + } + ] + } + } + ], + "body": { + "type": "BlockStatement", + "start": 52, + "end": 54, + "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/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/input.js new file mode 100644 index 000000000000..72058aa6dd6b --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/input.js @@ -0,0 +1 @@ +async (a = ({ await: x }) => {}) => {}; diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json new file mode 100644 index 000000000000..0d5a5b2fa589 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json @@ -0,0 +1,225 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "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": "ArrowFunctionExpression", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "AssignmentPattern", + "start": 7, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "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": 31, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 14, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "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": false, + "value": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 2320871427a1..9c76b5ca07a5 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -1,15 +1,5 @@ language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) -language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(default) -language/expressions/async-arrow-function/await-as-param-ident-nested-arrow-parameter-position.js(strict mode) -language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js(default) -language/expressions/async-arrow-function/await-as-param-nested-arrow-parameter-position.js(strict mode) -language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js(default) -language/expressions/async-arrow-function/await-as-param-rest-nested-arrow-parameter-position.js(strict mode) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js(default) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals-default.js(strict mode) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js(default) -language/expressions/async-arrow-function/early-errors-arrow-await-in-formals.js(strict mode) language/expressions/class/elements/fields-duplicate-privatenames.js(default) language/expressions/class/elements/fields-duplicate-privatenames.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) From fa5a40c8d5eb97f76c6574804bfe37028f3e9e7f Mon Sep 17 00:00:00 2001 From: "David J. Hamilton" Date: Wed, 2 Oct 2019 07:45:03 -0700 Subject: [PATCH 104/965] assertNoDuplicates throw with more context (#10419) When users see errors like ``` Duplicate plugin/preset detected. If you'd like to use two separate instances of a plugin, they need separate names, e.g. plugins: [ ['some-plugin', {}], ['some-plugin', {}, 'some unique name'], ] ``` It can be difficult to determine the source of the conflict, especially in a larger build system. This commit outputs what is known about the plugins that actually conflict, which can be helpful for users to determine the root cause of the conflict. Partially addresses #9778 --- .../babel-core/src/config/config-descriptors.js | 4 ++++ packages/babel-core/test/option-manager.js | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/babel-core/src/config/config-descriptors.js b/packages/babel-core/src/config/config-descriptors.js index e17cca93c680..d9218a87c020 100644 --- a/packages/babel-core/src/config/config-descriptors.js +++ b/packages/babel-core/src/config/config-descriptors.js @@ -345,6 +345,7 @@ function assertNoDuplicates(items: Array): void { } if (nameMap.has(item.name)) { + const conflicts = items.filter(i => i.value === item.value); throw new Error( [ `Duplicate plugin/preset detected.`, @@ -355,6 +356,9 @@ function assertNoDuplicates(items: Array): void { ` ['some-plugin', {}],`, ` ['some-plugin', {}, 'some unique name'],`, ` ]`, + ``, + `Duplicates detected are:`, + `${JSON.stringify(conflicts, null, 2)}`, ].join("\n"), ); } diff --git a/packages/babel-core/test/option-manager.js b/packages/babel-core/test/option-manager.js index 4a6301ab4777..8839f1178c3a 100644 --- a/packages/babel-core/test/option-manager.js +++ b/packages/babel-core/test/option-manager.js @@ -27,14 +27,19 @@ describe("option-manager", () => { return { plugin, calls }; } - it("should throw if a plugin is repeated", () => { - const { calls, plugin } = makePlugin(); + it("should throw if a plugin is repeated, with information about the repeated plugin", () => { + const { calls, plugin } = makePlugin("my-plugin"); expect(() => { loadOptions({ - plugins: [plugin, plugin], + plugins: [ + [plugin, undefined, "my-plugin"], + [plugin, undefined, "my-plugin"], + ], }); - }).toThrow(/Duplicate plugin\/preset detected/); + }).toThrow( + /Duplicate plugin\/preset detected.*Duplicates detected are.*my-plugin.*my-plugin/ms, + ); expect(calls).toEqual([]); }); From 57ae306457ceda6689124a2a55a0c9d959f8d3ae Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 2 Oct 2019 12:13:58 -0500 Subject: [PATCH 105/965] Bump flow@0.108.0 (#10516) --- package.json | 2 +- packages/babel-preset-env/src/utils.js | 2 +- packages/babel-preset-env/test/utils.spec.js | 2 ++ yarn.lock | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2f6b030afbe6..89b4611eda71 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "eslint-plugin-import": "^2.17.2", "eslint-plugin-prettier": "^3.1.0", "fancy-log": "^1.3.3", - "flow-bin": "^0.102.0", + "flow-bin": "^0.108.0", "graceful-fs": "^4.1.15", "gulp": "^4.0.2", "gulp-babel": "^8.0.0", diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index fa4e2ecce0fe..cb35951a8f87 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -62,7 +62,7 @@ export function findSuggestion(options: string[], option: string): string { return validOption; } return suggestion; - }, undefined); + }, ""); } export function prettifyVersion(version: string) { diff --git a/packages/babel-preset-env/test/utils.spec.js b/packages/babel-preset-env/test/utils.spec.js index 2dce5f76c504..6a6bb48d3919 100644 --- a/packages/babel-preset-env/test/utils.spec.js +++ b/packages/babel-preset-env/test/utils.spec.js @@ -56,6 +56,8 @@ describe("utils", () => { const options = ["one", "two", "three"]; expect(findSuggestion(options, "onr")).toEqual("one"); expect(findSuggestion(options, "tree")).toEqual("three"); + expect(findSuggestion(options, "")).toEqual("one"); + expect(findSuggestion(options, "xxx")).toEqual("one"); }); }); }); diff --git a/yarn.lock b/yarn.lock index 42b1f996c88b..44a15c55b9ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4880,10 +4880,10 @@ flatted@^2.0.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== -flow-bin@^0.102.0: - version "0.102.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.102.0.tgz#3d5de44bcc26d26585e932b3201988b766f9b380" - integrity sha512-mYon6noeLO0Q5SbiWULLQeM1L96iuXnRtYMd47j3bEWXAwUW9EnwNWcn+cZg/jC/Dg4Wj/jnkdTDEuFtbeu1ww== +flow-bin@^0.108.0: + version "0.108.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.108.0.tgz#6a42c85fd664d23dd937d925851e8e6ab5d71393" + integrity sha512-hPEyCP1J8rdhNDfCAA5w7bN6HUNBDcHVg/ABU5JVo0gUFMx+uRewpyEH8LlLBGjVQuIpbaPpaqpoaQhAVyaYww== flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: version "1.1.1" From 0b37ab0362083a526a33ccf30407afd538b5cb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 2 Oct 2019 18:17:04 -0400 Subject: [PATCH 106/965] Use `make -j` for parallel build (#10506) * build: add build-babel-types task * chore: revamp Makefile to for parallel builds * chore: style fix * chore: skip install step as we handle yarn in makefile * test job execution order --- .travis.yml | 38 ++++++--------- Gulpfile.js | 62 +++++++++++------------- Makefile | 134 +++++++++++++++++++++++++++++++++++---------------- package.json | 1 - 4 files changed, 136 insertions(+), 99 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ae4cb229356..4b897a8e1a1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,48 +6,40 @@ cache: os: linux -node_js: - # We test the latest version on circleci - - "11" - - "10" - - "8" - - "6" - env: global: - PATH=$HOME/.yarn/bin:$PATH - JOB=test -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - -install: - # the `make test-ci` script runs this command already - - if [ "$JOB" != "test" ] && [ "$JOB" != "lint" ]; then yarn install; fi - - if [ "$JOB" = "lint" ]; then make bootstrap; fi - +install: skip before_script: + - curl -o- -L https://yarnpkg.com/install.sh | bash - if [ "$TRAVIS_OS_NAME" = "windows" ]; then choco install make; fi - - if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi - - if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi script: - - if [ "$JOB" = "test" ]; then make test-ci; fi - - if [ "$JOB" = "lint" ]; then make lint && make flow; fi - - if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi - - if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi + - if [ "$JOB" = "test" ]; then make -j test-ci; fi + - if [ "$JOB" = "lint" ]; then make -j code-quality-ci; fi + - if [ "$JOB" = "babel-parser-flow-tests" ]; then make -j test-flow-ci; fi + - if [ "$JOB" = "babel-parser-test262-tests" ]; then make -j test-test262-ci; fi matrix: fast_finish: true include: + - node_js: "node" + env: JOB=lint + # We test the latest version on circleci + - node_js: "11" + # 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 - - node_js: "node" - env: JOB=lint + # Continue node_js matrix + - node_js: "6" + - node_js: "10" + - node_js: "8" - node_js: "node" env: JOB=babel-parser-flow-tests - node_js: "node" diff --git a/Gulpfile.js b/Gulpfile.js index 5df9882ca3f2..c8a60079bff8 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -11,25 +11,20 @@ const filter = require("gulp-filter"); const gulp = require("gulp"); const path = require("path"); const webpack = require("webpack"); -const merge = require("merge-stream"); const rollup = require("rollup"); const rollupBabel = require("rollup-plugin-babel"); const rollupNodeResolve = require("rollup-plugin-node-resolve"); const rollupReplace = require("rollup-plugin-replace"); const { registerStandalonePackageTask } = require("./scripts/gulp-tasks"); -const sources = ["codemods", "packages"]; +const defaultSourcesGlob = "./@(codemods|packages)/*/src/**/*.js"; function swapSrcWithLib(srcPath) { const parts = srcPath.split(path.sep); - parts[1] = "lib"; + parts[2] = "lib"; return parts.join(path.sep); } -function getGlobFromSource(source) { - return `./${source}/*/src/**/*.js`; -} - function getIndexFromPackage(name) { return `${name}/src/index.js`; } @@ -56,32 +51,28 @@ function rename(fn) { }); } -function buildBabel(exclude) { - return merge( - sources.map(source => { - const base = path.join(__dirname, source); - - let stream = gulp.src(getGlobFromSource(source), { base: base }); - - if (exclude) { - const filters = exclude.map(p => `!**/${p}/**`); - filters.unshift("**"); - stream = stream.pipe(filter(filters)); - } - - return stream - .pipe(errorsLogger()) - .pipe(newer({ dest: base, map: swapSrcWithLib })) - .pipe(compilationLogger()) - .pipe(babel()) - .pipe( - // Passing 'file.relative' because newer() above uses a relative - // path and this keeps it consistent. - rename(file => path.resolve(file.base, swapSrcWithLib(file.relative))) - ) - .pipe(gulp.dest(base)); - }) - ); +function buildBabel(exclude, sourcesGlob = defaultSourcesGlob) { + const base = __dirname; + + let stream = gulp.src(sourcesGlob, { base: __dirname }); + + if (exclude) { + const filters = exclude.map(p => `!**/${p}/**`); + filters.unshift("**"); + stream = stream.pipe(filter(filters)); + } + + return stream + .pipe(errorsLogger()) + .pipe(newer({ dest: base, map: swapSrcWithLib })) + .pipe(compilationLogger()) + .pipe(babel()) + .pipe( + // Passing 'file.relative' because newer() above uses a relative + // path and this keeps it consistent. + rename(file => path.resolve(file.base, swapSrcWithLib(file.relative))) + ) + .pipe(gulp.dest(base)); } function buildRollup(packages) { @@ -118,6 +109,9 @@ const bundles = ["packages/babel-parser"]; gulp.task("build-rollup", () => buildRollup(bundles)); gulp.task("build-babel", () => buildBabel(/* exclude */ bundles)); +gulp.task("build-babel-types", () => + buildBabel(/* exclude */ bundles, "packages/babel-types/src/**/*.js") +); gulp.task("build", gulp.parallel("build-rollup", "build-babel")); gulp.task("default", gulp.series("build")); @@ -128,7 +122,7 @@ gulp.task( "watch", gulp.series("build-no-bundle", function watch() { gulpWatch( - sources.map(getGlobFromSource), + defaultSourcesGlob, { debounceDelay: 200 }, gulp.task("build-no-bundle") ); diff --git a/Makefile b/Makefile index ea76e1f02bed..962936d1a6cc 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -MAKEFLAGS = -j1 FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 TEST262_COMMIT = a1acc23cd85c552cde9c06cfed300c58d4b5b04c @@ -9,21 +8,42 @@ SOURCES = packages codemods .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap -build: clean clean-lib +build: build-bundle +ifneq ("$(BABEL_COVERAGE)", "true") + $(MAKE) build-standalone +endif + +build-bundle: clean clean-lib yarn gulp build - node packages/babel-standalone/scripts/generate.js - node packages/babel-types/scripts/generateTypeHelpers.js + $(MAKE) generate-standalone generate-type-helpers # call build again as the generated files might need to be compiled again. yarn gulp build - # generate flow and typescript typings + $(MAKE) build-typings + $(MAKE) build-dist + +build-bundle-ci: bootstrap-only + $(MAKE) build-bundle + +generate-standalone: + node packages/babel-standalone/scripts/generate.js + +generate-type-helpers: + node packages/babel-types/scripts/generateTypeHelpers.js + +build-typings: build-flow-typings build-typescript-typings + +build-flow-typings: node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow + +build-typescript-typings: node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts -ifneq ("$(BABEL_COVERAGE)", "true") - make build-standalone - make build-preset-env-standalone -endif -build-standalone: +build-standalone: build-babel-standalone build-preset-env-standalone + +build-standalone-ci: build-bundle-ci + $(MAKE) build-standalone + +build-babel-standalone: yarn gulp build-babel-standalone build-preset-env-standalone: @@ -35,25 +55,48 @@ prepublish-build-standalone: prepublish-build-preset-env-standalone: BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-preset-env-standalone -build-dist: build +build-dist: build-polyfill-dist build-plugin-transform-runtime-dist + +build-polyfill-dist: cd packages/babel-polyfill; \ scripts/build-dist.sh + +build-plugin-transform-runtime-dist: cd packages/babel-plugin-transform-runtime; \ node scripts/build-dist.js -watch: clean clean-lib - +build-no-bundle: clean clean-lib + BABEL_ENV=development yarn gulp build-no-bundle # Ensure that build artifacts for types are created during local # development too. - BABEL_ENV=development yarn gulp build-no-bundle - node packages/babel-types/scripts/generateTypeHelpers.js - node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow - node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts + $(MAKE) generate-type-helpers + $(MAKE) build-typings + +watch: build-no-bundle BABEL_ENV=development yarn gulp watch +code-quality-ci: flowcheck-ci lint-ci + +flowcheck-ci: bootstrap-flowcheck + $(MAKE) flow + +code-quality: flow lint + flow: yarn flow check --strip-root +bootstrap-flowcheck: bootstrap-only + yarn gulp build-babel-types + $(MAKE) build-typings + +lint-ci: lint-js-ci lint-ts-ci + +lint-js-ci: bootstrap-only + $(MAKE) lint-js + +lint-ts-ci: bootstrap-flowcheck + $(MAKE) lint-ts + lint: lint-js lint-ts lint-js: @@ -62,7 +105,9 @@ lint-js: lint-ts: scripts/tests/typescript/lint.sh -fix: fix-json +fix: fix-json fix-js + +fix-js: yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix fix-json: @@ -82,18 +127,20 @@ test-clean: # Does not work on Windows; use "yarn jest" instead test-only: BABEL_ENV=test ./scripts/test.sh - make test-clean + $(MAKE) test-clean test: lint test-only -test-ci: bootstrap +test-ci: jest-ci + +jest-ci: build-standalone-ci BABEL_ENV=test yarn jest --maxWorkers=4 --ci - make test-clean + $(MAKE) test-clean # Does not work on Windows test-ci-coverage: SHELL:=/bin/bash test-ci-coverage: - BABEL_COVERAGE=true BABEL_ENV=test make bootstrap + BABEL_COVERAGE=true BABEL_ENV=test $(MAKE) bootstrap BABEL_ENV=test TEST_TYPE=cov ./scripts/test-cov.sh bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json @@ -106,7 +153,8 @@ bootstrap-flow: test-flow: node scripts/tests/flow/run_babel_parser_flow_tests.js -test-flow-ci: bootstrap test-flow +test-flow-ci: build-bundle-ci bootstrap-flow + $(MAKE) test-flow test-flow-update-whitelist: node scripts/tests/flow/run_babel_parser_flow_tests.js --update-whitelist @@ -120,7 +168,8 @@ bootstrap-test262: test-test262: node scripts/tests/test262/run_babel_parser_test262.js -test-test262-ci: bootstrap test-test262 +test-test262-ci: build-bundle-ci bootstrap-test262 + $(MAKE) test-test262 test-test262-update-whitelist: node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist @@ -129,18 +178,14 @@ test-test262-update-whitelist: clone-license: ./scripts/clone-license.sh -prepublish-build: - make clean-lib - rm -rf packages/babel-runtime/helpers - rm -rf packages/babel-runtime-corejs2/helpers - rm -rf packages/babel-runtime-corejs2/core-js - NODE_ENV=production BABEL_ENV=production make build-dist - make clone-license +prepublish-build: clean-lib clean-runtime-helpers + NODE_ENV=production BABEL_ENV=production $(MAKE) build-dist + $(MAKE) clone-license prepublish: - make bootstrap-only - make prepublish-build - make test + $(MAKE) bootstrap-only + $(MAKE) prepublish-build + $(MAKE) test new-version: git pull --rebase @@ -149,7 +194,7 @@ new-version: # NOTE: Run make new-version first publish: prepublish yarn lerna publish from-git --require-scripts - make clean + $(MAKE) clean publish-ci: prepublish ifneq ("$(NPM_TOKEN)", "") @@ -160,21 +205,28 @@ else endif yarn lerna publish from-git --require-scripts --yes rm -f .npmrc - make clean + $(MAKE) clean -bootstrap-only: clean-all +bootstrap-only: lerna-bootstrap + +yarn-install: clean-all yarn --ignore-engines + +lerna-bootstrap: yarn-install yarn lerna bootstrap -- --ignore-engines bootstrap: bootstrap-only - make build - cd packages/babel-plugin-transform-runtime; \ - node scripts/build-dist.js + $(MAKE) build clean-lib: $(foreach source, $(SOURCES), \ $(call clean-source-lib, $(source))) +clean-runtime-helpers: + rm -rf packages/babel-runtime/helpers + rm -rf packages/babel-runtime-corejs2/helpers + rm -rf packages/babel-runtime-corejs2/core-js + clean-all: rm -rf node_modules rm -rf package-lock.json @@ -183,7 +235,7 @@ clean-all: $(foreach source, $(SOURCES), \ $(call clean-source-all, $(source))) - make clean + $(MAKE) clean define clean-source-lib rm -rf $(1)/*/lib diff --git a/package.json b/package.json index 89b4611eda71..7fe25f132a30 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", "lodash": "^4.17.13", - "merge-stream": "^1.0.1", "output-file-sync": "^2.0.0", "prettier": "^1.17.1", "pump": "^3.0.0", From e6264a09921c60b8f18870d0a75678e4fa04f0f8 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 2 Oct 2019 18:32:34 -0500 Subject: [PATCH 107/965] Bump jest@24.9.0 (#10520) --- package.json | 4 +- yarn.lock | 790 ++++++++++++++++++++++++++++----------------------- 2 files changed, 433 insertions(+), 361 deletions(-) diff --git a/package.json b/package.json index 7fe25f132a30..1fbd8da7d90c 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@babel/register": "^7.6.0", "@babel/runtime": "^7.6.0", "babel-eslint": "^11.0.0-beta.0", - "babel-jest": "^24.8.0", + "babel-jest": "^24.9.0", "babel-loader": "^8.0.6", "babel-plugin-transform-charcodes": "^0.2.0", "browserify": "^16.2.3", @@ -51,7 +51,7 @@ "gulp-uglify": "^3.0.2", "gulp-watch": "^5.0.1", "husky": "^3.0.0", - "jest": "^24.8.0", + "jest": "^24.9.0", "lerna": "^3.16.0", "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", diff --git a/yarn.lock b/yarn.lock index 44a15c55b9ef..b7b9e7381872 100644 --- a/yarn.lock +++ b/yarn.lock @@ -873,76 +873,77 @@ unique-filename "^1.1.1" which "^1.3.1" -"@jest/console@^24.7.1": - version "24.7.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" - integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== +"@jest/console@^24.7.1", "@jest/console@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.9.0.tgz#79b1bc06fb74a8cfb01cbdedf945584b1b9707f0" + integrity sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ== dependencies: - "@jest/source-map" "^24.3.0" + "@jest/source-map" "^24.9.0" chalk "^2.0.1" slash "^2.0.0" -"@jest/core@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" - integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== +"@jest/core@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.9.0.tgz#2ceccd0b93181f9c4850e74f2a9ad43d351369c4" + integrity sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A== dependencies: "@jest/console" "^24.7.1" - "@jest/reporters" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/reporters" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" ansi-escapes "^3.0.0" chalk "^2.0.1" exit "^0.1.2" graceful-fs "^4.1.15" - jest-changed-files "^24.8.0" - jest-config "^24.8.0" - jest-haste-map "^24.8.0" - jest-message-util "^24.8.0" + jest-changed-files "^24.9.0" + jest-config "^24.9.0" + jest-haste-map "^24.9.0" + jest-message-util "^24.9.0" jest-regex-util "^24.3.0" - jest-resolve-dependencies "^24.8.0" - jest-runner "^24.8.0" - jest-runtime "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" - jest-watcher "^24.8.0" + jest-resolve "^24.9.0" + jest-resolve-dependencies "^24.9.0" + jest-runner "^24.9.0" + jest-runtime "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" + jest-watcher "^24.9.0" micromatch "^3.1.10" p-each-series "^1.0.0" - pirates "^4.0.1" realpath-native "^1.1.0" rimraf "^2.5.4" + slash "^2.0.0" strip-ansi "^5.0.0" -"@jest/environment@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" - integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== - dependencies: - "@jest/fake-timers" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - -"@jest/fake-timers@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" - integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== - dependencies: - "@jest/types" "^24.8.0" - jest-message-util "^24.8.0" - jest-mock "^24.8.0" - -"@jest/reporters@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" - integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== - dependencies: - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" +"@jest/environment@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.9.0.tgz#21e3afa2d65c0586cbd6cbefe208bafade44ab18" + integrity sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ== + dependencies: + "@jest/fake-timers" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + +"@jest/fake-timers@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.9.0.tgz#ba3e6bf0eecd09a636049896434d306636540c93" + integrity sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A== + dependencies: + "@jest/types" "^24.9.0" + jest-message-util "^24.9.0" + jest-mock "^24.9.0" + +"@jest/reporters@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.9.0.tgz#86660eff8e2b9661d042a8e98a028b8d631a5b43" + integrity sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw== + dependencies: + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.2" @@ -950,74 +951,75 @@ istanbul-lib-instrument "^3.0.1" istanbul-lib-report "^2.0.4" istanbul-lib-source-maps "^3.0.1" - istanbul-reports "^2.1.1" - jest-haste-map "^24.8.0" - jest-resolve "^24.8.0" - jest-runtime "^24.8.0" - jest-util "^24.8.0" + istanbul-reports "^2.2.6" + jest-haste-map "^24.9.0" + jest-resolve "^24.9.0" + jest-runtime "^24.9.0" + jest-util "^24.9.0" jest-worker "^24.6.0" - node-notifier "^5.2.1" + node-notifier "^5.4.2" slash "^2.0.0" source-map "^0.6.0" string-length "^2.0.0" -"@jest/source-map@^24.3.0": - version "24.3.0" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" - integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== +"@jest/source-map@^24.3.0", "@jest/source-map@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.9.0.tgz#0e263a94430be4b41da683ccc1e6bffe2a191714" + integrity sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg== dependencies: callsites "^3.0.0" graceful-fs "^4.1.15" source-map "^0.6.0" -"@jest/test-result@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" - integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== +"@jest/test-result@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.9.0.tgz#11796e8aa9dbf88ea025757b3152595ad06ba0ca" + integrity sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA== dependencies: - "@jest/console" "^24.7.1" - "@jest/types" "^24.8.0" + "@jest/console" "^24.9.0" + "@jest/types" "^24.9.0" "@types/istanbul-lib-coverage" "^2.0.0" -"@jest/test-sequencer@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" - integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== +"@jest/test-sequencer@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz#f8f334f35b625a4f2f355f2fe7e6036dad2e6b31" + integrity sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A== dependencies: - "@jest/test-result" "^24.8.0" - jest-haste-map "^24.8.0" - jest-runner "^24.8.0" - jest-runtime "^24.8.0" + "@jest/test-result" "^24.9.0" + jest-haste-map "^24.9.0" + jest-runner "^24.9.0" + jest-runtime "^24.9.0" -"@jest/transform@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" - integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== +"@jest/transform@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.9.0.tgz#4ae2768b296553fadab09e9ec119543c90b16c56" + integrity sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ== dependencies: "@babel/core" "^7.1.0" - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" babel-plugin-istanbul "^5.1.0" chalk "^2.0.1" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.0.0" graceful-fs "^4.1.15" - jest-haste-map "^24.8.0" - jest-regex-util "^24.3.0" - jest-util "^24.8.0" + jest-haste-map "^24.9.0" + jest-regex-util "^24.9.0" + jest-util "^24.9.0" micromatch "^3.1.10" + pirates "^4.0.1" realpath-native "^1.1.0" slash "^2.0.0" source-map "^0.6.1" write-file-atomic "2.4.1" -"@jest/types@^24.8.0": - version "24.8.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" - integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== +"@jest/types@^24.9.0": + version "24.9.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.9.0.tgz#63cb26cb7500d069e5a389441a7c6ab5e909fc59" + integrity sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^1.1.1" - "@types/yargs" "^12.0.9" + "@types/yargs" "^13.0.0" "@lerna/add@3.16.2": version "3.16.2" @@ -1941,10 +1943,17 @@ "@types/uglify-js" "*" source-map "^0.6.0" -"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": - version "12.0.12" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" - integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== +"@types/yargs-parser@*": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" + integrity sha512-gCubfBUZ6KxzoibJ+SCUc/57Ms1jz5NjHe4+dI2krNmU5zCPAphyLJYyTOg06ueIyfj+SaCUqmzun7ImlxDcKg== + +"@types/yargs@^13.0.0": + version "13.0.3" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-13.0.3.tgz#76482af3981d4412d65371a318f992d33464a380" + integrity sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ== + dependencies: + "@types/yargs-parser" "*" "@zkochan/cmd-shim@^3.1.0": version "3.1.0" @@ -2486,16 +2495,16 @@ babel-eslint@^11.0.0-beta.0: eslint-visitor-keys "^1.0.0" semver "^5.6.0" -babel-jest@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" - integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== +babel-jest@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" + integrity sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw== dependencies: - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" "@types/babel__core" "^7.1.0" babel-plugin-istanbul "^5.1.0" - babel-preset-jest "^24.6.0" + babel-preset-jest "^24.9.0" chalk "^2.4.2" slash "^2.0.0" @@ -2525,10 +2534,10 @@ babel-plugin-istanbul@^5.1.0: istanbul-lib-instrument "^3.3.0" test-exclude "^5.2.3" -babel-plugin-jest-hoist@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" - integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== +babel-plugin-jest-hoist@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz#4f837091eb407e01447c8843cbec546d0002d756" + integrity sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw== dependencies: "@types/babel__traverse" "^7.0.6" @@ -2540,13 +2549,13 @@ babel-plugin-transform-charcodes@^0.2.0: "@babel/parser" "^7.0.0" "@babel/traverse" "^7.0.0" -babel-preset-jest@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" - integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== +babel-preset-jest@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz#192b521e2217fb1d1f67cf73f70c336650ad3cdc" + integrity sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg== dependencies: "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - babel-plugin-jest-hoist "^24.6.0" + babel-plugin-jest-hoist "^24.9.0" bach@^1.0.0: version "1.2.0" @@ -3030,7 +3039,7 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -camelcase@^5.0.0: +camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -3203,6 +3212,15 @@ cliui@^4.0.0: strip-ansi "^4.0.0" wrap-ansi "^2.0.0" +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" @@ -3918,10 +3936,10 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -diff-sequences@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" - integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== +diff-sequences@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.9.0.tgz#5715d6244e2aa65f48bba0bc972db0b0b11e95b5" + integrity sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew== diffie-hellman@^5.0.0: version "5.0.3" @@ -4087,6 +4105,11 @@ elliptic@^6.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.0" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + emoji-regex@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" @@ -4567,17 +4590,17 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" -expect@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" - integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== +expect@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.9.0.tgz#b75165b4817074fa4a157794f46fe9f1ba15b6ca" + integrity sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" ansi-styles "^3.2.0" - jest-get-type "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-regex-util "^24.3.0" + jest-get-type "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-regex-util "^24.9.0" extend-shallow@^1.1.2: version "1.1.4" @@ -5037,6 +5060,11 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + get-own-enumerable-property-symbols@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" @@ -6278,316 +6306,318 @@ istanbul-lib-source-maps@^3.0.1: rimraf "^2.6.3" source-map "^0.6.1" -istanbul-reports@^2.1.1: +istanbul-reports@^2.2.6: version "2.2.6" resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== dependencies: handlebars "^4.1.2" -jest-changed-files@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" - integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== +jest-changed-files@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" + integrity sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" execa "^1.0.0" throat "^4.0.0" -jest-cli@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" - integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== +jest-cli@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.9.0.tgz#ad2de62d07472d419c6abc301fc432b98b10d2af" + integrity sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg== dependencies: - "@jest/core" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/core" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" chalk "^2.0.1" exit "^0.1.2" import-local "^2.0.0" is-ci "^2.0.0" - jest-config "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" + jest-config "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" prompts "^2.0.1" realpath-native "^1.1.0" - yargs "^12.0.2" + yargs "^13.3.0" -jest-config@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" - integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== +jest-config@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.9.0.tgz#fb1bbc60c73a46af03590719efa4825e6e4dd1b5" + integrity sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ== dependencies: "@babel/core" "^7.1.0" - "@jest/test-sequencer" "^24.8.0" - "@jest/types" "^24.8.0" - babel-jest "^24.8.0" + "@jest/test-sequencer" "^24.9.0" + "@jest/types" "^24.9.0" + babel-jest "^24.9.0" chalk "^2.0.1" glob "^7.1.1" - jest-environment-jsdom "^24.8.0" - jest-environment-node "^24.8.0" - jest-get-type "^24.8.0" - jest-jasmine2 "^24.8.0" + jest-environment-jsdom "^24.9.0" + jest-environment-node "^24.9.0" + jest-get-type "^24.9.0" + jest-jasmine2 "^24.9.0" jest-regex-util "^24.3.0" - jest-resolve "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" + jest-resolve "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" micromatch "^3.1.10" - pretty-format "^24.8.0" + pretty-format "^24.9.0" realpath-native "^1.1.0" -jest-diff@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" - integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== +jest-diff@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da" + integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ== dependencies: chalk "^2.0.1" - diff-sequences "^24.3.0" - jest-get-type "^24.8.0" - pretty-format "^24.8.0" + diff-sequences "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" jest-docblock@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" - integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.9.0.tgz#7970201802ba560e1c4092cc25cbedf5af5a8ce2" + integrity sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA== dependencies: detect-newline "^2.1.0" -jest-each@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" - integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== +jest-each@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.9.0.tgz#eb2da602e2a610898dbc5f1f6df3ba86b55f8b05" + integrity sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" chalk "^2.0.1" - jest-get-type "^24.8.0" - jest-util "^24.8.0" - pretty-format "^24.8.0" - -jest-environment-jsdom@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" - integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== - dependencies: - "@jest/environment" "^24.8.0" - "@jest/fake-timers" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - jest-util "^24.8.0" + jest-get-type "^24.9.0" + jest-util "^24.9.0" + pretty-format "^24.9.0" + +jest-environment-jsdom@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz#4b0806c7fc94f95edb369a69cc2778eec2b7375b" + integrity sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA== + dependencies: + "@jest/environment" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + jest-util "^24.9.0" jsdom "^11.5.1" -jest-environment-node@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" - integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== +jest-environment-node@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.9.0.tgz#333d2d2796f9687f2aeebf0742b519f33c1cbfd3" + integrity sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA== dependencies: - "@jest/environment" "^24.8.0" - "@jest/fake-timers" "^24.8.0" - "@jest/types" "^24.8.0" - jest-mock "^24.8.0" - jest-util "^24.8.0" + "@jest/environment" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/types" "^24.9.0" + jest-mock "^24.9.0" + jest-util "^24.9.0" -jest-get-type@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" - integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== +jest-get-type@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.9.0.tgz#1684a0c8a50f2e4901b6644ae861f579eed2ef0e" + integrity sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q== -jest-haste-map@^24.8.0: - version "24.8.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.1.tgz#f39cc1d2b1d907e014165b4bd5a957afcb992982" - integrity sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g== +jest-haste-map@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.9.0.tgz#b38a5d64274934e21fa417ae9a9fbeb77ceaac7d" + integrity sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" anymatch "^2.0.0" fb-watchman "^2.0.0" graceful-fs "^4.1.15" invariant "^2.2.4" - jest-serializer "^24.4.0" - jest-util "^24.8.0" - jest-worker "^24.6.0" + jest-serializer "^24.9.0" + jest-util "^24.9.0" + jest-worker "^24.9.0" micromatch "^3.1.10" sane "^4.0.3" walker "^1.0.7" optionalDependencies: fsevents "^1.2.7" -jest-jasmine2@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" - integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== +jest-jasmine2@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz#1f7b1bd3242c1774e62acabb3646d96afc3be6a0" + integrity sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw== dependencies: "@babel/traverse" "^7.1.0" - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" chalk "^2.0.1" co "^4.6.0" - expect "^24.8.0" + expect "^24.9.0" is-generator-fn "^2.0.0" - jest-each "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-runtime "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - pretty-format "^24.8.0" + jest-each "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-runtime "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + pretty-format "^24.9.0" throat "^4.0.0" -jest-leak-detector@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" - integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== +jest-leak-detector@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz#b665dea7c77100c5c4f7dfcb153b65cf07dcf96a" + integrity sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA== dependencies: - pretty-format "^24.8.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" -jest-matcher-utils@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" - integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== +jest-matcher-utils@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz#f5b3661d5e628dffe6dd65251dfdae0e87c3a073" + integrity sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA== dependencies: chalk "^2.0.1" - jest-diff "^24.8.0" - jest-get-type "^24.8.0" - pretty-format "^24.8.0" + jest-diff "^24.9.0" + jest-get-type "^24.9.0" + pretty-format "^24.9.0" -jest-message-util@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" - integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== +jest-message-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.9.0.tgz#527f54a1e380f5e202a8d1149b0ec872f43119e3" + integrity sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw== dependencies: "@babel/code-frame" "^7.0.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" "@types/stack-utils" "^1.0.1" chalk "^2.0.1" micromatch "^3.1.10" slash "^2.0.0" stack-utils "^1.0.1" -jest-mock@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" - integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== +jest-mock@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.9.0.tgz#c22835541ee379b908673ad51087a2185c13f1c6" + integrity sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" jest-pnp-resolver@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== -jest-regex-util@^24.3.0: - version "24.3.0" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" - integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== +jest-regex-util@^24.3.0, jest-regex-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.9.0.tgz#c13fb3380bde22bf6575432c493ea8fe37965636" + integrity sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA== -jest-resolve-dependencies@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" - integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== +jest-resolve-dependencies@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz#ad055198959c4cfba8a4f066c673a3f0786507ab" + integrity sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" jest-regex-util "^24.3.0" - jest-snapshot "^24.8.0" + jest-snapshot "^24.9.0" -jest-resolve@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" - integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== +jest-resolve@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.9.0.tgz#dff04c7687af34c4dd7e524892d9cf77e5d17321" + integrity sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" browser-resolve "^1.11.3" chalk "^2.0.1" jest-pnp-resolver "^1.2.1" realpath-native "^1.1.0" -jest-runner@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" - integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== +jest-runner@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.9.0.tgz#574fafdbd54455c2b34b4bdf4365a23857fcdf42" + integrity sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg== dependencies: "@jest/console" "^24.7.1" - "@jest/environment" "^24.8.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/environment" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" chalk "^2.4.2" exit "^0.1.2" graceful-fs "^4.1.15" - jest-config "^24.8.0" + jest-config "^24.9.0" jest-docblock "^24.3.0" - jest-haste-map "^24.8.0" - jest-jasmine2 "^24.8.0" - jest-leak-detector "^24.8.0" - jest-message-util "^24.8.0" - jest-resolve "^24.8.0" - jest-runtime "^24.8.0" - jest-util "^24.8.0" + jest-haste-map "^24.9.0" + jest-jasmine2 "^24.9.0" + jest-leak-detector "^24.9.0" + jest-message-util "^24.9.0" + jest-resolve "^24.9.0" + jest-runtime "^24.9.0" + jest-util "^24.9.0" jest-worker "^24.6.0" source-map-support "^0.5.6" throat "^4.0.0" -jest-runtime@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" - integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== +jest-runtime@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.9.0.tgz#9f14583af6a4f7314a6a9d9f0226e1a781c8e4ac" + integrity sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw== dependencies: "@jest/console" "^24.7.1" - "@jest/environment" "^24.8.0" + "@jest/environment" "^24.9.0" "@jest/source-map" "^24.3.0" - "@jest/transform" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/yargs" "^12.0.2" + "@jest/transform" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/yargs" "^13.0.0" chalk "^2.0.1" exit "^0.1.2" glob "^7.1.3" graceful-fs "^4.1.15" - jest-config "^24.8.0" - jest-haste-map "^24.8.0" - jest-message-util "^24.8.0" - jest-mock "^24.8.0" + jest-config "^24.9.0" + jest-haste-map "^24.9.0" + jest-message-util "^24.9.0" + jest-mock "^24.9.0" jest-regex-util "^24.3.0" - jest-resolve "^24.8.0" - jest-snapshot "^24.8.0" - jest-util "^24.8.0" - jest-validate "^24.8.0" + jest-resolve "^24.9.0" + jest-snapshot "^24.9.0" + jest-util "^24.9.0" + jest-validate "^24.9.0" realpath-native "^1.1.0" slash "^2.0.0" strip-bom "^3.0.0" - yargs "^12.0.2" + yargs "^13.3.0" -jest-serializer@^24.4.0: - version "24.4.0" - resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" - integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== +jest-serializer@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.9.0.tgz#e6d7d7ef96d31e8b9079a714754c5d5c58288e73" + integrity sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ== -jest-snapshot@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" - integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== +jest-snapshot@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.9.0.tgz#ec8e9ca4f2ec0c5c87ae8f925cf97497b0e951ba" + integrity sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew== dependencies: "@babel/types" "^7.0.0" - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" chalk "^2.0.1" - expect "^24.8.0" - jest-diff "^24.8.0" - jest-matcher-utils "^24.8.0" - jest-message-util "^24.8.0" - jest-resolve "^24.8.0" + expect "^24.9.0" + jest-diff "^24.9.0" + jest-get-type "^24.9.0" + jest-matcher-utils "^24.9.0" + jest-message-util "^24.9.0" + jest-resolve "^24.9.0" mkdirp "^0.5.1" natural-compare "^1.4.0" - pretty-format "^24.8.0" - semver "^5.5.0" + pretty-format "^24.9.0" + semver "^6.2.0" -jest-util@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" - integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== +jest-util@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.9.0.tgz#7396814e48536d2e85a37de3e4c431d7cb140162" + integrity sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg== dependencies: - "@jest/console" "^24.7.1" - "@jest/fake-timers" "^24.8.0" - "@jest/source-map" "^24.3.0" - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" + "@jest/console" "^24.9.0" + "@jest/fake-timers" "^24.9.0" + "@jest/source-map" "^24.9.0" + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" callsites "^3.0.0" chalk "^2.0.1" graceful-fs "^4.1.15" @@ -6596,46 +6626,46 @@ jest-util@^24.8.0: slash "^2.0.0" source-map "^0.6.0" -jest-validate@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" - integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== +jest-validate@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.9.0.tgz#0775c55360d173cd854e40180756d4ff52def8ab" + integrity sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ== dependencies: - "@jest/types" "^24.8.0" - camelcase "^5.0.0" + "@jest/types" "^24.9.0" + camelcase "^5.3.1" chalk "^2.0.1" - jest-get-type "^24.8.0" - leven "^2.1.0" - pretty-format "^24.8.0" - -jest-watcher@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" - integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== - dependencies: - "@jest/test-result" "^24.8.0" - "@jest/types" "^24.8.0" - "@types/yargs" "^12.0.9" + jest-get-type "^24.9.0" + leven "^3.1.0" + pretty-format "^24.9.0" + +jest-watcher@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.9.0.tgz#4b56e5d1ceff005f5b88e528dc9afc8dd4ed2b3b" + integrity sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw== + dependencies: + "@jest/test-result" "^24.9.0" + "@jest/types" "^24.9.0" + "@types/yargs" "^13.0.0" ansi-escapes "^3.0.0" chalk "^2.0.1" - jest-util "^24.8.0" + jest-util "^24.9.0" string-length "^2.0.0" -jest-worker@^24.6.0: - version "24.6.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" - integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== +jest-worker@^24.6.0, jest-worker@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.9.0.tgz#5dbfdb5b2d322e98567898238a9697bcce67b3e5" + integrity sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw== dependencies: - merge-stream "^1.0.1" + merge-stream "^2.0.0" supports-color "^6.1.0" -jest@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" - integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg== +jest@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.9.0.tgz#987d290c05a08b52c56188c1002e368edb007171" + integrity sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw== dependencies: import-local "^2.0.0" - jest-cli "^24.8.0" + jest-cli "^24.9.0" js-levenshtein@^1.1.3: version "1.1.6" @@ -6926,10 +6956,10 @@ lerna@^3.16.0: import-local "^2.0.0" npmlog "^4.1.2" -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= +leven@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" + integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== levn@^0.3.0, levn@~0.3.0: version "0.3.0" @@ -7825,10 +7855,10 @@ node-modules-regexp@^1.0.0: resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= -node-notifier@^5.2.1: - version "5.4.0" - resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" - integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== +node-notifier@^5.4.2: + version "5.4.3" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.3.tgz#cb72daf94c93904098e28b9c590fd866e464bd50" + integrity sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q== dependencies: growly "^1.3.0" is-wsl "^1.1.0" @@ -8695,12 +8725,12 @@ prettier@^1.17.1: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== -pretty-format@^24.8.0: - version "24.8.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" - integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== +pretty-format@^24.9.0: + version "24.9.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" + integrity sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA== dependencies: - "@jest/types" "^24.8.0" + "@jest/types" "^24.9.0" ansi-regex "^4.0.0" ansi-styles "^3.2.0" react-is "^16.8.4" @@ -9958,6 +9988,15 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + string-width@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" @@ -11050,6 +11089,15 @@ wrap-ansi@^3.0.1: string-width "^2.1.1" strip-ansi "^4.0.0" +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -11157,6 +11205,14 @@ yargs-parser@^11.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^13.1.1: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" @@ -11178,7 +11234,7 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs@^12.0.1, yargs@^12.0.2: +yargs@^12.0.1: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== @@ -11196,6 +11252,22 @@ yargs@^12.0.1, yargs@^12.0.2: y18n "^3.2.1 || ^4.0.0" yargs-parser "^11.1.1" +yargs@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" + integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.1" + yargs@^6.5.0, yargs@^6.6.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" From fbf3cb0ac40a77ea0e63d7d2c6f0bd9481dbb43d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 3 Oct 2019 16:46:07 -0400 Subject: [PATCH 108/965] Misc: also lock old PRs [skip ci] (#10524) --- .github/lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/lock.yml b/.github/lock.yml index 7737237177e2..9e005246746c 100644 --- a/.github/lock.yml +++ b/.github/lock.yml @@ -4,7 +4,7 @@ daysUntilLock: 91 # Comment to post before locking. Set to `false` to disable lockComment: false -only: issues +# The label to be applied when an issue is locked lockLabel: 'outdated' # Issues or pull requests with these labels will not be locked From 3498195ae25475a376edf7149bff0e8b69eee002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 8 Oct 2019 18:50:03 +0200 Subject: [PATCH 109/965] Do not hoist jsx referencing a mutable binding (#10529) --- .../deopt-mutable-complex/input.mjs | 10 ++++++++++ .../deopt-mutable-complex/output.mjs | 10 ++++++++++ .../constant-elements/deopt-mutable/input.mjs | 6 ++++++ .../constant-elements/deopt-mutable/output.mjs | 5 +++++ packages/babel-traverse/src/path/lib/hoister.js | 14 ++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/input.mjs create mode 100644 packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/output.mjs create mode 100644 packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/input.mjs create mode 100644 packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/output.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/input.mjs b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/input.mjs new file mode 100644 index 000000000000..d55eaf7cd0ec --- /dev/null +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/input.mjs @@ -0,0 +1,10 @@ +let foo = 'hello'; + +const mutate = () => { + foo = 'goodbye'; +} + +export const Component = () => { + if (Math.random() > 0.5) mutate(); + return {foo}; +}; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/output.mjs b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/output.mjs new file mode 100644 index 000000000000..83c8f677226e --- /dev/null +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable-complex/output.mjs @@ -0,0 +1,10 @@ +let foo = 'hello'; + +const mutate = () => { + foo = 'goodbye'; +}; + +export const Component = () => { + if (Math.random() > 0.5) mutate(); + return {foo}; +}; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/input.mjs b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/input.mjs new file mode 100644 index 000000000000..1225d11e87eb --- /dev/null +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/input.mjs @@ -0,0 +1,6 @@ +let foo = 'hello'; + +export const Component = () => { + foo = 'goodbye'; + return {foo}; +}; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/output.mjs b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/output.mjs new file mode 100644 index 000000000000..dd266a198d47 --- /dev/null +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deopt-mutable/output.mjs @@ -0,0 +1,5 @@ +let foo = 'hello'; +export const Component = () => { + foo = 'goodbye'; + return {foo}; +}; diff --git a/packages/babel-traverse/src/path/lib/hoister.js b/packages/babel-traverse/src/path/lib/hoister.js index 2fd8339eaa7d..7e7f85034628 100644 --- a/packages/babel-traverse/src/path/lib/hoister.js +++ b/packages/babel-traverse/src/path/lib/hoister.js @@ -32,6 +32,15 @@ const referenceVisitor = { const binding = path.scope.getBinding(path.node.name); if (!binding) return; + // we can handle reassignments only if they happen in the same scope as the declaration + for (const violation of binding.constantViolations) { + if (violation.scope !== binding.path.scope) { + state.mutableBinding = true; + path.stop(); + return; + } + } + // this binding isn't accessible from the parent scope so we can safely ignore it // eg. it's in a closure etc if (binding !== state.scope.getBinding(path.node.name)) return; @@ -46,6 +55,9 @@ export default class PathHoister { this.breakOnScopePaths = []; // Storage for bindings that may affect what path we can hoist to. this.bindings = {}; + // "true" if the current path contains a reference to a binding whose + // value can change and thus can't be safely hoisted. + this.mutableBinding = false; // Storage for eligible scopes. this.scopes = []; // Our original scope and path. @@ -195,6 +207,8 @@ export default class PathHoister { run() { this.path.traverse(referenceVisitor, this); + if (this.mutableBinding) return; + this.getCompatibleScopes(); const attachTo = this.getAttachmentPath(); From bc0966a46fc915b03e88770f318395f8cbbf6273 Mon Sep 17 00:00:00 2001 From: Jessica Franco Date: Wed, 9 Oct 2019 02:07:57 +0900 Subject: [PATCH 110/965] Add declarations for more of @babel/types exports (#10504) This adds lots of missing declarations to the types of @babel/types, including many utility functions useful to plugin authors. With the typescript types, I tried to make them as useful as possible for control flow analysis / inference, but Flow doesn't seem to support overloads and I'm not as familiar with it anyway so it has simpler types. --- .../babel-types/scripts/generators/flow.js | 74 ++++++- .../scripts/generators/typescript.js | 183 +++++++++++++++--- 2 files changed, 232 insertions(+), 25 deletions(-) diff --git a/packages/babel-types/scripts/generators/flow.js b/packages/babel-types/scripts/generators/flow.js index f3d8a85233fd..8b40554e2123 100644 --- a/packages/babel-types/scripts/generators/flow.js +++ b/packages/babel-types/scripts/generators/flow.js @@ -121,12 +121,69 @@ for (let i = 0; i < t.TYPES.length; i++) { } lines.push( - `declare function validate(n: BabelNode, key: string, value: mixed): void;`, + // builders/ + // eslint-disable-next-line max-len + `declare function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): ${NODE_PREFIX}TypeAnnotation`, + // eslint-disable-next-line max-len + `declare function createUnionTypeAnnotation(types: Array<${NODE_PREFIX}FlowType>): ${NODE_PREFIX}UnionTypeAnnotation`, + // this smells like "internal API" + // eslint-disable-next-line max-len + `declare function buildChildren(node: { children: Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment | ${NODE_PREFIX}JSXEmptyExpression> }): Array<${NODE_PREFIX}JSXText | ${NODE_PREFIX}JSXExpressionContainer | ${NODE_PREFIX}JSXSpreadChild | ${NODE_PREFIX}JSXElement | ${NODE_PREFIX}JSXFragment>`, + + // clone/ `declare function clone(n: T): T;`, `declare function cloneDeep(n: T): T;`, `declare function cloneNode(n: T, deep?: boolean): T;`, + `declare function cloneWithoutLoc(n: T): T;`, + + // comments/ + `declare type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, + // eslint-disable-next-line max-len + `declare function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, + // eslint-disable-next-line max-len + `declare function addComments(node: T, type: CommentTypeShorthand, comments: Array): T`, + `declare function inheritInnerComments(node: Node, parent: Node): void`, + `declare function inheritLeadingComments(node: Node, parent: Node): void`, + `declare function inheritsComments(node: T, parent: Node): void`, + `declare function inheritTrailingComments(node: Node, parent: Node): void`, + `declare function removeComments(node: T): T`, + + // converters/ + `declare function ensureBlock(node: ${NODE_PREFIX}, key: string): ${NODE_PREFIX}BlockStatement`, + `declare function toBindingIdentifierName(name?: ?string): string`, + // eslint-disable-next-line max-len + `declare function toBlock(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Expression, parent?: ${NODE_PREFIX}Function | null): ${NODE_PREFIX}BlockStatement`, + // eslint-disable-next-line max-len + `declare function toComputedKey(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}Expression | ${NODE_PREFIX}Identifier): ${NODE_PREFIX}Expression`, + // eslint-disable-next-line max-len + `declare function toExpression(node: ${NODE_PREFIX}ExpressionStatement | ${NODE_PREFIX}Expression | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function): ${NODE_PREFIX}Expression`, + `declare function toIdentifier(name?: ?string): string`, + // eslint-disable-next-line max-len + `declare function toKeyAlias(node: ${NODE_PREFIX}Method | ${NODE_PREFIX}Property, key?: ${NODE_PREFIX}): string`, + // toSequenceExpression relies on types that aren't declared in flow + // eslint-disable-next-line max-len + `declare function toStatement(node: ${NODE_PREFIX}Statement | ${NODE_PREFIX}Class | ${NODE_PREFIX}Function | ${NODE_PREFIX}AssignmentExpression, ignore?: boolean): ${NODE_PREFIX}Statement | void`, + `declare function valueToNode(value: any): ${NODE_PREFIX}Expression`, + + // modifications/ + // eslint-disable-next-line max-len + `declare function removeTypeDuplicates(types: Array<${NODE_PREFIX}FlowType>): Array<${NODE_PREFIX}FlowType>`, + // eslint-disable-next-line max-len + `declare function appendToMemberExpression(member: ${NODE_PREFIX}MemberExpression, append: ${NODE_PREFIX}, computed?: boolean): ${NODE_PREFIX}MemberExpression`, + // eslint-disable-next-line max-len + `declare function inherits(child: T, parent: ${NODE_PREFIX} | null | void): T`, + // eslint-disable-next-line max-len + `declare function prependToMemberExpression(member: ${NODE_PREFIX}MemberExpression, prepend: ${NODE_PREFIX}Expression): ${NODE_PREFIX}MemberExpression`, `declare function removeProperties(n: T, opts: ?{}): void;`, `declare function removePropertiesDeep(n: T, opts: ?{}): T;`, + + // retrievers/ + // eslint-disable-next-line max-len + `declare function getBindingIdentifiers(node: ${NODE_PREFIX}, duplicates: boolean, outerOnly?: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, + // eslint-disable-next-line max-len + `declare function getOuterBindingIdentifiers(node: Node, duplicates: boolean): { [key: string]: ${NODE_PREFIX}Identifier | Array<${NODE_PREFIX}Identifier> }`, + + // traverse/ `declare type TraversalAncestors = Array<{ node: BabelNode, key: string, @@ -139,6 +196,16 @@ lines.push( };`.replace(/(^|\n) {2}/g, "$1"), // eslint-disable-next-line `declare function traverse(n: BabelNode, TraversalHandler | TraversalHandlers, state?: T): void;`, + `declare function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, + + // utils/ + // cleanJSXElementLiteralChild is not exported + // inherit is not exported + `declare function shallowEqual(actual: Object, expected: Object): boolean`, + + // validators/ + // eslint-disable-next-line max-len + `declare function buildMatchMemberExpression(match: string, allowPartial?: boolean): (?BabelNode) => boolean`, `declare function is(type: string, n: BabelNode, opts: Object): boolean;`, `declare function isBinding(node: BabelNode, parent: BabelNode, grandparent?: BabelNode): boolean`, `declare function isBlockScoped(node: BabelNode): boolean`, @@ -154,7 +221,10 @@ lines.push( `declare function isValidES3Identifier(name: string): boolean`, `declare function isValidES3Identifier(name: string): boolean`, `declare function isValidIdentifier(name: string): boolean`, - `declare function isVar(node: BabelNode): boolean` + `declare function isVar(node: BabelNode): boolean`, + // eslint-disable-next-line max-len + `declare function matchesPattern(node: ?BabelNode, match: string | Array, allowPartial?: boolean): boolean`, + `declare function validate(n: BabelNode, key: string, value: mixed): void;` ); for (const type in t.FLIPPED_ALIAS_KEYS) { diff --git a/packages/babel-types/scripts/generators/typescript.js b/packages/babel-types/scripts/generators/typescript.js index 6666a277d37e..01e6c4782819 100644 --- a/packages/babel-types/scripts/generators/typescript.js +++ b/packages/babel-types/scripts/generators/typescript.js @@ -62,6 +62,13 @@ for (const type in t.NODE_FIELDS) { fieldNames.forEach(fieldName => { const field = fields[fieldName]; + // Future / annoying TODO: + // MemberExpression.property, ObjectProperty.key and ObjectMethod.key need special cases; either: + // - convert the declaration to chain() like ClassProperty.key and ClassMethod.key, + // - declare an alias type for valid keys, detect the case and reuse it here, + // - declare a disjoint union with, for example, ObjectPropertyBase, + // ObjectPropertyLiteralKey and ObjectPropertyComputedKey, and declare ObjectProperty + // as "ObjectPropertyBase & (ObjectPropertyLiteralKey | ObjectPropertyComputedKey)" let typeAnnotation = stringifyValidator(field.validate, ""); if (isNullable(field) && !hasDefault(field)) { @@ -109,25 +116,113 @@ for (const type in t.NODE_FIELDS) { } } -for (let i = 0; i < t.TYPES.length; i++) { - let decl = `export function is${t.TYPES[i]}(node: object | null | undefined, opts?: object | null): `; - - if (t.NODE_FIELDS[t.TYPES[i]]) { - decl += `node is ${t.TYPES[i]};`; - } else if (t.FLIPPED_ALIAS_KEYS[t.TYPES[i]]) { - decl += `node is ${t.TYPES[i]};`; - } else { - decl += `boolean;`; - } - - lines.push(decl); +for (const typeName of t.TYPES) { + const result = + t.NODE_FIELDS[typeName] || t.FLIPPED_ALIAS_KEYS[typeName] + ? `node is ${typeName}` + : "boolean"; + + lines.push( + `export function is${typeName}(node: object | null | undefined, opts?: object | null): ${result};`, + // TypeScript 3.7: https://github.com/microsoft/TypeScript/pull/32695 will allow assert declarations + // eslint-disable-next-line max-len + `// export function assert${typeName}(node: object | null | undefined, opts?: object | null): asserts ${ + result === "boolean" ? "node" : result + };` + ); } lines.push( - `export function validate(n: Node, key: string, value: any): void;`, + // assert/ + // Commented out as this declaration requires TypeScript 3.7 (what do?) + `// export function assertNode(obj: any): asserts obj is Node`, + + // builders/ + // eslint-disable-next-line max-len + `export function createTypeAnnotationBasedOnTypeof(type: 'string' | 'number' | 'undefined' | 'boolean' | 'function' | 'object' | 'symbol'): StringTypeAnnotation | VoidTypeAnnotation | NumberTypeAnnotation | BooleanTypeAnnotation | GenericTypeAnnotation`, + `export function createUnionTypeAnnotation(types: [T]): T`, + // this probably misbehaves if there are 0 elements, and it's not a UnionTypeAnnotation if there's only 1 + // it is possible to require "2 or more" for this overload ([T, T, ...T[]]) but it requires typescript 3.0 + `export function createUnionTypeAnnotation(types: ReadonlyArray): UnionTypeAnnotation`, + // this smells like "internal API" + // eslint-disable-next-line max-len + `export function buildChildren(node: { children: ReadonlyArray }): JSXElement['children']`, + + // clone/ `export function clone(n: T): T;`, `export function cloneDeep(n: T): T;`, `export function cloneNode(n: T, deep?: boolean): T;`, + `export function cloneWithoutLoc(n: T): T;`, + + // comments/ + `export type CommentTypeShorthand = 'leading' | 'inner' | 'trailing'`, + // eslint-disable-next-line max-len + `export function addComment(node: T, type: CommentTypeShorthand, content: string, line?: boolean): T`, + // eslint-disable-next-line max-len + `export function addComments(node: T, type: CommentTypeShorthand, comments: ReadonlyArray): T`, + `export function inheritInnerComments(node: Node, parent: Node): void`, + `export function inheritLeadingComments(node: Node, parent: Node): void`, + `export function inheritsComments(node: T, parent: Node): void`, + `export function inheritTrailingComments(node: Node, parent: Node): void`, + `export function removeComments(node: T): T`, + + // converters/ + // eslint-disable-next-line max-len + `export function ensureBlock(node: Extract): BlockStatement`, + // too complex? + // eslint-disable-next-line max-len + `export function ensureBlock = 'body'>(node: Extract>, key: K): BlockStatement`, + // gatherSequenceExpressions is not exported + `export function toBindingIdentifierName(name: { toString(): string } | null | undefined): string`, + `export function toBlock(node: Statement | Expression, parent?: Function | null): BlockStatement`, + // it is possible for `node` to be an arbitrary object if `key` is always provided, + // but that doesn't look like intended API + // eslint-disable-next-line max-len + `export function toComputedKey>(node: T, key?: Expression | Identifier): Expression`, + `export function toExpression(node: Function): FunctionExpression`, + `export function toExpression(node: Class): ClassExpression`, + `export function toExpression(node: ExpressionStatement | Expression | Class | Function): Expression`, + `export function toIdentifier(name: { toString(): string } | null | undefined): string`, + `export function toKeyAlias(node: Method | Property, key?: Node): string`, + // NOTE: this actually uses Scope from @babel/traverse, but we can't add a dependency on its types, + // as they live in @types. Declare the structural subset that is required. + // eslint-disable-next-line max-len + `export function toSequenceExpression(nodes: ReadonlyArray, scope: { push(value: { id: LVal; kind: 'var'; init?: Expression}): void; buildUndefinedNode(): Node }): SequenceExpression | undefined`, + `export function toStatement(node: AssignmentExpression, ignore?: boolean): ExpressionStatement`, + `export function toStatement(node: Statement | AssignmentExpression, ignore?: boolean): Statement`, + `export function toStatement(node: Class, ignore: true): ClassDeclaration | undefined`, + `export function toStatement(node: Class, ignore?: boolean): ClassDeclaration`, + `export function toStatement(node: Function, ignore: true): FunctionDeclaration | undefined`, + `export function toStatement(node: Function, ignore?: boolean): FunctionDeclaration`, + // eslint-disable-next-line max-len + `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore: true): Statement | undefined`, + // eslint-disable-next-line max-len + `export function toStatement(node: Statement | Class | Function | AssignmentExpression, ignore?: boolean): Statement`, + // eslint-disable-next-line max-len + `export function valueToNode(value: undefined): Identifier`, // (should this not be a UnaryExpression to avoid shadowing?) + `export function valueToNode(value: boolean): BooleanLiteral`, + `export function valueToNode(value: null): NullLiteral`, + `export function valueToNode(value: string): StringLiteral`, + // Infinities and NaN need to use a BinaryExpression; negative values must be wrapped in UnaryExpression + `export function valueToNode(value: number): NumericLiteral | BinaryExpression | UnaryExpression`, + `export function valueToNode(value: RegExp): RegExpLiteral`, + // eslint-disable-next-line max-len + `export function valueToNode(value: ReadonlyArray): ArrayExpression`, + // this throws with objects that are not PlainObject according to lodash, + // or if there are non-valueToNode-able values + `export function valueToNode(value: object): ObjectExpression`, + // eslint-disable-next-line max-len + `export function valueToNode(value: undefined | boolean | null | string | number | RegExp | object): Expression`, + + // modifications/ + // eslint-disable-next-line max-len + `export function removeTypeDuplicates(types: ReadonlyArray): FlowType[]`, + // eslint-disable-next-line max-len + `export function appendToMemberExpression>(member: T, append: MemberExpression['property'], computed?: boolean): T`, + // eslint-disable-next-line max-len + `export function inherits(child: T, parent: Node | null | undefined): T`, + // eslint-disable-next-line max-len + `export function prependToMemberExpression>(member: T, prepend: MemberExpression['object']): T`, `export function removeProperties( n: Node, opts?: { preserveComments: boolean } | null @@ -136,34 +231,76 @@ lines.push( n: T, opts?: { preserveComments: boolean } | null ): T;`, + + // retrievers/ + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean): Record>`, + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean): Record`, + // eslint-disable-next-line max-len + `export function getBindingIdentifiers(node: Node, duplicates: boolean, outerOnly?: boolean): Record>`, + // eslint-disable-next-line max-len + `export function getOuterBindingIdentifiers(node: Node, duplicates: true): Record>`, + `export function getOuterBindingIdentifiers(node: Node, duplicates?: false): Record`, + // eslint-disable-next-line max-len + `export function getOuterBindingIdentifiers(node: Node, duplicates: boolean): Record>`, + + // traverse/ `export type TraversalAncestors = ReadonlyArray<{ node: Node, key: string, index?: number, }>; - export type TraversalHandler = (node: Node, parent: TraversalAncestors, type: T) => void; + export type TraversalHandler = ( + this: undefined, node: Node, parent: TraversalAncestors, type: T + ) => void; export type TraversalHandlers = { enter?: TraversalHandler, exit?: TraversalHandler, };`.replace(/(^|\n) {2}/g, "$1"), // eslint-disable-next-line `export function traverse(n: Node, h: TraversalHandler | TraversalHandlers, state?: T): void;`, - `export function is(type: string, n: Node, opts: object): boolean;`, + `export function traverseFast(n: Node, h: TraversalHandler, state?: T): void;`, + + // utils/ + // cleanJSXElementLiteralChild is not exported + // inherit is not exported + `export function shallowEqual(actual: object, expected: T): actual is T`, + + // validators/ + // eslint-disable-next-line max-len + `export function buildMatchMemberExpression(match: string, allowPartial?: boolean): (node: Node | null | undefined) => node is MemberExpression`, + // eslint-disable-next-line max-len + `export function is(type: T, n: Node | null | undefined, required?: undefined): n is Extract`, + // eslint-disable-next-line max-len + `export function is>(type: T, n: Node | null | undefined, required: Partial

): n is P`, + // eslint-disable-next-line max-len + `export function is

(type: string, n: Node | null | undefined, required: Partial

): n is P`, + `export function is(type: string, n: Node | null | undefined, required?: Partial): n is Node`, `export function isBinding(node: Node, parent: Node, grandparent?: Node): boolean`, - `export function isBlockScoped(node: Node): boolean`, - `export function isImmutable(node: Node): boolean`, - `export function isLet(node: Node): boolean`, - `export function isNode(node: object | null | undefined): boolean`, + // eslint-disable-next-line max-len + `export function isBlockScoped(node: Node): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration`, + `export function isImmutable(node: Node): node is Immutable`, + `export function isLet(node: Node): node is VariableDeclaration`, + `export function isNode(node: object | null | undefined): node is Node`, + `export function isNodesEquivalent>(a: T, b: any): b is T`, `export function isNodesEquivalent(a: any, b: any): boolean`, - `export function isPlaceholderType(placeholderType: string, targetType: string): boolean`, + `export function isPlaceholderType(placeholderType: Node['type'], targetType: Node['type']): boolean`, `export function isReferenced(node: Node, parent: Node, grandparent?: Node): boolean`, - `export function isScope(node: Node, parent: Node): boolean`, + `export function isScope(node: Node, parent: Node): node is Scopable`, `export function isSpecifierDefault(specifier: ModuleSpecifier): boolean`, + `export function isType(nodetype: string, targetType: T): nodetype is T`, `export function isType(nodetype: string | null | undefined, targetType: string): boolean`, `export function isValidES3Identifier(name: string): boolean`, - `export function isValidES3Identifier(name: string): boolean`, `export function isValidIdentifier(name: string): boolean`, - `export function isVar(node: Node): boolean` + `export function isVar(node: Node): node is VariableDeclaration`, + // the MemberExpression implication is incidental, but it follows from the implementation + // eslint-disable-next-line max-len + `export function matchesPattern(node: Node | null | undefined, match: string | ReadonlyArray, allowPartial?: boolean): node is MemberExpression`, + // TypeScript 3.7: ": asserts n is T" + // eslint-disable-next-line max-len + `export function validate(n: Node | null | undefined, key: K, value: T[K]): void`, + `export function validate(n: Node, key: string, value: any): void;` ); for (const type in t.DEPRECATED_KEYS) { From 0856618ed57188e7c7bdad26749a028acfbade0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 8 Oct 2019 13:09:05 -0400 Subject: [PATCH 111/965] perf: replace lookahead by lookaheadCharCode (#10371) * perf: replace lookahead by lookaheadCharCode * fix: flow ignore * refactor: add nextTokenStart method * refactor: duplicated isNewLine code * refactor: remove lookahead usage from babylon core --- .../babel-parser/src/parser/expression.js | 2 +- packages/babel-parser/src/parser/statement.js | 45 +++++++------------ packages/babel-parser/src/parser/util.js | 26 +++++++++-- .../src/plugins/typescript/index.js | 9 +++- packages/babel-parser/src/tokenizer/index.js | 29 ++++++------ 5 files changed, 62 insertions(+), 49 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index bf47b980ba1a..812fa605a6af 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -613,7 +613,7 @@ export default class ExpressionParser extends LValParser { } else if (this.match(tt.questionDot)) { this.expectPlugin("optionalChaining"); state.optionalChainMember = true; - if (noCalls && this.lookahead().type === tt.parenL) { + if (noCalls && this.lookaheadCharCode() === charCodes.leftParenthesis) { state.stop = true; return base; } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index bfadb601dbcf..8ce0c9d64418 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -8,7 +8,7 @@ import { isIdentifierStart, keywordRelationalOperator, } from "../util/identifier"; -import { lineBreak, skipWhiteSpace } from "../util/whitespace"; +import { lineBreak } from "../util/whitespace"; import * as charCodes from "charcodes"; import { BIND_CLASS, @@ -105,10 +105,7 @@ export default class StatementParser extends ExpressionParser { if (!this.isContextual("let")) { return false; } - skipWhiteSpace.lastIndex = this.state.pos; - const skip = skipWhiteSpace.exec(this.input); - // $FlowIgnore - const next = this.state.pos + skip[0].length; + const next = this.nextTokenStart(); const nextCh = this.input.charCodeAt(next); // For ambiguous cases, determine if a LexicalDeclaration (or only a // Statement) is allowed here. If context is not empty then only a Statement @@ -170,7 +167,7 @@ export default class StatementParser extends ExpressionParser { case tt._for: return this.parseForStatement(node); case tt._function: - if (this.lookahead().type === tt.dot) break; + if (this.lookaheadCharCode() === charCodes.dot) break; if (context) { if (this.state.strict) { this.raise( @@ -223,8 +220,11 @@ export default class StatementParser extends ExpressionParser { return this.parseEmptyStatement(node); case tt._export: case tt._import: { - const nextToken = this.lookahead(); - if (nextToken.type === tt.parenL || nextToken.type === tt.dot) { + const nextTokenCharCode = this.lookaheadCharCode(); + if ( + nextTokenCharCode === charCodes.leftParenthesis || + nextTokenCharCode === charCodes.dot + ) { break; } @@ -1746,11 +1746,11 @@ export default class StatementParser extends ExpressionParser { maybeParseExportDeclaration(node: N.Node): boolean { if (this.shouldParseExportDeclaration()) { if (this.isContextual("async")) { - const next = this.lookahead(); + const next = this.nextTokenStart(); // export async; - if (next.type !== tt._function) { - this.unexpected(next.start, `Unexpected token, expected "function"`); + if (!this.isUnparsedContextual(next, "function")) { + this.unexpected(next, `Unexpected token, expected "function"`); } } @@ -1765,21 +1765,10 @@ export default class StatementParser extends ExpressionParser { isAsyncFunction(): boolean { if (!this.isContextual("async")) return false; - - const { pos } = this.state; - - skipWhiteSpace.lastIndex = pos; - const skip = skipWhiteSpace.exec(this.input); - - if (!skip || !skip.length) return false; - - const next = pos + skip[0].length; - + const next = this.nextTokenStart(); return ( - !lineBreak.test(this.input.slice(pos, next)) && - this.input.slice(next, next + 8) === "function" && - (next + 8 === this.length || - !isIdentifierChar(this.input.charCodeAt(next + 8))) + !lineBreak.test(this.input.slice(this.state.pos, next)) && + this.isUnparsedContextual(next, "function") ); } @@ -1841,10 +1830,10 @@ export default class StatementParser extends ExpressionParser { return false; } - const lookahead = this.lookahead(); + const next = this.nextTokenStart(); return ( - lookahead.type === tt.comma || - (lookahead.type === tt.name && lookahead.value === "from") + this.input.charCodeAt(next) === charCodes.comma || + this.isUnparsedContextual(next, "from") ); } diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index 41e19c1a3c2e..d66671551ee2 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -4,6 +4,8 @@ import { types as tt, type TokenType } from "../tokenizer/types"; import Tokenizer from "../tokenizer"; import type { Node } from "../types"; import { lineBreak, skipWhiteSpace } from "../util/whitespace"; +import { isIdentifierChar } from "../util/identifier"; +import * as charCodes from "charcodes"; const literal = /^('|")((?:\\?.)*?)\1/; @@ -26,8 +28,15 @@ export default class UtilParser extends Tokenizer { } isLookaheadRelational(op: "<" | ">"): boolean { - const l = this.lookahead(); - return l.type === tt.relational && l.value === op; + const next = this.nextTokenStart(); + if (this.input.charAt(next) === op) { + if (next + 1 === this.input.length) { + return true; + } + const afterNext = this.input.charCodeAt(next + 1); + return afterNext !== op.charCodeAt(0) && afterNext !== charCodes.equalsTo; + } + return false; } // TODO @@ -60,9 +69,18 @@ export default class UtilParser extends Tokenizer { ); } + isUnparsedContextual(nameStart: number, name: string): boolean { + const nameEnd = nameStart + name.length; + return ( + this.input.slice(nameStart, nameEnd) === name && + (nameEnd === this.input.length || + !isIdentifierChar(this.input.charCodeAt(nameEnd))) + ); + } + isLookaheadContextual(name: string): boolean { - const l = this.lookahead(); - return l.type === tt.name && l.value === name; + const next = this.nextTokenStart(); + return this.isUnparsedContextual(next, name); } // Consumes contextual keyword if possible. diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 3ac78d17474a..1eedd15b83c4 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -19,6 +19,7 @@ import { BIND_CLASS, } from "../../util/scopeflags"; import TypeScriptScopeHandler from "./scope"; +import * as charCodes from "charcodes"; type TsModifier = | "readonly" @@ -657,7 +658,10 @@ export default (superClass: Class): Class => : this.match(tt._null) ? "TSNullKeyword" : keywordTypeFromName(this.state.value); - if (type !== undefined && this.lookahead().type !== tt.dot) { + if ( + type !== undefined && + this.lookaheadCharCode() !== charCodes.dot + ) { const node: N.TsKeywordType = this.startNode(); this.next(); return this.finishNode(node, type); @@ -1203,7 +1207,8 @@ export default (superClass: Class): Class => tsIsExternalModuleReference(): boolean { return ( - this.isContextual("require") && this.lookahead().type === tt.parenL + this.isContextual("require") && + this.lookaheadCharCode() === charCodes.leftParenthesis ); } diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 3fdced8aaffd..1d2ea02212fd 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -13,6 +13,7 @@ import { lineBreakG, isNewLine, isWhitespace, + skipWhiteSpace, } from "../util/whitespace"; import State from "./state"; @@ -168,6 +169,18 @@ export default class Tokenizer extends LocationParser { return curr; } + nextTokenStart(): number { + const thisTokEnd = this.state.pos; + skipWhiteSpace.lastIndex = thisTokEnd; + const skip = skipWhiteSpace.exec(this.input); + // $FlowIgnore: The skipWhiteSpace ensures to match any string + return thisTokEnd + skip[0].length; + } + + lookaheadCharCode(): number { + return this.input.charCodeAt(this.nextTokenStart()); + } + // Toggle strict mode. Re-reads the next number or string to please // pedantic tests (`"use strict"; 010;` should fail). @@ -267,13 +280,7 @@ export default class Tokenizer extends LocationParser { const startLoc = this.state.curPosition(); let ch = this.input.charCodeAt((this.state.pos += startSkip)); if (this.state.pos < this.length) { - while ( - ch !== charCodes.lineFeed && - ch !== charCodes.carriageReturn && - ch !== charCodes.lineSeparator && - ch !== charCodes.paragraphSeparator && - ++this.state.pos < this.length - ) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } } @@ -441,13 +448,7 @@ export default class Tokenizer extends LocationParser { let ch = this.input.charCodeAt(this.state.pos); if (ch !== charCodes.exclamationMark) return false; - while ( - ch !== charCodes.lineFeed && - ch !== charCodes.carriageReturn && - ch !== charCodes.lineSeparator && - ch !== charCodes.paragraphSeparator && - ++this.state.pos < this.length - ) { + while (!isNewLine(ch) && ++this.state.pos < this.length) { ch = this.input.charCodeAt(this.state.pos); } From 599d2ff324f6abc45100f665537154c8f9a0c750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 8 Oct 2019 19:16:36 +0200 Subject: [PATCH 112/965] Update yarn.lock [skip ci] --- yarn.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index b7b9e7381872..17d850dc2850 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7441,13 +7441,6 @@ meow@^4.0.0: redent "^2.0.0" trim-newlines "^2.0.0" -merge-stream@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" - integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= - dependencies: - readable-stream "^2.0.1" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" From b0acfb24dd8d982da0a6c0f19620693268684c0b Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Wed, 9 Oct 2019 01:35:40 +0800 Subject: [PATCH 113/965] add scope to TSModuleDeclaration (#10119) --- .../src/plugins/typescript/index.js | 8 +- packages/babel-parser/src/util/scopeflags.js | 23 +- .../scope/module-declaration-var-2/input.js | 5 + .../module-declaration-var-2/output.json | 232 +++++++++++++++++ .../scope/module-declaration-var/input.js | 5 + .../scope/module-declaration-var/output.json | 236 ++++++++++++++++++ 6 files changed, 497 insertions(+), 12 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/input.js create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/input.js create mode 100644 packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 1eedd15b83c4..40292c5107c8 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -9,6 +9,7 @@ import type Parser from "../../parser"; import { type BindingTypes, BIND_NONE, + SCOPE_TS_MODULE, SCOPE_OTHER, BIND_TS_ENUM, BIND_TS_CONST_ENUM, @@ -1167,7 +1168,9 @@ export default (superClass: Class): Class => this.tsParseModuleOrNamespaceDeclaration(inner, true); node.body = inner; } else { + this.scope.enter(SCOPE_TS_MODULE); node.body = this.tsParseModuleBlock(); + this.scope.exit(); } return this.finishNode(node, "TSModuleDeclaration"); } @@ -1183,9 +1186,10 @@ export default (superClass: Class): Class => } else { this.unexpected(); } - if (this.match(tt.braceL)) { + this.scope.enter(SCOPE_TS_MODULE); node.body = this.tsParseModuleBlock(); + this.scope.exit(); } else { this.semicolon(); } @@ -1337,10 +1341,12 @@ export default (superClass: Class): Class => // `global { }` (with no `declare`) may appear inside an ambient module declaration. // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past "global". if (this.match(tt.braceL)) { + this.scope.enter(SCOPE_TS_MODULE); const mod: N.TsModuleDeclaration = node; mod.global = true; mod.id = expr; mod.body = this.tsParseModuleBlock(); + this.scope.exit(); return this.finishNode(mod, "TSModuleDeclaration"); } break; diff --git a/packages/babel-parser/src/util/scopeflags.js b/packages/babel-parser/src/util/scopeflags.js index 43b18f6641e1..d926998835b6 100644 --- a/packages/babel-parser/src/util/scopeflags.js +++ b/packages/babel-parser/src/util/scopeflags.js @@ -2,17 +2,18 @@ // Each scope gets a bitset that may contain these flags // prettier-ignore -export const SCOPE_OTHER = 0b000000000, - SCOPE_PROGRAM = 0b000000001, - SCOPE_FUNCTION = 0b000000010, - SCOPE_ASYNC = 0b000000100, - SCOPE_GENERATOR = 0b000001000, - SCOPE_ARROW = 0b000010000, - SCOPE_SIMPLE_CATCH = 0b000100000, - SCOPE_SUPER = 0b001000000, - SCOPE_DIRECT_SUPER = 0b010000000, - SCOPE_CLASS = 0b100000000, - SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION; +export const SCOPE_OTHER = 0b0000000000, + SCOPE_PROGRAM = 0b0000000001, + SCOPE_FUNCTION = 0b0000000010, + SCOPE_ASYNC = 0b0000000100, + SCOPE_GENERATOR = 0b0000001000, + SCOPE_ARROW = 0b0000010000, + SCOPE_SIMPLE_CATCH = 0b0000100000, + SCOPE_SUPER = 0b0001000000, + SCOPE_DIRECT_SUPER = 0b0010000000, + SCOPE_CLASS = 0b0100000000, + SCOPE_TS_MODULE = 0b1000000000, + SCOPE_VAR = SCOPE_PROGRAM | SCOPE_FUNCTION | SCOPE_TS_MODULE; export type ScopeFlags = | typeof SCOPE_OTHER diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/input.js b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/input.js new file mode 100644 index 000000000000..0cf66b421f31 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/input.js @@ -0,0 +1,5 @@ +declare class foo { +} +module bar { + export var foo: any; +} diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json new file mode 100644 index 000000000000..9bb0caf6808d --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json @@ -0,0 +1,232 @@ +{ + "type": "File", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [] + }, + "declare": true + }, + { + "type": "TSModuleDeclaration", + "start": 22, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "body": { + "type": "TSModuleBlock", + "start": 33, + "end": 59, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 37, + "end": 57, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 44, + "end": 57, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 48, + "end": 56, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 48, + "end": 56, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + }, + "identifierName": "foo" + }, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 51, + "end": 56, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start": 53, + "end": 56, + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 21 + } + } + } + } + }, + "init": null + } + ], + "kind": "var" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/input.js b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/input.js new file mode 100644 index 000000000000..237ff39e1579 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/input.js @@ -0,0 +1,5 @@ +declare class foo { +} +declare module 'bar' { + export var foo: any; +} diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json new file mode 100644 index 000000000000..77f4b16a6ac7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json @@ -0,0 +1,236 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 18, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 2, + "column": 1 + } + }, + "body": [] + }, + "declare": true + }, + { + "type": "TSModuleDeclaration", + "start": 22, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "id": { + "type": "StringLiteral", + "start": 37, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 15 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "extra": { + "rawValue": "bar", + "raw": "'bar'" + }, + "value": "bar" + }, + "body": { + "type": "TSModuleBlock", + "start": 43, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "start": 47, + "end": 67, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "specifiers": [], + "source": null, + "declaration": { + "type": "VariableDeclaration", + "start": 54, + "end": 67, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 22 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 58, + "end": 66, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 58, + "end": 66, + "loc": { + "start": { + "line": 4, + "column": 13 + }, + "end": { + "line": 4, + "column": 21 + }, + "identifierName": "foo" + }, + "name": "foo", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 61, + "end": 66, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "typeAnnotation": { + "type": "TSAnyKeyword", + "start": 63, + "end": 66, + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 21 + } + } + } + } + }, + "init": null + } + ], + "kind": "var" + } + } + ] + }, + "declare": true + } + ], + "directives": [] + } +} \ No newline at end of file From 563874c06cb03708a235e6d1710c42fab6cf6018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 8 Oct 2019 13:43:12 -0400 Subject: [PATCH 114/965] Do not remove let bindings even they are wrapped in closure (#10343) * fix: should not remove let binding even it is wrapped in closure Fixes #10339 * fix: remove bindings defined in blockScope when wrapped in closure * Move test assertions to the top level to ensure that they run --- .../src/index.js | 13 ++++--- .../test/fixtures/general/issue-10339/exec.js | 38 +++++++++++++++++++ .../fixtures/general/issue-10339/input.js | 7 ++++ .../fixtures/general/issue-10339/options.json | 3 ++ .../fixtures/general/issue-10339/output.js | 20 ++++++++++ 5 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/exec.js create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/input.js create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json create mode 100644 packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/output.js diff --git a/packages/babel-plugin-transform-block-scoping/src/index.js b/packages/babel-plugin-transform-block-scoping/src/index.js index 50c254c848a8..5391032751c4 100644 --- a/packages/babel-plugin-transform-block-scoping/src/index.js +++ b/packages/babel-plugin-transform-block-scoping/src/index.js @@ -441,22 +441,25 @@ class BlockScoping { } updateScopeInfo(wrappedInClosure) { - const scope = this.scope; + const blockScope = this.blockPath.scope; - const parentScope = scope.getFunctionParent() || scope.getProgramParent(); + const parentScope = + blockScope.getFunctionParent() || blockScope.getProgramParent(); const letRefs = this.letReferences; for (const key of Object.keys(letRefs)) { const ref = letRefs[key]; - const binding = scope.getBinding(ref.name); + const binding = blockScope.getBinding(ref.name); if (!binding) continue; if (binding.kind === "let" || binding.kind === "const") { binding.kind = "var"; if (wrappedInClosure) { - scope.removeBinding(ref.name); + if (blockScope.hasOwnBinding(ref.name)) { + blockScope.removeBinding(ref.name); + } } else { - scope.moveBindingTo(ref.name, parentScope); + blockScope.moveBindingTo(ref.name, parentScope); } } } diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/exec.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/exec.js new file mode 100644 index 000000000000..9fea95129bb4 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/exec.js @@ -0,0 +1,38 @@ +const code = multiline([ + "for (const {foo, ...bar} of { bar: [] }) {", + "() => foo;", + "const [qux] = bar;", + "try {} catch (e) {", + "let quux = qux;", + "}", + "}" +]); + +let programPath; +let forOfPath; +let functionPath; + +transform(code, { + configFile: false, + plugins: [ + "../../../../lib", + { + post({ path }) { + programPath = path; + path.traverse({ + ForOfStatement(path) { forOfPath = path }, + FunctionExpression(path) { functionPath = path } + }); + } + } + ] +}); + +expect(Object.keys(programPath.scope.bindings)).toEqual(["foo", "bar"]); + +// for declarations should be transformed to for bindings +expect(forOfPath.scope.bindings).toEqual({}); +// The body should be wrapped into closure +expect(forOfPath.get("body").scope.bindings).toEqual({}); + +expect(Object.keys(functionPath.scope.bindings)).toEqual(["foo", "bar", "qux", "quux"]); diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/input.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/input.js new file mode 100644 index 000000000000..dcca3b6e2d97 --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/input.js @@ -0,0 +1,7 @@ +for (const {foo, ...bar} of {}) { + () => foo; + const [qux] = bar; + try {} catch (e) { + const quux = qux; + } +} diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json new file mode 100644 index 000000000000..d829970edd1b --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-block-scoping", ["proposal-object-rest-spread", { "loose": true }]] +} diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/output.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/output.js new file mode 100644 index 000000000000..b482807df22a --- /dev/null +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/output.js @@ -0,0 +1,20 @@ +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } + +var _loop = function (foo, bar) { + () => foo; + + var [qux] = bar; + + try {} catch (e) { + var quux = qux; + } +}; + +for (var _ref of {}) { + var { + foo + } = _ref, + bar = _objectWithoutPropertiesLoose(_ref, ["foo"]); + + _loop(foo, bar); +} From 25b35261ca9c75bbf1b2d91bcc28bd00b9290496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 8 Oct 2019 20:39:07 +0200 Subject: [PATCH 115/965] Update test262 [skip ci] --- Makefile | 2 +- scripts/tests/test262/test262_whitelist.txt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 962936d1a6cc..1b675f78db6d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = a1acc23cd85c552cde9c06cfed300c58d4b5b04c +TEST262_COMMIT = 8688c4ab79059c3097098605e69f1ee5eda6c409 # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 9c76b5ca07a5..6ad39b56b688 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -324,6 +324,8 @@ language/module-code/top-level-await/syntax/for-await-expr-obj-literal.js(defaul 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) @@ -346,6 +348,8 @@ language/module-code/top-level-await/syntax/for-in-await-expr-obj-literal.js(def 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) @@ -368,6 +372,8 @@ language/module-code/top-level-await/syntax/for-of-await-expr-obj-literal.js(def 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) From d329156ebc17da01382acb83e212cb4328534ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 8 Oct 2019 21:31:40 +0200 Subject: [PATCH 116/965] v7.6.3 --- lerna.json | 2 +- packages/babel-cli/package.json | 6 +++--- packages/babel-core/package.json | 12 ++++++------ packages/babel-generator/package.json | 8 ++++---- packages/babel-helper-fixtures/package.json | 2 +- .../package.json | 6 +++--- packages/babel-node/package.json | 6 +++--- packages/babel-parser/package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 6 +++--- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../babel-preset-env-standalone/package.json | 8 ++++---- packages/babel-preset-env/package.json | 14 +++++++------- packages/babel-preset-react/package.json | 6 +++--- packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 16 ++++++++-------- packages/babel-traverse/package.json | 8 ++++---- packages/babel-types/package.json | 6 +++--- 23 files changed, 68 insertions(+), 68 deletions(-) diff --git a/lerna.json b/lerna.json index 4c33226c52cb..c6f0ba10f683 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.6.2", + "version": "7.6.3", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 0c7af101f160..41ca75cbaf72 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.6.2", + "version": "7.6.3", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -36,8 +36,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/helper-fixtures": "^7.6.2" + "@babel/core": "^7.6.3", + "@babel/helper-fixtures": "^7.6.3" }, "bin": { "babel": "./bin/babel.js", diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index e91fbcbe27a7..b78462ffc28b 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.6.2", + "version": "7.6.3", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,12 +34,12 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.2", + "@babel/generator": "^7.6.3", "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.2", + "@babel/parser": "^7.6.3", "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.0", + "@babel/traverse": "^7.6.3", + "@babel/types": "^7.6.3", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -49,6 +49,6 @@ "source-map": "^0.6.1" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.6.0" + "@babel/helper-transform-fixture-test-runner": "^7.6.3" } } diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index eb5d9231bb9a..8f24e09d2310 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.6.2", + "version": "7.6.3", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,13 +14,13 @@ "lib" ], "dependencies": { - "@babel/types": "^7.6.0", + "@babel/types": "^7.6.3", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.6.1" }, "devDependencies": { - "@babel/helper-fixtures": "^7.6.2", - "@babel/parser": "^7.6.2" + "@babel/helper-fixtures": "^7.6.3", + "@babel/parser": "^7.6.3" } } diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index cf47185a8b40..2f30f7c53d22 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-fixtures", - "version": "7.6.2", + "version": "7.6.3", "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index ca35190645ea..4d4ccd25ba01 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.6.0", + "version": "7.6.3", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,8 +12,8 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.6.0", - "@babel/helper-fixtures": "^7.6.0", + "@babel/core": "^7.6.3", + "@babel/helper-fixtures": "^7.6.3", "@babel/polyfill": "^7.6.0", "babel-check-duplicated-nodes": "^1.0.0", "jest": "^24.8.0", diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 58c66f24cbc7..f2b77567c4fb 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.6.2", + "version": "7.6.3", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -31,8 +31,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/helper-fixtures": "^7.6.2", + "@babel/core": "^7.6.3", + "@babel/helper-fixtures": "^7.6.3", "fs-readdir-recursive": "^1.0.0", "output-file-sync": "^2.0.0" }, diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 803192a3ee07..b0758e260a64 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.6.2", + "version": "7.6.3", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -29,7 +29,7 @@ }, "devDependencies": { "@babel/code-frame": "^7.5.5", - "@babel/helper-fixtures": "^7.6.2", + "@babel/helper-fixtures": "^7.6.3", "charcodes": "^0.2.0", "unicode-12.0.0": "^0.7.9" }, diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index d51f5c659d6a..5a6c85f93138 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.6.2", + "version": "7.6.3", "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index 8b2e1a0b1c45..7c5ab0d57b47 100644 --- a/packages/babel-plugin-transform-flow-comments/package.json +++ b/packages/babel-plugin-transform-flow-comments/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-comments", - "version": "7.6.0", + "version": "7.6.3", "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", @@ -12,7 +12,7 @@ "babel-plugin" ], "dependencies": { - "@babel/generator": "^7.6.0", + "@babel/generator": "^7.6.3", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-flow": "^7.2.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-flow-strip-types/package.json b/packages/babel-plugin-transform-flow-strip-types/package.json index c484570c331d..7754af0e1c17 100644 --- a/packages/babel-plugin-transform-flow-strip-types/package.json +++ b/packages/babel-plugin-transform-flow-strip-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-strip-types", - "version": "7.4.4", + "version": "7.6.3", "description": "Strip flow type annotations from your output code.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0" } } 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 c014d9a9c20a..679aa4396f52 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.6.2", + "version": "7.6.3", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -27,7 +27,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0", "core-js": "^3.2.1", "core-js-pure": "^3.2.1" diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index a596b388ba1a..10c33b538817 100644 --- a/packages/babel-plugin-transform-react-constant-elements/package.json +++ b/packages/babel-plugin-transform-react-constant-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-constant-elements", - "version": "7.6.0", + "version": "7.6.3", "description": "Treat React JSX elements as value types and hoist them to the highest scope", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index 1ea526e123c4..c685bcda9077 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.6.0", + "version": "7.6.3", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 55b57afe542e..b1befbaf7df9 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.6.2", + "version": "7.6.3", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -11,10 +11,10 @@ "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.5.0", "@babel/plugin-proposal-json-strings": "^7.0.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.2", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.3", "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.6.2", - "@babel/standalone": "^7.6.2" + "@babel/preset-env": "^7.6.3", + "@babel/standalone": "^7.6.3" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 8e122f7e519d..740beedde749 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.6.2", + "version": "7.6.3", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -30,7 +30,7 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.6.2", + "@babel/plugin-transform-block-scoping": "^7.6.3", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", @@ -45,7 +45,7 @@ "@babel/plugin-transform-modules-commonjs": "^7.6.0", "@babel/plugin-transform-modules-systemjs": "^7.5.0", "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.2", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.3", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", @@ -58,7 +58,7 @@ "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-unicode-regex": "^7.6.2", - "@babel/types": "^7.6.0", + "@babel/types": "^7.6.3", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", @@ -69,9 +69,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.6.2", - "@babel/core": "^7.6.2", - "@babel/helper-fixtures": "^7.6.2", + "@babel/cli": "^7.6.3", + "@babel/core": "^7.6.3", + "@babel/helper-fixtures": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index a7c6e195a5ad..f7a255aa8adb 100644 --- a/packages/babel-preset-react/package.json +++ b/packages/babel-preset-react/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-react", - "version": "7.0.0", + "version": "7.6.3", "description": "Babel preset for all React plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -21,8 +21,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.0.0", + "@babel/core": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/helper-transform-fixture-test-runner": "^7.0.0" + "@babel/helper-transform-fixture-test-runner": "^7.6.3" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 2286dffe3dd9..3b2a4defd8c7 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.6.2", + "version": "7.6.3", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 9e6ec873f718..55b4e26b6571 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.6.2", + "version": "7.6.3", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 84b8975759a8..84f3d9127abf 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.6.2", + "version": "7.6.3", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 35a5e842c4a1..7da9e3a66efb 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.6.2", + "version": "7.6.3", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -9,7 +9,7 @@ "src" ], "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.6.3", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", @@ -50,15 +50,15 @@ "@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", - "@babel/plugin-transform-block-scoping": "^7.6.2", + "@babel/plugin-transform-block-scoping": "^7.6.3", "@babel/plugin-transform-classes": "^7.5.5", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", "@babel/plugin-transform-dotall-regex": "^7.6.2", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-flow-comments": "^7.6.0", - "@babel/plugin-transform-flow-strip-types": "^7.4.4", + "@babel/plugin-transform-flow-comments": "^7.6.3", + "@babel/plugin-transform-flow-strip-types": "^7.6.3", "@babel/plugin-transform-for-of": "^7.4.4", "@babel/plugin-transform-function-name": "^7.4.4", "@babel/plugin-transform-instanceof": "^7.5.5", @@ -77,7 +77,7 @@ "@babel/plugin-transform-property-literals": "^7.2.0", "@babel/plugin-transform-property-mutators": "^7.2.0", "@babel/plugin-transform-proto-to-assign": "^7.5.5", - "@babel/plugin-transform-react-constant-elements": "^7.6.0", + "@babel/plugin-transform-react-constant-elements": "^7.6.3", "@babel/plugin-transform-react-display-name": "^7.2.0", "@babel/plugin-transform-react-inline-elements": "^7.2.0", "@babel/plugin-transform-react-jsx": "^7.3.0", @@ -93,10 +93,10 @@ "@babel/plugin-transform-strict-mode": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-typescript": "^7.6.0", + "@babel/plugin-transform-typescript": "^7.6.3", "@babel/plugin-transform-unicode-regex": "^7.6.2", "@babel/preset-flow": "^7.0.0", - "@babel/preset-react": "^7.0.0", + "@babel/preset-react": "^7.6.3", "@babel/preset-typescript": "^7.6.0" }, "keywords": [ diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 0762ff547d89..049b656f17f2 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.6.2", + "version": "7.6.3", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.2", + "@babel/generator": "^7.6.3", "@babel/helper-function-name": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.2", - "@babel/types": "^7.6.0", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 28681f00de9e..75b54493ee97 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.6.1", + "version": "7.6.3", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -17,7 +17,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.6.0", - "@babel/parser": "^7.6.0" + "@babel/generator": "^7.6.3", + "@babel/parser": "^7.6.3" } } From c7add11fdcc4be26e3ef94d1bba7ba303a15c312 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Tue, 8 Oct 2019 19:33:00 +0000 Subject: [PATCH 117/965] Add v7.6.3 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0f88e67e14e..4927c261c8a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,47 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.6.3 (2019-10-08) + +#### :eyeglasses: Spec Compliance +* `babel-parser` + * [#10469](https://github.com/babel/babel/pull/10469) Disallow await inside async arrow params ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10493](https://github.com/babel/babel/pull/10493) [parser] Disallow numeric separators in legacy octal like integers ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) + +#### :rocket: New Feature +* `babel-types` + * [#10504](https://github.com/babel/babel/pull/10504) Add declarations for more of @babel/types exports ([@Jessidhia](https://github.com/Jessidhia)) + +#### :bug: Bug Fix +* `babel-plugin-transform-block-scoping` + * [#10343](https://github.com/babel/babel/pull/10343) Do not remove let bindings even they are wrapped in closure ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10119](https://github.com/babel/babel/pull/10119) add scope to TSModuleDeclaration ([@tanhauhau](https://github.com/tanhauhau)) + * [#10332](https://github.com/babel/babel/pull/10332) Do not allow member expressions to start async arrows ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10490](https://github.com/babel/babel/pull/10490) [parser] Don't crash on comment after trailing comma after elision ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-transform-react-constant-elements`, `babel-traverse` + * [#10529](https://github.com/babel/babel/pull/10529) Do not hoist jsx referencing a mutable binding ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-generator`, `babel-parser`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-typescript` + * [#10220](https://github.com/babel/babel/pull/10220) Flow: interface identifier should be declared in the scope ([@JLHwung](https://github.com/JLHwung)) + +#### :nail_care: Polish +* `babel-core` + * [#10419](https://github.com/babel/babel/pull/10419) assertNoDuplicates throw with more context ([@hjdivad](https://github.com/hjdivad)) + * [#10511](https://github.com/babel/babel/pull/10511) Add filename to transform error ([@JLHwung](https://github.com/JLHwung)) + +#### :house: Internal +* Other + * [#10506](https://github.com/babel/babel/pull/10506) Use `make -j` for parallel build ([@JLHwung](https://github.com/JLHwung)) + * [#10443](https://github.com/babel/babel/pull/10443) perf: only apply lazy cjs module transform on cli and core ([@JLHwung](https://github.com/JLHwung)) + * [#10494](https://github.com/babel/babel/pull/10494) Enable optional chaining and nullish coalescing plugins ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-fixtures`, `babel-helper-transform-fixture-test-runner`, `babel-node`, `babel-plugin-transform-react-jsx-source`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-preset-react` + * [#10249](https://github.com/babel/babel/pull/10249) Add windows to travis ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :running_woman: Performance +* `babel-parser` + * [#10371](https://github.com/babel/babel/pull/10371) perf: replace lookahead by lookaheadCharCode ([@JLHwung](https://github.com/JLHwung)) +* Other + * [#10443](https://github.com/babel/babel/pull/10443) perf: only apply lazy cjs module transform on cli and core ([@JLHwung](https://github.com/JLHwung)) ## v7.6.2 (2019-09-23) #### :eyeglasses: Spec Compliance From 34937f13d52f4dffcf74d10b10ac96cbeadb987d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 8 Oct 2019 23:08:50 +0200 Subject: [PATCH 118/965] Trailing comma after rest - The final fix (#10491) * [parser] Track trailing commas in extras instead of state * Update existing tests * Update test262 whitelist * Improve error message and location * nit * Use lookaheadCharCode --- .../babel-parser/src/parser/expression.js | 62 ++++++++++++------- packages/babel-parser/src/parser/lval.js | 54 +++++++++++----- packages/babel-parser/src/parser/statement.js | 1 + packages/babel-parser/src/plugins/flow.js | 11 +++- .../src/plugins/typescript/index.js | 42 ++++++------- packages/babel-parser/src/tokenizer/state.js | 5 -- .../output.json | 10 ++- .../output.json | 3 + .../basic/function-trailing-comma/output.json | 3 + .../output.json | 3 + .../output.json | 5 +- .../comments/regression/10230/output.json | 5 +- .../core/uncategorised/10/output.json | 5 +- .../core/uncategorised/12/output.json | 5 +- .../core/uncategorised/13/output.json | 5 +- .../comma-after-rest/options.json | 2 +- .../comma-after-spread-for-in/input.js | 1 + .../comma-after-spread-for-in/options.json | 3 + .../comma-after-spread-nested/input.js | 1 + .../comma-after-spread-nested/options.json | 3 + .../comma-after-spread/output.json | 5 +- .../comma-after-rest-param/options.json | 2 +- .../es2015/uncategorised/322/output.json | 5 +- .../options.json | 4 +- .../trailing-function-commas/1/output.json | 3 + .../es2018/object-rest-spread/10/output.json | 5 +- .../es2018/object-rest-spread/6/output.json | 1 + .../es2018/object-rest-spread/8/options.json | 2 +- .../comma-after-spread-for-in/input.js | 1 + .../comma-after-spread-for-in/options.json | 3 + .../comma-after-spread-nested/input.js | 1 + .../comma-after-spread-nested/options.json | 3 + .../comma-after-spread/output.json | 1 + .../elision/output.json | 5 +- .../elision/output.json | 5 +- .../proto-identifier-method/output.json | 1 + .../proto-literal-method/output.json | 1 + .../es2015-object-pattern/elision/output.json | 5 +- .../migrated_0003/output.json | 5 +- .../migrated_0005/output.json | 5 +- .../migrated_0006/output.json | 5 +- .../invalid-trailing-comma/options.json | 2 +- .../test/fixtures/flow/tuples/3/output.json | 5 +- .../object-method-type-param-jsx/output.json | 7 ++- .../object-reserved-word/output.json | 5 +- scripts/tests/test262/test262_whitelist.txt | 10 +-- 46 files changed, 226 insertions(+), 100 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/input.js create 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-nested/input.js create 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/es2018/object-rest-spread/comma-after-spread-for-in/input.js create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/input.js create mode 100644 packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 812fa605a6af..cd090b1fc890 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -168,9 +168,6 @@ export default class ExpressionParser extends LValParser { } } - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - let failOnShorthandAssign; if (refShorthandDefaultPos) { failOnShorthandAssign = false; @@ -230,9 +227,6 @@ export default class ExpressionParser extends LValParser { ); } - if (patternErrorMsg) this.checkCommaAfterRestFromSpread(); - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - this.next(); node.right = this.parseMaybeAssign(noIn); return this.finishNode(node, "AssignmentExpression"); @@ -240,8 +234,6 @@ export default class ExpressionParser extends LValParser { this.unexpected(refShorthandDefaultPos.start); } - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; - return left; } @@ -680,14 +672,12 @@ export default class ExpressionParser extends LValParser { let node = this.startNodeAt(startPos, startLoc); node.callee = base; - const oldCommaAfterSpreadAt = this.state.commaAfterSpreadAt; - this.state.commaAfterSpreadAt = -1; - node.arguments = this.parseCallExpressionArguments( tt.parenR, state.maybeAsyncArrow, base.type === "Import", base.type !== "Super", + node, ); if (!state.optionalChainMember) { this.finishCallExpression(node); @@ -698,8 +688,6 @@ export default class ExpressionParser extends LValParser { if (state.maybeAsyncArrow && this.shouldParseAsyncArrow()) { state.stop = true; - this.checkCommaAfterRestFromSpread(); - node = this.parseAsyncArrowFromCallExpression( this.startNodeAt(startPos, startLoc), node, @@ -743,7 +731,6 @@ export default class ExpressionParser extends LValParser { } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.commaAfterSpreadAt = oldCommaAfterSpreadAt; return node; } else if (this.match(tt.backQuote)) { @@ -825,6 +812,7 @@ export default class ExpressionParser extends LValParser { possibleAsyncArrow: boolean, dynamicImport?: boolean, allowPlaceholder?: boolean, + nodeForExtra?: ?N.Node, ): $ReadOnlyArray { const elts = []; let innerParenStart; @@ -837,13 +825,21 @@ export default class ExpressionParser extends LValParser { first = false; } else { this.expect(tt.comma); - if (this.eat(close)) { + if (this.match(close)) { if (dynamicImport) { this.raise( this.state.lastTokStart, "Trailing comma is disallowed inside import(...) arguments", ); } + if (nodeForExtra) { + this.addExtra( + nodeForExtra, + "trailingComma", + this.state.lastTokStart, + ); + } + this.next(); break; } } @@ -883,7 +879,12 @@ export default class ExpressionParser extends LValParser { call: N.CallExpression, ): N.ArrowFunctionExpression { this.expect(tt.arrow); - this.parseArrowExpression(node, call.arguments, true); + this.parseArrowExpression( + node, + call.arguments, + true, + call.extra?.trailingComma, + ); return node; } @@ -1046,6 +1047,7 @@ export default class ExpressionParser extends LValParser { tt.bracketR, true, refShorthandDefaultPos, + node, ); if (!this.state.maybeInArrowParameters) { // This could be an array pattern: @@ -1289,7 +1291,7 @@ export default class ExpressionParser extends LValParser { ), ); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(charCodes.rightParenthesis); break; } else { @@ -1504,7 +1506,11 @@ export default class ExpressionParser extends LValParser { first = false; } else { this.expect(tt.comma); - if (this.eat(tt.braceR)) break; + if (this.match(tt.braceR)) { + this.addExtra(node, "trailingComma", this.state.lastTokStart); + this.next(); + break; + } } const prop = this.parseObjectMember(isPattern, refShorthandDefaultPos); @@ -1572,7 +1578,7 @@ export default class ExpressionParser extends LValParser { this.next(); // Don't use parseRestBinding() as we only allow Identifier here. prop.argument = this.parseIdentifier(); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(charCodes.rightCurlyBrace); return this.finishNode(prop, "RestElement"); } @@ -1856,6 +1862,7 @@ export default class ExpressionParser extends LValParser { node: N.ArrowFunctionExpression, params: ?(N.Expression[]), isAsync: boolean, + trailingCommaPos: ?number, ): N.ArrowFunctionExpression { this.scope.enter(functionFlags(isAsync, false) | SCOPE_ARROW); this.initFunction(node, isAsync); @@ -1867,7 +1874,7 @@ export default class ExpressionParser extends LValParser { this.state.yieldPos = -1; this.state.awaitPos = -1; - if (params) this.setArrowFunctionParameters(node, params); + if (params) this.setArrowFunctionParameters(node, params, trailingCommaPos); this.parseFunctionBody(node, true); this.scope.exit(); @@ -1881,11 +1888,13 @@ export default class ExpressionParser extends LValParser { setArrowFunctionParameters( node: N.ArrowFunctionExpression, params: N.Expression[], + trailingCommaPos: ?number, ): void { node.params = this.toAssignableList( params, true, "arrow function parameters", + trailingCommaPos, ); } @@ -2012,6 +2021,7 @@ export default class ExpressionParser extends LValParser { close: TokenType, allowEmpty?: boolean, refShorthandDefaultPos?: ?Pos, + nodeForExtra?: ?N.Node, ): $ReadOnlyArray { const elts = []; let first = true; @@ -2021,7 +2031,17 @@ export default class ExpressionParser extends LValParser { first = false; } else { this.expect(tt.comma); - if (this.eat(close)) break; + if (this.match(close)) { + if (nodeForExtra) { + this.addExtra( + nodeForExtra, + "trailingComma", + this.state.lastTokStart, + ); + } + this.next(); + break; + } } elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index b4281ab2ffb7..b9d98c3498ca 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -1,5 +1,6 @@ // @flow +import * as charCodes from "charcodes"; import { types as tt, type TokenType } from "../tokenizer/types"; import type { TSParameterProperty, @@ -60,6 +61,14 @@ export default class LValParser extends NodeUtils { const prop = node.properties[i]; const isLast = i === last; this.toAssignableObjectExpressionProp(prop, isBinding, isLast); + + if ( + isLast && + prop.type === "RestElement" && + node.extra?.trailingComma + ) { + this.raiseRestNotLast(node.extra.trailingComma); + } } break; @@ -78,7 +87,12 @@ export default class LValParser extends NodeUtils { case "ArrayExpression": node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding, contextDescription); + this.toAssignableList( + node.elements, + isBinding, + contextDescription, + node.extra?.trailingComma, + ); break; case "AssignmentExpression": @@ -142,6 +156,7 @@ export default class LValParser extends NodeUtils { exprList: Expression[], isBinding: ?boolean, contextDescription: string, + trailingCommaPos?: ?number, ): $ReadOnlyArray { let end = exprList.length; if (end) { @@ -160,6 +175,11 @@ export default class LValParser extends NodeUtils { ) { this.unexpected(arg.start); } + + if (trailingCommaPos) { + this.raiseTrailingCommaAfterRest(trailingCommaPos); + } + --end; } } @@ -213,11 +233,6 @@ export default class LValParser extends NodeUtils { undefined, refNeedsArrowPos, ); - - if (this.state.commaAfterSpreadAt === -1 && this.match(tt.comma)) { - this.state.commaAfterSpreadAt = this.state.start; - } - return this.finishNode(node, "SpreadElement"); } @@ -234,7 +249,11 @@ export default class LValParser extends NodeUtils { case tt.bracketL: { const node = this.startNode(); this.next(); - node.elements = this.parseBindingList(tt.bracketR, true); + node.elements = this.parseBindingList( + tt.bracketR, + charCodes.rightSquareBracket, + true, + ); return this.finishNode(node, "ArrayPattern"); } @@ -247,6 +266,7 @@ export default class LValParser extends NodeUtils { parseBindingList( close: TokenType, + closeCharCode: $Values, allowEmpty?: boolean, allowModifiers?: boolean, ): $ReadOnlyArray { @@ -265,7 +285,7 @@ export default class LValParser extends NodeUtils { break; } else if (this.match(tt.ellipsis)) { elts.push(this.parseAssignableListItemTypes(this.parseRestBinding())); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(closeCharCode); this.expect(close); break; } else { @@ -455,19 +475,21 @@ export default class LValParser extends NodeUtils { } } - checkCommaAfterRest(): void { + checkCommaAfterRest(close: $Values): void { if (this.match(tt.comma)) { - this.raiseRestNotLast(this.state.start); - } - } - - checkCommaAfterRestFromSpread(): void { - if (this.state.commaAfterSpreadAt > -1) { - this.raiseRestNotLast(this.state.commaAfterSpreadAt); + if (this.lookaheadCharCode() === close) { + this.raiseTrailingCommaAfterRest(this.state.start); + } else { + this.raiseRestNotLast(this.state.start); + } } } raiseRestNotLast(pos: number) { this.raise(pos, `Rest element must be last element`); } + + raiseTrailingCommaAfterRest(pos: number) { + this.raise(pos, `Unexpected trailing comma after rest element`); + } } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 8ce0c9d64418..ad7b8c0ab6a4 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1105,6 +1105,7 @@ export default class StatementParser extends ExpressionParser { this.expect(tt.parenL); node.params = this.parseBindingList( tt.parenR, + charCodes.rightParenthesis, /* allowEmpty */ false, allowModifiers, ); diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index c54f7b633d74..867c31243010 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -1798,6 +1798,7 @@ export default (superClass: Class): Class => ((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); @@ -1820,6 +1821,7 @@ export default (superClass: Class): Class => ((node.params: any): N.Expression[]), true, "arrow function parameters", + node.extra?.trailingComma, ); } return [arrows, []]; @@ -1831,6 +1833,7 @@ export default (superClass: Class): Class => ((node.params: any): N.Expression[]), true, "arrow function parameters", + node.extra?.trailingComma, ); return true; } catch (err) { @@ -2005,6 +2008,7 @@ export default (superClass: Class): Class => exprList: N.Expression[], isBinding: ?boolean, contextDescription: string, + trailingCommaPos?: ?number, ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; @@ -2012,7 +2016,12 @@ export default (superClass: Class): Class => exprList[i] = this.typeCastToParameter(expr); } } - return super.toAssignableList(exprList, isBinding, contextDescription); + return super.toAssignableList( + exprList, + isBinding, + contextDescription, + trailingCommaPos, + ); } // this is a list of nodes, from something like a call expression, we need to filter the diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 40292c5107c8..8adf82f1568a 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -363,21 +363,23 @@ export default (superClass: Class): Class => tsParseBindingListForSignature(): $ReadOnlyArray< N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern, > { - return this.parseBindingList(tt.parenR).map(pattern => { - if ( - pattern.type !== "Identifier" && - pattern.type !== "RestElement" && - pattern.type !== "ObjectPattern" && - pattern.type !== "ArrayPattern" - ) { - throw this.unexpected( - pattern.start, - "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + - `instead got ${pattern.type}`, - ); - } - return pattern; - }); + return this.parseBindingList(tt.parenR, charCodes.rightParenthesis).map( + pattern => { + if ( + pattern.type !== "Identifier" && + pattern.type !== "RestElement" && + pattern.type !== "ObjectPattern" && + pattern.type !== "ArrayPattern" + ) { + throw this.unexpected( + pattern.start, + "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern," + + `instead got ${pattern.type}`, + ); + } + return pattern; + }, + ); } tsParseTypeMemberSemicolon(): void { @@ -586,7 +588,7 @@ export default (superClass: Class): Class => const restNode: N.TsRestType = this.startNode(); this.next(); // skips ellipsis restNode.typeAnnotation = this.tsParseType(); - this.checkCommaAfterRest(); + this.checkCommaAfterRest(charCodes.rightSquareBracket); return this.finishNode(restNode, "TSRestType"); } @@ -2363,11 +2365,7 @@ export default (superClass: Class): Class => } } - toAssignableList( - exprList: N.Expression[], - isBinding: ?boolean, - contextDescription: string, - ): $ReadOnlyArray { + toAssignableList(exprList: N.Expression[]): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if (!expr) continue; @@ -2384,7 +2382,7 @@ export default (superClass: Class): Class => break; } } - return super.toAssignableList(exprList, isBinding, contextDescription); + return super.toAssignableList(...arguments); } typeCastToParameter(node: N.TsTypeCastExpression): N.Node { diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index a9dccb2bf0e6..4ee937e1d292 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -55,11 +55,6 @@ export default class State { // ^ noArrowParamsConversionAt: number[] = []; - // A comma after "...a" is only allowed in spread, but not in rest. - // Since we parse destructuring patterns as array/object literals - // and then convert them, we need to track it. - commaAfterSpreadAt: number = -1; - // Flags to track inParameters: boolean = false; maybeInArrowParameters: boolean = false; diff --git a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json index 90428301c81b..a1a531180079 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/array-expression-trailing-comma/output.json @@ -373,7 +373,10 @@ } ] } - ] + ], + "extra": { + "trailingComma": 140 + } } } ], @@ -494,7 +497,10 @@ } ] } - ] + ], + "extra": { + "trailingComma": 200 + } } } ], diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json index 3e22bc1678e5..b27cadb955a0 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json @@ -74,6 +74,9 @@ }, "name": "fn" }, + "extra": { + "trailingComma": 11 + }, "arguments": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json index 6147660b79f9..a224e1810b5d 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json @@ -74,6 +74,9 @@ }, "name": "fn" }, + "extra": { + "trailingComma": 7 + }, "arguments": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json index 5f2a5b29b779..8cf9693cb683 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-expression-trailing-comma/output.json @@ -181,6 +181,9 @@ } } ], + "extra": { + "trailingComma": 35 + }, "trailingComments": [ { "type": "CommentBlock", diff --git a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json index 82f13bbfed5e..1ab0eaed8cb3 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/object-property-trailing-comma/output.json @@ -309,7 +309,10 @@ } ] } - ] + ], + "extra": { + "trailingComma": 66 + } } } ], diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json index f081d1ee65fd..fac57ee10213 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json @@ -163,7 +163,10 @@ } ] } - ] + ], + "extra": { + "trailingComma": 13 + } } }, "trailingComments": [ diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json index 3f7e070ca3ac..d2f456d828ab 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json @@ -110,7 +110,10 @@ }, "value": 42 } - ] + ], + "extra": { + "trailingComma": 8 + } } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json index 573eda5bfa9f..0c39b167df03 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json @@ -150,7 +150,10 @@ }, "value": 3 } - ] + ], + "extra": { + "trailingComma": 13 + } } } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json index 34c8d7e15c8e..c2fec5bfcf25 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json @@ -151,7 +151,10 @@ }, "value": 3 } - ] + ], + "extra": { + "trailingComma": 14 + } } } } 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 index daa827f45cc4..7931fd924fcd 100644 --- 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 @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:5)" + "throws": "Unexpected trailing comma after rest element (1:5)" } diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/input.js b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/input.js new file mode 100644 index 000000000000..b58efbd91c33 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/input.js @@ -0,0 +1 @@ +for ([...a,] in []); 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 new file mode 100644 index 000000000000..0b0d3c532d1e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/options.json @@ -0,0 +1,3 @@ +{ + "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-nested/input.js b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/input.js new file mode 100644 index 000000000000..0e2c4750076e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/input.js @@ -0,0 +1 @@ +[[...a,]] = []; \ 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 new file mode 100644 index 000000000000..95a846d785a8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/options.json @@ -0,0 +1,3 @@ +{ + "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/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json index 5874666e2695..0a80d6e9f99b 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json @@ -90,7 +90,10 @@ "name": "a" } } - ] + ], + "extra": { + "trailingComma": 5 + } } } ], 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 65ed8c638978..38fec89ef15c 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": "Rest element must be last element (1:8)" + "throws": "Unexpected trailing comma after rest element (1:8)" } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json index 1749b8360656..68286e968b5c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json @@ -91,7 +91,10 @@ "name": "x" }, null - ] + ], + "extra": { + "trailingComma": 3 + } }, "right": { "type": "NumericLiteral", 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 index f686fb60b45e..bc7331763bfa 100644 --- 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 @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:11)" -} + "throws": "Unexpected trailing comma after rest element (1:11)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json index 2373fc85c177..40aa85102591 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json @@ -74,6 +74,9 @@ }, "name": "log" }, + "extra": { + "trailingComma": 13 + }, "arguments": [ { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json index 485e729af53e..6b852f78deea 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json @@ -183,7 +183,10 @@ "shorthand": true } } - ] + ], + "extra": { + "trailingComma": 10 + } }, "init": { "type": "Identifier", diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json index 1e1e8979748a..66bdc45dc975 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json @@ -289,6 +289,7 @@ } ], "extra": { + "trailingComma": 21, "parenthesized": true, "parenStart": 0 } 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 index c49db16e2821..c44d69275adb 100644 --- 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 @@ -1,3 +1,3 @@ { - "throws": "Rest element must be last element (1:16)" + "throws": "Unexpected trailing comma after rest element (1:16)" } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/input.js b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/input.js new file mode 100644 index 000000000000..f06e08484719 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/input.js @@ -0,0 +1 @@ +for ({...a,} in []); diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json new file mode 100644 index 000000000000..f14967a76c6c --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Rest element must be last element (1:10)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/input.js b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/input.js new file mode 100644 index 000000000000..d532e288fbaf --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/input.js @@ -0,0 +1 @@ +[{...a,}] = []; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json new file mode 100644 index 000000000000..9336eba62a3e --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Rest element must be last element (1:6)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json index ffb978345c27..2b3910bf3a5b 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json @@ -92,6 +92,7 @@ } ], "extra": { + "trailingComma": 6, "parenthesized": true, "parenStart": 0 } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json index 10c96101b155..2f49a3a77d71 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json @@ -78,7 +78,10 @@ "elements": [ null, null - ] + ], + "extra": { + "trailingComma": 3 + } } ], "body": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json index eebd569aa2e6..6032e42c2b32 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json @@ -75,7 +75,10 @@ "elements": [ null, null - ] + ], + "extra": { + "trailingComma": 2 + } }, "right": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json index d6a917129034..76754ed85da4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json @@ -166,6 +166,7 @@ } ], "extra": { + "trailingComma": 33, "parenthesized": true, "parenStart": 0 } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json index 0995b435bf70..cd0e7970cac6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json @@ -169,6 +169,7 @@ } ], "extra": { + "trailingComma": 35, "parenthesized": true, "parenStart": 0 } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json index 4f6c7b8f2be5..243668c0d0ad 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json @@ -128,7 +128,10 @@ "shorthand": true } } - ] + ], + "extra": { + "trailingComma": 6 + } }, "init": { "type": "NumericLiteral", diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json index 3f7e070ca3ac..d2f456d828ab 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json @@ -110,7 +110,10 @@ }, "value": 42 } - ] + ], + "extra": { + "trailingComma": 8 + } } } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json index 573eda5bfa9f..0c39b167df03 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json @@ -150,7 +150,10 @@ }, "value": 3 } - ] + ], + "extra": { + "trailingComma": 13 + } } } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json index 34c8d7e15c8e..c2fec5bfcf25 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json @@ -151,7 +151,10 @@ }, "value": 3 } - ] + ], + "extra": { + "trailingComma": 14 + } } } } 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 770750c7f91f..ae6f5f18ff31 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,3 @@ { - "throws": "Trailing comma is disallowed inside import(...) arguments (1:13)" + "throws": "Trailing comma is disallowed inside import(...) arguments (1:12)" } diff --git a/packages/babel-parser/test/fixtures/flow/tuples/3/output.json b/packages/babel-parser/test/fixtures/flow/tuples/3/output.json index 2c61f6b164a0..dada487fe124 100644 --- a/packages/babel-parser/test/fixtures/flow/tuples/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/tuples/3/output.json @@ -157,7 +157,10 @@ }, "value": 123 } - ] + ], + "extra": { + "trailingComma": 24 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json index 9cbc275b184b..5e5de02ff3c2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json @@ -187,7 +187,6 @@ "column": 23 } }, - "attributes": [], "name": { "type": "JSXIdentifier", "start": 29, @@ -204,6 +203,7 @@ }, "name": "Foo" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -263,7 +263,10 @@ ] } } - ] + ], + "extra": { + "trailingComma": 39 + } } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json index 5a8cfcc689b0..bd86fd173803 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json @@ -450,7 +450,10 @@ ] } } - ] + ], + "extra": { + "trailingComma": 77 + } } } ], diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 6ad39b56b688..977cd38ed79a 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -645,12 +645,4 @@ language/statements/class/elements/syntax/early-errors/invalid-names/method-outt language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(default) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) -language/statements/for-in/dstr/array-rest-before-elision.js(default) -language/statements/for-in/dstr/array-rest-before-elision.js(strict mode) -language/statements/for-in/dstr/array-rest-elision-invalid.js(default) -language/statements/for-in/dstr/array-rest-elision-invalid.js(strict mode) -language/statements/for-of/dstr/array-rest-before-elision.js(default) -language/statements/for-of/dstr/array-rest-before-elision.js(strict mode) -language/statements/for-of/dstr/array-rest-elision-invalid.js(default) -language/statements/for-of/dstr/array-rest-elision-invalid.js(strict mode) \ No newline at end of file +language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) \ No newline at end of file From 3ad4c70d3a0b391f16decf7b87a87165b0e39c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 9 Oct 2019 01:40:02 -0400 Subject: [PATCH 119/965] fix prepublish-build (#10530) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1b675f78db6d..757621cce370 100644 --- a/Makefile +++ b/Makefile @@ -179,7 +179,7 @@ clone-license: ./scripts/clone-license.sh prepublish-build: clean-lib clean-runtime-helpers - NODE_ENV=production BABEL_ENV=production $(MAKE) build-dist + NODE_ENV=production BABEL_ENV=production $(MAKE) build $(MAKE) clone-license prepublish: From 34d30e28d64603660214e96494f92d199385d3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 10 Oct 2019 16:03:49 +0200 Subject: [PATCH 120/965] Revert "chore: Upgrade source-map to 0.6.1 (#10446)" (#10536) This reverts commit cc080417b995e2903352e7956890e0c74b23d4c9. --- packages/babel-cli/package.json | 2 +- packages/babel-core/package.json | 2 +- packages/babel-generator/package.json | 2 +- .../babel-helper-transform-fixture-test-runner/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 41ca75cbaf72..4d4e472a5b8a 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -27,7 +27,7 @@ "mkdirp": "^0.5.1", "output-file-sync": "^2.0.0", "slash": "^2.0.0", - "source-map": "^0.6.1" + "source-map": "^0.5.0" }, "optionalDependencies": { "chokidar": "^2.1.8" diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index b78462ffc28b..53e09d837015 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -46,7 +46,7 @@ "lodash": "^4.17.13", "resolve": "^1.3.2", "semver": "^5.4.1", - "source-map": "^0.6.1" + "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-transform-fixture-test-runner": "^7.6.3" diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 8f24e09d2310..2f913b7ef870 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -17,7 +17,7 @@ "@babel/types": "^7.6.3", "jsesc": "^2.5.1", "lodash": "^4.17.13", - "source-map": "^0.6.1" + "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 4d4ccd25ba01..a82416b9784a 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -20,6 +20,6 @@ "jest-diff": "^24.8.0", "lodash": "^4.17.13", "resolve": "^1.3.2", - "source-map": "^0.6.1" + "source-map": "^0.5.0" } } From a422ea64ee2208a55dda33f990a422e14b917f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 10 Oct 2019 16:25:04 +0200 Subject: [PATCH 121/965] v7.6.4 --- lerna.json | 2 +- packages/babel-cli/package.json | 4 ++-- packages/babel-core/package.json | 8 ++++---- packages/babel-generator/package.json | 4 ++-- .../package.json | 4 ++-- packages/babel-parser/package.json | 2 +- packages/babel-standalone/package.json | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lerna.json b/lerna.json index c6f0ba10f683..551e14079f47 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.6.3", + "version": "7.6.4", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 4d4e472a5b8a..4e42d3ca83e5 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.6.3", + "version": "7.6.4", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -36,7 +36,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.6.4", "@babel/helper-fixtures": "^7.6.3" }, "bin": { diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 53e09d837015..f4dd6723634d 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.6.3", + "version": "7.6.4", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,9 +34,9 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", + "@babel/generator": "^7.6.4", "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.3", + "@babel/parser": "^7.6.4", "@babel/template": "^7.6.0", "@babel/traverse": "^7.6.3", "@babel/types": "^7.6.3", @@ -49,6 +49,6 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.6.3" + "@babel/helper-transform-fixture-test-runner": "^7.6.4" } } diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 2f913b7ef870..92dc51d1bda9 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.6.3", + "version": "7.6.4", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -21,6 +21,6 @@ }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.6.3" + "@babel/parser": "^7.6.4" } } diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index a82416b9784a..6622b66cad9f 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.6.3", + "version": "7.6.4", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.6.3", + "@babel/core": "^7.6.4", "@babel/helper-fixtures": "^7.6.3", "@babel/polyfill": "^7.6.0", "babel-check-duplicated-nodes": "^1.0.0", diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index b0758e260a64..3760270b1672 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.6.3", + "version": "7.6.4", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 7da9e3a66efb..77ae93d4e30e 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.6.3", + "version": "7.6.4", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -9,7 +9,7 @@ "src" ], "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.6.4", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", "@babel/plugin-proposal-async-generator-functions": "^7.2.0", From c455d2af8695d1268710172089503d53e5e2a758 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Thu, 10 Oct 2019 14:30:50 +0000 Subject: [PATCH 122/965] Add v7.6.4 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4927c261c8a4..9689c1be5cb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.6.4 (2019-10-10) + +#### :eyeglasses: Spec Compliance +* `babel-parser` + * [#10491](https://github.com/babel/babel/pull/10491) Trailing comma after rest - The final fix ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :bug: Bug Fix +* `babel-cli`, `babel-core`, `babel-generator`, `babel-helper-transform-fixture-test-runner` + * [#10536](https://github.com/babel/babel/pull/10536) Revert "chore: Upgrade source-map to 0.6.1 (#10446)" ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.6.3 (2019-10-08) #### :eyeglasses: Spec Compliance From 99035ca96e4b0b22b68464b5c2800e90e3b65dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 11 Oct 2019 10:18:54 +0200 Subject: [PATCH 123/965] Don't use args rest/spread to hoist super method calls (#9939) * Don't use args rest/spread to hoist super method calls * Hoist this in hoisted super method calls * Make the code more readable Review by edoardocavazza --- .../deeply-nested-asyncs/output.js | 4 +- .../object-method-with-super/output.js | 7 +- .../plugins-integration/issue-9935/input.js | 7 + .../issue-9935/options.json | 16 ++ .../plugins-integration/issue-9935/output.js | 19 +++ .../babel-traverse/src/path/conversion.js | 137 +++++++----------- .../babel-traverse/test/arrow-transform.js | 34 ++++- 7 files changed, 129 insertions(+), 95 deletions(-) create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/input.js create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/options.json create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/output.js diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/deeply-nested-asyncs/output.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/deeply-nested-asyncs/output.js index a5914b25f780..c6437ce0bb15 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/deeply-nested-asyncs/output.js +++ b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/deeply-nested-asyncs/output.js @@ -4,8 +4,8 @@ function s(_x) { function _s() { _s = babelHelpers.asyncToGenerator(function* (x) { - var _this = this, - _arguments = arguments; + var _arguments = arguments, + _this = this; for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-super/output.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-super/output.js index c8bccac252f7..6e26d643e065 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-super/output.js +++ b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/object-method-with-super/output.js @@ -1,11 +1,12 @@ class Foo extends class {} { method() { - var _superprop_callMethod = (..._args) => super.method(..._args); + var _superprop_getMethod = () => super.method, + _this = this; return babelHelpers.asyncToGenerator(function* () { - _superprop_callMethod(); + _superprop_getMethod().call(_this); - var arrow = () => _superprop_callMethod(); + var arrow = () => _superprop_getMethod().call(_this); })(); } diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/input.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/input.js new file mode 100644 index 000000000000..af57902922e0 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/input.js @@ -0,0 +1,7 @@ +class MyClass extends BaseClass { + async loadEntity() { + this.website = await this.loadWebsite(); + this.report.setCompany(this.website.company); + super.loadEntity(); + } +} diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/options.json new file mode 100644 index 000000000000..70f242c2ca72 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/options.json @@ -0,0 +1,16 @@ +{ + "presets": [ + [ + "env", + { + "targets": [ + "Chrome >= 60", + "Safari >= 11", + "iOS >= 10.3", + "Firefox >= 55", + "Edge >= 16" + ] + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/output.js new file mode 100644 index 000000000000..c955d4e85a46 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-9935/output.js @@ -0,0 +1,19 @@ +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); }); }; } + +class MyClass extends BaseClass { + loadEntity() { + var _superprop_getLoadEntity = () => super.loadEntity, + _this = this; + + return _asyncToGenerator(function* () { + _this.website = yield _this.loadWebsite(); + + _this.report.setCompany(_this.website.company); + + _superprop_getLoadEntity().call(_this); + })(); + } + +} diff --git a/packages/babel-traverse/src/path/conversion.js b/packages/babel-traverse/src/path/conversion.js index 99a2b00a733c..fd149535441a 100644 --- a/packages/babel-traverse/src/path/conversion.js +++ b/packages/babel-traverse/src/path/conversion.js @@ -216,30 +216,6 @@ function hoistFunctionEnvironment( }); } - // Convert all "this" references in the arrow to point at the alias. - let thisBinding; - if (thisPaths.length > 0 || specCompliant) { - thisBinding = getThisBinding(thisEnvFn, inConstructor); - - if ( - !specCompliant || - // In subclass constructors, still need to rewrite because "this" can't be bound in spec mode - // because it might not have been initialized yet. - (inConstructor && hasSuperClass(thisEnvFn)) - ) { - thisPaths.forEach(thisChild => { - const thisRef = thisChild.isJSX() - ? t.jsxIdentifier(thisBinding) - : t.identifier(thisBinding); - - thisRef.loc = thisChild.node.loc; - thisChild.replaceWith(thisRef); - }); - - if (specCompliant) thisBinding = null; - } - } - // Convert all "arguments" references in the arrow to point at the alias. if (argumentsPaths.length > 0) { const argumentsBinding = getBinding(thisEnvFn, "arguments", () => @@ -286,42 +262,64 @@ function hoistFunctionEnvironment( ? "" : superProp.get("property").node.name; - if (superProp.parentPath.isCallExpression({ callee: superProp.node })) { - const superBinding = getSuperPropCallBinding(thisEnvFn, key); + const isAssignment = superProp.parentPath.isAssignmentExpression({ + left: superProp.node, + }); + const isCall = superProp.parentPath.isCallExpression({ + callee: superProp.node, + }); + const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); + + const args = []; + if (superProp.node.computed) { + args.push(superProp.get("property").node); + } + + if (isAssignment) { + const value = superProp.parentPath.node.right; + args.push(value); + } + + const call = t.callExpression(t.identifier(superBinding), args); - if (superProp.node.computed) { - const prop = superProp.get("property").node; - superProp.replaceWith(t.identifier(superBinding)); - superProp.parentPath.node.arguments.unshift(prop); - } else { - superProp.replaceWith(t.identifier(superBinding)); - } + if (isCall) { + superProp.parentPath.unshiftContainer("arguments", t.thisExpression()); + superProp.replaceWith(t.memberExpression(call, t.identifier("call"))); + + thisPaths.push(superProp.parentPath.get("arguments.0")); + } else if (isAssignment) { + // Replace not only the super.prop, but the whole assignment + superProp.parentPath.replaceWith(call); } else { - const isAssignment = superProp.parentPath.isAssignmentExpression({ - left: superProp.node, - }); - const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key); - - const args = []; - if (superProp.node.computed) { - args.push(superProp.get("property").node); - } - - if (isAssignment) { - const value = superProp.parentPath.node.right; - args.push(value); - superProp.parentPath.replaceWith( - t.callExpression(t.identifier(superBinding), args), - ); - } else { - superProp.replaceWith( - t.callExpression(t.identifier(superBinding), args), - ); - } + superProp.replaceWith(call); } }); } + // Convert all "this" references in the arrow to point at the alias. + let thisBinding; + if (thisPaths.length > 0 || specCompliant) { + thisBinding = getThisBinding(thisEnvFn, inConstructor); + + if ( + !specCompliant || + // In subclass constructors, still need to rewrite because "this" can't be bound in spec mode + // because it might not have been initialized yet. + (inConstructor && hasSuperClass(thisEnvFn)) + ) { + thisPaths.forEach(thisChild => { + const thisRef = thisChild.isJSX() + ? t.jsxIdentifier(thisBinding) + : t.identifier(thisBinding); + + thisRef.loc = thisChild.node.loc; + thisChild.replaceWith(thisRef); + }); + + if (specCompliant) thisBinding = null; + } + } + return thisBinding; } @@ -485,37 +483,6 @@ function getSuperBinding(thisEnvFn) { }); } -// Create a binding for a function that will call "super.foo()" or "super[foo]()". -function getSuperPropCallBinding(thisEnvFn, propName) { - return getBinding(thisEnvFn, `superprop_call:${propName || ""}`, () => { - const argsBinding = thisEnvFn.scope.generateUidIdentifier("args"); - const argsList = [t.restElement(argsBinding)]; - - let fnBody; - if (propName) { - // (...args) => super.foo(...args) - fnBody = t.callExpression( - t.memberExpression(t.super(), t.identifier(propName)), - [t.spreadElement(t.identifier(argsBinding.name))], - ); - } else { - const method = thisEnvFn.scope.generateUidIdentifier("prop"); - // (method, ...args) => super[method](...args) - argsList.unshift(method); - fnBody = t.callExpression( - t.memberExpression( - t.super(), - t.identifier(method.name), - true /* computed */, - ), - [t.spreadElement(t.identifier(argsBinding.name))], - ); - } - - return t.arrowFunctionExpression(argsList, fnBody); - }); -} - // Create a binding for a function that will call "super.foo" or "super[foo]". function getSuperPropBinding(thisEnvFn, isAssignment, propName) { const op = isAssignment ? "set" : "get"; diff --git a/packages/babel-traverse/test/arrow-transform.js b/packages/babel-traverse/test/arrow-transform.js index f21ba52ac3ec..fdeeb4bd66de 100644 --- a/packages/babel-traverse/test/arrow-transform.js +++ b/packages/babel-traverse/test/arrow-transform.js @@ -539,7 +539,7 @@ describe("arrow function conversion", () => { ); }); - it("should convert super.prop() calls", () => { + it("should convert super.prop() calls without params", () => { assertConversion( ` () => { @@ -549,10 +549,11 @@ describe("arrow function conversion", () => { () => super.foo(); `, ` - var _superprop_callFoo = (..._args) => super.foo(..._args); + var _superprop_getFoo = () => super.foo, + _this = this; (function () { - _superprop_callFoo(); + _superprop_getFoo().call(_this); }); super.foo(); () => super.foo(); @@ -560,6 +561,28 @@ describe("arrow function conversion", () => { ); }); + it("should convert super.prop() calls with params", () => { + assertConversion( + ` + () => { + super.foo(a, b, ...c); + }; + super.foo(a, b, ...c); + () => super.foo(a, b, ...c); + `, + ` + var _superprop_getFoo = () => super.foo, + _this = this; + + (function () { + _superprop_getFoo().call(_this, a, b, ...c); + }); + super.foo(a, b, ...c); + () => super.foo(a, b, ...c); + `, + ); + }); + it("should convert super[prop]() calls", () => { assertConversion( ` @@ -570,10 +593,11 @@ describe("arrow function conversion", () => { () => super[foo](); `, ` - var _superprop_call = (_prop, ..._args) => super[_prop](..._args); + var _superprop_get = _prop => super[_prop], + _this = this; (function () { - _superprop_call(foo); + _superprop_get(foo).call(_this); }); super[foo](); () => super[foo](); From e28c8ac612e2a39147b92cfd97307469a007ab44 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 11 Oct 2019 20:22:42 -0500 Subject: [PATCH 124/965] Fix generator missing parens around an arrow returning function type (#10519) --- packages/babel-generator/src/node/parentheses.js | 12 ++++++++++-- .../test/fixtures/flow/arrow-functions/input.js | 1 + .../test/fixtures/flow/arrow-functions/output.js | 4 +++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/babel-generator/src/node/parentheses.js b/packages/babel-generator/src/node/parentheses.js index 8c38fa627239..0a1ab115c529 100644 --- a/packages/babel-generator/src/node/parentheses.js +++ b/packages/babel-generator/src/node/parentheses.js @@ -35,14 +35,22 @@ export function NullableTypeAnnotation(node: Object, parent: Object): boolean { return t.isArrayTypeAnnotation(parent); } -export function FunctionTypeAnnotation(node: Object, parent: Object): boolean { +export function FunctionTypeAnnotation( + node: Object, + parent: Object, + printStack: Array, +): boolean { return ( // (() => A) | (() => B) t.isUnionTypeAnnotation(parent) || // (() => A) & (() => B) t.isIntersectionTypeAnnotation(parent) || // (() => A)[] - t.isArrayTypeAnnotation(parent) + t.isArrayTypeAnnotation(parent) || + // (A: T): (T => T[]) => B => [A, B] + (t.isTypeAnnotation(parent) && + // Check grandparent + t.isArrowFunctionExpression(printStack[printStack.length - 3])) ); } diff --git a/packages/babel-generator/test/fixtures/flow/arrow-functions/input.js b/packages/babel-generator/test/fixtures/flow/arrow-functions/input.js index a3d11b136d6b..5719c2dbf087 100644 --- a/packages/babel-generator/test/fixtures/flow/arrow-functions/input.js +++ b/packages/babel-generator/test/fixtures/flow/arrow-functions/input.js @@ -5,3 +5,4 @@ const bar4 = x => {}; const bar5 = (x): string => {}; const bar6 = (x: number) => {}; const bar7 = (x) => {}; +const bar8 = (x: T): (T => T[]) => y => [x, y]; diff --git a/packages/babel-generator/test/fixtures/flow/arrow-functions/output.js b/packages/babel-generator/test/fixtures/flow/arrow-functions/output.js index 8b1f78020541..d132971e4bcf 100644 --- a/packages/babel-generator/test/fixtures/flow/arrow-functions/output.js +++ b/packages/babel-generator/test/fixtures/flow/arrow-functions/output.js @@ -10,4 +10,6 @@ const bar5 = (x): string => {}; const bar6 = (x: number) => {}; -const bar7 = (x) => {}; \ No newline at end of file +const bar7 = (x) => {}; + +const bar8 = (x: T): ((T) => T[]) => y => [x, y]; From 1b19608a5ab5a7711c398e70747a6f084fbefe57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 14 Oct 2019 00:59:02 +0200 Subject: [PATCH 125/965] Update fixtures for core-js new version --- .../test/fixtures/corejs3/entry-all-chrome-71/output.mjs | 1 + .../test/fixtures/corejs3/entry-chrome-48/output.mjs | 1 + .../test/fixtures/corejs3/entry-chrome-49/output.mjs | 1 + .../test/fixtures/corejs3/entry-chrome-66/output.mjs | 3 +++ .../test/fixtures/corejs3/entry-chrome-71/output.mjs | 1 + .../test/fixtures/corejs3/entry-chromeandroid/output.mjs | 1 + .../test/fixtures/corejs3/entry-electron/output.mjs | 1 + .../entry-entries-es-proposals-stage-chrome-71/output.mjs | 1 + .../test/fixtures/corejs3/entry-import/output.mjs | 1 + .../test/fixtures/corejs3/entry-node-10.13/output.mjs | 1 + .../test/fixtures/corejs3/entry-node-11/output.mjs | 1 + .../test/fixtures/corejs3/entry-node-web/output.mjs | 1 + .../test/fixtures/corejs3/entry-node/output.mjs | 1 + .../test/fixtures/corejs3/entry-require-all/output.js | 2 ++ .../test/fixtures/corejs3/entry-require-es-chrome-71/output.js | 2 ++ .../test/fixtures/corejs3/entry-require-es-proposals/output.js | 2 ++ .../test/fixtures/corejs3/entry-require/output.js | 2 ++ .../test/fixtures/corejs3/entry-stable-chrome-71/output.mjs | 1 + .../test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs | 3 +++ .../test/fixtures/corejs3/exclude-built-ins/output.mjs | 3 +++ .../test/fixtures/corejs3/exclude-include/output.mjs | 1 + .../test/fixtures/corejs3/force-all-transforms/output.mjs | 1 + .../test/fixtures/corejs3/include-built-ins/output.mjs | 1 + .../test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt | 1 + .../test/fixtures/debug/entry-corejs3-electron/stdout.txt | 1 + .../test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt | 1 + .../debug/entry-corejs3-es-proposals-chrome-71/stdout.txt | 1 + .../debug/entry-corejs3-force-all-transforms/stdout.txt | 1 + .../fixtures/debug/entry-corejs3-specific-targets/stdout.txt | 2 +- .../fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt | 1 + .../fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt | 3 +++ .../fixtures/debug/entry-corejs3-versions-decimals/stdout.txt | 2 +- .../debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt | 2 +- .../debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt | 2 +- .../fixtures/debug/entry-corejs3-versions-strings/stdout.txt | 2 +- .../test/fixtures/debug/entry-corejs3/stdout.txt | 2 +- packages/babel-runtime-corejs3/test/index.spec.js | 2 +- 37 files changed, 49 insertions(+), 7 deletions(-) diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs index 5e6fe80b6a9a..efa4728cac88 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs @@ -1,5 +1,6 @@ import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/esnext.aggregate-error"; import "core-js/modules/esnext.array.last-index"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs index 4714da27c5b2..064f9d4a4469 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs @@ -28,6 +28,7 @@ import "core-js/modules/es.function.has-instance"; import "core-js/modules/es.json.to-string-tag"; import "core-js/modules/es.map"; import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.math.to-string-tag"; import "core-js/modules/es.object.assign"; import "core-js/modules/es.object.define-getter"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs index d38ec2742978..add5d817c3ca 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs @@ -26,6 +26,7 @@ import "core-js/modules/es.function.has-instance"; import "core-js/modules/es.json.to-string-tag"; import "core-js/modules/es.map"; import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.math.to-string-tag"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs index f367b9447dc2..8051a9cde054 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs @@ -3,12 +3,15 @@ import "core-js/modules/es.array.flat"; import "core-js/modules/es.array.flat-map"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/es.promise"; import "core-js/modules/es.promise.finally"; import "core-js/modules/web.immediate"; import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs index e7e57e8ebb0d..7ff494cd47e4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs @@ -1,5 +1,6 @@ import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/web.immediate"; const foo = { diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs index e3be757cb2a9..929415b8b20e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs index daf15be68f3a..34a798940e85 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs index 31397143f89d..be5df68026ae 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs @@ -1,5 +1,6 @@ import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/esnext.aggregate-error"; import "core-js/modules/esnext.array.last-index"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs index f891a16256c3..1332106cce0a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs index ff125b389f5e..dd8a2c20f45c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs @@ -3,5 +3,6 @@ import "core-js/modules/es.array.flat"; import "core-js/modules/es.array.flat-map"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/web.queue-microtask"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs index d8b2d0eb8b78..db959e64958b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs @@ -1,4 +1,5 @@ import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/web.queue-microtask"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs index d5e59efa8f02..cd01fb3f1a40 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs index 87a92e7348c0..a3a45d940508 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js index 7a80df8b9bb7..788e39cdfeb8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js @@ -14,6 +14,8 @@ require("core-js/modules/es.array.unscopables.flat"); require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.math.hypot"); + require("core-js/modules/es.object.define-getter"); require("core-js/modules/es.object.define-setter"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js index af7ecd4cda07..ca0c13b8c25b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js @@ -2,6 +2,8 @@ require("core-js/modules/es.array.unscopables.flat"); require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.math.hypot"); + require("core-js/modules/es.object.from-entries"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js index 2507fd832b3d..72ba892bc13d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js @@ -14,6 +14,8 @@ require("core-js/modules/es.array.unscopables.flat"); require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.math.hypot"); + require("core-js/modules/es.object.define-getter"); require("core-js/modules/es.object.define-setter"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js index 49aa2d8f4ca3..974ad1fee63b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js @@ -14,6 +14,8 @@ require("core-js/modules/es.array.unscopables.flat"); require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.math.hypot"); + require("core-js/modules/es.object.define-getter"); require("core-js/modules/es.object.define-setter"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs index de648a923f2b..521c32b6f351 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs @@ -1,4 +1,5 @@ import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/web.immediate"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs index b55987d82a9f..e99fb491804b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs @@ -4,6 +4,7 @@ import "core-js/modules/es.array.flat-map"; import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/es.promise"; import "core-js/modules/es.promise.finally"; @@ -13,4 +14,6 @@ import "core-js/modules/es.string.trim-start"; import "core-js/modules/web.dom-collections.iterator"; import "core-js/modules/web.immediate"; import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs index 8dc8ff014a4c..cb63c2cc360c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs @@ -4,6 +4,7 @@ import "core-js/modules/es.array.flat-map"; import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.from-entries"; import "core-js/modules/es.promise"; import "core-js/modules/es.promise.finally"; @@ -11,4 +12,6 @@ import "core-js/modules/es.string.replace"; import "core-js/modules/es.string.trim-end"; import "core-js/modules/es.string.trim-start"; import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs index e116abf02cf1..170d86bd7cae 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs @@ -7,6 +7,7 @@ import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; import "core-js/modules/es.map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs index 698280d4465c..acdf857cf0e3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs @@ -6,6 +6,7 @@ import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs index 504b23702786..49a4b1893150 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs @@ -7,6 +7,7 @@ import "core-js/modules/es.array.sort"; import "core-js/modules/es.array.unscopables.flat"; import "core-js/modules/es.array.unscopables.flat-map"; import "core-js/modules/es.map"; +import "core-js/modules/es.math.hypot"; import "core-js/modules/es.object.define-getter"; import "core-js/modules/es.object.define-setter"; import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt index d09bcf36bfe8..6b47f470f6aa 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt @@ -20,6 +20,7 @@ Using polyfills with `entry` option: [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } + es.math.hypot { "chrome":"71" } es.object.from-entries { "chrome":"71" } esnext.aggregate-error { "chrome":"71" } esnext.array.last-index { "chrome":"71" } 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 5445a52fdfa9..85026b3df8e2 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 @@ -71,6 +71,7 @@ Using polyfills with `entry` option: es.json.to-string-tag { "electron":"0.36" } es.map { "electron":"0.36" } es.math.acosh { "electron":"0.36" } + es.math.hypot { "electron":"0.36" } es.math.to-string-tag { "electron":"0.36" } es.object.assign { "electron":"0.36" } es.object.define-getter { "electron":"0.36" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt index 99d49d29aacb..b3751d6de895 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt @@ -20,6 +20,7 @@ Using polyfills with `entry` option: [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } + es.math.hypot { "chrome":"71" } es.object.from-entries { "chrome":"71" } [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/input.mjs] Based on your targets, regenerator-runtime import excluded. diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt index b33a091e4a0c..179cbc24c06f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt @@ -20,6 +20,7 @@ Using polyfills with `entry` option: [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } + es.math.hypot { "chrome":"71" } es.object.from-entries { "chrome":"71" } esnext.aggregate-error { "chrome":"71" } esnext.array.last-index { "chrome":"71" } 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 f367d425aa6a..dbc3ba935e3e 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 @@ -53,6 +53,7 @@ Using polyfills with `entry` option: es.array.sort { "chrome":"55" } es.array.unscopables.flat { "chrome":"55" } es.array.unscopables.flat-map { "chrome":"55" } + es.math.hypot { "chrome":"55" } es.object.define-getter { "chrome":"55" } es.object.define-setter { "chrome":"55" } es.object.from-entries { "chrome":"55" } 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 343730b312a9..a1a20c2c2999 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 @@ -110,7 +110,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10", "safari":"7" } es.math.expm1 { "ie":"10", "safari":"7" } es.math.fround { "ie":"10", "safari":"7" } - es.math.hypot { "ie":"10", "safari":"7" } + es.math.hypot { "chrome":"54", "ie":"10", "safari":"7" } es.math.imul { "ie":"10", "safari":"7" } es.math.log10 { "ie":"10", "safari":"7" } es.math.log1p { "ie":"10", "safari":"7" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt index f205f4ee7e90..e1ad31ad13ab 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt @@ -20,6 +20,7 @@ Using polyfills with `entry` option: [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/input.mjs] Replaced core-js entries with the following polyfills: es.array.unscopables.flat { "chrome":"71" } es.array.unscopables.flat-map { "chrome":"71" } + es.math.hypot { "chrome":"71" } es.object.from-entries { "chrome":"71" } web.immediate { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt index 521763cfccd9..7cff00543450 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt @@ -26,6 +26,7 @@ Using polyfills with `entry` option: es.array.iterator { "samsung":"8.2" } es.array.unscopables.flat { "samsung":"8.2" } es.array.unscopables.flat-map { "samsung":"8.2" } + es.math.hypot { "samsung":"8.2" } es.object.from-entries { "samsung":"8.2" } es.promise { "samsung":"8.2" } es.promise.finally { "samsung":"8.2" } @@ -35,6 +36,8 @@ Using polyfills with `entry` option: web.dom-collections.iterator { "samsung":"8.2" } web.immediate { "samsung":"8.2" } web.queue-microtask { "samsung":"8.2" } + web.url { "samsung":"8.2" } web.url.to-json { "samsung":"8.2" } + web.url-search-params { "samsung":"8.2" } [/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/input.mjs] Based on your targets, regenerator-runtime import excluded. 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 ac4e78a5e55a..efcedad873c6 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 @@ -108,7 +108,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10" } es.math.expm1 { "ie":"10" } es.math.fround { "ie":"10" } - es.math.hypot { "ie":"10" } + es.math.hypot { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } es.math.imul { "ie":"10" } es.math.log10 { "ie":"10" } es.math.log1p { "ie":"10" } 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 3e1c3e4cb655..af5f0f9ffe87 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 @@ -95,7 +95,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10" } es.math.expm1 { "ie":"10" } es.math.fround { "ie":"10" } - es.math.hypot { "ie":"10" } + es.math.hypot { "chrome":"54", "ie":"10", "node":"6.10" } es.math.imul { "ie":"10" } es.math.log10 { "ie":"10" } es.math.log1p { "ie":"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 39329f1c54b4..c74e3e37cb55 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 @@ -96,7 +96,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10" } es.math.expm1 { "ie":"10" } es.math.fround { "ie":"10" } - es.math.hypot { "ie":"10" } + es.math.hypot { "chrome":"54", "ie":"10", "node":"6.10" } es.math.imul { "ie":"10" } es.math.log10 { "ie":"10" } es.math.log1p { "ie":"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 be2c12299d4a..caff30ef4984 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 @@ -95,7 +95,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10" } es.math.expm1 { "ie":"10" } es.math.fround { "ie":"10" } - es.math.hypot { "ie":"10" } + es.math.hypot { "chrome":"54", "ie":"10", "node":"6.10" } es.math.imul { "ie":"10" } es.math.log10 { "ie":"10" } es.math.log1p { "ie":"10" } 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 892118c99f83..b337515f602d 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 @@ -97,7 +97,7 @@ Using polyfills with `entry` option: es.math.cosh { "ie":"10" } es.math.expm1 { "ie":"10" } es.math.fround { "ie":"10" } - es.math.hypot { "ie":"10" } + es.math.hypot { "chrome":"54", "ie":"10", "node":"6" } es.math.imul { "ie":"10" } es.math.log10 { "ie":"10" } es.math.log1p { "ie":"10" } diff --git a/packages/babel-runtime-corejs3/test/index.spec.js b/packages/babel-runtime-corejs3/test/index.spec.js index 5f58d25022aa..88af741b9b43 100644 --- a/packages/babel-runtime-corejs3/test/index.spec.js +++ b/packages/babel-runtime-corejs3/test/index.spec.js @@ -274,7 +274,7 @@ describe("babel-runtime", () => { it("matchAll, exists", () => { expect( - typeof require("../core-js/instance/match-all")("").call("qwe", /./).next, + typeof require("../core-js/instance/match-all")("").call("qwe", /./g).next, ).toEqual("function"); }); From dcf7d89b8e9b6b364aae17652f94a4f0d3fe0950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 14 Oct 2019 12:19:55 -0400 Subject: [PATCH 126/965] fix: remove filename annotation in buildCodeFrameError (#10539) --- .../src/transformation/file/file.js | 2 -- .../plugins/build-code-frame-error/exec.js | 32 ++++++++++--------- .../build-code-frame-error/options.json | 3 -- 3 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json diff --git a/packages/babel-core/src/transformation/file/file.js b/packages/babel-core/src/transformation/file/file.js index 2adb6e775763..1aa6070c73c2 100644 --- a/packages/babel-core/src/transformation/file/file.js +++ b/packages/babel-core/src/transformation/file/file.js @@ -259,8 +259,6 @@ export default class File { ): Error { let loc = node && (node.loc || node._loc); - msg = `${this.opts.filename ?? "unknown"}: ${msg}`; - if (!loc && node) { const state = { loc: null, diff --git a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/exec.js b/packages/babel-core/test/fixtures/plugins/build-code-frame-error/exec.js index 3462e87a1932..0b56fb9bfb43 100644 --- a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/exec.js +++ b/packages/babel-core/test/fixtures/plugins/build-code-frame-error/exec.js @@ -1,16 +1,18 @@ -var code = "function f() {}"; -transform(code, { - plugins: [ - function() { - return { - visitor: { - FunctionDeclaration: function(path) { - throw path.buildCodeFrameError("someMsg"); +expect(() => { + var code = "function f() {}"; + transform(code, { + plugins: [ + function() { + return { + visitor: { + FunctionDeclaration: function(path) { + throw path.buildCodeFrameError("someMsg"); + }, }, - }, - }; - }, - ], - // hard to assert on ANSI escape codes - highlightCode: false, -}); + }; + }, + ], + // hard to assert on ANSI escape codes + highlightCode: false, + }); +}).toThrow(/^unknown: someMsg\s+> 1 \| function f\(\) {}/); diff --git a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json b/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json deleted file mode 100644 index 96fe5df0c4e2..000000000000 --- a/packages/babel-core/test/fixtures/plugins/build-code-frame-error/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "unknown: someMsg\n> 1 | function f() {}" -} From 06313a62881a5915c67d276fb51e5c3fe4521e3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1nchez?= Date: Mon, 14 Oct 2019 16:18:33 -0600 Subject: [PATCH 127/965] Allow duplicate __proto__ keys in patterns, simple case (#6705) (#10532) * Allow duplicate __proto__ keys in patterns, simple case (#6705) * Update test262 whitelist * Rename checkDuplicatedProto's parameter and adjust type * Store first __proto__ redefinition's position --- .../babel-parser/src/parser/expression.js | 25 ++- packages/babel-parser/src/plugins/estree.js | 12 +- .../destructuring/duplicate-proto/input.js | 1 + .../destructuring/duplicate-proto/output.json | 207 ++++++++++++++++++ scripts/tests/test262/test262_whitelist.txt | 2 - 5 files changed, 230 insertions(+), 17 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/input.js create mode 100644 packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index cd090b1fc890..556ac6daa7be 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -67,14 +67,13 @@ export default class ExpressionParser extends LValParser { +parseFunctionParams: (node: N.Function, allowModifiers?: boolean) => void; +takeDecorators: (node: N.HasDecorators) => void; - // Check if property name clashes with already added. - // Object/class getters and setters are not allowed to clash — - // either with each other or with an init property — and in - // strict mode, init properties are also not allowed to be repeated. + // Check if property __proto__ has been used more than once. + // If the expression is a destructuring assignment, then __proto__ may appear + // multiple times. Otherwise, __proto__ is a duplicated key. - checkPropClash( + checkDuplicatedProto( prop: N.ObjectMember | N.SpreadElement, - propHash: { [key: string]: boolean }, + protoRef: { used: boolean, start?: number }, ): void { if ( prop.type === "SpreadElement" || @@ -91,10 +90,12 @@ export default class ExpressionParser extends LValParser { const name = key.type === "Identifier" ? key.name : String(key.value); if (name === "__proto__") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); + // Store the first redefinition's position + if (protoRef.used && !protoRef.start) { + protoRef.start = key.start; } - propHash.proto = true; + + protoRef.used = true; } } @@ -1515,7 +1516,7 @@ export default class ExpressionParser extends LValParser { const prop = this.parseObjectMember(isPattern, refShorthandDefaultPos); // $FlowIgnore RestElement will never be returned if !isPattern - if (!isPattern) this.checkPropClash(prop, propHash); + if (!isPattern) this.checkDuplicatedProto(prop, propHash); // $FlowIgnore if (prop.shorthand) { @@ -1525,6 +1526,10 @@ export default class ExpressionParser extends LValParser { node.properties.push(prop); } + if (!this.match(tt.eq) && propHash.start !== undefined) { + this.raise(propHash.start, "Redefinition of __proto__ property"); + } + return this.finishNode( node, isPattern ? "ObjectPattern" : "ObjectExpression", diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index a407b8ac84ca..eae357921453 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -125,9 +125,9 @@ export default (superClass: Class): Class => } } - checkPropClash( + checkDuplicatedProto( prop: N.ObjectMember | N.SpreadElement, - propHash: { [key: string]: boolean }, + protoRef: { used: boolean, start?: number }, ): void { if ( prop.type === "SpreadElement" || @@ -144,10 +144,12 @@ export default (superClass: Class): Class => const name = key.type === "Identifier" ? key.name : String(key.value); if (name === "__proto__" && prop.kind === "init") { - if (propHash.proto) { - this.raise(key.start, "Redefinition of __proto__ property"); + // Store the first redefinition's position + if (protoRef.used && !protoRef.start) { + protoRef.start = key.start; } - propHash.proto = true; + + protoRef.used = true; } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/input.js b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/input.js new file mode 100644 index 000000000000..494000aa3793 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/input.js @@ -0,0 +1 @@ +({ __proto__: x, __proto__: y } = {}); diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/output.json new file mode 100644 index 000000000000..f82a656eae43 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 38 + } + }, + "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": "AssignmentExpression", + "start": 1, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "operator": "=", + "left": { + "type": "ObjectPattern", + "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": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + { + "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": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "y" + }, + "name": "y" + } + } + ] + }, + "right": { + "type": "ObjectExpression", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 34 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "properties": [] + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 977cd38ed79a..8ed606443333 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -1,5 +1,3 @@ -language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(default) -language/expressions/assignment/destructuring/obj-prop-__proto__dup.js(strict mode) language/expressions/class/elements/fields-duplicate-privatenames.js(default) language/expressions/class/elements/fields-duplicate-privatenames.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) From 686186cabc9391c4c0fd5cf75ab79aec70326e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 15 Oct 2019 23:00:23 +0200 Subject: [PATCH 128/965] Attemp fixing @babel/node and cli errors on Travis on Windows (#10547) For some reason, it looks like that the rimraf call didn't properly delete the folder: EEXIST: file already exists, mkdir 'C:\Users\travis\build\babel\babel\packages\babel-node\test\tmp' 150 | process.chdir(__dirname); 151 | if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc); > 152 | fs.mkdirSync(tmpLoc); | ^ 153 | process.chdir(tmpLoc); 154 | }; Lets try to reuse the existing folder rather than deleting and recreating it --- packages/babel-cli/test/index.js | 28 ++++++++++++++++++++-------- packages/babel-node/test/index.js | 18 ++++++++++-------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 9e8af0d9b947..7aa457b00fb8 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -115,13 +115,6 @@ const buildTest = function(binName, testName, opts) { const binLoc = path.join(__dirname, "../lib", binName); return function(callback) { - const dir = process.cwd(); - - process.chdir(__dirname); - if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc); - fs.mkdirSync(tmpLoc); - process.chdir(tmpLoc); - saveInFiles(opts.inFiles); let args = [binLoc]; @@ -159,7 +152,6 @@ const buildTest = function(binName, testName, opts) { args.map(arg => `"${arg}"`).join(" ") + ": " + err.message; } - process.chdir(dir); callback(err); }); @@ -175,6 +167,26 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { const suiteLoc = path.join(fixtureLoc, binName); describe("bin/" + binName, function() { + let cwd; + + beforeEach(() => { + cwd = process.cwd(); + + if (fs.existsSync(tmpLoc)) { + for (const child of fs.readdirSync(tmpLoc)) { + rimraf.sync(path.join(tmpLoc, child)); + } + } else { + fs.mkdirSync(tmpLoc); + } + + process.chdir(tmpLoc); + }); + + afterEach(() => { + process.chdir(cwd); + }); + fs.readdirSync(suiteLoc).forEach(function(testName) { if (testName.startsWith(".")) return; diff --git a/packages/babel-node/test/index.js b/packages/babel-node/test/index.js index 9fd61c73f81e..45283de76957 100644 --- a/packages/babel-node/test/index.js +++ b/packages/babel-node/test/index.js @@ -99,7 +99,6 @@ const buildTest = function(binName, testName, opts) { const binLoc = path.join(__dirname, "../lib", binName); return function(callback) { - clear(); saveInFiles(opts.inFiles); let args = [binLoc]; @@ -146,13 +145,6 @@ const buildTest = function(binName, testName, opts) { }; }; -const clear = function() { - process.chdir(__dirname); - if (fs.existsSync(tmpLoc)) rimraf.sync(tmpLoc); - fs.mkdirSync(tmpLoc); - process.chdir(tmpLoc); -}; - fs.readdirSync(fixtureLoc).forEach(function(binName) { if (binName[0] === ".") return; @@ -162,6 +154,16 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { beforeEach(() => { cwd = process.cwd(); + + if (fs.existsSync(tmpLoc)) { + for (const child of fs.readdirSync(tmpLoc)) { + rimraf.sync(path.join(tmpLoc, child)); + } + } else { + fs.mkdirSync(tmpLoc); + } + + process.chdir(tmpLoc); }); afterEach(() => { From 272d85d0ad653ca61011a6a7af07c272035cad0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 15 Oct 2019 23:46:10 +0200 Subject: [PATCH 129/965] Inject core-js@3 imports in Program:exit instead of on post() (#10146) * Inject corejs3 imports in Program:exit instead of post This allows them to be requeued and transformed by other plugins. * Also entry * Rebase * Update packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js [skip ci] Co-Authored-By: Brian Ng --- .../src/polyfills/corejs3/entry-plugin.js | 69 ++++++++---- .../src/polyfills/corejs3/usage-plugin.js | 41 ++++--- .../output.mjs | 4 +- .../corejs3/entry-entries-modules/output.mjs | 6 +- .../issue-10142-corejs2-entry/input.mjs | 1 + .../issue-10142-corejs2-entry/options.json | 14 +++ .../issue-10142-corejs2-entry/output.mjs | 6 ++ .../issue-10142-corejs2-entry/plugin.js | 8 ++ .../issue-10142-corejs2-usage/input.mjs | 1 + .../issue-10142-corejs2-usage/options.json | 6 ++ .../issue-10142-corejs2-usage/output.mjs | 6 ++ .../issue-10142-corejs2-usage/plugin.js | 7 ++ .../issue-10142-corejs3-entry/input.mjs | 1 + .../issue-10142-corejs3-entry/options.json | 14 +++ .../issue-10142-corejs3-entry/output.mjs | 100 ++++++++++++++++++ .../issue-10142-corejs3-entry/plugin.js | 8 ++ .../issue-10142-corejs3-usage/input.mjs | 1 + .../issue-10142-corejs3-usage/options.json | 6 ++ .../issue-10142-corejs3-usage/output.mjs | 6 ++ .../issue-10142-corejs3-usage/plugin.js | 7 ++ 20 files changed, 270 insertions(+), 42 deletions(-) create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/options.json create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/plugin.js create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/options.json create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/plugin.js create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/options.json create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/plugin.js create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/options.json create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/output.mjs create mode 100644 packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/plugin.js diff --git a/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js b/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js index 1d8d3df0a2fa..e30b284d8ac2 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js @@ -10,6 +10,7 @@ import { createImport, getImportSource, getRequireSource, + getModulePath, } from "../../utils"; import { logEntryPolyfills } from "../../debug"; @@ -48,6 +49,20 @@ export default function( const available = new Set(getModulesListForTargetVersion(corejs.version)); + function shouldReplace(source, modules) { + if (!modules) return false; + if ( + // Don't replace an import with itself to avoid an infinite loop + modules.length === 1 && + polyfills.has(modules[0]) && + available.has(modules[0]) && + getModulePath(modules[0]) === source + ) { + return false; + } + return true; + } + const isPolyfillImport = { ImportDeclaration(path: NodePath) { const source = getImportSource(path); @@ -56,24 +71,40 @@ export default function( console.warn(BABEL_POLYFILL_DEPRECATION); } else { const modules = isCoreJSSource(source); - if (modules) { + if (shouldReplace(source, modules)) { this.replaceBySeparateModulesImport(path, modules); } } }, - Program(path: NodePath) { - path.get("body").forEach(bodyPath => { - const source = getRequireSource(bodyPath); - if (!source) return; - if (isBabelPolyfillSource(source)) { - console.warn(BABEL_POLYFILL_DEPRECATION); - } else { - const modules = isCoreJSSource(source); - if (modules) { - this.replaceBySeparateModulesImport(bodyPath, modules); + Program: { + enter(path: NodePath) { + path.get("body").forEach(bodyPath => { + const source = getRequireSource(bodyPath); + if (!source) return; + if (isBabelPolyfillSource(source)) { + console.warn(BABEL_POLYFILL_DEPRECATION); + } else { + const modules = isCoreJSSource(source); + if (shouldReplace(source, modules)) { + this.replaceBySeparateModulesImport(bodyPath, modules); + } + } + }); + }, + exit(path: NodePath) { + const filtered = intersection(polyfills, this.polyfillsSet, available); + const reversed = Array.from(filtered).reverse(); + + for (const module of reversed) { + // Program:exit could be called multiple times. + // Avoid injecting the polyfills twice. + if (!this.injectedPolyfills.has(module)) { + createImport(path, module); } } - }); + + filtered.forEach(module => this.injectedPolyfills.add(module)); + }, }, }; @@ -81,6 +112,7 @@ export default function( name: "corejs3-entry", visitor: isPolyfillImport, pre() { + this.injectedPolyfills = new Set(); this.polyfillsSet = new Set(); this.replaceBySeparateModulesImport = function(path, modules) { @@ -91,19 +123,12 @@ export default function( path.remove(); }; }, - post({ path }: { path: NodePath }) { - const filtered = intersection(polyfills, this.polyfillsSet, available); - const reversed = Array.from(filtered).reverse(); - - for (const module of reversed) { - createImport(path, module); - } - + post() { if (debug) { logEntryPolyfills( "core-js", - this.polyfillsSet.size > 0, - filtered, + this.injectedPolyfills.size > 0, + this.injectedPolyfills, this.file.opts.filename, polyfillTargets, corejs3Polyfills, diff --git a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js index 2b06088aa61a..687a07c4367d 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js @@ -112,13 +112,30 @@ export default function( }, // require('core-js') - Program(path: NodePath) { - path.get("body").forEach(bodyPath => { - if (isPolyfillSource(getRequireSource(bodyPath))) { - console.warn(NO_DIRECT_POLYFILL_IMPORT); - bodyPath.remove(); + Program: { + enter(path: NodePath) { + path.get("body").forEach(bodyPath => { + if (isPolyfillSource(getRequireSource(bodyPath))) { + console.warn(NO_DIRECT_POLYFILL_IMPORT); + bodyPath.remove(); + } + }); + }, + + exit(path: NodePath) { + const filtered = intersection(polyfills, this.polyfillsSet, available); + const reversed = Array.from(filtered).reverse(); + + for (const module of reversed) { + // Program:exit could be called multiple times. + // Avoid injecting the polyfills twice. + if (!this.injectedPolyfills.has(module)) { + createImport(path, module); + } } - }); + + filtered.forEach(module => this.injectedPolyfills.add(module)); + }, }, // import('something').then(...) @@ -214,6 +231,7 @@ export default function( return { name: "corejs3-usage", pre() { + this.injectedPolyfills = new Set(); this.polyfillsSet = new Set(); this.addUnsupported = function(builtIn) { @@ -252,17 +270,10 @@ export default function( this.addUnsupported(InstancePropertyDependencies); }; }, - post({ path }: { path: NodePath }) { - const filtered = intersection(polyfills, this.polyfillsSet, available); - const reversed = Array.from(filtered).reverse(); - - for (const module of reversed) { - createImport(path, module); - } - + post() { if (debug) { logUsagePolyfills( - filtered, + this.injectedPolyfills, this.file.opts.filename, polyfillTargets, corejs3Polyfills, diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs index 44a025d6a453..55d6e9dbd5c4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.string.replace-all"; +import 'core-js/modules/es.object.from-entries'; +import 'core-js/modules/esnext.string.replace-all'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs index 16b33e2fd0b9..e761a4ac12c5 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.string.replace-all"; +import 'core-js/modules/es.symbol'; +import 'core-js/modules/es.object.from-entries'; +import 'core-js/modules/esnext.string.replace-all'; diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/input.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/input.mjs new file mode 100644 index 000000000000..bd6332b8bac3 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/input.mjs @@ -0,0 +1 @@ +import "core-js"; \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/options.json b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/options.json new file mode 100644 index 000000000000..786316f22efb --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 2, + "modules": false, + "targets": { "chrome": 65 } + } + ] + ], + "plugins": ["./plugin.js"] +} diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/output.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/output.mjs new file mode 100644 index 000000000000..05407cabf92a --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/output.mjs @@ -0,0 +1,6 @@ +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/plugin.js b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/plugin.js new file mode 100644 index 000000000000..931322f3b71d --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-entry/plugin.js @@ -0,0 +1,8 @@ +module.exports = () => ({ + visitor: { + ImportDeclaration(path) { + if (path.node.source.value === "core-js") return; + path.node.source.value = "MODIFIED"; + }, + }, +}); diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/input.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/input.mjs new file mode 100644 index 000000000000..b24e09f0c2fd --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/input.mjs @@ -0,0 +1 @@ +new Map(); \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/options.json b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/options.json new file mode 100644 index 000000000000..d7ce4a4a7218 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/options.json @@ -0,0 +1,6 @@ +{ + "presets": [ + ["env", { "useBuiltIns": "usage", "corejs": 2, "modules": false }] + ], + "plugins": ["./plugin.js"] +} diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/output.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/output.mjs new file mode 100644 index 000000000000..2e074eea8b62 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/output.mjs @@ -0,0 +1,6 @@ +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +new Map(); diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/plugin.js b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/plugin.js new file mode 100644 index 000000000000..ddfe181cf61e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs2-usage/plugin.js @@ -0,0 +1,7 @@ +module.exports = () => ({ + visitor: { + ImportDeclaration(path) { + path.node.source.value = "MODIFIED"; + }, + }, +}); diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/input.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/input.mjs new file mode 100644 index 000000000000..bd6332b8bac3 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/input.mjs @@ -0,0 +1 @@ +import "core-js"; \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/options.json b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/options.json new file mode 100644 index 000000000000..79d8456fac83 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 3, + "modules": false, + "targets": { "chrome": 65 } + } + ] + ], + "plugins": ["./plugin.js"] +} diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/output.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/output.mjs new file mode 100644 index 000000000000..da903d0b0539 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/output.mjs @@ -0,0 +1,100 @@ +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/plugin.js b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/plugin.js new file mode 100644 index 000000000000..931322f3b71d --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-entry/plugin.js @@ -0,0 +1,8 @@ +module.exports = () => ({ + visitor: { + ImportDeclaration(path) { + if (path.node.source.value === "core-js") return; + path.node.source.value = "MODIFIED"; + }, + }, +}); diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/input.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/input.mjs new file mode 100644 index 000000000000..b24e09f0c2fd --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/input.mjs @@ -0,0 +1 @@ +new Map(); \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/options.json b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/options.json new file mode 100644 index 000000000000..3d488206b51d --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/options.json @@ -0,0 +1,6 @@ +{ + "presets": [ + ["env", { "useBuiltIns": "usage", "corejs": 3, "modules": false }] + ], + "plugins": ["./plugin.js"] +} diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/output.mjs b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/output.mjs new file mode 100644 index 000000000000..2e074eea8b62 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/output.mjs @@ -0,0 +1,6 @@ +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +import "MODIFIED"; +new Map(); diff --git a/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/plugin.js b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/plugin.js new file mode 100644 index 000000000000..ddfe181cf61e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/sanity/issue-10142-corejs3-usage/plugin.js @@ -0,0 +1,7 @@ +module.exports = () => ({ + visitor: { + ImportDeclaration(path) { + path.node.source.value = "MODIFIED"; + }, + }, +}); From cd5d3abc32d6864281bc909a0bd6942f4319d920 Mon Sep 17 00:00:00 2001 From: Gerald Date: Wed, 16 Oct 2019 21:23:47 +0800 Subject: [PATCH 130/965] fix: String#italics is incorrectly defined in babel-preset-env (#10563) --- .../src/polyfills/corejs3/built-in-definitions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js index e03208878726..f3de8ef83733 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js @@ -197,7 +197,7 @@ export const InstanceProperties: ObjectMap = { forEach: ["es.array.for-each", "web.dom-collections.for-each"], includes: ["es.array.includes", "es.string.includes"], indexOf: ["es.array.index-of"], - italic: ["es.string.italics"], + italics: ["es.string.italics"], join: ["es.array.join"], keys: ArrayNatureIteratorsWithTag, lastIndex: ["esnext.array.last-index"], From 800eccc046ff71e4c2a0cbdb3fdddbae87933a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 16 Oct 2019 10:12:13 -0400 Subject: [PATCH 131/965] chore: introduce envinfo into environment section (#10553) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: introduce envinfo into environment section [skip ci] * Apply suggestions from code review Co-Authored-By: Nicolò Ribaudo * Address review comments from Nicolò * Update .github/ISSUE_TEMPLATE/Bug_report.md [skip ci] Co-Authored-By: Brian Ng * chore: simplify issue template [skip ci] --- .github/ISSUE_TEMPLATE/Bug_report.md | 6 +++++- .github/ISSUE_TEMPLATE/Regression-v7.md | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 344922e4702c..bdde953530f3 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -22,7 +22,7 @@ var your => (code) => here; **Expected behavior/code** A clear and concise description of what you expected to happen (or code). -**Babel Configuration (.babelrc, package.json, cli command)** +**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command)** ```js { @@ -31,6 +31,10 @@ A clear and concise description of what you expected to happen (or code). ``` **Environment** + +``` + +``` - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] diff --git a/.github/ISSUE_TEMPLATE/Regression-v7.md b/.github/ISSUE_TEMPLATE/Regression-v7.md index a700b90ba073..b001290cf317 100644 --- a/.github/ISSUE_TEMPLATE/Regression-v7.md +++ b/.github/ISSUE_TEMPLATE/Regression-v7.md @@ -26,7 +26,10 @@ A clear and concise description of what the regression is. var your => (code) => here; ``` -**Babel Configuration (.babelrc, package.json, cli command)** +**Expected behavior/code** +A clear and concise description of what you expected to happen (or code). + +**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command)** ```js { @@ -34,10 +37,11 @@ var your => (code) => here; } ``` -**Expected behavior/code** -A clear and concise description of what you expected to happen (or code). - **Environment** + +``` + +``` - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] From d234ff6572e7593f36620780319b4e183aec7561 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 16 Oct 2019 09:56:35 -0500 Subject: [PATCH 132/965] Revert "chore: introduce envinfo into environment section (#10553)" (#10564) This reverts commit 800eccc046ff71e4c2a0cbdb3fdddbae87933a71. --- .github/ISSUE_TEMPLATE/Bug_report.md | 6 +----- .github/ISSUE_TEMPLATE/Regression-v7.md | 12 ++++-------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index bdde953530f3..344922e4702c 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -22,7 +22,7 @@ var your => (code) => here; **Expected behavior/code** A clear and concise description of what you expected to happen (or code). -**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command)** +**Babel Configuration (.babelrc, package.json, cli command)** ```js { @@ -31,10 +31,6 @@ A clear and concise description of what you expected to happen (or code). ``` **Environment** - -``` - -``` - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] diff --git a/.github/ISSUE_TEMPLATE/Regression-v7.md b/.github/ISSUE_TEMPLATE/Regression-v7.md index b001290cf317..a700b90ba073 100644 --- a/.github/ISSUE_TEMPLATE/Regression-v7.md +++ b/.github/ISSUE_TEMPLATE/Regression-v7.md @@ -26,10 +26,7 @@ A clear and concise description of what the regression is. var your => (code) => here; ``` -**Expected behavior/code** -A clear and concise description of what you expected to happen (or code). - -**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command)** +**Babel Configuration (.babelrc, package.json, cli command)** ```js { @@ -37,11 +34,10 @@ A clear and concise description of what you expected to happen (or code). } ``` -**Environment** - -``` +**Expected behavior/code** +A clear and concise description of what you expected to happen (or code). -``` +**Environment** - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] From 22545420106522eb723b33d94f4086f1627e1f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 16 Oct 2019 22:13:21 +0200 Subject: [PATCH 133/965] Don't use deprecated "lerna publish --require-scripts" (#10558) [skip ci] --- Makefile | 2 +- packages/babel-polyfill/package.json | 4 ++++ packages/babel-polyfill/scripts/postpublish.js | 8 -------- packages/babel-polyfill/scripts/prepublish.js | 13 ------------- packages/babel-preset-env-standalone/package.json | 3 +++ .../scripts/prepublish.js | 11 ----------- packages/babel-standalone/package.json | 3 +++ packages/babel-standalone/scripts/prepublish.js | 7 ------- 8 files changed, 11 insertions(+), 40 deletions(-) delete mode 100644 packages/babel-polyfill/scripts/postpublish.js delete mode 100644 packages/babel-polyfill/scripts/prepublish.js delete mode 100644 packages/babel-preset-env-standalone/scripts/prepublish.js delete mode 100644 packages/babel-standalone/scripts/prepublish.js diff --git a/Makefile b/Makefile index 757621cce370..36b5fa501d23 100644 --- a/Makefile +++ b/Makefile @@ -193,7 +193,7 @@ new-version: # NOTE: Run make new-version first publish: prepublish - yarn lerna publish from-git --require-scripts + yarn lerna publish from-git $(MAKE) clean publish-ci: prepublish diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index 525bcdcf3954..d3a4055dadf1 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -8,6 +8,10 @@ "publishConfig": { "access": "public" }, + "scripts": { + "prepublishOnly": "cp dist/polyfill.min.js browser.js", + "postpublish": "rm browser.js" + }, "repository": "https://github.com/babel/babel/tree/master/packages/babel-polyfill", "main": "lib/index.js", "dependencies": { diff --git a/packages/babel-polyfill/scripts/postpublish.js b/packages/babel-polyfill/scripts/postpublish.js deleted file mode 100644 index 57a59218c810..000000000000 --- a/packages/babel-polyfill/scripts/postpublish.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; - -const fs = require("fs"); -const path = require("path"); - -try { - fs.unlinkSync(path.join(__dirname, "../browser.js")); -} catch (err) {} diff --git a/packages/babel-polyfill/scripts/prepublish.js b/packages/babel-polyfill/scripts/prepublish.js deleted file mode 100644 index 84276779f950..000000000000 --- a/packages/babel-polyfill/scripts/prepublish.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; - -const fs = require("fs"); -const path = require("path"); - -function relative(loc) { - return path.join(__dirname, "..", loc); -} - -fs.writeFileSync( - relative("browser.js"), - fs.readFileSync(relative("dist/polyfill.min.js")) -); diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index b1befbaf7df9..bdda607f1596 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -8,6 +8,9 @@ "babel-preset-env.min.js", "src" ], + "scripts": { + "prepublishOnly": "cd ../.. && make prepublish-build-preset-env-standalone" + }, "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.5.0", "@babel/plugin-proposal-json-strings": "^7.0.0", diff --git a/packages/babel-preset-env-standalone/scripts/prepublish.js b/packages/babel-preset-env-standalone/scripts/prepublish.js deleted file mode 100644 index bff650fb032d..000000000000 --- a/packages/babel-preset-env-standalone/scripts/prepublish.js +++ /dev/null @@ -1,11 +0,0 @@ -// This file is executed by lerna before publishing, -// @babel/preset-env-standalone so that it has the -// new version and not the old one. - -require("child_process").execSync( - "make prepublish-build-preset-env-standalone", - { - cwd: require("path").resolve(__dirname, "../../.."), - stdio: "inherit", - } -); diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 77ae93d4e30e..bfed051647ec 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -8,6 +8,9 @@ "babel.min.js", "src" ], + "scripts": { + "prepublishOnly": "cd ../.. && make prepublish-build-standalone" + }, "devDependencies": { "@babel/core": "^7.6.4", "@babel/helper-plugin-utils": "^7.0.0", diff --git a/packages/babel-standalone/scripts/prepublish.js b/packages/babel-standalone/scripts/prepublish.js deleted file mode 100644 index daadffb117ef..000000000000 --- a/packages/babel-standalone/scripts/prepublish.js +++ /dev/null @@ -1,7 +0,0 @@ -// This file is executed by lerna before publishing @babel/standalone, -// so that it has the new version and not the old one. - -require("child_process").execSync("make prepublish-build-standalone", { - cwd: require("path").resolve(__dirname, "../../.."), - stdio: "inherit", -}); From 5800fc97b32778f72c5a95b970e38102ab866eaf Mon Sep 17 00:00:00 2001 From: piotr Date: Thu, 17 Oct 2019 00:01:22 +0200 Subject: [PATCH 134/965] [parser] Exception to 8 and 9 in tagged template (#10567) --- packages/babel-parser/src/tokenizer/index.js | 8 ++++++++ .../core/escape-template/non-octal/eight/input.js | 1 + .../core/escape-template/non-octal/eight/options.json | 3 +++ .../fixtures/core/escape-template/non-octal/nine/input.js | 1 + .../core/escape-template/non-octal/nine/options.json | 3 +++ 5 files changed, 16 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js create 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/nine/input.js create mode 100644 packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/options.json diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 1d2ea02212fd..ab0dbe5b9237 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1239,6 +1239,14 @@ export default class Tokenizer extends LocationParser { case charCodes.lineSeparator: case charCodes.paragraphSeparator: return ""; + case charCodes.digit8: + case charCodes.digit9: + if (inTemplate) { + const codePos = this.state.pos - 1; + + this.state.invalidTemplateEscapePosition = codePos; + return null; + } default: if (ch >= charCodes.digit0 && ch <= charCodes.digit7) { const codePos = this.state.pos - 1; diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js new file mode 100644 index 000000000000..adc52b823a24 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js @@ -0,0 +1 @@ +`\8`; 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 new file mode 100644 index 000000000000..3ae5cb6c96c4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/options.json @@ -0,0 +1,3 @@ +{ + "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/input.js b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/input.js new file mode 100644 index 000000000000..b5435620b9cb --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/input.js @@ -0,0 +1 @@ +`\9`; 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 new file mode 100644 index 000000000000..3ae5cb6c96c4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Invalid escape sequence in template (1:2)" +} \ No newline at end of file From 487f10f84d03a2019c7aa8da254577478bb28e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 17 Oct 2019 03:30:01 -0400 Subject: [PATCH 135/965] fix: disable caching when babel could not read/write cache (#10557) * fix: disable caching when babel could not read/write cache * emit warning when cache folder resides in readonly fs * fix: always register save handler * cache: maintain old behaviour * test: add more test case * fix: next tick tasks are FIFO * test: disable test on Windows --- packages/babel-register/src/cache.js | 61 ++++++++++++++++++++++++--- packages/babel-register/test/cache.js | 38 ++++++++++++++++- 2 files changed, 90 insertions(+), 9 deletions(-) diff --git a/packages/babel-register/src/cache.js b/packages/babel-register/src/cache.js index 439c92c30851..0a2983b89aa2 100644 --- a/packages/babel-register/src/cache.js +++ b/packages/babel-register/src/cache.js @@ -14,11 +14,17 @@ const DEFAULT_FILENAME = path.join( const FILENAME: string = process.env.BABEL_CACHE_PATH || DEFAULT_FILENAME; let data: Object = {}; +let cacheDisabled = false; + +function isCacheDisabled() { + return process.env.BABEL_DISABLE_CACHE ?? cacheDisabled; +} /** * Write stringified cache to disk. */ export function save() { + if (isCacheDisabled()) return; let serialised: string = "{}"; try { @@ -32,8 +38,30 @@ export function save() { } } - mkdirpSync(path.dirname(FILENAME)); - fs.writeFileSync(FILENAME, serialised); + try { + mkdirpSync(path.dirname(FILENAME)); + fs.writeFileSync(FILENAME, serialised); + } catch (e) { + switch (e.code) { + case "EACCES": + case "EPERM": + console.warn( + `Babel could not write cache to file: ${FILENAME} +due to a permission issue. Cache is disabled.`, + ); + cacheDisabled = true; + break; + case "EROFS": + console.warn( + `Babel could not write cache to file: ${FILENAME} +because it resides in a readonly filesystem. Cache is disabled.`, + ); + cacheDisabled = true; + break; + default: + throw e; + } + } } /** @@ -41,18 +69,37 @@ export function save() { */ export function load() { - if (process.env.BABEL_DISABLE_CACHE) return; + if (isCacheDisabled()) { + data = {}; + return; + } process.on("exit", save); process.nextTick(save); - if (!fs.existsSync(FILENAME)) return; + let cacheContent; try { - data = JSON.parse(fs.readFileSync(FILENAME)); - } catch (err) { - return; + cacheContent = fs.readFileSync(FILENAME); + } catch (e) { + switch (e.code) { + // check EACCES only as fs.readFileSync will never throw EPERM on Windows + // https://github.com/libuv/libuv/blob/076df64dbbda4320f93375913a728efc40e12d37/src/win/fs.c#L735 + case "EACCES": + console.warn( + `Babel could not read cache file: ${FILENAME} +due to a permission issue. Cache is disabled.`, + ); + cacheDisabled = true; + /* fall through */ + default: + return; + } } + + try { + data = JSON.parse(cacheContent); + } catch {} } /** diff --git a/packages/babel-register/test/cache.js b/packages/babel-register/test/cache.js index c9704cbdd3ab..f4fb2de2e8ec 100644 --- a/packages/babel-register/test/cache.js +++ b/packages/babel-register/test/cache.js @@ -7,12 +7,12 @@ const oldBabelDisableCacheValue = process.env.BABEL_DISABLE_CACHE; process.env.BABEL_CACHE_PATH = testCacheFilename; delete process.env.BABEL_DISABLE_CACHE; -function writeCache(data) { +function writeCache(data, mode = 0o666) { if (typeof data === "object") { data = JSON.stringify(data); } - fs.writeFileSync(testCacheFilename, data); + fs.writeFileSync(testCacheFilename, data, { mode }); } function cleanCache() { @@ -73,5 +73,39 @@ describe("@babel/register - caching", () => { expect(fs.existsSync(testCacheFilename)).toBe(true); expect(get()).toEqual({}); }); + + it("should create the cache after load", cb => { + load(); + + process.nextTick(() => { + expect(fs.existsSync(testCacheFilename)).toBe(true); + expect(get()).toEqual({}); + cb(); + }); + }); + + // Only write mode is effective on Windows + if (process.platform !== "win32") { + it("should be disabled when CACHE_PATH is not allowed to read", () => { + writeCache({ foo: "bar" }, 0o266); + + load(); + + expect(get()).toEqual({}); + }); + } + + it("should be disabled when CACHE_PATH is not allowed to write", cb => { + writeCache({ foo: "bar" }, 0o466); + + load(); + + expect(get()).toEqual({ foo: "bar" }); + process.nextTick(() => { + load(); + expect(get()).toEqual({}); + cb(); + }); + }); }); }); From 095f28a913a65f7dd21d5788c8d58b9c71e3bfd9 Mon Sep 17 00:00:00 2001 From: gr <13141462+gonzarodriguezt@users.noreply.github.com> Date: Thu, 17 Oct 2019 04:30:36 -0300 Subject: [PATCH 136/965] fix: Exclude catch clause from let identifier error (#10559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Exclude catch clause from let identifier error * Disallow let binding based on parameter * Add test * Remove unused getter * Update packages/babel-parser/src/parser/statement.js Co-Authored-By: Nicolò Ribaudo --- packages/babel-parser/src/parser/lval.js | 7 +- packages/babel-parser/src/parser/statement.js | 1 + packages/babel-parser/src/plugins/estree.js | 10 +- .../es2015/let/let-at-catch-block/input.js | 3 + .../let/let-at-catch-block/options.json | 3 + .../es2015/let/try-catch-let/input.js | 1 + .../es2015/let/try-catch-let/output.json | 117 ++++++++++++++++++ 7 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/input.js create 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/try-catch-let/input.js create mode 100644 packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index b9d98c3498ca..050bb1eda6c1 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -17,7 +17,7 @@ import type { import type { Pos, Position } from "../util/location"; import { isStrictBindReservedWord } from "../util/identifier"; import { NodeUtils } from "./node"; -import { type BindingTypes, BIND_NONE, BIND_LEXICAL } from "../util/scopeflags"; +import { type BindingTypes, BIND_NONE } from "../util/scopeflags"; export default class LValParser extends NodeUtils { // Forward-declaration: defined in expression.js @@ -348,6 +348,7 @@ export default class LValParser extends NodeUtils { bindingType: BindingTypes = BIND_NONE, checkClashes: ?{ [key: string]: boolean }, contextDescription: string, + disallowLetBinding?: boolean, ): void { switch (expr.type) { case "Identifier": @@ -383,7 +384,7 @@ export default class LValParser extends NodeUtils { checkClashes[key] = true; } } - if (bindingType === BIND_LEXICAL && expr.name === "let") { + if (disallowLetBinding && expr.name === "let") { this.raise( expr.start, "'let' is not allowed to be used as a name in 'let' or 'const' declarations.", @@ -408,6 +409,7 @@ export default class LValParser extends NodeUtils { bindingType, checkClashes, "object destructuring pattern", + disallowLetBinding, ); } break; @@ -420,6 +422,7 @@ export default class LValParser extends NodeUtils { bindingType, checkClashes, "array destructuring pattern", + disallowLetBinding, ); } } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index ad7b8c0ab6a4..81e310debd7b 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1021,6 +1021,7 @@ export default class StatementParser extends ExpressionParser { kind === "var" ? BIND_VAR : BIND_LEXICAL, undefined, "variable declaration", + kind !== "var", ); } diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index eae357921453..014a1a54067d 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -108,6 +108,7 @@ export default (superClass: Class): Class => bindingType: BindingTypes = BIND_NONE, checkClashes: ?{ [key: string]: boolean }, contextDescription: string, + disallowLetBinding?: boolean, ): void { switch (expr.type) { case "ObjectPattern": @@ -117,11 +118,18 @@ export default (superClass: Class): Class => bindingType, checkClashes, "object destructuring pattern", + disallowLetBinding, ); }); break; default: - super.checkLVal(expr, bindingType, checkClashes, contextDescription); + super.checkLVal( + expr, + bindingType, + checkClashes, + contextDescription, + disallowLetBinding, + ); } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/input.js b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/input.js new file mode 100644 index 000000000000..25619fa29b6a --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/input.js @@ -0,0 +1,3 @@ +try {} catch (err) { + let let; +} \ 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 new file mode 100644 index 000000000000..2c54a7452db9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/options.json @@ -0,0 +1,3 @@ +{ + "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/try-catch-let/input.js b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/input.js new file mode 100644 index 000000000000..a96f76fcd513 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/input.js @@ -0,0 +1 @@ +try {} catch (let) {} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json new file mode 100644 index 000000000000..3d714b032e34 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json @@ -0,0 +1,117 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TryStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "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": 21, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "param": { + "type": "Identifier", + "start": 14, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 17 + }, + "identifierName": "let" + }, + "name": "let" + }, + "body": { + "type": "BlockStatement", + "start": 19, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + "finalizer": null + } + ], + "directives": [] + } +} \ No newline at end of file From 8c94b3f209409c0303cbb44bca37c7dfefca78c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 17 Oct 2019 07:49:41 -0400 Subject: [PATCH 137/965] Bump babel-types to ^7.6.3 (#10568) * fix incorrect lerna bootstrap options * chore: bump @babel/types dependencies to v7.6.3 * chore: remove ignore-engines on lerna bootstrap --- Makefile | 2 +- packages/babel-helper-annotate-as-pure/package.json | 2 +- packages/babel-helper-bindify-decorators/package.json | 2 +- .../package.json | 2 +- packages/babel-helper-builder-react-jsx/package.json | 2 +- packages/babel-helper-call-delegate/package.json | 2 +- packages/babel-helper-define-map/package.json | 2 +- .../babel-helper-explode-assignable-expression/package.json | 2 +- packages/babel-helper-explode-class/package.json | 2 +- packages/babel-helper-function-name/package.json | 2 +- packages/babel-helper-get-function-arity/package.json | 2 +- packages/babel-helper-hoist-variables/package.json | 2 +- .../babel-helper-member-expression-to-functions/package.json | 2 +- packages/babel-helper-module-imports/package.json | 2 +- packages/babel-helper-module-transforms/package.json | 2 +- packages/babel-helper-optimise-call-expression/package.json | 2 +- packages/babel-helper-remap-async-to-generator/package.json | 2 +- packages/babel-helper-replace-supers/package.json | 2 +- packages/babel-helper-simple-access/package.json | 2 +- packages/babel-helper-split-export-declaration/package.json | 2 +- packages/babel-helper-wrap-function/package.json | 2 +- packages/babel-helpers/package.json | 2 +- packages/babel-template/package.json | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 36b5fa501d23..acec39fa4486 100644 --- a/Makefile +++ b/Makefile @@ -213,7 +213,7 @@ yarn-install: clean-all yarn --ignore-engines lerna-bootstrap: yarn-install - yarn lerna bootstrap -- --ignore-engines + yarn lerna bootstrap bootstrap: bootstrap-only $(MAKE) build diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index 543b4fbf16ab..0ccaace9f494 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index c7904cd201ea..0b3c4c587696 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -10,6 +10,6 @@ "main": "lib/index.js", "dependencies": { "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json index 3e292cc12d6f..f52081203a1e 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -10,6 +10,6 @@ "main": "lib/index.js", "dependencies": { "@babel/helper-explode-assignable-expression": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index 7b13e4b4753a..cf082d88cf9c 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.3.0", + "@babel/types": "^7.6.3", "esutils": "^2.0.0" } } diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index 3e7fd81bcf40..c7e9e0222d25 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -11,6 +11,6 @@ "dependencies": { "@babel/helper-hoist-variables": "^7.4.4", "@babel/traverse": "^7.4.4", - "@babel/types": "^7.4.4" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index a51713a7f9f5..ac574448da1f 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -10,7 +10,7 @@ "main": "lib/index.js", "dependencies": { "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.5.5", + "@babel/types": "^7.6.3", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index cf91ef586e0a..8cbf2aaeb781 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -10,6 +10,6 @@ "main": "lib/index.js", "dependencies": { "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index ce7b0df4a3fe..630951905259 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -11,6 +11,6 @@ "dependencies": { "@babel/helper-bindify-decorators": "^7.1.0", "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index 77670f935a38..ab39d5f4d5db 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -11,6 +11,6 @@ "dependencies": { "@babel/helper-get-function-arity": "^7.0.0", "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index 1ed46aabd225..ec3f4a85c2cf 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index dad2e954ce2f..98cb86eec955 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.4.4" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-member-expression-to-functions/package.json b/packages/babel-helper-member-expression-to-functions/package.json index 4e94f0cdefaf..571c84a18a7b 100644 --- a/packages/babel-helper-member-expression-to-functions/package.json +++ b/packages/babel-helper-member-expression-to-functions/package.json @@ -10,6 +10,6 @@ "main": "lib/index.js", "author": "Justin Ridgewell ", "dependencies": { - "@babel/types": "^7.5.5" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index e740d2f546bb..7e6bad8b26c9 100644 --- a/packages/babel-helper-module-imports/package.json +++ b/packages/babel-helper-module-imports/package.json @@ -11,7 +11,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports", "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" }, "devDependencies": { "@babel/core": "^7.0.0" diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 3e4d55182dcf..f8f7ef94092a 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -15,7 +15,7 @@ "@babel/helper-simple-access": "^7.1.0", "@babel/helper-split-export-declaration": "^7.4.4", "@babel/template": "^7.4.4", - "@babel/types": "^7.5.5", + "@babel/types": "^7.6.3", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index f048cd350075..9c9245260c78 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-remap-async-to-generator/package.json b/packages/babel-helper-remap-async-to-generator/package.json index fb44a863a9c1..e0033b85c2c4 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -13,6 +13,6 @@ "@babel/helper-wrap-function": "^7.1.0", "@babel/template": "^7.1.0", "@babel/traverse": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index a6c6dbc76c2b..b762e5ea0f2a 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -12,6 +12,6 @@ "@babel/helper-member-expression-to-functions": "^7.5.5", "@babel/helper-optimise-call-expression": "^7.0.0", "@babel/traverse": "^7.5.5", - "@babel/types": "^7.5.5" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index 51a8abba2b7a..4fd9ee272372 100644 --- a/packages/babel-helper-simple-access/package.json +++ b/packages/babel-helper-simple-access/package.json @@ -12,6 +12,6 @@ "main": "lib/index.js", "dependencies": { "@babel/template": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json index f8510565f9e9..e4ae3ae051fe 100644 --- a/packages/babel-helper-split-export-declaration/package.json +++ b/packages/babel-helper-split-export-declaration/package.json @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.4.4" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index d0a3396e76f5..6d06942e0e5c 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -12,6 +12,6 @@ "@babel/helper-function-name": "^7.1.0", "@babel/template": "^7.1.0", "@babel/traverse": "^7.1.0", - "@babel/types": "^7.2.0" + "@babel/types": "^7.6.3" } } diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 5f3c0a7895d8..555a469caa6f 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -13,7 +13,7 @@ "dependencies": { "@babel/template": "^7.6.0", "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.0" + "@babel/types": "^7.6.3" }, "devDependencies": { "@babel/helper-plugin-test-runner": "^7.0.0" diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index 5b0bc20c5ed1..cc599610aa84 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -13,6 +13,6 @@ "dependencies": { "@babel/code-frame": "^7.0.0", "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.0" + "@babel/types": "^7.6.3" } } From da9c9a64c26533a51ce68152753488a5a8d9d57a Mon Sep 17 00:00:00 2001 From: Jaideep Bhoosreddy Date: Thu, 17 Oct 2019 13:52:31 -0400 Subject: [PATCH 138/965] Add master branch workflow for test262 tests (#10556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The results of these tests will be stored in build artifacts which will be used to compare with test262 runs on PR (future work!). Robin has also done a lot of work to ensure all babel packages are properly linked to the test runner. Additionally, Nicolo has helped in mentorship and contributions to babel-test262-runner which is used here. We're no longer giving xunit output to CircleCI because once it sees failing tests it will mark babel's master as broken. As a stopgap, it will render the test results in the mocha spec format, which is human readable. Co-Authored-By: Robin Ricard Co-Authored-By: Nicolò Ribaudo --- .circleci/config.yml | 68 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cb085191b714..dfa4bf21bf96 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,8 +30,17 @@ aliases: - &artifact_env_min path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js + - &test262_workdir + working_directory: ~/babel/babel-test262-runner + + - &artifact_test262_tap + path: ~/test262.tap + + - &artifact_test262_xunit + path: ~/test-results + jobs: - build: + test: working_directory: ~/babel docker: - image: circleci/node:12 @@ -54,3 +63,60 @@ jobs: - store_artifacts: *artifact_env_min - save_cache: *save-node-modules-cache - save_cache: *save-yarn-cache + test262: + working_directory: ~/babel + docker: + - image: circleci/node:12 + steps: + - checkout + - restore-cache: *restore-yarn-cache + - restore-cache: *restore-node-modules-cache + - run: + name: Build Babel + command: BABEL_ENV=test make bootstrap + - run: + name: Link Babel + command: | + cd packages + for package in */; do + cd $package + yarn link + cd .. + done + - run: + name: Setup Test Runner + command: | + git clone --recurse-submodules https://github.com/babel/babel-test262-runner + cd babel-test262-runner + yarn + yarn add tap-mocha-reporter --dev + curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > jq + chmod +x ./jq + for package in ../packages/*/package.json; do + yarn link $(./jq -j ".name" $package) + done + node lib/download-node + - run: + name: Run Test262 + command: node lib/run-tests I_AM_SURE | tee ~/test262.tap + <<: *test262_workdir + - store_artifacts: *artifact_test262_tap + - run: + name: Output test262 results + command: | + cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true + <<: *test262_workdir + + +workflows: + version: 2 + test: + jobs: + - test + master: + jobs: + - test262: + filters: + branches: + only: + - master From b5b8055cc00756f94bf71deb45f288738520ee3c Mon Sep 17 00:00:00 2001 From: Daniel Arthur Gallagher <8526031+DanArthurGallagher@users.noreply.github.com> Date: Thu, 17 Oct 2019 23:26:14 +0200 Subject: [PATCH 139/965] docs: add homepage link to @babel/runtime package.json (#10418) * docs: add homepage link Adds a homepage link to populate npmjs.com. Update the repository property syntax. * Update the repository link Point to the root repo plus a reference to the subdirectory. * style: drop HTML extension --- packages/babel-runtime/package.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 84f3d9127abf..afdb001717db 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -6,7 +6,12 @@ "publishConfig": { "access": "public" }, - "repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime", + "repository": { + "type" : "git", + "url" : "https://github.com/babel/babel.git", + "directory": "packages/babel-runtime" + }, + "homepage": "https://babeljs.io/docs/en/next/babel-runtime", "author": "Sebastian McKenzie ", "dependencies": { "regenerator-runtime": "^0.13.2" From 43b623c1f1e86e6fb86cae8d955a84fd924380a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 18 Oct 2019 00:16:35 +0200 Subject: [PATCH 140/965] [traverse] Allow skipping nodes inserted with .replaceWith() (#9777) * Avoid regression --- packages/babel-traverse/src/path/context.js | 15 +++++++- packages/babel-traverse/test/traverse.js | 42 +++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/packages/babel-traverse/src/path/context.js b/packages/babel-traverse/src/path/context.js index faa5e9d3f15e..47c8f831f429 100644 --- a/packages/babel-traverse/src/path/context.js +++ b/packages/babel-traverse/src/path/context.js @@ -67,7 +67,12 @@ export function visit(): boolean { return false; } - if (this.call("enter") || this.shouldSkip) { + // Note: We need to check "this.shouldSkip" twice because + // the visitor can set it to true. Usually .shouldSkip is false + // before calling the enter visitor, but it can be true in case of + // a requeued node (e.g. by .replaceWith()) that is then marked + // with .skip(). + if (this.shouldSkip || this.call("enter") || this.shouldSkip) { this.debug("Skip..."); return this.shouldStop; } @@ -233,6 +238,14 @@ export function setKey(key) { export function requeue(pathToQueue = this) { if (pathToQueue.removed) return; + // TODO: Uncomment in Babel 8. If a path is skipped, and then replaced with a + // new one, the new one shouldn't probably be skipped. + // Note that this currently causes an infinite loop because of + // packages/babel-plugin-transform-block-scoping/src/tdz.js#L52-L59 + // (b5b8055cc00756f94bf71deb45f288738520ee3c) + // + // pathToQueue.shouldSkip = false; + // TODO(loganfsmyth): This should be switched back to queue in parent contexts // automatically once #2892 and #4135 have been resolved. See #4140. // let contexts = this._getQueueContexts(); diff --git a/packages/babel-traverse/test/traverse.js b/packages/babel-traverse/test/traverse.js index a4b391c0b2fa..316c2e12c0d8 100644 --- a/packages/babel-traverse/test/traverse.js +++ b/packages/babel-traverse/test/traverse.js @@ -1,6 +1,7 @@ import cloneDeep from "lodash/cloneDeep"; import traverse from "../lib"; import { parse } from "@babel/parser"; +import * as t from "@babel/types"; describe("traverse", function() { const code = ` @@ -174,4 +175,45 @@ describe("traverse", function() { expect(p).not.toBe(scopes[i]); }); }); + + describe("path.skip()", function() { + it("replaced paths can be skipped", function() { + const ast = parse("id"); + + let skipped; + traverse(ast, { + noScope: true, + Identifier(path) { + path.replaceWith(t.numericLiteral(0)); + path.skip(); + skipped = true; + }, + NumericLiteral() { + skipped = false; + }, + }); + + expect(skipped).toBe(true); + }); + + // Skipped: see the comment in the `NodePath.requque` method. + it.skip("skipped and requeued paths should be visited", function() { + const ast = parse("id"); + + let visited = false; + traverse(ast, { + noScope: true, + Identifier(path) { + path.replaceWith(t.numericLiteral(0)); + path.skip(); + path.requeue(); + }, + NumericLiteral() { + visited = true; + }, + }); + + expect(visited).toBe(true); + }); + }); }); From 78cd63d9cfcd96e6a151c58fed392c3ee757d861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 18 Oct 2019 11:16:08 +0200 Subject: [PATCH 141/965] Fix invalid test layout in @babel/parser --- .../escape-template/{non-octal/eight => non-octal-eight}/input.js | 0 .../{non-octal/eight => non-octal-eight}/options.json | 0 .../escape-template/{non-octal/nine => non-octal-nine}/input.js | 0 .../{non-octal/nine => non-octal-nine}/options.json | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename packages/babel-parser/test/fixtures/core/escape-template/{non-octal/eight => non-octal-eight}/input.js (100%) rename packages/babel-parser/test/fixtures/core/escape-template/{non-octal/eight => non-octal-eight}/options.json (100%) rename packages/babel-parser/test/fixtures/core/escape-template/{non-octal/nine => non-octal-nine}/input.js (100%) rename packages/babel-parser/test/fixtures/core/escape-template/{non-octal/nine => non-octal-nine}/options.json (100%) diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/input.js rename to packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/core/escape-template/non-octal/eight/options.json rename to packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/options.json diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/input.js b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/input.js rename to packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/input.js 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 similarity index 100% rename from packages/babel-parser/test/fixtures/core/escape-template/non-octal/nine/options.json rename to packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/options.json From fe258dec047f473fb5a35172b2ff8cb172051dec Mon Sep 17 00:00:00 2001 From: samuel kwok Date: Sat, 19 Oct 2019 18:01:38 +0800 Subject: [PATCH 142/965] fix: _interopRequireWildcard should only cache objects (#10574) * fix: [#10561] _interopRequireWildcard should cache object only * fix: narrow down cache restriction to object/function type * test: add interop require null module case --- packages/babel-helpers/src/helpers.js | 4 ++++ .../test/fixtures/commonjs/exec-interop-null/exec.js | 3 +++ .../test/fixtures/commonjs/exec-interop-null/mod.js | 1 + .../test/fixtures/commonjs/exec-interop-null/options.json | 5 +++++ .../test/fixtures/commonjs/exec-interop-string/exec.js | 3 +++ .../test/fixtures/commonjs/exec-interop-string/mod.js | 1 + .../test/fixtures/commonjs/exec-interop-string/options.json | 5 +++++ .../test/fixtures/misc/copy-getters-setters-star/output.js | 2 +- .../auto-esm-unsupported-import-unsupported/output.js | 4 +++- .../test/fixtures/dynamic-import/modules-amd/output.js | 4 +++- .../test/fixtures/dynamic-import/modules-cjs/output.js | 4 +++- 11 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/exec.js create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/mod.js create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/options.json create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/exec.js create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/mod.js create mode 100644 packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/options.json diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index e54dd6444558..32cbee4fc000 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -620,6 +620,10 @@ helpers.interopRequireWildcard = helper("7.0.0-beta.0")` 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); diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/exec.js b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/exec.js new file mode 100644 index 000000000000..a1d2711151d0 --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/exec.js @@ -0,0 +1,3 @@ +return import("./mod.js").then(({ default: def }) => { + expect(def).toBe(null); +}); diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/mod.js b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/mod.js new file mode 100644 index 000000000000..c8a9c8ebee78 --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/mod.js @@ -0,0 +1 @@ +module.exports = null; \ No newline at end of file diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/options.json new file mode 100644 index 000000000000..eeebc1a57738 --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-null/options.json @@ -0,0 +1,5 @@ +{ + "parserOpts": { + "allowReturnOutsideFunction": true + } +} diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/exec.js b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/exec.js new file mode 100644 index 000000000000..e228b3fbc3a9 --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/exec.js @@ -0,0 +1,3 @@ +return import("./mod.js").then(({ default: def }) => { + expect(def).toBe("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="); +}); diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/mod.js b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/mod.js new file mode 100644 index 000000000000..bfd0466f4c1d --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/mod.js @@ -0,0 +1 @@ +module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="; \ No newline at end of file diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/options.json new file mode 100644 index 000000000000..eeebc1a57738 --- /dev/null +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/exec-interop-string/options.json @@ -0,0 +1,5 @@ +{ + "parserOpts": { + "allowReturnOutsideFunction": true + } +} 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 90b458ba8d18..f17e16f9dacf 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; } 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 = {}; 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; } 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 b49aa8ea3bd9..d71f23bfef4b 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 @@ -1,8 +1,10 @@ "use strict"; +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 _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; } 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 = {}; 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; } 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 7932f5924429..000247047cd4 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 @@ -1,7 +1,9 @@ define(["require"], function (_require) { + 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 _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; } 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 = {}; 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; } 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 b49aa8ea3bd9..d71f23bfef4b 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 @@ -1,8 +1,10 @@ "use strict"; +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 _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; } 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 = {}; 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; } Promise.resolve().then(function () { return _interopRequireWildcard(require("foo")); From 5b40845afe22fb0e2dad84a1dbad5d2dadf009b1 Mon Sep 17 00:00:00 2001 From: Matthew Whitworth Date: Mon, 21 Oct 2019 16:39:03 +0100 Subject: [PATCH 143/965] 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 144/965] 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 145/965] 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 @@ v6 npm Downloads

- Travis Status + Travis Status CircleCI Status Coverage Status Slack Status From fce1b741054ef52d0c9710e6dfd8ec78b3c6e618 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 24 Oct 2019 08:28:01 -0500 Subject: [PATCH 146/965] 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 147/965] =?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 148/965] 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 149/965] 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 150/965] [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 151/965] =?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 152/965] [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 153/965] 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 154/965] 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 155/965] 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 156/965] 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 157/965] [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 158/965] 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 159/965] 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 160/965] 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 161/965] 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 162/965] =?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 163/965] 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 164/965] 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 165/965] 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. /\(? 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\nyyy'); + +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 166/965] [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 167/965] 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 168/965] 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 169/965] 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 170/965] 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 171/965] 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 172/965] 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 173/965] 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 174/965] 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 175/965] 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 176/965] [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 177/965] [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 178/965] 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 179/965] 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 180/965] =?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 181/965] 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 182/965] @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 183/965] 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 184/965] 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; listKey: ?string; - inList: boolean; - parentKey: ?string; key: ?string; node: ?Object; scope: Scope; type: ?string; - typeAnnotation: ?Object; static get({ hub, parentPath, parent, container, listKey, key }): NodePath { if (!hub && parentPath) { @@ -111,10 +109,16 @@ export default class NodePath { } setData(key: string, val: any): any { + if (this.data == null) { + this.data = Object.create(null); + } return (this.data[key] = val); } getData(key: string, def?: any): any { + if (this.data == null) { + this.data = Object.create(null); + } let val = this.data[key]; if (val === undefined && def !== undefined) val = this.data[key] = def; return val; @@ -152,6 +156,49 @@ export default class NodePath { toString() { return generator(this.node).code; } + + get inList() { + return !!this.listKey; + } + + get parentKey() { + return this.listKey || this.key; + } + + get shouldSkip() { + return !!(this._traverseFlags & SHOULD_SKIP); + } + + set shouldSkip(v) { + if (v) { + this._traverseFlags |= SHOULD_SKIP; + } else { + this._traverseFlags &= ~SHOULD_SKIP; + } + } + + get shouldStop() { + return !!(this._traverseFlags & SHOULD_STOP); + } + + set shouldStop(v) { + if (v) { + this._traverseFlags |= SHOULD_STOP; + } else { + this._traverseFlags &= ~SHOULD_STOP; + } + } + + get removed() { + return !!(this._traverseFlags & REMOVED); + } + set removed(v) { + if (v) { + this._traverseFlags |= REMOVED; + } else { + this._traverseFlags &= ~REMOVED; + } + } } Object.assign( diff --git a/packages/babel-traverse/src/path/removal.js b/packages/babel-traverse/src/path/removal.js index b4d1330b256d..9ddf0a201448 100644 --- a/packages/babel-traverse/src/path/removal.js +++ b/packages/babel-traverse/src/path/removal.js @@ -1,6 +1,7 @@ // This file contains methods responsible for removing a node. import { hooks } from "./lib/removal-hooks"; +import { REMOVED, SHOULD_SKIP } from "./index"; export function remove() { this._assertUnremoved(); @@ -39,8 +40,8 @@ export function _remove() { } export function _markRemoved() { - this.shouldSkip = true; - this.removed = true; + // this.shouldSkip = true; this.removed = true; + this._traverseFlags |= SHOULD_SKIP | REMOVED; this.node = null; } From cdbffe39908cbb5f69f4f67363a715378f9dbb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 11:25:15 +0100 Subject: [PATCH 185/965] Remove --require-scripts from publish-ci [skip ci] --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index acec39fa4486..2c077a3fbd87 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ else echo "Missing NPM_TOKEN env var" exit 1 endif - yarn lerna publish from-git --require-scripts --yes + yarn lerna publish from-git --yes rm -f .npmrc $(MAKE) clean From 97faa83953cb87e332554fa559a4956d202343ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 11:27:14 +0100 Subject: [PATCH 186/965] v7.7.0 --- lerna.json | 2 +- packages/babel-cli/package.json | 4 +- packages/babel-core/package.json | 14 +++---- packages/babel-generator/package.json | 6 +-- .../package.json | 4 +- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 4 +- .../babel-helper-call-delegate/package.json | 8 ++-- .../package.json | 14 +++---- .../package.json | 4 +- packages/babel-helper-define-map/package.json | 6 +-- .../package.json | 6 +-- .../babel-helper-explode-class/package.json | 8 ++-- .../babel-helper-function-name/package.json | 8 ++-- .../package.json | 4 +- .../babel-helper-hoist-variables/package.json | 4 +- .../package.json | 4 +- .../babel-helper-module-imports/package.json | 6 +-- .../package.json | 12 +++--- .../package.json | 4 +- .../package.json | 12 +++--- .../babel-helper-replace-supers/package.json | 10 ++--- .../babel-helper-simple-access/package.json | 6 +-- .../package.json | 4 +- .../babel-helper-wrap-function/package.json | 10 ++--- packages/babel-helpers/package.json | 8 ++-- packages/babel-node/package.json | 6 +-- packages/babel-parser/package.json | 2 +- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 4 +- .../package.json | 6 +-- .../package.json | 6 +-- .../babel-plugin-syntax-flow/package.json | 4 +- .../package.json | 4 +- .../package.json | 8 ++-- .../package.json | 16 +++---- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 8 ++-- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 6 +-- .../package.json | 4 +- .../package.json | 6 +-- .../package.json | 6 +-- packages/babel-polyfill/package.json | 2 +- .../babel-preset-env-standalone/package.json | 10 ++--- packages/babel-preset-env/package.json | 38 ++++++++--------- packages/babel-preset-react/package.json | 6 +-- packages/babel-preset-typescript/package.json | 6 +-- packages/babel-register/package.json | 4 +- packages/babel-runtime-corejs2/package.json | 4 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 8 ++-- packages/babel-standalone/package.json | 42 +++++++++---------- packages/babel-template/package.json | 6 +-- packages/babel-traverse/package.json | 12 +++--- packages/babel-types/package.json | 6 +-- 62 files changed, 232 insertions(+), 232 deletions(-) diff --git a/lerna.json b/lerna.json index 551e14079f47..33ce123064ca 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.6.4", + "version": "7.7.0", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 843c7c3c8787..0328b7596c27 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.6.4", + "version": "7.7.0", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -35,7 +35,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.4", + "@babel/core": "^7.7.0", "@babel/helper-fixtures": "^7.6.3" }, "bin": { diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index f4dd6723634d..d07ab536efce 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.6.4", + "version": "7.7.0", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,12 +34,12 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.4", - "@babel/helpers": "^7.6.2", - "@babel/parser": "^7.6.4", - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.0", + "@babel/helpers": "^7.7.0", + "@babel/parser": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 92dc51d1bda9..a51ad5d38e7c 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.6.4", + "version": "7.7.0", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,13 +14,13 @@ "lib" ], "dependencies": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.6.4" + "@babel/parser": "^7.7.0" } } diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index 0ccaace9f494..49ad791e871f 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-annotate-as-pure", - "version": "7.0.0", + "version": "7.7.0", "description": "Helper function to annotate paths and nodes with #__PURE__ comment", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index 0b3c4c587696..855c07d721a1 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-bindify-decorators", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to bindify decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json index f52081203a1e..de2fdf665951 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to build binary assignment operator visitors", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/helper-explode-assignable-expression": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index cf082d88cf9c..d0d46f8fecb1 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-react-jsx", - "version": "7.3.0", + "version": "7.7.0", "description": "Helper function to build react jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3", + "@babel/types": "^7.7.0", "esutils": "^2.0.0" } } diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index c7e9e0222d25..e978c18e56b5 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-call-delegate", - "version": "7.4.4", + "version": "7.7.0", "description": "Helper function to call delegate", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.4.4", - "@babel/traverse": "^7.4.4", - "@babel/types": "^7.6.3" + "@babel/helper-hoist-variables": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-create-class-features-plugin/package.json b/packages/babel-helper-create-class-features-plugin/package.json index 3884dece47f5..10a9d838580a 100644 --- a/packages/babel-helper-create-class-features-plugin/package.json +++ b/packages/babel-helper-create-class-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-class-features-plugin", - "version": "7.6.0", + "version": "7.7.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile class public and private fields, private methods and decorators to ES6", @@ -14,18 +14,18 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-member-expression-to-functions": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5", - "@babel/helper-split-export-declaration": "^7.4.4" + "@babel/helper-replace-supers": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index 7d49d45d507b..71abede86fb5 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-regexp-features-plugin", - "version": "7.6.0", + "version": "7.7.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile ESNext Regular Expressions to ES5", @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index ac574448da1f..dd8f635f8fc2 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-define-map", - "version": "7.5.5", + "version": "7.7.0", "description": "Helper function to define a map", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.1.0", - "@babel/types": "^7.6.3", + "@babel/helper-function-name": "^7.7.0", + "@babel/types": "^7.7.0", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index 8cbf2aaeb781..3dd23b0405c3 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-assignable-expression", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to explode an assignable expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index 630951905259..a30a169acc57 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-class", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to explode class", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-bindify-decorators": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/helper-bindify-decorators": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index ab39d5f4d5db..c4a46b4c9279 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-function-name", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to change the property 'name' of every function", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-get-function-arity": "^7.0.0", - "@babel/template": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/helper-get-function-arity": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index ec3f4a85c2cf..a9ab2ebebed2 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-get-function-arity", - "version": "7.0.0", + "version": "7.7.0", "description": "Helper function to get function arity", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index 98cb86eec955..51acf5b0def5 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-hoist-variables", - "version": "7.4.4", + "version": "7.7.0", "description": "Helper function to hoist variables", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-member-expression-to-functions/package.json b/packages/babel-helper-member-expression-to-functions/package.json index 571c84a18a7b..ddf3f9e002ce 100644 --- a/packages/babel-helper-member-expression-to-functions/package.json +++ b/packages/babel-helper-member-expression-to-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-member-expression-to-functions", - "version": "7.5.5", + "version": "7.7.0", "description": "Helper function to replace certain member expressions with function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions", "license": "MIT", @@ -10,6 +10,6 @@ "main": "lib/index.js", "author": "Justin Ridgewell ", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index 7e6bad8b26c9..ee5f134217e3 100644 --- a/packages/babel-helper-module-imports/package.json +++ b/packages/babel-helper-module-imports/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-imports", - "version": "7.0.0", + "version": "7.7.0", "description": "Babel helper functions for inserting module loads", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,9 +11,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports", "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" }, "devDependencies": { - "@babel/core": "^7.0.0" + "@babel/core": "^7.7.0" } } diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index f8f7ef94092a..7d1e61d78dfa 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-transforms", - "version": "7.5.5", + "version": "7.7.0", "description": "Babel helper functions for implementing ES6 module transformations", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,11 +11,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-imports": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/template": "^7.4.4", - "@babel/types": "^7.6.3", + "@babel/helper-module-imports": "^7.7.0", + "@babel/helper-simple-access": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index 9c9245260c78..374d7d4ba5f2 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-optimise-call-expression", - "version": "7.0.0", + "version": "7.7.0", "description": "Helper function to optimise call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-remap-async-to-generator/package.json b/packages/babel-helper-remap-async-to-generator/package.json index e0033b85c2c4..09149e3704de 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-remap-async-to-generator", - "version": "7.1.0", + "version": "7.7.0", "description": "Helper function to remap async functions to generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", "license": "MIT", @@ -9,10 +9,10 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-wrap-function": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/helper-annotate-as-pure": "^7.7.0", + "@babel/helper-wrap-function": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index b762e5ea0f2a..1291e2a4a9a2 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-replace-supers", - "version": "7.5.5", + "version": "7.7.0", "description": "Helper function to replace supers", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.5.5", - "@babel/helper-optimise-call-expression": "^7.0.0", - "@babel/traverse": "^7.5.5", - "@babel/types": "^7.6.3" + "@babel/helper-member-expression-to-functions": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index 4fd9ee272372..b904fc3e757f 100644 --- a/packages/babel-helper-simple-access/package.json +++ b/packages/babel-helper-simple-access/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-simple-access", - "version": "7.1.0", + "version": "7.7.0", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,7 +11,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/template": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json index e4ae3ae051fe..c877e501f0d3 100644 --- a/packages/babel-helper-split-export-declaration/package.json +++ b/packages/babel-helper-split-export-declaration/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-split-export-declaration", - "version": "7.4.4", + "version": "7.7.0", "description": "", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.6.3" + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index 6d06942e0e5c..743c33bf99a4 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-wrap-function", - "version": "7.2.0", + "version": "7.7.0", "description": "Helper to wrap functions inside a function call.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.1.0", - "@babel/template": "^7.1.0", - "@babel/traverse": "^7.1.0", - "@babel/types": "^7.6.3" + "@babel/helper-function-name": "^7.7.0", + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 555a469caa6f..31ff1ee3c5a5 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.6.2", + "version": "7.7.0", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -11,9 +11,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.6.0", - "@babel/traverse": "^7.6.2", - "@babel/types": "^7.6.3" + "@babel/template": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0" }, "devDependencies": { "@babel/helper-plugin-test-runner": "^7.0.0" diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 737f8eadf884..ace2ab57c6ad 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.6.3", + "version": "7.7.0", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -19,7 +19,7 @@ "compiler" ], "dependencies": { - "@babel/register": "^7.6.2", + "@babel/register": "^7.7.0", "commander": "^2.8.1", "core-js": "^3.2.1", "lodash": "^4.17.13", @@ -31,7 +31,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.7.0", "@babel/helper-fixtures": "^7.6.3", "fs-readdir-recursive": "^1.0.0", "make-dir": "^2.1.0" diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 3760270b1672..0226cc56e6bd 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.6.4", + "version": "7.7.0", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-plugin-proposal-async-generator-functions/package.json b/packages/babel-plugin-proposal-async-generator-functions/package.json index 81db9bcc3d53..276aa93ea371 100644 --- a/packages/babel-plugin-proposal-async-generator-functions/package.json +++ b/packages/babel-plugin-proposal-async-generator-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-async-generator-functions", - "version": "7.2.0", + "version": "7.7.0", "description": "Turn async generator functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions", "license": "MIT", @@ -13,14 +13,14 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0", + "@babel/helper-remap-async-to-generator": "^7.7.0", "@babel/plugin-syntax-async-generators": "^7.2.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-class-properties/package.json b/packages/babel-plugin-proposal-class-properties/package.json index 9a11e1c822a6..5036770a07d3 100644 --- a/packages/babel-plugin-proposal-class-properties/package.json +++ b/packages/babel-plugin-proposal-class-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-class-properties", - "version": "7.5.5", + "version": "7.7.0", "description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.5.5", + "@babel/helper-create-class-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index 6278dff8e544..e7f9f4de57e3 100644 --- a/packages/babel-plugin-proposal-decorators/package.json +++ b/packages/babel-plugin-proposal-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-decorators", - "version": "7.6.0", + "version": "7.7.0", "author": "Logan Smyth ", "license": "MIT", "publishConfig": { @@ -15,7 +15,7 @@ "decorators" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.6.0", + "@babel/helper-create-class-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-decorators": "^7.2.0" }, @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-dynamic-import/package.json b/packages/babel-plugin-proposal-dynamic-import/package.json index a691155641e4..1ade94814252 100644 --- a/packages/babel-plugin-proposal-dynamic-import/package.json +++ b/packages/babel-plugin-proposal-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-dynamic-import", - "version": "7.5.0", + "version": "7.7.0", "description": "Transform import() expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-function-sent/package.json b/packages/babel-plugin-proposal-function-sent/package.json index 0ba394b625af..f8335257f1a6 100644 --- a/packages/babel-plugin-proposal-function-sent/package.json +++ b/packages/babel-plugin-proposal-function-sent/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-function-sent", - "version": "7.5.0", + "version": "7.7.0", "description": "Compile the function.sent meta property to valid ES2015 code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-sent", "license": "MIT", @@ -13,14 +13,14 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-wrap-function": "^7.2.0", + "@babel/helper-wrap-function": "^7.7.0", "@babel/plugin-syntax-function-sent": "^7.2.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index cfb844aeb1bc..b478bbdde033 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-unicode-property-regex", - "version": "7.6.2", + "version": "7.7.0", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -22,14 +22,14 @@ "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-create-regexp-features-plugin": "^7.6.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-syntax-flow/package.json b/packages/babel-plugin-syntax-flow/package.json index 864023567a5d..2885aa9f81ec 100644 --- a/packages/babel-plugin-syntax-flow/package.json +++ b/packages/babel-plugin-syntax-flow/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-flow", - "version": "7.2.0", + "version": "7.7.0", "description": "Allow parsing of the flow syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.0" } } diff --git a/packages/babel-plugin-syntax-top-level-await/package.json b/packages/babel-plugin-syntax-top-level-await/package.json index 8411ce39f938..5b42d9a1f1c9 100644 --- a/packages/babel-plugin-syntax-top-level-await/package.json +++ b/packages/babel-plugin-syntax-top-level-await/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-top-level-await", - "version": "7.6.4", + "version": "7.7.0", "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", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4" + "@babel/core": "^7.7.0" } } diff --git a/packages/babel-plugin-transform-async-to-generator/package.json b/packages/babel-plugin-transform-async-to-generator/package.json index d6b8b908e89a..7703da8097fe 100644 --- a/packages/babel-plugin-transform-async-to-generator/package.json +++ b/packages/babel-plugin-transform-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-async-to-generator", - "version": "7.5.0", + "version": "7.7.0", "description": "Turn async functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator", "license": "MIT", @@ -12,15 +12,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.1.0" + "@babel/helper-remap-async-to-generator": "^7.7.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-classes/package.json b/packages/babel-plugin-transform-classes/package.json index f1fcc8a2e80b..cfb696cf0a8f 100644 --- a/packages/babel-plugin-transform-classes/package.json +++ b/packages/babel-plugin-transform-classes/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-classes", - "version": "7.5.5", + "version": "7.7.0", "description": "Compile ES2015 classes to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes", "license": "MIT", @@ -9,13 +9,13 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.0.0", - "@babel/helper-define-map": "^7.5.5", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-annotate-as-pure": "^7.7.0", + "@babel/helper-define-map": "^7.7.0", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-optimise-call-expression": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5", - "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/helper-replace-supers": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", "globals": "^11.1.0" }, "keywords": [ @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 4ace562398ab..77dc9f4deb5e 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-dotall-regex", - "version": "7.6.2", + "version": "7.7.0", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -18,14 +18,14 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex", "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.6.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-function-name/package.json b/packages/babel-plugin-transform-function-name/package.json index 2a03ae1b21ac..c6be0eee3d0a 100644 --- a/packages/babel-plugin-transform-function-name/package.json +++ b/packages/babel-plugin-transform-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-function-name", - "version": "7.4.4", + "version": "7.7.0", "description": "Apply ES2015 function.name semantics to all functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.1.0", + "@babel/helper-function-name": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index e6f010f39412..2b278105db8c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.6.0", + "version": "7.7.0", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.4.4", + "@babel/helper-module-transforms": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-simple-access": "^7.7.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, "keywords": [ @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-object-rest-spread": "^7.2.0" } diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index d827ae959527..381c7ba180a3 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-systemjs", - "version": "7.5.0", + "version": "7.7.0", "description": "This plugin transforms ES2015 modules to SystemJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.4.4", + "@babel/helper-hoist-variables": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0" } diff --git a/packages/babel-plugin-transform-modules-umd/package.json b/packages/babel-plugin-transform-modules-umd/package.json index 9dd0f73213e6..8db718dec04f 100644 --- a/packages/babel-plugin-transform-modules-umd/package.json +++ b/packages/babel-plugin-transform-modules-umd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-umd", - "version": "7.2.0", + "version": "7.7.0", "description": "This plugin transforms ES2015 modules to UMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-module-transforms": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "keywords": [ @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } 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 3d1b894fc89a..8186a98c0685 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.6.3", + "version": "7.7.0", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -21,13 +21,13 @@ }, "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.6.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.0" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0", "core-js": "^3.2.1", "core-js-pure": "^3.2.1" diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index 5af70957b122..a3c3b36d70e1 100644 --- a/packages/babel-plugin-transform-react-jsx/package.json +++ b/packages/babel-plugin-transform-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx", - "version": "7.3.0", + "version": "7.7.0", "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", @@ -12,7 +12,7 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.3.0", + "@babel/helper-builder-react-jsx": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-jsx": "^7.2.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index 9dbdaa4c6c7c..503edd243e8a 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -2,7 +2,7 @@ "name": "@babel/plugin-transform-regenerator", "author": "Ben Newman ", "description": "Explode async and generator functions into a state machine.", - "version": "7.4.5", + "version": "7.7.0", "homepage": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "main": "lib/index.js", @@ -17,7 +17,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.5", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index c685bcda9077..2c96f987306f 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.6.3", + "version": "7.7.0", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -13,7 +13,7 @@ "typescript" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.6.0", + "@babel/helper-create-class-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-syntax-typescript": "^7.2.0" }, @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index 647fb228ce30..f71c3d1dd38b 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-unicode-regex", - "version": "7.6.2", + "version": "7.7.0", "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.6.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index d3a4055dadf1..013e949556e3 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@babel/polyfill", - "version": "7.6.0", + "version": "7.7.0", "description": "Provides polyfills necessary for a full ES2015+ environment", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index bdda607f1596..42e20fb08b71 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.6.3", + "version": "7.7.0", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -12,12 +12,12 @@ "prepublishOnly": "cd ../.. && make prepublish-build-preset-env-standalone" }, "devDependencies": { - "@babel/plugin-proposal-dynamic-import": "^7.5.0", + "@babel/plugin-proposal-dynamic-import": "^7.7.0", "@babel/plugin-proposal-json-strings": "^7.0.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.3", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.6.3", - "@babel/standalone": "^7.6.3" + "@babel/preset-env": "^7.7.0", + "@babel/standalone": "^7.7.0" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 5cfecce86f6b..a8182900bf5c 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.6.3", + "version": "7.7.0", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -14,52 +14,52 @@ "build-data": "node ./scripts/build-data.js; node ./scripts/build-modules-support.js" }, "dependencies": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", - "@babel/plugin-proposal-dynamic-import": "^7.5.0", + "@babel/plugin-proposal-async-generator-functions": "^7.7.0", + "@babel/plugin-proposal-dynamic-import": "^7.7.0", "@babel/plugin-proposal-json-strings": "^7.2.0", "@babel/plugin-proposal-object-rest-spread": "^7.6.2", "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.6.2", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.0", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@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-syntax-top-level-await": "^7.7.0", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.5.0", + "@babel/plugin-transform-async-to-generator": "^7.7.0", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", "@babel/plugin-transform-block-scoping": "^7.6.3", - "@babel/plugin-transform-classes": "^7.5.5", + "@babel/plugin-transform-classes": "^7.7.0", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.6.2", + "@babel/plugin-transform-dotall-regex": "^7.7.0", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.4.4", + "@babel/plugin-transform-function-name": "^7.7.0", "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.6.0", - "@babel/plugin-transform-modules-systemjs": "^7.5.0", - "@babel/plugin-transform-modules-umd": "^7.2.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.6.3", + "@babel/plugin-transform-modules-commonjs": "^7.7.0", + "@babel/plugin-transform-modules-systemjs": "^7.7.0", + "@babel/plugin-transform-modules-umd": "^7.7.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-super": "^7.5.5", "@babel/plugin-transform-parameters": "^7.4.4", "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.4.5", + "@babel/plugin-transform-regenerator": "^7.7.0", "@babel/plugin-transform-reserved-words": "^7.2.0", "@babel/plugin-transform-shorthand-properties": "^7.2.0", "@babel/plugin-transform-spread": "^7.6.2", "@babel/plugin-transform-sticky-regex": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.6.2", - "@babel/types": "^7.6.3", + "@babel/plugin-transform-unicode-regex": "^7.7.0", + "@babel/types": "^7.7.0", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", @@ -70,8 +70,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.6.3", - "@babel/core": "^7.6.3", + "@babel/cli": "^7.7.0", + "@babel/core": "^7.7.0", "@babel/helper-fixtures": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index f7a255aa8adb..2793bfb44bc6 100644 --- a/packages/babel-preset-react/package.json +++ b/packages/babel-preset-react/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-react", - "version": "7.6.3", + "version": "7.7.0", "description": "Babel preset for all React plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -13,7 +13,7 @@ "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-transform-react-display-name": "^7.0.0", - "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.7.0", "@babel/plugin-transform-react-jsx-self": "^7.0.0", "@babel/plugin-transform-react-jsx-source": "^7.0.0" }, @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/helper-transform-fixture-test-runner": "^7.6.3" } diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index fb48e54dc063..ce3bb85142c5 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.6.0", + "version": "7.7.0", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -14,13 +14,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.6.0" + "@babel/plugin-transform-typescript": "^7.7.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", + "@babel/core": "^7.7.0", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 397c70c64f87..5edcac8d4e97 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.6.2", + "version": "7.7.0", "description": "babel require hook", "license": "MIT", "publishConfig": { @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", + "@babel/core": "^7.7.0", "default-require-extensions": "^2.0.0" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 3b2a4defd8c7..b8d0bc49be4c 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.6.3", + "version": "7.7.0", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { @@ -13,6 +13,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.6.2" + "@babel/helpers": "^7.7.0" } } diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 55b4e26b6571..0948273e927f 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.6.3", + "version": "7.7.0", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index afdb001717db..df8449b3858c 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,14 +1,14 @@ { "name": "@babel/runtime", - "version": "7.6.3", + "version": "7.7.0", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { "access": "public" }, "repository": { - "type" : "git", - "url" : "https://github.com/babel/babel.git", + "type": "git", + "url": "https://github.com/babel/babel.git", "directory": "packages/babel-runtime" }, "homepage": "https://babeljs.io/docs/en/next/babel-runtime", @@ -17,6 +17,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.6.2" + "@babel/helpers": "^7.7.0" } } diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index bfed051647ec..4aaa2d7aa0f5 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.6.4", + "version": "7.7.0", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -12,17 +12,17 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.6.4", + "@babel/core": "^7.7.0", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", - "@babel/plugin-proposal-async-generator-functions": "^7.2.0", - "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-decorators": "^7.6.0", + "@babel/plugin-proposal-async-generator-functions": "^7.7.0", + "@babel/plugin-proposal-class-properties": "^7.7.0", + "@babel/plugin-proposal-decorators": "^7.7.0", "@babel/plugin-proposal-do-expressions": "^7.6.0", "@babel/plugin-proposal-export-default-from": "^7.5.2", "@babel/plugin-proposal-export-namespace-from": "^7.5.2", "@babel/plugin-proposal-function-bind": "^7.2.0", - "@babel/plugin-proposal-function-sent": "^7.5.0", + "@babel/plugin-proposal-function-sent": "^7.7.0", "@babel/plugin-proposal-json-strings": "^7.2.0", "@babel/plugin-proposal-logical-assignment-operators": "^7.2.0", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", @@ -33,7 +33,7 @@ "@babel/plugin-proposal-pipeline-operator": "^7.5.0", "@babel/plugin-proposal-private-methods": "^7.6.0", "@babel/plugin-proposal-throw-expressions": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.6.2", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.0", "@babel/plugin-syntax-async-generators": "^7.2.0", "@babel/plugin-syntax-class-properties": "^7.2.0", "@babel/plugin-syntax-decorators": "^7.2.0", @@ -41,7 +41,7 @@ "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-syntax-export-default-from": "^7.2.0", "@babel/plugin-syntax-export-namespace-from": "^7.2.0", - "@babel/plugin-syntax-flow": "^7.2.0", + "@babel/plugin-syntax-flow": "^7.7.0", "@babel/plugin-syntax-function-bind": "^7.2.0", "@babel/plugin-syntax-function-sent": "^7.2.0", "@babel/plugin-syntax-import-meta": "^7.2.0", @@ -51,27 +51,27 @@ "@babel/plugin-syntax-pipeline-operator": "^7.5.0", "@babel/plugin-syntax-typescript": "^7.3.3", "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.5.0", + "@babel/plugin-transform-async-to-generator": "^7.7.0", "@babel/plugin-transform-block-scoped-functions": "^7.2.0", "@babel/plugin-transform-block-scoping": "^7.6.3", - "@babel/plugin-transform-classes": "^7.5.5", + "@babel/plugin-transform-classes": "^7.7.0", "@babel/plugin-transform-computed-properties": "^7.2.0", "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.6.2", + "@babel/plugin-transform-dotall-regex": "^7.7.0", "@babel/plugin-transform-duplicate-keys": "^7.5.0", "@babel/plugin-transform-exponentiation-operator": "^7.2.0", "@babel/plugin-transform-flow-comments": "^7.6.3", "@babel/plugin-transform-flow-strip-types": "^7.6.3", "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.4.4", + "@babel/plugin-transform-function-name": "^7.7.0", "@babel/plugin-transform-instanceof": "^7.5.5", "@babel/plugin-transform-jscript": "^7.2.0", "@babel/plugin-transform-literals": "^7.2.0", "@babel/plugin-transform-member-expression-literals": "^7.2.0", "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.6.0", - "@babel/plugin-transform-modules-systemjs": "^7.5.0", - "@babel/plugin-transform-modules-umd": "^7.2.0", + "@babel/plugin-transform-modules-commonjs": "^7.7.0", + "@babel/plugin-transform-modules-systemjs": "^7.7.0", + "@babel/plugin-transform-modules-umd": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/plugin-transform-object-assign": "^7.2.0", "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.2.0", @@ -83,11 +83,11 @@ "@babel/plugin-transform-react-constant-elements": "^7.6.3", "@babel/plugin-transform-react-display-name": "^7.2.0", "@babel/plugin-transform-react-inline-elements": "^7.2.0", - "@babel/plugin-transform-react-jsx": "^7.3.0", + "@babel/plugin-transform-react-jsx": "^7.7.0", "@babel/plugin-transform-react-jsx-compat": "^7.2.0", "@babel/plugin-transform-react-jsx-self": "^7.2.0", "@babel/plugin-transform-react-jsx-source": "^7.5.0", - "@babel/plugin-transform-regenerator": "^7.4.5", + "@babel/plugin-transform-regenerator": "^7.7.0", "@babel/plugin-transform-reserved-words": "^7.2.0", "@babel/plugin-transform-runtime": "^7.6.2", "@babel/plugin-transform-shorthand-properties": "^7.2.0", @@ -96,11 +96,11 @@ "@babel/plugin-transform-strict-mode": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-typescript": "^7.6.3", - "@babel/plugin-transform-unicode-regex": "^7.6.2", + "@babel/plugin-transform-typescript": "^7.7.0", + "@babel/plugin-transform-unicode-regex": "^7.7.0", "@babel/preset-flow": "^7.0.0", - "@babel/preset-react": "^7.6.3", - "@babel/preset-typescript": "^7.6.0" + "@babel/preset-react": "^7.7.0", + "@babel/preset-typescript": "^7.7.0" }, "keywords": [ "babel", diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index cc599610aa84..bf01d6cc6f06 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -1,6 +1,6 @@ { "name": "@babel/template", - "version": "7.6.0", + "version": "7.7.0", "description": "Generate an AST from a string template.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.6.0", - "@babel/types": "^7.6.3" + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0" } } diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 049b656f17f2..2665f5bc77b7 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.6.3", + "version": "7.7.0", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.6.3", - "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.4.4", - "@babel/parser": "^7.6.3", - "@babel/types": "^7.6.3", + "@babel/generator": "^7.7.0", + "@babel/helper-function-name": "^7.7.0", + "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/parser": "^7.7.0", + "@babel/types": "^7.7.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 75b54493ee97..07cff7f4ac60 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.6.3", + "version": "7.7.0", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -17,7 +17,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.6.3", - "@babel/parser": "^7.6.3" + "@babel/generator": "^7.7.0", + "@babel/parser": "^7.7.0" } } From 5f2240e7ab319c8e22cc6d2405364e439968e1e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 12:06:52 +0100 Subject: [PATCH 187/965] Add v7.7.0 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9689c1be5cb1..f0aeed650d2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,108 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 + +## v7.7.0 (2019-11-05) + +#### :eyeglasses: Spec Compliance +* `babel-types` + * [#10621](https://github.com/babel/babel/pull/10621) throw a TypeError if identifier validation fails. ([@dentrado](https://github.com/dentrado)) +* `babel-parser` + * [#10559](https://github.com/babel/babel/pull/10559) fix: Exclude catch clause from let identifier error. ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) + * [#10567](https://github.com/babel/babel/pull/10567) [parser] Exception to 8 and 9 in tagged template. ([@pnowak](https://github.com/pnowak)) + * [#10532](https://github.com/babel/babel/pull/10532) Allow duplicate __proto__ keys in patterns, simple case (#6705). ([@alejo90](https://github.com/alejo90)) + +#### :rocket: New Feature +* `babel-generator`, `babel-helper-create-class-features-plugin`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-preset-typescript`, `babel-types` + * [#10545](https://github.com/babel/babel/pull/10545) Add support for TS declare modifier on fields. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core`, `babel-parser`, `babel-preset-typescript` + * [#10363](https://github.com/babel/babel/pull/10363) @babel/parser error recovery. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core` + * [#10599](https://github.com/babel/babel/pull/10599) Add support for .cjs config files. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10501](https://github.com/babel/babel/pull/10501) Add support for babel.config.json. ([@devongovett](https://github.com/devongovett)) + * [#10361](https://github.com/babel/babel/pull/10361) feat: if code frame error is on a single line, highlight the whole path. ([@SimenB](https://github.com/SimenB)) +* `babel-plugin-syntax-top-level-await`, `babel-preset-env` + * [#10573](https://github.com/babel/babel/pull/10573) Create @babel/plugin-syntax-top-level-await. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-helper-builder-react-jsx`, `babel-plugin-transform-react-jsx`, `babel-preset-react` + * [#10572](https://github.com/babel/babel/pull/10572) [transform-react-jsx] Add useSpread option to transform JSX. ([@ivandevp](https://github.com/ivandevp)) +* `babel-generator`, `babel-parser`, `babel-plugin-proposal-decorators`, `babel-plugin-syntax-flow`, `babel-types` + * [#10344](https://github.com/babel/babel/pull/10344) Flow enums parsing. ([@gkz](https://github.com/gkz)) +* `babel-plugin-transform-function-name`, `babel-plugin-transform-modules-umd`, `babel-preset-env` + * [#10477](https://github.com/babel/babel/pull/10477) Changes UMD callsite to be more likely to pass in the intended object.. ([@MicahZoltu](https://github.com/MicahZoltu)) +* `babel-parser` + * [#10449](https://github.com/babel/babel/pull/10449) Create parser plugin "topLevelAwait". ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10521](https://github.com/babel/babel/pull/10521) [parser] Enable "exportNamespaceFrom" by default. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10483](https://github.com/babel/babel/pull/10483) [parser] Add support for private fields in TypeScript. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-generator`, `babel-parser`, `babel-types` + * [#10543](https://github.com/babel/babel/pull/10543) add assertions signature for TypeScript. ([@tanhauhau](https://github.com/tanhauhau)) +* `babel-cli`, `babel-register` + * [#8622](https://github.com/babel/babel/pull/8622) Make dir for babel --out-file. ([@TrySound](https://github.com/TrySound)) +* `babel-cli` + * [#10399](https://github.com/babel/babel/pull/10399) Closes [#8326](https://github.com/babel/babel/issues/8326), add back --quiet option.. ([@chris-peng-1244](https://github.com/chris-peng-1244)) + +#### :bug: Bug Fix +* `babel-helpers`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-function-sent`, `babel-preset-env` + * [#10422](https://github.com/babel/babel/pull/10422) Correctly delegate .return() in async generator. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs` + * [#10628](https://github.com/babel/babel/pull/10628) Don't throw when destructuring into a var named as an import. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-transform-modules-systemjs` + * [#10638](https://github.com/babel/babel/pull/10638) fix: remove ExportNamedDeclaration when the specifier is empty. ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10631](https://github.com/babel/babel/pull/10631) [TS] Parse calls with type args in optional chains. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10607](https://github.com/babel/babel/pull/10607) fixed missing errors on assignment pattern in object expression. ([@vivek12345](https://github.com/vivek12345)) + * [#10594](https://github.com/babel/babel/pull/10594) [parser] Parse only modifiers of actual methods. ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) +* `babel-plugin-transform-typescript` + * [#10555](https://github.com/babel/babel/pull/10555) [TS] Correctly transform computed strings and templates in enums. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core` + * [#10623](https://github.com/babel/babel/pull/10623) Fix: inputSourceMap should work when it is an external file. ([@JLHwung](https://github.com/JLHwung)) + * [#10539](https://github.com/babel/babel/pull/10539) fix: remove filename annotation in buildCodeFrameError. ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-proposal-decorators` + * [#10578](https://github.com/babel/babel/pull/10578) [decorators] fix: support string literal properties. ([@mwhitworth](https://github.com/mwhitworth)) +* `babel-helpers`, `babel-plugin-proposal-dynamic-import`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env` + * [#10574](https://github.com/babel/babel/pull/10574) fix: _interopRequireWildcard should only cache objects. ([@samMeow](https://github.com/samMeow)) +* `babel-traverse` + * [#9777](https://github.com/babel/babel/pull/9777) [traverse] Allow skipping nodes inserted with .replaceWith(). ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-preset-env` + * [#10146](https://github.com/babel/babel/pull/10146) Inject core-js@3 imports in Program:exit instead of on post(). ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-generator` + * [#10519](https://github.com/babel/babel/pull/10519) Fix generator missing parens around an arrow returning function type. ([@existentialism](https://github.com/existentialism)) +* `babel-plugin-transform-async-to-generator`, `babel-preset-env`, `babel-traverse` + * [#9939](https://github.com/babel/babel/pull/9939) Don't use args rest/spread to hoist super method calls. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :nail_care: Polish +* `babel-plugin-transform-classes`, `babel-plugin-transform-regenerator`, `babel-preset-env` + * [#9481](https://github.com/babel/babel/pull/9481) [preset-env] Don't use async-to-generator when already using regenerator. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-helpers`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env` + * [#10585](https://github.com/babel/babel/pull/10585) fix(babel‑helpers/interopRequireWildcard): Avoid double nullish check. ([@ExE-Boss](https://github.com/ExE-Boss)) +* `babel-register` + * [#10557](https://github.com/babel/babel/pull/10557) fix: disable caching when babel could not read/write cache. ([@JLHwung](https://github.com/JLHwung)) + +#### :house: Internal +* `babel-cli`, `babel-node` + * [#10619](https://github.com/babel/babel/pull/10619) chore: remove output-file-sync dependency. ([@JLHwung](https://github.com/JLHwung)) +* `babel-register` + * [#10614](https://github.com/babel/babel/pull/10614) chore: bump source-map-support to 0.5.14. ([@JLHwung](https://github.com/JLHwung)) +* `babel-helper-create-regexp-features-plugin`, `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-named-capturing-groups-regex`, `babel-plugin-transform-unicode-regex`, `babel-preset-env` + * [#10447](https://github.com/babel/babel/pull/10447) Merge multiple regex transform plugin. ([@JLHwung](https://github.com/JLHwung)) +* `babel-preset-env` + * [#10612](https://github.com/babel/babel/pull/10612) chore: update web.immediate support fixtures. ([@JLHwung](https://github.com/JLHwung)) +* `babel-helper-module-imports` + * [#10608](https://github.com/babel/babel/pull/10608) Use .find instead of .filter to get targetPath in ImportInjector. ([@Andarist](https://github.com/Andarist)) +* Other + * [#10600](https://github.com/babel/babel/pull/10600) Test node@13 on circle. ([@existentialism](https://github.com/existentialism)) + * [#10593](https://github.com/babel/babel/pull/10593) chore: replace outdated travis-ci.org badges [ci skip]. ([@JLHwung](https://github.com/JLHwung)) + * [#10591](https://github.com/babel/babel/pull/10591) chore: test against Node.js 13. ([@JLHwung](https://github.com/JLHwung)) + * [#10556](https://github.com/babel/babel/pull/10556) Add master branch workflow for test262 tests. ([@jbhoosreddy](https://github.com/jbhoosreddy)) + * [#10553](https://github.com/babel/babel/pull/10553) chore: introduce envinfo into environment section. ([@JLHwung](https://github.com/JLHwung)) +* `babel-runtime` + * [#10418](https://github.com/babel/babel/pull/10418) docs: add homepage link. ([@DanArthurGallagher](https://github.com/DanArthurGallagher)) +* `babel-helper-annotate-as-pure`, `babel-helper-bindify-decorators`, `babel-helper-builder-binary-assignment-operator-visitor`, `babel-helper-builder-react-jsx`, `babel-helper-call-delegate`, `babel-helper-define-map`, `babel-helper-explode-assignable-expression`, `babel-helper-explode-class`, `babel-helper-function-name`, `babel-helper-get-function-arity`, `babel-helper-hoist-variables`, `babel-helper-member-expression-to-functions`, `babel-helper-module-imports`, `babel-helper-module-transforms`, `babel-helper-optimise-call-expression`, `babel-helper-remap-async-to-generator`, `babel-helper-replace-supers`, `babel-helper-simple-access`, `babel-helper-split-export-declaration`, `babel-helper-wrap-function`, `babel-helpers`, `babel-template` + * [#10568](https://github.com/babel/babel/pull/10568) Bump babel-types to ^7.6.3. ([@JLHwung](https://github.com/JLHwung)) + +#### :running_woman: Performance +* `babel-traverse` + * [#10480](https://github.com/babel/babel/pull/10480) Traverse performance. ([@JLHwung](https://github.com/JLHwung)) + ## v7.6.4 (2019-10-10) #### :eyeglasses: Spec Compliance From f8eb290da121c65566f1ce1db90de0b1a9b8e186 Mon Sep 17 00:00:00 2001 From: Archer <836524655@qq.com> Date: Tue, 5 Nov 2019 21:39:14 +0800 Subject: [PATCH 188/965] =?UTF-8?q?Fix(babel-preset-env):=20check=20api.ca?= =?UTF-8?q?ller=20is=20a=20function=20to=20avoid=E2=80=A6=20(#10649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/babel-preset-env/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js index 1c0b08f853df..17740c4c3586 100644 --- a/packages/babel-preset-env/src/index.js +++ b/packages/babel-preset-env/src/index.js @@ -237,7 +237,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), + shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait), }); const pluginNames = filterItems( From bf48fca6a07301b536b9cf94edd935dd1072c979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 14:43:23 +0100 Subject: [PATCH 189/965] =?UTF-8?q?Revert=20"throw=20a=20TypeError=20if=20?= =?UTF-8?q?identifier=20validation=20fails=20(#106=E2=80=A6=20(#10650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c7d8b8a37752f42163128cf4d5e8b54c2637cec4. --- 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, 3 insertions(+), 13 deletions(-) delete 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 2b7802096cd9..09c41c9119a9 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -1,5 +1,5 @@ // @flow -import isIdentifierName from "../validators/isIdentifierName"; +import isValidIdentifier from "../validators/isValidIdentifier"; import { BINARY_OPERATORS, @@ -406,8 +406,8 @@ defineType("Identifier", { ...patternLikeCommon, name: { validate: chain(function(node, key, val) { - if (!isIdentifierName(val)) { - throw new TypeError(`"${val}" is not a valid identifer name`); + if (!isValidIdentifier(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 a34588c85c06..d3311dfc9f2f 100644 --- a/packages/babel-types/src/index.js +++ b/packages/babel-types/src/index.js @@ -109,7 +109,6 @@ 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 deleted file mode 100644 index 9cae809217cf..000000000000 --- a/packages/babel-types/src/validators/isIdentifierName.js +++ /dev/null @@ -1,9 +0,0 @@ -// @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 42c8e0fb2f44734f175941859952b3c909e20304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 5 Nov 2019 14:44:00 +0100 Subject: [PATCH 190/965] v7.7.1 --- lerna.json | 2 +- packages/babel-preset-env-standalone/package.json | 6 +++--- packages/babel-preset-env/package.json | 4 ++-- packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 2 +- packages/babel-types/package.json | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lerna.json b/lerna.json index 33ce123064ca..7abfa608d2a3 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.0", + "version": "7.7.1", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 42e20fb08b71..feb9d499c0ae 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.0", + "version": "7.7.1", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -16,8 +16,8 @@ "@babel/plugin-proposal-json-strings": "^7.0.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.7.0", - "@babel/standalone": "^7.7.0" + "@babel/preset-env": "^7.7.1", + "@babel/standalone": "^7.7.1" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index a8182900bf5c..7648965e88be 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.0", + "version": "7.7.1", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -59,7 +59,7 @@ "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", "@babel/plugin-transform-unicode-regex": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/types": "^7.7.1", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index b8d0bc49be4c..501e5f0ea62c 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.0", + "version": "7.7.1", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 0948273e927f..ea5650549784 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.0", + "version": "7.7.1", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index df8449b3858c..6e7e3faf9e98 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.0", + "version": "7.7.1", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 4aaa2d7aa0f5..30290bb81ad7 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.0", + "version": "7.7.1", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 07cff7f4ac60..fbf76658006d 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.7.0", + "version": "7.7.1", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From d3db02da308d088d030d73995f202465418f5295 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Tue, 5 Nov 2019 13:50:36 +0000 Subject: [PATCH 191/965] Add v7.7.1 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0aeed650d2e..d5da577f4fd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,13 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.7.1 (2019-11-05) + +#### :bug: Bug Fix +* `babel-types` + * [#10650](https://github.com/babel/babel/pull/10650) Revert "throw a TypeError if identifier validation fails (#10621)" ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-preset-env` + * [#10649](https://github.com/babel/babel/pull/10649) Fix(babel-preset-env): check api.caller is a function to avoid to thr… ([@love2me](https://github.com/love2me)) ## v7.7.0 (2019-11-05) From f544753bb8c9c7a470d98e897b089fd31b83d1f6 Mon Sep 17 00:00:00 2001 From: njlr Date: Tue, 5 Nov 2019 14:40:57 +0000 Subject: [PATCH 192/965] code style: consistent spacing (#10643) [ci-skip] Makes spacing consistent --- packages/babel-preset-typescript/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-preset-typescript/src/index.js b/packages/babel-preset-typescript/src/index.js index f7dc5eefae00..f3159543f66d 100644 --- a/packages/babel-preset-typescript/src/index.js +++ b/packages/babel-preset-typescript/src/index.js @@ -17,6 +17,7 @@ export default declare( if (typeof allExtensions !== "boolean") { throw new Error(".allExtensions must be a boolean, or undefined"); } + if (typeof isTSX !== "boolean") { throw new Error(".isTSX must be a boolean, or undefined"); } From 0f949990c33cc3c2b3dc24632f7639be166756b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 5 Nov 2019 12:28:16 -0500 Subject: [PATCH 193/965] fix: add inList setter for compatibility with babel-minify (#10656) --- packages/babel-traverse/src/path/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/babel-traverse/src/path/index.js b/packages/babel-traverse/src/path/index.js index e73cbde9d1ee..79ef05092857 100644 --- a/packages/babel-traverse/src/path/index.js +++ b/packages/babel-traverse/src/path/index.js @@ -161,6 +161,13 @@ export default class NodePath { return !!this.listKey; } + set inList(inList) { + if (!inList) { + this.listKey = null; + } + // ignore inList = true as it should depend on `listKey` + } + get parentKey() { return this.listKey || this.key; } From 2640e5a27cfeea21c8eff5539306fd577dcfec67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 5 Nov 2019 14:52:57 -0500 Subject: [PATCH 194/965] fix: remove accessibility of constructor (#10658) --- packages/babel-plugin-transform-typescript/src/index.js | 1 + .../test/fixtures/class/methods/input.ts | 1 + .../test/fixtures/class/methods/output.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/packages/babel-plugin-transform-typescript/src/index.js b/packages/babel-plugin-transform-typescript/src/index.js index ed7d927fe595..97b23b454503 100644 --- a/packages/babel-plugin-transform-typescript/src/index.js +++ b/packages/babel-plugin-transform-typescript/src/index.js @@ -93,6 +93,7 @@ export default declare( // Rest handled by Function visitor }, constructor(path, classPath) { + if (path.node.accessibility) path.node.accessibility = null; // Collects parameter properties so that we can add an assignment // for each of them in the constructor body // diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/input.ts index 35f255f2b23e..58026a1bdaa7 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/input.ts +++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/input.ts @@ -1,4 +1,5 @@ class C { m(): void; public m(x?: number, ...y: number[]): void {} + public constructor() {} } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/output.js index cb6e585efbb4..b5436ecfaec6 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/output.js +++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/methods/output.js @@ -1,4 +1,6 @@ class C { m(x, ...y) {} + constructor() {} + } From 2cd5ad0c8026ecaf55335eb152fb13ab650fd78f Mon Sep 17 00:00:00 2001 From: Leonid Shevtsov Date: Wed, 6 Nov 2019 10:13:08 +0200 Subject: [PATCH 195/965] fix typo: identifer -> identifier (#10647) --- packages/babel-generator/test/index.js | 2 +- packages/babel-parser/src/parser/expression.js | 2 +- packages/babel-types/src/definitions/core.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/babel-generator/test/index.js b/packages/babel-generator/test/index.js index 826610d2b85d..e247686e2488 100644 --- a/packages/babel-generator/test/index.js +++ b/packages/babel-generator/test/index.js @@ -197,7 +197,7 @@ describe("generation", function() { const id2 = fn.body.body[0].expression; id2.name += "2"; - id2.loc.identiferName = "bar"; + id2.loc.identifierName = "bar"; const generated = generate( ast, diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 291351594925..89088db4d98b 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -384,7 +384,7 @@ export default class ExpressionParser extends LValParser { * so for ?? operator we need to check in this case the right expression to have parenthesis * second case a && b ?? c * here a && b => This is considered as a logical expression in the ast tree - * c => identifer + * c => identifier * so now here for ?? operator we need to check the left expression to have parenthesis * if the parenthesis is missing we raise an error and throw it */ diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js index 09c41c9119a9..973c3bfa67c8 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -407,7 +407,7 @@ defineType("Identifier", { name: { validate: chain(function(node, key, val) { if (!isValidIdentifier(val)) { - // throw new TypeError(`"${val}" is not a valid identifer name`); + // throw new TypeError(`"${val}" is not a valid identifier name`); } }, assertValueType("string")), }, From 3ab035bab6ec027e8f6407165541235c6a7615e7 Mon Sep 17 00:00:00 2001 From: Maksim Ryzhikov Date: Wed, 6 Nov 2019 15:34:09 +0300 Subject: [PATCH 196/965] fix: Use the recommended property to specify repository URL (#10665) [ci-skip] Use recommended by npm property to specify repository URL https://docs.npmjs.com/files/package.json#repository Otherwise, it breaks some tools which relay on this convention for example "nlf" package https://github.com/iandotkelly/nlf/blob/master/lib/nlf.js#L284-L285 --- .../babel-helper-create-regexp-features-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index 71abede86fb5..7e93bf17a147 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -6,7 +6,7 @@ "description": "Compile ESNext Regular Expressions to ES5", "repository": { "type": "git", - "repository": "https://github.com/babel/babel", + "url": "https://github.com/babel/babel", "directory": "packages/babel-helper-create-regexp-features-plugin" }, "main": "lib/index.js", From bdb4318f47ec42ca4e325b5163e2e8ad57de4849 Mon Sep 17 00:00:00 2001 From: Vojtech Miksu Date: Wed, 6 Nov 2019 12:30:32 -0800 Subject: [PATCH 197/965] chore: update convert-source-map dep (#10667) --- packages/babel-core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index d07ab536efce..1100ef39c93d 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -40,7 +40,7 @@ "@babel/template": "^7.7.0", "@babel/traverse": "^7.7.0", "@babel/types": "^7.7.0", - "convert-source-map": "^1.1.0", + "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", "lodash": "^4.17.13", From 9082e68d6f70472ee39f881574c3f01ed97d0958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 7 Nov 2019 02:18:36 +0300 Subject: [PATCH 198/965] Parse arrows with params annotations in conditional expressions (#10669) --- packages/babel-parser/src/plugins/flow.js | 1 + .../input.js | 2 + .../output.json | 220 +++++++++++++++ .../input.js | 3 + .../output.json | 250 ++++++++++++++++++ 5 files changed, 476 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 5e7187455da2..ab5f646b6efb 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2061,6 +2061,7 @@ export default (superClass: Class): Class => return node.operator === "="; case "ParenthesizedExpression": + case "TypeCastExpression": return this.isAssignable(node.expression); case "MemberExpression": diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/input.js b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/input.js new file mode 100644 index 000000000000..1f0c3e33482c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/input.js @@ -0,0 +1,2 @@ +test + ? (x: T): U => y diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json new file mode 100644 index 000000000000..3c80e21673a6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json @@ -0,0 +1,220 @@ +{ + "type": "File", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "test": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "test" + }, + "name": "test" + }, + "consequent": { + "type": "TypeCastExpression", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "x" + }, + "name": "x" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "T" + }, + "name": "T" + } + } + }, + "extra": { + "parenthesized": true, + "parenStart": 9 + } + }, + "alternate": { + "type": "ArrowFunctionExpression", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "U" + }, + "name": "U" + } + ], + "body": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "y" + }, + "name": "y" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/input.js b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/input.js new file mode 100644 index 000000000000..a36f5ca0c5d8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/input.js @@ -0,0 +1,3 @@ +test + ? (x: T): U => y + : z \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json new file mode 100644 index 000000000000..6be59ef645aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json @@ -0,0 +1,250 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "expression": { + "type": "ConditionalExpression", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "test": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "test" + }, + "name": "test" + }, + "consequent": { + "type": "ArrowFunctionExpression", + "start": 9, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "predicate": null, + "returnType": { + "type": "TypeAnnotation", + "start": 15, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 13 + }, + "identifierName": "U" + }, + "name": "U" + } + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 10, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "typeAnnotation": { + "type": "GenericTypeAnnotation", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "body": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 18 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "alternate": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 5 + }, + "identifierName": "z" + }, + "name": "z" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file From 35f4d1276310bac6fede4a6f86a5c76f951e179e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 7 Nov 2019 02:20:52 +0300 Subject: [PATCH 199/965] v7.7.2 --- lerna.json | 2 +- packages/babel-core/package.json | 10 +++++----- packages/babel-generator/package.json | 6 +++--- .../package.json | 4 ++-- packages/babel-parser/package.json | 2 +- .../babel-plugin-transform-typescript/package.json | 4 ++-- packages/babel-preset-env-standalone/package.json | 4 ++-- packages/babel-preset-typescript/package.json | 6 +++--- packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 8 ++++---- packages/babel-traverse/package.json | 8 ++++---- packages/babel-types/package.json | 6 +++--- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lerna.json b/lerna.json index 7abfa608d2a3..d348baa77c41 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.1", + "version": "7.7.2", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 1100ef39c93d..7b64334e7030 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.7.0", + "version": "7.7.2", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -34,12 +34,12 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.0", + "@babel/generator": "^7.7.2", "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.0", + "@babel/parser": "^7.7.2", "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/traverse": "^7.7.2", + "@babel/types": "^7.7.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index a51ad5d38e7c..9d4a96b51756 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.7.0", + "version": "7.7.2", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,13 +14,13 @@ "lib" ], "dependencies": { - "@babel/types": "^7.7.0", + "@babel/types": "^7.7.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.7.0" + "@babel/parser": "^7.7.2" } } diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index 7e93bf17a147..c0e278155fce 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-regexp-features-plugin", - "version": "7.7.0", + "version": "7.7.2", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile ESNext Regular Expressions to ES5", @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 0226cc56e6bd..b9b393d95960 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.0", + "version": "7.7.2", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index 2c96f987306f..abe6f25e2b07 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.7.0", + "version": "7.7.2", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index feb9d499c0ae..63afb4df4bdf 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.1", + "version": "7.7.2", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -17,7 +17,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/preset-env": "^7.7.1", - "@babel/standalone": "^7.7.1" + "@babel/standalone": "^7.7.2" }, "keywords": [ "babel", diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index ce3bb85142c5..fa98c56cd283 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.7.0", + "version": "7.7.2", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -14,13 +14,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.0" + "@babel/plugin-transform-typescript": "^7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.2", "@babel/helper-plugin-test-runner": "^7.0.0" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 501e5f0ea62c..d5bc51194622 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.1", + "version": "7.7.2", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index ea5650549784..1aff3a832aa7 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.1", + "version": "7.7.2", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 6e7e3faf9e98..d0dc352d9599 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.1", + "version": "7.7.2", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 30290bb81ad7..a906babfca67 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.1", + "version": "7.7.2", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -12,7 +12,7 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.2", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.2.0", "@babel/plugin-proposal-async-generator-functions": "^7.7.0", @@ -96,11 +96,11 @@ "@babel/plugin-transform-strict-mode": "^7.2.0", "@babel/plugin-transform-template-literals": "^7.4.4", "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-typescript": "^7.7.0", + "@babel/plugin-transform-typescript": "^7.7.2", "@babel/plugin-transform-unicode-regex": "^7.7.0", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.7.0", - "@babel/preset-typescript": "^7.7.0" + "@babel/preset-typescript": "^7.7.2" }, "keywords": [ "babel", diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 2665f5bc77b7..ee21b6e83e09 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.7.0", + "version": "7.7.2", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.0", + "@babel/generator": "^7.7.2", "@babel/helper-function-name": "^7.7.0", "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/parser": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/parser": "^7.7.2", + "@babel/types": "^7.7.2", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index fbf76658006d..04946bc67d68 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.7.1", + "version": "7.7.2", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -17,7 +17,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.7.0", - "@babel/parser": "^7.7.0" + "@babel/generator": "^7.7.2", + "@babel/parser": "^7.7.2" } } From c2bace4b73ae65771941efcf9c2eb33ad8c3463f Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Wed, 6 Nov 2019 23:28:38 +0000 Subject: [PATCH 200/965] Add v7.7.2 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5da577f4fd1..a3db1b7afbee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,15 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.7.2 (2019-11-07) + +#### :bug: Bug Fix +* `babel-parser` + * [#10669](https://github.com/babel/babel/pull/10669) Parse arrows with params annotations in conditional expressions ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-transform-typescript` + * [#10658](https://github.com/babel/babel/pull/10658) fix: remove accessibility of constructor ([@JLHwung](https://github.com/JLHwung)) +* `babel-traverse` + * [#10656](https://github.com/babel/babel/pull/10656) fix: add inList setter for compatibility with babel-minify ([@JLHwung](https://github.com/JLHwung)) ## v7.7.1 (2019-11-05) #### :bug: Bug Fix From 0287c0f02f8844adbfd7d84a97a1a8a94c17fa1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 8 Nov 2019 23:23:04 +0300 Subject: [PATCH 201/965] Don't recover from "adjacent jsx elements" parser error (#10682) --- .../babel-parser/src/plugins/jsx/index.js | 10 +- .../jsx/errors/adjacent-tags/options.json | 3 + .../jsx/errors/adjacent-tags/output.json | 189 ------------------ 3 files changed, 5 insertions(+), 197 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json delete mode 100644 packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json diff --git a/packages/babel-parser/src/plugins/jsx/index.js b/packages/babel-parser/src/plugins/jsx/index.js index 523702f0dd84..2aba709267f2 100644 --- a/packages/babel-parser/src/plugins/jsx/index.js +++ b/packages/babel-parser/src/plugins/jsx/index.js @@ -484,18 +484,12 @@ export default (superClass: Class): Class => node.closingElement = closingElement; } node.children = children; - 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( + if (this.isRelational("<")) { + throw 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/test/fixtures/jsx/errors/adjacent-tags/options.json b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json new file mode 100644 index 000000000000..9835a882e99c --- /dev/null +++ b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (1:22)" +} \ No newline at end of file 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 deleted file mode 100644 index b657e0982552..000000000000 --- a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/output.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "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 From e315d65a7a8cedbe0476b4a2872890e93a1289ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 8 Nov 2019 23:45:00 +0300 Subject: [PATCH 202/965] v7.7.3 --- lerna.json | 2 +- packages/babel-parser/package.json | 2 +- packages/babel-preset-env-standalone/package.json | 4 ++-- packages/babel-standalone/package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lerna.json b/lerna.json index d348baa77c41..aaabc787806d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.2", + "version": "7.7.3", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index b9b393d95960..ebf2db424378 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.2", + "version": "7.7.3", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 63afb4df4bdf..c749a6caae8f 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.2", + "version": "7.7.3", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -17,7 +17,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/preset-env": "^7.7.1", - "@babel/standalone": "^7.7.2" + "@babel/standalone": "^7.7.3" }, "keywords": [ "babel", diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index a906babfca67..3f7831157508 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.2", + "version": "7.7.3", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ From 8c2ed89aaa21fe5fd3718114d93100adb25dc7fa Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Fri, 8 Nov 2019 20:52:12 +0000 Subject: [PATCH 203/965] Add v7.7.3 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3db1b7afbee..ef3a4efcb9a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0 +## v7.7.3 (2019-11-08) + +#### :bug: Bug Fix +* `babel-parser` + * [#10682](https://github.com/babel/babel/pull/10682) Don't recover from "adjacent jsx elements" parser error ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.7.2 (2019-11-07) #### :bug: Bug Fix From 70c0ed512a5fb2e8f461c7d14e493a3ce131e686 Mon Sep 17 00:00:00 2001 From: chrishinrichs Date: Fri, 8 Nov 2019 21:31:46 -0600 Subject: [PATCH 204/965] Fix: Don't call Object.keys on non-objects (babel#10482) (#10683) --- packages/babel-helpers/src/helpers.js | 6 +++--- .../test/fixtures/object-spread/assignment/output.js | 2 +- .../test/fixtures/object-spread/expression/output.js | 2 +- .../fixtures/object-spread/variable-declaration/output.js | 2 +- .../test/fixtures/corejs2/entry-shippedProposals/output.js | 2 +- .../test/fixtures/corejs2/usage-shippedProposals/output.js | 2 +- .../test/fixtures/preset-options/shippedProposals/output.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index fadce7421815..d235cf328569 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -397,7 +397,7 @@ helpers.objectSpread = helper("7.0.0-beta.0")` export default function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = (arguments[i] != null) ? arguments[i] : {}; - var ownKeys = Object.keys(source); + var ownKeys = Object.keys(Object(source)); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; @@ -434,13 +434,13 @@ helpers.objectSpread2 = helper("7.5.0")` for (var i = 1; i < arguments.length; i++) { var source = (arguments[i] != null) ? arguments[i] : {}; if (i % 2) { - ownKeys(source, true).forEach(function (key) { + ownKeys(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { - ownKeys(source).forEach(function (key) { + ownKeys(Object(source)).forEach(function (key) { Object.defineProperty( target, key, diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/assignment/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/assignment/output.js index bca55509f8df..a1f2970a3264 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/assignment/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/assignment/output.js @@ -1,6 +1,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/output.js index ba0e5ad1c8e3..a172df60bd16 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/output.js @@ -1,6 +1,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js index 1370408b8354..9fabf3047b3d 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.js @@ -1,6 +1,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } 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 11efbf4cdb8d..54c32b60fc2c 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 @@ -298,7 +298,7 @@ require("regenerator-runtime/runtime"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } 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 02988151dce8..53afb8206c83 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 @@ -30,7 +30,7 @@ require("core-js/modules/es6.object.to-string"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } 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 358a6a1f78bb..36fd231345ab 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 @@ -1,6 +1,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 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; } From 2b082601a7fa00c3e7c505da16fe5dfe009c3860 Mon Sep 17 00:00:00 2001 From: Kenza Houmani Date: Mon, 11 Nov 2019 09:36:17 +0000 Subject: [PATCH 205/965] Fix parentheses on replaceWithMultiple for JSX (#10598) * Closes #9851 Fix parentheses on replaceWithMultiple for JSX * Rename test * Use generate(ast) directly --- packages/babel-traverse/src/path/modification.js | 4 +++- packages/babel-traverse/test/replacement.js | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/babel-traverse/src/path/modification.js b/packages/babel-traverse/src/path/modification.js index 6039a94c6090..1f6d2a0b32db 100644 --- a/packages/babel-traverse/src/path/modification.js +++ b/packages/babel-traverse/src/path/modification.js @@ -115,7 +115,9 @@ export function insertAfter(nodes) { }), ); } else if ( - (this.isNodeType("Expression") && !this.isJSXElement()) || + (this.isNodeType("Expression") && + !this.isJSXElement() && + !parentPath.isJSXElement()) || (parentPath.isForStatement() && this.key === "init") ) { if (this.node) { diff --git a/packages/babel-traverse/test/replacement.js b/packages/babel-traverse/test/replacement.js index 3454937fe506..6d54972611f2 100644 --- a/packages/babel-traverse/test/replacement.js +++ b/packages/babel-traverse/test/replacement.js @@ -1,5 +1,6 @@ import traverse from "../lib"; import { parse } from "@babel/parser"; +import generate from "@babel/generator"; import * as t from "@babel/types"; describe("path/replacement", function() { @@ -97,4 +98,19 @@ describe("path/replacement", function() { ); }); }); + describe("replaceWithMultiple", () => { + it("does not add extra parentheses for a JSXElement with a JSXElement parent", () => { + const ast = parse(`

`, { + plugins: ["jsx"], + }); + traverse(ast, { + JSXElement: path => { + if (path.node.openingElement.name.name === "span") { + path.replaceWithMultiple(path.node.children.filter(t.isJSXElement)); + } + }, + }); + expect(generate(ast).code).toBe("

;"); + }); + }); }); From 8e5f2dc929cb860b9090e6cb71df148fbe2b791b Mon Sep 17 00:00:00 2001 From: Mohammad Ahmadi Date: Mon, 11 Nov 2019 13:09:36 +0330 Subject: [PATCH 206/965] corrected the grammar of an option description (#10691) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * grammar correction of an option description (missed in #10589) * changed description to be consistent with others Co-Authored-By: Huáng Jùnliàng * ran prettier --- packages/babel-cli/src/babel/options.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 04a648c1fd5a..169c61ffa51a 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -73,7 +73,10 @@ commander.option( "Do not include superfluous whitespace characters and line terminators.", booleanify, ); -commander.option("--minified", "save as much bytes when printing [true|false]"); +commander.option( + "--minified [true|false]", + "Save as many bytes when printing.", +); commander.option( "--auxiliary-comment-before [string]", "Print a comment before any injected non-user code.", From b2767c7d8ad4b74e244b6162660b48d13fcfaae5 Mon Sep 17 00:00:00 2001 From: Benjamin Blackwood Date: Tue, 12 Nov 2019 00:08:18 +1100 Subject: [PATCH 207/965] Add funding field to package.json (#10687) [ci-skip] --- packages/babel-core/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 7b64334e7030..4da69a87d404 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -28,6 +28,10 @@ "engines": { "node": ">=6.9.0" }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + }, "browser": { "./lib/config/files/index.js": "./lib/config/files/index-browser.js", "./lib/transform-file.js": "./lib/transform-file-browser.js" From 4cb5e0a01317f36e779c1d7ab53840416bce5d03 Mon Sep 17 00:00:00 2001 From: Sakibul Mowla Date: Mon, 11 Nov 2019 21:38:13 +0000 Subject: [PATCH 208/965] Allow TypeScript type assertions in array destructuring (#10592) * Add test * Add fix * Fix test, destructure with as assertion * Add angle-bracket assertion case * Use isBinding to make typeCastToParameter decision --- .../src/plugins/typescript/index.js | 17 +- .../cast/destructure-and-assign/input.ts | 2 + .../cast/destructure-and-assign/output.json | 269 ++++++++++++++++++ 3 files changed, 283 insertions(+), 5 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 9fabb50cd0a2..2e7472e216d2 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -2483,7 +2483,10 @@ export default (superClass: Class): Class => } } - toAssignableList(exprList: N.Expression[]): $ReadOnlyArray { + toAssignableList( + exprList: N.Expression[], + isBinding: ?boolean, + ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; if (!expr) continue; @@ -2493,10 +2496,14 @@ export default (superClass: Class): Class => break; case "TSAsExpression": case "TSTypeAssertion": - this.raise( - expr.start, - "Unexpected type cast in parameter position.", - ); + if (!isBinding) { + exprList[i] = this.typeCastToParameter(expr); + } else { + this.raise( + expr.start, + "Unexpected type cast in parameter position.", + ); + } break; } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/input.ts b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/input.ts new file mode 100644 index 000000000000..ece9096fb9f6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/input.ts @@ -0,0 +1,2 @@ +[a as number] = [42]; +[a] = [42]; diff --git a/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json new file mode 100644 index 000000000000..d621a6cb84c1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json @@ -0,0 +1,269 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 1, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + } + } + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "elements": [ + { + "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": "ExpressionStatement", + "start": 22, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 22, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 31, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 24, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 8 + } + } + } + } + ] + }, + "right": { + "type": "ArrayExpression", + "start": 36, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "elements": [ + { + "type": "NumericLiteral", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 17 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + ] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file From d413a3078c1b7a46be106bebf67816c5f9550fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 11 Nov 2019 17:36:10 -0500 Subject: [PATCH 209/965] Add `asserts this [is type]` parsing support (#10677) --- .../src/plugins/typescript/index.js | 64 ++- packages/babel-parser/src/types.js | 1 + .../asserts-this-with-predicate/input.ts | 4 + .../asserts-this-with-predicate/options.json | 5 + .../asserts-this-with-predicate/output.json | 397 ++++++++++++++++++ .../assert-predicate/asserts-this/input.ts | 3 + .../assert-predicate/asserts-this/output.json | 187 +++++++++ .../asserts-var-with-predicate/input.ts | 3 + .../asserts-var-with-predicate/output.json | 267 ++++++++++++ .../input.ts | 0 .../output.json | 0 .../invalid-escaped-asserts-keyword/input.ts | 1 + .../output.json | 170 ++++++++ .../babel-types/src/definitions/typescript.js | 5 +- 14 files changed, 1087 insertions(+), 20 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json rename packages/babel-parser/test/fixtures/typescript/assert-predicate/{asserts-with-predicate => declare-asserts-var-with-predicate}/input.ts (100%) rename packages/babel-parser/test/fixtures/typescript/assert-predicate/{asserts-with-predicate => declare-asserts-var-with-predicate}/output.json (100%) create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 2e7472e216d2..4cf196b9a704 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -680,6 +680,15 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSLiteralType"); } + tsParseThisTypeOrThisTypePredicate(): N.TsThisType | N.TsTypePredicate { + const thisKeyword = this.tsParseThisTypeNode(); + if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { + return this.tsParseThisTypePredicate(thisKeyword); + } else { + return thisKeyword; + } + } + tsParseNonArrayType(): N.TsType { switch (this.state.type) { case tt.name: @@ -715,14 +724,8 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSLiteralType"); } break; - case tt._this: { - const thisKeyword = this.tsParseThisTypeNode(); - if (this.isContextual("is") && !this.hasPrecedingLineBreak()) { - return this.tsParseThisTypePredicate(thisKeyword); - } else { - return thisKeyword; - } - } + case tt._this: + return this.tsParseThisTypeOrThisTypePredicate(); case tt._typeof: return this.tsParseTypeQuery(); case tt._import: @@ -937,6 +940,24 @@ export default (superClass: Class): Class => this.tsParseTypePredicateAsserts.bind(this), ); + if (asserts && this.match(tt._this)) { + // When asserts is false, thisKeyword is handled by tsParseNonArrayType + // : asserts this is type + let thisTypePredicate = this.tsParseThisTypeOrThisTypePredicate(); + // if it turns out to be a `TSThisType`, wrap it with `TSTypePredicate` + // : asserts this + if (thisTypePredicate.type === "TSThisType") { + const node: N.TsTypePredicate = this.startNodeAtNode(t); + node.parameterName = (thisTypePredicate: N.TsThisType); + node.asserts = true; + thisTypePredicate = this.finishNode(node, "TSTypePredicate"); + } else { + (thisTypePredicate: N.TsTypePredicate).asserts = true; + } + t.typeAnnotation = thisTypePredicate; + return this.finishNode(t, "TSTypeAnnotation"); + } + const typePredicateVariable = this.tsIsIdentifier() && this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this)); @@ -947,15 +968,15 @@ export default (superClass: Class): Class => return this.tsParseTypeAnnotation(/* eatColon */ false, t); } + const node: N.TsTypePredicate = this.startNodeAtNode(t); // : asserts foo - const node = this.startNodeAtNode(t); node.parameterName = this.parseIdentifier(); node.asserts = asserts; t.typeAnnotation = this.finishNode(node, "TSTypePredicate"); return this.finishNode(t, "TSTypeAnnotation"); } - // : foo is type + // : asserts foo is type const type = this.tsParseTypeAnnotation(/* eatColon */ false); const node = this.startNodeAtNode(t); node.parameterName = typePredicateVariable; @@ -989,18 +1010,25 @@ export default (superClass: Class): Class => } tsParseTypePredicateAsserts(): boolean { - if (!this.tsIsIdentifier()) { - return false; - } - - const id = this.parseIdentifier(); if ( - id.name !== "asserts" || - this.hasPrecedingLineBreak() || - !this.tsIsIdentifier() + !this.match(tt.name) || + this.state.value !== "asserts" || + this.hasPrecedingLineBreak() ) { return false; } + const containsEsc = this.state.containsEsc; + this.next(); + if (!this.match(tt.name) && !this.match(tt._this)) { + return false; + } + + if (containsEsc) { + this.raise( + this.state.lastTokStart, + "Escape sequence in keyword asserts", + ); + } return true; } diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 8392a58db0f2..82815b1443d6 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1227,6 +1227,7 @@ export type TsTypePredicate = TsTypeBase & { type: "TSTypePredicate", parameterName: Identifier | TsThisType, typeAnnotation: TsTypeAnnotation, + asserts?: boolean, }; // `typeof` operator diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/input.ts new file mode 100644 index 000000000000..cc1a550f07bb --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/input.ts @@ -0,0 +1,4 @@ +class Foo { + isBar(): asserts this is Foo {} + isBaz = (): asserts this is Foo => {} +} diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json new file mode 100644 index 000000000000..efb11900ba6e --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "typescript", "classProperties" + ] +} diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json new file mode 100644 index 000000000000..bed7e168b396 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/output.json @@ -0,0 +1,397 @@ +{ + "type": "File", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 87, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 87, + "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": 87, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 14, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 14, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 7 + }, + "identifierName": "isBar" + }, + "name": "isBar" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start": 21, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeAnnotation": { + "type": "TSTypePredicate", + "start": 31, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "parameterName": { + "type": "TSThisType", + "start": 31, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 23 + } + } + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeName": { + "type": "Identifier", + "start": 39, + "end": 42, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "Foo" + }, + "name": "Foo" + } + } + }, + "asserts": true + } + }, + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 33 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassProperty", + "start": 48, + "end": 85, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 48, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 7 + }, + "identifierName": "isBaz" + }, + "name": "isBaz" + }, + "computed": false, + "value": { + "type": "ArrowFunctionExpression", + "start": 56, + "end": 85, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "returnType": { + "type": "TSTypeAnnotation", + "start": 58, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 33 + } + }, + "typeAnnotation": { + "type": "TSTypePredicate", + "start": 68, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 3, + "column": 33 + } + }, + "parameterName": { + "type": "TSThisType", + "start": 68, + "end": 72, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 3, + "column": 26 + } + } + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 76, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 33 + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 76, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 33 + } + }, + "typeName": { + "type": "Identifier", + "start": 76, + "end": 79, + "loc": { + "start": { + "line": 3, + "column": 30 + }, + "end": { + "line": 3, + "column": 33 + }, + "identifierName": "Foo" + }, + "name": "Foo" + } + } + }, + "asserts": true + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 83, + "end": 85, + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "body": [], + "directives": [] + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/input.ts new file mode 100644 index 000000000000..839483541d5b --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/input.ts @@ -0,0 +1,3 @@ +class C { + m(): asserts this {}; +} diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json new file mode 100644 index 000000000000..e9d5458c1c89 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json @@ -0,0 +1,187 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "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 + } + }, + "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": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "m" + }, + "name": "m" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "returnType": { + "type": "TSTypeAnnotation", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "typeAnnotation": { + "type": "TSTypePredicate", + "start": 15, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 19 + } + }, + "parameterName": { + "type": "TSThisType", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 19 + } + } + }, + "asserts": true + } + }, + "body": { + "type": "BlockStatement", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/input.ts new file mode 100644 index 000000000000..2b580e64e906 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/input.ts @@ -0,0 +1,3 @@ +class C { + assertIsString(value: unknown): asserts value is string {} +} diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json new file mode 100644 index 000000000000..f63a5e0581c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json @@ -0,0 +1,267 @@ +{ + "type": "File", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 72, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 72, + "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": 72, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 70, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 60 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "assertIsString" + }, + "name": "assertIsString" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 2, + "column": 31 + }, + "identifierName": "value" + }, + "name": "value", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 32, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "typeAnnotation": { + "type": "TSUnknownKeyword", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 31 + } + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start": 42, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 57 + } + }, + "typeAnnotation": { + "type": "TSTypePredicate", + "start": 42, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 32 + }, + "end": { + "line": 2, + "column": 57 + } + }, + "parameterName": { + "type": "Identifier", + "start": 52, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 42 + }, + "end": { + "line": 2, + "column": 47 + }, + "identifierName": "value" + }, + "name": "value" + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 61, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 51 + }, + "end": { + "line": 2, + "column": 57 + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 61, + "end": 67, + "loc": { + "start": { + "line": 2, + "column": 51 + }, + "end": { + "line": 2, + "column": 57 + } + } + } + }, + "asserts": true + } + }, + "body": { + "type": "BlockStatement", + "start": 68, + "end": 70, + "loc": { + "start": { + "line": 2, + "column": 58 + }, + "end": { + "line": 2, + "column": 60 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "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/declare-asserts-var-with-predicate/input.ts similarity index 100% rename from packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/input.ts rename to packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/input.ts 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/declare-asserts-var-with-predicate/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-with-predicate/output.json rename to packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/output.json diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/input.ts b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/input.ts new file mode 100644 index 000000000000..a89b5ad6c9fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/input.ts @@ -0,0 +1 @@ +declare function assertIsString(value: unknown): \u{61}sserts value; diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json new file mode 100644 index 000000000000..90484c4b93a3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json @@ -0,0 +1,170 @@ +{ + "type": "File", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "errors": [ + "SyntaxError: Escape sequence in keyword asserts (1:49)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSDeclareFunction", + "start": 0, + "end": 68, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 68 + } + }, + "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": 67, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "typeAnnotation": { + "type": "TSTypePredicate", + "start": 47, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 67 + } + }, + "parameterName": { + "type": "Identifier", + "start": 62, + "end": 67, + "loc": { + "start": { + "line": 1, + "column": 62 + }, + "end": { + "line": 1, + "column": 67 + }, + "identifierName": "value" + }, + "name": "value" + }, + "asserts": true + } + }, + "declare": true + } + ], + "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 bba8a5b73c8e..608ea8ab2207 100644 --- a/packages/babel-types/src/definitions/typescript.js +++ b/packages/babel-types/src/definitions/typescript.js @@ -175,11 +175,12 @@ defineType("TSTypeReference", { defineType("TSTypePredicate", { aliases: ["TSType"], - visitor: ["parameterName", "typeAnnotation", "asserts"], + visitor: ["parameterName", "typeAnnotation"], + builder: ["parameterName", "typeAnnotation", "asserts"], fields: { parameterName: validateType(["Identifier", "TSThisType"]), typeAnnotation: validateOptionalType("TSTypeAnnotation"), - asserts: validate(bool), + asserts: validateOptional(bool), }, }); From d9fd07929aeafb16b51d361011808442fd7cb29f Mon Sep 17 00:00:00 2001 From: 4geru koichi uchinishi Date: Wed, 13 Nov 2019 01:08:35 +0900 Subject: [PATCH 210/965] chore: add missing new line to fixture (#10697) --- .../test/fixtures/top-level-await/unsupported/input.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index d8ddd6c0ad0b..0a5e432fc91c 100644 --- 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 @@ -1 +1 @@ -await 0; \ No newline at end of file +await 0; From ecad667dda7d8bbc8594df0a36d0a68f3eacb21b Mon Sep 17 00:00:00 2001 From: Shriram Balaji Date: Tue, 12 Nov 2019 21:58:40 +0530 Subject: [PATCH 211/965] Fix optional method chaining in derived classes (#10694) --- .../src/index.js | 2 ++ .../general/super-method-call-loose/input.js | 12 ++++++++++++ .../super-method-call-loose/options.json | 3 +++ .../general/super-method-call-loose/output.js | 15 +++++++++++++++ .../fixtures/general/super-method-call/input.js | 12 ++++++++++++ .../general/super-method-call/output.js | 17 +++++++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/input.js create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/options.json create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/output.js create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/input.js create mode 100644 packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/output.js diff --git a/packages/babel-plugin-proposal-optional-chaining/src/index.js b/packages/babel-plugin-proposal-optional-chaining/src/index.js index c3e324041520..918a59ade508 100644 --- a/packages/babel-plugin-proposal-optional-chaining/src/index.js +++ b/packages/babel-plugin-proposal-optional-chaining/src/index.js @@ -82,6 +82,8 @@ export default declare((api, options) => { let context = scope.maybeGenerateMemoised(object); if (context) { chain.object = t.assignmentExpression("=", context, object); + } else if (t.isSuper(object)) { + context = t.thisExpression(); } else { context = object; } diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/input.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/input.js new file mode 100644 index 000000000000..445c06ab259e --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/input.js @@ -0,0 +1,12 @@ +"use strict"; +class Base { + method() { + return 'Hello!'; + } +} + +class Derived extends Base { + method() { + return super.method?.() + } +} diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/options.json b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/options.json new file mode 100644 index 000000000000..39ea3f99c7ff --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/options.json @@ -0,0 +1,3 @@ +{ + "plugins": [["proposal-optional-chaining", { "loose": true }]] +} diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/output.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/output.js new file mode 100644 index 000000000000..6fd3890a61aa --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call-loose/output.js @@ -0,0 +1,15 @@ +"use strict"; + +class Base { + method() { + return 'Hello!'; + } + +} + +class Derived extends Base { + method() { + return super.method == null ? void 0 : super.method(); + } + +} diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/input.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/input.js new file mode 100644 index 000000000000..445c06ab259e --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/input.js @@ -0,0 +1,12 @@ +"use strict"; +class Base { + method() { + return 'Hello!'; + } +} + +class Derived extends Base { + method() { + return super.method?.() + } +} diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/output.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/output.js new file mode 100644 index 000000000000..891da0508e27 --- /dev/null +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/super-method-call/output.js @@ -0,0 +1,17 @@ +"use strict"; + +class Base { + method() { + return 'Hello!'; + } + +} + +class Derived extends Base { + method() { + var _super$method; + + return (_super$method = super.method) === null || _super$method === void 0 ? void 0 : _super$method.call(this); + } + +} From f71338baf93ad483cf5c48be4f1573ceac8f88ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 12 Nov 2019 23:55:36 +0100 Subject: [PATCH 212/965] E2E test Babel with itself before publishing (#10569) * Add e2e test using Babel itself * Make checks run again --- .circleci/config.yml | 54 ++++++++++++---- Makefile | 14 ++++- scripts/integration-tests/e2e-babel.sh | 29 +++++++++ scripts/integration-tests/publish-local.sh | 33 ++++++++++ scripts/integration-tests/utils/cleanup.sh | 30 +++++++++ scripts/integration-tests/utils/git.sh | 29 +++++++++ .../integration-tests/utils/local-registry.sh | 34 +++++++++++ .../integration-tests/verdaccio-config.yml | 61 +++++++++++++++++++ 8 files changed, 272 insertions(+), 12 deletions(-) create mode 100755 scripts/integration-tests/e2e-babel.sh create mode 100755 scripts/integration-tests/publish-local.sh create mode 100755 scripts/integration-tests/utils/cleanup.sh create mode 100755 scripts/integration-tests/utils/git.sh create mode 100755 scripts/integration-tests/utils/local-registry.sh create mode 100755 scripts/integration-tests/verdaccio-config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 691613f6de4b..400c61909baa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,5 @@ -version: 2 +version: 2.1 + aliases: - &restore-node-modules-cache keys: @@ -39,15 +40,19 @@ aliases: - &artifact_test262_xunit path: ~/test-results -jobs: - test: - working_directory: ~/babel +executors: + node-executor: docker: - image: circleci/node:13 + working_directory: ~/babel + +jobs: + test: + executor: node-executor steps: - checkout - - restore-cache: *restore-yarn-cache - - restore-cache: *restore-node-modules-cache + - restore_cache: *restore-yarn-cache + - restore_cache: *restore-node-modules-cache - run: yarn --version - run: make test-ci-coverage # Builds babel-standalone with the regular Babel config @@ -63,14 +68,13 @@ jobs: - store_artifacts: *artifact_env_min - save_cache: *save-node-modules-cache - save_cache: *save-yarn-cache + test262: - working_directory: ~/babel - docker: - - image: circleci/node:12 + executor: node-executor steps: - checkout - - restore-cache: *restore-yarn-cache - - restore-cache: *restore-node-modules-cache + - restore_cache: *restore-yarn-cache + - restore_cache: *restore-node-modules-cache - run: name: Build Babel command: BABEL_ENV=test make bootstrap @@ -107,11 +111,32 @@ jobs: cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true <<: *test262_workdir + publish-verdaccio: + executor: node-executor + steps: + - checkout + - run: yarn install + - run: ./scripts/integration-tests/publish-local.sh + - persist_to_workspace: + root: /tmp/verdaccio-workspace + paths: + - storage + - htpasswd + + e2e-babel: + executor: node-executor + steps: + - checkout + - attach_workspace: + at: /tmp/verdaccio-workspace + - run: ./scripts/integration-tests/e2e-babel.sh + workflows: version: 2 test: jobs: - test + master: jobs: - test262: @@ -119,3 +144,10 @@ workflows: branches: only: - master + + e2e: + jobs: + - publish-verdaccio + - e2e-babel: + requires: + - publish-verdaccio diff --git a/Makefile b/Makefile index 2c077a3fbd87..cfef047f6140 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 TEST262_COMMIT = 8688c4ab79059c3097098605e69f1ee5eda6c409 +FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" + # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true @@ -189,7 +191,7 @@ prepublish: new-version: git pull --rebase - yarn lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" + yarn lerna version --force-publish=$(FORCE_PUBLISH) # NOTE: Run make new-version first publish: prepublish @@ -207,6 +209,16 @@ endif rm -f .npmrc $(MAKE) clean +publish-test: +ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE") + echo "You probably don't know what you are doing" + exit 1 +endif + $(MAKE) prepublish-build + yarn lerna version patch --force-publish=$(FORCE_PUBLISH) --no-push --yes --tag-version-prefix="version-e2e-test-" + yarn lerna publish from-git --registry http://localhost:4873 --yes --tag-version-prefix="version-e2e-test-" + $(MAKE) clean + bootstrap-only: lerna-bootstrap yarn-install: clean-all diff --git a/scripts/integration-tests/e2e-babel.sh b/scripts/integration-tests/e2e-babel.sh new file mode 100755 index 000000000000..d295a9416c55 --- /dev/null +++ b/scripts/integration-tests/e2e-babel.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +#==============================================================================# +# SETUP # +#==============================================================================# + +# Start in scripts/integration-tests/ even if run from root directory +cd "$(dirname "$0")" + +source utils/local-registry.sh +source utils/cleanup.sh + +# Echo every command being executed +set -x + +# Go to the root of the monorepo +cd ../.. + +#==============================================================================# +# TEST # +#==============================================================================# + +startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml +yarn upgrade --scope @babel + +# Test +make test-ci + +cleanup diff --git a/scripts/integration-tests/publish-local.sh b/scripts/integration-tests/publish-local.sh new file mode 100755 index 000000000000..d16f123512a5 --- /dev/null +++ b/scripts/integration-tests/publish-local.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#==============================================================================# +# SETUP # +#==============================================================================# + +# Start in scripts/integration-tests/ even if run from root directory +cd "$(dirname "$0")" + +source utils/local-registry.sh +source utils/git.sh +source utils/cleanup.sh + +# Echo every command being executed +set -x + +# Go to the root of the monorepo +cd ../.. + +initializeE2Egit + +#==============================================================================# +# PUBLISH # +#==============================================================================# + +make bootstrap-only + +startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml +loginLocalRegistry + +I_AM_USING_VERDACCIO=I_AM_SURE make publish-test + +cleanup diff --git a/scripts/integration-tests/utils/cleanup.sh b/scripts/integration-tests/utils/cleanup.sh new file mode 100755 index 000000000000..0a578b79fdc7 --- /dev/null +++ b/scripts/integration-tests/utils/cleanup.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +function cleanup { + echo "Cleaning up." + stopLocalRegistry + + if [ -n "$GIT_E2E_SETUP" ]; then + cleanupE2Egit + fi +} + +# Error messages are redirected to stderr +function handle_error { + echo "$(basename $0): ERROR! An error was encountered executing line $1." 1>&2; + cleanup + echo "Exiting with error." 1>&2; + exit 1 +} + +function handle_exit { + cleanup + echo "Exiting without error." 1>&2; + exit +} + +# Exit the script with a helpful error message when any error is encountered +trap 'set +x; handle_error $LINENO $BASH_COMMAND' ERR + +# Cleanup before exit on any termination signal +trap 'set +x; handle_exit' SIGQUIT SIGTERM SIGINT SIGKILL SIGHUP diff --git a/scripts/integration-tests/utils/git.sh b/scripts/integration-tests/utils/git.sh new file mode 100755 index 000000000000..2cce5ee99077 --- /dev/null +++ b/scripts/integration-tests/utils/git.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +original_git_branch=`git rev-parse --abbrev-ref HEAD` +tmp_branch_name="integration-tests-$(date +'%F-%H-%M-%N')" +original_user_name=`git config user.name` +original_user_email=`git config user.email` + +export GIT_E2E_SETUP="true" + +function initializeE2Egit { + git checkout -b $tmp_branch_name + + # This is needed by lerna, which commits when publishing + git config user.name "Babel E2E Test" + git config user.email "babel-e2e@example.com" +} + +function cleanupE2Egit { + # Delete release tags + git tag -d $(git tag -l "version-e2e-test-*") + + # Checkout the previous branch + git checkout -f $original_git_branch + git branch -D $tmp_branch_name + + # Restore git user + git config user.name "$original_user_name" + git config user.email "$original_user_email" +} diff --git a/scripts/integration-tests/utils/local-registry.sh b/scripts/integration-tests/utils/local-registry.sh new file mode 100755 index 000000000000..e0212d2529b3 --- /dev/null +++ b/scripts/integration-tests/utils/local-registry.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Copied from https://github.com/facebook/create-react-app/blob/053f9774d3f592c17741d2a86de66a7ca58f90c0/tasks/local-registry.sh + +custom_registry_url=http://localhost:4873 +original_npm_registry_url=`npm get registry` +original_yarn_registry_url=`yarn config get registry` +default_verdaccio_package=verdaccio@~4.3.3 + +function startLocalRegistry { + # Start local registry + tmp_registry_log=`mktemp` + echo "Registry output file: $tmp_registry_log" + (cd && nohup npx ${VERDACCIO_PACKAGE:-$default_verdaccio_package} -c $1 &>$tmp_registry_log &) + + # Wait for Verdaccio to boot + grep -q "http address" <(tail -f $tmp_registry_log) + + # Set registry to local registry + npm set registry "$custom_registry_url" + yarn config set registry "$custom_registry_url" +} + +function loginLocalRegistry { + # Login so we can publish packages + (cd && npx npm-auth-to-token@1.0.0 -u user -p password -e user@example.com -r "$custom_registry_url") +} + +function stopLocalRegistry { + # Restore the original NPM and Yarn registry URLs and stop Verdaccio + fuser -k 4873/tcp + npm set registry "$original_npm_registry_url" + yarn config set registry "$original_yarn_registry_url" +} diff --git a/scripts/integration-tests/verdaccio-config.yml b/scripts/integration-tests/verdaccio-config.yml new file mode 100755 index 000000000000..69d210aa3933 --- /dev/null +++ b/scripts/integration-tests/verdaccio-config.yml @@ -0,0 +1,61 @@ +# +# This is the default config file. It allows all users to do anything, +# so don't use it on production systems. +# +# Look here for more config file examples: +# https://github.com/verdaccio/verdaccio/tree/master/conf +# + +# path to a directory with all packages +storage: /tmp/verdaccio-workspace/storage + +auth: + htpasswd: + file: /tmp/verdaccio-workspace/htpasswd + # Maximum amount of users allowed to register, defaults to "+inf". + # You can set this to -1 to disable registration. + # max_users: 1000 + +# a list of other known repositories we can talk to +uplinks: + npmjs: + url: https://registry.npmjs.org/ + +packages: + '@*/*': + # scoped packages + access: $all + publish: $all + unpublish: $all + proxy: npmjs + + '**': + # allow all users (including non-authenticated users) to read and + # publish all packages + # + # you can specify usernames/groupnames (depending on your auth plugin) + # and three keywords: "$all", "$anonymous", "$authenticated" + access: $all + publish: $all + unpublish: $all + + # if package is not available locally, proxy requests to 'npmjs' registry + proxy: npmjs + +# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections. +# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout. +# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough. +server: + keepAliveTimeout: 60 + +middlewares: + audit: + enabled: true + +# log settings +logs: + - { type: stdout, format: pretty, level: http } + #- {type: file, path: verdaccio.log, level: info} +#experiments: +# # support for npm token command +# token: false From ce070ce42261fa3d537fe5a87a54f26635656c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 12 Nov 2019 18:05:38 -0500 Subject: [PATCH 213/965] bump @babel/* dev dependencies (#10648) * bump @babel/* dev dependencies * chore: align version to @babel/runtime * chore: bump to 7.7.1 * chore: bump to 7.7.2 --- babel.config.js | 5 +- package.json | 16 +- yarn.lock | 619 ++++++++++++++++++++++++------------------------ 3 files changed, 322 insertions(+), 318 deletions(-) diff --git a/babel.config.js b/babel.config.js index fe0f90d0bad8..c7f53eaff39a 100644 --- a/babel.config.js +++ b/babel.config.js @@ -123,7 +123,10 @@ module.exports = function(api) { ], plugins: [ includeRuntime - ? ["@babel/transform-runtime", { version: "7.4.4" }] + ? [ + "@babel/transform-runtime", + { version: require("@babel/runtime/package").version }, + ] : null, ].filter(Boolean), }, diff --git a/package.json b/package.json index a420748f1135..a601cabc9e8c 100644 --- a/package.json +++ b/package.json @@ -9,20 +9,20 @@ "test": "make test" }, "devDependencies": { - "@babel/cli": "^7.6.0", - "@babel/core": "^7.6.0", + "@babel/cli": "^7.7.0", + "@babel/core": "^7.7.2", "@babel/eslint-plugin-development": "^1.0.1", - "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-class-properties": "^7.7.0", "@babel/plugin-proposal-export-namespace-from": "^7.5.2", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-numeric-separator": "^7.2.0", "@babel/plugin-proposal-optional-chaining": "^7.6.0", - "@babel/plugin-transform-modules-commonjs": "^7.6.0", - "@babel/plugin-transform-runtime": "^7.6.0", - "@babel/preset-env": "^7.6.0", + "@babel/plugin-transform-modules-commonjs": "^7.7.0", + "@babel/plugin-transform-runtime": "^7.6.2", + "@babel/preset-env": "^7.7.1", "@babel/preset-flow": "^7.0.0", - "@babel/register": "^7.6.0", - "@babel/runtime": "^7.6.0", + "@babel/register": "^7.7.0", + "@babel/runtime": "^7.7.2", "babel-eslint": "^11.0.0-beta.0", "babel-jest": "^24.9.0", "babel-loader": "^8.0.6", diff --git a/yarn.lock b/yarn.lock index 17d850dc2850..95eb973a33d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,18 +2,17 @@ # yarn lockfile v1 -"@babel/cli@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.6.0.tgz#1470a04394eaf37862989ea4912adf440fa6ff8d" - integrity sha512-1CTDyGUjQqW3Mz4gfKZ04KGOckyyaNmKneAMlABPS+ZyuxWv3FrVEVz7Ag08kNIztVx8VaJ8YgvYLSNlMKAT5Q== +"@babel/cli@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.7.0.tgz#8d10c9acb2acb362d7614a9493e1791c69100d89" + integrity sha512-jECEqAq6Ngf3pOhLSg7od9WKyrIacyh1oNNYtRXNn+ummSHCTXBamGywOAtiae34Vk7zKuQNnLvo2BKTMCoV4A== dependencies: commander "^2.8.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.1.0" glob "^7.0.0" lodash "^4.17.13" - mkdirp "^0.5.1" - output-file-sync "^2.0.0" + make-dir "^2.1.0" slash "^2.0.0" source-map "^0.5.0" optionalDependencies: @@ -26,19 +25,19 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/core@^7.1.0", "@babel/core@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.6.0.tgz#9b00f73554edd67bebc86df8303ef678be3d7b48" - integrity sha512-FuRhDRtsd6IptKpHXAa+4WPZYY2ZzgowkbLBecEDDSje1X/apG7jQM33or3NdOmjXBKWGOg4JmSiRfUfuTtHXw== +"@babel/core@^7.1.0", "@babel/core@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" + integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.0" - "@babel/helpers" "^7.6.0" - "@babel/parser" "^7.6.0" - "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.0" - "@babel/types" "^7.6.0" - convert-source-map "^1.1.0" + "@babel/generator" "^7.7.2" + "@babel/helpers" "^7.7.0" + "@babel/parser" "^7.7.2" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.2" + "@babel/types" "^7.7.2" + convert-source-map "^1.7.0" debug "^4.1.0" json5 "^2.1.0" lodash "^4.17.13" @@ -51,23 +50,22 @@ resolved "https://registry.yarnpkg.com/@babel/eslint-plugin-development/-/eslint-plugin-development-1.0.1.tgz#1f5206ae95795db09b65e7dbc2b158d66497a44c" integrity sha512-ioEhN8HgKr4Yx8ef+XryNpKN4FimSFceb0qVVxvoUzpFn3xyq17MlY5AquEqtXObE7Nu7WKq7QL9INzjCrugyw== -"@babel/generator@^7.4.0", "@babel/generator@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.6.0.tgz#e2c21efbfd3293ad819a2359b448f002bfdfda56" - integrity sha512-Ms8Mo7YBdMMn1BYuNtKuP/z0TgEIhbcyB8HVR6PPNYp4P61lMsABiS4A3VG1qznjXVCf3r+fVHhm4efTYVsySA== +"@babel/generator@^7.4.0", "@babel/generator@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" + integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== dependencies: - "@babel/types" "^7.6.0" + "@babel/types" "^7.7.2" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" - trim-right "^1.0.1" -"@babel/helper-annotate-as-pure@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" - integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== +"@babel/helper-annotate-as-pure@^7.0.0", "@babel/helper-annotate-as-pure@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz#efc54032d43891fe267679e63f6860aa7dbf4a5e" + integrity sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.7.0" "@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": version "7.1.0" @@ -86,25 +84,33 @@ "@babel/traverse" "^7.4.4" "@babel/types" "^7.4.4" -"@babel/helper-create-class-features-plugin@^7.5.5": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.6.0.tgz#769711acca889be371e9bc2eb68641d55218021f" - integrity sha512-O1QWBko4fzGju6VoVvrZg0RROCVifcLxiApnGP3OWfWzvxRZFCoBD81K5ur5e3bVY2Vf/5rIJm8cqPKn8HUJng== +"@babel/helper-create-class-features-plugin@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz#bcdc223abbfdd386f94196ae2544987f8df775e8" + integrity sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.5.5" - "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-member-expression-to-functions" "^7.7.0" + "@babel/helper-optimise-call-expression" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" - "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-replace-supers" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" -"@babel/helper-define-map@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.5.5.tgz#3dec32c2046f37e09b28c93eb0b103fd2a25d369" - integrity sha512-fTfxx7i0B5NJqvUOBBGREnrqbTxRh7zinBANpZXAVDlsZxYdclDp467G1sQ8VZYMnAURY3RpBUAgOYT9GfzHBg== +"@babel/helper-create-regexp-features-plugin@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.0.tgz#2e8badfe201cfafb5d930f46cf1e0b6f1cdcab23" + integrity sha512-ZhagAAVGD3L6MPM9/zZi7RRteonfBFLVUz3kjsnYsMAtr9hOJCKI9BAKIMpqn3NyWicPieoX779UL+7/3BEAOA== + dependencies: + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.6.0" + +"@babel/helper-define-map@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz#60b0e9fd60def9de5054c38afde8c8ee409c7529" + integrity sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.5.5" + "@babel/helper-function-name" "^7.7.0" + "@babel/types" "^7.7.0" lodash "^4.17.13" "@babel/helper-explode-assignable-expression@^7.1.0": @@ -115,61 +121,61 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" - integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== +"@babel/helper-function-name@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz#44a5ad151cfff8ed2599c91682dda2ec2c8430a3" + integrity sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q== dependencies: - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-get-function-arity" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" -"@babel/helper-get-function-arity@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" - integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== +"@babel/helper-get-function-arity@^7.0.0", "@babel/helper-get-function-arity@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz#c604886bc97287a1d1398092bc666bc3d7d7aa2d" + integrity sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.7.0" -"@babel/helper-hoist-variables@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" - integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== +"@babel/helper-hoist-variables@^7.4.4", "@babel/helper-hoist-variables@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz#b4552e4cfe5577d7de7b183e193e84e4ec538c81" + integrity sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ== dependencies: - "@babel/types" "^7.4.4" + "@babel/types" "^7.7.0" -"@babel/helper-member-expression-to-functions@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.5.5.tgz#1fb5b8ec4453a93c439ee9fe3aeea4a84b76b590" - integrity sha512-5qZ3D1uMclSNqYcXqiHoA0meVdv+xUEex9em2fqMnrk/scphGlGgg66zjMrPJESPwrFJ6sbfFQYUSa0Mz7FabA== +"@babel/helper-member-expression-to-functions@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz#472b93003a57071f95a541ea6c2b098398bcad8a" + integrity sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA== dependencies: - "@babel/types" "^7.5.5" + "@babel/types" "^7.7.0" -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" - integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz#99c095889466e5f7b6d66d98dffc58baaf42654d" + integrity sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.7.0" -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz#f84ff8a09038dcbca1fd4355661a500937165b4a" - integrity sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw== +"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz#154a69f0c5b8fd4d39e49750ff7ac4faa3f36786" + integrity sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ== dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/template" "^7.4.4" - "@babel/types" "^7.5.5" + "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-simple-access" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" lodash "^4.17.13" -"@babel/helper-optimise-call-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" - integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== +"@babel/helper-optimise-call-expression@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz#4f66a216116a66164135dc618c5d8b7a959f9365" + integrity sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.7.0" "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" @@ -183,60 +189,60 @@ dependencies: lodash "^4.17.13" -"@babel/helper-remap-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" - integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-wrap-function" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-replace-supers@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.5.5.tgz#f84ce43df031222d2bad068d2626cb5799c34bc2" - integrity sha512-XvRFWrNnlsow2u7jXDuH4jDDctkxbS7gXssrP4q2nUD606ukXHRvydj346wmNg+zAgpFx4MWf4+usfC93bElJg== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.5.5" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.5.5" - "@babel/types" "^7.5.5" - -"@babel/helper-simple-access@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" - integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== - dependencies: - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-split-export-declaration@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" - integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== - dependencies: - "@babel/types" "^7.4.4" - -"@babel/helper-wrap-function@^7.1.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" - integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.2.0" - -"@babel/helpers@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.6.0.tgz#21961d16c6a3c3ab597325c34c465c0887d31c6e" - integrity sha512-W9kao7OBleOjfXtFGgArGRX6eCP0UEcA2ZWEWNkJdRZnHhW4eEbeswbG3EwaRsnQUAEGWYgMq1HsIXuNNNy2eQ== - dependencies: - "@babel/template" "^7.6.0" - "@babel/traverse" "^7.6.0" - "@babel/types" "^7.6.0" +"@babel/helper-remap-async-to-generator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz#4d69ec653e8bff5bce62f5d33fc1508f223c75a7" + integrity sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.7.0" + "@babel/helper-wrap-function" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + +"@babel/helper-replace-supers@^7.5.5", "@babel/helper-replace-supers@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz#d5365c8667fe7cbd13b8ddddceb9bd7f2b387512" + integrity sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.7.0" + "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + +"@babel/helper-simple-access@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz#97a8b6c52105d76031b86237dc1852b44837243d" + integrity sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g== + dependencies: + "@babel/template" "^7.7.0" + "@babel/types" "^7.7.0" + +"@babel/helper-split-export-declaration@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz#1365e74ea6c614deeb56ebffabd71006a0eb2300" + integrity sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA== + dependencies: + "@babel/types" "^7.7.0" + +"@babel/helper-wrap-function@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz#15af3d3e98f8417a60554acbb6c14e75e0b33b74" + integrity sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w== + dependencies: + "@babel/helper-function-name" "^7.7.0" + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" + +"@babel/helpers@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.0.tgz#359bb5ac3b4726f7c1fde0ec75f64b3f4275d60b" + integrity sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g== + dependencies: + "@babel/template" "^7.7.0" + "@babel/traverse" "^7.7.0" + "@babel/types" "^7.7.0" "@babel/highlight@^7.0.0": version "7.5.0" @@ -247,32 +253,32 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.0.tgz#3e05d0647432a8326cb28d0de03895ae5a57f39b" - integrity sha512-+o2q111WEx4srBs7L9eJmcwi655eD8sXniLqMB93TBK9GrNzGrxDWSjiqz2hLU0Ha8MTXFIP0yd9fNdP+m43ZQ== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.2.tgz#ea8334dc77416bfd9473eb470fd00d8245b3943b" + integrity sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w== -"@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" - integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== +"@babel/plugin-proposal-async-generator-functions@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.0.tgz#83ef2d6044496b4c15d8b4904e2219e6dccc6971" + integrity sha512-ot/EZVvf3mXtZq0Pd0+tSOfGWMizqmOohXmNZg6LNFjHOV+wOPv7BvVYh8oPR8LhpIP3ye8nNooKL50YRWxpYA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/helper-remap-async-to-generator" "^7.7.0" "@babel/plugin-syntax-async-generators" "^7.2.0" -"@babel/plugin-proposal-class-properties@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.5.tgz#a974cfae1e37c3110e71f3c6a2e48b8e71958cd4" - integrity sha512-AF79FsnWFxjlaosgdi421vmYG6/jg79bVD0dpD44QdgobzHKuLZ6S3vl8la9qIeSwGi8i1fS0O1mfuDAAdo1/A== +"@babel/plugin-proposal-class-properties@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.0.tgz#ac54e728ecf81d90e8f4d2a9c05a890457107917" + integrity sha512-tufDcFA1Vj+eWvwHN+jvMN6QsV5o+vUlytNKrbMiCeDL0F2j92RURzUsUMWE5EJkLyWxjdUslCsMQa9FWth16A== dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.5" + "@babel/helper-create-class-features-plugin" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-proposal-dynamic-import@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" - integrity sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw== +"@babel/plugin-proposal-dynamic-import@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz#dc02a8bad8d653fb59daf085516fa416edd2aa7f" + integrity sha512-7poL3Xi+QFPC7sGAzEIbXUyYzGJwbc2+gSD0AkiC5k52kH2cqHdqxm5hNFfLW3cRSTcx9bN0Fl7/6zWcLLnKAQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0" @@ -309,10 +315,10 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.5.tgz#61939744f71ba76a3ae46b5eea18a54c16d22e58" - integrity sha512-F2DxJJSQ7f64FyTVl5cw/9MWn6naXGdk3Q3UhDbFEEHv+EilCPoeRD3Zh/Utx1CJz4uyKlQ4uH+bJPbEhMV7Zw== +"@babel/plugin-proposal-object-rest-spread@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz#8ffccc8f3a6545e9f78988b6bf4fe881b88e8096" + integrity sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.2.0" @@ -333,14 +339,13 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-optional-chaining" "^7.2.0" -"@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" - integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== +"@babel/plugin-proposal-unicode-property-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.0.tgz#549fe1717a1bd0a2a7e63163841cb37e78179d5d" + integrity sha512-mk34H+hp7kRBWJOOAR0ZMGCydgKMD4iN9TpDRp3IIcbunltxEY89XSimc6WbtSLCDrwcdy/EEw7h5CFCzxTchw== dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" "@babel/plugin-syntax-async-generators@^7.2.0": version "7.2.0" @@ -412,6 +417,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-top-level-await@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.0.tgz#f5699549f50bbe8d12b1843a4e82f0a37bb65f4d" + integrity sha512-hi8FUNiFIY1fnUI2n1ViB1DR0R4QeK4iHcTlW6aJkrPoTdb8Rf1EMQ6GT3f67DDkYyWgew9DFoOZ6gOoEsdzTA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-arrow-functions@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" @@ -419,14 +431,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" - integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== +"@babel/plugin-transform-async-to-generator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz#e2b84f11952cf5913fe3438b7d2585042772f492" + integrity sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw== dependencies: - "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-module-imports" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/helper-remap-async-to-generator" "^7.7.0" "@babel/plugin-transform-block-scoped-functions@^7.2.0": version "7.2.0" @@ -435,26 +447,26 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.0.tgz#c49e21228c4bbd4068a35667e6d951c75439b1dc" - integrity sha512-tIt4E23+kw6TgL/edACZwP1OUKrjOTyMrFMLoT5IOFrfMRabCgekjqFd5o6PaAMildBu46oFkekIdMuGkkPEpA== +"@babel/plugin-transform-block-scoping@^7.6.3": + version "7.6.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a" + integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.5.5.tgz#d094299d9bd680a14a2a0edae38305ad60fb4de9" - integrity sha512-U2htCNK/6e9K7jGyJ++1p5XRU+LJjrwtoiVn9SzRlDT2KubcZ11OOwy3s24TjHxPgxNwonCYP7U2K51uVYCMDg== +"@babel/plugin-transform-classes@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz#b411ecc1b8822d24b81e5d184f24149136eddd4a" + integrity sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA== dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.5.5" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.7.0" + "@babel/helper-define-map" "^7.7.0" + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-optimise-call-expression" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" - "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/helper-replace-supers" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.2.0": @@ -471,14 +483,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" - integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== +"@babel/plugin-transform-dotall-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.0.tgz#c5c9ecacab3a5e0c11db6981610f0c32fd698b3b" + integrity sha512-3QQlF7hSBnSuM1hQ0pS3pmAbWLax/uGNCbPBND9y+oJ4Y776jsyujG2k0Sn2Aj2a0QwVOiOFL5QVPA7spjvzSA== dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" "@babel/plugin-transform-duplicate-keys@^7.5.0": version "7.5.0" @@ -510,12 +521,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" - integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== +"@babel/plugin-transform-function-name@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz#0fa786f1eef52e3b7d4fc02e54b2129de8a04c2a" + integrity sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA== dependencies: - "@babel/helper-function-name" "^7.1.0" + "@babel/helper-function-name" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-literals@^7.2.0": @@ -541,39 +552,39 @@ "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz#39dfe957de4420445f1fcf88b68a2e4aa4515486" - integrity sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g== +"@babel/plugin-transform-modules-commonjs@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz#3e5ffb4fd8c947feede69cbe24c9554ab4113fe3" + integrity sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg== dependencies: - "@babel/helper-module-transforms" "^7.4.4" + "@babel/helper-module-transforms" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-simple-access" "^7.7.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" - integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== +"@babel/plugin-transform-modules-systemjs@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.0.tgz#9baf471213af9761c1617bb12fd278e629041417" + integrity sha512-ZAuFgYjJzDNv77AjXRqzQGlQl4HdUM6j296ee4fwKVZfhDR9LAGxfvXjBkb06gNETPnN0sLqRm9Gxg4wZH6dXg== dependencies: - "@babel/helper-hoist-variables" "^7.4.4" + "@babel/helper-hoist-variables" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" - integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== +"@babel/plugin-transform-modules-umd@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.0.tgz#d62c7da16670908e1d8c68ca0b5d4c0097b69966" + integrity sha512-u7eBA03zmUswQ9LQ7Qw0/ieC1pcAkbp5OQatbWUzY1PaBccvuJXUkYzoN1g7cqp7dbTu6Dp9bXyalBvD04AANA== dependencies: - "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-module-transforms" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.6.0.tgz#1e6e663097813bb4f53d42df0750cf28ad3bb3f1" - integrity sha512-jem7uytlmrRl3iCAuQyw8BpB4c4LWvSpvIeXKpMb+7j84lkx4m4mYr5ErAcmN5KM7B6BqrAvRGjBIbbzqCczew== +"@babel/plugin-transform-named-capturing-groups-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.0.tgz#358e6fd869b9a4d8f5cbc79e4ed4fc340e60dcaf" + integrity sha512-+SicSJoKouPctL+j1pqktRVCgy+xAch1hWWTMy13j0IflnyNjaoskj+DwRQFimHbLqO3sq2oN2CXMvXq3Bgapg== dependencies: - regexp-tree "^0.1.13" + "@babel/helper-create-regexp-features-plugin" "^7.7.0" "@babel/plugin-transform-new-target@^7.4.4": version "7.4.4" @@ -606,10 +617,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-regenerator@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" - integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== +"@babel/plugin-transform-regenerator@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz#f1b20b535e7716b622c99e989259d7dd942dd9cc" + integrity sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg== dependencies: regenerator-transform "^0.14.0" @@ -620,10 +631,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-runtime@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.0.tgz#85a3cce402b28586138e368fce20ab3019b9713e" - integrity sha512-Da8tMf7uClzwUm/pnJ1S93m/aRXmoYNDD7TkHua8xBDdaAs54uZpTWvEt6NGwmoVMb9mZbntfTqmG2oSzN/7Vg== +"@babel/plugin-transform-runtime@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.2.tgz#2669f67c1fae0ae8d8bf696e4263ad52cb98b6f8" + integrity sha512-cqULw/QB4yl73cS5Y0TZlQSjDvNkzDbu0FurTZyHlJpWE5T3PCMdnyV+xXoH1opr1ldyHODe3QAX3OMAii5NxA== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" @@ -637,10 +648,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" - integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== +"@babel/plugin-transform-spread@^7.6.2": + version "7.6.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz#fc77cf798b24b10c46e1b51b1b88c2bf661bb8dd" + integrity sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -667,65 +678,65 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-unicode-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" - integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== +"@babel/plugin-transform-unicode-regex@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz#743d9bcc44080e3cc7d49259a066efa30f9187a3" + integrity sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA== dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" -"@babel/preset-env@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.6.0.tgz#aae4141c506100bb2bfaa4ac2a5c12b395619e50" - integrity sha512-1efzxFv/TcPsNXlRhMzRnkBFMeIqBBgzwmZwlFDw5Ubj0AGLeufxugirwZmkkX/ayi3owsSqoQ4fw8LkfK9SYg== +"@babel/preset-env@^7.7.1": + version "7.7.1" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.1.tgz#04a2ff53552c5885cf1083e291c8dd5490f744bb" + integrity sha512-/93SWhi3PxcVTDpSqC+Dp4YxUu3qZ4m7I76k0w73wYfn7bGVuRIO4QUz95aJksbS+AD1/mT1Ie7rbkT0wSplaA== dependencies: - "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-module-imports" "^7.7.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-dynamic-import" "^7.5.0" + "@babel/plugin-proposal-async-generator-functions" "^7.7.0" + "@babel/plugin-proposal-dynamic-import" "^7.7.0" "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.5.5" + "@babel/plugin-proposal-object-rest-spread" "^7.6.2" "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-proposal-unicode-property-regex" "^7.7.0" "@babel/plugin-syntax-async-generators" "^7.2.0" "@babel/plugin-syntax-dynamic-import" "^7.2.0" "@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.7.0" "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.5.0" + "@babel/plugin-transform-async-to-generator" "^7.7.0" "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.6.0" - "@babel/plugin-transform-classes" "^7.5.5" + "@babel/plugin-transform-block-scoping" "^7.6.3" + "@babel/plugin-transform-classes" "^7.7.0" "@babel/plugin-transform-computed-properties" "^7.2.0" "@babel/plugin-transform-destructuring" "^7.6.0" - "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.7.0" "@babel/plugin-transform-duplicate-keys" "^7.5.0" "@babel/plugin-transform-exponentiation-operator" "^7.2.0" "@babel/plugin-transform-for-of" "^7.4.4" - "@babel/plugin-transform-function-name" "^7.4.4" + "@babel/plugin-transform-function-name" "^7.7.0" "@babel/plugin-transform-literals" "^7.2.0" "@babel/plugin-transform-member-expression-literals" "^7.2.0" "@babel/plugin-transform-modules-amd" "^7.5.0" - "@babel/plugin-transform-modules-commonjs" "^7.6.0" - "@babel/plugin-transform-modules-systemjs" "^7.5.0" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.6.0" + "@babel/plugin-transform-modules-commonjs" "^7.7.0" + "@babel/plugin-transform-modules-systemjs" "^7.7.0" + "@babel/plugin-transform-modules-umd" "^7.7.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.0" "@babel/plugin-transform-new-target" "^7.4.4" "@babel/plugin-transform-object-super" "^7.5.5" "@babel/plugin-transform-parameters" "^7.4.4" "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.4.5" + "@babel/plugin-transform-regenerator" "^7.7.0" "@babel/plugin-transform-reserved-words" "^7.2.0" "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" + "@babel/plugin-transform-spread" "^7.6.2" "@babel/plugin-transform-sticky-regex" "^7.2.0" "@babel/plugin-transform-template-literals" "^7.4.4" "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.6.0" + "@babel/plugin-transform-unicode-regex" "^7.7.0" + "@babel/types" "^7.7.1" browserslist "^4.6.0" core-js-compat "^3.1.1" invariant "^2.2.2" @@ -740,52 +751,52 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types" "^7.0.0" -"@babel/register@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.6.0.tgz#76b6f466714680f4becafd45beeb2a7b87431abf" - integrity sha512-78BomdN8el+x/nkup9KwtjJXuptW5oXMFmP11WoM2VJBjxrKv4grC3qjpLL8RGGUYUGsm57xnjYFM2uom+jWUQ== +"@babel/register@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.7.0.tgz#4e23ecf840296ef79c605baaa5c89e1a2426314b" + integrity sha512-HV3GJzTvSoyOMWGYn2TAh6uL6g+gqKTgEZ99Q3+X9UURT1VPT/WcU46R61XftIc5rXytcOHZ4Z0doDlsjPomIg== 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" + source-map-support "^0.5.16" -"@babel/runtime@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.0.tgz#4fc1d642a9fd0299754e8b5de62c631cf5568205" - integrity sha512-89eSBLJsxNxOERC0Op4vd+0Bqm6wRMqMbFtV3i0/fbaWw/mJ8Q3eBvgX0G4SyrOOLCtbu98HspF8o09MRT+KzQ== +"@babel/runtime@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.2.tgz#111a78002a5c25fc8e3361bedc9529c696b85a6a" + integrity sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw== dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4", "@babel/template@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.6.0.tgz#7f0159c7f5012230dad64cca42ec9bdb5c9536e6" - integrity sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ== +"@babel/template@^7.4.0", "@babel/template@^7.7.0": + version "7.7.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" + integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.6.0" - "@babel/types" "^7.6.0" + "@babel/parser" "^7.7.0" + "@babel/types" "^7.7.0" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.5", "@babel/traverse@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.6.0.tgz#389391d510f79be7ce2ddd6717be66d3fed4b516" - integrity sha512-93t52SaOBgml/xY74lsmt7xOR4ufYvhb5c5qiM6lu4J/dWGMAfAh6eKw4PjLes6DI6nQgearoxnFJk60YchpvQ== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" + integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.6.0" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.6.0" - "@babel/types" "^7.6.0" + "@babel/generator" "^7.7.2" + "@babel/helper-function-name" "^7.7.0" + "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/parser" "^7.7.2" + "@babel/types" "^7.7.2" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.5.5", "@babel/types@^7.6.0": - version "7.6.1" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.1.tgz#53abf3308add3ac2a2884d539151c57c4b3ac648" - integrity sha512-X7gdiuaCmA0uRjCmRtYJNAVCc/q+5xSgsfKJHqMN4iNLILX39677fJE1O40arPMh0TTtS9ItH67yre6c7k6t0g== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": + version "7.7.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" + integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== dependencies: esutils "^2.0.2" lodash "^4.17.13" @@ -3505,10 +3516,10 @@ conventional-recommended-bump@^5.0.0: meow "^4.0.0" q "^1.5.1" -convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0, convert-source-map@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== dependencies: safe-buffer "~5.1.1" @@ -6782,9 +6793,9 @@ json5@^1.0.1: minimist "^1.2.0" json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + version "2.1.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" + integrity sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ== dependencies: minimist "^1.2.0" @@ -9175,17 +9186,12 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp-tree@^0.1.13: - version "0.1.13" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.13.tgz#5b19ab9377edc68bc3679256840bb29afc158d7f" - integrity sha512-hwdV/GQY5F8ReLZWO+W1SRoN5YfpOKY6852+tBFcma72DKBIcHjPRIlIvQN35bCOljuAfP2G2iB0FC/w236mUw== - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== -regexpu-core@^4.5.4: +regexpu-core@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.6.0.tgz#2037c18b327cfce8a6fea2a4ec441f2432afb8b6" integrity sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg== @@ -9754,10 +9760,10 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.6, source-map-support@^0.5.9: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== +source-map-support@^0.5.16, source-map-support@^0.5.6: + version "0.5.16" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" + integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -10441,11 +10447,6 @@ trim-off-newlines@^1.0.0: resolved "https://registry.yarnpkg.com/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz#9f9ba9d9efa8764c387698bcbfeb2c848f11adb3" integrity sha1-n5up2e+odkw4dpi8v+sshI8RrbM= -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - tslib@^1.9.0: version "1.10.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" From 7633f094793e2bffc82f1c4f4036fdbf30418700 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 12 Nov 2019 18:25:24 -0500 Subject: [PATCH 214/965] =?UTF-8?q?Babel=20should=20not=20silently=20remov?= =?UTF-8?q?e=20unknown=20options=20after=20command=E2=80=A6=20(#10698)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: add test case * chore: bump commander to 4.0.1 * fix: let commander.js throw on unknown options after args --- packages/babel-cli/package.json | 2 +- packages/babel-cli/src/babel/options.js | 4 ++++ .../error incorrect options after args/in-files/script.js | 1 + .../babel/error incorrect options after args/options.json | 4 ++++ .../babel/error incorrect options after args/stderr.txt | 1 + .../error incorrect options before args/in-files/script.js | 1 + .../babel/error incorrect options before args/options.json | 4 ++++ .../babel/error incorrect options before args/stderr.txt | 1 + 8 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options after args/in-files/script.js create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options after args/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options after args/stderr.txt create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options before args/in-files/script.js create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options before args/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/error incorrect options before args/stderr.txt diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 0328b7596c27..c5b1e90485d6 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -19,7 +19,7 @@ "compiler" ], "dependencies": { - "commander": "^2.8.1", + "commander": "^4.0.1", "convert-source-map": "^1.1.0", "fs-readdir-recursive": "^1.1.0", "glob": "^7.0.0", diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 169c61ffa51a..1543d02f4bb4 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -163,6 +163,10 @@ commander.option( commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); +// register an empty action handler so that commander.js can throw on +// unknown options _after_ args +// see https://github.com/tj/commander.js/issues/561#issuecomment-522209408 +commander.action(() => {}); export type CmdOptions = { babelOptions: Object, diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options after args/in-files/script.js b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/in-files/script.js new file mode 100644 index 000000000000..4bc9539528d4 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/in-files/script.js @@ -0,0 +1 @@ +arr.map(x => x * MULTIPLIER); diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options after args/options.json b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/options.json new file mode 100644 index 000000000000..dde64755da06 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/options.json @@ -0,0 +1,4 @@ +{ + "args": ["script.js", "--spruce-maps"], + "stderrContains": true +} diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options after args/stderr.txt b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/stderr.txt new file mode 100644 index 000000000000..294d5ccaeaed --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options after args/stderr.txt @@ -0,0 +1 @@ +error: unknown option '--spruce-maps' diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options before args/in-files/script.js b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/in-files/script.js new file mode 100644 index 000000000000..4bc9539528d4 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/in-files/script.js @@ -0,0 +1 @@ +arr.map(x => x * MULTIPLIER); diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options before args/options.json b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/options.json new file mode 100644 index 000000000000..0d7953971726 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/options.json @@ -0,0 +1,4 @@ +{ + "args": ["--spruce-maps", "script.js"], + "stderrContains": true +} diff --git a/packages/babel-cli/test/fixtures/babel/error incorrect options before args/stderr.txt b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/stderr.txt new file mode 100644 index 000000000000..294d5ccaeaed --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error incorrect options before args/stderr.txt @@ -0,0 +1 @@ +error: unknown option '--spruce-maps' From 67ea7f4b4da9726d66982258a64c001481b7cda5 Mon Sep 17 00:00:00 2001 From: Jaideep Bhoosreddy Date: Wed, 13 Nov 2019 11:31:29 -0500 Subject: [PATCH 215/965] Implement PR workflow for running test262 on babel PRs (#10579) * Implement PR workflow with test262 * revisions --- .circleci/config.yml | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 400c61909baa..0d1c725d3243 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,6 +40,9 @@ aliases: - &artifact_test262_xunit path: ~/test-results + - &artifact_test262_diff_tap + path: ~/diff.tap + executors: node-executor: docker: @@ -73,6 +76,14 @@ jobs: executor: node-executor steps: - checkout + - run: + name: Sync with latest master branch (only on PRs) + command: | + if [ -n "$CIRCLE_PULL_REQUEST" ] + then + git fetch origin refs/pull/$CIRCLE_PR_NUMBER/merge + git checkout -qf FETCH_HEAD + fi - restore_cache: *restore-yarn-cache - restore_cache: *restore-node-modules-cache - run: @@ -100,16 +111,34 @@ jobs: yarn link $(./jq -j ".name" $package) done node lib/download-node + - run: + name: Download master branch Test262 artifact + command: node lib/download-master-artifact ~/master.tap + <<: *test262_workdir - run: name: Run Test262 command: node lib/run-tests I_AM_SURE | tee ~/test262.tap <<: *test262_workdir - store_artifacts: *artifact_test262_tap - run: - name: Output test262 results + name: Output Test262 results command: | cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true <<: *test262_workdir + - run: + name: Compare previous master branch & current job results + command: | + mkdir -p ~/test-results/test262 + node lib/compare-results ~/master.tap ~/test262.tap | tee ~/diff.tap + <<: *test262_workdir + - store_artifacts: *artifact_test262_diff_tap + - run: + name: Output comparision results and report to CircleCI + command: | + mkdir -p ~/test-results/test262 + cat ~/diff.tap | $(npm bin)/tap-merge | $(npm bin)/tap-mocha-reporter xunit | tee ~/test-results/test262/results.xml + <<: *test262_workdir + - store_test_results: *artifact_test262_xunit publish-verdaccio: executor: node-executor @@ -136,15 +165,20 @@ workflows: test: jobs: - test - - master: + test262-master: jobs: - test262: filters: branches: only: - master - + test262: + jobs: + - approve-test262-run: + type: approval + - test262: + requires: + - approve-test262-run e2e: jobs: - publish-verdaccio From 1d1101eb7c8d89a2179b098f6dd131b4b479020a Mon Sep 17 00:00:00 2001 From: ZYSzys Date: Thu, 14 Nov 2019 00:39:19 +0800 Subject: [PATCH 216/965] Add missing flow type to babel-cli for consistency (#10692) --- packages/babel-cli/src/babel/dir.js | 6 +++--- packages/babel-cli/src/babel/file.js | 2 +- packages/babel-cli/src/babel/options.js | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index c6790d5acea7..234eb7c8f60b 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -145,7 +145,7 @@ export default async function({ if (cliOptions.watch) { const chokidar = util.requireChokidar(); - filenames.forEach(function(filenameOrDir) { + filenames.forEach(function(filenameOrDir: string): void { const watcher = chokidar.watch(filenameOrDir, { persistent: true, ignoreInitial: true, @@ -155,8 +155,8 @@ export default async function({ }, }); - ["add", "change"].forEach(function(type) { - watcher.on(type, function(filename) { + ["add", "change"].forEach(function(type: string): void { + watcher.on(type, function(filename: string): void { handleFile( filename, filename === filenameOrDir diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js index 23b0307cc884..1ad5d6b84772 100644 --- a/packages/babel-cli/src/babel/file.js +++ b/packages/babel-cli/src/babel/file.js @@ -223,7 +223,7 @@ export default async function({ pollInterval: 10, }, }) - .on("all", function(type: string, filename: string) { + .on("all", function(type: string, filename: string): void { if (!util.isCompilableExtension(filename, cliOptions.extensions)) { return; } diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 1543d02f4bb4..fa09d6b64ed3 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -320,7 +320,10 @@ function booleanify(val: any): boolean | any { return val; } -function collect(value, previousValue): Array { +function collect( + value: string | any, + previousValue: Array, +): Array { // If the user passed the option with no value, like "babel file.js --presets", do nothing. if (typeof value !== "string") return previousValue; From 433b6ba3a41c6715bd3638b243502d51304555a2 Mon Sep 17 00:00:00 2001 From: Jaideep Bhoosreddy Date: Wed, 13 Nov 2019 15:42:44 -0500 Subject: [PATCH 217/965] Ignore PR job on master branch (#10702) --- .circleci/config.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d1c725d3243..f654bb91c696 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,9 +176,17 @@ workflows: jobs: - approve-test262-run: type: approval + filters: + branches: + ignore: + - master - test262: requires: - approve-test262-run + filters: + branches: + ignore: + - master e2e: jobs: - publish-verdaccio From e1839e5ec9c10ffadac51aa58fbc1e6753c6b27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 13 Nov 2019 16:47:56 -0500 Subject: [PATCH 218/965] Circumvent typeof transform for umd build template (#10701) * add test case * fix: circumvent typeof transform * chore: update test fixtures --- .../output.js | 2 +- .../src/index.js | 8 ++++--- .../loose/export-default-10/output.js | 2 +- .../loose/export-default-11/output.js | 2 +- .../fixtures/loose/export-default-2/output.js | 2 +- .../fixtures/loose/export-default-3/output.js | 2 +- .../fixtures/loose/export-default-4/output.js | 2 +- .../fixtures/loose/export-default-5/output.js | 2 +- .../fixtures/loose/export-default-6/output.js | 2 +- .../fixtures/loose/export-default-7/output.js | 2 +- .../fixtures/loose/export-default-8/output.js | 2 +- .../fixtures/loose/export-default-9/output.js | 2 +- .../fixtures/loose/export-default/output.js | 2 +- .../fixtures/loose/export-from-2/output.js | 2 +- .../fixtures/loose/export-from-3/output.js | 2 +- .../fixtures/loose/export-from-4/output.js | 2 +- .../fixtures/loose/export-from-5/output.js | 2 +- .../fixtures/loose/export-from-6/output.js | 2 +- .../test/fixtures/loose/export-from/output.js | 2 +- .../fixtures/loose/export-named-2/output.js | 2 +- .../fixtures/loose/export-named-3/output.js | 2 +- .../fixtures/loose/export-named-4/output.js | 2 +- .../fixtures/loose/export-named-5/output.js | 2 +- .../fixtures/loose/export-named/output.js | 2 +- .../fixtures/loose/exports-variable/output.js | 2 +- .../loose/get-module-name-option/output.js | 2 +- .../loose/hoist-function-exports/output.js | 2 +- .../fixtures/loose/imports-default/output.js | 2 +- .../output.js | 2 +- .../imports-exact-globals-false/output.js | 2 +- .../output.js | 2 +- .../imports-exact-globals-true/output.js | 2 +- .../fixtures/loose/imports-glob/output.js | 2 +- .../fixtures/loose/imports-mixing/output.js | 2 +- .../fixtures/loose/imports-named/output.js | 2 +- .../test/fixtures/loose/imports/output.js | 2 +- .../output.js | 2 +- .../output.js | 2 +- .../output.js | 2 +- .../test/fixtures/loose/module-id/output.js | 2 +- .../output.js | 2 +- .../test/fixtures/loose/module-name/output.js | 2 +- .../loose/non-default-imports/output.js | 2 +- .../loose/override-export-name/output.js | 2 +- .../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 +- .../fixtures/umd/export-default-10/output.js | 2 +- .../fixtures/umd/export-default-11/output.js | 2 +- .../fixtures/umd/export-default-2/output.js | 2 +- .../fixtures/umd/export-default-3/output.js | 2 +- .../fixtures/umd/export-default-4/output.js | 2 +- .../fixtures/umd/export-default-5/output.js | 2 +- .../fixtures/umd/export-default-6/output.js | 2 +- .../fixtures/umd/export-default-7/output.js | 2 +- .../fixtures/umd/export-default-8/output.js | 2 +- .../fixtures/umd/export-default-9/output.js | 2 +- .../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 +- .../fixtures/umd/export-named-2/output.js | 2 +- .../fixtures/umd/export-named-3/output.js | 2 +- .../fixtures/umd/export-named-4/output.js | 2 +- .../fixtures/umd/export-named-5/output.js | 2 +- .../test/fixtures/umd/export-named/output.js | 2 +- .../fixtures/umd/exports-variable/output.js | 2 +- .../umd/get-module-name-option/output.js | 2 +- .../umd/hoist-function-exports/output.js | 2 +- .../fixtures/umd/imports-default/output.js | 2 +- .../output.js | 2 +- .../umd/imports-exact-globals-false/output.js | 2 +- .../output.js | 2 +- .../umd/imports-exact-globals-true/output.js | 2 +- .../test/fixtures/umd/imports-glob/output.js | 2 +- .../fixtures/umd/imports-mixing/output.js | 2 +- .../test/fixtures/umd/imports-named/output.js | 2 +- .../test/fixtures/umd/imports/output.js | 2 +- .../output.js | 2 +- .../output.js | 2 +- .../output.js | 2 +- .../test/fixtures/umd/module-id/output.js | 2 +- .../output.js | 2 +- .../test/fixtures/umd/module-name/output.js | 2 +- .../umd/non-default-imports/output.js | 2 +- .../umd/override-export-name/output.js | 2 +- .../umd/override-import-name/output.js | 2 +- .../test/fixtures/umd/overview/output.js | 2 +- .../test/fixtures/umd/remap/output.js | 2 +- .../dynamic-import/modules-umd/output.js | 4 +--- .../fixtures/modules/modules-umd/output.js | 4 +--- .../plugins-integration/issue-10662/input.mjs | 2 ++ .../issue-10662/options.json | 14 +++++++++++++ .../plugins-integration/issue-10662/output.js | 21 +++++++++++++++++++ 98 files changed, 136 insertions(+), 101 deletions(-) create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json create mode 100644 packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/output.js 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 aca80143342e..cd8510701baf 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 037c70f2b45b..87ab37eff91d 100644 --- a/packages/babel-plugin-transform-modules-umd/src/index.js +++ b/packages/babel-plugin-transform-modules-umd/src/index.js @@ -14,7 +14,9 @@ import { types as t, template } from "@babel/core"; const buildPrerequisiteAssignment = template(` GLOBAL_REFERENCE = GLOBAL_REFERENCE || {} `); - +// Note: we avoid comparing typeof results with "object" or "symbol" otherwise +// they will be processed by `transform-typeof-symbol`, which in return could +// cause typeof helper used before declaration const buildWrapper = template(` (function (global, factory) { if (typeof define === "function" && define.amd) { @@ -28,8 +30,8 @@ const buildWrapper = template(` GLOBAL_TO_ASSIGN; } })( - typeof globalThis === "object" ? globalThis - : typeof self === "object" ? self + typeof globalThis !== "undefined" ? globalThis + : typeof self !== "undefined" ? 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 32501cb4319b..16cf5dab5b0e 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0633fe90d0a0..43f6f4120ba2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 34e8e2fa3d82..1eb753f05ea7 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 aa3b89c8d714..8b28dd6ec87b 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 7e144092f4e7..d1aa080c8110 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 6766df086135..50d6e6ae7234 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 4fd6be58e8d3..2e9a39834a8f 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 fa009a30d6df..99ed0428f6f9 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f221e56a8ccd..50619c0ab739 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f840c25e6f78..78580db2a617 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5b666da90d2f..005e2f9b8237 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 14961ba262e8..75e19b01ab38 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 fb7da87c3f20..d6c735f4b8c8 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 dc7a24f5f4c5..13cd6c56cf1a 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 2e900d34ed1a..db35ffb83d9e 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 feaf9c4c81a1..8405ded47ad5 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 c9634daa1bc9..f200b057fbbf 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f840c25e6f78..78580db2a617 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 d8434b638462..4e96e316480b 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 9f6a74975f35..e19d1a5d1fc3 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 60d36f6a310e..c9353e2a5bd1 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 e12b16c662f8..23ff6af10e6e 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 34f0969295f0..d4aeec297660 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 9ef9726b81db..bbfb355912b8 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 3894e1d6357b..640ce3bb776c 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _evens) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 733966a5af62..71c3133b263f 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 9d38e1ce05a6..c751e3aee868 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 18307048ec1b..5229781b738a 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 05b85cc76366..54211b04b3c0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 baea395d1471..bf4c741e6ce0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 2820bf461f2a..be83fe78d33c 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 37b9f152bef7..17bf5e1fac30 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f8fb2a0217cb..d6e7457a2618 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0e773a28c17e..5d36f0f1abf6 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo, _fooBar, _fooBar2) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5c79efde0967..06cb04062449 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 55ebfb1b8c30..da053338dc3b 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0085a705c53a..55f97d820fda 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 7dc12234cdb4..2d9c9cd817c0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 db9e9b200d7c..45d0bcb7c75b 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 01c2ce86f9d3..ec9d725704c7 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 10c4c15c9b6a..81afa0c2b734 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_render) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5b666da90d2f..005e2f9b8237 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 c6850dc1ab1a..9a60cc93eeff 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_es6Promise) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0ec5e6cb6d88..92177358c8c4 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, foo2, _fooBar, _fooBar2) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 a8503bc29b96..03b4c1258a54 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f0c22802cb37..78689e28938e 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 49e75d5bc965..96660c937784 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5447cc116b68..670be0b97f02 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 04d3f90de328..ec688671cff5 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 6579e72a0bdd..b982d97d90da 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5478384d3bde..e5dafcbe9c01 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 ae92ef86e76d..b57a16c2680f 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 38bb552b8f92..b244eea085de 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 b5b988ee2090..7a36751246c2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 a9d3a15498cd..260883e265f2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 e0c54835f5f6..20b42c4faae2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 3650a0e70afd..127234bed6d4 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 24f7b0cac307..3580d4361beb 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5d59222a6acc..033dc64eadbe 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 a71a3dc3afa1..1a2577046f54 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 c5806681062b..fd5bfbed33af 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 69ed1878b92c..46e4a2b27dd2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 3f4e37cb955c..cda318717a4c 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 e0c54835f5f6..20b42c4faae2 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0174dbf05c23..9b45a5008053 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 b39c6551907e..096434af4d2e 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 ea7c9ea47720..6966fb097e00 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 ba76f746df69..1062cc37298a 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 116ca5633a54..9ad3023932a7 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 9ef9726b81db..bbfb355912b8 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 6b33b55fddfb..f6448a39188b 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, _evens) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 733966a5af62..71c3133b263f 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 9d38e1ce05a6..c751e3aee868 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 18307048ec1b..5229781b738a 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 05b85cc76366..54211b04b3c0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 baea395d1471..bf4c741e6ce0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_fooBar, _fooBar2, _fizzbuzz) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 2820bf461f2a..be83fe78d33c 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 37b9f152bef7..17bf5e1fac30 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 f8fb2a0217cb..d6e7457a2618 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0e773a28c17e..5d36f0f1abf6 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_foo, _fooBar, _fooBar2) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 b45744b06497..db961cbcdf89 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 0b358a9b2079..c3bd11fb105c 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 3a3fb1a0cb30..dd85a01acf7d 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 7dc12234cdb4..2d9c9cd817c0 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 1d76a5b0d621..e6186c39d886 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 07c787a92f28..e85460f205bb 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 10c4c15c9b6a..81afa0c2b734 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_render) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 3650a0e70afd..127234bed6d4 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 c6850dc1ab1a..9a60cc93eeff 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_es6Promise) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 4d7a91b32231..294904dbbd39 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports, foo2, _fooBar, _fooBar2) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 c374f3aa7925..33c36e34dc22 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; } -})(typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : this, function (_exports) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 8e25ad450629..f4b267b43c0b 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,5 +1,3 @@ -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); @@ -12,7 +10,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat factory(); global.input = mod.exports; } -})((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object" ? globalThis : (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" ? self : this, function () { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? 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 5f1d193f306f..f4afd867e11a 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,5 +1,3 @@ -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); @@ -12,7 +10,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat factory(global.a); global.input = mod.exports; } -})((typeof globalThis === "undefined" ? "undefined" : _typeof(globalThis)) === "object" ? globalThis : (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" ? self : this, function (_a) { +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_a) { "use strict"; _a = _interopRequireDefault(_a); diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/input.mjs b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/input.mjs new file mode 100644 index 000000000000..99f2bc766393 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/input.mjs @@ -0,0 +1,2 @@ +var globalThis = {}; +typeof globalThis; diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json new file mode 100644 index 000000000000..00fdf1fb5d98 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "env", + { + "modules": "umd", + "targets": [ + "Safari 8", + "IE 11" + ] + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/output.js new file mode 100644 index 000000000000..e13f6d324d73 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/output.js @@ -0,0 +1,21 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof exports !== "undefined") { + factory(); + } else { + var mod = { + exports: {} + }; + factory(); + global.input = mod.exports; + } +})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function () { + "use strict"; + + 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); } + + var globalThis = {}; + + _typeof(globalThis); +}); From 15b0283650581c100da7fc6571df58c1ceee425b Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 13 Nov 2019 19:40:27 -0500 Subject: [PATCH 219/965] --- lerna.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lerna.json b/lerna.json index aaabc787806d..d51103fbc211 100644 --- a/lerna.json +++ b/lerna.json @@ -28,6 +28,7 @@ }, "packages": [ "codemods/*", + "eslint/*", "packages/*" ], "npmClient": "yarn", From 13feb7278e5c19c7e1b8d9177447525088e34e53 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 29 Jun 2016 16:40:35 -0400 Subject: [PATCH 220/965] init --- .../babel-eslint-config-internal/.gitignore | 1 + eslint/babel-eslint-config-internal/README.md | 3 + eslint/babel-eslint-config-internal/index.js | 64 +++++++++++++++++++ .../babel-eslint-config-internal/package.json | 21 ++++++ 4 files changed, 89 insertions(+) create mode 100644 eslint/babel-eslint-config-internal/.gitignore create mode 100644 eslint/babel-eslint-config-internal/README.md create mode 100644 eslint/babel-eslint-config-internal/index.js create mode 100644 eslint/babel-eslint-config-internal/package.json diff --git a/eslint/babel-eslint-config-internal/.gitignore b/eslint/babel-eslint-config-internal/.gitignore new file mode 100644 index 000000000000..3c3629e647f5 --- /dev/null +++ b/eslint/babel-eslint-config-internal/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/eslint/babel-eslint-config-internal/README.md b/eslint/babel-eslint-config-internal/README.md new file mode 100644 index 000000000000..9978722d8b5d --- /dev/null +++ b/eslint/babel-eslint-config-internal/README.md @@ -0,0 +1,3 @@ +eslint-config-babel + +eslint config for the babel codebase (copied from eslint-config-kittens) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js new file mode 100644 index 000000000000..11a9baa56090 --- /dev/null +++ b/eslint/babel-eslint-config-internal/index.js @@ -0,0 +1,64 @@ +module.exports = { + parser: "babel-eslint", + extends: "eslint:recommended", + plugins: ["flow-vars", "babel"], + rules: { + "flow-vars/define-flow-type": 1, + "flow-vars/use-flow-type": 1, + quotes: [2, "double"], + "no-var": 2, + "keyword-spacing": 2, + strict: 0, + "no-underscore-dangle": 0, + curly: 0, + "no-multi-spaces": 0, + "key-spacing": 0, + "no-return-assign": 0, + "consistent-return": 0, + "no-shadow": 0, + "comma-dangle": 0, + "no-use-before-define": 0, + "no-empty": 0, + "new-parens": 0, + "no-cond-assign": 0, + "no-fallthrough": 0, + "new-cap": 0, + "no-loop-func": 0, + "no-unreachable": 0, + "no-labels": 0, + "no-process-exit": 0, + camelcase: 0, + "no-console": 0, + "no-constant-condition": 0, + "no-inner-declarations": 0, + "no-case-declarations": 0, + semi: [2, "always"], + + // soft indent of 2 characters + "indent": [2, 2], + + // maximum length of 110 characters + "max-len": [2, 110, 2], + + // Enforce parens around arrow function arguments + "babel/arrow-parens": [2, "always"], + // Require a space on each side of arrow operator + "arrow-spacing": [2, { before: true, after: true }], + // Prevent using => in a condition where <= is intended + "no-confusing-arrow": 2, + // prevent no space in `if (){` + "space-before-blocks": "always" + }, + + globals: { + // Flow + Iterator: true, + $Keys: true + }, + + env: { + node: true, + es6: true, + browser: true + } +}; diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json new file mode 100644 index 000000000000..04c3b0b3d1d3 --- /dev/null +++ b/eslint/babel-eslint-config-internal/package.json @@ -0,0 +1,21 @@ +{ + "name": "eslint-config-babel", + "version": "1.0.0", + "description": "eslint config for babel", + "author": "Sebastian McKenzie ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel/tree/master/packages/eslint-config-babel" + }, + "main": "index.js", + "dependencies": { + "babel-eslint": "^6.0.0", + "eslint-plugin-babel": "^3.0.0", + "eslint-plugin-flow-vars": "^0.4.0" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } +} From a48f2e209cc925de6afaac2e3b08770ee0f008e8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 29 Jun 2016 17:33:26 -0400 Subject: [PATCH 221/965] fix bug with config, use other way of specifying severity --- eslint/babel-eslint-config-internal/index.js | 72 ++++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 11a9baa56090..2643eaf35066 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -3,51 +3,51 @@ module.exports = { extends: "eslint:recommended", plugins: ["flow-vars", "babel"], rules: { - "flow-vars/define-flow-type": 1, - "flow-vars/use-flow-type": 1, - quotes: [2, "double"], - "no-var": 2, - "keyword-spacing": 2, - strict: 0, - "no-underscore-dangle": 0, - curly: 0, - "no-multi-spaces": 0, - "key-spacing": 0, - "no-return-assign": 0, - "consistent-return": 0, - "no-shadow": 0, - "comma-dangle": 0, - "no-use-before-define": 0, - "no-empty": 0, - "new-parens": 0, - "no-cond-assign": 0, - "no-fallthrough": 0, - "new-cap": 0, - "no-loop-func": 0, - "no-unreachable": 0, - "no-labels": 0, - "no-process-exit": 0, - camelcase: 0, - "no-console": 0, - "no-constant-condition": 0, - "no-inner-declarations": 0, - "no-case-declarations": 0, - semi: [2, "always"], + "flow-vars/define-flow-type": "warn", + "flow-vars/use-flow-type": "warn", + quotes: ["error", "double"], + "no-var": "error", + "keyword-spacing": "error", + strict: "off", + "no-underscore-dangle": "off", + curly: "off", + "no-multi-spaces": "off", + "key-spacing": "off", + "no-return-assign": "off", + "consistent-return": "off", + "no-shadow": "off", + "comma-dangle": "off", + "no-use-before-define": "off", + "no-empty": "off", + "new-parens": "off", + "no-cond-assign": "off", + "no-fallthrough": "off", + "new-cap": "off", + "no-loop-func": "off", + "no-unreachable": "off", + "no-labels": "off", + "no-process-exit": "off", + camelcase: "off", + "no-console": "off", + "no-constant-condition": "off", + "no-inner-declarations": "off", + "no-case-declarations": "off", + semi: ["error", "always"], // soft indent of 2 characters - "indent": [2, 2], + "indent": ["error", 2], // maximum length of 110 characters - "max-len": [2, 110, 2], + "max-len": ["error", 110, 2], // Enforce parens around arrow function arguments - "babel/arrow-parens": [2, "always"], + "babel/arrow-parens": ["error", "always"], // Require a space on each side of arrow operator - "arrow-spacing": [2, { before: true, after: true }], + "arrow-spacing": ["error", { before: true, after: true }], // Prevent using => in a condition where <= is intended - "no-confusing-arrow": 2, + "no-confusing-arrow": "error", // prevent no space in `if (){` - "space-before-blocks": "always" + "space-before-blocks": ["error", "always"] }, globals: { From 5706f0531ba70d62f64b9314e31ba176525f6a00 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 29 Jun 2016 17:33:34 -0400 Subject: [PATCH 222/965] 1.0.1 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 04c3b0b3d1d3..41f3f6135aef 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "1.0.0", + "version": "1.0.1", "description": "eslint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From bfa69bbdb63e44d95afdfb7586c7bfb214c83990 Mon Sep 17 00:00:00 2001 From: Bo Borgerson Date: Fri, 2 Sep 2016 15:48:46 -0700 Subject: [PATCH 223/965] Add the "space-infix-ops" rule (babel/eslint-config-babel#1) Require whitespace around infix operators. The babel code base already mostly satisfies this. Nice to keep it that way. This is used by Lerna, too. --- eslint/babel-eslint-config-internal/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 2643eaf35066..925c8370725e 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -44,6 +44,8 @@ module.exports = { "babel/arrow-parens": ["error", "always"], // Require a space on each side of arrow operator "arrow-spacing": ["error", { before: true, after: true }], + // Require a space on each side of all infix operators + "space-infix-ops": "error", // Prevent using => in a condition where <= is intended "no-confusing-arrow": "error", // prevent no space in `if (){` From b95c7aa5568861ec6114ec6f2f4ce7e5a30fd72c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 2 Sep 2016 18:49:34 -0400 Subject: [PATCH 224/965] 1.0.2 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 41f3f6135aef..86bd94eb8ac2 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "1.0.1", + "version": "1.0.2", "description": "eslint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From edcf1b59dd7022a01c18560acb3db58709e863b2 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 24 Sep 2016 08:09:47 +0200 Subject: [PATCH 225/965] Exchange flow plugin with new one (babel/eslint-config-babel#2) * Change to eslint-plugin-flowtype * Use new plugin * Make dependencies peerDependencies * Readd babel-eslint --- eslint/babel-eslint-config-internal/index.js | 4 ++-- eslint/babel-eslint-config-internal/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 925c8370725e..b4b144a942ac 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -3,8 +3,8 @@ module.exports = { extends: "eslint:recommended", plugins: ["flow-vars", "babel"], rules: { - "flow-vars/define-flow-type": "warn", - "flow-vars/use-flow-type": "warn", + "flowtype/define-flow-type": "warn", + "flowtype/use-flow-type": "warn", quotes: ["error", "double"], "no-var": "error", "keyword-spacing": "error", diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 86bd94eb8ac2..3238118ea4a0 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -10,10 +10,10 @@ "url": "https://github.com/babel/babel/tree/master/packages/eslint-config-babel" }, "main": "index.js", - "dependencies": { + "peerDependencies": { "babel-eslint": "^6.0.0", "eslint-plugin-babel": "^3.0.0", - "eslint-plugin-flow-vars": "^0.4.0" + "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From c88f9033748e4176647b444e7927b22da3c91497 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 24 Sep 2016 02:10:40 -0400 Subject: [PATCH 226/965] readme [skip ci] --- eslint/babel-eslint-config-internal/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/README.md b/eslint/babel-eslint-config-internal/README.md index 9978722d8b5d..cec3011183f8 100644 --- a/eslint/babel-eslint-config-internal/README.md +++ b/eslint/babel-eslint-config-internal/README.md @@ -1,3 +1,4 @@ -eslint-config-babel +## eslint-config-babel +--- eslint config for the babel codebase (copied from eslint-config-kittens) From 978f3392c5bc5cfdbb3683ea93d06aaed0a26b12 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 1 Oct 2016 18:12:29 +0200 Subject: [PATCH 227/965] Do not allow trailing spaces (babel/eslint-config-babel#3) --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index b4b144a942ac..027e6b19ac10 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -27,6 +27,7 @@ module.exports = { "no-unreachable": "off", "no-labels": "off", "no-process-exit": "off", + "no-trailing-spaces": "error", camelcase: "off", "no-console": "off", "no-constant-condition": "off", From 0f877648277526795c5c6b2c6de3a20c835db8bd Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 1 Oct 2016 18:12:35 +0200 Subject: [PATCH 228/965] Ensure unix line endings (babel/eslint-config-babel#4) --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 027e6b19ac10..14ebfaac2753 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -6,6 +6,7 @@ module.exports = { "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", quotes: ["error", "double"], + "linebreak-style": ["error", "unix"], "no-var": "error", "keyword-spacing": "error", strict: "off", From c3bc500240b3df6b8281bc7e9ced08a084ce9676 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 5 Oct 2016 16:32:19 -0400 Subject: [PATCH 229/965] update info/links --- eslint/babel-eslint-config-internal/README.md | 2 +- eslint/babel-eslint-config-internal/package.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-config-internal/README.md b/eslint/babel-eslint-config-internal/README.md index cec3011183f8..5f87298ead30 100644 --- a/eslint/babel-eslint-config-internal/README.md +++ b/eslint/babel-eslint-config-internal/README.md @@ -1,4 +1,4 @@ ## eslint-config-babel --- -eslint config for the babel codebase (copied from eslint-config-kittens) +ESLint config for the Babel codebase (originally taken from `eslint-config-kittens`) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 3238118ea4a0..3114be188482 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,17 +1,17 @@ { "name": "eslint-config-babel", "version": "1.0.2", - "description": "eslint config for babel", + "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/babel/babel/tree/master/packages/eslint-config-babel" + "url": "https://github.com/babel/eslint-config-babel" }, "main": "index.js", "peerDependencies": { - "babel-eslint": "^6.0.0", + "babel-eslint": "^7.0.0", "eslint-plugin-babel": "^3.0.0", "eslint-plugin-flowtype": "^2.4.0" }, From b2b1416fbcf7dad0e920d1c05e49b192f225f7b1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 5 Oct 2016 16:32:27 -0400 Subject: [PATCH 230/965] 2.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 3114be188482..41d33b1f8bb9 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "1.0.2", + "version": "2.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 1536dfda0a2b9b5f123b34789998c654d2df8ec2 Mon Sep 17 00:00:00 2001 From: Dan Harper Date: Wed, 5 Oct 2016 21:35:44 +0100 Subject: [PATCH 231/965] flowtype plugin (babel/eslint-config-babel#6) --- eslint/babel-eslint-config-internal/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 14ebfaac2753..0320f320e25d 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -1,7 +1,7 @@ module.exports = { parser: "babel-eslint", extends: "eslint:recommended", - plugins: ["flow-vars", "babel"], + plugins: ["flowtype", "babel"], rules: { "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", From 92794894132a28b87dbd79eba4ba568f5f0885e1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 5 Oct 2016 16:36:03 -0400 Subject: [PATCH 232/965] 2.0.1 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 41d33b1f8bb9..3db87c4829f3 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "2.0.0", + "version": "2.0.1", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 4819beb14937134fdfc1cad730b0d8bd78a6de9f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 18:03:01 -0500 Subject: [PATCH 233/965] use builtin (babel/eslint-config-babel#8) * use built-in * Update package.json --- eslint/babel-eslint-config-internal/index.js | 2 +- eslint/babel-eslint-config-internal/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 0320f320e25d..cfa4f4ab0a3f 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -43,7 +43,7 @@ module.exports = { "max-len": ["error", 110, 2], // Enforce parens around arrow function arguments - "babel/arrow-parens": ["error", "always"], + "arrow-parens": ["error", "always"], // Require a space on each side of arrow operator "arrow-spacing": ["error", { before: true, after: true }], // Require a space on each side of all infix operators diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 3db87c4829f3..bd9ce77d53d4 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -12,7 +12,7 @@ "main": "index.js", "peerDependencies": { "babel-eslint": "^7.0.0", - "eslint-plugin-babel": "^3.0.0", + "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { From 1f4e239217655e84b831383f83099f7e9f791408 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 18:03:35 -0500 Subject: [PATCH 234/965] 3.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index bd9ce77d53d4..b2adea3fae7d 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "2.0.1", + "version": "3.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 6117b83b55f3ee6cc025f4484bc842db9f77edfd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 8 Jan 2017 22:19:01 -0500 Subject: [PATCH 235/965] Merge pull request babel/eslint-config-babel#9 from kaicataldo/prefer-const Enable prefer-const --- eslint/babel-eslint-config-internal/index.js | 75 +++++++++----------- 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index cfa4f4ab0a3f..14cb43a3a684 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -1,65 +1,54 @@ module.exports = { parser: "babel-eslint", extends: "eslint:recommended", - plugins: ["flowtype", "babel"], + plugins: ["flowtype"], rules: { - "flowtype/define-flow-type": "warn", - "flowtype/use-flow-type": "warn", - quotes: ["error", "double"], - "linebreak-style": ["error", "unix"], - "no-var": "error", - "keyword-spacing": "error", - strict: "off", - "no-underscore-dangle": "off", + "arrow-parens": ["error", "always"], + "arrow-spacing": ["error", { before: true, after: true }], + camelcase: "off", + "comma-dangle": "off", + "consistent-return": "off", curly: "off", - "no-multi-spaces": "off", + "indent": ["error", 2], + "linebreak-style": ["error", "unix"], "key-spacing": "off", - "no-return-assign": "off", - "consistent-return": "off", - "no-shadow": "off", - "comma-dangle": "off", - "no-use-before-define": "off", - "no-empty": "off", + "keyword-spacing": "error", + "max-len": ["error", 110, 2], + "new-cap": "off", "new-parens": "off", + "no-case-declarations": "off", "no-cond-assign": "off", + "no-confusing-arrow": "error", + "no-console": "off", + "no-constant-condition": "off", + "no-empty": "off", "no-fallthrough": "off", - "new-cap": "off", - "no-loop-func": "off", - "no-unreachable": "off", + "no-inner-declarations": "off", + "no-multi-spaces": "off", "no-labels": "off", + "no-loop-func": "off", "no-process-exit": "off", + "no-return-assign": "off", + "no-shadow": "off", "no-trailing-spaces": "error", - camelcase: "off", - "no-console": "off", - "no-constant-condition": "off", - "no-inner-declarations": "off", - "no-case-declarations": "off", - semi: ["error", "always"], - - // soft indent of 2 characters - "indent": ["error", 2], - - // maximum length of 110 characters - "max-len": ["error", 110, 2], - - // Enforce parens around arrow function arguments - "arrow-parens": ["error", "always"], - // Require a space on each side of arrow operator - "arrow-spacing": ["error", { before: true, after: true }], - // Require a space on each side of all infix operators + "no-underscore-dangle": "off", + "no-unreachable": "off", + "no-use-before-define": "off", + "no-var": "error", + "prefer-const": "error", + quotes: ["error", "double"], + "space-before-blocks": ["error", "always"], "space-infix-ops": "error", - // Prevent using => in a condition where <= is intended - "no-confusing-arrow": "error", - // prevent no space in `if (){` - "space-before-blocks": ["error", "always"] + semi: ["error", "always"], + strict: "off" + "flowtype/define-flow-type": "warn", + "flowtype/use-flow-type": "warn", }, - globals: { // Flow Iterator: true, $Keys: true }, - env: { node: true, es6: true, From 42ad818e3f1f3dc7170d805e74791d28b1c02f1a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 8 Jan 2017 22:19:51 -0500 Subject: [PATCH 236/965] 4.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index b2adea3fae7d..87e89b8675e2 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "3.0.0", + "version": "4.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From ff304c3890d5ca72abdab5fad179bbb0942d4958 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 10 Jan 2017 12:26:45 -0500 Subject: [PATCH 237/965] fix --- eslint/babel-eslint-config-internal/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 14cb43a3a684..aca31ea0e5e5 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -40,7 +40,7 @@ module.exports = { "space-before-blocks": ["error", "always"], "space-infix-ops": "error", semi: ["error", "always"], - strict: "off" + strict: "off", "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", }, From d9b467403a6e5261827dd86a10949bc71a0bf892 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 10 Jan 2017 12:27:01 -0500 Subject: [PATCH 238/965] 4.0.1 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 87e89b8675e2..427f3596cbc7 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "4.0.0", + "version": "4.0.1", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 292003444db721936e18cd29b361ac91b9ad2807 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sat, 14 Jan 2017 07:51:07 -0500 Subject: [PATCH 239/965] peerDeps: remove eslint-plugin-babel (babel/eslint-config-babel#13) --- eslint/babel-eslint-config-internal/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 427f3596cbc7..8c10582435e4 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -12,7 +12,6 @@ "main": "index.js", "peerDependencies": { "babel-eslint": "^7.0.0", - "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { From d4a1e97249cfd18153b03b5909079566510b50fb Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 14 Jan 2017 13:51:22 +0100 Subject: [PATCH 240/965] Add comma-spacing rule (babel/eslint-config-babel#11) --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index aca31ea0e5e5..2dd105c78d75 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -7,6 +7,7 @@ module.exports = { "arrow-spacing": ["error", { before: true, after: true }], camelcase: "off", "comma-dangle": "off", + "comma-spacing": "error", "consistent-return": "off", curly: "off", "indent": ["error", 2], From af4dcb616dbd7f830f29a6122156ce6f0d1f9c8f Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 14 Jan 2017 13:51:41 +0100 Subject: [PATCH 241/965] better indent switch, iife, multiline functions (babel/eslint-config-babel#10) --- eslint/babel-eslint-config-internal/index.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 2dd105c78d75..9d2573fadaac 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -10,7 +10,21 @@ module.exports = { "comma-spacing": "error", "consistent-return": "off", curly: "off", - "indent": ["error", 2], + indent: ["error", 2, { + SwitchCase: 1, + outerIIFEBody: 1, + FunctionDeclaration: { + parameters: 1, + body: 1, + }, + FunctionExpression: { + parameters: 1, + body: 1, + }, + CallExpression: { + parameters: 1, + } + }], "linebreak-style": ["error", "unix"], "key-spacing": "off", "keyword-spacing": "error", From cada67daeb8eea8a52c4a12c584801d79d8f47d8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 14 Jan 2017 07:54:17 -0500 Subject: [PATCH 242/965] 5.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 8c10582435e4..096bf6f28121 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "4.0.1", + "version": "5.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 3bbc507a3f9a84afd5c5ca5a9403382be12e7b8f Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 14 Jan 2017 22:00:42 +0100 Subject: [PATCH 243/965] Add object-curly-spacing rule (babel/eslint-config-babel#14) Fixes babel/eslint-config-babel#12 --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 9d2573fadaac..409967ea660e 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -50,6 +50,7 @@ module.exports = { "no-unreachable": "off", "no-use-before-define": "off", "no-var": "error", + "object-curly-spacing": ["error", "always"], "prefer-const": "error", quotes: ["error", "double"], "space-before-blocks": ["error", "always"], From 50122b70781ad6c111715f6ced47963f7c7d6278 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 14 Jan 2017 16:01:07 -0500 Subject: [PATCH 244/965] 6.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 096bf6f28121..61455462bcaa 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "5.0.0", + "version": "6.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 773c3405143741b1bb51fe8e250616c3b41677b8 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 16:59:50 +0100 Subject: [PATCH 245/965] Add func-call-spacing rule (babel/eslint-config-babel#15) --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 409967ea660e..71f03ee39dac 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -10,6 +10,7 @@ module.exports = { "comma-spacing": "error", "consistent-return": "off", curly: "off", + "func-call-spacing": "error", indent: ["error", 2, { SwitchCase: 1, outerIIFEBody: 1, From 1ce807d5de5bc72d35d135d3163ea5bf7ad46e26 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 17:14:45 +0100 Subject: [PATCH 246/965] Enable key-spacing and no-multi-spaces (babel/eslint-config-babel#18) Fixes babel/eslint-config-babel#16 --- eslint/babel-eslint-config-internal/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 71f03ee39dac..f014d6bc53d1 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -27,7 +27,7 @@ module.exports = { } }], "linebreak-style": ["error", "unix"], - "key-spacing": "off", + "key-spacing": "error", "keyword-spacing": "error", "max-len": ["error", 110, 2], "new-cap": "off", @@ -40,7 +40,7 @@ module.exports = { "no-empty": "off", "no-fallthrough": "off", "no-inner-declarations": "off", - "no-multi-spaces": "off", + "no-multi-spaces": "error", "no-labels": "off", "no-loop-func": "off", "no-process-exit": "off", From 8a527d1ef53ef8116d955305ec889f9ee7ab750a Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Feb 2017 17:45:06 +0100 Subject: [PATCH 247/965] Enable comma-dangle (babel/eslint-config-babel#19) --- eslint/babel-eslint-config-internal/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index f014d6bc53d1..4a827248f7f5 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -6,7 +6,7 @@ module.exports = { "arrow-parens": ["error", "always"], "arrow-spacing": ["error", { before: true, after: true }], camelcase: "off", - "comma-dangle": "off", + "comma-dangle": ["error", "always-multiline"], "comma-spacing": "error", "consistent-return": "off", curly: "off", From a2f678151d32f0d106e10394b081b6dace9eb291 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 17 Jun 2017 13:35:03 -0500 Subject: [PATCH 248/965] Breaking: Drop style rules (babel/eslint-config-babel#22) * Drop style rules * es tweaks * fix * Update index.js --- eslint/babel-eslint-config-internal/index.js | 35 +++----------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 4a827248f7f5..a249588d2713 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -2,36 +2,17 @@ module.exports = { parser: "babel-eslint", extends: "eslint:recommended", plugins: ["flowtype"], + parserOptions: { + ecmaVersion: 2017, + sourceType: "module" + }, rules: { - "arrow-parens": ["error", "always"], - "arrow-spacing": ["error", { before: true, after: true }], camelcase: "off", - "comma-dangle": ["error", "always-multiline"], - "comma-spacing": "error", "consistent-return": "off", curly: "off", - "func-call-spacing": "error", - indent: ["error", 2, { - SwitchCase: 1, - outerIIFEBody: 1, - FunctionDeclaration: { - parameters: 1, - body: 1, - }, - FunctionExpression: { - parameters: 1, - body: 1, - }, - CallExpression: { - parameters: 1, - } - }], "linebreak-style": ["error", "unix"], - "key-spacing": "error", - "keyword-spacing": "error", "max-len": ["error", 110, 2], "new-cap": "off", - "new-parens": "off", "no-case-declarations": "off", "no-cond-assign": "off", "no-confusing-arrow": "error", @@ -40,23 +21,16 @@ module.exports = { "no-empty": "off", "no-fallthrough": "off", "no-inner-declarations": "off", - "no-multi-spaces": "error", "no-labels": "off", "no-loop-func": "off", "no-process-exit": "off", "no-return-assign": "off", "no-shadow": "off", - "no-trailing-spaces": "error", "no-underscore-dangle": "off", "no-unreachable": "off", "no-use-before-define": "off", "no-var": "error", - "object-curly-spacing": ["error", "always"], "prefer-const": "error", - quotes: ["error", "double"], - "space-before-blocks": ["error", "always"], - "space-infix-ops": "error", - semi: ["error", "always"], strict: "off", "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", @@ -68,7 +42,6 @@ module.exports = { }, env: { node: true, - es6: true, browser: true } }; From 4b35717b04762dca7f385428a2be6f1aa5db930b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 17 Jun 2017 14:35:27 -0400 Subject: [PATCH 249/965] 7.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 61455462bcaa..9e2bce43432a 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "6.0.0", + "version": "7.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 288a74e55f1b6f3cab17df142d2597514b61f9c2 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 17 Jun 2017 13:53:32 -0500 Subject: [PATCH 250/965] Re-add es6 env option (babel/eslint-config-babel#24) --- eslint/babel-eslint-config-internal/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index a249588d2713..5c5fb5632770 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -42,6 +42,7 @@ module.exports = { }, env: { node: true, + es6: true, browser: true } }; From 794e8b12eb77a2a59e0397b927fd6607d5b46fd1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 17 Jun 2017 14:53:43 -0400 Subject: [PATCH 251/965] 7.0.1 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 9e2bce43432a..3e64bbe049bf 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "7.0.0", + "version": "7.0.1", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 85d858984ba1f57fbfed0825259e21b1cb18befe Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 7 Aug 2017 18:58:40 -0500 Subject: [PATCH 252/965] Update babel-eslint peer dep (babel/eslint-config-babel#25) --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 3e64bbe049bf..070ad2a32b99 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -11,7 +11,7 @@ }, "main": "index.js", "peerDependencies": { - "babel-eslint": "^7.0.0", + "babel-eslint": "^7.0.0 || ^8.0.0-alpha", "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { From a47d722c076210ff776ceca99fdfebbb8e01c506 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Aug 2017 19:59:01 -0400 Subject: [PATCH 253/965] 7.0.2 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 070ad2a32b99..7e5b554e8aee 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "7.0.1", + "version": "7.0.2", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 74d47288c0ad140c5e1f5a42c9829c859b6608f6 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 11 Sep 2018 10:28:24 -0500 Subject: [PATCH 254/965] Merge pull request babel/eslint-config-babel#28 from babel/b --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 7e5b554e8aee..e3bfd4bcbffa 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -11,7 +11,7 @@ }, "main": "index.js", "peerDependencies": { - "babel-eslint": "^7.0.0 || ^8.0.0-alpha", + "babel-eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { From 7499b0cab0f80a28cfebf7c31dbfc6eadd1d43e5 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 11 Sep 2018 10:28:37 -0500 Subject: [PATCH 255/965] Merge pull request babel/eslint-config-babel#20 from babel/existentialism-patch-1 --- eslint/babel-eslint-config-internal/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 5c5fb5632770..82d4013ef665 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -7,13 +7,13 @@ module.exports = { sourceType: "module" }, rules: { - camelcase: "off", + "camelcase": "off", "consistent-return": "off", - curly: "off", + "curly": ["error", "multi-line"], "linebreak-style": ["error", "unix"], "max-len": ["error", 110, 2], "new-cap": "off", - "no-case-declarations": "off", + "no-case-declarations": "error", "no-cond-assign": "off", "no-confusing-arrow": "error", "no-console": "off", @@ -31,7 +31,7 @@ module.exports = { "no-use-before-define": "off", "no-var": "error", "prefer-const": "error", - strict: "off", + "strict": "off", "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", }, From e13c2f535c155fc9a0a22fbd1b1f2f50e53b9793 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 11 Sep 2018 11:20:13 -0500 Subject: [PATCH 256/965] 8.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index e3bfd4bcbffa..9b9eb2dfd31a 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "7.0.2", + "version": "8.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From a3230ce73076c4ff18fef1c90f86652036c31bc4 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 25 Sep 2018 16:24:38 -0500 Subject: [PATCH 257/965] Merge pull request babel/eslint-config-babel#29 from babel/babel-eslint --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 9b9eb2dfd31a..42f4712bdaf4 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -11,7 +11,7 @@ }, "main": "index.js", "peerDependencies": { - "babel-eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "babel-eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", "eslint-plugin-flowtype": "^2.4.0" }, "scripts": { From ad2ca8dd4b70e378e2402b5ded7d8d3b7db34e0b Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 21 Nov 2018 09:09:28 -0600 Subject: [PATCH 258/965] Merge tag 'v8.0.1' 8.0.1 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 42f4712bdaf4..1eced636406f 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "8.0.0", + "version": "8.0.1", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 0076d85f5da04a085c8b2b7ccd0fbdf161cf6355 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 21 Nov 2018 09:04:12 -0600 Subject: [PATCH 259/965] Relax eslint-plugin-flowtype peerDep --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 1eced636406f..75a85890be89 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -12,7 +12,7 @@ "main": "index.js", "peerDependencies": { "babel-eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", - "eslint-plugin-flowtype": "^2.4.0" + "eslint-plugin-flowtype": "^2 || ^3" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From 7c39f9477f3a4675cdaa7634e91451d2333b6a0f Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 21 Nov 2018 09:10:50 -0600 Subject: [PATCH 260/965] 8.0.2 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 75a85890be89..0f55c9aa817f 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "8.0.1", + "version": "8.0.2", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 3a5d6ee4337490591533283e64aca823cb2359ab Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 10 Feb 2019 14:17:27 -0800 Subject: [PATCH 261/965] Update peer dependencies and allow babel-eslint 11 --- eslint/babel-eslint-config-internal/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 0f55c9aa817f..6bc1fd7f704b 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -11,8 +11,8 @@ }, "main": "index.js", "peerDependencies": { - "babel-eslint": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", - "eslint-plugin-flowtype": "^2 || ^3" + "babel-eslint": "^10.0.0 || ^11.0.0-0", + "eslint-plugin-flowtype": "^3.0.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From b0fcf28267e064233736a682ba7913ec46067684 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 10 Feb 2019 14:19:02 -0800 Subject: [PATCH 262/965] 9.0.0 --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 6bc1fd7f704b..a46867e3c69f 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-babel", - "version": "8.0.2", + "version": "9.0.0", "description": "ESLint config for babel", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 5d5c7c6ae1fe165de1a887b3586b71c7bb7dd881 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 21:44:06 +1100 Subject: [PATCH 263/965] first commit --- eslint/babel-eslint-parser/.gitignore | 1 + eslint/babel-eslint-parser/LICENSE | 22 ++++++ eslint/babel-eslint-parser/README.md | 34 ++++++++ .../babel-eslint-parser/acorn-to-esprima.js | 50 ++++++++++++ eslint/babel-eslint-parser/index.js | 77 +++++++++++++++++++ eslint/babel-eslint-parser/package.json | 20 +++++ 6 files changed, 204 insertions(+) create mode 100644 eslint/babel-eslint-parser/.gitignore create mode 100644 eslint/babel-eslint-parser/LICENSE create mode 100644 eslint/babel-eslint-parser/README.md create mode 100644 eslint/babel-eslint-parser/acorn-to-esprima.js create mode 100644 eslint/babel-eslint-parser/index.js create mode 100644 eslint/babel-eslint-parser/package.json diff --git a/eslint/babel-eslint-parser/.gitignore b/eslint/babel-eslint-parser/.gitignore new file mode 100644 index 000000000000..3c3629e647f5 --- /dev/null +++ b/eslint/babel-eslint-parser/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/eslint/babel-eslint-parser/LICENSE b/eslint/babel-eslint-parser/LICENSE new file mode 100644 index 000000000000..dac23744b010 --- /dev/null +++ b/eslint/babel-eslint-parser/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2014-2015 Sebastian McKenzie + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md new file mode 100644 index 000000000000..c6a433f04f2d --- /dev/null +++ b/eslint/babel-eslint-parser/README.md @@ -0,0 +1,34 @@ +# babel-eslint + +**babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic +[eslint](https://github.com/eslint/eslint). + +**NOTE:** Please note that this is experimental and may have numerous bugs. It is however +successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). + +## Usage + +### Install + +```sh +$ npm install eslint babel-eslint +``` + +### Setup + +**.eslintrc** + +```json +{ + "parser": "babel-eslint", + "rules": { + "strict": 0 + } +} +``` + +### Run + +```sh +$ eslint your-files-here +``` diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js new file mode 100644 index 000000000000..6040a3d65432 --- /dev/null +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -0,0 +1,50 @@ +var tokTypes = require("babel").acorn.tokTypes; +var traverse = require("babel").traverse; +var t = require("babel").types; + +exports.toToken = function (token) { + var type = token.type; + + if (type === tokTypes.name) { + token.type = "Identifier"; + } else if (type === tokTypes.semi || type === tokTypes.comma || type === tokTypes.parenL || type === tokTypes.parenR || type === tokTypes.braceL || type === tokTypes.braceR) { + token.type = "Punctuator"; + token.value = type.type; + } + + return token; +}; + +exports.toAST = function (ast) { + traverse(ast, astTransformVisitor); +}; + +var astTransformVisitor = { + noScope: true, + enter: function (node) { + if (t.isImportBatchSpecifier(node)) { + node.type = "ImportNamespaceSpecifier"; + node.id = node.name; + delete node.name; + } else if (t.isFunction(node)) { + node.defaults = []; + + node.params = node.params.map(function (param) { + if (t.isAssignmentPattern(param)) { + node.defaults.push(param.right); + return param.left; + } else { + node.defaults.push(null); + return param; + } + }); + + // rest + if (t.isRestElement(node.params[node.params.length - 1])) { + node.rest = node.params.pop(); + } + } else if (t.isClassProperty(node)) { + this.remove(); + } + } +}; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js new file mode 100644 index 000000000000..ee476e9bfecc --- /dev/null +++ b/eslint/babel-eslint-parser/index.js @@ -0,0 +1,77 @@ +var acornToEsprima = require("./acorn-to-esprima"); +var traverse = require("babel").traverse; +var extend = require("lodash/object/extend"); +var Module = require("module"); +var acorn = require("babel").acorn; +var path = require("path"); +var t = require("babel").types; + +var hasPatched = false; + +function createModule(filename) { + var mod = new Module(filename); + mod.filename = filename; + mod.paths = Module._nodeModulePaths(path.dirname(filename)); + return mod; +} + +function monkeypatch() { + if (hasPatched) return; + hasPatched = true; + + var eslintLoc; + try { + eslintLoc = require.resolve("eslint"); + } catch (err) { + throw new ReferenceError("couldn't resolve eslint"); + } + + // get modules relative to what eslint will load + var eslintMod = createModule(eslintLoc); + var escopeLoc = Module._resolveFilename("escope", eslintMod); + var escopeMod = createModule(escopeLoc); + + // monkeypatch estraverse + var estraverse = escopeMod.require("estraverse"); + extend(estraverse.VisitorKeys, t.VISITOR_KEYS); + + // monkeypatch escope + var escope = require(escopeLoc); + var analyze = escope.analyze; + escope.analyze = function (ast, opts) { + opts.ecmaVersion = 6; + opts.sourceType = "module"; + return analyze.call(this, ast, opts) + }; +} + +exports.parse = function (code) { + try { + monkeypatch(); + } catch (err) { + console.error(err.stack); + process.exit(1); + } + + var opts = {}; + opts.ecmaVersion = 7; + opts.playground = true; + opts.locations = true; + opts.ranges = true; + + var comments = opts.onComment = []; + var tokens = opts.onToken = []; + + var ast = acorn.parse(code, opts); + + // convert tokens + ast.tokens = tokens.map(acornToEsprima.toToken); + + // add comments + ast.comments = comments; + + // transform esprima and acorn divergent nodes + acornToEsprima.toAST(ast); + + return ast; +}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json new file mode 100644 index 000000000000..be6c731f536d --- /dev/null +++ b/eslint/babel-eslint-parser/package.json @@ -0,0 +1,20 @@ +{ + "name": "babel-eslint", + "version": "1.0.3", + "description": "", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel-eslint.git" + }, + "dependencies": { + "babel": "^4.6.0", + "lodash": "^3.3.1" + }, + "author": "Sebastian McKenzie ", + "license": "MIT", + "bugs": { + "url": "https://github.com/babel/babel-eslint/issues" + }, + "homepage": "https://github.com/babel/babel-eslint" +} From d70e358a948834ef653b0077281139247689d97c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 21:49:54 +1100 Subject: [PATCH 264/965] clean up readme --- eslint/babel-eslint-parser/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index c6a433f04f2d..dd638879244f 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -1,7 +1,7 @@ # babel-eslint **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic -[eslint](https://github.com/eslint/eslint). +[ESLint](https://github.com/eslint/eslint). **NOTE:** Please note that this is experimental and may have numerous bugs. It is however successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). @@ -27,6 +27,8 @@ $ npm install eslint babel-eslint } ``` +Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rules. + ### Run ```sh From 5c226d0451b1249661f4fb9b05ec786349eb4429 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 21:57:03 +1100 Subject: [PATCH 265/965] add more comments to acorn-to-esprima source --- eslint/babel-eslint-parser/acorn-to-esprima.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 6040a3d65432..e149e9020b05 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -23,12 +23,13 @@ var astTransformVisitor = { noScope: true, enter: function (node) { if (t.isImportBatchSpecifier(node)) { + // ImportBatchSpecifier => ImportNamespaceSpecifier node.type = "ImportNamespaceSpecifier"; node.id = node.name; delete node.name; } else if (t.isFunction(node)) { + // defaults node.defaults = []; - node.params = node.params.map(function (param) { if (t.isAssignmentPattern(param)) { node.defaults.push(param.right); @@ -44,6 +45,7 @@ var astTransformVisitor = { node.rest = node.params.pop(); } } else if (t.isClassProperty(node)) { + // eslint doesn't like these this.remove(); } } From 041c7e246f461af8b9f2ea1d0f51d4b1c202782c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 22:40:56 +1100 Subject: [PATCH 266/965] add support for spread property --- eslint/babel-eslint-parser/acorn-to-esprima.js | 6 ++++++ eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index e149e9020b05..2069819a224e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -44,6 +44,12 @@ var astTransformVisitor = { if (t.isRestElement(node.params[node.params.length - 1])) { node.rest = node.params.pop(); } + } else if (t.isSpreadProperty(node)) { + node.type = "Property"; + node.kind = "init"; + node.computed = false; + node.key = node.value = node.argument; + delete node.argument; } else if (t.isClassProperty(node)) { // eslint doesn't like these this.remove(); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index be6c731f536d..b33f4a4a4583 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.3", + "version": "1.0.4", "description": "", "main": "index.js", "repository": { From 65a6fce75ce6f38ebb592fc254c25fc024a4bf26 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 23:06:47 +1100 Subject: [PATCH 267/965] turn ArrowFunctionExpression into a FunctionExpression - fixes babel/babel-eslint#1 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 ++ eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 2069819a224e..b82cf6aeea1e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -53,6 +53,8 @@ var astTransformVisitor = { } else if (t.isClassProperty(node)) { // eslint doesn't like these this.remove(); + } else if (t.isArrowFunctionExpression(node)) { + node.type = "FunctionExpression"; } } }; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b33f4a4a4583..5f44d601af25 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.4", + "version": "1.0.5", "description": "", "main": "index.js", "repository": { From be9da7ef08f09c1ee63fb059ba6aefb9dfdf55f8 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 23:23:15 +1100 Subject: [PATCH 268/965] output esprima compatible error messages - fixes babel/babel-eslint#3 --- eslint/babel-eslint-parser/index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ee476e9bfecc..41aa98b1748a 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -62,7 +62,20 @@ exports.parse = function (code) { var comments = opts.onComment = []; var tokens = opts.onToken = []; - var ast = acorn.parse(code, opts); + var ast; + try { + ast = acorn.parse(code, opts); + } catch (err) { + if (err instanceof SyntaxError) { + err.lineNumber = err.loc.line; + err.column = err.loc.column; + + // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start + err.message = "Line X: " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); + } + + throw err; + } // convert tokens ast.tokens = tokens.map(acornToEsprima.toToken); From 932d799e28ec2d1c1ea61b037d8bdcb8367fbd1d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 27 Feb 2015 23:40:59 +1100 Subject: [PATCH 269/965] pop off last token which will be an EOF, currently not used anywhere by espree and it runs into issues with some rules - fixes babel/babel-eslint#2 --- eslint/babel-eslint-parser/index.js | 5 +++++ eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 41aa98b1748a..ed25b643066f 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -77,6 +77,11 @@ exports.parse = function (code) { throw err; } + // remove EOF token, eslint doesn't use this for anything and it interferes with some rules + // see https://github.com/babel/babel-eslint/issues/2 for more info + // todo: find a more elegant way to do this + tokens.pop(); + // convert tokens ast.tokens = tokens.map(acornToEsprima.toToken); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5f44d601af25..92646e6374e3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.5", + "version": "1.0.6", "description": "", "main": "index.js", "repository": { From a14e1e8fd159637816eb6a4b7e143819b07903e7 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 11:28:22 +1100 Subject: [PATCH 270/965] clean up toAst method and properly transform rest elements away - fixes babel/babel-eslint#7 --- .../babel-eslint-parser/acorn-to-esprima.js | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index b82cf6aeea1e..29b2b003fe68 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -22,38 +22,43 @@ exports.toAST = function (ast) { var astTransformVisitor = { noScope: true, enter: function (node) { + if (t.isSpreadProperty(node)) { + node.type = "Property"; + node.kind = "init"; + node.computed = false; + node.key = node.value = node.argument; + delete node.argument; + } + + if (t.isClassProperty(node)) { + // eslint doesn't like these + this.remove(); + } + if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier => ImportNamespaceSpecifier node.type = "ImportNamespaceSpecifier"; node.id = node.name; delete node.name; - } else if (t.isFunction(node)) { - // defaults + } + + // functions + + if (t.isFunction(node)) { node.defaults = []; node.params = node.params.map(function (param) { if (t.isAssignmentPattern(param)) { node.defaults.push(param.right); return param.left; } else { + if (t.isRestElement(param)) param = param.argument; node.defaults.push(null); return param; } }); + } - // rest - if (t.isRestElement(node.params[node.params.length - 1])) { - node.rest = node.params.pop(); - } - } else if (t.isSpreadProperty(node)) { - node.type = "Property"; - node.kind = "init"; - node.computed = false; - node.key = node.value = node.argument; - delete node.argument; - } else if (t.isClassProperty(node)) { - // eslint doesn't like these - this.remove(); - } else if (t.isArrowFunctionExpression(node)) { + if (t.isArrowFunctionExpression(node)) { node.type = "FunctionExpression"; } } From 1d1d7a5145a8a5e4da129b6637ac8a35c43edb8f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 11:31:54 +1100 Subject: [PATCH 271/965] transform JSX identifiers and member expressions - fixes babel/babel-eslint#5 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 29b2b003fe68..a2ebdf0e3e47 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -42,6 +42,20 @@ var astTransformVisitor = { delete node.name; } + // JSX + + if (t.isJSXIdentifier(node)) { + if (node.name === "this" && t.isReferenced(node, parent)) { + return t.thisExpression(); + } else { + node.type = "Identifier"; + } + } + + if (t.isJSXMemberExpression(node)) { + node.type = "MemberExpression"; + } + // functions if (t.isFunction(node)) { From 9117398452dbd5c84e4e932fd3bd0405c8afc73a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 11:50:44 +1100 Subject: [PATCH 272/965] bump version --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 92646e6374e3..ffa31ab3ce51 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.6", + "version": "1.0.7", "description": "", "main": "index.js", "repository": { From 1ca488c3ec7750c44317fb95d69974f1b6787798 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 11:58:56 +1100 Subject: [PATCH 273/965] turn class declarations into variable declarations - fixes babel/babel-eslint#8 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index a2ebdf0e3e47..70d07423c59f 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -30,11 +30,6 @@ var astTransformVisitor = { delete node.argument; } - if (t.isClassProperty(node)) { - // eslint doesn't like these - this.remove(); - } - if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier => ImportNamespaceSpecifier node.type = "ImportNamespaceSpecifier"; @@ -42,6 +37,19 @@ var astTransformVisitor = { delete node.name; } + // classes + + if (t.isClassDeclaration(node)) { + return t.variableDeclaration("let", [ + t.variableDeclarator(node.id, node) + ]); + } + + if (t.isClassProperty(node)) { + // eslint doesn't like these + this.remove(); + } + // JSX if (t.isJSXIdentifier(node)) { From 5b2df4ce30fb1f8110323465ced47ec3d5e862f7 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 11:59:26 +1100 Subject: [PATCH 274/965] bump version --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ffa31ab3ce51..085ac9eace97 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.7", + "version": "1.0.8", "description": "", "main": "index.js", "repository": { From 24aa904d997c1f6e37a7b137c84e7793d1f85082 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 12:03:01 +1100 Subject: [PATCH 275/965] add how does it work section to readme --- eslint/babel-eslint-parser/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index dd638879244f..889de538a323 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -34,3 +34,10 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ```sh $ eslint your-files-here ``` + +## How does it work? + +ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports +aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is +transformed into code that ESLint can understand. All location info such as line numbers, +columns is also retained so you can track down errors with ease. From bde03060a51e15712bf200ab51cc0d54ef3e4cba Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 12:07:21 +1100 Subject: [PATCH 276/965] remove ClassDeclaration transformation --- eslint/babel-eslint-parser/acorn-to-esprima.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 70d07423c59f..0241427e34d5 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -38,12 +38,6 @@ var astTransformVisitor = { } // classes - - if (t.isClassDeclaration(node)) { - return t.variableDeclaration("let", [ - t.variableDeclarator(node.id, node) - ]); - } if (t.isClassProperty(node)) { // eslint doesn't like these @@ -54,7 +48,7 @@ var astTransformVisitor = { if (t.isJSXIdentifier(node)) { if (node.name === "this" && t.isReferenced(node, parent)) { - return t.thisExpression(); + return t.inherits(t.thisExpression(), node); } else { node.type = "Identifier"; } From e891659b21f22adf557adcbd009c93b937f5610f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 12:07:33 +1100 Subject: [PATCH 277/965] bump version --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 085ac9eace97..7215681e8122 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.8", + "version": "1.0.9", "description": "", "main": "index.js", "repository": { From 1cc579cb5d4bd7adf7647c860b2bbb2deecec031 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 12:09:20 +1100 Subject: [PATCH 278/965] move up explantory paragraph --- eslint/babel-eslint-parser/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 889de538a323..960e1e75129a 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -6,6 +6,13 @@ **NOTE:** Please note that this is experimental and may have numerous bugs. It is however successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). +## How does it work? + +ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports +aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is +transformed into code that ESLint can understand. All location info such as line numbers, +columns is also retained so you can track down errors with ease. + ## Usage ### Install @@ -34,10 +41,3 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ```sh $ eslint your-files-here ``` - -## How does it work? - -ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports -aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is -transformed into code that ESLint can understand. All location info such as line numbers, -columns is also retained so you can track down errors with ease. From 0f1910891d4eadc922c9190d7ecf87b118eace87 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 16:33:21 +1100 Subject: [PATCH 279/965] explode all rest elements - fixes babel/babel-eslint#11 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 5 ++++- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 0241427e34d5..5ca5b634419e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -30,6 +30,10 @@ var astTransformVisitor = { delete node.argument; } + if (t.isRestElement(node)) { + return node.argument; + } + if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier => ImportNamespaceSpecifier node.type = "ImportNamespaceSpecifier"; @@ -67,7 +71,6 @@ var astTransformVisitor = { node.defaults.push(param.right); return param.left; } else { - if (t.isRestElement(param)) param = param.argument; node.defaults.push(null); return param; } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7215681e8122..809d016735aa 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.9", + "version": "1.0.10", "description": "", "main": "index.js", "repository": { From e4cee14aa67cafaf5a4b0878a8eae54b9243dbb5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 17:07:11 +1100 Subject: [PATCH 280/965] better XJSIdentifier -> Identifier logic - fixes babel/babel-eslint#12 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 8 +++++++- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 5ca5b634419e..6ee3f568a753 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -19,6 +19,10 @@ exports.toAST = function (ast) { traverse(ast, astTransformVisitor); }; +function isCompatTag(tagName) { + return tagName && /^[a-z]|\-/.test(tagName); +} + var astTransformVisitor = { noScope: true, enter: function (node) { @@ -53,8 +57,10 @@ var astTransformVisitor = { if (t.isJSXIdentifier(node)) { if (node.name === "this" && t.isReferenced(node, parent)) { return t.inherits(t.thisExpression(), node); - } else { + } else if (!t.isJSXAttribute(parent) && !isCompatTag(node.name)) { node.type = "Identifier"; + } else { + // just ignore this node as it'd be something like
or an attribute name } } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 809d016735aa..497418afa9c2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.10", + "version": "1.0.11", "description": "", "main": "index.js", "repository": { From e08a0fab998f8f751f8c58f97b0680868508ef44 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 17:07:28 +1100 Subject: [PATCH 281/965] Merge branch 'master' of github.com:babel/babel-eslint --- eslint/babel-eslint-parser/index.js | 6 +++--- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ed25b643066f..ca364bad9c54 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,6 +1,6 @@ var acornToEsprima = require("./acorn-to-esprima"); var traverse = require("babel").traverse; -var extend = require("lodash/object/extend"); +var assign = require("lodash.assign"); var Module = require("module"); var acorn = require("babel").acorn; var path = require("path"); @@ -33,7 +33,7 @@ function monkeypatch() { // monkeypatch estraverse var estraverse = escopeMod.require("estraverse"); - extend(estraverse.VisitorKeys, t.VISITOR_KEYS); + assign(estraverse.VisitorKeys, t.VISITOR_KEYS); // monkeypatch escope var escope = require(escopeLoc); @@ -73,7 +73,7 @@ exports.parse = function (code) { // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start err.message = "Line X: " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); } - + throw err; } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 497418afa9c2..e34ea6c96748 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -9,7 +9,7 @@ }, "dependencies": { "babel": "^4.6.0", - "lodash": "^3.3.1" + "lodash.assign": "^3.0.0" }, "author": "Sebastian McKenzie ", "license": "MIT", From 02f4f5e88561216f8371568d33e11853acb29c70 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 28 Feb 2015 17:37:12 +1100 Subject: [PATCH 282/965] turn super references into a this expression - fixes babel/babel-eslint#10 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 6 +++++- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 6ee3f568a753..3ff4ebe66a06 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -25,7 +25,7 @@ function isCompatTag(tagName) { var astTransformVisitor = { noScope: true, - enter: function (node) { + enter: function (node, parent) { if (t.isSpreadProperty(node)) { node.type = "Property"; node.kind = "init"; @@ -46,6 +46,10 @@ var astTransformVisitor = { } // classes + + if (t.isReferencedIdentifier(node, parent, { name: "super" })) { + return t.inherits(t.thisExpression(), node); + } if (t.isClassProperty(node)) { // eslint doesn't like these diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e34ea6c96748..dbfdc9135768 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.11", + "version": "1.0.12", "description": "", "main": "index.js", "repository": { From 955dd1e12647108db8b67219cc738e6390323e46 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 2 Mar 2015 12:04:59 +1100 Subject: [PATCH 283/965] turn async functions into generators - fixes babel/babel-eslint#22 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 3ff4ebe66a06..a7df3060d2df 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -45,6 +45,15 @@ var astTransformVisitor = { delete node.name; } + if (t.isFunction(node) && node.async) { + node.generator = true; + node.async - false; + } + + if (t.isAwaitExpression(node)) { + node.type = "YieldExpression"; + } + // classes if (t.isReferencedIdentifier(node, parent, { name: "super" })) { From 9a77a7dbaadebbf1d6f6f176f64870f1fe3148ff Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 2 Mar 2015 12:25:08 +1100 Subject: [PATCH 284/965] ensure function expression body is a block statement - fixes babel/babel-eslint#20 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index a7df3060d2df..b8e8540a9eca 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -45,11 +45,6 @@ var astTransformVisitor = { delete node.name; } - if (t.isFunction(node) && node.async) { - node.generator = true; - node.async - false; - } - if (t.isAwaitExpression(node)) { node.type = "YieldExpression"; } @@ -98,6 +93,16 @@ var astTransformVisitor = { if (t.isArrowFunctionExpression(node)) { node.type = "FunctionExpression"; + if (node.body.type !== "BlockStatement") { + node.body = t.inherits(t.blockStatement([ + node.body + ]), node); + } + } + + if (t.isFunction(node) && node.async) { + node.generator = true; + node.async - false; } } }; From 71a5782ab73c2935b479f957781e46cffa82e780 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 2 Mar 2015 12:31:08 +1100 Subject: [PATCH 285/965] make spread properties computed - fixes babel/babel-eslint#16 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index b8e8540a9eca..ad39a897a477 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -29,7 +29,7 @@ var astTransformVisitor = { if (t.isSpreadProperty(node)) { node.type = "Property"; node.kind = "init"; - node.computed = false; + node.computed = true; node.key = node.value = node.argument; delete node.argument; } From a31835836d3a337b85ddd34cf4260973e0e62d4f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 4 Mar 2015 22:29:49 +1100 Subject: [PATCH 286/965] bump version --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dbfdc9135768..e0a103db37fa 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.12", + "version": "1.0.13", "description": "", "main": "index.js", "repository": { From 6556b06f231b1bac297dba5f6aefe1bf324dba4a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 9 Mar 2015 02:45:56 +1100 Subject: [PATCH 287/965] Merge branch 'master' of github.com:babel/babel-eslint --- .../babel-eslint-parser/acorn-to-esprima.js | 42 ++--- eslint/babel-eslint-parser/index.js | 13 +- eslint/babel-eslint-parser/package.json | 10 +- .../babel-eslint-parser/test/babel-eslint.js | 90 +++++++++++ .../test/non-regression.js | 145 ++++++++++++++++++ 5 files changed, 279 insertions(+), 21 deletions(-) create mode 100644 eslint/babel-eslint-parser/test/babel-eslint.js create mode 100644 eslint/babel-eslint-parser/test/non-regression.js diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index ad39a897a477..66e1993c8618 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -7,9 +7,24 @@ exports.toToken = function (token) { if (type === tokTypes.name) { token.type = "Identifier"; - } else if (type === tokTypes.semi || type === tokTypes.comma || type === tokTypes.parenL || type === tokTypes.parenR || type === tokTypes.braceL || type === tokTypes.braceR) { + } else if (type === tokTypes.semi || type === tokTypes.comma || type === tokTypes.parenL || type === tokTypes.parenR || type === tokTypes.braceL || type === tokTypes.braceR || type === tokTypes.slash || type === tokTypes.dot || type.isAssign) { token.type = "Punctuator"; - token.value = type.type; + if (!token.value) { + token.value = type.type; + } + } else if (type === tokTypes.jsxTagStart) { + token.type = "Punctuator"; + token.value = "<"; + } else if (type === tokTypes.jsxTagEnd) { + token.type = "Punctuator"; + token.value = ">"; + } else if (type === tokTypes.jsxName) { + token.type = "JSXIdentifier"; + } else if (type.keyword) { + token.type = "Keyword"; + } else if (type === tokTypes.num) { + token.type = "Numeric"; + token.value = String(token.value); } return token; @@ -50,7 +65,12 @@ var astTransformVisitor = { } // classes - + + if (t.isClassDeclaration(node) || t.isClassExpression(node)) { + node.name = node.id; + delete node.id; + } + if (t.isReferencedIdentifier(node, parent, { name: "super" })) { return t.inherits(t.thisExpression(), node); } @@ -60,22 +80,6 @@ var astTransformVisitor = { this.remove(); } - // JSX - - if (t.isJSXIdentifier(node)) { - if (node.name === "this" && t.isReferenced(node, parent)) { - return t.inherits(t.thisExpression(), node); - } else if (!t.isJSXAttribute(parent) && !isCompatTag(node.name)) { - node.type = "Identifier"; - } else { - // just ignore this node as it'd be something like
or an attribute name - } - } - - if (t.isJSXMemberExpression(node)) { - node.type = "MemberExpression"; - } - // functions if (t.isFunction(node)) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ca364bad9c54..3def57ec38d3 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -21,7 +21,7 @@ function monkeypatch() { var eslintLoc; try { - eslintLoc = require.resolve("eslint"); + eslintLoc = Module._resolveFilename("eslint", module.parent); } catch (err) { throw new ReferenceError("couldn't resolve eslint"); } @@ -43,6 +43,17 @@ function monkeypatch() { opts.sourceType = "module"; return analyze.call(this, ast, opts) }; + + var eslint = require(eslintLoc); + var getScope = eslint.linter.getScope; + eslint.linter.getScope = function () { + var scope = getScope.apply(this, arguments); + if (scope.type === "global" && !scope.__patchedWithModuleVariables) { + scope.__patchedWithModuleVariables = true; + scope.variables.push.apply(scope.variables, scope.childScopes[0].variables); + } + return scope; + }; } exports.parse = function (code) { diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e0a103db37fa..c064dadd4883 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -16,5 +16,13 @@ "bugs": { "url": "https://github.com/babel/babel-eslint/issues" }, - "homepage": "https://github.com/babel/babel-eslint" + "homepage": "https://github.com/babel/babel-eslint", + "devDependencies": { + "eslint": "^0.15.1", + "espree": "^1.10.0", + "mocha": "^2.1.0" + }, + "scripts": { + "test": "mocha" + } } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js new file mode 100644 index 000000000000..f8365c1844d0 --- /dev/null +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -0,0 +1,90 @@ +var util = require("util"); +var espree = require("espree"); +var babelEslint = require(".."); + + +function assertSameAST(a, b, path) { + if (!path) { + path = []; + } + + function error(text) { + throw new Error("At " + path.join(".") + ": " + text + ":\n" + util.inspect(a) + "\n" + util.inspect(b)); + } + + var typeA = a === null ? "null" : typeof a; + var typeB = b === null ? "null" : typeof b; + if (typeA !== typeB) { + error("have not the same type (" + typeA + " !== " + typeB + ")"); + } else if (typeA === "object") { + var keysA = Object.keys(a); + var keysB = Object.keys(b); + keysA.sort(); + keysB.sort(); + while (true) { + var keyA = keysA.shift(); + + // Exception: ignore "end" and "start" outside "loc" properties + if ((keyA === "end" || keyA === "start") && path[path.length - 1] !== "loc") continue; + // Exception: ignore root "comments" property + if (keyA === "comments" && path.length === 0) continue; + + var keyB = keysB.shift(); + + if (keyA === undefined && keyB === undefined) break; + if (keyA === undefined || keyA > keyB) error("first does not have key \"" + keyB + "\""); + if (keyB === undefined || keyA < keyB) error("second does not have key \"" + keyA + "\""); + path.push(keyA); + assertSameAST(a[keyA], b[keyB], path); + path.pop(); + } + } else if (a !== b) { + error("are different (" + JSON.stringify(a) + " !== " + JSON.stringify(b) + ")"); + } +} + +function parseAndAssertSame(code) { + var esAST = espree.parse(code, { + ecmaFeatures: { + classes: true, + jsx: true + }, + tokens: true, + loc: true, + range: true + }); + var acornAST = babelEslint.parse(code); + assertSameAST(acornAST, esAST); +} + +describe("acorn-to-esprima", function () { + + it("simple expression", function () { + parseAndAssertSame("a = 1"); + }); + + it("class declaration", function () { + parseAndAssertSame("class Foo {}"); + }); + + it("class expression", function () { + parseAndAssertSame("var a = class Foo {}"); + }); + + it("jsx expression", function () { + parseAndAssertSame(""); + }); + + it("jsx expression with 'this' as identifier", function () { + parseAndAssertSame(""); + }); + + it("jsx expression with a dynamic attribute", function () { + parseAndAssertSame(""); + }); + + it("jsx expression with a member expression as identifier", function () { + parseAndAssertSame(""); + }); + +}); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js new file mode 100644 index 000000000000..68f5113109c8 --- /dev/null +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -0,0 +1,145 @@ +/*eslint-env mocha*/ +"use strict"; +var eslint = require("eslint"); + +function verifyAndAssertMessages(code, rules, expectedMessages) { + var messages = eslint.linter.verify( + code, + { + parser: require.resolve(".."), + rules: rules, + env: { + node: true + } + } + ); + + if (messages.length !== expectedMessages.length) { + throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length); + } + + messages.forEach(function (message, i) { + var formatedMessage = message.line + ":" + message.column + " " + message.message + (message.ruleId ? " " + message.ruleId : ""); + if (formatedMessage !== expectedMessages[i]) { + throw new Error("Message " + i + " does not match:\nExpected: " + expectedMessages[i] + "\nActual: " + formatedMessage); + } + }); +} + +describe("verify", function () { + + it("arrow function support (issue #1)", function () { + verifyAndAssertMessages( + "describe('stuff', () => {});", + {}, + [] + ); + }); + + it("EOL validation (issue #2)", function () { + verifyAndAssertMessages( + "module.exports = \"something\";", + { "eol-last": 1, "semi": 1 }, + [ "1:1 Newline required at end of file but not found. eol-last" ] + ); + }); + + it("Readable error messages (issue #3)", function () { + verifyAndAssertMessages( + "{ , res }", + {}, + [ "1:2 Unexpected token" ] + ); + }); + + it("Unused vars in JSX (issue #5)", function () { + verifyAndAssertMessages( + "var App = require('./App');\n" + + "module.exports = ;", + { "no-unused-vars": 1 }, + [] + ); + }); + + it("Modules support (issue #5)", function () { + verifyAndAssertMessages( + "import Foo from 'foo';\n" + + "export default Foo;", + { }, + [] + ); + }); + + it("Rest parameters (issue #7)", function () { + verifyAndAssertMessages( + "function foo(...args) { return args; }", + { "no-undef": 1 }, + [] + ); + }); + + it("Exported classes should be used (issue #8)", function () { + verifyAndAssertMessages( + "class Foo {} module.exports = Foo;", + { "no-unused-vars": 1 }, + [] + ); + }); + + it("super keyword in class (issue #10)", function () { + verifyAndAssertMessages( + "class Foo { constructor() { super() } }", + { "no-undef": 1 }, + [] + ); + }); + + it("Rest parameter in destructuring assignment (issue #11)", function () { + verifyAndAssertMessages( + "const [a, ...rest] = ['1', '2', '3']; module.exports = rest;", + { "no-undef": 1 }, + [] + ); + }); + + it("JSX attribute names marked as variables (issue #12)", function () { + verifyAndAssertMessages( + "module.exports =
", + { "no-undef": 1 }, + [] + ); + }); + + it("Variables in JSX should be used (issues #15, #17, #21, #29)", function () { + verifyAndAssertMessages( + "import App from './App'; export default ();", + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("Multiple destructured assignment with compound properties (issue #16)", function () { + verifyAndAssertMessages( + "module.exports = { ...a.a, ...a.b };", + { "no-dupe-keys": 1 }, + [] + ); + }); + + it("Arrow function with non-block bodies (issue #20)", function () { + verifyAndAssertMessages( + "\"use strict\"; () => 1", + { "strict": 1 }, + [] + ); + }); + + it("await keyword (issue #22)", function () { + verifyAndAssertMessages( + "async function foo() { await bar(); }", + { "no-unused-expressions": 1 }, + [] + ); + }); + +}); From 78ca83eb6fe66cb63e2c0abb45cc7da204d746de Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 9 Mar 2015 02:46:17 +1100 Subject: [PATCH 288/965] 1.0.14 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c064dadd4883..c3033c171779 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.13", + "version": "1.0.14", "description": "", "main": "index.js", "repository": { From 47e3808aa4fb947826b9a1125d4661a1c1c010b1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 10 Mar 2015 18:18:35 +1100 Subject: [PATCH 289/965] update to eslint 0.16, remove certain mangling --- .../babel-eslint-parser/acorn-to-esprima.js | 27 ------------------- eslint/babel-eslint-parser/package.json | 5 +++- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 66e1993c8618..da698ddb6602 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -66,11 +66,6 @@ var astTransformVisitor = { // classes - if (t.isClassDeclaration(node) || t.isClassExpression(node)) { - node.name = node.id; - delete node.id; - } - if (t.isReferencedIdentifier(node, parent, { name: "super" })) { return t.inherits(t.thisExpression(), node); } @@ -82,28 +77,6 @@ var astTransformVisitor = { // functions - if (t.isFunction(node)) { - node.defaults = []; - node.params = node.params.map(function (param) { - if (t.isAssignmentPattern(param)) { - node.defaults.push(param.right); - return param.left; - } else { - node.defaults.push(null); - return param; - } - }); - } - - if (t.isArrowFunctionExpression(node)) { - node.type = "FunctionExpression"; - if (node.body.type !== "BlockStatement") { - node.body = t.inherits(t.blockStatement([ - node.body - ]), node); - } - } - if (t.isFunction(node) && node.async) { node.generator = true; node.async - false; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c3033c171779..e5f789bc2cc4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,6 +11,9 @@ "babel": "^4.6.0", "lodash.assign": "^3.0.0" }, + "scripts": { + "test": "mocha" + }, "author": "Sebastian McKenzie ", "license": "MIT", "bugs": { @@ -18,7 +21,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.15.1", + "eslint": "^0.16.0", "espree": "^1.10.0", "mocha": "^2.1.0" }, From 64b63e44bf298b4d5bbc625e480eb2b6759298a6 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:13:34 +1100 Subject: [PATCH 290/965] update to babel-core and eslint 0.16 --- .../babel-eslint-parser/acorn-to-esprima.js | 99 ++++++++++++++++--- eslint/babel-eslint-parser/index.js | 17 +--- eslint/babel-eslint-parser/package.json | 2 +- .../babel-eslint-parser/test/babel-eslint.js | 78 +++++++++++---- 4 files changed, 148 insertions(+), 48 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index da698ddb6602..f6e5817440f8 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -1,17 +1,22 @@ -var tokTypes = require("babel").acorn.tokTypes; -var traverse = require("babel").traverse; -var t = require("babel").types; +var tokTypes = require("babel-core").acorn.tokTypes; +var traverse = require("babel-core").traverse; +var t = require("babel-core").types; exports.toToken = function (token) { var type = token.type; if (type === tokTypes.name) { token.type = "Identifier"; - } else if (type === tokTypes.semi || type === tokTypes.comma || type === tokTypes.parenL || type === tokTypes.parenR || type === tokTypes.braceL || type === tokTypes.braceR || type === tokTypes.slash || type === tokTypes.dot || type.isAssign) { + } else if (type === tokTypes.semi || type === tokTypes.comma || + type === tokTypes.parenL || type === tokTypes.parenR || + type === tokTypes.braceL || type === tokTypes.braceR || + type === tokTypes.slash || type === tokTypes.dot || + type === tokTypes.bracketL || type === tokTypes.bracketR || + type === tokTypes.ellipsis || type === tokTypes.arrow || + type === tokTypes.star || + type.isAssign) { token.type = "Punctuator"; - if (!token.value) { - token.value = type.type; - } + if (!token.value) token.value = type.type; } else if (type === tokTypes.jsxTagStart) { token.type = "Punctuator"; token.value = "<"; @@ -25,6 +30,9 @@ exports.toToken = function (token) { } else if (type === tokTypes.num) { token.type = "Numeric"; token.value = String(token.value); + } else if (type === tokTypes.string) { + token.type = "String"; + token.value = JSON.stringify(token.value); } return token; @@ -40,7 +48,7 @@ function isCompatTag(tagName) { var astTransformVisitor = { noScope: true, - enter: function (node, parent) { + exit: function (node, parent) { if (t.isSpreadProperty(node)) { node.type = "Property"; node.kind = "init"; @@ -53,17 +61,58 @@ var astTransformVisitor = { return node.argument; } + // modules + + if (t.isImportDeclaration(node)) { + delete node.isType; + } + + if (t.isExportDeclaration(node)) { + if (node.default) { + delete node.specifiers; + delete node.source; + node.type = "ExportDefaultDeclaration"; + if (node.declaration.type === "FunctionExpression") { + node.declaration.type = "FunctionDeclaration"; + } else if (node.declaration.type === "ClassExpression") { + node.declaration.type = "ClassDeclaration"; + } + } else if (t.isExportBatchSpecifier(node.specifiers[0])) { + node.type = "ExportAllDeclaration"; + delete node.specifiers; + delete node.declaration; + } else { + node.type = "ExportNamedDeclaration"; + } + delete node.default; + } + + if (t.isExportSpecifier(node)) { + node.local = node.id; + node.exported = node.name || node.id; + delete node.id; + delete node.name; + } + + if (t.isImportSpecifier(node)) { + node.local = node.id || node.name; + if (node.default) { + node.type = "ImportDefaultSpecifier"; + } else { + node.imported = node.name || node.id; + } + delete node.id; + delete node.name; + delete node.default; + } + if (t.isImportBatchSpecifier(node)) { // ImportBatchSpecifier => ImportNamespaceSpecifier node.type = "ImportNamespaceSpecifier"; - node.id = node.name; + node.local = node.name; delete node.name; } - if (t.isAwaitExpression(node)) { - node.type = "YieldExpression"; - } - // classes if (t.isReferencedIdentifier(node, parent, { name: "super" })) { @@ -76,10 +125,28 @@ var astTransformVisitor = { } // functions + + if (t.isFunction(node)) { + node.defaults = []; + node.params = node.params.map(function (param) { + if (t.isAssignmentPattern(param)) { + node.defaults.push(param.right); + return param.left; + } else { + node.defaults.push(null); + return param; + } + }); - if (t.isFunction(node) && node.async) { - node.generator = true; - node.async - false; + node.rest = null; + if (node.async) node.generator = true; + delete node.async; + } + + if (t.isAwaitExpression(node)) { + node.type = "YieldExpression"; + node.delegate = node.all; + delete node.all; } } }; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3def57ec38d3..6a40a1364363 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,10 +1,10 @@ var acornToEsprima = require("./acorn-to-esprima"); -var traverse = require("babel").traverse; +var traverse = require("babel-core").traverse; var assign = require("lodash.assign"); var Module = require("module"); -var acorn = require("babel").acorn; +var acorn = require("babel-core").acorn; var path = require("path"); -var t = require("babel").types; +var t = require("babel-core").types; var hasPatched = false; @@ -43,17 +43,6 @@ function monkeypatch() { opts.sourceType = "module"; return analyze.call(this, ast, opts) }; - - var eslint = require(eslintLoc); - var getScope = eslint.linter.getScope; - eslint.linter.getScope = function () { - var scope = getScope.apply(this, arguments); - if (scope.type === "global" && !scope.__patchedWithModuleVariables) { - scope.__patchedWithModuleVariables = true; - scope.variables.push.apply(scope.variables, scope.childScopes[0].variables); - } - return scope; - }; } exports.parse = function (code) { diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e5f789bc2cc4..521d9cb7dad2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel": "^4.6.0", + "babel-core": "^4.6.0", "lodash.assign": "^3.0.0" }, "scripts": { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index f8365c1844d0..ae9b5c520534 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,7 +1,6 @@ -var util = require("util"); -var espree = require("espree"); var babelEslint = require(".."); - +var espree = require("espree"); +var util = require("util"); function assertSameAST(a, b, path) { if (!path) { @@ -23,17 +22,19 @@ function assertSameAST(a, b, path) { keysB.sort(); while (true) { var keyA = keysA.shift(); + if (keyA && keyA[0] === "_") continue; // Exception: ignore "end" and "start" outside "loc" properties if ((keyA === "end" || keyA === "start") && path[path.length - 1] !== "loc") continue; + // Exception: ignore root "comments" property if (keyA === "comments" && path.length === 0) continue; var keyB = keysB.shift(); if (keyA === undefined && keyB === undefined) break; - if (keyA === undefined || keyA > keyB) error("first does not have key \"" + keyB + "\""); - if (keyB === undefined || keyA < keyB) error("second does not have key \"" + keyA + "\""); + if (keyA === undefined || keyA > keyB) error('first does not have key "' + keyB + '"'); + if (keyB === undefined || keyA < keyB) error('second does not have key "' + keyA + '"'); path.push(keyA); assertSameAST(a[keyA], b[keyB], path); path.pop(); @@ -44,21 +45,21 @@ function assertSameAST(a, b, path) { } function parseAndAssertSame(code) { - var esAST = espree.parse(code, { - ecmaFeatures: { - classes: true, - jsx: true - }, - tokens: true, - loc: true, - range: true - }); - var acornAST = babelEslint.parse(code); - assertSameAST(acornAST, esAST); + var esAST = espree.parse(code, { + ecmaFeatures: { + modules: true, + classes: true, + jsx: true + }, + tokens: true, + loc: true, + range: true + }); + var acornAST = babelEslint.parse(code); + assertSameAST(acornAST, esAST); } describe("acorn-to-esprima", function () { - it("simple expression", function () { parseAndAssertSame("a = 1"); }); @@ -87,4 +88,47 @@ describe("acorn-to-esprima", function () { parseAndAssertSame(""); }); + it("default import", function () { + parseAndAssertSame('import foo from "foo";'); + }); + + it("import specifier", function () { + parseAndAssertSame('import { foo } from "foo";'); + }); + + it("import specifier with name", function () { + parseAndAssertSame('import { foo as bar } from "foo";'); + }); + + it("import bare", function () { + parseAndAssertSame('import "foo";'); + }); + + it("export default class declaration", function () { + parseAndAssertSame("export default class Foo {}"); + }); + + it("export default class expression", function () { + parseAndAssertSame("export default class {};"); + }); + + it("export default function declaration", function () { + parseAndAssertSame("export default function Foo() {}"); + }); + + it("export default function expression", function () { + parseAndAssertSame("export default function () {};"); + }); + + it("export all", function () { + parseAndAssertSame('export * from "foo";'); + }); + + it("export named", function () { + parseAndAssertSame("export { foo };"); + }); + + it("export named alias", function () { + parseAndAssertSame("export { foo as bar };"); + }); }); From 24eef217567160d465a72c20bbedb928a68df68f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:15:07 +1100 Subject: [PATCH 291/965] convert playground assignment operators - fixes babel/babel-eslint#40 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index f6e5817440f8..0633cbf5d08c 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -61,6 +61,14 @@ var astTransformVisitor = { return node.argument; } + // playground + + if (t.isAssignmentExpression(node)) { + if (node.operator === "||=" || node.operator === "?=") { + node.operator = "+="; + } + } + // modules if (t.isImportDeclaration(node)) { From 762597197480c8876fe381e9ae5ad749dbfb6619 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:17:22 +1100 Subject: [PATCH 292/965] Merge branch 'master' of github.com:babel/babel-eslint --- eslint/babel-eslint-parser/.travis.yml | 7 +++++++ eslint/babel-eslint-parser/README.md | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-parser/.travis.yml diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml new file mode 100644 index 000000000000..8ac23aee56e0 --- /dev/null +++ b/eslint/babel-eslint-parser/.travis.yml @@ -0,0 +1,7 @@ +--- +git: + depth: 1 +language: node_js +node_js: + - '0.12' + - 'io.js' diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 960e1e75129a..09130684ff83 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -1,4 +1,4 @@ -# babel-eslint +# babel-eslint [![Build Status][travis-image]][travis-url] **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). @@ -41,3 +41,6 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ```sh $ eslint your-files-here ``` + +[travis-url]: https://travis-ci.org/babel/babel-eslint +[travis-image]: https://travis-ci.org/babel/babel-eslint.svg?branch=master From 6762396aec7c851d70d4aed1f49dc40e4b57f1a1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:35:00 +1100 Subject: [PATCH 293/965] fix module conversion --- eslint/babel-eslint-parser/acorn-to-esprima.js | 4 ++-- eslint/babel-eslint-parser/test/babel-eslint.js | 4 ++-- eslint/babel-eslint-parser/test/non-regression.js | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 0633cbf5d08c..dd6c680c568f 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -103,11 +103,11 @@ var astTransformVisitor = { } if (t.isImportSpecifier(node)) { - node.local = node.id || node.name; + node.local = node.name || node.id; if (node.default) { node.type = "ImportDefaultSpecifier"; } else { - node.imported = node.name || node.id; + node.imported = node.id; } delete node.id; delete node.name; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index ae9b5c520534..1dc2008fb78b 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -109,7 +109,7 @@ describe("acorn-to-esprima", function () { }); it("export default class expression", function () { - parseAndAssertSame("export default class {};"); + parseAndAssertSame("export default class {}"); }); it("export default function declaration", function () { @@ -117,7 +117,7 @@ describe("acorn-to-esprima", function () { }); it("export default function expression", function () { - parseAndAssertSame("export default function () {};"); + parseAndAssertSame("export default function () {}"); }); it("export all", function () { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 68f5113109c8..5cff7f9fdc61 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -9,7 +9,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages) { parser: require.resolve(".."), rules: rules, env: { - node: true + node: true } } ); @@ -27,7 +27,6 @@ function verifyAndAssertMessages(code, rules, expectedMessages) { } describe("verify", function () { - it("arrow function support (issue #1)", function () { verifyAndAssertMessages( "describe('stuff', () => {});", @@ -141,5 +140,4 @@ describe("verify", function () { [] ); }); - }); From 3fced333e8aba071e46e6a049b1a7e1df5358d99 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:40:00 +1100 Subject: [PATCH 294/965] bump to 2.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 521d9cb7dad2..cbb0853c7414 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "1.0.14", + "version": "2.0.0", "description": "", "main": "index.js", "repository": { From cbe8c84ec157088e1eb97a1e6b310b64da94f6c9 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 00:40:11 +1100 Subject: [PATCH 295/965] add messages to non regression test output --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 5cff7f9fdc61..505870d69454 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -15,7 +15,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages) { ); if (messages.length !== expectedMessages.length) { - throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length); + throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length + " " + JSON.stringify(messages)); } messages.forEach(function (message, i) { From fcb367666d5f51ee6a451a61f0c64772323aa382 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 01:15:15 +1100 Subject: [PATCH 296/965] add class usage non regression test --- eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 505870d69454..7eacdc794e41 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -140,4 +140,12 @@ describe("verify", function () { [] ); }); + + it("class usage", function () { + verifyAndAssertMessages( + "class Lol {} module.exports = Lol;", + { "no-unused-vars": 1 }, + [] + ); + }); }); From 665f0d600235c1be60cfce56d9419a5d5b0c69f2 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 01:15:32 +1100 Subject: [PATCH 297/965] upgrade babel-core to 4.7.8 --- eslint/babel-eslint-parser/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cbb0853c7414..0bef841dfaad 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "2.0.0", + "version": "2.0.1", "description": "", "main": "index.js", "repository": { @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^4.6.0", + "babel-core": "^4.7.8", "lodash.assign": "^3.0.0" }, "scripts": { From 0d0cc6bb83e7d32bd0e05e85fc9242301b71e052 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Mar 2015 21:35:12 +1100 Subject: [PATCH 298/965] Merge pull request babel/babel-eslint#44 from Globegitter/patch-1 Added global flag to install command --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 09130684ff83..45c7852b1e33 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -18,7 +18,7 @@ columns is also retained so you can track down errors with ease. ### Install ```sh -$ npm install eslint babel-eslint +$ npm install -g eslint babel-eslint ``` ### Setup From ce91f1869b0781a2fc1be80e8e1c99d0b02f9ad0 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 16 Mar 2015 12:42:57 +1100 Subject: [PATCH 299/965] Merge pull request babel/babel-eslint#50 from UltCombo/fix-48 acorn-to-esprima: fix ExportNamedDeclaration, closes babel/babel-eslint#48 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index dd6c680c568f..a441043b5ebd 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -85,7 +85,7 @@ var astTransformVisitor = { } else if (node.declaration.type === "ClassExpression") { node.declaration.type = "ClassDeclaration"; } - } else if (t.isExportBatchSpecifier(node.specifiers[0])) { + } else if (node.specifiers && t.isExportBatchSpecifier(node.specifiers[0])) { node.type = "ExportAllDeclaration"; delete node.specifiers; delete node.declaration; @@ -94,7 +94,7 @@ var astTransformVisitor = { } delete node.default; } - + if (t.isExportSpecifier(node)) { node.local = node.id; node.exported = node.name || node.id; @@ -133,7 +133,7 @@ var astTransformVisitor = { } // functions - + if (t.isFunction(node)) { node.defaults = []; node.params = node.params.map(function (param) { From b9ae556f9f938cfdac5896860c8b5cb2f28ce351 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 16 Mar 2015 12:49:38 +1100 Subject: [PATCH 300/965] add sourceType property --- eslint/babel-eslint-parser/acorn-to-esprima.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index a441043b5ebd..ca6516526d55 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -39,6 +39,7 @@ exports.toToken = function (token) { }; exports.toAST = function (ast) { + ast.sourceType = "module"; traverse(ast, astTransformVisitor); }; From ded2e420b15c430dcc21b1665f2022c6c431d1fb Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 16 Mar 2015 12:49:43 +1100 Subject: [PATCH 301/965] bump version --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0bef841dfaad..527e51ba44dc 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "2.0.1", + "version": "2.0.2", "description": "", "main": "index.js", "repository": { From 4a531aaba41875b39ee5ee1d8c131d6fa8f5667d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 8 Apr 2015 22:07:21 -0700 Subject: [PATCH 302/965] port to babel 5.0.0 --- .../babel-eslint-parser/acorn-to-esprima.js | 96 ++++--------------- eslint/babel-eslint-parser/index.js | 25 ++++- eslint/babel-eslint-parser/package.json | 6 +- .../test/non-regression.js | 9 -- 4 files changed, 42 insertions(+), 94 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index ca6516526d55..5375a3b11845 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -1,36 +1,36 @@ -var tokTypes = require("babel-core").acorn.tokTypes; var traverse = require("babel-core").traverse; +var tt = require("babel-core").acorn.tokTypes; var t = require("babel-core").types; exports.toToken = function (token) { var type = token.type; - if (type === tokTypes.name) { + if (type === tt.name) { token.type = "Identifier"; - } else if (type === tokTypes.semi || type === tokTypes.comma || - type === tokTypes.parenL || type === tokTypes.parenR || - type === tokTypes.braceL || type === tokTypes.braceR || - type === tokTypes.slash || type === tokTypes.dot || - type === tokTypes.bracketL || type === tokTypes.bracketR || - type === tokTypes.ellipsis || type === tokTypes.arrow || - type === tokTypes.star || + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.slash || type === tt.dot || + type === tt.bracketL || type === tt.bracketR || + type === tt.ellipsis || type === tt.arrow || + type === tt.star || type.isAssign) { token.type = "Punctuator"; - if (!token.value) token.value = type.type; - } else if (type === tokTypes.jsxTagStart) { + if (!token.value) token.value = type.label; + } else if (type === tt.jsxTagStart) { token.type = "Punctuator"; token.value = "<"; - } else if (type === tokTypes.jsxTagEnd) { + } else if (type === tt.jsxTagEnd) { token.type = "Punctuator"; token.value = ">"; - } else if (type === tokTypes.jsxName) { + } else if (type === tt.jsxName) { token.type = "JSXIdentifier"; } else if (type.keyword) { token.type = "Keyword"; - } else if (type === tokTypes.num) { + } else if (type === tt.num) { token.type = "Numeric"; token.value = String(token.value); - } else if (type === tokTypes.string) { + } else if (type === tt.string) { token.type = "String"; token.value = JSON.stringify(token.value); } @@ -62,14 +62,6 @@ var astTransformVisitor = { return node.argument; } - // playground - - if (t.isAssignmentExpression(node)) { - if (node.operator === "||=" || node.operator === "?=") { - node.operator = "+="; - } - } - // modules if (t.isImportDeclaration(node)) { @@ -77,49 +69,11 @@ var astTransformVisitor = { } if (t.isExportDeclaration(node)) { - if (node.default) { - delete node.specifiers; - delete node.source; - node.type = "ExportDefaultDeclaration"; - if (node.declaration.type === "FunctionExpression") { - node.declaration.type = "FunctionDeclaration"; - } else if (node.declaration.type === "ClassExpression") { - node.declaration.type = "ClassDeclaration"; - } - } else if (node.specifiers && t.isExportBatchSpecifier(node.specifiers[0])) { - node.type = "ExportAllDeclaration"; - delete node.specifiers; - delete node.declaration; - } else { - node.type = "ExportNamedDeclaration"; + if (t.isClassExpression(node.declaration)) { + node.declaration.type = "ClassDeclaration"; + } else if (t.isFunctionExpression(node.declaration)) { + node.declaration.type = "FunctionDeclaration"; } - delete node.default; - } - - if (t.isExportSpecifier(node)) { - node.local = node.id; - node.exported = node.name || node.id; - delete node.id; - delete node.name; - } - - if (t.isImportSpecifier(node)) { - node.local = node.name || node.id; - if (node.default) { - node.type = "ImportDefaultSpecifier"; - } else { - node.imported = node.id; - } - delete node.id; - delete node.name; - delete node.default; - } - - if (t.isImportBatchSpecifier(node)) { - // ImportBatchSpecifier => ImportNamespaceSpecifier - node.type = "ImportNamespaceSpecifier"; - node.local = node.name; - delete node.name; } // classes @@ -136,18 +90,6 @@ var astTransformVisitor = { // functions if (t.isFunction(node)) { - node.defaults = []; - node.params = node.params.map(function (param) { - if (t.isAssignmentPattern(param)) { - node.defaults.push(param.right); - return param.left; - } else { - node.defaults.push(null); - return param; - } - }); - - node.rest = null; if (node.async) node.generator = true; delete node.async; } diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 6a40a1364363..7b056e70ace8 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -53,11 +53,26 @@ exports.parse = function (code) { process.exit(1); } - var opts = {}; - opts.ecmaVersion = 7; - opts.playground = true; - opts.locations = true; - opts.ranges = true; + var opts = { + ecmaVersion: 7, + locations: true, + ranges: true, + sourceType: "module", + plugins: { + jsx: true, + flow: true + }, + features: { + "es7.asyncFunctions": true, + "es7.classProperties": true, + "es7.comprehensions": true, + "es7.decorators": true, + "es7.doExpressions": true, + "es7.exponentiationOperator": true, + "es7.exportExtensions": true, + "es7.objectRestSpread": true + } + }; var comments = opts.onComment = []; var tokens = opts.onToken = []; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 527e51ba44dc..c3356a36bfb7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^4.7.8", + "babel-core": "^5.0.0-beta4", "lodash.assign": "^3.0.0" }, "scripts": { @@ -21,8 +21,8 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.16.0", - "espree": "^1.10.0", + "eslint": "^0.18.0", + "espree": "^2.0.0", "mocha": "^2.1.0" }, "scripts": { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 7eacdc794e41..400ab62c7ef2 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -51,15 +51,6 @@ describe("verify", function () { ); }); - it("Unused vars in JSX (issue #5)", function () { - verifyAndAssertMessages( - "var App = require('./App');\n" + - "module.exports = ;", - { "no-unused-vars": 1 }, - [] - ); - }); - it("Modules support (issue #5)", function () { verifyAndAssertMessages( "import Foo from 'foo';\n" + From 729cedc9259c54af3815bef428014d2f21051fda Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 8 Apr 2015 22:07:28 -0700 Subject: [PATCH 303/965] Merge branch 'master' of github.com:babel/babel-eslint --- eslint/babel-eslint-parser/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7b056e70ace8..35a77b5d8fdb 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -41,7 +41,13 @@ function monkeypatch() { escope.analyze = function (ast, opts) { opts.ecmaVersion = 6; opts.sourceType = "module"; - return analyze.call(this, ast, opts) + // Don't visit TypeAlias when analyzing scope, but retain them for other + // eslint rules. + var TypeAliasKeys = estraverse.VisitorKeys.TypeAlias; + estraverse.VisitorKeys.TypeAlias = []; + var results = analyze.call(this, ast, opts); + estraverse.VisitorKeys.TypeAlias = TypeAliasKeys; + return results; }; } From d301c8e099f44773f0246fb55eef4ae40828da04 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 13 Apr 2015 17:12:08 -0700 Subject: [PATCH 304/965] upgrade to babel 5.1.8 --- .../babel-eslint-parser/acorn-to-esprima.js | 5 ----- eslint/babel-eslint-parser/index.js | 20 ++----------------- eslint/babel-eslint-parser/package.json | 4 ++-- .../test/non-regression.js | 8 -------- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 5375a3b11845..1206826b462c 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -82,11 +82,6 @@ var astTransformVisitor = { return t.inherits(t.thisExpression(), node); } - if (t.isClassProperty(node)) { - // eslint doesn't like these - this.remove(); - } - // functions if (t.isFunction(node)) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 35a77b5d8fdb..dcef0c5b1c07 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -2,7 +2,7 @@ var acornToEsprima = require("./acorn-to-esprima"); var traverse = require("babel-core").traverse; var assign = require("lodash.assign"); var Module = require("module"); -var acorn = require("babel-core").acorn; +var parse = require("babel-core").parse; var path = require("path"); var t = require("babel-core").types; @@ -60,24 +60,8 @@ exports.parse = function (code) { } var opts = { - ecmaVersion: 7, locations: true, ranges: true, - sourceType: "module", - plugins: { - jsx: true, - flow: true - }, - features: { - "es7.asyncFunctions": true, - "es7.classProperties": true, - "es7.comprehensions": true, - "es7.decorators": true, - "es7.doExpressions": true, - "es7.exponentiationOperator": true, - "es7.exportExtensions": true, - "es7.objectRestSpread": true - } }; var comments = opts.onComment = []; @@ -85,7 +69,7 @@ exports.parse = function (code) { var ast; try { - ast = acorn.parse(code, opts); + ast = parse(code, opts); } catch (err) { if (err instanceof SyntaxError) { err.lineNumber = err.loc.line; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c3356a36bfb7..aa4ec3e947b6 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "2.0.2", + "version": "3.0.0", "description": "", "main": "index.js", "repository": { @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.0.0-beta4", + "babel-core": "^5.1.8", "lodash.assign": "^3.0.0" }, "scripts": { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 400ab62c7ef2..3a676d0e006d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -100,14 +100,6 @@ describe("verify", function () { ); }); - it("Variables in JSX should be used (issues #15, #17, #21, #29)", function () { - verifyAndAssertMessages( - "import App from './App'; export default ();", - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - it("Multiple destructured assignment with compound properties (issue #16)", function () { verifyAndAssertMessages( "module.exports = { ...a.a, ...a.b };", From 47c167309202b619c65aa243ac9842c6ce094f6f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 13 Apr 2015 18:05:58 -0700 Subject: [PATCH 305/965] remove flow types and class property keys --- eslint/babel-eslint-parser/acorn-to-esprima.js | 8 ++++++++ eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 1206826b462c..d69365076536 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -58,6 +58,10 @@ var astTransformVisitor = { delete node.argument; } + if (t.isFlow(node)) { + return this.remove(); + } + if (t.isRestElement(node)) { return node.argument; } @@ -82,6 +86,10 @@ var astTransformVisitor = { return t.inherits(t.thisExpression(), node); } + if (t.isClassProperty(node)) { + delete node.key; + } + // functions if (t.isFunction(node)) { diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index aa4ec3e947b6..1c1ae9041a8c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.0.0", + "version": "3.0.1", "description": "", "main": "index.js", "repository": { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3a676d0e006d..3e4b3d9bf305 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -131,4 +131,12 @@ describe("verify", function () { [] ); }); + + it("class properties", function () { + verifyAndAssertMessages( + "class Lol { foo = 'bar'; }", + { "no-undef": 1 }, + [] + ); + }); }); From 46f65bcf494eddc0b9f967eb021b1f242047f380 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 6 May 2015 17:19:30 +0100 Subject: [PATCH 306/965] Merge pull request babel/babel-eslint#76 from Cellule/attach_comments Attach comments to ast using estraverse --- eslint/babel-eslint-parser/index.js | 49 ++++++++++- .../babel-eslint-parser/test/babel-eslint.js | 85 ++++++++++++------- 2 files changed, 103 insertions(+), 31 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index dcef0c5b1c07..f8aef5b7f552 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -6,6 +6,7 @@ var parse = require("babel-core").parse; var path = require("path"); var t = require("babel-core").types; +var estraverse; var hasPatched = false; function createModule(filename) { @@ -32,7 +33,7 @@ function monkeypatch() { var escopeMod = createModule(escopeLoc); // monkeypatch estraverse - var estraverse = escopeMod.require("estraverse"); + estraverse = escopeMod.require("estraverse"); assign(estraverse.VisitorKeys, t.VISITOR_KEYS); // monkeypatch escope @@ -51,6 +52,51 @@ function monkeypatch() { }; } +exports.attachComments = function(ast, comments, tokens) { + estraverse.attachComments(ast, comments, tokens); + + if (comments.length) { + var firstComment = comments[0]; + var lastComment = comments[comments.length - 1]; + // fixup program start + if (!tokens.length) { + // if no tokens, the program starts at the end of the last comment + ast.range[0] = lastComment.range[1]; + ast.loc.start.line = lastComment.loc.end.line; + ast.loc.start.column = lastComment.loc.end.column; + } else if (firstComment.start < tokens[0].range[0]) { + // if there are comments before the first token, the program starts at the first token + var token = tokens[0]; + ast.range[0] = token.range[0]; + ast.loc.start.line = token.loc.start.line; + ast.loc.start.column = token.loc.start.column; + + // estraverse do not put leading comments on first node when the comment + // appear before the first token + if (ast.body.length) { + var node = ast.body[0]; + node.leadingComments = []; + var firstTokenStart = token.range[0]; + var len = comments.length; + for(var i = 0; i < len && comments[i].start < firstTokenStart; i++ ) { + node.leadingComments.push(comments[i]); + } + } + } + // fixup program end + if (tokens.length) { + var lastToken = tokens[tokens.length - 1]; + if (lastComment.end > lastToken.range[1]) { + // If there is a comment after the last token, the program ends at the + // last token and not the comment + ast.range[1] = lastToken.range[1]; + ast.loc.end.line = lastToken.loc.end.line; + ast.loc.end.column = lastToken.loc.end.column; + } + } + } +}; + exports.parse = function (code) { try { monkeypatch(); @@ -92,6 +138,7 @@ exports.parse = function (code) { // add comments ast.comments = comments; + exports.attachComments(ast, comments, tokens); // transform esprima and acorn divergent nodes acornToEsprima.toAST(ast); diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 1dc2008fb78b..7c7c45c5b223 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -2,45 +2,32 @@ var babelEslint = require(".."); var espree = require("espree"); var util = require("util"); -function assertSameAST(a, b, path) { +// Checks if the source ast implements the target ast. Ignores extra keys on source ast +function assertImplementsAST(target, source, path) { if (!path) { path = []; } function error(text) { - throw new Error("At " + path.join(".") + ": " + text + ":\n" + util.inspect(a) + "\n" + util.inspect(b)); + var err = new Error("At " + path.join(".") + ": " + text + ":"); + err.depth = path.length + 1; + throw err; } - var typeA = a === null ? "null" : typeof a; - var typeB = b === null ? "null" : typeof b; + var typeA = target === null ? "null" : typeof target; + var typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { - error("have not the same type (" + typeA + " !== " + typeB + ")"); + error("have different types (" + typeA + " !== " + typeB + ")"); } else if (typeA === "object") { - var keysA = Object.keys(a); - var keysB = Object.keys(b); - keysA.sort(); - keysB.sort(); - while (true) { - var keyA = keysA.shift(); - if (keyA && keyA[0] === "_") continue; - - // Exception: ignore "end" and "start" outside "loc" properties - if ((keyA === "end" || keyA === "start") && path[path.length - 1] !== "loc") continue; - - // Exception: ignore root "comments" property - if (keyA === "comments" && path.length === 0) continue; - - var keyB = keysB.shift(); - - if (keyA === undefined && keyB === undefined) break; - if (keyA === undefined || keyA > keyB) error('first does not have key "' + keyB + '"'); - if (keyB === undefined || keyA < keyB) error('second does not have key "' + keyA + '"'); - path.push(keyA); - assertSameAST(a[keyA], b[keyB], path); + var keysTarget = Object.keys(target); + for(var i in keysTarget) { + var key = keysTarget[i]; + path.push(key); + assertImplementsAST(target[key], source[key], path); path.pop(); } - } else if (a !== b) { - error("are different (" + JSON.stringify(a) + " !== " + JSON.stringify(b) + ")"); + } else if (target !== source) { + error("are different (" + JSON.stringify(target) + " !== " + JSON.stringify(source) + ")"); } } @@ -53,10 +40,21 @@ function parseAndAssertSame(code) { }, tokens: true, loc: true, - range: true + range: true, + comment: true, + attachComment: true }); var acornAST = babelEslint.parse(code); - assertSameAST(acornAST, esAST); + try { + assertImplementsAST(esAST, acornAST); + } catch(err) { + err.message += + "\nespree:\n" + + util.inspect(esAST, {depth: err.depth}) + + "\nbabel-eslint:\n" + + util.inspect(acornAST, {depth: err.depth}); + throw err; + } } describe("acorn-to-esprima", function () { @@ -131,4 +129,31 @@ describe("acorn-to-esprima", function () { it("export named alias", function () { parseAndAssertSame("export { foo as bar };"); }); + + it("empty program with line comment", function () { + parseAndAssertSame("// single comment"); + }); + + it("empty program with block comment", function () { + parseAndAssertSame(" /* multiline\n * comment\n*/"); + }); + + it("line comments", function () { + parseAndAssertSame([ + " // single comment", + "var foo = 15; // comment next to statement", + "// second comment after statement" + ].join("\n")); + }); + + it("block comments", function () { + parseAndAssertSame([ + " /* single comment */ ", + "var foo = 15; /* comment next to statement */", + "/*", + " * multiline", + " * comment", + " */" + ].join("\n")); + }); }); From e571aec2ff61c01165a492d7da14317e30b9c23a Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 6 May 2015 17:19:48 +0100 Subject: [PATCH 307/965] 3.1.0 --- eslint/babel-eslint-parser/package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1c1ae9041a8c..b33bd2be5f00 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.0.1", + "version": "3.1.0", "description": "", "main": "index.js", "repository": { @@ -24,8 +24,5 @@ "eslint": "^0.18.0", "espree": "^2.0.0", "mocha": "^2.1.0" - }, - "scripts": { - "test": "mocha" } } From 77c5b0f3b75ea4284ec9079e0c2882bd8694d8cf Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 7 May 2015 13:48:32 +0100 Subject: [PATCH 308/965] Merge pull request babel/babel-eslint#86 from hzoo/patchestraverse-fb also patch estraverse-fb - fixes babel/babel-eslint#73 --- eslint/babel-eslint-parser/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f8aef5b7f552..c5426b672d19 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -36,6 +36,10 @@ function monkeypatch() { estraverse = escopeMod.require("estraverse"); assign(estraverse.VisitorKeys, t.VISITOR_KEYS); + // monkeypatch estraverse-fb + var estraverseFb = eslintMod.require("estraverse-fb"); + assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); + // monkeypatch escope var escope = require(escopeLoc); var analyze = escope.analyze; From 0f13e5708bc48db7fadf2d27827027aa0d47a3a5 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 7 May 2015 13:49:05 +0100 Subject: [PATCH 309/965] 3.1.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b33bd2be5f00..24b899ba03c4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.0", + "version": "3.1.1", "description": "", "main": "index.js", "repository": { From 758e8d40e5487e7967b77d88210616779ce11879 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 11 May 2015 08:15:41 +0100 Subject: [PATCH 310/965] Merge pull request babel/babel-eslint#90 from hzoo/morePunctuatorTypes change more tokentypes to be punctuator - fixes babel/babel-eslint#59 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index d69365076536..393290dcc77e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -13,7 +13,16 @@ exports.toToken = function (token) { type === tt.slash || type === tt.dot || type === tt.bracketL || type === tt.bracketR || type === tt.ellipsis || type === tt.arrow || - type === tt.star || + type === tt.star || type === tt.incDec || + type === tt.colon || type === tt.question || + type === tt.template || type === tt.backQuote || + type === tt.dollarBraceL || type === tt.at || + type === tt.logicalOR || type === tt.logicalAND || + type === tt.bitwiseOR || type === tt.bitwiseXOR || + type === tt.bitwiseAND || type === tt.equality || + type === tt.relational || type === tt.bitShift || + type === tt.plusMin || type === tt.modulo || + type === tt.exponent || type === tt.prefix || type.isAssign) { token.type = "Punctuator"; if (!token.value) token.value = type.label; From 527287aa29ff0389ce2056ea36b665709c52b145 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 13 May 2015 00:27:19 +0100 Subject: [PATCH 311/965] Merge pull request babel/babel-eslint#93 from hzoo/tokenTypes add tokenTypes: Null, Boolean, RegularExpression --- eslint/babel-eslint-parser/acorn-to-esprima.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 393290dcc77e..756b82e974b5 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -34,6 +34,10 @@ exports.toToken = function (token) { token.value = ">"; } else if (type === tt.jsxName) { token.type = "JSXIdentifier"; + } else if (type.keyword === "null") { + token.type = "Null"; + } else if (type.keyword === "false" || token.keyword === "true") { + token.type = "Boolean"; } else if (type.keyword) { token.type = "Keyword"; } else if (type === tt.num) { @@ -42,6 +46,8 @@ exports.toToken = function (token) { } else if (type === tt.string) { token.type = "String"; token.value = JSON.stringify(token.value); + } else if (type === tt.regexp) { + token.type = "RegularExpression"; } return token; From d84fc559f2bd7bd8845445ffffcfa35569a0eac4 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 14 May 2015 21:38:56 +0100 Subject: [PATCH 312/965] Merge pull request babel/babel-eslint#94 from hzoo/support-templates support template strings - Fixes babel/babel-eslint#31 --- .../babel-eslint-parser/acorn-to-esprima.js | 91 +++++++++++++++++++ eslint/babel-eslint-parser/index.js | 6 +- .../babel-eslint-parser/test/babel-eslint.js | 53 ++++++++++- .../test/non-regression.js | 10 ++ 4 files changed, 154 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 756b82e974b5..b562711bcc66 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -58,10 +58,82 @@ exports.toAST = function (ast) { traverse(ast, astTransformVisitor); }; +exports.toTokens = function (tokens) { + // transform tokens to type "Template" + convertTemplateType(tokens); + + return tokens.map(exports.toToken); +}; + function isCompatTag(tagName) { return tagName && /^[a-z]|\-/.test(tagName); } +function convertTemplateType(tokens) { + var startingToken = 0; + var currentToken = 0; + var numBraces = 0; + + function isTemplateStarter(token) { + return tokens[token].type === tt.backQuote || + tokens[token].type === tt.braceR; + } + + function isTemplateEnder(token) { + return tokens[token].type === tt.dollarBraceL || + tokens[token].type === tt.backQuote; + } + + function createTemplateValue(start, end) { + var value = ""; + while (start <= end) { + if (tokens[start].value) { + value += tokens[start].value; + } else if (tokens[start].type !== tt.template) { + value += tokens[start].type.label; + } + start++; + } + return value; + } + + function replaceWithTemplateType(start, end) { + var templateToken = { + type: 'Template', + value: createTemplateValue(start, end), + range: [tokens[start].start, tokens[end].end], + loc: { + start: tokens[start].loc.start, + end: tokens[end].loc.end + } + } + tokens.splice(start, end - start + 1, templateToken); + } + + function checkNumBraces(token) { + if (tokens[token].type === tt.braceL) { + numBraces++; + } else if (tokens[token].type === tt.braceR) { + numBraces--; + } + } + + while (startingToken < tokens.length) { + if (isTemplateStarter(startingToken) && numBraces === 0) { + currentToken = startingToken + 1; + while (currentToken < tokens.length - 1 && !isTemplateEnder(currentToken)) { + checkNumBraces(currentToken); + currentToken++; + } + replaceWithTemplateType(startingToken, currentToken); + startingToken++; + } else { + checkNumBraces(startingToken); + startingToken++; + } + } +} + var astTransformVisitor = { noScope: true, exit: function (node, parent) { @@ -117,5 +189,24 @@ var astTransformVisitor = { node.delegate = node.all; delete node.all; } + + // template strings + + if (t.isTemplateLiteral(node)) { + node.quasis.forEach(function (q) { + q.range[0] -= 1; + if (q.tail) { + q.range[1] += 1; + } else { + q.range[1] += 2; + } + q.loc.start.column -= 1; + if (q.tail) { + q.loc.end.column += 1; + } else { + q.loc.end.column += 2; + } + }); + } } }; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index c5426b672d19..2002b68fd971 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -56,7 +56,7 @@ function monkeypatch() { }; } -exports.attachComments = function(ast, comments, tokens) { +exports.attachComments = function (ast, comments, tokens) { estraverse.attachComments(ast, comments, tokens); if (comments.length) { @@ -82,7 +82,7 @@ exports.attachComments = function(ast, comments, tokens) { node.leadingComments = []; var firstTokenStart = token.range[0]; var len = comments.length; - for(var i = 0; i < len && comments[i].start < firstTokenStart; i++ ) { + for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { node.leadingComments.push(comments[i]); } } @@ -138,7 +138,7 @@ exports.parse = function (code) { tokens.pop(); // convert tokens - ast.tokens = tokens.map(acornToEsprima.toToken); + ast.tokens = acornToEsprima.toTokens(tokens); // add comments ast.comments = comments; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 7c7c45c5b223..123745f516ab 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -20,7 +20,7 @@ function assertImplementsAST(target, source, path) { error("have different types (" + typeA + " !== " + typeB + ")"); } else if (typeA === "object") { var keysTarget = Object.keys(target); - for(var i in keysTarget) { + for (var i in keysTarget) { var key = keysTarget[i]; path.push(key); assertImplementsAST(target[key], source[key], path); @@ -34,6 +34,7 @@ function assertImplementsAST(target, source, path) { function parseAndAssertSame(code) { var esAST = espree.parse(code, { ecmaFeatures: { + templateStrings: true, modules: true, classes: true, jsx: true @@ -50,14 +51,60 @@ function parseAndAssertSame(code) { } catch(err) { err.message += "\nespree:\n" + - util.inspect(esAST, {depth: err.depth}) + + util.inspect(esAST, {depth: err.depth, colors: true}) + "\nbabel-eslint:\n" + - util.inspect(acornAST, {depth: err.depth}); + util.inspect(acornAST, {depth: err.depth, colors: true}); throw err; } } describe("acorn-to-esprima", function () { + describe("templates", function () { + it("empty template string", function () { + parseAndAssertSame("``"); + }); + + it("template string", function () { + parseAndAssertSame("`test`"); + }); + + it("template string using $", function () { + parseAndAssertSame("`$`"); + }); + + it("template string with expression", function () { + parseAndAssertSame("`${a}`"); + }); + + it("template string with multiple expressions", function () { + parseAndAssertSame("`${a}${b}${c}`"); + }); + + it("template string with expression and strings", function () { + parseAndAssertSame("`a${a}a`"); + }); + + it("template string with binary expression", function () { + parseAndAssertSame("`a${a + b}a`"); + }); + + it("tagged template", function () { + parseAndAssertSame("jsx``"); + }); + + it("tagged template with expression", function () { + parseAndAssertSame("jsx``"); + }); + + it("tagged template with new operator", function () { + parseAndAssertSame("new raw`42`"); + }); + + it("template with nested function/object", function () { + parseAndAssertSame("`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`"); + }); + }); + it("simple expression", function () { parseAndAssertSame("a = 1"); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3e4b3d9bf305..1ce55b05771d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -139,4 +139,14 @@ describe("verify", function () { [] ); }); + + it("template strings #31", function () { + verifyAndAssertMessages( + "console.log(`${a}, b`);", + { "comma-spacing": 1 }, + [] + ); + }); + + }); From 9731e496c844b6e761068b2645b9a2948e6abb82 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 14 May 2015 21:39:13 +0100 Subject: [PATCH 313/965] 3.1.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 24b899ba03c4..5b760611fcdd 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.1", + "version": "3.1.2", "description": "", "main": "index.js", "repository": { From 730f2528dc3fb4867541e3e74fa403e178604c58 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 15 May 2015 14:42:28 -0400 Subject: [PATCH 314/965] Merge pull request babel/babel-eslint#97 from hzoo/fix-templates fix template type issues --- .../babel-eslint-parser/acorn-to-esprima.js | 54 ++++++++++++++----- .../babel-eslint-parser/test/babel-eslint.js | 37 +++++++++++++ .../test/non-regression.js | 2 - 3 files changed, 77 insertions(+), 16 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index b562711bcc66..ea6222e3eeaa 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -36,7 +36,7 @@ exports.toToken = function (token) { token.type = "JSXIdentifier"; } else if (type.keyword === "null") { token.type = "Null"; - } else if (type.keyword === "false" || token.keyword === "true") { + } else if (type.keyword === "false" || type.keyword === "true") { token.type = "Boolean"; } else if (type.keyword) { token.type = "Keyword"; @@ -48,6 +48,11 @@ exports.toToken = function (token) { token.value = JSON.stringify(token.value); } else if (type === tt.regexp) { token.type = "RegularExpression"; + token.regex = { + pattern: token.value.pattern, + flags: token.value.flags + }; + token.value = String(token.value.value); } return token; @@ -70,20 +75,26 @@ function isCompatTag(tagName) { } function convertTemplateType(tokens) { - var startingToken = 0; - var currentToken = 0; - var numBraces = 0; + var startingToken = 0; + var currentToken = 0; + var numBraces = 0; + var hasTemplateEnded = true; + + function isBackQuote(token) { + return tokens[token].type === tt.backQuote; + } function isTemplateStarter(token) { - return tokens[token].type === tt.backQuote || + return isBackQuote(token) || tokens[token].type === tt.braceR; } function isTemplateEnder(token) { - return tokens[token].type === tt.dollarBraceL || - tokens[token].type === tt.backQuote; + return isBackQuote(token) || + tokens[token].type === tt.dollarBraceL; } + // append the values between start and end function createTemplateValue(start, end) { var value = ""; while (start <= end) { @@ -97,6 +108,7 @@ function convertTemplateType(tokens) { return value; } + // create Template token function replaceWithTemplateType(start, end) { var templateToken = { type: 'Template', @@ -107,10 +119,12 @@ function convertTemplateType(tokens) { end: tokens[end].loc.end } } + + // put new token in place of old tokens tokens.splice(start, end - start + 1, templateToken); } - function checkNumBraces(token) { + function trackNumBraces(token) { if (tokens[token].type === tt.braceL) { numBraces++; } else if (tokens[token].type === tt.braceR) { @@ -119,18 +133,30 @@ function convertTemplateType(tokens) { } while (startingToken < tokens.length) { + // template start: check if ` or } if (isTemplateStarter(startingToken) && numBraces === 0) { currentToken = startingToken + 1; - while (currentToken < tokens.length - 1 && !isTemplateEnder(currentToken)) { - checkNumBraces(currentToken); + + // check if token after template start is "template" + if (currentToken >= tokens.length - 1 || tokens[currentToken].type !== tt.template) { + break; + } + + // template end: find ` or ${ + while (!isTemplateEnder(currentToken)) { + if (currentToken >= tokens.length - 1) { + break; + } currentToken++; } + + hasTemplateEnded = isBackQuote(currentToken); + // template start and end found: create new token replaceWithTemplateType(startingToken, currentToken); - startingToken++; - } else { - checkNumBraces(startingToken); - startingToken++; + } else if (!hasTemplateEnded) { + trackNumBraces(startingToken); } + startingToken++; } } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 123745f516ab..4c0d062d7e49 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -33,7 +33,12 @@ function assertImplementsAST(target, source, path) { function parseAndAssertSame(code) { var esAST = espree.parse(code, { + env: { + "es6": true, + "node": true + }, ecmaFeatures: { + blockBindings: true, templateStrings: true, modules: true, classes: true, @@ -103,6 +108,22 @@ describe("acorn-to-esprima", function () { it("template with nested function/object", function () { parseAndAssertSame("`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`"); }); + + it("template with braces inside and outside of template string #96", function () { + parseAndAssertSame("if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }"); + }); + + it("template also with braces #96", function () { + parseAndAssertSame( + "export default function f1() {" + + "function f2(foo) {" + + "const bar = 3;" + + "return `${foo} ${bar}`;" + + "}" + + "return f2;" + + "}" + ); + }); }); it("simple expression", function () { @@ -203,4 +224,20 @@ describe("acorn-to-esprima", function () { " */" ].join("\n")); }); + + it("null", function () { + parseAndAssertSame("null"); + }); + + it("boolean", function () { + parseAndAssertSame("if (true) {} else if (false) {}"); + }); + + it("regexp", function () { + parseAndAssertSame("/affix-top|affix-bottom|affix|[a-z]/"); + }); + + it("regexp in a template string", function () { + parseAndAssertSame("`${/\\d/.exec(\"1\")[0]}`"); + }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1ce55b05771d..d16b71a6249f 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -147,6 +147,4 @@ describe("verify", function () { [] ); }); - - }); From 5ba504f809571e69ee3ed7c1ab6e53c1709234e8 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 15 May 2015 20:55:56 +0100 Subject: [PATCH 315/965] 3.1.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5b760611fcdd..d097b68a6237 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.2", + "version": "3.1.3", "description": "", "main": "index.js", "repository": { From b699e4f2aa2685ff7c0a45540da6ac0ecb3b04cf Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 16 May 2015 23:17:03 +0100 Subject: [PATCH 316/965] add support for type cast expressions - fixes babel/babel-eslint#102 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 4 ++++ eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index ea6222e3eeaa..d43e96494e4e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -171,6 +171,10 @@ var astTransformVisitor = { delete node.argument; } + if (t.isTypeCastExpression(node)) { + return node.expression; + } + if (t.isFlow(node)) { return this.remove(); } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index d16b71a6249f..99d34fb2ea57 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -124,6 +124,14 @@ describe("verify", function () { ); }); + it("type cast expression", function () { + verifyAndAssertMessages( + "for (let a of (a: Array)) {}", + {}, + [] + ); + }); + it("class usage", function () { verifyAndAssertMessages( "class Lol {} module.exports = Lol;", From 54adf244ddf65ecc2c208c0f18aff6604dcf3f79 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Sat, 16 May 2015 23:17:12 +0100 Subject: [PATCH 317/965] 3.1.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d097b68a6237..b9d69b54f6f5 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.3", + "version": "3.1.4", "description": "", "main": "index.js", "repository": { From 82f3fe41475bc380d75b0e1223eef1f6411ddfbc Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 16 May 2015 23:22:53 -0400 Subject: [PATCH 318/965] Merge pull request babel/babel-eslint#101 from hzoo/more-jsx add JSXText type, more tests --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 ++ eslint/babel-eslint-parser/test/babel-eslint.js | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index d43e96494e4e..13451af130dd 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -34,6 +34,8 @@ exports.toToken = function (token) { token.value = ">"; } else if (type === tt.jsxName) { token.type = "JSXIdentifier"; + } else if (type === tt.jsxText) { + token.type = "JSXText"; } else if (type.keyword === "null") { token.type = "Null"; } else if (type.keyword === "false" || type.keyword === "true") { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 4c0d062d7e49..40a9fc84e015 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -154,6 +154,22 @@ describe("acorn-to-esprima", function () { parseAndAssertSame(""); }); + it("jsx expression with spread", function () { + parseAndAssertSame("var myDivElement =
;"); + }); + + it("empty jsx text", function () { + parseAndAssertSame(""); + }); + + it("jsx text with content", function () { + parseAndAssertSame("Hello, world!"); + }); + + it("nested jsx", function () { + parseAndAssertSame("
\n

Wat

\n
"); + }); + it("default import", function () { parseAndAssertSame('import foo from "foo";'); }); From 47a771a7b121587b73c3efeebb22b184a2ae0ce3 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 16 May 2015 23:23:28 -0400 Subject: [PATCH 319/965] Merge pull request babel/babel-eslint#100 from babel/es7.functionBind add ES7 function bind (::) as Punctuator --- eslint/babel-eslint-parser/acorn-to-esprima.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 13451af130dd..995ca2ae5d56 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -23,6 +23,7 @@ exports.toToken = function (token) { type === tt.relational || type === tt.bitShift || type === tt.plusMin || type === tt.modulo || type === tt.exponent || type === tt.prefix || + type === tt.doubleColon || type.isAssign) { token.type = "Punctuator"; if (!token.value) token.value = type.label; From 7fa06fa56692eeca0fbd1e93d6b01c861770ee92 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 16 May 2015 23:26:48 -0400 Subject: [PATCH 320/965] add test for babel/babel-eslint#66 --- eslint/babel-eslint-parser/test/non-regression.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 99d34fb2ea57..ba62ccf05014 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -124,7 +124,15 @@ describe("verify", function () { ); }); - it("type cast expression", function () { + it("flow type", function () { + verifyAndAssertMessages( + "type SomeNewType = any;", + {}, + [] + ); + }); + + it("type cast expression #102", function () { verifyAndAssertMessages( "for (let a of (a: Array)) {}", {}, From a5f9a8fea0375f5f77945ff3f1ee8843b3067daf Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 17 May 2015 17:13:40 -0400 Subject: [PATCH 321/965] 3.1.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b9d69b54f6f5..8279cb2a7fa8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.4", + "version": "3.1.5", "description": "", "main": "index.js", "repository": { From 80114dda35af218830e642318dcc872c4aeb5b0b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 20 May 2015 18:14:18 -0400 Subject: [PATCH 322/965] Merge pull request babel/babel-eslint#107 from hzoo/update-eslint eslint@0.21.2 --- eslint/babel-eslint-parser/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8279cb2a7fa8..f697dae86ab9 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "babel-core": "^5.1.8", + "eslint": "^0.21.2", "lodash.assign": "^3.0.0" }, "scripts": { From 0e50a0b6e001826c30c01a87e61118c475fc5184 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 20 May 2015 19:03:56 -0400 Subject: [PATCH 323/965] Merge pull request babel/babel-eslint#105 from hzoo/visit-decorators patch escope to visit decorators - fixes babel/babel-eslint#72 --- eslint/babel-eslint-parser/index.js | 35 +++++++ .../test/non-regression.js | 94 ++++++++++++++++++- 2 files changed, 128 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 2002b68fd971..613d1fc72d0b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -54,6 +54,41 @@ function monkeypatch() { estraverse.VisitorKeys.TypeAlias = TypeAliasKeys; return results; }; + + // monkeypatch escope/referencer + var referencerLoc; + try { + var referencerLoc = Module._resolveFilename("./referencer", escopeMod); + } catch (err) { + throw new ReferenceError("couldn't resolve escope/referencer"); + } + var referencer = require(referencerLoc); + + // if there are decotators, then visit each + function visitDecorators(node) { + if (!node.decorators) { + return; + } + for (var i = 0; i < node.decorators.length; i++) { + if (node.decorators[i].expression) { + this.visit(node.decorators[i]); + } + } + } + + // monkeypatch referencer methods to visit decorators + var visitClass = referencer.prototype.visitClass; + referencer.prototype.visitClass = function (node) { + // visit decorators that are in: Class Declaration + visitDecorators.call(this, node); + visitClass.call(this, node); + } + var visitProperty = referencer.prototype.visitProperty; + referencer.prototype.visitProperty = function (node) { + // visit decorators that are in: Visit Property / MethodDefinition + visitDecorators.call(this, node); + visitProperty.call(this, node); + } } exports.attachComments = function (ast, comments, tokens) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index ba62ccf05014..3cb0222a5be1 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -55,7 +55,7 @@ describe("verify", function () { verifyAndAssertMessages( "import Foo from 'foo';\n" + "export default Foo;", - { }, + {}, [] ); }); @@ -163,4 +163,96 @@ describe("verify", function () { [] ); }); + + describe("decorators #72", function () { + it("class declaration", function () { + verifyAndAssertMessages( + [ + "import classDeclaration from 'decorator';", + "import decoratorParameter from 'decorator';", + "@classDeclaration(decoratorParameter)", + "@classDeclaration", + "class TextareaAutosize {}" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + + it("method definition", function () { + verifyAndAssertMessages( + [ + "import classMethodDeclarationA from 'decorator';", + "import decoratorParameter from 'decorator';", + "class TextareaAutosize {", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "methodDeclaration(e) {", + "e();", + "}", + "}" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + + it("method definition get/set", function () { + verifyAndAssertMessages( + [ + "import classMethodDeclarationA from 'decorator';", + "import decoratorParameter from 'decorator';", + "class TextareaAutosize {", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "get bar() { }", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "set bar() { }", + "}" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + + it("object property", function () { + verifyAndAssertMessages( + [ + "import classMethodDeclarationA from 'decorator';", + "import decoratorParameter from 'decorator';", + "var obj = {", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "methodDeclaration(e) {", + "e();", + "}", + "};", + "obj;" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + + it("object property get/set", function () { + verifyAndAssertMessages( + [ + "import classMethodDeclarationA from 'decorator';", + "import decoratorParameter from 'decorator';", + "var obj = {", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "get bar() { },", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "set bar() { }", + "};", + "obj;" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + }); }); From 1230588b988d57d28dec29df220b1842f8c4abe6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 20 May 2015 19:06:06 -0400 Subject: [PATCH 324/965] 3.1.6 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f697dae86ab9..83bd276269e7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.5", + "version": "3.1.6", "description": "", "main": "index.js", "repository": { From 48c23ad8ef2850a1e546de99720a25361930e776 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 21 May 2015 06:51:17 -0400 Subject: [PATCH 325/965] remove from dependency (update devDependency --- eslint/babel-eslint-parser/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 83bd276269e7..59882e43f93b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -9,7 +9,6 @@ }, "dependencies": { "babel-core": "^5.1.8", - "eslint": "^0.21.2", "lodash.assign": "^3.0.0" }, "scripts": { @@ -22,7 +21,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.18.0", + "eslint": "^0.21.2", "espree": "^2.0.0", "mocha": "^2.1.0" } From 573020678aaa323216ff7df3a50a7b4fba633eeb Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 21 May 2015 06:51:52 -0400 Subject: [PATCH 326/965] 3.1.7 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 59882e43f93b..c99b12b008fc 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.6", + "version": "3.1.7", "description": "", "main": "index.js", "repository": { From 9cc077638a5801bfa863d6c1d1aad9189af4abfb Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 21 May 2015 07:46:01 -0400 Subject: [PATCH 327/965] add all espree ecmaFeatures, fixes babel/babel-eslint#31 again --- .../babel-eslint-parser/acorn-to-esprima.js | 17 ++++++--- .../babel-eslint-parser/test/babel-eslint.js | 36 +++++++++++++++---- .../test/non-regression.js | 13 +++++++ 3 files changed, 56 insertions(+), 10 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 995ca2ae5d56..8a26e10db5ef 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -80,8 +80,10 @@ function isCompatTag(tagName) { function convertTemplateType(tokens) { var startingToken = 0; var currentToken = 0; + // track use of {} var numBraces = 0; - var hasTemplateEnded = true; + // track number of nested templates + var numBackQuotes = 0; function isBackQuote(token) { return tokens[token].type === tt.backQuote; @@ -89,7 +91,8 @@ function convertTemplateType(tokens) { function isTemplateStarter(token) { return isBackQuote(token) || - tokens[token].type === tt.braceR; + // only can be a template starter when in a template already + tokens[token].type === tt.braceR && numBackQuotes > 0; } function isTemplateEnder(token) { @@ -138,6 +141,10 @@ function convertTemplateType(tokens) { while (startingToken < tokens.length) { // template start: check if ` or } if (isTemplateStarter(startingToken) && numBraces === 0) { + if (isBackQuote(startingToken)) { + numBackQuotes++; + } + currentToken = startingToken + 1; // check if token after template start is "template" @@ -153,10 +160,12 @@ function convertTemplateType(tokens) { currentToken++; } - hasTemplateEnded = isBackQuote(currentToken); + if (isBackQuote(currentToken)) { + numBackQuotes--; + } // template start and end found: create new token replaceWithTemplateType(startingToken, currentToken); - } else if (!hasTemplateEnded) { + } else if (numBackQuotes > 0) { trackNumBraces(startingToken); } startingToken++; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 40a9fc84e015..64260de8153f 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -33,16 +33,29 @@ function assertImplementsAST(target, source, path) { function parseAndAssertSame(code) { var esAST = espree.parse(code, { - env: { - "es6": true, - "node": true - }, ecmaFeatures: { + arrowFunctions: true, blockBindings: true, + destructuring: true, + regexYFlag: true, + regexUFlag: true, templateStrings: true, - modules: true, + binaryLiterals: true, + octalLiterals: true, + unicodeCodePointEscapes: true, + defaultParams: true, + restParams: true, + forOf: true, + objectLiteralComputedProperties: true, + objectLiteralShorthandMethods: true, + objectLiteralShorthandProperties: true, + objectLiteralDuplicateProperties: true, + generators: true, + spread: true, classes: true, - jsx: true + modules: true, + jsx: true, + globalReturn: true }, tokens: true, loc: true, @@ -124,6 +137,17 @@ describe("acorn-to-esprima", function () { "}" ); }); + + it("template with destructuring #31", function () { + parseAndAssertSame([ + "module.exports = {", + "render() {", + "var {name} = this.props;", + "return Math.max(null, `Name: ${name}, Name: ${name}`);", + "}", + "};" + ].join("\n")); + }); }); it("simple expression", function () { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3cb0222a5be1..1b2a2a8a30b6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -164,6 +164,19 @@ describe("verify", function () { ); }); + it("template with destructuring #31", function () { + verifyAndAssertMessages([ + "module.exports = {", + "render() {", + "var {name} = this.props;", + "return Math.max(null, `Name: ${name}, Name: ${name}`);", + "}", + "};"].join("\n"), + { "comma-spacing": 1 }, + [] + ); + }); + describe("decorators #72", function () { it("class declaration", function () { verifyAndAssertMessages( From b845304ce21aa55d9c7c670eb40de37efa0b624a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 22 May 2015 21:04:00 -0400 Subject: [PATCH 328/965] update readme about issues/jsx --- eslint/babel-eslint-parser/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 45c7852b1e33..808db61daf28 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -6,6 +6,8 @@ **NOTE:** Please note that this is experimental and may have numerous bugs. It is however successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). +If there's an issue, check if it can be reproduced with the regular parser and with the latest versions of `eslint` and `babel-eslint`. For issues related to JSX, see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! + ## How does it work? ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports From 813ede0cd5b5d93caf6419c44c5cb484dd2e420c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 22 May 2015 21:05:00 -0400 Subject: [PATCH 329/965] 3.1.8 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c99b12b008fc..d8366933b70a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.7", + "version": "3.1.8", "description": "", "main": "index.js", "repository": { From 7f0ce79fae3424a68a0bb58f873d2388913f7e7c Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 25 May 2015 05:48:08 +0100 Subject: [PATCH 330/965] Merge pull request babel/babel-eslint#113 from babel/paths Use Path-based introspection methods rather than node-based --- .../babel-eslint-parser/acorn-to-esprima.js | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 8a26e10db5ef..d8ac33df9237 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -175,7 +175,7 @@ function convertTemplateType(tokens) { var astTransformVisitor = { noScope: true, exit: function (node, parent) { - if (t.isSpreadProperty(node)) { + if (this.isSpreadProperty()) { node.type = "Property"; node.kind = "init"; node.computed = true; @@ -183,50 +183,51 @@ var astTransformVisitor = { delete node.argument; } - if (t.isTypeCastExpression(node)) { + if (this.isTypeCastExpression()) { return node.expression; } - if (t.isFlow(node)) { + if (this.isFlow()) { return this.remove(); } - if (t.isRestElement(node)) { + if (this.isRestElement()) { return node.argument; } // modules - if (t.isImportDeclaration(node)) { + if (this.isImportDeclaration()) { delete node.isType; } - if (t.isExportDeclaration(node)) { - if (t.isClassExpression(node.declaration)) { + if (this.isExportDeclaration(node)) { + var declar = this.get("declaration"); + if (declar.isClassExpression()) { node.declaration.type = "ClassDeclaration"; - } else if (t.isFunctionExpression(node.declaration)) { + } else if (declar.isFunctionExpression()) { node.declaration.type = "FunctionDeclaration"; } } // classes - if (t.isReferencedIdentifier(node, parent, { name: "super" })) { + if (this.isReferencedIdentifier({ name: "super" })) { return t.inherits(t.thisExpression(), node); } - if (t.isClassProperty(node)) { + if (this.isClassProperty()) { delete node.key; } // functions - if (t.isFunction(node)) { + if (this.isFunction()) { if (node.async) node.generator = true; delete node.async; } - if (t.isAwaitExpression(node)) { + if (this.isAwaitExpression()) { node.type = "YieldExpression"; node.delegate = node.all; delete node.all; @@ -234,7 +235,7 @@ var astTransformVisitor = { // template strings - if (t.isTemplateLiteral(node)) { + if (this.isTemplateLiteral()) { node.quasis.forEach(function (q) { q.range[0] -= 1; if (q.tail) { From b95ea1092ea331eb47751a61a21ce5beec0ce5ac Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 25 May 2015 05:48:21 +0100 Subject: [PATCH 331/965] 3.1.9 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d8366933b70a..95d6c347d7ab 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.8", + "version": "3.1.9", "description": "", "main": "index.js", "repository": { From 866a77a8cc253c0d7a155db19e3e0959449092a0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Jun 2015 21:14:33 -0400 Subject: [PATCH 332/965] Merge pull request babel/babel-eslint#117 from hzoo/eslint-0.22.1 update to eslint@0.22.1 --- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 95d6c347d7ab..8aa2a8e07cd0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -21,7 +21,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.21.2", + "eslint": "^0.22.1", "espree": "^2.0.0", "mocha": "^2.1.0" } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1b2a2a8a30b6..57c80ad95381 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -185,7 +185,7 @@ describe("verify", function () { "import decoratorParameter from 'decorator';", "@classDeclaration(decoratorParameter)", "@classDeclaration", - "class TextareaAutosize {}" + "export class TextareaAutosize {}" ].join("\n"), { "no-unused-vars": 1 }, [] @@ -197,7 +197,7 @@ describe("verify", function () { [ "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", - "class TextareaAutosize {", + "export class TextareaAutosize {", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "methodDeclaration(e) {", @@ -215,7 +215,7 @@ describe("verify", function () { [ "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", - "class TextareaAutosize {", + "export class TextareaAutosize {", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "get bar() { }", From a4f6edab857d386a1f1469b296755b2e389253d4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Jun 2015 21:16:02 -0400 Subject: [PATCH 333/965] Merge pull request babel/babel-eslint#109 from hzoo/i-108 visit flow types - fixes babel/babel-eslint#108 --- .../babel-eslint-parser/acorn-to-esprima.js | 33 +- eslint/babel-eslint-parser/index.js | 192 ++++- eslint/babel-eslint-parser/package.json | 3 +- .../test/non-regression.js | 763 +++++++++++++++++- 4 files changed, 959 insertions(+), 32 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index d8ac33df9237..324758fd1e76 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -117,7 +117,7 @@ function convertTemplateType(tokens) { // create Template token function replaceWithTemplateType(start, end) { var templateToken = { - type: 'Template', + type: "Template", value: createTemplateValue(start, end), range: [tokens[start].start, tokens[end].end], loc: { @@ -183,16 +183,35 @@ var astTransformVisitor = { delete node.argument; } - if (this.isTypeCastExpression()) { - return node.expression; + if (this.isRestElement()) { + return node.argument; } - if (this.isFlow()) { - return this.remove(); + // prevent "no-undef" + // for "Component" in: "let x: React.Component" + if (this.isQualifiedTypeIdentifier()) { + delete node.id; + } + // for "b" in: "var a: { b: Foo }" + if (this.isObjectTypeProperty()) { + delete node.key; + } + // for "indexer" in: "var a: {[indexer: string]: number}" + if (this.isObjectTypeIndexer()) { + delete node.id; + } + // for "param" in: "var a: { func(param: Foo): Bar };" + if (this.isFunctionTypeParam()) { + delete node.name; } - if (this.isRestElement()) { - return node.argument; + // flow + + if (this.isDeclareModule() || + this.isDeclareClass() || + this.isDeclareFunction() || + this.isDeclareVariable()) { + return this.remove(); } // modules diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 613d1fc72d0b..0977fd421ac1 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,6 +1,7 @@ var acornToEsprima = require("./acorn-to-esprima"); var traverse = require("babel-core").traverse; var assign = require("lodash.assign"); +var pick = require("lodash.pick"); var Module = require("module"); var parse = require("babel-core").parse; var path = require("path"); @@ -46,12 +47,7 @@ function monkeypatch() { escope.analyze = function (ast, opts) { opts.ecmaVersion = 6; opts.sourceType = "module"; - // Don't visit TypeAlias when analyzing scope, but retain them for other - // eslint rules. - var TypeAliasKeys = estraverse.VisitorKeys.TypeAlias; - estraverse.VisitorKeys.TypeAlias = []; var results = analyze.call(this, ast, opts); - estraverse.VisitorKeys.TypeAlias = TypeAliasKeys; return results; }; @@ -62,8 +58,18 @@ function monkeypatch() { } catch (err) { throw new ReferenceError("couldn't resolve escope/referencer"); } + var referencerMod = createModule(referencerLoc); var referencer = require(referencerLoc); + // reference Definition + var definitionLoc; + try { + var definitionLoc = Module._resolveFilename("./definition", referencerMod); + } catch (err) { + throw new ReferenceError("couldn't resolve escope/definition"); + } + var Definition = require(definitionLoc).Definition; + // if there are decotators, then visit each function visitDecorators(node) { if (!node.decorators) { @@ -76,18 +82,182 @@ function monkeypatch() { } } - // monkeypatch referencer methods to visit decorators + // iterate through part of t.VISITOR_KEYS + var visitorKeysMap = pick(t.VISITOR_KEYS, function(k) { + return t.FLIPPED_ALIAS_KEYS.Flow.concat([ + "ArrayPattern", + "ClassDeclaration", + "ClassExpression", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "ObjectPattern", + "RestElement" + ]).indexOf(k) === -1; + }); + + var propertyTypes = { + // loops + callProperties: { type: "loop", values: ["value"] }, + indexers: { type: "loop", values: ["key", "value"] }, + properties: { type: "loop", values: ["value"] }, + types: { type: "loop" }, + params: { type: "loop" }, + // single property + argument: { type: "single" }, + elementType: { type: "single" }, + qualification: { type: "single" }, + rest: { type: "single" }, + returnType: { type: "single" }, + // others + typeAnnotation: { type: "typeAnnotation" }, + typeParameters: { type: "typeParameters" }, + id: { type: "id" } + }; + + function visitTypeAnnotation(node) { + // get property to check (params, id, etc...) + var visitorValues = visitorKeysMap[node.type]; + if (!visitorValues) { + return; + } + + // can have multiple properties + for (var i = 0; i < visitorValues.length; i++) { + var visitorValue = visitorValues[i]; + var propertyType = propertyTypes[visitorValue]; + var nodeProperty = node[visitorValue]; + // check if property or type is defined + if (propertyType == null || nodeProperty == null) { + continue; + } + if (propertyType.type === "loop") { + for (var j = 0; j < nodeProperty.length; j++) { + if (Array.isArray(propertyType.values)) { + for (var k = 0; k < propertyType.values.length; k++) { + checkIdentifierOrVisit.call(this, nodeProperty[j][propertyType.values[k]]); + } + } else { + checkIdentifierOrVisit.call(this, nodeProperty[j]); + } + } + } else if (propertyType.type === "single") { + checkIdentifierOrVisit.call(this, nodeProperty); + } else if (propertyType.type === "typeAnnotation") { + visitTypeAnnotation.call(this, node.typeAnnotation); + } else if (propertyType.type === "typeParameters") { + for (var j = 0; j < node.typeParameters.params.length; j++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); + } + } else if (propertyType.type === "id") { + if (node.id.type === "Identifier") { + checkIdentifierOrVisit.call(this, node.id); + } else { + visitTypeAnnotation.call(this, node.id); + } + } + } + } + + function checkIdentifierOrVisit(node) { + if (node.typeAnnotation) { + visitTypeAnnotation.call(this, node.typeAnnotation); + } else if (node.type === "Identifier") { + this.visit(node); + } else { + visitTypeAnnotation.call(this, node); + } + } + + // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; - referencer.prototype.visitClass = function (node) { - // visit decorators that are in: Class Declaration + referencer.prototype.visitClass = function(node) { visitDecorators.call(this, node); + // visit class + if (node.id) { + this.visit(node.id); + } + // visit flow type: ClassImplements + if (node.implements) { + for (var i = 0; i < node.implements.length; i++) { + checkIdentifierOrVisit.call(this, node.implements[i]); + } + } + if (node.typeParameters) { + for (var i = 0; i < node.typeParameters.params.length; i++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); + } + } + if (node.superTypeParameters) { + for (var i = 0; i < node.superTypeParameters.params.length; i++) { + checkIdentifierOrVisit.call(this, node.superTypeParameters.params[i]); + } + } visitClass.call(this, node); - } + }; + // visit decorators that are in: Property / MethodDefinition var visitProperty = referencer.prototype.visitProperty; - referencer.prototype.visitProperty = function (node) { - // visit decorators that are in: Visit Property / MethodDefinition + referencer.prototype.visitProperty = function(node) { + if (node.value.type === 'TypeCastExpression') { + visitTypeAnnotation.call(this, node.value); + } visitDecorators.call(this, node); visitProperty.call(this, node); + }; + + // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression + var visitFunction = referencer.prototype.visitFunction; + referencer.prototype.visitFunction = function(node) { + if (node.returnType) { + checkIdentifierOrVisit.call(this, node.returnType); + } + // only visit if function parameters have types + if (node.params) { + for (var i = 0; i < node.params.length; i++) { + if (node.params[i].typeAnnotation) { + checkIdentifierOrVisit.call(this, node.params[i]); + } + } + } + if (node.typeParameters) { + for (var i = 0; i < node.typeParameters.params.length; i++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); + } + } + visitFunction.call(this, node); + }; + + // visit flow type in VariableDeclaration + var variableDeclaration = referencer.prototype.VariableDeclaration; + referencer.prototype.VariableDeclaration = function(node) { + if (node.declarations) { + for (var i = 0; i < node.declarations.length; i++) { + checkIdentifierOrVisit.call(this, node.declarations[i].id); + } + } + variableDeclaration.call(this, node); + }; + + referencer.prototype.TypeAlias = function(node) { + this.currentScope().__define( + node.id, + new Definition( + "Variable", + node.id, + node, + null, + null, + null + ) + ); + if (node.right) { + visitTypeAnnotation.call(this, node.right); + } + if (node.typeParameters) { + for (var i = 0; i < node.typeParameters.params.length; i++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); + } + } } } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8aa2a8e07cd0..f1b3880106cb 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -9,7 +9,8 @@ }, "dependencies": { "babel-core": "^5.1.8", - "lodash.assign": "^3.0.0" + "lodash.assign": "^3.0.0", + "lodash.pick": "^3.1.0" }, "scripts": { "test": "mocha" diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 57c80ad95381..9b0b783d337a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -124,20 +124,757 @@ describe("verify", function () { ); }); - it("flow type", function () { - verifyAndAssertMessages( - "type SomeNewType = any;", - {}, - [] - ); - }); + describe("flow", function () { + it("check regular function", function () { + verifyAndAssertMessages([ + "function a(b, c) { b += 1; c += 1; } a;", + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); - it("type cast expression #102", function () { - verifyAndAssertMessages( - "for (let a of (a: Array)) {}", - {}, - [] - ); + it("type alias", function () { + verifyAndAssertMessages( + "type SomeNewType = any;", + { "no-undef": 1 }, + [] + ); + }); + + it("type cast expression #102", function () { + verifyAndAssertMessages( + "for (let a of (a: Array)) {}", + {}, + [] + ); + }); + + it("multiple nullable type annotations and return #108", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "function log(foo: ?Foo, foo2: ?Foo2): ?Foo3 {", + "console.log(foo, foo2);", + "}", + "log(1, 2);" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("type parameters", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "function log() {}", + "log();" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("nested type annotations", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "function foo(callback: () => Foo) {", + "return callback();", + "}", + "foo();" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("type in var declaration", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "var x: Foo = 1;", + "x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("object type annotation", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "var a: {numVal: Foo};", + "a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("object property types", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a = {", + "circle: (null : ?{ setNativeProps(props: Foo): Foo2 })", + "};", + "a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("namespaced types", function () { + verifyAndAssertMessages([ + "var React = require('react-native');", + "var b = {", + "openExternalExample: (null: ?React.Component)", + "};", + "var c = {", + "render(): React.Component {}", + "};", + "b;", + "c;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("ArrayTypeAnnotation", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "var x: Foo[]; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("ClassImplements", function () { + verifyAndAssertMessages([ + "import type Foo from 'foo';", + "import type Bar from 'foo';", + "class Foo implements Bar {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("type alias creates declaration + usage", function () { + verifyAndAssertMessages([ + "type Foo = any;", + "var x : Foo = 1; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("type alias with type parameters", function () { + verifyAndAssertMessages([ + "import type Bar from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "type Foo = Bar", + "var x : Foo = 1; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("export type alias", function () { + verifyAndAssertMessages([ + "import type Foo2 from 'foo';", + "export type Foo = Foo2;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("1", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "export default function(a: Foo, b: ?Foo2, c){ a; b; c; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("2", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "export default function(a: () => Foo){ a; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("3", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "export default function(a: (_:Foo) => Foo2){ a; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("4", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "export default function(a: (_1:Foo, _2:Foo2) => Foo3){ a; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("5", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "export default function(a: (_1:Foo, ...foo:Array) => number){ a; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("6", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "export default function(): Foo {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("7", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "export default function():() => Foo {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("8", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "export default function():(_?:Foo) => Foo2{}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("9", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "export default function () {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }) + + it("10", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a=function() {}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("11", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a={*id(x: Foo2): Foo3 { x; }}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("12", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a={async id(x: Foo2): Foo3 { x; }}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("13", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a={123(x: Foo2): Foo3 { x; }}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("14", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "class Bar {set fooProp(value:Foo):Foo2{ value; }}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("15", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "class Foo {get fooProp():Foo{}}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("16", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var numVal:Foo; numVal;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("17", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: {numVal: Foo;}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("18", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a: ?{numVal: Foo; [indexer: Foo2]: Foo3}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("19", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a: {numVal: Foo; subObj?: ?{strVal: Foo2}}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("20", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "import type Foo4 from 'foo';", + "var a: { [a: Foo]: Foo2; [b: Foo3]: Foo4; }; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("21", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a: {add(x:Foo, ...y:Array): Foo3}; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("22", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a: { id(x: Foo2): Foo3; }; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("23", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a:Array = [1, 2, 3]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("24", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import Baz from 'foo';", + "class Bar extends Baz { };" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("25", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "class Bar { bar():Foo3 { return 42; }}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("26", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "class Bar { static prop1:Foo; prop2:Foo2; }" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("27", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var x : Foo | Foo2 = 4; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("28", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var x : () => Foo | () => Foo2; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("29", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var x: typeof Foo | number = Foo2; x;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("30", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + 'var {x}: {x: Foo; } = { x: "hello" }; x;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("31", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + 'var [x]: Array = [ "hello" ]; x;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("32", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "export default function({x}: { x: Foo; }) {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("33", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "function foo([x]: Array) { x; } foo();" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("34", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a: Map >; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("35", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: ?Promise[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("36", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a:(...rest:Array) => Foo2; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("37", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "import type Foo4 from 'foo';", + "var a: (x: Foo2, ...y:Foo3[]) => Foo4; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("38", function () { + verifyAndAssertMessages( + [ + 'import type {foo, bar} from "baz";', + 'foo; bar;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("39", function () { + verifyAndAssertMessages( + [ + 'import type {foo as bar} from "baz";', + 'bar;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("40", function () { + verifyAndAssertMessages( + [ + 'import type from "foo";', + 'type;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("41", function () { + verifyAndAssertMessages( + [ + 'import type, {foo} from "bar";', + 'type; foo;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("42", function () { + verifyAndAssertMessages( + [ + 'import type * as namespace from "bar";', + 'namespace;' + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("43", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: Foo[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("44", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: ?Foo[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("45", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: (?Foo)[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("46", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: () => Foo[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("47", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: (() => Foo)[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("48", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "var a: typeof Foo[]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("49", function () { + verifyAndAssertMessages( + [ + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "var a : [Foo, Foo2,] = [123, 'duck',]; a;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); }); it("class usage", function () { From e6ba27075e33aa0fcf96edc51f509b886f02034b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Jun 2015 21:18:54 -0400 Subject: [PATCH 334/965] 3.1.10 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f1b3880106cb..37d3f2e1b886 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.9", + "version": "3.1.10", "description": "", "main": "index.js", "repository": { From ade0b3b21b152c991880b0a0c109d9a162d61f96 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 3 Jun 2015 17:06:42 -0400 Subject: [PATCH 335/965] Merge pull request babel/babel-eslint#114 from hzoo/i-9 support comprehensions (no-undef) - fixes babel/babel-eslint#9 --- eslint/babel-eslint-parser/index.js | 45 ++++++++---- .../test/non-regression.js | 73 +++++++++++++++++-- 2 files changed, 96 insertions(+), 22 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 0977fd421ac1..cd28c765455c 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -173,10 +173,6 @@ function monkeypatch() { var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { visitDecorators.call(this, node); - // visit class - if (node.id) { - this.visit(node.id); - } // visit flow type: ClassImplements if (node.implements) { for (var i = 0; i < node.implements.length; i++) { @@ -198,7 +194,7 @@ function monkeypatch() { // visit decorators that are in: Property / MethodDefinition var visitProperty = referencer.prototype.visitProperty; referencer.prototype.visitProperty = function(node) { - if (node.value.type === 'TypeCastExpression') { + if (node.value.type === "TypeCastExpression") { visitTypeAnnotation.call(this, node.value); } visitDecorators.call(this, node); @@ -238,18 +234,21 @@ function monkeypatch() { variableDeclaration.call(this, node); }; - referencer.prototype.TypeAlias = function(node) { - this.currentScope().__define( - node.id, + function createScopeVariable (node, name) { + this.currentScope().variableScope.__define(name, new Definition( - "Variable", - node.id, - node, - null, - null, - null + "Variable", + name, + node, + null, + null, + null ) ); + } + + referencer.prototype.TypeAlias = function(node) { + createScopeVariable.call(this, node, node.id); if (node.right) { visitTypeAnnotation.call(this, node.right); } @@ -259,6 +258,24 @@ function monkeypatch() { } } } + + referencer.prototype.ComprehensionBlock = function(node) { + var left = node.left; + if (left) { + if (left.type === "Identifier") { + createScopeVariable.call(this, node, left); + } else if (left.type === "ArrayPattern") { + for (var i = 0; i < left.elements.length; i++) { + if (left.elements[i]) { + createScopeVariable.call(this, left.elements, left.elements[i]); + } + } + } + } + if (node.right) { + this.visit(node.right); + } + } } exports.attachComments = function (ast, comments, tokens) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 9b0b783d337a..2a837f779c2e 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -255,9 +255,8 @@ describe("verify", function () { it("ClassImplements", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", "import type Bar from 'foo';", - "class Foo implements Bar {}" + "export default class Foo implements Bar {}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -459,7 +458,7 @@ describe("verify", function () { [ "import type Foo from 'foo';", "import type Foo2 from 'foo';", - "class Bar {set fooProp(value:Foo):Foo2{ value; }}" + "export default class Bar {set fooProp(value:Foo):Foo2{ value; }}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -469,8 +468,8 @@ describe("verify", function () { it("15", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "class Foo {get fooProp():Foo{}}" + "import type Foo2 from 'foo';", + "export default class Foo {get fooProp(): Foo2{}}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -581,7 +580,7 @@ describe("verify", function () { "import type Foo from 'foo';", "import type Foo2 from 'foo';", "import Baz from 'foo';", - "class Bar extends Baz { };" + "export default class Bar extends Baz { };" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -594,7 +593,7 @@ describe("verify", function () { "import type Foo from 'foo';", "import type Foo2 from 'foo';", "import type Foo3 from 'foo';", - "class Bar { bar():Foo3 { return 42; }}" + "export default class Bar { bar():Foo3 { return 42; }}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -606,7 +605,7 @@ describe("verify", function () { [ "import type Foo from 'foo';", "import type Foo2 from 'foo';", - "class Bar { static prop1:Foo; prop2:Foo2; }" + "export default class Bar { static prop1:Foo; prop2:Foo2; }" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -885,6 +884,19 @@ describe("verify", function () { ); }); + it("class definition: gaearon/redux#24", function () { + verifyAndAssertMessages([ + "export default function root(stores) {", + "return DecoratedComponent => class ReduxRootDecorator {", + "a() { DecoratedComponent; }", + "};", + "}", + ].join("\n"), + { "no-undef": 1, "no-unused-vars": 1 }, + [] + ); + }); + it("class properties", function () { verifyAndAssertMessages( "class Lol { foo = 'bar'; }", @@ -914,6 +926,51 @@ describe("verify", function () { ); }); + describe("comprehensions", function () { + it("array #9", function () { + verifyAndAssertMessages([ + "let arr = [1, 2, 3];", + "let b = [for (e of arr) String(e)];" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("array, if statement, multiple blocks", function () { + verifyAndAssertMessages([ + "let arr = [1, 2, 3];", + "let arr2 = [1, 2, 3];", + "[for (x of arr) for (y of arr2) if (x === true && y === true) x + y];" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("expression, if statement, multiple blocks", function () { + verifyAndAssertMessages([ + "let arr = [1, 2, 3];", + "let arr2 = [1, 2, 3];", + "(for (x of arr) for (y of arr2) if (x === true && y === true) x + y)" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("ArrayPattern", function () { + verifyAndAssertMessages([ + "let arr = [1, 2, 3];", + "let arr2 = [1, 2, 3];", + "[for ([,x] of arr) for ({[start.x]: x, [start.y]: y} of arr2) x]" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + }); + describe("decorators #72", function () { it("class declaration", function () { verifyAndAssertMessages( From 6a2938deaaceb730e04b6ba9526bb5e48d4396d0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 3 Jun 2015 17:11:28 -0400 Subject: [PATCH 336/965] Merge pull request babel/babel-eslint#118 from hzoo/poly-types add flow exceptions for polymorphic types () - Ref babel/babel-eslint#109 --- eslint/babel-eslint-parser/index.js | 4 ++++ .../test/non-regression.js | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index cd28c765455c..3c764c99f8e3 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -163,6 +163,10 @@ function monkeypatch() { if (node.typeAnnotation) { visitTypeAnnotation.call(this, node.typeAnnotation); } else if (node.type === "Identifier") { + // exception for polymorphic types: , , etc + if (node.name.length === 1 && node.name === node.name.toUpperCase()) { + return; + } this.visit(node); } else { visitTypeAnnotation.call(this, node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 2a837f779c2e..598498afab5c 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -296,6 +296,26 @@ describe("verify", function () { ); }); + it("polymorphpic types #109", function () { + verifyAndAssertMessages([ + "export default function groupByEveryN(array: Array, n: number): Array> {}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("types definition from import", function () { + verifyAndAssertMessages([ + "import type Promise from 'bluebird';", + "type Operation = () => Promise;", + "x: Operation;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + it("1", function () { verifyAndAssertMessages( [ From 6bcdfb11cc7bc7faf144d975a5aeac352eed48ab Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 3 Jun 2015 17:13:06 -0400 Subject: [PATCH 337/965] 3.1.11 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 37d3f2e1b886..44ba9b9bd04c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.10", + "version": "3.1.11", "description": "", "main": "index.js", "repository": { From b10c9b035735bab8f7fef71dbc1cb24d5886d3e1 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 5 Jun 2015 10:00:15 +0100 Subject: [PATCH 338/965] update to babel 5.5.1 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 +- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 324758fd1e76..81b79aa82f5b 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -211,7 +211,7 @@ var astTransformVisitor = { this.isDeclareClass() || this.isDeclareFunction() || this.isDeclareVariable()) { - return this.remove(); + return this.dangerouslyRemove(); } // modules diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 44ba9b9bd04c..16d0c58b44f9 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.1.8", + "babel-core": "^5.5.1", "lodash.assign": "^3.0.0", "lodash.pick": "^3.1.0" }, From 8d3a7244c311b3e1bf021d704114f4085e90e13d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 5 Jun 2015 10:00:26 +0100 Subject: [PATCH 339/965] 3.1.12 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 16d0c58b44f9..1d757d42b9e8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.11", + "version": "3.1.12", "description": "", "main": "index.js", "repository": { From 84a8d342f2d7eb3263f0c6b9e65d4cfa6cb61ff7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 5 Jun 2015 05:24:20 -0400 Subject: [PATCH 340/965] Merge pull request babel/babel-eslint#121 from hzoo/i-120 don't visit var decl - fixes babel/babel-eslint#120 --- eslint/babel-eslint-parser/index.js | 5 ++++- eslint/babel-eslint-parser/test/non-regression.js | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3c764c99f8e3..074a0720a557 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -232,7 +232,10 @@ function monkeypatch() { referencer.prototype.VariableDeclaration = function(node) { if (node.declarations) { for (var i = 0; i < node.declarations.length; i++) { - checkIdentifierOrVisit.call(this, node.declarations[i].id); + var type = node.declarations[i].id.typeAnnotation; + if (type) { + checkIdentifierOrVisit.call(this, type); + } } } variableDeclaration.call(this, node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 598498afab5c..c21096f93002 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -950,7 +950,7 @@ describe("verify", function () { it("array #9", function () { verifyAndAssertMessages([ "let arr = [1, 2, 3];", - "let b = [for (e of arr) String(e)];" + "let b = [for (e of arr) String(e)]; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -1082,4 +1082,12 @@ describe("verify", function () { ); }); }); + + it("detects minimal no-unused-vars case #120", function () { + verifyAndAssertMessages( + "var unused;", + { "no-unused-vars": 1 }, + [ "1:4 unused is defined but never used no-unused-vars" ] + ) + }); }); From c38ea387e56171ae8c9d6d4a5dbe95b5d1070ea4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 5 Jun 2015 05:29:59 -0400 Subject: [PATCH 341/965] 3.1.13 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1d757d42b9e8..285c1a9d8905 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.12", + "version": "3.1.13", "description": "", "main": "index.js", "repository": { From face6ff6af50dd3d655239c8e5c00b069c2ca744 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 6 Jun 2015 09:14:24 -0400 Subject: [PATCH 342/965] add lint config from babel, lint --- eslint/babel-eslint-parser/.eslintrc | 26 +++++++++++++++++ .../babel-eslint-parser/acorn-to-esprima.js | 8 ++---- eslint/babel-eslint-parser/index.js | 25 ++++++++--------- .../babel-eslint-parser/test/babel-eslint.js | 10 +++---- .../test/non-regression.js | 28 +++++++++---------- 5 files changed, 59 insertions(+), 38 deletions(-) create mode 100644 eslint/babel-eslint-parser/.eslintrc diff --git a/eslint/babel-eslint-parser/.eslintrc b/eslint/babel-eslint-parser/.eslintrc new file mode 100644 index 000000000000..b4c0ddaa6f79 --- /dev/null +++ b/eslint/babel-eslint-parser/.eslintrc @@ -0,0 +1,26 @@ +{ + "rules": { + "strict": 0, + "no-underscore-dangle": 0, + "curly": 0, + "no-multi-spaces": 0, + "key-spacing": 0, + "no-return-assign": 0, + "consistent-return": 0, + "no-shadow": 0, + "comma-dangle": 0, + "no-use-before-define": 0, + "no-empty": 0, + "new-parens": 0, + "no-cond-assign": 0, + "no-fallthrough": 0, + "new-cap": 0, + "no-loop-func": 0, + "no-unreachable": 0, + "no-process-exit": 0 + }, + "env": { + "node": true, + "mocha": true + } +} \ No newline at end of file diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 81b79aa82f5b..479e4f97d505 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -73,10 +73,6 @@ exports.toTokens = function (tokens) { return tokens.map(exports.toToken); }; -function isCompatTag(tagName) { - return tagName && /^[a-z]|\-/.test(tagName); -} - function convertTemplateType(tokens) { var startingToken = 0; var currentToken = 0; @@ -124,7 +120,7 @@ function convertTemplateType(tokens) { start: tokens[start].loc.start, end: tokens[end].loc.end } - } + }; // put new token in place of old tokens tokens.splice(start, end - start + 1, templateToken); @@ -174,7 +170,7 @@ function convertTemplateType(tokens) { var astTransformVisitor = { noScope: true, - exit: function (node, parent) { + exit: function (node) { /* parent */ if (this.isSpreadProperty()) { node.type = "Property"; node.kind = "init"; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 074a0720a557..7f0f48a961a4 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,5 +1,4 @@ var acornToEsprima = require("./acorn-to-esprima"); -var traverse = require("babel-core").traverse; var assign = require("lodash.assign"); var pick = require("lodash.pick"); var Module = require("module"); @@ -54,7 +53,7 @@ function monkeypatch() { // monkeypatch escope/referencer var referencerLoc; try { - var referencerLoc = Module._resolveFilename("./referencer", escopeMod); + referencerLoc = Module._resolveFilename("./referencer", escopeMod); } catch (err) { throw new ReferenceError("couldn't resolve escope/referencer"); } @@ -64,7 +63,7 @@ function monkeypatch() { // reference Definition var definitionLoc; try { - var definitionLoc = Module._resolveFilename("./definition", referencerMod); + definitionLoc = Module._resolveFilename("./definition", referencerMod); } catch (err) { throw new ReferenceError("couldn't resolve escope/definition"); } @@ -146,8 +145,8 @@ function monkeypatch() { } else if (propertyType.type === "typeAnnotation") { visitTypeAnnotation.call(this, node.typeAnnotation); } else if (propertyType.type === "typeParameters") { - for (var j = 0; j < node.typeParameters.params.length; j++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); + for (var l = 0; l < node.typeParameters.params.length; l++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[l]); } } else if (propertyType.type === "id") { if (node.id.type === "Identifier") { @@ -184,13 +183,13 @@ function monkeypatch() { } } if (node.typeParameters) { - for (var i = 0; i < node.typeParameters.params.length; i++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); + for (var j = 0; j < node.typeParameters.params.length; j++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); } } if (node.superTypeParameters) { - for (var i = 0; i < node.superTypeParameters.params.length; i++) { - checkIdentifierOrVisit.call(this, node.superTypeParameters.params[i]); + for (var k = 0; k < node.superTypeParameters.params.length; k++) { + checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); } } visitClass.call(this, node); @@ -220,8 +219,8 @@ function monkeypatch() { } } if (node.typeParameters) { - for (var i = 0; i < node.typeParameters.params.length; i++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); + for (var j = 0; j < node.typeParameters.params.length; j++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); } } visitFunction.call(this, node); @@ -264,7 +263,7 @@ function monkeypatch() { checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); } } - } + }; referencer.prototype.ComprehensionBlock = function(node) { var left = node.left; @@ -282,7 +281,7 @@ function monkeypatch() { if (node.right) { this.visit(node.right); } - } + }; } exports.attachComments = function (ast, comments, tokens) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 64260de8153f..09e3229e5809 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -195,19 +195,19 @@ describe("acorn-to-esprima", function () { }); it("default import", function () { - parseAndAssertSame('import foo from "foo";'); + parseAndAssertSame("import foo from 'foo';"); }); it("import specifier", function () { - parseAndAssertSame('import { foo } from "foo";'); + parseAndAssertSame("import { foo } from 'foo';"); }); it("import specifier with name", function () { - parseAndAssertSame('import { foo as bar } from "foo";'); + parseAndAssertSame("import { foo as bar } from 'foo';"); }); it("import bare", function () { - parseAndAssertSame('import "foo";'); + parseAndAssertSame("import 'foo';"); }); it("export default class declaration", function () { @@ -227,7 +227,7 @@ describe("acorn-to-esprima", function () { }); it("export all", function () { - parseAndAssertSame('export * from "foo";'); + parseAndAssertSame("export * from 'foo';"); }); it("export named", function () { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c21096f93002..0bafac9e0196 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -420,7 +420,7 @@ describe("verify", function () { { "no-unused-vars": 1, "no-undef": 1 }, [] ); - }) + }); it("10", function () { verifyAndAssertMessages( @@ -672,7 +672,7 @@ describe("verify", function () { verifyAndAssertMessages( [ "import type Foo from 'foo';", - 'var {x}: {x: Foo; } = { x: "hello" }; x;' + "var {x}: {x: Foo; } = { x: 'hello' }; x;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -683,7 +683,7 @@ describe("verify", function () { verifyAndAssertMessages( [ "import type Foo from 'foo';", - 'var [x]: Array = [ "hello" ]; x;' + "var [x]: Array = [ 'hello' ]; x;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -764,8 +764,8 @@ describe("verify", function () { it("38", function () { verifyAndAssertMessages( [ - 'import type {foo, bar} from "baz";', - 'foo; bar;' + "import type {foo, bar} from 'baz';", + "foo; bar;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -775,8 +775,8 @@ describe("verify", function () { it("39", function () { verifyAndAssertMessages( [ - 'import type {foo as bar} from "baz";', - 'bar;' + "import type {foo as bar} from 'baz';", + "bar;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -786,8 +786,8 @@ describe("verify", function () { it("40", function () { verifyAndAssertMessages( [ - 'import type from "foo";', - 'type;' + "import type from 'foo';", + "type;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -797,8 +797,8 @@ describe("verify", function () { it("41", function () { verifyAndAssertMessages( [ - 'import type, {foo} from "bar";', - 'type; foo;' + "import type, {foo} from 'bar';", + "type; foo;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -808,8 +808,8 @@ describe("verify", function () { it("42", function () { verifyAndAssertMessages( [ - 'import type * as namespace from "bar";', - 'namespace;' + "import type * as namespace from 'bar';", + "namespace;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -1088,6 +1088,6 @@ describe("verify", function () { "var unused;", { "no-unused-vars": 1 }, [ "1:4 unused is defined but never used no-unused-vars" ] - ) + ); }); }); From c15a7c6b65bc708361f0bd7f0c1fa9e714275cf5 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 6 Jun 2015 09:21:23 -0400 Subject: [PATCH 343/965] lint: fix quotes, rule --- eslint/babel-eslint-parser/.eslintrc | 3 ++- eslint/babel-eslint-parser/test/babel-eslint.js | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/.eslintrc b/eslint/babel-eslint-parser/.eslintrc index b4c0ddaa6f79..63b343642b89 100644 --- a/eslint/babel-eslint-parser/.eslintrc +++ b/eslint/babel-eslint-parser/.eslintrc @@ -17,7 +17,8 @@ "new-cap": 0, "no-loop-func": 0, "no-unreachable": 0, - "no-process-exit": 0 + "no-process-exit": 0, + "quotes": [1, "double", "avoid-escape"] }, "env": { "node": true, diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 09e3229e5809..64260de8153f 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -195,19 +195,19 @@ describe("acorn-to-esprima", function () { }); it("default import", function () { - parseAndAssertSame("import foo from 'foo';"); + parseAndAssertSame('import foo from "foo";'); }); it("import specifier", function () { - parseAndAssertSame("import { foo } from 'foo';"); + parseAndAssertSame('import { foo } from "foo";'); }); it("import specifier with name", function () { - parseAndAssertSame("import { foo as bar } from 'foo';"); + parseAndAssertSame('import { foo as bar } from "foo";'); }); it("import bare", function () { - parseAndAssertSame("import 'foo';"); + parseAndAssertSame('import "foo";'); }); it("export default class declaration", function () { @@ -227,7 +227,7 @@ describe("acorn-to-esprima", function () { }); it("export all", function () { - parseAndAssertSame("export * from 'foo';"); + parseAndAssertSame('export * from "foo";'); }); it("export named", function () { From adc009b832911c70c0ff84e424df19c0a77f7302 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 6 Jun 2015 16:54:05 -0400 Subject: [PATCH 344/965] Merge pull request babel/babel-eslint#122 from hzoo/i-95 visit properties in ObjectPattern - fixes babel/babel-eslint#95 --- eslint/babel-eslint-parser/index.js | 12 +++++++++--- eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7f0f48a961a4..81475eb7aa6f 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -231,9 +231,15 @@ function monkeypatch() { referencer.prototype.VariableDeclaration = function(node) { if (node.declarations) { for (var i = 0; i < node.declarations.length; i++) { - var type = node.declarations[i].id.typeAnnotation; - if (type) { - checkIdentifierOrVisit.call(this, type); + var id = node.declarations[i].id; + var typeAnnotation = id.typeAnnotation; + if (typeAnnotation) { + checkIdentifierOrVisit.call(this, typeAnnotation); + } + if (id.type === 'ObjectPattern') { + for (var j = 0; j < id.properties.length; j++) { + this.visit(id.properties[j]); + } } } } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 0bafac9e0196..a0b149c2f2bb 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1090,4 +1090,12 @@ describe("verify", function () { [ "1:4 unused is defined but never used no-unused-vars" ] ); }); + + it("visits excluded properties left of spread #95", function () { + verifyAndAssertMessages( + "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", + { "no-undef": 1, "no-unused-vars": 1 }, + [] + ) + }); }); From 5d23153aed4a1c605515ea4e3d878b515efaa59d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 6 Jun 2015 16:55:00 -0400 Subject: [PATCH 345/965] 3.1.14 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 285c1a9d8905..8fab55c0a118 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.13", + "version": "3.1.14", "description": "", "main": "index.js", "repository": { From 4ba3178d8e7092955af5801809247e1095f0838b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Jun 2015 09:37:55 -0400 Subject: [PATCH 346/965] Merge pull request babel/babel-eslint#116 from hzoo/eslint-tests Add eslint submodule to run eslint tests - Ref babel/babel-eslint#62 --- eslint/babel-eslint-parser/.gitignore | 1 + eslint/babel-eslint-parser/.gitmodules | 3 +++ eslint/babel-eslint-parser/.npmignore | 1 + eslint/babel-eslint-parser/eslint | 1 + eslint/babel-eslint-parser/eslint-tester.js | 6 ++++++ eslint/babel-eslint-parser/package.json | 5 ++++- 6 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-parser/.gitmodules create mode 100644 eslint/babel-eslint-parser/.npmignore create mode 160000 eslint/babel-eslint-parser/eslint create mode 100644 eslint/babel-eslint-parser/eslint-tester.js diff --git a/eslint/babel-eslint-parser/.gitignore b/eslint/babel-eslint-parser/.gitignore index 3c3629e647f5..93f136199161 100644 --- a/eslint/babel-eslint-parser/.gitignore +++ b/eslint/babel-eslint-parser/.gitignore @@ -1 +1,2 @@ node_modules +npm-debug.log diff --git a/eslint/babel-eslint-parser/.gitmodules b/eslint/babel-eslint-parser/.gitmodules new file mode 100644 index 000000000000..e922d16a4493 --- /dev/null +++ b/eslint/babel-eslint-parser/.gitmodules @@ -0,0 +1,3 @@ +[submodule "eslint"] + path = eslint + url = https://github.com/eslint/eslint diff --git a/eslint/babel-eslint-parser/.npmignore b/eslint/babel-eslint-parser/.npmignore new file mode 100644 index 000000000000..9096200b7c1f --- /dev/null +++ b/eslint/babel-eslint-parser/.npmignore @@ -0,0 +1 @@ +eslint diff --git a/eslint/babel-eslint-parser/eslint b/eslint/babel-eslint-parser/eslint new file mode 160000 index 000000000000..b89d293dcff7 --- /dev/null +++ b/eslint/babel-eslint-parser/eslint @@ -0,0 +1 @@ +Subproject commit b89d293dcff77b52eb39902e1e2453fc6678850a diff --git a/eslint/babel-eslint-parser/eslint-tester.js b/eslint/babel-eslint-parser/eslint-tester.js new file mode 100644 index 000000000000..52924fa93983 --- /dev/null +++ b/eslint/babel-eslint-parser/eslint-tester.js @@ -0,0 +1,6 @@ +var ESLintTester = require("./eslint/node_modules/eslint-tester"); + +console.log("Use babel-eslint for test suite"); +ESLintTester.setDefaultConfig({ + parser: "../../index" +}); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8fab55c0a118..c33550c811a8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -13,6 +13,8 @@ "lodash.pick": "^3.1.0" }, "scripts": { + "bootstrap": "git submodule update --init && cd eslint && npm install", + "eslint": "cd eslint && mocha -c tests/lib/rules/**/*.js -r ../eslint-tester.js", "test": "mocha" }, "author": "Sebastian McKenzie ", @@ -22,7 +24,8 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.22.1", + "eslint": "^0.21.2", + "eslint-tester": "^0.7.0", "espree": "^2.0.0", "mocha": "^2.1.0" } From d83aa7f6ce186a7ae88206111edc518f0d093004 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Jun 2015 09:41:12 -0400 Subject: [PATCH 347/965] clarify known eslint issues, add to link slack channel for questions --- eslint/babel-eslint-parser/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 808db61daf28..ec6b7d00f2a7 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -6,7 +6,13 @@ **NOTE:** Please note that this is experimental and may have numerous bugs. It is however successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). -If there's an issue, check if it can be reproduced with the regular parser and with the latest versions of `eslint` and `babel-eslint`. For issues related to JSX, see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! +If there is an issue, first check if it can be reproduced with the regular parser and with the latest versions of `eslint` and `babel-eslint`. + +For questions and support please visit the `#linting` [babel slack channel](https://babel-slack.herokuapp.com)! + +## Known Issues +> For issues related to JSX (especially `no-unused-vars`), see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! +- `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) ## How does it work? From 1c25c8eed39fe6783273f130111abb2c67c78b40 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 9 Jun 2015 15:00:38 -0400 Subject: [PATCH 348/965] Merge pull request babel/babel-eslint#126 from leebyron/fix-flow-type Fixes flow type scoping issues - fixes babel/babel-eslint#123 --- eslint/babel-eslint-parser/index.js | 52 ++++++---- .../test/non-regression.js | 97 +++++++++++++------ 2 files changed, 101 insertions(+), 48 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 81475eb7aa6f..e78025c0f912 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -162,37 +162,49 @@ function monkeypatch() { if (node.typeAnnotation) { visitTypeAnnotation.call(this, node.typeAnnotation); } else if (node.type === "Identifier") { - // exception for polymorphic types: , , etc - if (node.name.length === 1 && node.name === node.name.toUpperCase()) { - return; - } this.visit(node); } else { visitTypeAnnotation.call(this, node); } } + function nestTypeParamScope(manager, node) { + var parentScope = manager.__currentScope; + var scope = new escope.Scope(manager, "type-parameters", parentScope, node, false); + manager.__nestScope(scope); + for (var j = 0; j < node.typeParameters.params.length; j++) { + var name = node.typeParameters.params[j]; + scope.__define(name, new Definition("TypeParameter", name, name)); + } + scope.__define = function() { + return parentScope.__define.apply(parentScope, arguments); + } + return scope; + } + // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { visitDecorators.call(this, node); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope(this.scopeManager, node); + } // visit flow type: ClassImplements if (node.implements) { for (var i = 0; i < node.implements.length; i++) { checkIdentifierOrVisit.call(this, node.implements[i]); } } - if (node.typeParameters) { - for (var j = 0; j < node.typeParameters.params.length; j++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); - } - } if (node.superTypeParameters) { for (var k = 0; k < node.superTypeParameters.params.length; k++) { checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); } } visitClass.call(this, node); + if (typeParamScope) { + this.close(node); + } }; // visit decorators that are in: Property / MethodDefinition var visitProperty = referencer.prototype.visitProperty; @@ -207,6 +219,10 @@ function monkeypatch() { // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression var visitFunction = referencer.prototype.visitFunction; referencer.prototype.visitFunction = function(node) { + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope(this.scopeManager, node); + } if (node.returnType) { checkIdentifierOrVisit.call(this, node.returnType); } @@ -218,12 +234,10 @@ function monkeypatch() { } } } - if (node.typeParameters) { - for (var j = 0; j < node.typeParameters.params.length; j++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[j]); - } - } visitFunction.call(this, node); + if (typeParamScope) { + this.close(node); + } }; // visit flow type in VariableDeclaration @@ -261,13 +275,15 @@ function monkeypatch() { referencer.prototype.TypeAlias = function(node) { createScopeVariable.call(this, node, node.id); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope(this.scopeManager, node); + } if (node.right) { visitTypeAnnotation.call(this, node.right); } - if (node.typeParameters) { - for (var i = 0; i < node.typeParameters.params.length; i++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[i]); - } + if (typeParamScope) { + this.close(node); } }; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index a0b149c2f2bb..de0bfbf66b90 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -169,8 +169,8 @@ describe("verify", function () { verifyAndAssertMessages([ "import type Foo from 'foo';", "import type Foo2 from 'foo';", - "function log() {}", - "log();" + "function log(a: T1, b: T2) { return a + b; }", + "log(1, 2);" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -276,9 +276,8 @@ describe("verify", function () { it("type alias with type parameters", function () { verifyAndAssertMessages([ "import type Bar from 'foo';", - "import type Foo2 from 'foo';", "import type Foo3 from 'foo';", - "type Foo = Bar", + "type Foo = Bar", "var x : Foo = 1; x;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, @@ -316,6 +315,62 @@ describe("verify", function () { ); }); + it("polymorphpic/generic types for class #123", function () { + verifyAndAssertMessages([ + "class Box {", + "value: T;", + "}", + "var box = new Box();", + "console.log(box.value);" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("polymorphpic/generic types for function #123", function () { + verifyAndAssertMessages([ + "export function identity(value) {", + "var a: T = value; a;", + "}" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("polymorphpic/generic types for type alias #123", function () { + verifyAndAssertMessages([ + "import Bar from './Bar';", + "type Foo = Bar; var x: Foo = 1; x++" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("polymorphpic/generic types - outside of fn scope #123", function () { + verifyAndAssertMessages([ + "export function foo(value) {", + "};", + "var b: T = 1; b;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [ '1:20 T is defined but never used no-unused-vars', + '3:7 "T" is not defined. no-undef' ] + ); + }); + + it("polymorphpic/generic types - extending unknown #123", function () { + verifyAndAssertMessages([ + "import Bar from 'bar';", + "export class Foo extends Bar {}", + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [ '2:29 "T" is not defined. no-undef' ] + ); + }); + it("1", function () { verifyAndAssertMessages( [ @@ -413,9 +468,7 @@ describe("verify", function () { it("9", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default function () {}" + "export default function (a: T1, b: T2) {}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -425,9 +478,7 @@ describe("verify", function () { it("10", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a=function() {}; a;" + "var a=function(a: T1, b: T2) {return a + b;}; a;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -437,10 +488,7 @@ describe("verify", function () { it("11", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a={*id(x: Foo2): Foo3 { x; }}; a;" + "var a={*id(x: T): T { x; }}; a;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -450,10 +498,7 @@ describe("verify", function () { it("12", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a={async id(x: Foo2): Foo3 { x; }}; a;" + "var a={async id(x: T): T { x; }}; a;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -463,10 +508,7 @@ describe("verify", function () { it("13", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a={123(x: Foo2): Foo3 { x; }}; a;" + "var a={123(x: T): T { x; }}; a;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -597,10 +639,8 @@ describe("verify", function () { it("24", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import Baz from 'foo';", - "export default class Bar extends Baz { };" + "import type Baz from 'baz';", + "export default class Bar extends Baz { };" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -610,10 +650,7 @@ describe("verify", function () { it("25", function () { verifyAndAssertMessages( [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "export default class Bar { bar():Foo3 { return 42; }}" + "export default class Bar { bar(): T { return 42; }}" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] From d5e2ac1fb656e42bb10d6d03409e0e85d0299f8f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 9 Jun 2015 15:01:13 -0400 Subject: [PATCH 349/965] 3.1.15 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c33550c811a8..f50310602aac 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.14", + "version": "3.1.15", "description": "", "main": "index.js", "repository": { From eaec0f15953a9a83b35dc4ec071783323f25a28c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 10 Jun 2015 17:07:53 -0400 Subject: [PATCH 350/965] remove uneeded param --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 479e4f97d505..a5a11835ca84 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -216,7 +216,7 @@ var astTransformVisitor = { delete node.isType; } - if (this.isExportDeclaration(node)) { + if (this.isExportDeclaration())) { var declar = this.get("declaration"); if (declar.isClassExpression()) { node.declaration.type = "ClassDeclaration"; From 0c47ebe88128814433f681da1649199f97c5e803 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 10 Jun 2015 17:11:21 -0400 Subject: [PATCH 351/965] fix build.. --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index a5a11835ca84..9dfdfffa1d71 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -216,7 +216,7 @@ var astTransformVisitor = { delete node.isType; } - if (this.isExportDeclaration())) { + if (this.isExportDeclaration()) { var declar = this.get("declaration"); if (declar.isClassExpression()) { node.declaration.type = "ClassDeclaration"; From da3d4bf5377c5f439e03abb8b30a2112c9c02329 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 15 Jun 2015 20:25:44 -0400 Subject: [PATCH 352/965] Known Issue: object-shorthand with spread operator --- eslint/babel-eslint-parser/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ec6b7d00f2a7..ff69f517869b 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -13,6 +13,7 @@ For questions and support please visit the `#linting` [babel slack channel](http ## Known Issues > For issues related to JSX (especially `no-unused-vars`), see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! - `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) +- `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) ## How does it work? From d224153cba45568222298867fc4e5c13869dd76c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 17 Jun 2015 07:17:26 -0400 Subject: [PATCH 353/965] Merge pull request babel/babel-eslint#133 from hzoo/i-132 support flow declarations correctly, lint - fixes babel/babel-eslint#132 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 11 +---------- eslint/babel-eslint-parser/index.js | 17 +++++++++++++++-- .../babel-eslint-parser/test/non-regression.js | 16 ++++++++++++++-- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 9dfdfffa1d71..7809f04a1f8b 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -183,7 +183,7 @@ var astTransformVisitor = { return node.argument; } - // prevent "no-undef" + // flow: prevent "no-undef" // for "Component" in: "let x: React.Component" if (this.isQualifiedTypeIdentifier()) { delete node.id; @@ -201,15 +201,6 @@ var astTransformVisitor = { delete node.name; } - // flow - - if (this.isDeclareModule() || - this.isDeclareClass() || - this.isDeclareFunction() || - this.isDeclareVariable()) { - return this.dangerouslyRemove(); - } - // modules if (this.isImportDeclaration()) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index e78025c0f912..f69d9f0a2cb7 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -178,7 +178,7 @@ function monkeypatch() { } scope.__define = function() { return parentScope.__define.apply(parentScope, arguments); - } + }; return scope; } @@ -250,7 +250,7 @@ function monkeypatch() { if (typeAnnotation) { checkIdentifierOrVisit.call(this, typeAnnotation); } - if (id.type === 'ObjectPattern') { + if (id.type === "ObjectPattern") { for (var j = 0; j < id.properties.length; j++) { this.visit(id.properties[j]); } @@ -304,6 +304,19 @@ function monkeypatch() { this.visit(node.right); } }; + + referencer.prototype.DeclareModule = + referencer.prototype.DeclareFunction = + referencer.prototype.DeclareVariable = + referencer.prototype.DeclareClass = function(node) { + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope(this.scopeManager, node); + } + if (typeParamScope) { + this.close(node); + } + }; } exports.attachComments = function (ast, comments, tokens) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index de0bfbf66b90..4b4665f270aa 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -356,7 +356,7 @@ describe("verify", function () { "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ '1:20 T is defined but never used no-unused-vars', + [ "1:20 T is defined but never used no-unused-vars", '3:7 "T" is not defined. no-undef' ] ); }); @@ -371,6 +371,18 @@ describe("verify", function () { ); }); + it("support declarations #132", function () { + verifyAndAssertMessages([ + "declare class A { static () : number }", + "declare module B { declare var x: number; }", + "declare function foo(): void;", + "declare var bar" + ].join("\n"), + { "no-undef": 1, "no-unused-vars": 1 }, + [] + ); + }); + it("1", function () { verifyAndAssertMessages( [ @@ -1133,6 +1145,6 @@ describe("verify", function () { "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", { "no-undef": 1, "no-unused-vars": 1 }, [] - ) + ); }); }); From d16f726b1527f6c37b8b1d7b1c021042c9c50d72 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 17 Jun 2015 07:18:47 -0400 Subject: [PATCH 354/965] 3.1.16 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f50310602aac..ddf3bf744aea 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.15", + "version": "3.1.16", "description": "", "main": "index.js", "repository": { From 0de733b66aae21a35e1ecb81d7d90405ab41a2c8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 17 Jun 2015 09:18:51 -0400 Subject: [PATCH 355/965] flow: create var declaration for flow declarations --- eslint/babel-eslint-parser/index.js | 4 ++++ eslint/babel-eslint-parser/test/non-regression.js | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f69d9f0a2cb7..93400573d16c 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -309,6 +309,10 @@ function monkeypatch() { referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = referencer.prototype.DeclareClass = function(node) { + if (node.id) { + createScopeVariable.call(this, node, node.id); + } + var typeParamScope; if (node.typeParameters) { typeParamScope = nestTypeParamScope(this.scopeManager, node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4b4665f270aa..6420d1abdd19 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -376,7 +376,8 @@ describe("verify", function () { "declare class A { static () : number }", "declare module B { declare var x: number; }", "declare function foo(): void;", - "declare var bar" + "declare var bar", + "A; B; foo(); bar;" ].join("\n"), { "no-undef": 1, "no-unused-vars": 1 }, [] From cf57c817cbdd320f4ad1ec0bed1a0dd101e823fd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 17 Jun 2015 20:31:58 -0400 Subject: [PATCH 356/965] Known Issues: add flow declarations with 'no-unused-vars' --- eslint/babel-eslint-parser/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ff69f517869b..aed3e0bd531a 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -14,6 +14,7 @@ For questions and support please visit the `#linting` [babel slack channel](http > For issues related to JSX (especially `no-unused-vars`), see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! - `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) - `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) +- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) ## How does it work? From c3b0bb21e94ba85303988da08ad995d5965d1448 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 17 Jun 2015 20:32:16 -0400 Subject: [PATCH 357/965] 3.1.17 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ddf3bf744aea..b1773b615453 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.16", + "version": "3.1.17", "description": "", "main": "index.js", "repository": { From cec51daa04b6afde07e22362affbd3cdb5ac4db0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 18 Jun 2015 21:22:59 -0400 Subject: [PATCH 358/965] add message about using eslint-plugin-babel --- eslint/babel-eslint-parser/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index aed3e0bd531a..e51c1f04f0b6 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -11,10 +11,14 @@ If there is an issue, first check if it can be reproduced with the regular parse For questions and support please visit the `#linting` [babel slack channel](https://babel-slack.herokuapp.com)! ## Known Issues -> For issues related to JSX (especially `no-unused-vars`), see if [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) helps! +- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) + +Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for react/jsx issues +- `no-unused-vars` with jsx + +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for the issues below: - `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) - `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) -- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) ## How does it work? From 96a9af0a06d64dd47417773d6c6cf3b518dd03d9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 22 Jun 2015 16:48:51 -0400 Subject: [PATCH 359/965] update eslint, update tests --- eslint/babel-eslint-parser/package.json | 9 ++++----- eslint/babel-eslint-parser/test/non-regression.js | 15 +++++++-------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b1773b615453..cf924e48352b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.5.1", + "babel-core": "^5.6.4", "lodash.assign": "^3.0.0", "lodash.pick": "^3.1.0" }, @@ -24,9 +24,8 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.21.2", - "eslint-tester": "^0.7.0", - "espree": "^2.0.0", - "mocha": "^2.1.0" + "eslint": "^0.23.0", + "espree": "^2.0.3", + "mocha": "^2.2.5" } } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 6420d1abdd19..54ce33429cc3 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -47,7 +47,7 @@ describe("verify", function () { verifyAndAssertMessages( "{ , res }", {}, - [ "1:2 Unexpected token" ] + [ "1:2 Line X: Unexpected token" ] ); }); @@ -297,7 +297,7 @@ describe("verify", function () { it("polymorphpic types #109", function () { verifyAndAssertMessages([ - "export default function groupByEveryN(array: Array, n: number): Array> {}" + "export default function groupByEveryN(array: Array, n: number): Array> { n; }" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -351,13 +351,12 @@ describe("verify", function () { it("polymorphpic/generic types - outside of fn scope #123", function () { verifyAndAssertMessages([ - "export function foo(value) {", - "};", + "export function foo(value) { value; };", "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [ "1:20 T is defined but never used no-unused-vars", - '3:7 "T" is not defined. no-undef' ] + '2:7 "T" is not defined. no-undef' ] ); }); @@ -481,7 +480,7 @@ describe("verify", function () { it("9", function () { verifyAndAssertMessages( [ - "export default function (a: T1, b: T2) {}" + "export default function (a: T1, b: T2) { b; }" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -744,7 +743,7 @@ describe("verify", function () { verifyAndAssertMessages( [ "import type Foo from 'foo';", - "export default function({x}: { x: Foo; }) {}" + "export default function({x}: { x: Foo; }) { x; }" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -958,7 +957,7 @@ describe("verify", function () { verifyAndAssertMessages([ "export default function root(stores) {", "return DecoratedComponent => class ReduxRootDecorator {", - "a() { DecoratedComponent; }", + "a() { DecoratedComponent; stores; }", "};", "}", ].join("\n"), From c22414c1fd5364c227d0bb569abf7813fd1dd931 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 22 Jun 2015 17:00:31 -0400 Subject: [PATCH 360/965] fix tests after updating babel --- eslint/babel-eslint-parser/test/non-regression.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 54ce33429cc3..c9d4aeb886aa 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1084,7 +1084,7 @@ describe("verify", function () { "get bar() { }", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", - "set bar() { }", + "set bar(val) { val; }", "}" ].join("\n"), { "no-unused-vars": 1 }, @@ -1122,7 +1122,7 @@ describe("verify", function () { "get bar() { },", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", - "set bar() { }", + "set bar(val) { val; }", "};", "obj;" ].join("\n"), From 7ff5dd56e849158871703ce3c00749fd9dd21a03 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 23 Jun 2015 18:32:09 -0400 Subject: [PATCH 361/965] Merge pull request babel/babel-eslint#135 from PiPeep/fix-jest Fix eslint module path resolution in jest --- eslint/babel-eslint-parser/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 93400573d16c..f6eafd46f282 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -22,9 +22,15 @@ function monkeypatch() { var eslintLoc; try { + // avoid importing a local copy of eslint, try to find a peer dependency eslintLoc = Module._resolveFilename("eslint", module.parent); } catch (err) { - throw new ReferenceError("couldn't resolve eslint"); + try { + // avoids breaking in jest where module.parent is undefined + eslintLoc = require.resolve("eslint"); + } catch (err) { + throw new ReferenceError("couldn't resolve eslint"); + } } // get modules relative to what eslint will load From b05ae77e4158c0efdc3ff84ce2aec98c304335fc Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 23 Jun 2015 18:32:44 -0400 Subject: [PATCH 362/965] 3.1.18 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cf924e48352b..c4a95cc03a7e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.17", + "version": "3.1.18", "description": "", "main": "index.js", "repository": { From e72e79694f58a5718b5b5bf9d17229639dc5a836 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 26 Jun 2015 15:06:18 +0100 Subject: [PATCH 363/965] attempt to resolve estraverse relative to esrecurse if found - this is necessary because of the tree flattening in npm 3 --- eslint/babel-eslint-parser/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f6eafd46f282..7d09ca5043fd 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -38,8 +38,15 @@ function monkeypatch() { var escopeLoc = Module._resolveFilename("escope", eslintMod); var escopeMod = createModule(escopeLoc); + // npm 3: monkeypatch estraverse if it's in escope + var estraverseRelative = escopeMod; + try { + var esrecurseLoc = Module._resolveFilename("esrecurse", eslintMod); + estraverseRelative = createModule(esrecurseLoc); + } catch (err) {} + // monkeypatch estraverse - estraverse = escopeMod.require("estraverse"); + estraverse = estraverseRelative.require("estraverse"); assign(estraverse.VisitorKeys, t.VISITOR_KEYS); // monkeypatch estraverse-fb From 1502bf6a2d6ed560130053e4840f0604a60c1d8d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 26 Jun 2015 15:06:21 +0100 Subject: [PATCH 364/965] 3.1.19 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c4a95cc03a7e..5496628643ee 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.18", + "version": "3.1.19", "description": "", "main": "index.js", "repository": { From dee7261bbead22e9c22cac30e62d40d1283fc0fc Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 29 Jun 2015 13:48:19 -0400 Subject: [PATCH 365/965] Merge pull request babel/babel-eslint#140 from hzoo/i-138 create scope for each comprehension - fixes babel/babel-eslint#138 --- eslint/babel-eslint-parser/index.js | 41 ++++++++++++++----- .../test/non-regression.js | 30 ++++++++++++-- 2 files changed, 57 insertions(+), 14 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7d09ca5043fd..44893c80e4ae 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -300,22 +300,41 @@ function monkeypatch() { } }; - referencer.prototype.ComprehensionBlock = function(node) { - var left = node.left; - if (left) { - if (left.type === "Identifier") { - createScopeVariable.call(this, node, left); - } else if (left.type === "ArrayPattern") { - for (var i = 0; i < left.elements.length; i++) { - if (left.elements[i]) { - createScopeVariable.call(this, left.elements, left.elements[i]); + referencer.prototype.ComprehensionExpression = function(node) { + for (var i = 0; i < node.blocks.length; i++) { + var block = node.blocks[i]; + if (block.left) { + var scope = new escope.Scope(this.scopeManager, "comprehensions", this.currentScope(), node, false); + this.scopeManager.__nestScope(scope); + + var left = block.left; + if (left.type === "Identifier") { + scope.__define(left, new Definition("ComprehensionElement", left, left)); + } else if (left.type === "ArrayPattern") { + for (var i = 0; i < left.elements.length; i++) { + var name = left.elements[i]; + if (name) { + scope.__define(name, new Definition("ComprehensionElement", name, name)); + } + } + } else if (left.type === "ObjectPattern") { + for (var i = 0; i < left.properties.length; i++) { + var name = left.properties[i]; + if (name && name.key && name.key.type === 'Identifier') { + scope.__define(name.key, new Definition("ComprehensionElement", name.key, name.key)); + } } } } + if (block.right) { + this.visit(block.right); + } } - if (node.right) { - this.visit(node.right); + if (node.filter) { + this.visit(block.filter); } + this.visit(node.body); + this.close(node); }; referencer.prototype.DeclareModule = diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c9d4aeb886aa..6be4343f42b0 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1017,7 +1017,7 @@ describe("verify", function () { ); }); - it("expression, if statement, multiple blocks", function () { + it("generator, if statement, multiple blocks", function () { verifyAndAssertMessages([ "let arr = [1, 2, 3];", "let arr2 = [1, 2, 3];", @@ -1031,13 +1031,37 @@ describe("verify", function () { it("ArrayPattern", function () { verifyAndAssertMessages([ "let arr = [1, 2, 3];", - "let arr2 = [1, 2, 3];", - "[for ([,x] of arr) for ({[start.x]: x, [start.y]: y} of arr2) x]" + "[for ([,x] of arr) x]" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); + + it("ObjectPattern", function () { + verifyAndAssertMessages([ + "let arr = [{x: 1, y: 2}, {x: 2, y: 3}];", + "[for ({x, y} of arr) x + y]" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); + + it("multiple comprehensions #138", function () { + verifyAndAssertMessages([ + "function test() {", + "let items;", + "return {", + "a: [for (i of items) i],", + "b: [for (i of items) i]", + "};", + "} test;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1, "no-redeclare": 1 }, + [] + ); + }); }); describe("decorators #72", function () { From 6b05576d9902102b557e450d3b8aa24eb6164dbd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 29 Jun 2015 13:51:50 -0400 Subject: [PATCH 366/965] 3.1.20 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5496628643ee..7c601765e485 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.19", + "version": "3.1.20", "description": "", "main": "index.js", "repository": { From 0de11015cc7126dfdeb78b759fd28bf0685861e0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 29 Jun 2015 14:19:06 -0400 Subject: [PATCH 367/965] update devDep eslint@0.24.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7c601765e485..05bfc82b87de 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.23.0", + "eslint": "^0.24.0", "espree": "^2.0.3", "mocha": "^2.2.5" } From b26b8efca4ade5312103235eed3b03f03751647b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Jul 2015 11:27:42 -0400 Subject: [PATCH 368/965] add known issue for babel/babel-eslint#136 --- eslint/babel-eslint-parser/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index e51c1f04f0b6..297e1751f21c 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -12,6 +12,7 @@ For questions and support please visit the `#linting` [babel slack channel](http ## Known Issues - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) +- `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136) Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for react/jsx issues - `no-unused-vars` with jsx From 78a7af3c0a77781a8182b738a4ac98a578cec78f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Jul 2015 11:38:00 -0400 Subject: [PATCH 369/965] add known issue for babel/babel-eslint#130 - `no-undef` for global flow types --- eslint/babel-eslint-parser/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 297e1751f21c..c185ba0fc786 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -11,6 +11,8 @@ If there is an issue, first check if it can be reproduced with the regular parse For questions and support please visit the `#linting` [babel slack channel](https://babel-slack.herokuapp.com)! ## Known Issues +- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) + - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) - `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136) From 4e884f439ec05fb2e543b011803fdae11fae9ac2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 5 Jul 2015 22:06:15 -0400 Subject: [PATCH 370/965] Merge pull request babel/babel-eslint#143 from hzoo/i-142 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit only visit properties in object destructuring when there is a SpreadP… --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 +- eslint/babel-eslint-parser/index.js | 11 +++++++++-- eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 7809f04a1f8b..8681d04e5d71 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -172,7 +172,7 @@ var astTransformVisitor = { noScope: true, exit: function (node) { /* parent */ if (this.isSpreadProperty()) { - node.type = "Property"; + node.type = "SpreadProperty"; node.kind = "init"; node.computed = true; node.key = node.value = node.argument; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 44893c80e4ae..e37e5417e329 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -264,8 +264,15 @@ function monkeypatch() { checkIdentifierOrVisit.call(this, typeAnnotation); } if (id.type === "ObjectPattern") { - for (var j = 0; j < id.properties.length; j++) { - this.visit(id.properties[j]); + // check if object destructuring has a spread + var hasSpread = id.properties.filter(function(p) { + return p.type === "SpreadProperty" + }); + // visit properties if so + if (hasSpread.length > 0) { + for (var j = 0; j < id.properties.length; j++) { + this.visit(id.properties[j]); + } } } } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 6be4343f42b0..553594df778d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1171,4 +1171,12 @@ describe("verify", function () { [] ); }); + + it("detects no-unused-vars with object destructuring #142", function () { + verifyAndAssertMessages( + "const {Bacona} = require('baconjs')", + { "no-undef": 1, "no-unused-vars": 1 }, + [ "1:7 Bacona is defined but never used no-unused-vars" ] + ); + }); }); From 8c4adbf98d85a420e2bb4b873c8a10a06490f18a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 5 Jul 2015 22:08:19 -0400 Subject: [PATCH 371/965] 3.1.21 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 05bfc82b87de..247f86c3abff 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.20", + "version": "3.1.21", "description": "", "main": "index.js", "repository": { From d9bf8d252e54972c0bcb673db303ead2dceb1d87 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Jul 2015 09:36:34 -0400 Subject: [PATCH 372/965] fix no-unused-vars issue with spread Use a private _spread property on Property node instead of SpreadProperty Fixes https://github.com/babel/babel-eslint/issues/142#issuecomment-118707124 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 4 +++- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 8681d04e5d71..d1e1d8151c8e 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -172,7 +172,9 @@ var astTransformVisitor = { noScope: true, exit: function (node) { /* parent */ if (this.isSpreadProperty()) { - node.type = "SpreadProperty"; + // private var to track if it's a spread property + node._spread = true; + node.type = "Property"; node.kind = "init"; node.computed = true; node.key = node.value = node.argument; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index e37e5417e329..7a755aaeb9bc 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -266,7 +266,7 @@ function monkeypatch() { if (id.type === "ObjectPattern") { // check if object destructuring has a spread var hasSpread = id.properties.filter(function(p) { - return p.type === "SpreadProperty" + return p._spread === true; }); // visit properties if so if (hasSpread.length > 0) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 553594df778d..ed857f0e2a50 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1179,4 +1179,18 @@ describe("verify", function () { [ "1:7 Bacona is defined but never used no-unused-vars" ] ); }); + + it("don't warn no-unused-vars with spread #142", function () { + verifyAndAssertMessages([ + "export default function test(data) {", + "return {", + "foo: 'bar',", + "...data", + "};", + "}", + ].join("\n"), + { "no-undef": 1, "no-unused-vars": 1 }, + [] + ); + }); }); From f57dde1ac3480b7d5a144da7f233d54547cc5ae5 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Jul 2015 09:38:11 -0400 Subject: [PATCH 373/965] 3.1.22 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 247f86c3abff..1a0fc85c1c7f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.21", + "version": "3.1.22", "description": "", "main": "index.js", "repository": { From 05f5cc3ea8f298c9fbc5558f0b40ad7bf846b4b6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Jul 2015 10:40:11 -0400 Subject: [PATCH 374/965] Merge pull request babel/babel-eslint#146 from hzoo/i-142-2 use node.babelType for SpreadProperty --- eslint/babel-eslint-parser/acorn-to-esprima.js | 6 ++++-- eslint/babel-eslint-parser/index.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index d1e1d8151c8e..82983ca1de66 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -170,10 +170,12 @@ function convertTemplateType(tokens) { var astTransformVisitor = { noScope: true, + enter: function (node) { + // private var to track original node type + node._babelType = node.type; + }, exit: function (node) { /* parent */ if (this.isSpreadProperty()) { - // private var to track if it's a spread property - node._spread = true; node.type = "Property"; node.kind = "init"; node.computed = true; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7a755aaeb9bc..6d4da4d7036b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -266,7 +266,7 @@ function monkeypatch() { if (id.type === "ObjectPattern") { // check if object destructuring has a spread var hasSpread = id.properties.filter(function(p) { - return p._spread === true; + return p._babelType === "SpreadProperty"; }); // visit properties if so if (hasSpread.length > 0) { From 39fa1c4ac2db673869d42e59950708279844fea0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Jul 2015 10:40:56 -0400 Subject: [PATCH 375/965] 3.1.23 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1a0fc85c1c7f..a1486a6b32b2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.22", + "version": "3.1.23", "description": "", "main": "index.js", "repository": { From efef3af7b81756a1efa49c2b4fddf878f4d100de Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 9 Jul 2015 13:11:14 -0400 Subject: [PATCH 376/965] update readme - separate channel/signup, categorize known issues better --- eslint/babel-eslint-parser/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index c185ba0fc786..7556b2998fc0 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -6,17 +6,20 @@ **NOTE:** Please note that this is experimental and may have numerous bugs. It is however successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). -If there is an issue, first check if it can be reproduced with the regular parser and with the latest versions of `eslint` and `babel-eslint`. +> If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! -For questions and support please visit the `#linting` [babel slack channel](https://babel-slack.herokuapp.com)! +For questions and support please visit the [`#linting`](https://babeljs.slack.com/messages/linting/) babel slack channel (sign up [here](https://babel-slack.herokuapp.com))! ## Known Issues +Flow: - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) + +Modules/strict mode - `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136) -Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for react/jsx issues +Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues - `no-unused-vars` with jsx Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for the issues below: From 61555c6ebd787aa044d394850ae847ba0aba92e5 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 10 Jul 2015 18:37:45 -0400 Subject: [PATCH 377/965] fix typo: attachComment -> attachComments --- eslint/babel-eslint-parser/test/babel-eslint.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 64260de8153f..b9b1201cae6b 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -61,7 +61,7 @@ function parseAndAssertSame(code) { loc: true, range: true, comment: true, - attachComment: true + attachComments: true }); var acornAST = babelEslint.parse(code); try { From e7aecdce711b604a3d5e0be9ad05dff7ef910cc8 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 21 Jul 2015 22:34:14 +0100 Subject: [PATCH 378/965] convert comment node types from babel to espree - ref facebook/react#4449 --- eslint/babel-eslint-parser/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 6d4da4d7036b..355fc5d34e68 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -447,6 +447,14 @@ exports.parse = function (code) { ast.tokens = acornToEsprima.toTokens(tokens); // add comments + for (var i = 0; i < comments.length; i++) { + var comment = comments[i]; + if (comment.type === "CommentBlock") { + comment.type = "Block"; + } else if (comment.type === "CommentLine") { + comment.type = "Line"; + } + } ast.comments = comments; exports.attachComments(ast, comments, tokens); From 8baea68c6c0c71460d2850e9b56ce9c46c49a3a6 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Tue, 21 Jul 2015 22:34:24 +0100 Subject: [PATCH 379/965] 3.1.24 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a1486a6b32b2..e9c0d8261ce8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.23", + "version": "3.1.24", "description": "", "main": "index.js", "repository": { From c551545f29978c46a4249288cc1bf1d386e9c89d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 22 Jul 2015 01:19:23 +0100 Subject: [PATCH 380/965] filter comment tokens - fixes babel/babel-eslint#153 --- .../babel-eslint-parser/acorn-to-esprima.js | 4 ++- .../test/non-regression.js | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 82983ca1de66..c30023ef364d 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -70,7 +70,9 @@ exports.toTokens = function (tokens) { // transform tokens to type "Template" convertTemplateType(tokens); - return tokens.map(exports.toToken); + return tokens.filter(function (token) { + return token.type !== "CommentLine" && token.type !== "CommentBlock"; + }).map(exports.toToken); }; function convertTemplateType(tokens) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index ed857f0e2a50..27f8f299e1e9 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1193,4 +1193,29 @@ describe("verify", function () { [] ); }); + + it("excludes comment tokens #153", function () { + verifyAndAssertMessages( + [ + "var a = [", + "1,", + "2, // a trailing comment makes this line fail comma-dangle (always-multiline)", + "];", + ].join("\n"), + { "comma-dangle": [2, "always-multiline"] }, + [] + ); + + verifyAndAssertMessages( + [ + "switch (a) {", + "// A comment here makes the above line fail brace-style", + "case 1:", + "console.log(a);", + "}" + ].join("\n"), + { "brace-style": 2 }, + [] + ); + }); }); From ec9a75173b13f023bb41d301a515cd6fe324ebda Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 22 Jul 2015 01:19:45 +0100 Subject: [PATCH 381/965] 3.1.25 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e9c0d8261ce8..ccca7762ee10 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.24", + "version": "3.1.25", "description": "", "main": "index.js", "repository": { From 2bb5101112b4c60e910138449cd1d73b3db85b4e Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 21 Jul 2015 23:57:13 -0400 Subject: [PATCH 382/965] add test for babel/babel-eslint#149 --- eslint/babel-eslint-parser/test/non-regression.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 27f8f299e1e9..fee81e582d2a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1218,4 +1218,13 @@ describe("verify", function () { [] ); }); + + it("ternary and parens #149", function () { + verifyAndAssertMessages([ + "true ? (true) : false;" + ].join("\n"), + { "space-infix-ops": 1 }, + [] + ); + }); }); From 9c452f5b14982c52ca835744306eb2f073b6d20b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Jul 2015 00:36:03 -0400 Subject: [PATCH 383/965] remove estraverse attach comments method, fix up tests --- eslint/babel-eslint-parser/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 355fc5d34e68..efbac4bf3b70 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -363,8 +363,6 @@ function monkeypatch() { } exports.attachComments = function (ast, comments, tokens) { - estraverse.attachComments(ast, comments, tokens); - if (comments.length) { var firstComment = comments[0]; var lastComment = comments[comments.length - 1]; @@ -456,7 +454,7 @@ exports.parse = function (code) { } } ast.comments = comments; - exports.attachComments(ast, comments, tokens); + exports.attachComments(ast, comments, ast.tokens); // transform esprima and acorn divergent nodes acornToEsprima.toAST(ast); From bb29041dce5730b0b5119f134e18a6af148bd21a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Jul 2015 01:35:33 -0400 Subject: [PATCH 384/965] 3.1.26 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ccca7762ee10..dfb1c1101a74 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.25", + "version": "3.1.26", "description": "", "main": "index.js", "repository": { From 8d65e3e8940e702cd094572e6d9b5026eced5e08 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 10:08:31 -0400 Subject: [PATCH 385/965] Merge pull request babel/babel-eslint#154 from alexkuz/master fix visiting filter in comprehension --- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index efbac4bf3b70..a1ceaa8b6bd0 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -338,7 +338,7 @@ function monkeypatch() { } } if (node.filter) { - this.visit(block.filter); + this.visit(node.filter); } this.visit(node.body); this.close(node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index fee81e582d2a..3709688a966d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1062,6 +1062,17 @@ describe("verify", function () { [] ); }); + + it("visiting filter in comprehension", function () { + verifyAndAssertMessages([ + "function test(items, val) {", + "return [ for (i of items) if (i === val) i ];", + "} test;" + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); }); describe("decorators #72", function () { From 80888a1b2362c30c13a3f659190fdfdcf3255e0b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 10:53:17 -0400 Subject: [PATCH 386/965] 3.1.27 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dfb1c1101a74..05d56fea5f96 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.26", + "version": "3.1.27", "description": "", "main": "index.js", "repository": { From d4318aa0d8d6510657cd07d01004fa60321b00ae Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 11:00:42 -0400 Subject: [PATCH 387/965] Merge pull request babel/babel-eslint#128 from hzoo/i-124 add tests - for babel/babel-eslint#124 --- .../babel-eslint-parser/test/babel-eslint.js | 12 +++++++ .../test/non-regression.js | 34 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index b9b1201cae6b..9f0b2850684c 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -265,6 +265,18 @@ describe("acorn-to-esprima", function () { ].join("\n")); }); + it("block comments #124", function () { + parseAndAssertSame([ + "React.createClass({", + "render() {", + "// return (", + "//
", + "// ); // <-- this is the line that is reported", + "}", + "});" + ].join("\n")); + }); + it("null", function () { parseAndAssertSame("null"); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3709688a966d..3d2bd82e0740 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1238,4 +1238,38 @@ describe("verify", function () { [] ); }); + + // it("line comment space-in-parens #124", function () { + // verifyAndAssertMessages( + // [ + // "React.createClass({", + // "render() {", + // "// return (", + // "//
", + // "// ); // <-- this is the line that is reported", + // "}", + // "});" + // ].join("\n"), + // { "space-in-parens": 1 }, + // [ ] + // ) + // }); + + it("block comment space-in-parens #124", function () { + verifyAndAssertMessages( + [ + "React.createClass({", + "render() {", + "/*", + "return (", + "
", + "); // <-- this is the line that is reported", + "*/", + "}", + "});" + ].join("\n"), + { "space-in-parens": 1 }, + [ ] + ) + }); }); From c5bbf91892db71f02ef6cbf8b7ad262930dc0005 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 11:08:08 -0400 Subject: [PATCH 388/965] Merge pull request babel/babel-eslint#152 from bgw/line-x Replace 'Line X' with actual line number --- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index a1ceaa8b6bd0..a686f5e02455 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -430,7 +430,7 @@ exports.parse = function (code) { err.column = err.loc.column; // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = "Line X: " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); + err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); } throw err; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3d2bd82e0740..c3f6721fd5d4 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -47,7 +47,7 @@ describe("verify", function () { verifyAndAssertMessages( "{ , res }", {}, - [ "1:2 Line X: Unexpected token" ] + [ "1:2 Unexpected token" ] ); }); From 44371323726560f4776e737b4c3a34e258319dc8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Jul 2015 11:08:25 -0400 Subject: [PATCH 389/965] 4.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 05d56fea5f96..a25a50949dc8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "3.1.27", + "version": "4.0.0", "description": "", "main": "index.js", "repository": { From 56a27a06473cae47432b9d817e9112451f18a2fe Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:21:18 +0100 Subject: [PATCH 390/965] add range property - fixes babel/babel-eslint#155 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index c30023ef364d..c527ea87bced 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -177,6 +177,8 @@ var astTransformVisitor = { node._babelType = node.type; }, exit: function (node) { /* parent */ + node.range = [node.start, node.end]; + if (this.isSpreadProperty()) { node.type = "Property"; node.kind = "init"; From 06ccbca7637527e5723bb946f52cc1437d0f72b4 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:21:29 +0100 Subject: [PATCH 391/965] 4.0.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a25a50949dc8..f47bbb142bc1 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.0", + "version": "4.0.1", "description": "", "main": "index.js", "repository": { From 582cf6cc8a2413f7e8af6ad845ca48fbe98affbd Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:44:49 +0100 Subject: [PATCH 392/965] add missing ranges --- eslint/babel-eslint-parser/acorn-to-esprima.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index c527ea87bced..229b3b7c32b4 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -4,6 +4,7 @@ var t = require("babel-core").types; exports.toToken = function (token) { var type = token.type; + token.range = [token.start, token.end]; if (type === tt.name) { token.type = "Identifier"; @@ -63,6 +64,7 @@ exports.toToken = function (token) { exports.toAST = function (ast) { ast.sourceType = "module"; + ast.range = [ast.start, ast.end]; traverse(ast, astTransformVisitor); }; From af51b545bad46232a91189b738023c3ab2c30267 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:44:56 +0100 Subject: [PATCH 393/965] 4.0.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f47bbb142bc1..855b83181361 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.1", + "version": "4.0.2", "description": "", "main": "index.js", "repository": { From 19e2f1bb3376a6f2b190a2dd33430557ce78653f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:58:37 +0100 Subject: [PATCH 394/965] use start/end rather than directly using range in attachComments --- eslint/babel-eslint-parser/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index a686f5e02455..5a94fee62575 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -369,13 +369,13 @@ exports.attachComments = function (ast, comments, tokens) { // fixup program start if (!tokens.length) { // if no tokens, the program starts at the end of the last comment - ast.range[0] = lastComment.range[1]; + ast.start = lastComment.end; ast.loc.start.line = lastComment.loc.end.line; ast.loc.start.column = lastComment.loc.end.column; - } else if (firstComment.start < tokens[0].range[0]) { + } else if (firstComment.start < tokens[0].start) { // if there are comments before the first token, the program starts at the first token var token = tokens[0]; - ast.range[0] = token.range[0]; + ast.start = token.start; ast.loc.start.line = token.loc.start.line; ast.loc.start.column = token.loc.start.column; @@ -384,7 +384,7 @@ exports.attachComments = function (ast, comments, tokens) { if (ast.body.length) { var node = ast.body[0]; node.leadingComments = []; - var firstTokenStart = token.range[0]; + var firstTokenStart = token.start; var len = comments.length; for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { node.leadingComments.push(comments[i]); @@ -394,10 +394,10 @@ exports.attachComments = function (ast, comments, tokens) { // fixup program end if (tokens.length) { var lastToken = tokens[tokens.length - 1]; - if (lastComment.end > lastToken.range[1]) { + if (lastComment.end > lastToken.end) { // If there is a comment after the last token, the program ends at the // last token and not the comment - ast.range[1] = lastToken.range[1]; + ast.end = lastToken.end; ast.loc.end.line = lastToken.loc.end.line; ast.loc.end.column = lastToken.loc.end.column; } From 39e9fc9e408e27575c39a808ad1ab529ddb31225 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 02:58:45 +0100 Subject: [PATCH 395/965] 4.0.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 855b83181361..287c11f46fe2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.2", + "version": "4.0.3", "description": "", "main": "index.js", "repository": { From 2c868efbad1d03d4e70d21ea0762122153d3839e Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 04:04:30 +0100 Subject: [PATCH 396/965] fix range generation for template tokens - fixes babel/babel-eslint#156 --- eslint/babel-eslint-parser/acorn-to-esprima.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 229b3b7c32b4..4c1210857461 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -119,7 +119,8 @@ function convertTemplateType(tokens) { var templateToken = { type: "Template", value: createTemplateValue(start, end), - range: [tokens[start].start, tokens[end].end], + start: tokens[start].start, + end: tokens[end].end, loc: { start: tokens[start].loc.start, end: tokens[end].loc.end @@ -175,12 +176,12 @@ function convertTemplateType(tokens) { var astTransformVisitor = { noScope: true, enter: function (node) { + node.range = [node.start, node.end]; + // private var to track original node type node._babelType = node.type; }, exit: function (node) { /* parent */ - node.range = [node.start, node.end]; - if (this.isSpreadProperty()) { node.type = "Property"; node.kind = "init"; From 18b029ca882eb7f204fa9fca24c7d0c49b989030 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 04:04:37 +0100 Subject: [PATCH 397/965] 4.0.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 287c11f46fe2..3ca955bd1237 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.3", + "version": "4.0.4", "description": "", "main": "index.js", "repository": { From f79577a7ec54c9a5fd547d106d87ab622b5ace44 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 04:07:19 +0100 Subject: [PATCH 398/965] add Makefile --- eslint/babel-eslint-parser/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 eslint/babel-eslint-parser/Makefile diff --git a/eslint/babel-eslint-parser/Makefile b/eslint/babel-eslint-parser/Makefile new file mode 100644 index 000000000000..c16045682f14 --- /dev/null +++ b/eslint/babel-eslint-parser/Makefile @@ -0,0 +1,7 @@ +.PHONY: publish-patch + +publish-patch: + mocha + npm version patch + npm publish + git push --tags From 436716fdd72ca67d406974503184e901919cc2f9 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 04:20:19 +0100 Subject: [PATCH 399/965] update babel-core to 5.6.9 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3ca955bd1237..b0fd855ecfef 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.6.4", + "babel-core": "^5.6.9", "lodash.assign": "^3.0.0", "lodash.pick": "^3.1.0" }, From 4255c0f812fb85ad1989d08903a5af42a567cae7 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 27 Jul 2015 04:20:26 +0100 Subject: [PATCH 400/965] 4.0.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b0fd855ecfef..6e7e7d9ae4b1 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.4", + "version": "4.0.5", "description": "", "main": "index.js", "repository": { From 71ab33eff419688a70623003ffda88cc2ec04e50 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 3 Aug 2015 10:57:06 -0400 Subject: [PATCH 401/965] update to eslint 1.0.0, fix tests --- eslint/babel-eslint-parser/package.json | 2 +- .../babel-eslint-parser/test/non-regression.js | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 6e7e7d9ae4b1..6d8c84a93fb7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^0.24.0", + "eslint": "^1.0.0", "espree": "^2.0.3", "mocha": "^2.2.5" } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c3f6721fd5d4..4683dc6f3637 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -39,7 +39,7 @@ describe("verify", function () { verifyAndAssertMessages( "module.exports = \"something\";", { "eol-last": 1, "semi": 1 }, - [ "1:1 Newline required at end of file but not found. eol-last" ] + [ "1:2 Newline required at end of file but not found. eol-last" ] ); }); @@ -47,7 +47,7 @@ describe("verify", function () { verifyAndAssertMessages( "{ , res }", {}, - [ "1:2 Unexpected token" ] + [ "1:3 Unexpected token" ] ); }); @@ -108,10 +108,11 @@ describe("verify", function () { ); }); + // fix after updating to ESLint 1.0.0 it("Arrow function with non-block bodies (issue #20)", function () { verifyAndAssertMessages( "\"use strict\"; () => 1", - { "strict": 1 }, + { "strict": [1, "global"] }, [] ); }); @@ -355,8 +356,8 @@ describe("verify", function () { "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:20 T is defined but never used no-unused-vars", - '2:7 "T" is not defined. no-undef' ] + [ "1:21 T is defined but never used no-unused-vars", + '2:8 "T" is not defined. no-undef' ] ); }); @@ -366,7 +367,7 @@ describe("verify", function () { "export class Foo extends Bar {}", ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ '2:29 "T" is not defined. no-undef' ] + [ '2:30 "T" is not defined. no-undef' ] ); }); @@ -1171,7 +1172,7 @@ describe("verify", function () { verifyAndAssertMessages( "var unused;", { "no-unused-vars": 1 }, - [ "1:4 unused is defined but never used no-unused-vars" ] + [ "1:5 unused is defined but never used no-unused-vars" ] ); }); @@ -1187,7 +1188,7 @@ describe("verify", function () { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:7 Bacona is defined but never used no-unused-vars" ] + [ "1:8 Bacona is defined but never used no-unused-vars" ] ); }); From 21294eb2283edec634a024c13891144f713c28ba Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 14 Aug 2015 22:00:10 -0400 Subject: [PATCH 402/965] update to eslint@1.1.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 6d8c84a93fb7..c1ec430846da 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.0.0", + "eslint": "^1.1.0", "espree": "^2.0.3", "mocha": "^2.2.5" } From 839c5ed57713e3a2a663886aabd08b127b484a54 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 14 Aug 2015 22:00:25 -0400 Subject: [PATCH 403/965] use --follow-tags --- eslint/babel-eslint-parser/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/Makefile b/eslint/babel-eslint-parser/Makefile index c16045682f14..53bfdbc78a5f 100644 --- a/eslint/babel-eslint-parser/Makefile +++ b/eslint/babel-eslint-parser/Makefile @@ -4,4 +4,4 @@ publish-patch: mocha npm version patch npm publish - git push --tags + git push --follow-tags From 6476a8d916917ddb75b7c156ae7b50d1d7e0d438 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 08:48:41 -0400 Subject: [PATCH 404/965] Merge pull request babel/babel-eslint#164 from hzoo/remove-rest-transform Remove rest transform --- .../babel-eslint-parser/acorn-to-esprima.js | 4 --- .../babel-eslint-parser/test/babel-eslint.js | 28 ++++++++++--------- .../test/non-regression.js | 7 +++++ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 4c1210857461..c0d02a539244 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -190,10 +190,6 @@ var astTransformVisitor = { delete node.argument; } - if (this.isRestElement()) { - return node.argument; - } - // flow: prevent "no-undef" // for "Component" in: "let x: React.Component" if (this.isQualifiedTypeIdentifier()) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 9f0b2850684c..05983d998236 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -35,27 +35,29 @@ function parseAndAssertSame(code) { var esAST = espree.parse(code, { ecmaFeatures: { arrowFunctions: true, - blockBindings: true, - destructuring: true, - regexYFlag: true, - regexUFlag: true, - templateStrings: true, binaryLiterals: true, - octalLiterals: true, - unicodeCodePointEscapes: true, + blockBindings: true, + classes: true, defaultParams: true, - restParams: true, + destructuring: true, forOf: true, + generators: true, + modules: true, objectLiteralComputedProperties: true, + objectLiteralDuplicateProperties: true, objectLiteralShorthandMethods: true, objectLiteralShorthandProperties: true, - objectLiteralDuplicateProperties: true, - generators: true, + octalLiterals: true, + regexUFlag: true, + regexYFlag: true, + restParams: true, spread: true, - classes: true, - modules: true, + superInFunctions: true, + templateStrings: true, + unicodeCodePointEscapes: true, + globalReturn: true, jsx: true, - globalReturn: true + experimentalObjectRestSpread: true, }, tokens: true, loc: true, diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4683dc6f3637..1dc559b8b131 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1273,4 +1273,11 @@ describe("verify", function () { [ ] ) }); + + it("no no-undef error with rest #11", function () { + verifyAndAssertMessages("const [a, ...rest] = ['1', '2', '3']; a; rest;", + { "no-undef": 1, "no-unused-vars": 1 }, + [ ] + ) + }); }); From cd0f5ccc93b02970f10f84c73ee7bf48f895cdb2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 09:24:14 -0400 Subject: [PATCH 405/965] add older tests --- .../test/non-regression.js | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1dc559b8b131..688b08e87b16 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -54,7 +54,9 @@ describe("verify", function () { it("Modules support (issue #5)", function () { verifyAndAssertMessages( "import Foo from 'foo';\n" + - "export default Foo;", + "export default Foo;\n" + + "export const c = 'c';\n" + + "export class Store {}", {}, [] ); @@ -125,6 +127,26 @@ describe("verify", function () { ); }); + it("arrow functions (issue #27)", function () { + verifyAndAssertMessages( + "[1, 2, 3].map(i => i * 2);", + { "func-names": 1, "space-before-blocks": 1 }, + [] + ); + }); + + it("comment with padded-blocks (issue #33)", function () { + verifyAndAssertMessages([ + "if (a){", + "// i'm a comment!", + "let b = c", + "}" + ].join("\n"), + { "padded-blocks": [1, "never"] }, + [] + ); + }); + describe("flow", function () { it("check regular function", function () { verifyAndAssertMessages([ @@ -967,7 +989,7 @@ describe("verify", function () { ); }); - it("class properties", function () { + it("class properties #71", function () { verifyAndAssertMessages( "class Lol { foo = 'bar'; }", { "no-undef": 1 }, From 7d8de4e2ae5a618a18ecd4875e146d5154e7d422 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 09:25:14 -0400 Subject: [PATCH 406/965] 4.0.6 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c1ec430846da..8945271bbb8f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.5", + "version": "4.0.6", "description": "", "main": "index.js", "repository": { From 69c303ea00d44d23a7bd3c55495ead8dd21d74d7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 19:49:21 -0400 Subject: [PATCH 407/965] Merge pull request babel/babel-eslint#166 from hzoo/remove-async-transform remove async func transform --- eslint/babel-eslint-parser/acorn-to-esprima.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index c0d02a539244..3dab2d6e104b 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -235,11 +235,6 @@ var astTransformVisitor = { // functions - if (this.isFunction()) { - if (node.async) node.generator = true; - delete node.async; - } - if (this.isAwaitExpression()) { node.type = "YieldExpression"; node.delegate = node.all; From 5b577637882c1a639ec4cd08e78774bc9220c235 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 19:49:44 -0400 Subject: [PATCH 408/965] 4.0.7 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8945271bbb8f..90a7ac27b9b3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.6", + "version": "4.0.7", "description": "", "main": "index.js", "repository": { From 9740af8be40823fcd62af6cbb793bb58e1aebe3a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 16:11:57 -0400 Subject: [PATCH 409/965] Merge pull request babel/babel-eslint#169 from hzoo/i-168 async func and space-before-function-paren --- eslint/babel-eslint-parser/acorn-to-esprima.js | 4 ++++ eslint/babel-eslint-parser/test/non-regression.js | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 3dab2d6e104b..121d26c5882d 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -235,6 +235,10 @@ var astTransformVisitor = { // functions + if (this.isFunction()) { + if (node.async) node.generator = true; + } + if (this.isAwaitExpression()) { node.type = "YieldExpression"; node.delegate = node.all; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 688b08e87b16..3bdd61553714 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1302,4 +1302,11 @@ describe("verify", function () { [ ] ) }); + + it("async function with space-before-function-paren #168", function () { + verifyAndAssertMessages("it('handles updates', async function() {});", + { "space-before-function-paren": [1, "never"] }, + [ ] + ) + }); }); From d06c0033440a78ae1ece868531a684935c3d0a7d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 16:12:18 -0400 Subject: [PATCH 410/965] 4.0.8 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 90a7ac27b9b3..cdf495cf6350 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.7", + "version": "4.0.8", "description": "", "main": "index.js", "repository": { From 2140a08e3e0c2575915e7e843a4a4d5d22280e78 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 21:54:01 -0400 Subject: [PATCH 411/965] Merge pull request babel/babel-eslint#170 from hzoo/remove-super-transform remove super transform since it should be in espree --- eslint/babel-eslint-parser/acorn-to-esprima.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index 121d26c5882d..f5ce569bb682 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -223,30 +223,24 @@ var astTransformVisitor = { } } - // classes - - if (this.isReferencedIdentifier({ name: "super" })) { - return t.inherits(t.thisExpression(), node); - } - + // remove class property keys (or patch in escope) if (this.isClassProperty()) { delete node.key; } - // functions - + // async function as generator if (this.isFunction()) { if (node.async) node.generator = true; } + // await transform to yield if (this.isAwaitExpression()) { node.type = "YieldExpression"; node.delegate = node.all; delete node.all; } - // template strings - + // template string range fixes if (this.isTemplateLiteral()) { node.quasis.forEach(function (q) { q.range[0] -= 1; From 8d46c00125293679277d0306d796503345070cee Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 22:33:38 -0400 Subject: [PATCH 412/965] 4.0.9 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cdf495cf6350..84d04f0744cf 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.8", + "version": "4.0.9", "description": "", "main": "index.js", "repository": { From e8c6b4e98874ad499280ad6be9cf114de223c43f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 22:48:56 -0400 Subject: [PATCH 413/965] Merge pull request babel/babel-eslint#165 from hzoo/remove-spread-transform use SpreadProperty type, revert other transforms --- eslint/babel-eslint-parser/acorn-to-esprima.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js index f5ce569bb682..729e47ed7f65 100644 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ b/eslint/babel-eslint-parser/acorn-to-esprima.js @@ -183,11 +183,8 @@ var astTransformVisitor = { }, exit: function (node) { /* parent */ if (this.isSpreadProperty()) { - node.type = "Property"; - node.kind = "init"; - node.computed = true; + node.type = "SpreadProperty"; node.key = node.value = node.argument; - delete node.argument; } // flow: prevent "no-undef" From 03492bae52f08185b6f015ff008e6db70a8dea63 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 16 Aug 2015 22:49:15 -0400 Subject: [PATCH 414/965] 4.0.10 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 84d04f0744cf..60a6d3514a52 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.9", + "version": "4.0.10", "description": "", "main": "index.js", "repository": { From fea7ef937e5719902df76187d9df64c43bb5eae4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 19 Aug 2015 09:46:50 -0400 Subject: [PATCH 415/965] remove note about babel-eslint being experimental --- eslint/babel-eslint-parser/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 7556b2998fc0..157169ba35b2 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -3,17 +3,16 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -**NOTE:** Please note that this is experimental and may have numerous bugs. It is however -successfuly linting the [babel core](https://github.com/babel/babel/blob/master/.eslintrc). +`babel-eslint` is successfully linting [babel core](https://github.com/babel/babel/blob/master/.eslintrc) and many other projects. > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! For questions and support please visit the [`#linting`](https://babeljs.slack.com/messages/linting/) babel slack channel (sign up [here](https://babel-slack.herokuapp.com))! ## Known Issues -Flow: +Flow: - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` + - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) Modules/strict mode @@ -22,7 +21,7 @@ Modules/strict mode Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues - `no-unused-vars` with jsx -Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for the issues below: +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues such as: - `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) - `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) From 412aee0be0224034340cce48dd5e94ed4a091df0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 20 Aug 2015 14:39:37 -0400 Subject: [PATCH 416/965] update eslint to 1.2.0 --- eslint/babel-eslint-parser/eslint | 2 +- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/eslint b/eslint/babel-eslint-parser/eslint index b89d293dcff7..8f6f543b2952 160000 --- a/eslint/babel-eslint-parser/eslint +++ b/eslint/babel-eslint-parser/eslint @@ -1 +1 @@ -Subproject commit b89d293dcff77b52eb39902e1e2453fc6678850a +Subproject commit 8f6f543b2952e439ba5e158b3f0bcfd150ab3914 diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 60a6d3514a52..dc9e5d4080e5 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.1.0", + "eslint": "file:eslint", "espree": "^2.0.3", "mocha": "^2.2.5" } From ac163a64fe6bed5dc3f1aaeedd6b6aeda286d130 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 20 Aug 2015 14:41:06 -0400 Subject: [PATCH 417/965] do not use local --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dc9e5d4080e5..26c40c935bba 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "file:eslint", + "eslint": "^1.2.1", "espree": "^2.0.3", "mocha": "^2.2.5" } From 8812bf735ec3ecb5c7754478569fb3778b076556 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 20 Aug 2015 15:04:30 -0400 Subject: [PATCH 418/965] update espree, update eslintester for eslint 1.0 --- eslint/babel-eslint-parser/eslint-tester.js | 2 +- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/eslint-tester.js b/eslint/babel-eslint-parser/eslint-tester.js index 52924fa93983..905a625d4689 100644 --- a/eslint/babel-eslint-parser/eslint-tester.js +++ b/eslint/babel-eslint-parser/eslint-tester.js @@ -1,4 +1,4 @@ -var ESLintTester = require("./eslint/node_modules/eslint-tester"); +var ESLintTester = require("./eslint").RuleTester; console.log("Use babel-eslint for test suite"); ESLintTester.setDefaultConfig({ diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 5a94fee62575..8d93ced41d4c 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -415,7 +415,7 @@ exports.parse = function (code) { var opts = { locations: true, - ranges: true, + ranges: true }; var comments = opts.onComment = []; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 26c40c935bba..69ed11382a25 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -14,7 +14,7 @@ }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", - "eslint": "cd eslint && mocha -c tests/lib/rules/**/*.js -r ../eslint-tester.js", + "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha" }, "author": "Sebastian McKenzie ", @@ -25,7 +25,7 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "eslint": "^1.2.1", - "espree": "^2.0.3", + "espree": "^2.2.4", "mocha": "^2.2.5" } } From b2405a9924cbd99860d4a0754192ced81a50d934 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 20 Aug 2015 15:07:05 -0400 Subject: [PATCH 419/965] lint fix, lint task --- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 8d93ced41d4c..fad1f83b7a48 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -327,7 +327,7 @@ function monkeypatch() { } else if (left.type === "ObjectPattern") { for (var i = 0; i < left.properties.length; i++) { var name = left.properties[i]; - if (name && name.key && name.key.type === 'Identifier') { + if (name && name.key && name.key.type === "Identifier") { scope.__define(name.key, new Definition("ComprehensionElement", name.key, name.key)); } } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 69ed11382a25..57c13dead393 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,8 @@ "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", - "test": "mocha" + "test": "mocha", + "lint": "./node_modules/eslint/bin/eslint.js ./test index.js acorn-to-esprima.js" }, "author": "Sebastian McKenzie ", "license": "MIT", From 4cdf59532ddcd8e8c5d6fb45610e439e435ac767 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Aug 2015 12:11:24 -0400 Subject: [PATCH 420/965] Merge pull request babel/babel-eslint#177 from hzoo/use-acorn-to-esprima use `acorn-to-esprima` package --- .../babel-eslint-parser/acorn-to-esprima.js | 258 ------------------ eslint/babel-eslint-parser/index.js | 70 +---- eslint/babel-eslint-parser/package.json | 3 +- 3 files changed, 15 insertions(+), 316 deletions(-) delete mode 100644 eslint/babel-eslint-parser/acorn-to-esprima.js diff --git a/eslint/babel-eslint-parser/acorn-to-esprima.js b/eslint/babel-eslint-parser/acorn-to-esprima.js deleted file mode 100644 index 729e47ed7f65..000000000000 --- a/eslint/babel-eslint-parser/acorn-to-esprima.js +++ /dev/null @@ -1,258 +0,0 @@ -var traverse = require("babel-core").traverse; -var tt = require("babel-core").acorn.tokTypes; -var t = require("babel-core").types; - -exports.toToken = function (token) { - var type = token.type; - token.range = [token.start, token.end]; - - if (type === tt.name) { - token.type = "Identifier"; - } else if (type === tt.semi || type === tt.comma || - type === tt.parenL || type === tt.parenR || - type === tt.braceL || type === tt.braceR || - type === tt.slash || type === tt.dot || - type === tt.bracketL || type === tt.bracketR || - type === tt.ellipsis || type === tt.arrow || - type === tt.star || type === tt.incDec || - type === tt.colon || type === tt.question || - type === tt.template || type === tt.backQuote || - type === tt.dollarBraceL || type === tt.at || - type === tt.logicalOR || type === tt.logicalAND || - type === tt.bitwiseOR || type === tt.bitwiseXOR || - type === tt.bitwiseAND || type === tt.equality || - type === tt.relational || type === tt.bitShift || - type === tt.plusMin || type === tt.modulo || - type === tt.exponent || type === tt.prefix || - type === tt.doubleColon || - type.isAssign) { - token.type = "Punctuator"; - if (!token.value) token.value = type.label; - } else if (type === tt.jsxTagStart) { - token.type = "Punctuator"; - token.value = "<"; - } else if (type === tt.jsxTagEnd) { - token.type = "Punctuator"; - token.value = ">"; - } else if (type === tt.jsxName) { - token.type = "JSXIdentifier"; - } else if (type === tt.jsxText) { - token.type = "JSXText"; - } else if (type.keyword === "null") { - token.type = "Null"; - } else if (type.keyword === "false" || type.keyword === "true") { - token.type = "Boolean"; - } else if (type.keyword) { - token.type = "Keyword"; - } else if (type === tt.num) { - token.type = "Numeric"; - token.value = String(token.value); - } else if (type === tt.string) { - token.type = "String"; - token.value = JSON.stringify(token.value); - } else if (type === tt.regexp) { - token.type = "RegularExpression"; - token.regex = { - pattern: token.value.pattern, - flags: token.value.flags - }; - token.value = String(token.value.value); - } - - return token; -}; - -exports.toAST = function (ast) { - ast.sourceType = "module"; - ast.range = [ast.start, ast.end]; - traverse(ast, astTransformVisitor); -}; - -exports.toTokens = function (tokens) { - // transform tokens to type "Template" - convertTemplateType(tokens); - - return tokens.filter(function (token) { - return token.type !== "CommentLine" && token.type !== "CommentBlock"; - }).map(exports.toToken); -}; - -function convertTemplateType(tokens) { - var startingToken = 0; - var currentToken = 0; - // track use of {} - var numBraces = 0; - // track number of nested templates - var numBackQuotes = 0; - - function isBackQuote(token) { - return tokens[token].type === tt.backQuote; - } - - function isTemplateStarter(token) { - return isBackQuote(token) || - // only can be a template starter when in a template already - tokens[token].type === tt.braceR && numBackQuotes > 0; - } - - function isTemplateEnder(token) { - return isBackQuote(token) || - tokens[token].type === tt.dollarBraceL; - } - - // append the values between start and end - function createTemplateValue(start, end) { - var value = ""; - while (start <= end) { - if (tokens[start].value) { - value += tokens[start].value; - } else if (tokens[start].type !== tt.template) { - value += tokens[start].type.label; - } - start++; - } - return value; - } - - // create Template token - function replaceWithTemplateType(start, end) { - var templateToken = { - type: "Template", - value: createTemplateValue(start, end), - start: tokens[start].start, - end: tokens[end].end, - loc: { - start: tokens[start].loc.start, - end: tokens[end].loc.end - } - }; - - // put new token in place of old tokens - tokens.splice(start, end - start + 1, templateToken); - } - - function trackNumBraces(token) { - if (tokens[token].type === tt.braceL) { - numBraces++; - } else if (tokens[token].type === tt.braceR) { - numBraces--; - } - } - - while (startingToken < tokens.length) { - // template start: check if ` or } - if (isTemplateStarter(startingToken) && numBraces === 0) { - if (isBackQuote(startingToken)) { - numBackQuotes++; - } - - currentToken = startingToken + 1; - - // check if token after template start is "template" - if (currentToken >= tokens.length - 1 || tokens[currentToken].type !== tt.template) { - break; - } - - // template end: find ` or ${ - while (!isTemplateEnder(currentToken)) { - if (currentToken >= tokens.length - 1) { - break; - } - currentToken++; - } - - if (isBackQuote(currentToken)) { - numBackQuotes--; - } - // template start and end found: create new token - replaceWithTemplateType(startingToken, currentToken); - } else if (numBackQuotes > 0) { - trackNumBraces(startingToken); - } - startingToken++; - } -} - -var astTransformVisitor = { - noScope: true, - enter: function (node) { - node.range = [node.start, node.end]; - - // private var to track original node type - node._babelType = node.type; - }, - exit: function (node) { /* parent */ - if (this.isSpreadProperty()) { - node.type = "SpreadProperty"; - node.key = node.value = node.argument; - } - - // flow: prevent "no-undef" - // for "Component" in: "let x: React.Component" - if (this.isQualifiedTypeIdentifier()) { - delete node.id; - } - // for "b" in: "var a: { b: Foo }" - if (this.isObjectTypeProperty()) { - delete node.key; - } - // for "indexer" in: "var a: {[indexer: string]: number}" - if (this.isObjectTypeIndexer()) { - delete node.id; - } - // for "param" in: "var a: { func(param: Foo): Bar };" - if (this.isFunctionTypeParam()) { - delete node.name; - } - - // modules - - if (this.isImportDeclaration()) { - delete node.isType; - } - - if (this.isExportDeclaration()) { - var declar = this.get("declaration"); - if (declar.isClassExpression()) { - node.declaration.type = "ClassDeclaration"; - } else if (declar.isFunctionExpression()) { - node.declaration.type = "FunctionDeclaration"; - } - } - - // remove class property keys (or patch in escope) - if (this.isClassProperty()) { - delete node.key; - } - - // async function as generator - if (this.isFunction()) { - if (node.async) node.generator = true; - } - - // await transform to yield - if (this.isAwaitExpression()) { - node.type = "YieldExpression"; - node.delegate = node.all; - delete node.all; - } - - // template string range fixes - if (this.isTemplateLiteral()) { - node.quasis.forEach(function (q) { - q.range[0] -= 1; - if (q.tail) { - q.range[1] += 1; - } else { - q.range[1] += 2; - } - q.loc.start.column -= 1; - if (q.tail) { - q.loc.end.column += 1; - } else { - q.loc.end.column += 2; - } - }); - } - } -}; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index fad1f83b7a48..279fd25eb488 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,10 +1,12 @@ -var acornToEsprima = require("./acorn-to-esprima"); +var acornToEsprima = require("acorn-to-esprima"); var assign = require("lodash.assign"); var pick = require("lodash.pick"); var Module = require("module"); -var parse = require("babel-core").parse; var path = require("path"); +var parse = require("babel-core").parse; var t = require("babel-core").types; +var tt = require("babel-core").acorn.tokTypes; +var traverse = require("babel-core").traverse; var estraverse; var hasPatched = false; @@ -362,49 +364,6 @@ function monkeypatch() { }; } -exports.attachComments = function (ast, comments, tokens) { - if (comments.length) { - var firstComment = comments[0]; - var lastComment = comments[comments.length - 1]; - // fixup program start - if (!tokens.length) { - // if no tokens, the program starts at the end of the last comment - ast.start = lastComment.end; - ast.loc.start.line = lastComment.loc.end.line; - ast.loc.start.column = lastComment.loc.end.column; - } else if (firstComment.start < tokens[0].start) { - // if there are comments before the first token, the program starts at the first token - var token = tokens[0]; - ast.start = token.start; - ast.loc.start.line = token.loc.start.line; - ast.loc.start.column = token.loc.start.column; - - // estraverse do not put leading comments on first node when the comment - // appear before the first token - if (ast.body.length) { - var node = ast.body[0]; - node.leadingComments = []; - var firstTokenStart = token.start; - var len = comments.length; - for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { - node.leadingComments.push(comments[i]); - } - } - } - // fixup program end - if (tokens.length) { - var lastToken = tokens[tokens.length - 1]; - if (lastComment.end > lastToken.end) { - // If there is a comment after the last token, the program ends at the - // last token and not the comment - ast.end = lastToken.end; - ast.loc.end.line = lastToken.loc.end.line; - ast.loc.end.column = lastToken.loc.end.column; - } - } - } -}; - exports.parse = function (code) { try { monkeypatch(); @@ -413,6 +372,10 @@ exports.parse = function (code) { process.exit(1); } + return exports.parseNoPatch(code); +} + +exports.parseNoPatch = function (code) { var opts = { locations: true, ranges: true @@ -442,22 +405,15 @@ exports.parse = function (code) { tokens.pop(); // convert tokens - ast.tokens = acornToEsprima.toTokens(tokens); + ast.tokens = acornToEsprima.toTokens(tokens, tt); // add comments - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - if (comment.type === "CommentBlock") { - comment.type = "Block"; - } else if (comment.type === "CommentLine") { - comment.type = "Line"; - } - } + acornToEsprima.convertComments(comments); ast.comments = comments; - exports.attachComments(ast, comments, ast.tokens); + acornToEsprima.attachComments(ast, comments, ast.tokens); // transform esprima and acorn divergent nodes - acornToEsprima.toAST(ast); + acornToEsprima.toAST(ast, traverse); return ast; -}; +} \ No newline at end of file diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 57c13dead393..d477eb2529f6 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -10,7 +10,8 @@ "dependencies": { "babel-core": "^5.6.9", "lodash.assign": "^3.0.0", - "lodash.pick": "^3.1.0" + "lodash.pick": "^3.1.0", + "acorn-to-esprima": "^1.0.1" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", From 61243967ac2dd56088c27200b58acbaef4de3fcd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Aug 2015 12:14:17 -0400 Subject: [PATCH 421/965] 4.1.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d477eb2529f6..fad52967c0c4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.0.10", + "version": "4.1.0", "description": "", "main": "index.js", "repository": { From 2b17528c5d8aaf9a74acbf1af846ab32ed2c63ad Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 31 Aug 2015 10:22:52 -0400 Subject: [PATCH 422/965] Merge pull request babel/babel-eslint#180 from hzoo/master update eslint, acorn-to-esprima - ref eslint/eslint#3596 --- eslint/babel-eslint-parser/package.json | 6 +++--- eslint/babel-eslint-parser/test/babel-eslint.js | 8 ++++++++ eslint/babel-eslint-parser/test/non-regression.js | 6 +++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index fad52967c0c4..03d1045cab53 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,10 +8,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.6.9", + "babel-core": "^5.8.23", "lodash.assign": "^3.0.0", "lodash.pick": "^3.1.0", - "acorn-to-esprima": "^1.0.1" + "acorn-to-esprima": "^1.0.2" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.2.1", + "eslint": "^1.3.1", "espree": "^2.2.4", "mocha": "^2.2.5" } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 05983d998236..3ef824046cc6 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -294,4 +294,12 @@ describe("acorn-to-esprima", function () { it("regexp in a template string", function () { parseAndAssertSame("`${/\\d/.exec(\"1\")[0]}`"); }); + + it("first line is empty", function () { + parseAndAssertSame("\nimport Immutable from \"immutable\";"); + }); + + it("empty", function () { + parseAndAssertSame(""); + }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3bdd61553714..c268199fadb6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -378,7 +378,7 @@ describe("verify", function () { "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:21 T is defined but never used no-unused-vars", + [ "1:21 \"T\" is defined but never used no-unused-vars", '2:8 "T" is not defined. no-undef' ] ); }); @@ -1194,7 +1194,7 @@ describe("verify", function () { verifyAndAssertMessages( "var unused;", { "no-unused-vars": 1 }, - [ "1:5 unused is defined but never used no-unused-vars" ] + [ "1:5 \"unused\" is defined but never used no-unused-vars" ] ); }); @@ -1210,7 +1210,7 @@ describe("verify", function () { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:8 Bacona is defined but never used no-unused-vars" ] + [ "1:8 \"Bacona\" is defined but never used no-unused-vars" ] ); }); From 229a1922d85e1cc5ad4236a54249fcb2fdb60303 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 31 Aug 2015 10:23:10 -0400 Subject: [PATCH 423/965] 4.1.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 03d1045cab53..e15825c747c3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.0", + "version": "4.1.1", "description": "", "main": "index.js", "repository": { From 742b1cb65dccc3582bba53a5245f3188d958d3d1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 11 Sep 2015 18:38:53 -0400 Subject: [PATCH 424/965] Merge pull request babel/babel-eslint#182 from bryanrsmith/patch-1 fix typo in comment --- eslint/babel-eslint-parser/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 279fd25eb488..f89554f13097 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -84,7 +84,7 @@ function monkeypatch() { } var Definition = require(definitionLoc).Definition; - // if there are decotators, then visit each + // if there are decorators, then visit each function visitDecorators(node) { if (!node.decorators) { return; @@ -416,4 +416,4 @@ exports.parseNoPatch = function (code) { acornToEsprima.toAST(ast, traverse); return ast; -} \ No newline at end of file +} From c0a7ebf51b56130668c0f3dce815a10d0f37eeb0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 14 Sep 2015 14:26:21 -0400 Subject: [PATCH 425/965] fix attachComment typo, add comment tests --- .../babel-eslint-parser/test/babel-eslint.js | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 3ef824046cc6..216717312cb8 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -63,7 +63,7 @@ function parseAndAssertSame(code) { loc: true, range: true, comment: true, - attachComments: true + attachComment: true }); var acornAST = babelEslint.parse(code); try { @@ -302,4 +302,29 @@ describe("acorn-to-esprima", function () { it("empty", function () { parseAndAssertSame(""); }); + + it("jsdoc", function () { + parseAndAssertSame([ + "/**", + "* @param {object} options", + "* @return {number}", + "*/", + "const test = function({ a, b, c }) {", + "return a + b + c;", + "};", + "module.exports = test;" + ].join("\n")); + }) + + it("empty block with comment", function () { + parseAndAssertSame([ + "function a () {", + "try {", + "b();", + "} catch (e) {", + "// asdf", + "}", + "}" + ].join("\n")); + }) }); From 95c4c77df19ec5f2e4791230a43e16d91ce0c47b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 14 Sep 2015 14:45:10 -0400 Subject: [PATCH 426/965] 4.1.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e15825c747c3..959b269743e6 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.1", + "version": "4.1.2", "description": "", "main": "index.js", "repository": { From cc4ce5bbeda49531e9a383b2d49fe5aa323de21f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 14 Sep 2015 14:48:14 -0400 Subject: [PATCH 427/965] add node 4 to travis --- eslint/babel-eslint-parser/.travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 8ac23aee56e0..551529748b9a 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -5,3 +5,4 @@ language: node_js node_js: - '0.12' - 'io.js' + - '4' \ No newline at end of file From 6dc026c203db869f3da77101ed29cc1dbcd0fc0e Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 15 Sep 2015 09:20:14 -0400 Subject: [PATCH 428/965] un-comment babel/babel-eslint#124 test --- .../test/non-regression.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c268199fadb6..0dbea848c2fc 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1262,21 +1262,21 @@ describe("verify", function () { ); }); - // it("line comment space-in-parens #124", function () { - // verifyAndAssertMessages( - // [ - // "React.createClass({", - // "render() {", - // "// return (", - // "//
", - // "// ); // <-- this is the line that is reported", - // "}", - // "});" - // ].join("\n"), - // { "space-in-parens": 1 }, - // [ ] - // ) - // }); + it("line comment space-in-parens #124", function () { + verifyAndAssertMessages( + [ + "React.createClass({", + "render() {", + "// return (", + "//
", + "// ); // <-- this is the line that is reported", + "}", + "});" + ].join("\n"), + { "space-in-parens": 1 }, + [ ] + ) + }); it("block comment space-in-parens #124", function () { verifyAndAssertMessages( From b5e0dbe8e876f14b584241a89aa7800342082849 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Sep 2015 09:42:18 -0400 Subject: [PATCH 429/965] check AssignmentPattern types - fixes babel/babel-eslint#184 --- eslint/babel-eslint-parser/index.js | 9 +++++++-- .../test/non-regression.js | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f89554f13097..3cf0b6537ed9 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -244,8 +244,13 @@ function monkeypatch() { // only visit if function parameters have types if (node.params) { for (var i = 0; i < node.params.length; i++) { - if (node.params[i].typeAnnotation) { - checkIdentifierOrVisit.call(this, node.params[i]); + var param = node.params[i]; + if (param.typeAnnotation) { + checkIdentifierOrVisit.call(this, param); + } else if (t.isAssignmentPattern(param)) { + if (param.left.typeAnnotation) { + checkIdentifierOrVisit.call(this, param.left); + } } } } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 0dbea848c2fc..f24bad04e559 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1309,4 +1309,23 @@ describe("verify", function () { [ ] ) }); + + it("default param flow type no-unused-vars #184", function () { + verifyAndAssertMessages( + [ + "type ResolveOptionType = {", + "depth?: number,", + "identifier?: string", + "};", + "", + "export default function resolve(", + "options: ResolveOptionType = {}", + "): Object {", + "options;", + "}", + ].join("\n"), + { "no-unused-vars": 1, "no-undef": 1 }, + [ ] + ) + }); }); From 463cda9a1097260bcf0089082cd5a50fee498aec Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Sep 2015 09:42:26 -0400 Subject: [PATCH 430/965] 4.1.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 959b269743e6..d3a0ddd00c25 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.2", + "version": "4.1.3", "description": "", "main": "index.js", "repository": { From afd72ba541f2086f82fcb637c79640cb7912a6a1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 7 Oct 2015 20:05:11 -0400 Subject: [PATCH 431/965] update packages --- eslint/babel-eslint-parser/package.json | 12 ++++++------ eslint/babel-eslint-parser/test/non-regression.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d3a0ddd00c25..3eb79410c310 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,10 +8,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.8.23", - "lodash.assign": "^3.0.0", + "babel-core": "^5.8.25", + "lodash.assign": "^3.2.0", "lodash.pick": "^3.1.0", - "acorn-to-esprima": "^1.0.2" + "acorn-to-esprima": "^1.0.4" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", @@ -26,8 +26,8 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.3.1", - "espree": "^2.2.4", - "mocha": "^2.2.5" + "eslint": "^1.6.0", + "espree": "^2.2.5", + "mocha": "^2.3.3" } } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index f24bad04e559..888ed6eda874 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -47,7 +47,7 @@ describe("verify", function () { verifyAndAssertMessages( "{ , res }", {}, - [ "1:3 Unexpected token" ] + [ "1:3 Parsing error: Unexpected token" ] ); }); From dd8ba490ee7cbd651e8dfe5846d000ac8a3f3b7d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 7 Oct 2015 20:11:00 -0400 Subject: [PATCH 432/965] update readme, add contributing --- eslint/babel-eslint-parser/CONTRIBUTING.md | 11 +++++++++++ eslint/babel-eslint-parser/README.md | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-parser/CONTRIBUTING.md diff --git a/eslint/babel-eslint-parser/CONTRIBUTING.md b/eslint/babel-eslint-parser/CONTRIBUTING.md new file mode 100644 index 000000000000..c03d5e74e105 --- /dev/null +++ b/eslint/babel-eslint-parser/CONTRIBUTING.md @@ -0,0 +1,11 @@ +# Contributing + +Thanks for contributing! + +If you're about to report an issue - please first check if it's already been reported in the [issues page](https://github.com/babel/babel-eslint/issues). + +Also check to see if the latest versions of eslint/babel-eslint still produce the issue. + +Also check out the [Known Issues](https://github.com/babel/babel-eslint#known-issues) section of the README. + +If you are having issues with JSX you might want to check out eslint-plugin-react. If there's an issue with new experimental syntax you might need to report that in eslint-plugin-babel instead. diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 157169ba35b2..df81ef8a3ef0 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -9,6 +9,8 @@ For questions and support please visit the [`#linting`](https://babeljs.slack.com/messages/linting/) babel slack channel (sign up [here](https://babel-slack.herokuapp.com))! +> Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`) + ## Known Issues Flow: - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) @@ -21,7 +23,7 @@ Modules/strict mode Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues - `no-unused-vars` with jsx -Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues such as: +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues such as (and more): - `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) - `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) From b4fb1d3acae76e8fa5b684ce2218cea408acf916 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 7 Oct 2015 20:23:41 -0400 Subject: [PATCH 433/965] test with ecmaFeatures on by default, add test for babel/babel-eslint#192 Ref babel/babel-eslint#192 --- .../test/non-regression.js | 48 +++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 888ed6eda874..3e749b6ffeda 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -2,7 +2,34 @@ "use strict"; var eslint = require("eslint"); -function verifyAndAssertMessages(code, rules, expectedMessages) { +function verifyAndAssertMessages(code, rules, expectedMessages, features) { + var defaultEcmaFeatures = { + arrowFunctions: true, + binaryLiterals: true, + blockBindings: true, + classes: true, + defaultParams: true, + destructuring: true, + forOf: true, + generators: true, + modules: true, + objectLiteralComputedProperties: true, + objectLiteralDuplicateProperties: true, + objectLiteralShorthandMethods: true, + objectLiteralShorthandProperties: true, + octalLiterals: true, + regexUFlag: true, + regexYFlag: true, + restParams: true, + spread: true, + superInFunctions: true, + templateStrings: true, + unicodeCodePointEscapes: true, + globalReturn: true, + jsx: true, + experimentalObjectRestSpread: true + }; + var messages = eslint.linter.verify( code, { @@ -10,7 +37,8 @@ function verifyAndAssertMessages(code, rules, expectedMessages) { rules: rules, env: { node: true - } + }, + ecmaFeatures: features || defaultEcmaFeatures } ); @@ -111,11 +139,12 @@ describe("verify", function () { }); // fix after updating to ESLint 1.0.0 - it("Arrow function with non-block bodies (issue #20)", function () { + it.skip("Arrow function with non-block bodies (issue #20)", function () { verifyAndAssertMessages( "\"use strict\"; () => 1", { "strict": [1, "global"] }, - [] + [], + { modules: false } ); }); @@ -1328,4 +1357,15 @@ describe("verify", function () { [ ] ) }); + + it("no-use-before-define #192", function () { + verifyAndAssertMessages( + [ + "console.log(x);", + "var x = 1;" + ].join("\n"), + { "no-use-before-define": 1 }, + [ "1:13 x was used before it was defined no-use-before-define" ] + ) + }); }); From 677d42f7ad5b914ada7af7f68044ead4d28904c1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 1 Nov 2015 10:10:08 -0500 Subject: [PATCH 434/965] update eslint, acorn-to-esprima --- eslint/babel-eslint-parser/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3eb79410c310..7eea170d803f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,10 +8,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.8.25", + "babel-core": "^5.8.33", "lodash.assign": "^3.2.0", "lodash.pick": "^3.1.0", - "acorn-to-esprima": "^1.0.4" + "acorn-to-esprima": "^1.0.5" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.6.0", + "eslint": "^1.8.0", "espree": "^2.2.5", "mocha": "^2.3.3" } From d08053d483ef645ba51369b8f76c93b462dc84d0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 4 Nov 2015 09:51:00 -0500 Subject: [PATCH 435/965] 4.1.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7eea170d803f..cd3c43dbbbf3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.3", + "version": "4.1.4", "description": "", "main": "index.js", "repository": { From a294ab4545e60be6153e856bf8babf5c3c2c2cc4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 9 Nov 2015 21:04:45 -0500 Subject: [PATCH 436/965] Merge pull request babel/babel-eslint#206 from mysticatea/fix-for-eslint-1.9 Fix for ESLint@1.9 and npm@3 --- eslint/babel-eslint-parser/index.js | 6 ++++++ eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3cf0b6537ed9..4f72a11558b1 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -55,6 +55,12 @@ function monkeypatch() { var estraverseFb = eslintMod.require("estraverse-fb"); assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); + // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 + var estraverseOfEslint = eslintMod.require("estraverse"); + if (estraverseOfEslint !== estraverseFb) { + assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); + } + // monkeypatch escope var escope = require(escopeLoc); var analyze = escope.analyze; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cd3c43dbbbf3..dc3319204f7f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -26,7 +26,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.8.0", + "eslint": "^1.9.0", "espree": "^2.2.5", "mocha": "^2.3.3" } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3e749b6ffeda..3022560e01b7 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1365,7 +1365,7 @@ describe("verify", function () { "var x = 1;" ].join("\n"), { "no-use-before-define": 1 }, - [ "1:13 x was used before it was defined no-use-before-define" ] + [ "1:13 \"x\" was used before it was defined no-use-before-define" ] ) }); }); From 8f9cc6b8275765149d9dd82f2770568edd9c6381 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 9 Nov 2015 21:11:56 -0500 Subject: [PATCH 437/965] 4.1.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dc3319204f7f..a7a1c275b785 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.4", + "version": "4.1.5", "description": "", "main": "index.js", "repository": { From 5352ad41c563cd0a73f6ef327f097727c4661664 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 15 Nov 2015 20:59:48 -0500 Subject: [PATCH 438/965] mention eslint-plugin-flow-vars for flow issues --- eslint/babel-eslint-parser/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index df81ef8a3ef0..006007f61949 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -13,6 +13,7 @@ For questions and support please visit the [`#linting`](https://babeljs.slack.co ## Known Issues Flow: +> Check out [eslint-plugin-flow-vars](https://github.com/zertosh/eslint-plugin-flow-vars): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) From 0859607b4e6c7d5a72ce300e8ef962542a1e2ffb Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 13:34:48 -0500 Subject: [PATCH 439/965] Merge pull request babel/babel-eslint#209 from Constellation/pattern-visitor Patch SpreadProperty to escope's PatternVisitor --- eslint/babel-eslint-parser/index.js | 40 ++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 4f72a11558b1..f87d13240ab5 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -81,6 +81,19 @@ function monkeypatch() { var referencerMod = createModule(referencerLoc); var referencer = require(referencerLoc); + // monkeypatch escope/pattern-visitor + var patternVisitorLoc; + var patternVisitorMod; + var patternVisitor; + try { + patternVisitorLoc = Module._resolveFilename("./pattern-visitor", escopeMod); + patternVisitorMod = createModule(patternVisitorLoc); + patternVisitor = require(patternVisitorLoc); + } catch (err) { + // When eslint uses old escope, we cannot find pattern visitor. + // Fallback to the old way. + } + // reference Definition var definitionLoc; try { @@ -266,6 +279,12 @@ function monkeypatch() { } }; + if (patternVisitor) { + patternVisitor.prototype.SpreadProperty = function (node) { + this.visit(node.argument); + }; + } + // visit flow type in VariableDeclaration var variableDeclaration = referencer.prototype.VariableDeclaration; referencer.prototype.VariableDeclaration = function(node) { @@ -276,15 +295,18 @@ function monkeypatch() { if (typeAnnotation) { checkIdentifierOrVisit.call(this, typeAnnotation); } - if (id.type === "ObjectPattern") { - // check if object destructuring has a spread - var hasSpread = id.properties.filter(function(p) { - return p._babelType === "SpreadProperty"; - }); - // visit properties if so - if (hasSpread.length > 0) { - for (var j = 0; j < id.properties.length; j++) { - this.visit(id.properties[j]); + if (!patternVisitor) { + // Old method. Once escope in eslint is updated, this code is not necessary. + if (id.type === "ObjectPattern") { + // check if object destructuring has a spread + var hasSpread = id.properties.filter(function(p) { + return p._babelType === "SpreadProperty"; + }); + // visit properties if so + if (hasSpread.length > 0) { + for (var j = 0; j < id.properties.length; j++) { + this.visit(id.properties[j]); + } } } } From 3d901f59608c1175325362dffd9231021cdb6e47 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 20:33:39 -0500 Subject: [PATCH 440/965] Merge pull request babel/babel-eslint#212 from evocateur/fix-with-latest-eslint Avoid errors with eslint 1.10.x when excluding destructured properties --- eslint/babel-eslint-parser/index.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f87d13240ab5..5a4958fc774a 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -295,18 +295,15 @@ function monkeypatch() { if (typeAnnotation) { checkIdentifierOrVisit.call(this, typeAnnotation); } - if (!patternVisitor) { - // Old method. Once escope in eslint is updated, this code is not necessary. - if (id.type === "ObjectPattern") { - // check if object destructuring has a spread - var hasSpread = id.properties.filter(function(p) { - return p._babelType === "SpreadProperty"; - }); - // visit properties if so - if (hasSpread.length > 0) { - for (var j = 0; j < id.properties.length; j++) { - this.visit(id.properties[j]); - } + if (id.type === "ObjectPattern") { + // check if object destructuring has a spread + var hasSpread = id.properties.filter(function(p) { + return p._babelType === "SpreadProperty"; + }); + // visit properties if so + if (hasSpread.length > 0) { + for (var j = 0; j < id.properties.length; j++) { + this.visit(id.properties[j]); } } } From 2ddb2d4c89b0c698121fb0f64190d36c3edc5046 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 20:37:44 -0500 Subject: [PATCH 441/965] test for no-redeclare --- eslint/babel-eslint-parser/test/non-regression.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 3022560e01b7..1b7e06d8bec1 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1230,7 +1230,15 @@ describe("verify", function () { it("visits excluded properties left of spread #95", function () { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-undef": 1, "no-unused-vars": 1 }, + { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, + [] + ); + }); + + it("visits excluded properties left of spread #210", function () { + verifyAndAssertMessages( + "const props = { yo: 'yo' }; const { ...otherProps } = props;", + { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, [] ); }); From 12dd87f96ba1371d7e18960727b8d7a33e55ec1d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 20:38:48 -0500 Subject: [PATCH 442/965] add node 5 --- eslint/babel-eslint-parser/.travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 551529748b9a..d217b09b0469 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -5,4 +5,5 @@ language: node_js node_js: - '0.12' - 'io.js' - - '4' \ No newline at end of file + - '4' + - '5' From 78361c15182ac3bb1b767421e716d04f5e7677b7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 21:19:08 -0500 Subject: [PATCH 443/965] skip for now --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1b7e06d8bec1..6a285b85c31e 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -791,7 +791,7 @@ describe("verify", function () { ); }); - it("32", function () { + it.skip("32", function () { verifyAndAssertMessages( [ "import type Foo from 'foo';", From 27c9abfae528b46f7f72b4d82581987af3a3932b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 23 Nov 2015 21:19:53 -0500 Subject: [PATCH 444/965] 4.1.6 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a7a1c275b785..3aeac5769e32 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.5", + "version": "4.1.6", "description": "", "main": "index.js", "repository": { From 72e8f9d96975434556abe5e49bc4e46eee09a358 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 26 Nov 2015 14:44:37 -0500 Subject: [PATCH 445/965] Merge pull request babel/babel-eslint#202 from hzoo/babel6 Update to babel 6 --- eslint/babel-eslint-parser/index.js | 97 +++++++++---------- eslint/babel-eslint-parser/package.json | 11 ++- .../babel-eslint-parser/test/babel-eslint.js | 75 ++++++++++++-- .../test/non-regression.js | 80 --------------- 4 files changed, 119 insertions(+), 144 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 5a4958fc774a..ba3b784ea7fc 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -3,10 +3,10 @@ var assign = require("lodash.assign"); var pick = require("lodash.pick"); var Module = require("module"); var path = require("path"); -var parse = require("babel-core").parse; -var t = require("babel-core").types; -var tt = require("babel-core").acorn.tokTypes; -var traverse = require("babel-core").traverse; +var parse = require("babylon").parse; +var t = require("babel-types"); +var tt = require("babylon").tokTypes; +var traverse = require("babel-traverse").default; var estraverse; var hasPatched = false; @@ -243,7 +243,7 @@ function monkeypatch() { // visit decorators that are in: Property / MethodDefinition var visitProperty = referencer.prototype.visitProperty; referencer.prototype.visitProperty = function(node) { - if (node.value.type === "TypeCastExpression") { + if (node.value && node.value.type === "TypeCastExpression") { visitTypeAnnotation.call(this, node.value); } visitDecorators.call(this, node); @@ -298,7 +298,7 @@ function monkeypatch() { if (id.type === "ObjectPattern") { // check if object destructuring has a spread var hasSpread = id.properties.filter(function(p) { - return p._babelType === "SpreadProperty"; + return p._babelType === "SpreadProperty" || p._babelType === "RestProperty"; }); // visit properties if so if (hasSpread.length > 0) { @@ -339,43 +339,6 @@ function monkeypatch() { } }; - referencer.prototype.ComprehensionExpression = function(node) { - for (var i = 0; i < node.blocks.length; i++) { - var block = node.blocks[i]; - if (block.left) { - var scope = new escope.Scope(this.scopeManager, "comprehensions", this.currentScope(), node, false); - this.scopeManager.__nestScope(scope); - - var left = block.left; - if (left.type === "Identifier") { - scope.__define(left, new Definition("ComprehensionElement", left, left)); - } else if (left.type === "ArrayPattern") { - for (var i = 0; i < left.elements.length; i++) { - var name = left.elements[i]; - if (name) { - scope.__define(name, new Definition("ComprehensionElement", name, name)); - } - } - } else if (left.type === "ObjectPattern") { - for (var i = 0; i < left.properties.length; i++) { - var name = left.properties[i]; - if (name && name.key && name.key.type === "Identifier") { - scope.__define(name.key, new Definition("ComprehensionElement", name.key, name.key)); - } - } - } - } - if (block.right) { - this.visit(block.right); - } - } - if (node.filter) { - this.visit(node.filter); - } - this.visit(node.body); - this.close(node); - }; - referencer.prototype.DeclareModule = referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = @@ -408,11 +371,27 @@ exports.parse = function (code) { exports.parseNoPatch = function (code) { var opts = { locations: true, - ranges: true - }; - - var comments = opts.onComment = []; - var tokens = opts.onToken = []; + ranges: true, + sourceType: "module", + strictMode: true, + allowHashBang: true, + ecmaVersion: Infinity, + plugins: [ + "flow", + "jsx", + "asyncFunctions", + "asyncGenerators", + "classConstructorCall", + "classProperties", + "decorators", + "doExpressions", + "exponentiationOperator", + "exportExtensions", + "functionBind", + "objectRestSpread", + "trailingFunctionCommas" + ] +}; var ast; try { @@ -432,18 +411,30 @@ exports.parseNoPatch = function (code) { // remove EOF token, eslint doesn't use this for anything and it interferes with some rules // see https://github.com/babel/babel-eslint/issues/2 for more info // todo: find a more elegant way to do this - tokens.pop(); + ast.tokens.pop(); // convert tokens - ast.tokens = acornToEsprima.toTokens(tokens, tt); + ast.tokens = acornToEsprima.toTokens(ast.tokens, tt); // add comments - acornToEsprima.convertComments(comments); - ast.comments = comments; - acornToEsprima.attachComments(ast, comments, ast.tokens); + acornToEsprima.convertComments(ast.comments); // transform esprima and acorn divergent nodes acornToEsprima.toAST(ast, traverse); + // ast.program.tokens = ast.tokens; + // ast.program.comments = ast.comments; + // ast = ast.program; + + // remove File + ast.type = 'Program'; + ast.sourceType = ast.program.sourceType; + ast.directives = ast.program.directives; + ast.body = ast.program.body; + delete ast.program; + delete ast._paths; + + acornToEsprima.attachComments(ast, ast.comments, ast.tokens); + return ast; } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3aeac5769e32..cf5ddb6afb65 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,16 +8,19 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-core": "^5.8.33", + "acorn-to-esprima": "hzoo/acorn-to-esprima#babel6", + "babel-traverse": "^6.0.20", + "babel-types": "^6.0.19", + "babylon": "^6.0.18", "lodash.assign": "^3.2.0", - "lodash.pick": "^3.1.0", - "acorn-to-esprima": "^1.0.5" + "lodash.pick": "^3.1.0" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", - "lint": "./node_modules/eslint/bin/eslint.js ./test index.js acorn-to-esprima.js" + "lint": "./node_modules/eslint/bin/eslint.js ./test index.js acorn-to-esprima.js", + "preversion": "npm test" }, "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 216717312cb8..c4266de5008c 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,3 +1,4 @@ +var assert = require("assert"); var babelEslint = require(".."); var espree = require("espree"); var util = require("util"); @@ -17,7 +18,7 @@ function assertImplementsAST(target, source, path) { var typeA = target === null ? "null" : typeof target; var typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { - error("have different types (" + typeA + " !== " + typeB + ")"); + error("have different types (" + typeA + " !== " + typeB + ") " + "(" + target + " !== " + source + ")"); } else if (typeA === "object") { var keysTarget = Object.keys(target); for (var i in keysTarget) { @@ -65,17 +66,18 @@ function parseAndAssertSame(code) { comment: true, attachComment: true }); - var acornAST = babelEslint.parse(code); + var babylonAST = babelEslint.parse(code); try { - assertImplementsAST(esAST, acornAST); + assertImplementsAST(esAST, babylonAST); } catch(err) { err.message += "\nespree:\n" + util.inspect(esAST, {depth: err.depth, colors: true}) + "\nbabel-eslint:\n" + - util.inspect(acornAST, {depth: err.depth, colors: true}); + util.inspect(babylonAST, {depth: err.depth, colors: true}); throw err; } + // assert.equal(esAST, babylonAST); } describe("acorn-to-esprima", function () { @@ -240,11 +242,11 @@ describe("acorn-to-esprima", function () { parseAndAssertSame("export { foo as bar };"); }); - it("empty program with line comment", function () { + it.skip("empty program with line comment", function () { parseAndAssertSame("// single comment"); }); - it("empty program with block comment", function () { + it.skip("empty program with block comment", function () { parseAndAssertSame(" /* multiline\n * comment\n*/"); }); @@ -326,5 +328,64 @@ describe("acorn-to-esprima", function () { "}", "}" ].join("\n")); - }) + }); + + it("MethodDefinition", function () { + parseAndAssertSame([ + "export default class A {", + "a() {}", + "}" + ].join("\n")); + }); + + it("MethodDefinition 2", function () { + parseAndAssertSame([ + "export default class Bar { get bar() { return 42; }}" + ].join("\n")); + }); + + it("ClassMethod", function () { + parseAndAssertSame([ + "class A {", + "constructor() {", + "}", + "}" + ].join("\n")); + }); + + it("ClassMethod multiple params", function () { + parseAndAssertSame([ + "class A {", + "constructor(a, b, c) {", + "}", + "}" + ].join("\n")); + }); + + it("ClassMethod multiline", function () { + parseAndAssertSame([ + "class A {", + " constructor(", + " a,", + " b,", + " c", + " ) {", + "", + " }", + "}" + ].join("\n")); + }); + + it("ClassMethod oneline", function () { + parseAndAssertSame("class A { constructor(a, b, c) {} }"); + }); + + it("ObjectMethod", function () { + parseAndAssertSame([ + "var a = {", + "b(c) {", + "}", + "}" + ].join("\n")); + }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 6a285b85c31e..cdbc5555a5f4 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1047,86 +1047,6 @@ describe("verify", function () { ); }); - describe("comprehensions", function () { - it("array #9", function () { - verifyAndAssertMessages([ - "let arr = [1, 2, 3];", - "let b = [for (e of arr) String(e)]; b;" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - - it("array, if statement, multiple blocks", function () { - verifyAndAssertMessages([ - "let arr = [1, 2, 3];", - "let arr2 = [1, 2, 3];", - "[for (x of arr) for (y of arr2) if (x === true && y === true) x + y];" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - - it("generator, if statement, multiple blocks", function () { - verifyAndAssertMessages([ - "let arr = [1, 2, 3];", - "let arr2 = [1, 2, 3];", - "(for (x of arr) for (y of arr2) if (x === true && y === true) x + y)" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - - it("ArrayPattern", function () { - verifyAndAssertMessages([ - "let arr = [1, 2, 3];", - "[for ([,x] of arr) x]" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - - it("ObjectPattern", function () { - verifyAndAssertMessages([ - "let arr = [{x: 1, y: 2}, {x: 2, y: 3}];", - "[for ({x, y} of arr) x + y]" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - - it("multiple comprehensions #138", function () { - verifyAndAssertMessages([ - "function test() {", - "let items;", - "return {", - "a: [for (i of items) i],", - "b: [for (i of items) i]", - "};", - "} test;" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1, "no-redeclare": 1 }, - [] - ); - }); - - it("visiting filter in comprehension", function () { - verifyAndAssertMessages([ - "function test(items, val) {", - "return [ for (i of items) if (i === val) i ];", - "} test;" - ].join("\n"), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - }); - describe("decorators #72", function () { it("class declaration", function () { verifyAndAssertMessages( From c435628b6a6a7885bb935c962fc3bacd09c6afb2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 26 Nov 2015 14:46:42 -0500 Subject: [PATCH 446/965] 5.0.0-beta1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cf5ddb6afb65..e3481379a61d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "4.1.6", + "version": "5.0.0-beta1", "description": "", "main": "index.js", "repository": { From 204ba8641841c59f287a8fb2e1a2ef916f5b2499 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 27 Nov 2015 15:42:16 -0500 Subject: [PATCH 447/965] Merge pull request babel/babel-eslint#215 from zertosh/master babylon/espree option alignment --- eslint/babel-eslint-parser/index.js | 9 ++++----- eslint/babel-eslint-parser/test/babel-eslint.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ba3b784ea7fc..de3cdb0275dd 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -370,12 +370,11 @@ exports.parse = function (code) { exports.parseNoPatch = function (code) { var opts = { - locations: true, - ranges: true, sourceType: "module", strictMode: true, - allowHashBang: true, - ecmaVersion: Infinity, + allowImportExportEverywhere: false, // consistent with espree + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, plugins: [ "flow", "jsx", @@ -391,7 +390,7 @@ exports.parseNoPatch = function (code) { "objectRestSpread", "trailingFunctionCommas" ] -}; + }; var ast; try { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index c4266de5008c..b4498042feec 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -388,4 +388,18 @@ describe("acorn-to-esprima", function () { "}" ].join("\n")); }); + + it("do not allow import export everywhere", function() { + assert.throws(function () { + parseAndAssertSame("function F() { import a from \"a\"; }"); + }, /Illegal import declaration/) + }); + + it("return outside function", function () { + parseAndAssertSame("return;"); + }); + + it("super outside method", function () { + parseAndAssertSame("function F() { super(); }"); + }); }); From faa003168c1113d79abdc8e259c7f68317db0ecf Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 27 Nov 2015 15:44:07 -0500 Subject: [PATCH 448/965] add functionSent to parser --- eslint/babel-eslint-parser/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index de3cdb0275dd..820afe48e4e5 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -387,6 +387,7 @@ exports.parseNoPatch = function (code) { "exponentiationOperator", "exportExtensions", "functionBind", + "functionSent", "objectRestSpread", "trailingFunctionCommas" ] From f76be581b31a5c5cb4fdfdb1a78fe61b0bc1e1de Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 27 Nov 2015 15:45:09 -0500 Subject: [PATCH 449/965] 5.0.0-beta2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e3481379a61d..ca08e3365d06 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta1", + "version": "5.0.0-beta2", "description": "", "main": "index.js", "repository": { From 4249dcd35354d6049ea2f76195be4eac1fdb2217 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 28 Nov 2015 16:31:13 -0500 Subject: [PATCH 450/965] update acorn-to-esprima, add tests for babel/babel-eslint#216 --- eslint/babel-eslint-parser/index.js | 4 +- .../babel-eslint-parser/test/babel-eslint.js | 132 ++++++++++-------- .../test/non-regression.js | 8 ++ 3 files changed, 80 insertions(+), 64 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 820afe48e4e5..f0e7dea838e9 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -414,13 +414,13 @@ exports.parseNoPatch = function (code) { ast.tokens.pop(); // convert tokens - ast.tokens = acornToEsprima.toTokens(ast.tokens, tt); + ast.tokens = acornToEsprima.toTokens(ast.tokens, tt, code); // add comments acornToEsprima.convertComments(ast.comments); // transform esprima and acorn divergent nodes - acornToEsprima.toAST(ast, traverse); + acornToEsprima.toAST(ast, traverse, code); // ast.program.tokens = ast.tokens; // ast.program.comments = ast.comments; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index b4498042feec..c709f7da631d 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -330,76 +330,84 @@ describe("acorn-to-esprima", function () { ].join("\n")); }); - it("MethodDefinition", function () { - parseAndAssertSame([ - "export default class A {", - "a() {}", - "}" - ].join("\n")); - }); + describe("babel 6 tests", function () { + it("MethodDefinition", function () { + parseAndAssertSame([ + "export default class A {", + "a() {}", + "}" + ].join("\n")); + }); - it("MethodDefinition 2", function () { - parseAndAssertSame([ - "export default class Bar { get bar() { return 42; }}" - ].join("\n")); - }); + it("MethodDefinition 2", function () { + parseAndAssertSame([ + "export default class Bar { get bar() { return 42; }}" + ].join("\n")); + }); - it("ClassMethod", function () { - parseAndAssertSame([ - "class A {", - "constructor() {", - "}", - "}" - ].join("\n")); - }); + it("ClassMethod", function () { + parseAndAssertSame([ + "class A {", + "constructor() {", + "}", + "}" + ].join("\n")); + }); - it("ClassMethod multiple params", function () { - parseAndAssertSame([ - "class A {", - "constructor(a, b, c) {", - "}", - "}" - ].join("\n")); - }); + it("ClassMethod multiple params", function () { + parseAndAssertSame([ + "class A {", + "constructor(a, b, c) {", + "}", + "}" + ].join("\n")); + }); - it("ClassMethod multiline", function () { - parseAndAssertSame([ - "class A {", - " constructor(", - " a,", - " b,", - " c", - " ) {", - "", - " }", - "}" - ].join("\n")); - }); + it("ClassMethod multiline", function () { + parseAndAssertSame([ + "class A {", + " constructor(", + " a,", + " b,", + " c", + " ) {", + "", + " }", + "}" + ].join("\n")); + }); - it("ClassMethod oneline", function () { - parseAndAssertSame("class A { constructor(a, b, c) {} }"); - }); + it("ClassMethod oneline", function () { + parseAndAssertSame("class A { constructor(a, b, c) {} }"); + }); - it("ObjectMethod", function () { - parseAndAssertSame([ - "var a = {", - "b(c) {", - "}", - "}" - ].join("\n")); - }); + it("ObjectMethod", function () { + parseAndAssertSame([ + "var a = {", + "b(c) {", + "}", + "}" + ].join("\n")); + }); - it("do not allow import export everywhere", function() { - assert.throws(function () { - parseAndAssertSame("function F() { import a from \"a\"; }"); - }, /Illegal import declaration/) - }); + it("do not allow import export everywhere", function() { + assert.throws(function () { + parseAndAssertSame("function F() { import a from \"a\"; }"); + }, /Illegal import declaration/) + }); - it("return outside function", function () { - parseAndAssertSame("return;"); - }); + it("return outside function", function () { + parseAndAssertSame("return;"); + }); - it("super outside method", function () { - parseAndAssertSame("function F() { super(); }"); + it("super outside method", function () { + parseAndAssertSame("function F() { super(); }"); + }); + + it("StringLiteral", function () { + parseAndAssertSame(''); + parseAndAssertSame(""); + parseAndAssertSame("a"); + }); }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index cdbc5555a5f4..0e7559df3b35 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1296,4 +1296,12 @@ describe("verify", function () { [ "1:13 \"x\" was used before it was defined no-use-before-define" ] ) }); + + it("jsx and stringliteral #216", function () { + verifyAndAssertMessages( + "
", + {}, + [] + ) + }); }); From 61e1c5b546bfb6117143c5381391d6dcddc70a80 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 28 Nov 2015 16:31:24 -0500 Subject: [PATCH 451/965] 5.0.0-beta3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ca08e3365d06..9252cd59242a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta2", + "version": "5.0.0-beta3", "description": "", "main": "index.js", "repository": { From c078e11bcf3be8dcbb74338f95f7038a7877435f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 29 Nov 2015 08:24:10 -0500 Subject: [PATCH 452/965] update acorn-to-esprima to 2.0.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 9252cd59242a..1f03fb1d9af8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "acorn-to-esprima": "hzoo/acorn-to-esprima#babel6", + "acorn-to-esprima": "^2.0.1", "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.0.18", From 423683e7ef0e5de87da96924612adddc54862afd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 29 Nov 2015 08:24:29 -0500 Subject: [PATCH 453/965] 5.0.0-beta4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1f03fb1d9af8..74afb831e4ea 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta3", + "version": "5.0.0-beta4", "description": "", "main": "index.js", "repository": { From fa7dfc272a06a412f83b9726a8760fbb559f896c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 1 Dec 2015 09:58:43 -0500 Subject: [PATCH 454/965] update eslint --- eslint/babel-eslint-parser/eslint | 2 +- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/eslint b/eslint/babel-eslint-parser/eslint index 8f6f543b2952..fdce86d24e30 160000 --- a/eslint/babel-eslint-parser/eslint +++ b/eslint/babel-eslint-parser/eslint @@ -1 +1 @@ -Subproject commit 8f6f543b2952e439ba5e158b3f0bcfd150ab3914 +Subproject commit fdce86d24e30a31c0c819262b72ab6b454cb552a diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 74afb831e4ea..5bfb001008aa 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.9.0", + "eslint": "^1.10.2", "espree": "^2.2.5", "mocha": "^2.3.3" } From 318a530dfad9869dde88a814c012a12775316aff Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 9 Dec 2015 08:27:19 -0500 Subject: [PATCH 455/965] update acorn-to-esprima, add getter/setter tests --- eslint/babel-eslint-parser/package.json | 2 +- .../babel-eslint-parser/test/babel-eslint.js | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5bfb001008aa..98ceeb96f08d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "acorn-to-esprima": "^2.0.1", + "acorn-to-esprima": "^2.0.3", "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.0.18", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index c709f7da631d..3c2782dbb791 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -366,11 +366,12 @@ describe("acorn-to-esprima", function () { it("ClassMethod multiline", function () { parseAndAssertSame([ "class A {", - " constructor(", + " constructor (", " a,", " b,", " c", - " ) {", + " )", + "{", "", " }", "}" @@ -409,5 +410,28 @@ describe("acorn-to-esprima", function () { parseAndAssertSame(""); parseAndAssertSame("a"); }); + + it("getters and setters", function () { + parseAndAssertSame("class A { get x ( ) { ; } }"); + parseAndAssertSame([ + "class A {", + "get x(", + ")", + "{", + ";", + "}", + "}" + ].join("\n")); + parseAndAssertSame("class A { set x (a) { ; } }"); + parseAndAssertSame([ + "class A {", + "set x(a", + ")", + "{", + ";", + "}", + "}" + ].join("\n")); + }); }); }); From 3b673ef4b67332d43ab4e0155f12bf006ee821ff Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 9 Dec 2015 08:27:37 -0500 Subject: [PATCH 456/965] 5.0.0-beta5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 98ceeb96f08d..ace66a9191f4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta4", + "version": "5.0.0-beta5", "description": "", "main": "index.js", "repository": { From c35137040aa31cc49d5126920e93f8e4fab29dd9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 9 Dec 2015 08:40:27 -0500 Subject: [PATCH 457/965] update acorn-to-esprima, account for getter/setter kind property --- eslint/babel-eslint-parser/package.json | 2 +- .../babel-eslint-parser/test/babel-eslint.js | 10 +++++++ .../test/non-regression.js | 27 +++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ace66a9191f4..83923ac4904e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "acorn-to-esprima": "^2.0.3", + "acorn-to-esprima": "^2.0.4", "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.0.18", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 3c2782dbb791..dea774eb2efd 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -432,6 +432,16 @@ describe("acorn-to-esprima", function () { "}", "}" ].join("\n")); + parseAndAssertSame([ + "var B = {", + "get x () {", + "return this.ecks;", + "},", + "set x (ecks) {", + "this.ecks = ecks;", + "}", + "};" + ].join("\n")); }); }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 0e7559df3b35..af887aa4a7b0 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1304,4 +1304,31 @@ describe("verify", function () { [] ) }); + + it("getter/setter #218", function () { + verifyAndAssertMessages([ + "class Person {", + "set a (v) { }", + "}" + ].join("\n"), + { "space-before-function-paren": 1, "space-before-keywords": 1, "indent": 1 }, + [] + ) + }); + + it("getter/setter #220", function () { + verifyAndAssertMessages([ + "var B = {", + "get x () {", + "return this.ecks;", + "},", + "set x (ecks) {", + "this.ecks = ecks;", + "}", + "};" + ].join("\n"), + { "no-dupe-keys": 1 }, + [] + ) + }); }); From 02d63b7ec4e3e830fd603d2e5a636e967e0c3718 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 9 Dec 2015 08:42:02 -0500 Subject: [PATCH 458/965] 5.0.0-beta6 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 83923ac4904e..7d4c6dedfd8c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta5", + "version": "5.0.0-beta6", "description": "", "main": "index.js", "repository": { From c510fa79d00f0cba5af52f1fd84f5d6a9d3eed72 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 29 Dec 2015 13:44:12 -0500 Subject: [PATCH 459/965] add test for es6 unicode escapes --- eslint/babel-eslint-parser/test/non-regression.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index af887aa4a7b0..77326846588b 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1329,6 +1329,14 @@ describe("verify", function () { ].join("\n"), { "no-dupe-keys": 1 }, [] - ) + ); + }); + + it("regex with es6 unicodeCodePointEscapes", function () { + verifyAndAssertMessages( + "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", + {}, + [] + ); }); }); From 1adc834b10738410d3a975f87321bd4ee6ff4916 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 29 Dec 2015 13:48:29 -0500 Subject: [PATCH 460/965] skip for now --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 77326846588b..f2a35d586445 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1332,7 +1332,7 @@ describe("verify", function () { ); }); - it("regex with es6 unicodeCodePointEscapes", function () { + it.skip("regex with es6 unicodeCodePointEscapes", function () { verifyAndAssertMessages( "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", {}, From 0778f623fb0d633081f13b924e4c69325e42ac09 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 16 Jan 2016 00:16:50 -0500 Subject: [PATCH 461/965] Merge pull request babel/babel-eslint#232 from vaibhavmule/patch-1 update Licenses date --- eslint/babel-eslint-parser/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/LICENSE b/eslint/babel-eslint-parser/LICENSE index dac23744b010..80194a854b94 100644 --- a/eslint/babel-eslint-parser/LICENSE +++ b/eslint/babel-eslint-parser/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014-2015 Sebastian McKenzie +Copyright (c) 2014-2016 Sebastian McKenzie MIT License From 9380324a0f74d9e624be911cdda837b756e7e74c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 30 Jan 2016 10:32:47 -0500 Subject: [PATCH 462/965] temporarily remove test --- eslint/babel-eslint-parser/test/non-regression.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index f2a35d586445..d469fc410406 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1332,11 +1332,11 @@ describe("verify", function () { ); }); - it.skip("regex with es6 unicodeCodePointEscapes", function () { - verifyAndAssertMessages( - "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", - {}, - [] - ); - }); + // it("regex with es6 unicodeCodePointEscapes", function () { + // verifyAndAssertMessages( + // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", + // {}, + // [] + // ); + // }); }); From f083e49a6347c24270554726c5a9a2300c8051b0 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 30 Jan 2016 10:34:38 -0500 Subject: [PATCH 463/965] Merge pull request babel/babel-eslint#241 from jmm/rule-strict Add tests for `strict` rule --- .../fixtures/rules/strict/function-with.js | 3 + .../fixtures/rules/strict/function-without.js | 1 + .../rules/strict/global-with-function-with.js | 5 + .../strict/global-with-function-without.js | 3 + .../test/fixtures/rules/strict/global-with.js | 6 + .../test/fixtures/rules/strict/none.js | 1 + .../babel-eslint-parser/test/integration.js | 202 ++++++++++++++++++ 7 files changed, 221 insertions(+) create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/function-with.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/function-without.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-with.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-without.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/strict/none.js create mode 100644 eslint/babel-eslint-parser/test/integration.js diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-with.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-with.js new file mode 100644 index 000000000000..3df7515269d5 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-with.js @@ -0,0 +1,3 @@ +function x () { + "use strict"; +} diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-without.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-without.js new file mode 100644 index 000000000000..20b3e9e55005 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/function-without.js @@ -0,0 +1 @@ +function x () {} diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-with.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-with.js new file mode 100644 index 000000000000..ef682f72c947 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-with.js @@ -0,0 +1,5 @@ +"use strict"; + +function x () { + "use strict"; +} diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-without.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-without.js new file mode 100644 index 000000000000..206f708141b7 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with-function-without.js @@ -0,0 +1,3 @@ +"use strict"; + +function x () {} diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js new file mode 100644 index 000000000000..b28e68be0cd3 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js @@ -0,0 +1,6 @@ +"use strict";; +/* +The empty statement is intentional. As of now, ESLint won't enforce +string: [2, "global"] on a program with an empty body. A test for that without +massaging the AST to ESlint's input format should fail. +*/ diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/none.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/none.js new file mode 100644 index 000000000000..4a6db98f6226 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/none.js @@ -0,0 +1 @@ +"no use strict anywhere"; diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js new file mode 100644 index 000000000000..5ce7a443fca4 --- /dev/null +++ b/eslint/babel-eslint-parser/test/integration.js @@ -0,0 +1,202 @@ +var assert = require("assert"); +var assign = require("lodash.assign"); +var eslint = require("eslint"); +var fs = require("fs"); +var path = require("path"); + +var paths = { + fixtures: path.join(__dirname, "fixtures", "rules"), +}; + +var encoding = "utf8"; +var errorLevel = 2; + +var baseEslintOpts = { + parser: require.resolve(".."), +}; + +/** + * Load a fixture and run eslint.linter.verify() on it. + * Pass the return value to done(). + * @param object opts + * @param function done + */ +function lint (opts, done) { + readFixture(opts.fixture, function (err, src) { + if (err) return done(err); + done(null, eslint.linter.verify(src, opts.eslint)); + }); +} + +/** + * Read a fixture file, passing the content to done(). + * @param string|array id + * @param function done + */ +function readFixture (id, done) { + if (Array.isArray(id)) id = path.join.apply(path, id); + if (!path.extname(id)) id += ".js"; + fs.readFile( + path.join(paths.fixtures, id), + encoding, + done + ); +} +// readFixture + +describe("Rules:", function () { + describe("`strict`", strictSuite); +}); +// describe + +function strictSuite () { + var ruleId = "strict"; + + describe("when set to 'never'", function () { + var eslintOpts = assign({}, baseEslintOpts, { + rules: {}, + }); + eslintOpts.rules[ruleId] = [errorLevel, "never"]; + + ["global-with", "function-with"].forEach(function (fixture) { + it( + "should error on " + fixture.match(/^[^-]+/)[0] + " directive", + function (done) { + lint({ + fixture: ["strict", fixture], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + done(); + }); + } + ); + // it + }); + }); + // describe + + describe("when set to 'global'", function () { + var eslintOpts = assign({}, baseEslintOpts, { + rules: {} + }); + eslintOpts.rules[ruleId] = [errorLevel, "global"]; + + it("shouldn't error on single global directive", function (done) { + lint({ + fixture: ["strict", "global-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(!report.length); + done(); + }); + }); + // it + + it("should error twice on global directive: no and function directive: yes", function (done) { + lint({ + fixture: ["strict", "function-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + [0, 1].forEach(function (i) { + assert(report[i].ruleId === ruleId); + }); + done(); + }); + }); + // it + + it("should error on function directive", function (done) { + lint({ + fixture: ["strict", "global-with-function-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + + // This is to make sure the test fails prior to adapting Babel AST + // directive representation to ESLint format. Otherwise it reports an + // error for missing global directive that masquerades as the expected + // result of the previous assertion. + assert(report[0].nodeType !== "Program"); + done(); + }); + }); + // it + + it("should error on no directive", function (done) { + lint({ + fixture: ["strict", "none"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + done(); + }); + }); + // it + }); + // describe + + describe("when set to 'function'", function () { + var eslintOpts = assign({}, baseEslintOpts, { + rules: {} + }); + eslintOpts.rules[ruleId] = [errorLevel, "function"]; + + it("shouldn't error on single function directive", function (done) { + lint({ + fixture: ["strict", "function-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(!report.length); + done(); + }); + }); + // it + + it("should error twice on function directive: no and global directive: yes", function (done) { + lint({ + fixture: ["strict", "global-with-function-without"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + [0, 1].forEach(function (i) { + assert(report[i].ruleId === ruleId); + }); + done(); + }); + }); + // it + + it("should error on only global directive", function (done) { + lint({ + fixture: ["strict", "global-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + done(); + }); + }); + // it + + it("should error on extraneous global directive", function (done) { + lint({ + fixture: ["strict", "global-with-function-with"], + eslint: eslintOpts, + }, function (err, report) { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + assert(report[0].nodeType.indexOf("Function") === -1); + done(); + }); + }); + // it + }); + // describe +} From 167741b80bced41ac533f89bb9957099471ada0c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 30 Jan 2016 10:37:21 -0500 Subject: [PATCH 464/965] 5.0.0-beta7 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7d4c6dedfd8c..b5b9f785f54b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta6", + "version": "5.0.0-beta7", "description": "", "main": "index.js", "repository": { From 177c0b497953f2ba467a804e9a97136884058b6d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 30 Jan 2016 12:19:44 -0500 Subject: [PATCH 465/965] Add a test for use strict and directive ast change Fixes babel/babel-eslint#242 --- eslint/babel-eslint-parser/test/non-regression.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index d469fc410406..c8dcf93da2dc 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -138,8 +138,7 @@ describe("verify", function () { ); }); - // fix after updating to ESLint 1.0.0 - it.skip("Arrow function with non-block bodies (issue #20)", function () { + it("Arrow function with non-block bodies (issue #20)", function () { verifyAndAssertMessages( "\"use strict\"; () => 1", { "strict": [1, "global"] }, @@ -148,6 +147,15 @@ describe("verify", function () { ); }); + it("#242", function () { + verifyAndAssertMessages( + "\"use strict\"; asdf;", + { "no-irregular-whitespace": 1 }, + [], + {} + ); + }); + it("await keyword (issue #22)", function () { verifyAndAssertMessages( "async function foo() { await bar(); }", From e2464f462e219d0784be1752334c79127a505257 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 30 Jan 2016 12:20:15 -0500 Subject: [PATCH 466/965] 5.0.0-beta8 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b5b9f785f54b..64fbf7e40b1a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta7", + "version": "5.0.0-beta8", "description": "", "main": "index.js", "repository": { From a55236d383d039516b800f69a8173bbcd1995498 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Feb 2016 14:40:01 -0500 Subject: [PATCH 467/965] Merge pull request babel/babel-eslint#244 from christophehurpeau/patch-1 fix babel/babel-eslint#243 --- eslint/babel-eslint-parser/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f0e7dea838e9..7a76b5f4a676 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -80,6 +80,9 @@ function monkeypatch() { } var referencerMod = createModule(referencerLoc); var referencer = require(referencerLoc); + if (typeof referencer === 'object' && referencer.default) { + referencer = referencer.default; + } // monkeypatch escope/pattern-visitor var patternVisitorLoc; @@ -89,6 +92,9 @@ function monkeypatch() { patternVisitorLoc = Module._resolveFilename("./pattern-visitor", escopeMod); patternVisitorMod = createModule(patternVisitorLoc); patternVisitor = require(patternVisitorLoc); + if (typeof patternVisitor === 'object' && patternVisitor.default) { + patternVisitor = patternVisitor.default; + } } catch (err) { // When eslint uses old escope, we cannot find pattern visitor. // Fallback to the old way. From 740a54624908e40fb0d1129f3193577593f65841 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Feb 2016 14:40:54 -0500 Subject: [PATCH 468/965] 5.0.0-beta9 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 64fbf7e40b1a..247e6cbddd60 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta8", + "version": "5.0.0-beta9", "description": "", "main": "index.js", "repository": { From c1bec5c4de96c8a8a931c22067273849d01d5ce3 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Feb 2016 20:22:03 -0500 Subject: [PATCH 469/965] check using `__esModule` --- eslint/babel-eslint-parser/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7a76b5f4a676..cf42ffb3c49a 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -80,7 +80,7 @@ function monkeypatch() { } var referencerMod = createModule(referencerLoc); var referencer = require(referencerLoc); - if (typeof referencer === 'object' && referencer.default) { + if (referencer.__esModule) { referencer = referencer.default; } @@ -92,7 +92,7 @@ function monkeypatch() { patternVisitorLoc = Module._resolveFilename("./pattern-visitor", escopeMod); patternVisitorMod = createModule(patternVisitorLoc); patternVisitor = require(patternVisitorLoc); - if (typeof patternVisitor === 'object' && patternVisitor.default) { + if (patternVisitor.__esModule) { patternVisitor = patternVisitor.default; } } catch (err) { From 83debbfda0bdc1a2fef6017cfe90b9773822dd24 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Feb 2016 23:05:06 -0500 Subject: [PATCH 470/965] Merge pull request babel/babel-eslint#246 from babel/escope-patterns Prevent escope referencer from traversing into param pattern type annotations --- eslint/babel-eslint-parser/index.js | 17 +++++++++++++++++ .../babel-eslint-parser/test/non-regression.js | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index cf42ffb3c49a..47980470f4cb 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -47,17 +47,23 @@ function monkeypatch() { estraverseRelative = createModule(esrecurseLoc); } catch (err) {} + // contains all the instances of estraverse so we can modify them if necessary + var estraverses = []; + // monkeypatch estraverse estraverse = estraverseRelative.require("estraverse"); + estraverses.push(estraverse); assign(estraverse.VisitorKeys, t.VISITOR_KEYS); // monkeypatch estraverse-fb var estraverseFb = eslintMod.require("estraverse-fb"); + estraverses.push(estraverseFb); assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 var estraverseOfEslint = eslintMod.require("estraverse"); if (estraverseOfEslint !== estraverseFb) { + estraverses.push(estraverseOfEslint); assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); } @@ -279,7 +285,18 @@ function monkeypatch() { } } } + // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise + // escope will traverse into them and include the identifiers within as declarations + estraverses.forEach(function (estraverse) { + estraverse.VisitorKeys.ObjectPattern = ["properties"]; + estraverse.VisitorKeys.ArrayPattern = ["elements"]; + }); visitFunction.call(this, node); + // set them back to normal... + estraverses.forEach(function (estraverse) { + estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; + estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; + }); if (typeParamScope) { this.close(node); } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c8dcf93da2dc..e1f18afa087e 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1340,6 +1340,19 @@ describe("verify", function () { ); }); + it("fixes issues with flow types and ObjectPattern", function () { + verifyAndAssertMessages([ + "import type Foo from 'bar';", + "export default class Foobar {", + " foo({ bar }: Foo) { bar; }", + " bar({ foo }: Foo) { foo; }", + "}" + ].join("\n"), + { "no-unused-vars": 1 }, + [] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From 8f9f800dc575e275cd83fca029d92ff6f4cb7e1d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Feb 2016 23:06:09 -0500 Subject: [PATCH 471/965] 5.0.0-beta10 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 247e6cbddd60..f204d0a9fbe7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0-beta9", + "version": "5.0.0-beta10", "description": "", "main": "index.js", "repository": { From 05f708c330fcc43270974bdf33beab5020b0d2c5 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 2 Feb 2016 17:11:01 -0500 Subject: [PATCH 472/965] Merge pull request babel/babel-eslint#250 from danez/patch-1 Testcase for babel/babel-eslint#239 --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index e1f18afa087e..4e2d1128ea77 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1348,7 +1348,7 @@ describe("verify", function () { " bar({ foo }: Foo) { foo; }", "}" ].join("\n"), - { "no-unused-vars": 1 }, + { "no-unused-vars": 1, "no-shadow": 1 }, [] ); }); From e4f43aa51bcdaa01518bc26bb9a21d05f0db9a28 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 16 Feb 2016 12:32:56 -0500 Subject: [PATCH 473/965] Merge pull request babel/babel-eslint#255 from deepsweet/npm-ignore include only necessary files in npm package --- eslint/babel-eslint-parser/.npmignore | 1 - eslint/babel-eslint-parser/package.json | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 eslint/babel-eslint-parser/.npmignore diff --git a/eslint/babel-eslint-parser/.npmignore b/eslint/babel-eslint-parser/.npmignore deleted file mode 100644 index 9096200b7c1f..000000000000 --- a/eslint/babel-eslint-parser/.npmignore +++ /dev/null @@ -1 +0,0 @@ -eslint diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f204d0a9fbe7..0913779a967e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -3,6 +3,7 @@ "version": "5.0.0-beta10", "description": "", "main": "index.js", + "files": ["index.js"], "repository": { "type": "git", "url": "https://github.com/babel/babel-eslint.git" From 5df6babfad76cf79e7a1a21af27a8448fb084bcd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 16 Feb 2016 17:43:05 -0500 Subject: [PATCH 474/965] Update README.md --- eslint/babel-eslint-parser/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 006007f61949..8c3e1e1db1f7 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -3,7 +3,7 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -`babel-eslint` is successfully linting [babel core](https://github.com/babel/babel/blob/master/.eslintrc) and many other projects. +`babel-eslint` is successfully linting babel and many other projects. > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! @@ -35,12 +35,15 @@ aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and transformed into code that ESLint can understand. All location info such as line numbers, columns is also retained so you can track down errors with ease. +Basically `babel-eslint` exports an [`index.js`](/index.js) that a linter can use. +It just needs to export a `parse` method that takes in a string of code and outputs an AST. + ## Usage ### Install ```sh -$ npm install -g eslint babel-eslint +$ npm install eslint babel-eslint --save-dev ``` ### Setup From f117721251619a7a1a9dd67a0dc2331ba5b804ed Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 16 Feb 2016 18:06:37 -0500 Subject: [PATCH 475/965] 5.0.0 --- eslint/babel-eslint-parser/package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0913779a967e..5433fbfe9916 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,9 +1,11 @@ { "name": "babel-eslint", - "version": "5.0.0-beta10", + "version": "5.0.0", "description": "", "main": "index.js", - "files": ["index.js"], + "files": [ + "index.js" + ], "repository": { "type": "git", "url": "https://github.com/babel/babel-eslint.git" From edc91849cb58277a40a2c286710cc2db4eabec1e Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 16 Feb 2016 18:13:32 -0500 Subject: [PATCH 476/965] Update .travis.yml --- eslint/babel-eslint-parser/.travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index d217b09b0469..ed629d9af263 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,9 +1,10 @@ --- git: depth: 1 +sudo: false language: node_js node_js: - - '0.12' - - 'io.js' - - '4' - - '5' + - "0.10" + - "0.12" + - "4" + - "5" From dce22ce5f6a8078e381f453eefb5487e45d6faa6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 27 Feb 2016 10:23:01 -0500 Subject: [PATCH 477/965] Merge pull request babel/babel-eslint#257 from gmaclennan/patch-1 Update README.md install docs for eslint v1.x --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 8c3e1e1db1f7..41f349192e1e 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -43,7 +43,7 @@ It just needs to export a `parse` method that takes in a string of code and outp ### Install ```sh -$ npm install eslint babel-eslint --save-dev +$ npm install eslint@1.x babel-eslint --save-dev ``` ### Setup From 511862c4ee2566c832a21fd19e8a5c0eb8a0416c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 1 Mar 2016 22:34:53 -0500 Subject: [PATCH 478/965] Merge pull request babel/babel-eslint#264 from hzoo/eslint2 ESLint 2 --- .../babylon-to-espree/attachComments.js | 57 ++++ .../babylon-to-espree/convertTemplateType.js | 93 ++++++ .../babylon-to-espree/index.js | 20 ++ .../babylon-to-espree/toAST.js | 272 ++++++++++++++++++ .../babylon-to-espree/toToken.js | 60 ++++ .../babylon-to-espree/toTokens.js | 16 ++ eslint/babel-eslint-parser/index.js | 24 +- eslint/babel-eslint-parser/package.json | 13 +- .../babel-eslint-parser/test/babel-eslint.js | 70 +++-- .../babel-eslint-parser/test/integration.js | 3 + .../test/non-regression.js | 60 ++-- 11 files changed, 603 insertions(+), 85 deletions(-) create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/attachComments.js create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/index.js create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/toAST.js create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/toToken.js create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/toTokens.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js new file mode 100644 index 000000000000..4040ce7e4e0b --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js @@ -0,0 +1,57 @@ +// comment fixes +module.exports = function (ast, comments, tokens) { + if (comments.length) { + var firstComment = comments[0]; + var lastComment = comments[comments.length - 1]; + // fixup program start + if (!tokens.length) { + // if no tokens, the program starts at the end of the last comment + ast.start = lastComment.end; + ast.loc.start.line = lastComment.loc.end.line; + ast.loc.start.column = lastComment.loc.end.column; + + if (ast.leadingComments === null && ast.innerComments.length) { + ast.leadingComments = ast.innerComments; + } + } else if (firstComment.start < tokens[0].start) { + // if there are comments before the first token, the program starts at the first token + var token = tokens[0]; + // ast.start = token.start; + // ast.loc.start.line = token.loc.start.line; + // ast.loc.start.column = token.loc.start.column; + + // estraverse do not put leading comments on first node when the comment + // appear before the first token + if (ast.body.length) { + var node = ast.body[0]; + node.leadingComments = []; + var firstTokenStart = token.start; + var len = comments.length; + for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { + node.leadingComments.push(comments[i]); + } + } + } + // fixup program end + if (tokens.length) { + var lastToken = tokens[tokens.length - 1]; + if (lastComment.end > lastToken.end) { + // If there is a comment after the last token, the program ends at the + // last token and not the comment + // ast.end = lastToken.end; + ast.range[1] = lastToken.end; + ast.loc.end.line = lastToken.loc.end.line; + ast.loc.end.column = lastToken.loc.end.column; + } + } + } else { + if (!tokens.length) { + ast.loc.start.line = 1; + ast.loc.end.line = 1; + } + } + if (ast.body && ast.body.length > 0) { + ast.loc.start.line = ast.body[0].loc.start.line; + ast.range[0] = ast.body[0].start; + } +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js new file mode 100644 index 000000000000..0c3293dcf9d7 --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js @@ -0,0 +1,93 @@ +module.exports = function (tokens, tt) { + var startingToken = 0; + var currentToken = 0; + var numBraces = 0; // track use of {} + var numBackQuotes = 0; // track number of nested templates + + function isBackQuote(token) { + return tokens[token].type === tt.backQuote; + } + + function isTemplateStarter(token) { + return isBackQuote(token) || + // only can be a template starter when in a template already + tokens[token].type === tt.braceR && numBackQuotes > 0; + } + + function isTemplateEnder(token) { + return isBackQuote(token) || + tokens[token].type === tt.dollarBraceL; + } + + // append the values between start and end + function createTemplateValue(start, end) { + var value = ""; + while (start <= end) { + if (tokens[start].value) { + value += tokens[start].value; + } else if (tokens[start].type !== tt.template) { + value += tokens[start].type.label; + } + start++; + } + return value; + } + + // create Template token + function replaceWithTemplateType(start, end) { + var templateToken = { + type: "Template", + value: createTemplateValue(start, end), + start: tokens[start].start, + end: tokens[end].end, + loc: { + start: tokens[start].loc.start, + end: tokens[end].loc.end + } + }; + + // put new token in place of old tokens + tokens.splice(start, end - start + 1, templateToken); + } + + function trackNumBraces(token) { + if (tokens[token].type === tt.braceL) { + numBraces++; + } else if (tokens[token].type === tt.braceR) { + numBraces--; + } + } + + while (startingToken < tokens.length) { + // template start: check if ` or } + if (isTemplateStarter(startingToken) && numBraces === 0) { + if (isBackQuote(startingToken)) { + numBackQuotes++; + } + + currentToken = startingToken + 1; + + // check if token after template start is "template" + if (currentToken >= tokens.length - 1 || tokens[currentToken].type !== tt.template) { + break; + } + + // template end: find ` or ${ + while (!isTemplateEnder(currentToken)) { + if (currentToken >= tokens.length - 1) { + break; + } + currentToken++; + } + + if (isBackQuote(currentToken)) { + numBackQuotes--; + } + // template start and end found: create new token + replaceWithTemplateType(startingToken, currentToken); + } else if (numBackQuotes > 0) { + trackNumBraces(startingToken); + } + startingToken++; + } +} diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/babylon-to-espree/index.js new file mode 100644 index 000000000000..70accfdfcff2 --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/index.js @@ -0,0 +1,20 @@ +exports.attachComments = require("./attachComments"); + +exports.toTokens = require("./toTokens"); +exports.toAST = require("./toAST"); + +exports.convertComments = function (comments) { + for (var i = 0; i < comments.length; i++) { + var comment = comments[i]; + if (comment.type === "CommentBlock") { + comment.type = "Block"; + } else if (comment.type === "CommentLine") { + comment.type = "Line"; + } + // sometimes comments don't get ranges computed, + // even with options.ranges === true + if (!comment.range) { + comment.range = [comment.start, comment.end]; + } + } +} diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js new file mode 100644 index 000000000000..f82c4e598e0a --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -0,0 +1,272 @@ +var source; + +module.exports = function (ast, traverse, code) { + source = code; + ast.range = [ast.start, ast.end]; + traverse(ast, astTransformVisitor); +}; + +function changeToLiteral(node) { + node.type = "Literal"; + if (!node.raw) { + if (node.extra && node.extra.raw) { + node.raw = node.extra.raw; + } else { + node.raw = source.slice(node.start, node.end); + } + } +} + +var astTransformVisitor = { + noScope: true, + enter: function (path) { + var node = path.node; + + node.range = [node.start, node.end]; + + // private var to track original node type + node._babelType = node.type; + + if (node.innerComments) { + node.trailingComments = node.innerComments; + delete node.innerComments; + } + + if (node.trailingComments) { + for (var i = 0; i < node.trailingComments.length; i++) { + var comment = node.trailingComments[i]; + if (comment.type === "CommentLine") { + comment.type = "Line"; + } else if (comment.type === "CommentBlock") { + comment.type = "Block"; + } + comment.range = [comment.start, comment.end]; + } + } + + if (node.leadingComments) { + for (var i = 0; i < node.leadingComments.length; i++) { + var comment = node.leadingComments[i]; + if (comment.type === "CommentLine") { + comment.type = "Line"; + } else if (comment.type === "CommentBlock") { + comment.type = "Block"; + } + comment.range = [comment.start, comment.end]; + } + } + + // make '_paths' non-enumerable (babel-eslint #200) + Object.defineProperty(node, "_paths", { value: node._paths, writable: true }); + }, + exit: function (path) { + var node = path.node; + + [ + fixDirectives, + ].forEach(function (fixer) { + fixer(path); + }); + + if (path.isJSXText()) { + node.type = "Literal"; + node.raw = node.value; + } + + if (path.isNumericLiteral() || + path.isStringLiteral()) { + changeToLiteral(node); + } + + if (path.isBooleanLiteral()) { + node.type = "Literal"; + node.raw = String(node.value); + } + + if (path.isNullLiteral()) { + node.type = "Literal"; + node.raw = "null"; + node.value = null; + } + + if (path.isRegExpLiteral()) { + node.type = "Literal"; + node.raw = node.extra.raw; + node.value = {}; + node.regex = { + pattern: node.pattern, + flags: node.flags + }; + delete node.extra; + delete node.pattern; + delete node.flags; + } + + if (path.isObjectProperty()) { + node.type = "Property"; + node.kind = "init"; + } + + if (path.isClassMethod() || path.isObjectMethod()) { + var code = source.slice(node.key.end, node.body.start); + var offset = code.indexOf("("); + + node.value = { + type: "FunctionExpression", + id: node.id, + params: node.params, + body: node.body, + async: node.async, + generator: node.generator, + expression: node.expression, + defaults: [], // basic support - TODO: remove (old esprima) + loc: { + start: { + line: node.key.loc.start.line, + column: node.key.loc.end.column + offset // a[() {] + }, + end: node.body.loc.end + } + }; + // [asdf]() { + node.value.range = [node.key.end + offset, node.body.end]; + + node.value.start = node.value.range && node.value.range[0] || node.value.loc.start.column; + node.value.end = node.value.range && node.value.range[1] || node.value.loc.end.column; + + if (node.returnType) { + node.value.returnType = node.returnType; + } + + if (node.typeParameters) { + node.value.typeParameters = node.typeParameters; + } + + if (path.isClassMethod()) { + node.type = "MethodDefinition"; + } + + if (path.isObjectMethod()) { + node.type = "Property"; + if (node.kind === "method") { + node.kind = "init"; + } + } + + delete node.body; + delete node.id; + delete node.async; + delete node.generator; + delete node.expression; + delete node.params; + delete node.returnType; + delete node.typeParameters; + } + + if (path.isRestProperty() || path.isSpreadProperty()) { + node.type = "Experimental" + node.type; + } + + // flow: prevent "no-undef" + // for "Component" in: "let x: React.Component" + if (path.isQualifiedTypeIdentifier()) { + delete node.id; + } + // for "b" in: "var a: { b: Foo }" + if (path.isObjectTypeProperty()) { + delete node.key; + } + // for "indexer" in: "var a: {[indexer: string]: number}" + if (path.isObjectTypeIndexer()) { + delete node.id; + } + // for "param" in: "var a: { func(param: Foo): Bar };" + if (path.isFunctionTypeParam()) { + delete node.name; + } + + // modules + + if (path.isImportDeclaration()) { + delete node.isType; + } + + if (path.isExportDeclaration()) { + var declar = path.get("declaration"); + if (declar.isClassExpression()) { + node.declaration.type = "ClassDeclaration"; + } else if (declar.isFunctionExpression()) { + node.declaration.type = "FunctionDeclaration"; + } + } + + // remove class property keys (or patch in escope) + if (path.isClassProperty()) { + delete node.key; + } + + // async function as generator + if (path.isFunction()) { + if (node.async) node.generator = true; + } + + // TODO: remove (old esprima) + if (path.isFunction()) { + if (!node.defaults) { + node.defaults = []; + } + } + + // await transform to yield + if (path.isAwaitExpression()) { + node.type = "YieldExpression"; + node.delegate = node.all; + delete node.all; + } + + // template string range fixes + if (path.isTemplateLiteral()) { + node.quasis.forEach(function (q) { + q.range[0] -= 1; + if (q.tail) { + q.range[1] += 1; + } else { + q.range[1] += 2; + } + q.loc.start.column -= 1; + if (q.tail) { + q.loc.end.column += 1; + } else { + q.loc.end.column += 2; + } + }); + } + } +}; + + +function fixDirectives (path) { + if (!(path.isProgram() || path.isFunction())) return; + + var node = path.node; + var directivesContainer = node; + var body = node.body; + + if (node.type !== "Program") { + directivesContainer = body; + body = body.body; + } + + if (!directivesContainer.directives) return; + + directivesContainer.directives.reverse().forEach(function (directive) { + directive.type = "ExpressionStatement"; + directive.expression = directive.value; + delete directive.value; + directive.expression.type = "Literal"; + changeToLiteral(directive.expression); + body.unshift(directive); + }); + delete directivesContainer.directives; +} +// fixDirectives diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js new file mode 100644 index 000000000000..7e13f28e0c8a --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js @@ -0,0 +1,60 @@ +module.exports = function (token, tt, source) { + var type = token.type; + token.range = [token.start, token.end]; + + if (type === tt.name) { + token.type = "Identifier"; + } else if (type === tt.semi || type === tt.comma || + type === tt.parenL || type === tt.parenR || + type === tt.braceL || type === tt.braceR || + type === tt.slash || type === tt.dot || + type === tt.bracketL || type === tt.bracketR || + type === tt.ellipsis || type === tt.arrow || + type === tt.star || type === tt.incDec || + type === tt.colon || type === tt.question || + type === tt.template || type === tt.backQuote || + type === tt.dollarBraceL || type === tt.at || + type === tt.logicalOR || type === tt.logicalAND || + type === tt.bitwiseOR || type === tt.bitwiseXOR || + type === tt.bitwiseAND || type === tt.equality || + type === tt.relational || type === tt.bitShift || + type === tt.plusMin || type === tt.modulo || + type === tt.exponent || type === tt.prefix || + type === tt.doubleColon || + type.isAssign) { + token.type = "Punctuator"; + if (!token.value) token.value = type.label; + } else if (type === tt.jsxTagStart) { + token.type = "Punctuator"; + token.value = "<"; + } else if (type === tt.jsxTagEnd) { + token.type = "Punctuator"; + token.value = ">"; + } else if (type === tt.jsxName) { + token.type = "JSXIdentifier"; + } else if (type === tt.jsxText) { + token.type = "JSXText"; + } else if (type.keyword === "null") { + token.type = "Null"; + } else if (type.keyword === "false" || type.keyword === "true") { + token.type = "Boolean"; + } else if (type.keyword) { + token.type = "Keyword"; + } else if (type === tt.num) { + token.type = "Numeric"; + token.value = source.slice(token.start, token.end); + } else if (type === tt.string) { + token.type = "String"; + token.value = source.slice(token.start, token.end); + } else if (type === tt.regexp) { + token.type = "RegularExpression"; + var value = token.value; + token.regex = { + pattern: value.pattern, + flags: value.flags + }; + token.value = "/" + value.pattern + "/" + value.flags; + } + + return token; +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js new file mode 100644 index 000000000000..dab4b21b96c8 --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js @@ -0,0 +1,16 @@ +var convertTemplateType = require("./convertTemplateType"); +var toToken = require("./toToken"); + +module.exports = function (tokens, tt, code) { + // transform tokens to type "Template" + convertTemplateType(tokens, tt); + var transformedTokens = tokens.filter(function (token) { + return token.type !== "CommentLine" && token.type !== "CommentBlock"; + }); + + for (var i = 0, l = transformedTokens.length; i < l; i++) { + transformedTokens[i] = toToken(transformedTokens[i], tt, code); + } + + return transformedTokens; +}; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 47980470f4cb..87180e67e240 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,4 +1,4 @@ -var acornToEsprima = require("acorn-to-esprima"); +var babylonToEspree = require("./babylon-to-espree"); var assign = require("lodash.assign"); var pick = require("lodash.pick"); var Module = require("module"); @@ -380,7 +380,9 @@ function monkeypatch() { }; } -exports.parse = function (code) { +exports.parse = function (code, options) { + options = options || {}; + try { monkeypatch(); } catch (err) { @@ -388,12 +390,12 @@ exports.parse = function (code) { process.exit(1); } - return exports.parseNoPatch(code); + return exports.parseNoPatch(code, options); } -exports.parseNoPatch = function (code) { +exports.parseNoPatch = function (code, options) { var opts = { - sourceType: "module", + sourceType: options.sourceType || "module", strictMode: true, allowImportExportEverywhere: false, // consistent with espree allowReturnOutsideFunction: true, @@ -422,7 +424,7 @@ exports.parseNoPatch = function (code) { } catch (err) { if (err instanceof SyntaxError) { err.lineNumber = err.loc.line; - err.column = err.loc.column; + err.column = err.loc.column + 1; // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); @@ -437,27 +439,27 @@ exports.parseNoPatch = function (code) { ast.tokens.pop(); // convert tokens - ast.tokens = acornToEsprima.toTokens(ast.tokens, tt, code); + ast.tokens = babylonToEspree.toTokens(ast.tokens, tt, code); // add comments - acornToEsprima.convertComments(ast.comments); + babylonToEspree.convertComments(ast.comments); // transform esprima and acorn divergent nodes - acornToEsprima.toAST(ast, traverse, code); + babylonToEspree.toAST(ast, traverse, code); // ast.program.tokens = ast.tokens; // ast.program.comments = ast.comments; // ast = ast.program; // remove File - ast.type = 'Program'; + ast.type = "Program"; ast.sourceType = ast.program.sourceType; ast.directives = ast.program.directives; ast.body = ast.program.body; delete ast.program; delete ast._paths; - acornToEsprima.attachComments(ast, ast.comments, ast.tokens); + babylonToEspree.attachComments(ast, ast.comments, ast.tokens); return ast; } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5433fbfe9916..28a969a43a7f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,17 +1,17 @@ { "name": "babel-eslint", "version": "5.0.0", - "description": "", + "description": "Custom parser for ESLint", "main": "index.js", "files": [ - "index.js" + "index.js", + "babylon-to-espree" ], "repository": { "type": "git", "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "acorn-to-esprima": "^2.0.4", "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.0.18", @@ -22,7 +22,8 @@ "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", - "lint": "./node_modules/eslint/bin/eslint.js ./test index.js acorn-to-esprima.js", + "lint": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test", + "fix": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix", "preversion": "npm test" }, "author": "Sebastian McKenzie ", @@ -32,8 +33,8 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^1.10.2", - "espree": "^2.2.5", + "eslint": "^2.0.0", + "espree": "^3.0.0", "mocha": "^2.3.3" } } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index dea774eb2efd..a66f1c40cb14 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -32,49 +32,49 @@ function assertImplementsAST(target, source, path) { } } +function lookup(obj, keypath, backwardsDepth) { + if (!keypath) { return obj; } + + return keypath.split(".").slice(0, -1 * backwardsDepth) + .reduce(function (base, segment) { return base && base[segment], obj }); +} + function parseAndAssertSame(code) { var esAST = espree.parse(code, { ecmaFeatures: { - arrowFunctions: true, - binaryLiterals: true, - blockBindings: true, - classes: true, - defaultParams: true, - destructuring: true, - forOf: true, - generators: true, - modules: true, - objectLiteralComputedProperties: true, - objectLiteralDuplicateProperties: true, - objectLiteralShorthandMethods: true, - objectLiteralShorthandProperties: true, - octalLiterals: true, - regexUFlag: true, - regexYFlag: true, - restParams: true, - spread: true, - superInFunctions: true, - templateStrings: true, - unicodeCodePointEscapes: true, - globalReturn: true, - jsx: true, - experimentalObjectRestSpread: true, + // enable JSX parsing + jsx: true, + // enable return in global scope + globalReturn: true, + // enable implied strict mode (if ecmaVersion >= 5) + impliedStrict: true, + // allow experimental object rest/spread + experimentalObjectRestSpread: true }, tokens: true, loc: true, range: true, comment: true, - attachComment: true + attachComment: true, + ecmaVersion: 6, + sourceType: "module" }); var babylonAST = babelEslint.parse(code); try { assertImplementsAST(esAST, babylonAST); } catch(err) { + var traversal = err.message.slice(3, err.message.indexOf(":")); + if (esAST.tokens) { + delete esAST.tokens; + } + if (babylonAST.tokens) { + delete babylonAST.tokens; + } err.message += "\nespree:\n" + - util.inspect(esAST, {depth: err.depth, colors: true}) + + util.inspect(lookup(esAST, traversal, 2), {depth: err.depth, colors: true}) + "\nbabel-eslint:\n" + - util.inspect(babylonAST, {depth: err.depth, colors: true}); + util.inspect(lookup(babylonAST, traversal, 2), {depth: err.depth, colors: true}); throw err; } // assert.equal(esAST, babylonAST); @@ -394,7 +394,7 @@ describe("acorn-to-esprima", function () { it("do not allow import export everywhere", function() { assert.throws(function () { parseAndAssertSame("function F() { import a from \"a\"; }"); - }, /Illegal import declaration/) + }, /SyntaxError: 'import' and 'export' may only appear at the top level/) }); it("return outside function", function () { @@ -406,7 +406,7 @@ describe("acorn-to-esprima", function () { }); it("StringLiteral", function () { - parseAndAssertSame(''); + parseAndAssertSame(""); parseAndAssertSame(""); parseAndAssertSame("a"); }); @@ -443,5 +443,17 @@ describe("acorn-to-esprima", function () { "};" ].join("\n")); }); + + it("RestOperator", function () { + parseAndAssertSame("var { a, ...b } = c"); + parseAndAssertSame("var [ a, ...b ] = c"); + parseAndAssertSame("var a = function (...b) {}"); + }); + + it("SpreadOperator", function () { + parseAndAssertSame("var a = { b, ...c }"); + parseAndAssertSame("var a = [ a, ...b ]"); + parseAndAssertSame("var a = sum(...b)"); + }); }); }); diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 5ce7a443fca4..f3f09522e47d 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -13,6 +13,9 @@ var errorLevel = 2; var baseEslintOpts = { parser: require.resolve(".."), + parserOptions: { + sourceType: "script" + } }; /** diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4e2d1128ea77..0e979df42dab 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -2,43 +2,25 @@ "use strict"; var eslint = require("eslint"); -function verifyAndAssertMessages(code, rules, expectedMessages, features) { - var defaultEcmaFeatures = { - arrowFunctions: true, - binaryLiterals: true, - blockBindings: true, - classes: true, - defaultParams: true, - destructuring: true, - forOf: true, - generators: true, - modules: true, - objectLiteralComputedProperties: true, - objectLiteralDuplicateProperties: true, - objectLiteralShorthandMethods: true, - objectLiteralShorthandProperties: true, - octalLiterals: true, - regexUFlag: true, - regexYFlag: true, - restParams: true, - spread: true, - superInFunctions: true, - templateStrings: true, - unicodeCodePointEscapes: true, - globalReturn: true, - jsx: true, - experimentalObjectRestSpread: true - }; - +function verifyAndAssertMessages(code, rules, expectedMessages, sourceType) { var messages = eslint.linter.verify( code, { parser: require.resolve(".."), rules: rules, env: { - node: true + node: true, + es6: true }, - ecmaFeatures: features || defaultEcmaFeatures + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { + jsx: true, + experimentalObjectRestSpread: true, + globalReturn: true + }, + sourceType: sourceType || "module" + } } ); @@ -143,7 +125,7 @@ describe("verify", function () { "\"use strict\"; () => 1", { "strict": [1, "global"] }, [], - { modules: false } + "script" ); }); @@ -415,8 +397,8 @@ describe("verify", function () { "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:21 \"T\" is defined but never used no-unused-vars", - '2:8 "T" is not defined. no-undef' ] + [ "1:21 'T' is defined but never used no-unused-vars", + "2:8 'T' is not defined. no-undef" ] ); }); @@ -426,7 +408,7 @@ describe("verify", function () { "export class Foo extends Bar {}", ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ '2:30 "T" is not defined. no-undef' ] + [ "2:30 'T' is not defined. no-undef" ] ); }); @@ -1151,7 +1133,7 @@ describe("verify", function () { verifyAndAssertMessages( "var unused;", { "no-unused-vars": 1 }, - [ "1:5 \"unused\" is defined but never used no-unused-vars" ] + [ "1:5 'unused' is defined but never used no-unused-vars" ] ); }); @@ -1175,7 +1157,7 @@ describe("verify", function () { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:8 \"Bacona\" is defined but never used no-unused-vars" ] + [ "1:8 'Bacona' is defined but never used no-unused-vars" ] ); }); @@ -1301,7 +1283,7 @@ describe("verify", function () { "var x = 1;" ].join("\n"), { "no-use-before-define": 1 }, - [ "1:13 \"x\" was used before it was defined no-use-before-define" ] + [ "1:13 'x' was used before it was defined no-use-before-define" ] ) }); @@ -1316,10 +1298,10 @@ describe("verify", function () { it("getter/setter #218", function () { verifyAndAssertMessages([ "class Person {", - "set a (v) { }", + " set a (v) { }", "}" ].join("\n"), - { "space-before-function-paren": 1, "space-before-keywords": 1, "indent": 1 }, + { "space-before-function-paren": 1, "keyword-spacing": [1, {"before": true}], "indent": 1 }, [] ) }); From c28b839c175150861e4b5657ea7e975b88e67765 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 1 Mar 2016 22:37:28 -0500 Subject: [PATCH 479/965] Update README.md --- eslint/babel-eslint-parser/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 41f349192e1e..74ea5fb67b6b 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -12,6 +12,7 @@ For questions and support please visit the [`#linting`](https://babeljs.slack.co > Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`) ## Known Issues + Flow: > Check out [eslint-plugin-flow-vars](https://github.com/zertosh/eslint-plugin-flow-vars): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) @@ -44,6 +45,8 @@ It just needs to export a `parse` method that takes in a string of code and outp ```sh $ npm install eslint@1.x babel-eslint --save-dev + +$ npm install eslint@2.x babel-eslint@next --save-dev ``` ### Setup From c3915b9798784f74b91e772728bac94e0fcb49f1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 1 Mar 2016 22:39:34 -0500 Subject: [PATCH 480/965] 6.0.0-beta.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 28a969a43a7f..31826ee15864 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "5.0.0", + "version": "6.0.0-beta.1", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From a827ab2d4e4f5d75c6365435fa9eebf71b57c857 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 6 Mar 2016 22:29:51 -0500 Subject: [PATCH 481/965] Merge pull request babel/babel-eslint#269 from babel/eslint-2.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit try catch estraverse-fb since eslint removed it in 2.3.0, temp skip b… --- eslint/babel-eslint-parser/index.js | 12 ++++++++---- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 87180e67e240..58d31147532b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -55,10 +55,12 @@ function monkeypatch() { estraverses.push(estraverse); assign(estraverse.VisitorKeys, t.VISITOR_KEYS); - // monkeypatch estraverse-fb - var estraverseFb = eslintMod.require("estraverse-fb"); - estraverses.push(estraverseFb); - assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); + // monkeypatch estraverse-fb (only for eslint < 2.3.0) + try { + var estraverseFb = eslintMod.require("estraverse-fb"); + estraverses.push(estraverseFb); + assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); + } catch (err) {} // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 var estraverseOfEslint = eslintMod.require("estraverse"); @@ -380,6 +382,8 @@ function monkeypatch() { }; } +exports.VisitorKeys = t.VISITOR_KEYS; + exports.parse = function (code, options) { options = options || {}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 31826ee15864..94bed305f96a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^2.0.0", + "eslint": "^2.3.0", "espree": "^3.0.0", "mocha": "^2.3.3" } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 0e979df42dab..11be9483d1f9 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -391,7 +391,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types - outside of fn scope #123", function () { + it.skip("polymorphpic/generic types - outside of fn scope #123", function () { verifyAndAssertMessages([ "export function foo(value) { value; };", "var b: T = 1; b;" @@ -402,7 +402,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types - extending unknown #123", function () { + it.skip("polymorphpic/generic types - extending unknown #123", function () { verifyAndAssertMessages([ "import Bar from 'bar';", "export class Foo extends Bar {}", From 4a8c6d8a8ba7ea4705c3683d9e9358046aac4789 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Mar 2016 08:31:48 -0500 Subject: [PATCH 482/965] Merge pull request babel/babel-eslint#270 from danez/cleanup-monkey remove monkey-patching of patternVisitor as unused --- eslint/babel-eslint-parser/index.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 58d31147532b..67ec4e5337b4 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -92,22 +92,6 @@ function monkeypatch() { referencer = referencer.default; } - // monkeypatch escope/pattern-visitor - var patternVisitorLoc; - var patternVisitorMod; - var patternVisitor; - try { - patternVisitorLoc = Module._resolveFilename("./pattern-visitor", escopeMod); - patternVisitorMod = createModule(patternVisitorLoc); - patternVisitor = require(patternVisitorLoc); - if (patternVisitor.__esModule) { - patternVisitor = patternVisitor.default; - } - } catch (err) { - // When eslint uses old escope, we cannot find pattern visitor. - // Fallback to the old way. - } - // reference Definition var definitionLoc; try { @@ -304,12 +288,6 @@ function monkeypatch() { } }; - if (patternVisitor) { - patternVisitor.prototype.SpreadProperty = function (node) { - this.visit(node.argument); - }; - } - // visit flow type in VariableDeclaration var variableDeclaration = referencer.prototype.VariableDeclaration; referencer.prototype.VariableDeclaration = function(node) { From e886404171198436e99db8252b089fad7aa4347f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Mar 2016 12:34:10 -0500 Subject: [PATCH 483/965] 6.0.0-beta.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 94bed305f96a..b2c264481f80 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.1", + "version": "6.0.0-beta.2", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 6e3aa3357ccffcc063a873b85deb8ab099f1d2a3 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Mar 2016 23:09:33 -0500 Subject: [PATCH 484/965] Merge pull request babel/babel-eslint#272 from kaicataldo/fixes259 Update readme to fix npm registry escaped HTML (fixes babel/babel-eslint#259) --- eslint/babel-eslint-parser/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 74ea5fb67b6b..9ebee0f461e8 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -1,4 +1,5 @@ -# babel-eslint [![Build Status][travis-image]][travis-url] +# babel-eslint +[![Build Status][travis-image]][travis-url] **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). From 217f83fd5699716c885f5daff54d9788a82bf4c2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Mar 2016 23:09:46 -0500 Subject: [PATCH 485/965] Merge pull request babel/babel-eslint#271 from danez/fix-use-before-define Remove visiting of properties left of spread, fixes babel/babel-eslint#249. --- eslint/babel-eslint-parser/index.js | 12 ------- .../test/non-regression.js | 35 ++++++++++++++++--- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 67ec4e5337b4..0cabbb85c77d 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -298,18 +298,6 @@ function monkeypatch() { if (typeAnnotation) { checkIdentifierOrVisit.call(this, typeAnnotation); } - if (id.type === "ObjectPattern") { - // check if object destructuring has a spread - var hasSpread = id.properties.filter(function(p) { - return p._babelType === "SpreadProperty" || p._babelType === "RestProperty"; - }); - // visit properties if so - if (hasSpread.length > 0) { - for (var j = 0; j < id.properties.length; j++) { - this.visit(id.properties[j]); - } - } - } } } variableDeclaration.call(this, node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 11be9483d1f9..e34e9f506b80 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1137,18 +1137,45 @@ describe("verify", function () { ); }); - it("visits excluded properties left of spread #95", function () { + // This two tests are disabled, as the feature to visit properties when + // there is a spread/rest operator has been removed as it caused problems + // with other rules #249 + it.skip("visits excluded properties left of spread #95", function () { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, + { "no-unused-vars": 1 }, [] ); }); - it("visits excluded properties left of spread #210", function () { + it.skip("visits excluded properties left of spread #210", function () { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", - { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, + { "no-unused-vars": 1 }, + [] + ); + }); + + it("does not mark spread variables false-positive", function () { + verifyAndAssertMessages( + "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", + { "no-undef": 1, "no-redeclare": 1 }, + [] + ); + }); + + it("does not mark spread variables false-positive", function () { + verifyAndAssertMessages( + "const props = { yo: 'yo' }; const { ...otherProps } = props;", + { "no-undef": 1, "no-redeclare": 1 }, + [] + ); + }); + + it("does not mark spread variables as use-before-define #249", function () { + verifyAndAssertMessages( + "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", + { "no-use-before-define": 1 }, [] ); }); From d75bd7b82c6664a5ac80f57c761573767612ce23 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 7 Mar 2016 23:13:50 -0500 Subject: [PATCH 486/965] 6.0.0-beta.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b2c264481f80..505beb3656b8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.2", + "version": "6.0.0-beta.3", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 7fbf6111e3f342f7765e78ccbb9d31faf8289d83 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 8 Mar 2016 10:57:22 -0500 Subject: [PATCH 487/965] just throw an error right now instead of it silently working but with bugs --- eslint/babel-eslint-parser/index.js | 4 +++- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 0cabbb85c77d..2cf21cb02151 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -45,7 +45,9 @@ function monkeypatch() { try { var esrecurseLoc = Module._resolveFilename("esrecurse", eslintMod); estraverseRelative = createModule(esrecurseLoc); - } catch (err) {} + } catch (err) { + throw new Error("babel-eslint isn't currently compatible with ESLint 2.3.x. The recommendation is to pin to ESLint 2.2.x right now."); + } // contains all the instances of estraverse so we can modify them if necessary var estraverses = []; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 505beb3656b8..a62420bdc6cf 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^2.3.0", + "eslint": "~2.2.0", "espree": "^3.0.0", "mocha": "^2.3.3" } From c8ff9bad937fb484418e021d5faf561da7cc52b2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 8 Mar 2016 11:04:19 -0500 Subject: [PATCH 488/965] 6.0.0-beta.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a62420bdc6cf..c66d6f9a157c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.3", + "version": "6.0.0-beta.4", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From b42d59b29cb454bf28b17d5a37c743107599b3e8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 8 Mar 2016 11:06:47 -0500 Subject: [PATCH 489/965] errror on estraverse-fb.. --- eslint/babel-eslint-parser/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 2cf21cb02151..76073ea32567 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -45,9 +45,7 @@ function monkeypatch() { try { var esrecurseLoc = Module._resolveFilename("esrecurse", eslintMod); estraverseRelative = createModule(esrecurseLoc); - } catch (err) { - throw new Error("babel-eslint isn't currently compatible with ESLint 2.3.x. The recommendation is to pin to ESLint 2.2.x right now."); - } + } catch (err) {} // contains all the instances of estraverse so we can modify them if necessary var estraverses = []; @@ -62,7 +60,9 @@ function monkeypatch() { var estraverseFb = eslintMod.require("estraverse-fb"); estraverses.push(estraverseFb); assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); - } catch (err) {} + } catch (err) { + throw new Error("babel-eslint isn't currently compatible with ESLint 2.3.x. The recommendation is to pin to ESLint 2.2.x right now."); + } // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 var estraverseOfEslint = eslintMod.require("estraverse"); From 2c6b323a620b13049a60d5f39d61fbdc3d9b2835 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 8 Mar 2016 11:06:58 -0500 Subject: [PATCH 490/965] 6.0.0-beta.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c66d6f9a157c..a0ea3e2ea166 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.4", + "version": "6.0.0-beta.5", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 080f0c7b22335002f53da33fa77a7b5fcf1358d4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 14 Mar 2016 08:36:44 -0400 Subject: [PATCH 491/965] Merge pull request babel/babel-eslint#273 from mysticatea/fix-monkeypatching-for-2.3.0 Fix: Remove throwing an error when estraverse-fb has not found. --- eslint/babel-eslint-parser/index.js | 5 ++--- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 76073ea32567..c9e7bc4df94b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -61,7 +61,7 @@ function monkeypatch() { estraverses.push(estraverseFb); assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); } catch (err) { - throw new Error("babel-eslint isn't currently compatible with ESLint 2.3.x. The recommendation is to pin to ESLint 2.2.x right now."); + // Ignore: ESLint v2.3.0 does not have estraverse-fb } // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 @@ -77,6 +77,7 @@ function monkeypatch() { escope.analyze = function (ast, opts) { opts.ecmaVersion = 6; opts.sourceType = "module"; + var results = analyze.call(this, ast, opts); return results; }; @@ -350,8 +351,6 @@ function monkeypatch() { }; } -exports.VisitorKeys = t.VISITOR_KEYS; - exports.parse = function (code, options) { options = options || {}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a0ea3e2ea166..e3642d0be3a4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "~2.2.0", + "eslint": "^2.4.0", "espree": "^3.0.0", "mocha": "^2.3.3" } From c6a69b763fac400fbf90d94942eab7d81a075988 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 14 Mar 2016 08:37:34 -0400 Subject: [PATCH 492/965] 6.0.0-beta.6 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e3642d0be3a4..69be55a8b7e4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.5", + "version": "6.0.0-beta.6", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From c6401945d9833853812a26f1d8eb932b7e5c8aa4 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 25 Mar 2016 23:51:29 -0400 Subject: [PATCH 493/965] 6.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 69be55a8b7e4..de25c28ce281 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0-beta.6", + "version": "6.0.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From cccce9d0abf20d85e66ac49213ffc588a1c9fc13 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 28 Mar 2016 18:23:37 -0400 Subject: [PATCH 494/965] update install instructions for eslint 1 and 2 --- eslint/babel-eslint-parser/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 9ebee0f461e8..d57329ae34c9 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -45,9 +45,9 @@ It just needs to export a `parse` method that takes in a string of code and outp ### Install ```sh -$ npm install eslint@1.x babel-eslint --save-dev +$ npm install eslint@1.x babel-eslint@5 --save-dev -$ npm install eslint@2.x babel-eslint@next --save-dev +$ npm install eslint@2.x babel-eslint@6 --save-dev ``` ### Setup From 1fe0d4a94b0c06cdb3e9f38a0fa07650a1f877eb Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 31 Mar 2016 16:49:31 -0400 Subject: [PATCH 495/965] Merge pull request babel/babel-eslint#282 from josh/no-implicit-globals-regression Fix processing sourceType: script --- eslint/babel-eslint-parser/index.js | 1 - .../test/non-regression.js | 69 ++++++++++++++----- 2 files changed, 50 insertions(+), 20 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index c9e7bc4df94b..b42c3408eeb8 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -76,7 +76,6 @@ function monkeypatch() { var analyze = escope.analyze; escope.analyze = function (ast, opts) { opts.ecmaVersion = 6; - opts.sourceType = "module"; var results = analyze.call(this, ast, opts); return results; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index e34e9f506b80..b87ae83caa41 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -2,27 +2,32 @@ "use strict"; var eslint = require("eslint"); -function verifyAndAssertMessages(code, rules, expectedMessages, sourceType) { - var messages = eslint.linter.verify( - code, - { - parser: require.resolve(".."), - rules: rules, - env: { - node: true, - es6: true +function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { + var config = { + parser: require.resolve(".."), + rules: rules, + env: { + node: true, + es6: true + }, + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { + jsx: true, + experimentalObjectRestSpread: true, + globalReturn: true }, - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { - jsx: true, - experimentalObjectRestSpread: true, - globalReturn: true - }, - sourceType: sourceType || "module" - } + sourceType: sourceType || "module" } - ); + } + + if (overrideConfig) { + for (var key in overrideConfig) { + config[key] = overrideConfig[key] + } + } + + var messages = eslint.linter.verify(code, config); if (messages.length !== expectedMessages.length) { throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length + " " + JSON.stringify(messages)); @@ -1137,6 +1142,32 @@ describe("verify", function () { ); }); + it("no-implicit-globals in script", function () { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [ "1:5 Implicit global variable, assign as global property instead. no-implicit-globals" ], + "script", + { + env: {}, + parserOptions: { ecmaVersion: 6, sourceType: "script" } + } + ); + }); + + it("no-implicit-globals in module", function () { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [], + "module", + { + env: {}, + parserOptions: { ecmaVersion: 6, sourceType: "module" } + } + ); + }); + // This two tests are disabled, as the feature to visit properties when // there is a spread/rest operator has been removed as it caused problems // with other rules #249 From 3c9ef8ec7e42784d918857fc5b1bd5700e3707ba Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 31 Mar 2016 19:09:30 -0400 Subject: [PATCH 496/965] Merge pull request babel/babel-eslint#285 from josh/revert-282-no-implicit-globals-regression Revert "Fix processing sourceType: script" --- eslint/babel-eslint-parser/index.js | 1 + .../test/non-regression.js | 69 +++++-------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index b42c3408eeb8..c9e7bc4df94b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -76,6 +76,7 @@ function monkeypatch() { var analyze = escope.analyze; escope.analyze = function (ast, opts) { opts.ecmaVersion = 6; + opts.sourceType = "module"; var results = analyze.call(this, ast, opts); return results; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index b87ae83caa41..e34e9f506b80 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -2,32 +2,27 @@ "use strict"; var eslint = require("eslint"); -function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { - var config = { - parser: require.resolve(".."), - rules: rules, - env: { - node: true, - es6: true - }, - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { - jsx: true, - experimentalObjectRestSpread: true, - globalReturn: true +function verifyAndAssertMessages(code, rules, expectedMessages, sourceType) { + var messages = eslint.linter.verify( + code, + { + parser: require.resolve(".."), + rules: rules, + env: { + node: true, + es6: true }, - sourceType: sourceType || "module" - } - } - - if (overrideConfig) { - for (var key in overrideConfig) { - config[key] = overrideConfig[key] + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { + jsx: true, + experimentalObjectRestSpread: true, + globalReturn: true + }, + sourceType: sourceType || "module" + } } - } - - var messages = eslint.linter.verify(code, config); + ); if (messages.length !== expectedMessages.length) { throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length + " " + JSON.stringify(messages)); @@ -1142,32 +1137,6 @@ describe("verify", function () { ); }); - it("no-implicit-globals in script", function () { - verifyAndAssertMessages( - "var leakedGlobal = 1;", - { "no-implicit-globals": 1 }, - [ "1:5 Implicit global variable, assign as global property instead. no-implicit-globals" ], - "script", - { - env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "script" } - } - ); - }); - - it("no-implicit-globals in module", function () { - verifyAndAssertMessages( - "var leakedGlobal = 1;", - { "no-implicit-globals": 1 }, - [], - "module", - { - env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "module" } - } - ); - }); - // This two tests are disabled, as the feature to visit properties when // there is a spread/rest operator has been removed as it caused problems // with other rules #249 From 8a089b65fb4ffd076f85c0bd31ae767db8bfb966 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 31 Mar 2016 19:14:07 -0400 Subject: [PATCH 497/965] 6.0.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index de25c28ce281..d6bd28bbf449 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.0", + "version": "6.0.2", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 44ff3603796a9e6d558ea1c365cb0a5a3d37eb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ruci=C5=84ski?= Date: Mon, 18 Apr 2016 03:59:08 +0200 Subject: [PATCH 498/965] Make npm scripts work on Windows too. (babel/babel-eslint#295) --- eslint/babel-eslint-parser/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d6bd28bbf449..214d13412f76 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -22,8 +22,8 @@ "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", - "lint": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test", - "fix": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix", + "lint": "node node_modules/eslint/bin/eslint.js index.js babylon-to-espree test", + "fix": "node node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix", "preversion": "npm test" }, "author": "Sebastian McKenzie ", From 149dd082f349a92f91224df2716d18798f5077c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ruci=C5=84ski?= Date: Mon, 18 Apr 2016 04:01:15 +0200 Subject: [PATCH 499/965] Add root: true to eslint config. (babel/babel-eslint#294) This prevents taking user's eslint config files that are higher in the directory structure into consideration. --- eslint/babel-eslint-parser/.eslintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/.eslintrc b/eslint/babel-eslint-parser/.eslintrc index 63b343642b89..57a95f9d7e45 100644 --- a/eslint/babel-eslint-parser/.eslintrc +++ b/eslint/babel-eslint-parser/.eslintrc @@ -1,4 +1,5 @@ { + "root": true, "rules": { "strict": 0, "no-underscore-dangle": 0, @@ -24,4 +25,4 @@ "node": true, "mocha": true } -} \ No newline at end of file +} From fd36e3cf8d23879cad9be02f8523743552f69525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ruci=C5=84ski?= Date: Wed, 20 Apr 2016 02:55:24 +0200 Subject: [PATCH 500/965] Declare eslint call more simply in the scripts. (babel/babel-eslint#297) --- eslint/babel-eslint-parser/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 214d13412f76..856e93aeaded 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -22,8 +22,8 @@ "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", - "lint": "node node_modules/eslint/bin/eslint.js index.js babylon-to-espree test", - "fix": "node node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix", + "lint": "eslint index.js babylon-to-espree test", + "fix": "eslint index.js babylon-to-espree test --fix", "preversion": "npm test" }, "author": "Sebastian McKenzie ", From cf456bfe4a2e1a76a328637166c3c1e51f1663ea Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Wed, 20 Apr 2016 02:56:15 +0200 Subject: [PATCH 501/965] Fix escope to take sourceType and ecmaVersion from options (babel/babel-eslint#288) escope was hardcoded to sourcetype: "module" and ecmaVersion: "6" This changes it to take the configuration from the eslint options and still defaulting to "module" and "6". This is done by having to global variables, as monkeypatch is only triggered once. To fix scoping issues, the same logic as in eslint is applied. It disables the nodejs scope if the sourceType is module. --- eslint/babel-eslint-parser/index.js | 17 ++- .../test/non-regression.js | 104 ++++++++++++++---- 2 files changed, 99 insertions(+), 22 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index c9e7bc4df94b..70980797b27e 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -10,6 +10,7 @@ var traverse = require("babel-traverse").default; var estraverse; var hasPatched = false; +var eslintOptions = {}; function createModule(filename) { var mod = new Module(filename); @@ -75,8 +76,11 @@ function monkeypatch() { var escope = require(escopeLoc); var analyze = escope.analyze; escope.analyze = function (ast, opts) { - opts.ecmaVersion = 6; - opts.sourceType = "module"; + opts.ecmaVersion = eslintOptions.ecmaVersion; + opts.sourceType = eslintOptions.sourceType; + if (eslintOptions.globalReturn !== undefined) { + opts.nodejsScope = eslintOptions.globalReturn; + } var results = analyze.call(this, ast, opts); return results; @@ -353,6 +357,13 @@ function monkeypatch() { exports.parse = function (code, options) { options = options || {}; + eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; + eslintOptions.sourceType = options.sourceType = options.sourceType || "module"; + if (options.sourceType === "module") { + eslintOptions.globalReturn = false; + } else { + delete eslintOptions.globalReturn; + } try { monkeypatch(); @@ -366,7 +377,7 @@ exports.parse = function (code, options) { exports.parseNoPatch = function (code, options) { var opts = { - sourceType: options.sourceType || "module", + sourceType: options.sourceType, strictMode: true, allowImportExportEverywhere: false, // consistent with espree allowReturnOutsideFunction: true, diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index e34e9f506b80..f88ba58cef15 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -2,27 +2,32 @@ "use strict"; var eslint = require("eslint"); -function verifyAndAssertMessages(code, rules, expectedMessages, sourceType) { - var messages = eslint.linter.verify( - code, - { - parser: require.resolve(".."), - rules: rules, - env: { - node: true, - es6: true +function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { + var config = { + parser: require.resolve(".."), + rules: rules, + env: { + node: true, + es6: true + }, + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { + jsx: true, + experimentalObjectRestSpread: true, + globalReturn: true }, - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { - jsx: true, - experimentalObjectRestSpread: true, - globalReturn: true - }, - sourceType: sourceType || "module" - } + sourceType: sourceType + } + }; + + if (overrideConfig) { + for (var key in overrideConfig) { + config[key] = overrideConfig[key] } - ); + } + + var messages = eslint.linter.verify(code, config); if (messages.length !== expectedMessages.length) { throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length + " " + JSON.stringify(messages)); @@ -1362,6 +1367,67 @@ describe("verify", function () { ); }); + it("correctly detects redeclares if in script mode #217", function () { + verifyAndAssertMessages([ + "var a = 321;", + "var a = 123;", + ].join("\n"), + { "no-redeclare": 1 }, + [ "2:5 'a' is already defined no-redeclare" ], + "script" + ); + }); + + it("correctly detects redeclares if in module mode #217", function () { + verifyAndAssertMessages([ + "var a = 321;", + "var a = 123;", + ].join("\n"), + { "no-redeclare": 1 }, + [ "2:5 'a' is already defined no-redeclare" ], + "module" + ); + }); + + it("no-implicit-globals in script", function () { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [ "1:5 Implicit global variable, assign as global property instead. no-implicit-globals" ], + "script", + { + env: {}, + parserOptions: { ecmaVersion: 6, sourceType: "script" } + } + ); + }); + + it("no-implicit-globals in module", function () { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [], + "module", + { + env: {}, + parserOptions: { ecmaVersion: 6, sourceType: "module" } + } + ); + }); + + it("no-implicit-globals in default", function () { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [], + null, + { + env: {}, + parserOptions: { ecmaVersion: 6 } + } + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From cbc0475634a4c91ba18a6b2c87182ab7efea7eb5 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 25 Apr 2016 01:14:39 +0200 Subject: [PATCH 502/965] Update lodash and replace pick by pickBy (babel/babel-eslint#301) --- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 70980797b27e..98d0b18c9d67 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,6 +1,6 @@ var babylonToEspree = require("./babylon-to-espree"); var assign = require("lodash.assign"); -var pick = require("lodash.pick"); +var pick = require("lodash.pickby"); var Module = require("module"); var path = require("path"); var parse = require("babylon").parse; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 856e93aeaded..92705bd7f948 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,8 +15,8 @@ "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.0.18", - "lodash.assign": "^3.2.0", - "lodash.pick": "^3.1.0" + "lodash.assign": "^4.0.0", + "lodash.pickby": "^4.0.0" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", From 0ccbceb9e86b2008b3c4d7f744050f7a10aed00d Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 25 Apr 2016 15:41:43 +0200 Subject: [PATCH 503/965] Ensure strictmode is enabled/disabled when changing sourceType (babel/babel-eslint#302) --- .../babel-eslint-parser/test/non-regression.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index f88ba58cef15..593cc49239c4 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1428,6 +1428,23 @@ describe("verify", function () { ); }); + it("with does not crash parsing in script mode (strict off) #171", function () { + verifyAndAssertMessages( + "with (arguments) { length; }", + {}, + [], + "script" + ); + }); + + it("with does crash parsing in module mode (strict on) #171", function () { + verifyAndAssertMessages( + "with (arguments) { length; }", + {}, + [ "1:1 Parsing error: 'with' in strict mode" ] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From cfd35799da208aa781645e620176b7691ca42d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Ruci=C5=84ski?= Date: Mon, 25 Apr 2016 23:51:43 +0200 Subject: [PATCH 504/965] Fix parent not being set for decorator nodes. (babel/babel-eslint#296) --- eslint/babel-eslint-parser/index.js | 5 +++++ eslint/babel-eslint-parser/test/non-regression.js | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 98d0b18c9d67..46a196e87df9 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -72,6 +72,11 @@ function monkeypatch() { assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); } + estraverses.forEach(function (estraverse) { + estraverse.VisitorKeys.MethodDefinition.push("decorators"); + estraverse.VisitorKeys.Property.push("decorators"); + }); + // monkeypatch escope var escope = require(escopeLoc); var analyze = escope.analyze; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 593cc49239c4..9f1e4d9deaf5 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1048,6 +1048,7 @@ describe("verify", function () { [ "import classDeclaration from 'decorator';", "import decoratorParameter from 'decorator';", + "@classDeclaration((parameter) => parameter)", "@classDeclaration(decoratorParameter)", "@classDeclaration", "export class TextareaAutosize {}" @@ -1063,6 +1064,7 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "export class TextareaAutosize {", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "methodDeclaration(e) {", @@ -1081,9 +1083,11 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "export class TextareaAutosize {", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "get bar() { }", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "set bar(val) { val; }", @@ -1100,6 +1104,7 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "var obj = {", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "methodDeclaration(e) {", @@ -1119,9 +1124,11 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "var obj = {", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "get bar() { },", + "@classMethodDeclarationA((parameter) => parameter)", "@classMethodDeclarationA(decoratorParameter)", "@classMethodDeclarationA", "set bar(val) { val; }", From 161edcca4834c0277b79c62f073844da12c6146a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 25 Apr 2016 17:55:19 -0400 Subject: [PATCH 505/965] 6.0.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 92705bd7f948..81429d0d27b6 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.2", + "version": "6.0.4", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From a2f345b24b5ac01e971b7267086efa0afaa8d77b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 25 Apr 2016 18:00:58 -0400 Subject: [PATCH 506/965] add changelog command --- eslint/babel-eslint-parser/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 81429d0d27b6..2654996cc2f0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -24,7 +24,8 @@ "test": "mocha", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", - "preversion": "npm test" + "preversion": "npm test", + "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, "author": "Sebastian McKenzie ", "license": "MIT", From 872449d6fc3c8515490e5499b5e68db5b1d98cec Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 26 Apr 2016 18:11:33 +0200 Subject: [PATCH 507/965] Add configuration section to README (babel/babel-eslint#303) --- eslint/babel-eslint-parser/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index d57329ae34c9..627e1554fd9c 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -65,6 +65,21 @@ $ npm install eslint@2.x babel-eslint@6 --save-dev Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rules. +### Configuration + +`sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. + +**.eslintrc** + +```json +{ + "parser": "babel-eslint", + "parserOptions": { + "sourceType": "module" + } +} +``` + ### Run ```sh From 2b66040f0dd82a78bf1f0ec08650743a637075d0 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 29 Apr 2016 23:07:02 +0200 Subject: [PATCH 508/965] Add tests for two issues and rename test suite (babel/babel-eslint#304) --- .../babel-eslint-parser/test/babel-eslint.js | 2 +- .../test/non-regression.js | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index a66f1c40cb14..76005da1377f 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -80,7 +80,7 @@ function parseAndAssertSame(code) { // assert.equal(esAST, babylonAST); } -describe("acorn-to-esprima", function () { +describe("babylon-to-esprima", function () { describe("templates", function () { it("empty template string", function () { parseAndAssertSame("``"); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 9f1e4d9deaf5..992667a3df75 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1452,6 +1452,26 @@ describe("verify", function () { ); }); + it("new.target is not reported as undef #235", function () { + verifyAndAssertMessages( + "function foo () { return new.target }", + { "no-undef": 1 }, + [] + ); + }); + + it("decorator does not create TypeError #229", function () { + verifyAndAssertMessages([ + "class A {", + " @test", + " f() {}", + "}" + ].join("\n"), + { "no-undef": 1 }, + [ "2:4 'test' is not defined. no-undef"] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From 81ce743986caa6daabac184f3c3c06828820ec69 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 29 Apr 2016 23:22:40 +0200 Subject: [PATCH 509/965] Add node 6 to travis tests. --- eslint/babel-eslint-parser/.travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index ed629d9af263..f8062f9e28b7 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -8,3 +8,4 @@ node_js: - "0.12" - "4" - "5" + - "6" From 97af2b0b62577cf684f2e1a625c746d1aa69a3da Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Fri, 29 Apr 2016 23:23:13 +0200 Subject: [PATCH 510/965] Add regression test for babel/babel-eslint#223 (babel/babel-eslint#305) --- eslint/babel-eslint-parser/test/non-regression.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 992667a3df75..1d1889c5d6eb 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1468,7 +1468,17 @@ describe("verify", function () { "}" ].join("\n"), { "no-undef": 1 }, - [ "2:4 'test' is not defined. no-undef"] + [ "2:4 'test' is not defined. no-undef" ] + ); + }); + + it("Flow definition does not trigger warnings #223", function () { + verifyAndAssertMessages([ + "import { Map as $Map } from 'immutable';", + "function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {}" + ].join("\n"), + { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 }, + [] ); }); From c8fe9136d754ea253dd5f6034d11e4c6e57e7f2d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 2 May 2016 08:41:41 -0400 Subject: [PATCH 511/965] add a message about using the default parser (babel/babel-eslint#306) * add a message about using the default parser * decrease the size --- eslint/babel-eslint-parser/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 627e1554fd9c..fe434784c551 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -4,7 +4,9 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -`babel-eslint` is successfully linting babel and many other projects. +#### Note: You don't need to use babel-eslint if you are only using ES6/ES2015. ESLint actually supports ES6/ES7, JSX, and object rest/spread by default now. + +##### At the moment, you'll need it if you use stuff like class properties, decorators, async/await, types. > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! From 93a9a8d638853086ebf8ab1cc5a254951a60b70c Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 20 Jun 2016 23:11:38 +0200 Subject: [PATCH 512/965] Reset TypeParameters to Identifier (babel/babel-eslint#325) --- eslint/babel-eslint-parser/babylon-to-espree/toAST.js | 6 ++++++ eslint/babel-eslint-parser/index.js | 3 ++- eslint/babel-eslint-parser/test/non-regression.js | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index f82c4e598e0a..5dce899a52e2 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -167,6 +167,12 @@ var astTransformVisitor = { node.type = "Experimental" + node.type; } + if (path.isTypeParameter && path.isTypeParameter()) { + node.type = "Identifier"; + node.typeAnnotation = node.bound; + delete node.bound; + } + // flow: prevent "no-undef" // for "Component" in: "let x: React.Component" if (path.isQualifiedTypeIdentifier()) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 46a196e87df9..ea963b9e7c75 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -250,7 +250,8 @@ function monkeypatch() { this.close(node); } }; - // visit decorators that are in: Property / MethodDefinition + + // visit decorators that are in: Property / MethodDefinition var visitProperty = referencer.prototype.visitProperty; referencer.prototype.visitProperty = function(node) { if (node.value && node.value.type === "TypeCastExpression") { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1d1889c5d6eb..9b338ec785e7 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -396,7 +396,7 @@ describe("verify", function () { ); }); - it.skip("polymorphpic/generic types - outside of fn scope #123", function () { + it("polymorphpic/generic types - outside of fn scope #123", function () { verifyAndAssertMessages([ "export function foo(value) { value; };", "var b: T = 1; b;" @@ -407,7 +407,7 @@ describe("verify", function () { ); }); - it.skip("polymorphpic/generic types - extending unknown #123", function () { + it("polymorphpic/generic types - extending unknown #123", function () { verifyAndAssertMessages([ "import Bar from 'bar';", "export class Foo extends Bar {}", @@ -786,7 +786,7 @@ describe("verify", function () { ); }); - it.skip("32", function () { + it("32", function () { verifyAndAssertMessages( [ "import type Foo from 'foo';", From 4d473c330579fead88ce135df03a89948c11af46 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 20 Jun 2016 17:12:33 -0400 Subject: [PATCH 513/965] 6.0.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 2654996cc2f0..ae4c2871f66f 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.4", + "version": "6.0.5", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From ab9afd33d1109c7f718c6b1f290b2d2b4309c12f Mon Sep 17 00:00:00 2001 From: rhettlivingston Date: Wed, 22 Jun 2016 16:36:47 -0400 Subject: [PATCH 514/965] Add allowImportExportEverywhere parserOption (babel/babel-eslint#327) (babel/babel-eslint#329) * Add allowImportExportEverywhere parserOption (babel/babel-eslint#327) * Added "allowImportExportEverywhere option (babel/babel-eslint#327)" test. --- eslint/babel-eslint-parser/README.md | 4 +++- eslint/babel-eslint-parser/index.js | 3 ++- .../babel-eslint-parser/test/non-regression.js | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index fe434784c551..da28aa1189d4 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -70,6 +70,7 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ### Configuration `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. +`allowImportExportEverywhere` can be set to true to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. By default, import and export declarations can only appear at a program's top level. **.eslintrc** @@ -77,7 +78,8 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule { "parser": "babel-eslint", "parserOptions": { - "sourceType": "module" + "sourceType": "module", + "allowImportExportEverywhere": false } } ``` diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ea963b9e7c75..aec064893091 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -365,6 +365,7 @@ exports.parse = function (code, options) { options = options || {}; eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; eslintOptions.sourceType = options.sourceType = options.sourceType || "module"; + eslintOptions.allowImportExportEverywhere = options.allowImportExportEverywhere = options.allowImportExportEverywhere || false; if (options.sourceType === "module") { eslintOptions.globalReturn = false; } else { @@ -385,7 +386,7 @@ exports.parseNoPatch = function (code, options) { var opts = { sourceType: options.sourceType, strictMode: true, - allowImportExportEverywhere: false, // consistent with espree + allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, plugins: [ diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 9b338ec785e7..a56bbff3758a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1435,6 +1435,22 @@ describe("verify", function () { ); }); + it("allowImportExportEverywhere option (#327)", function () { + verifyAndAssertMessages([ + "if (true) { import Foo from 'foo'; }", + "function foo() { import Bar from 'bar'; }", + "switch (a) { case 1: import FooBar from 'foobar'; }" + ].join("\n"), + {}, + [], + "module", + { + env: {}, + parserOptions: { ecmaVersion: 6, sourceType: "module", allowImportExportEverywhere: true } + } + ); + }); + it("with does not crash parsing in script mode (strict off) #171", function () { verifyAndAssertMessages( "with (arguments) { length; }", From 167b8bf0a034b0d6f7e1579729ebbec3ecfb08db Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 22 Jun 2016 16:37:11 -0400 Subject: [PATCH 515/965] 6.1.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ae4c2871f66f..891502c9f226 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.0.5", + "version": "6.1.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From ce54b07e2d1520230dd0fdab0d7d1778da7d2f7a Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 26 Jun 2016 21:52:39 +0200 Subject: [PATCH 516/965] Testcase for newline-before-return shouldn't fail with comments. (babel/babel-eslint#300) --- eslint/babel-eslint-parser/test/non-regression.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index a56bbff3758a..d6b5d958a7ee 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1498,6 +1498,21 @@ describe("verify", function () { ); }); + it("newline-before-return with comments #289", function () { + verifyAndAssertMessages(["function a() {", + "if (b) {", + "/* eslint-disable no-console */", + "console.log('test');", + "/* eslint-enable no-console */", + "}", + "", + "return hasGlobal;", + "}"].join("\n"), + { "newline-before-return": 1 }, + [] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From 19baee224290d4f2d906911e45a57636b1f08d5e Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 26 Jun 2016 22:50:50 +0200 Subject: [PATCH 517/965] Add testcase for space-comment and shebang babel/babel-eslint#163 This works as of babylon 6.8.2 --- .../test/non-regression.js | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index d6b5d958a7ee..8caf04aaa651 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1499,20 +1499,32 @@ describe("verify", function () { }); it("newline-before-return with comments #289", function () { - verifyAndAssertMessages(["function a() {", - "if (b) {", - "/* eslint-disable no-console */", - "console.log('test');", - "/* eslint-enable no-console */", - "}", - "", - "return hasGlobal;", - "}"].join("\n"), + verifyAndAssertMessages([ + "function a() {", + "if (b) {", + "/* eslint-disable no-console */", + "console.log('test');", + "/* eslint-enable no-console */", + "}", + "", + "return hasGlobal;", + "}" + ].join("\n"), { "newline-before-return": 1 }, [] ); }); + it("spaced-comment with shebang #163", function () { + verifyAndAssertMessages(["#!/usr/bin/env babel-node", + "", + "import {spawn} from 'foobar';" + ].join("\n"), + { "spaced-comment": 1 }, + [] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From 66a4cf578fa8e7cb5ed2143b98834f014f509c11 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 27 Jun 2016 01:53:27 -0400 Subject: [PATCH 518/965] remove hardcoded strict mode value (babel/babel-eslint#331) --- eslint/babel-eslint-parser/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index aec064893091..004f3a761dbd 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -385,7 +385,6 @@ exports.parse = function (code, options) { exports.parseNoPatch = function (code, options) { var opts = { sourceType: options.sourceType, - strictMode: true, allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, From 9ee5e6e59ca96bc79a32adf0eb2f985fc65c1bd6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 8 Jul 2016 14:23:04 -0400 Subject: [PATCH 519/965] Create a variable for class properties in scope instead of deleting the key (babel/babel-eslint#336) --- eslint/babel-eslint-parser/babylon-to-espree/toAST.js | 5 ----- eslint/babel-eslint-parser/index.js | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 5dce899a52e2..cc680e999e53 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -206,11 +206,6 @@ var astTransformVisitor = { } } - // remove class property keys (or patch in escope) - if (path.isClassProperty()) { - delete node.key; - } - // async function as generator if (path.isFunction()) { if (node.async) node.generator = true; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 004f3a761dbd..9cbfb51a3952 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -229,6 +229,13 @@ function monkeypatch() { // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { + var classBody = node.body.body; + for (var a = 0; a < classBody.length; a++) { + if (classBody[a].type === "ClassProperty") { + createScopeVariable.call(this, classBody[a], classBody[a].key); + } + } + visitDecorators.call(this, node); var typeParamScope; if (node.typeParameters) { From 52d9c34465aba12ea42b8eadc1c7b36361f92e0a Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 8 Jul 2016 14:23:39 -0400 Subject: [PATCH 520/965] 6.1.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 891502c9f226..1ebc73129f63 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.1.0", + "version": "6.1.1", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 1766a21145d8ebd3d8c1133b5761032d3f821033 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sun, 10 Jul 2016 00:40:08 +0900 Subject: [PATCH 521/965] Fix: improve handling of class properties (fixes babel/babel-eslint#337) (babel/babel-eslint#338) I added ClassProperty method into Referencer of escope. This method will address class properties and those type anotations. --- eslint/babel-eslint-parser/index.js | 15 +++--- .../test/non-regression.js | 48 +++++++++++++++++++ 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 9cbfb51a3952..90c9259fef45 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -229,13 +229,6 @@ function monkeypatch() { // visit decorators that are in: ClassDeclaration / ClassExpression var visitClass = referencer.prototype.visitClass; referencer.prototype.visitClass = function(node) { - var classBody = node.body.body; - for (var a = 0; a < classBody.length; a++) { - if (classBody[a].type === "ClassProperty") { - createScopeVariable.call(this, classBody[a], classBody[a].key); - } - } - visitDecorators.call(this, node); var typeParamScope; if (node.typeParameters) { @@ -268,6 +261,14 @@ function monkeypatch() { visitProperty.call(this, node); }; + // visit ClassProperty as a Property. + referencer.prototype.ClassProperty = function(node) { + if (node.typeAnnotation) { + visitTypeAnnotation.call(this, node.typeAnnotation); + } + this.visitProperty(node); + }; + // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression var visitFunction = referencer.prototype.visitFunction; referencer.prototype.visitFunction = function(node) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 8caf04aaa651..1aca7343ceee 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1525,6 +1525,54 @@ describe("verify", function () { ); }); + describe("Class Property Declarations", function() { + it("no-redeclare false positive 1", function() { + verifyAndAssertMessages( + [ + "class Group {", + " static propTypes = {};", + "}", + "class TypicalForm {", + " static propTypes = {};", + "}" + ].join("\n"), + { "no-redeclare": 1 }, + [] + ); + }); + + it("no-redeclare false positive 2", function() { + verifyAndAssertMessages( + [ + "function validate() {}", + "class MyComponent {", + " static validate = validate;", + "}" + ].join("\n"), + { "no-redeclare": 1 }, + [] + ); + }); + + it("check references", function() { + verifyAndAssertMessages( + [ + "var a;", + "class A {", + " prop1;", + " prop2 = a;", + " prop3 = b;", + "}", + "new A" + ].join("\n"), + { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, + [ + "5:11 'b' is not defined. no-undef" + ] + ); + }); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From b0dbbfcc031983f0a93a637d0b7de676ccdc97d8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 9 Jul 2016 11:40:34 -0400 Subject: [PATCH 522/965] 6.1.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1ebc73129f63..dfaa5254e2c2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.1.1", + "version": "6.1.2", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 0cb35ab04e8a2a5d5c223a16dbe3311803b39978 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sun, 10 Jul 2016 23:47:44 +0200 Subject: [PATCH 523/965] Fix tests for eslint 3.0 Seems that eslint got a lot smarter and reports vars that are used, but are useless as unused These examples are also failing with espree --- eslint/babel-eslint-parser/test/non-regression.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1aca7343ceee..17bd277fedae 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -174,7 +174,7 @@ describe("verify", function () { describe("flow", function () { it("check regular function", function () { verifyAndAssertMessages([ - "function a(b, c) { b += 1; c += 1; } a;", + "function a(b, c) { b += 1; c += 1; return b + c; } a;", ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] @@ -389,7 +389,7 @@ describe("verify", function () { it("polymorphpic/generic types for type alias #123", function () { verifyAndAssertMessages([ "import Bar from './Bar';", - "type Foo = Bar; var x: Foo = 1; x++" + "type Foo = Bar; var x: Foo = 1; console.log(x);" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] From af44a1cc83bffbd7a703ef690f8ff10005bde85f Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 11 Jul 2016 00:28:57 +0200 Subject: [PATCH 524/965] Test eslint 3 and 2 on travis (babel/babel-eslint#340) closes babel/babel-eslint#332 --- eslint/babel-eslint-parser/.travis.yml | 27 ++++++++++++++++++------- eslint/babel-eslint-parser/package.json | 2 +- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index f8062f9e28b7..284614267923 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,11 +1,24 @@ ---- git: depth: 1 sudo: false language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "5" - - "6" +before_install: + - sh -c "if [ '$ESLINT_VERSION' = '2' ]; then npm i --save-dev eslint@2; fi" +matrix: + include: + - node_js: "0.10" + env: ESLINT_VERSION=2 + - node_js: "0.12" + env: ESLINT_VERSION=2 + - node_js: "4" + env: ESLINT_VERSION=2 + - node_js: "4" + env: ESLINT_VERSION=3 + - node_js: "5" + env: ESLINT_VERSION=2 + - node_js: "5" + env: ESLINT_VERSION=3 + - node_js: "6" + env: ESLINT_VERSION=2 + - node_js: "6" + env: ESLINT_VERSION=3 diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dfaa5254e2c2..798b69311c7e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -34,7 +34,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^2.4.0", + "eslint": "^3.0.0", "espree": "^3.0.0", "mocha": "^2.3.3" } From 289bf4f84a2e81bd24a0cf835b9d4dda2f1da870 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 11 Jul 2016 01:18:41 +0200 Subject: [PATCH 525/965] Add note about eslint 3 [skip ci] --- eslint/babel-eslint-parser/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index da28aa1189d4..5eadb475df29 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -44,12 +44,22 @@ It just needs to export a `parse` method that takes in a string of code and outp ## Usage +### Supported ESLint versions + +ESLint | babel-eslint +------------ | ------------- +1.x | <= 5.x +2.x | >= 6.x +3.x | >= 6.x + ### Install ```sh $ npm install eslint@1.x babel-eslint@5 --save-dev $ npm install eslint@2.x babel-eslint@6 --save-dev + +$ npm install eslint@3.x babel-eslint@6 --save-dev ``` ### Setup From 0534eb764495bbc79be815da8369072149151651 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 30 Jul 2016 19:44:42 +0200 Subject: [PATCH 526/965] Fix tests for eslint 3.2 (babel/babel-eslint#352) --- eslint/babel-eslint-parser/test/non-regression.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 17bd277fedae..eeb993adb5f6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -402,7 +402,7 @@ describe("verify", function () { "var b: T = 1; b;" ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:21 'T' is defined but never used no-unused-vars", + [ "1:21 'T' is defined but never used. no-unused-vars", "2:8 'T' is not defined. no-undef" ] ); }); @@ -1145,7 +1145,7 @@ describe("verify", function () { verifyAndAssertMessages( "var unused;", { "no-unused-vars": 1 }, - [ "1:5 'unused' is defined but never used no-unused-vars" ] + [ "1:5 'unused' is defined but never used. no-unused-vars" ] ); }); @@ -1196,7 +1196,7 @@ describe("verify", function () { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:8 'Bacona' is defined but never used no-unused-vars" ] + [ "1:8 'Bacona' is defined but never used. no-unused-vars" ] ); }); From 50e0abfd16e39bebbec2f315040f39daf7c315f7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 1 Aug 2016 15:00:01 -0400 Subject: [PATCH 527/965] Drop node < 4 (babel/babel-eslint#358) --- eslint/babel-eslint-parser/.travis.yml | 15 --------------- eslint/babel-eslint-parser/package.json | 3 +++ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 284614267923..8aac7f25eee0 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -2,23 +2,8 @@ git: depth: 1 sudo: false language: node_js -before_install: - - sh -c "if [ '$ESLINT_VERSION' = '2' ]; then npm i --save-dev eslint@2; fi" matrix: include: - - node_js: "0.10" - env: ESLINT_VERSION=2 - - node_js: "0.12" - env: ESLINT_VERSION=2 - node_js: "4" - env: ESLINT_VERSION=2 - - node_js: "4" - env: ESLINT_VERSION=3 - - node_js: "5" - env: ESLINT_VERSION=2 - node_js: "5" - env: ESLINT_VERSION=3 - - node_js: "6" - env: ESLINT_VERSION=2 - node_js: "6" - env: ESLINT_VERSION=3 diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 798b69311c7e..8fbade9960fc 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -29,6 +29,9 @@ }, "author": "Sebastian McKenzie ", "license": "MIT", + "engines": { + "node": ">=4" + }, "bugs": { "url": "https://github.com/babel/babel-eslint/issues" }, From 481329a47e6b3defdfcf5ac8d40813c19e27390b Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Tue, 2 Aug 2016 04:34:39 +0200 Subject: [PATCH 528/965] chore(package): update mocha to version 3.0.0 (babel/babel-eslint#356) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8fbade9960fc..0234029bdc55 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -39,6 +39,6 @@ "devDependencies": { "eslint": "^3.0.0", "espree": "^3.0.0", - "mocha": "^2.3.3" + "mocha": "^3.0.0" } } From 2b812b087c47e8968a9d0bc087bbaf87aed3dc09 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 3 Aug 2016 09:34:51 -0400 Subject: [PATCH 529/965] Merge pull request babel/babel-eslint#354 from babel/eslint-config-babel Use eslint-config-babel --- eslint/babel-eslint-parser/.eslintignore | 1 + eslint/babel-eslint-parser/.eslintrc | 28 -- eslint/babel-eslint-parser/.eslintrc.js | 16 + eslint/babel-eslint-parser/.travis.yml | 2 + .../babylon-to-espree/convertTemplateType.js | 2 +- .../babylon-to-espree/index.js | 2 +- .../babylon-to-espree/toAST.js | 32 +- eslint/babel-eslint-parser/index.js | 32 +- eslint/babel-eslint-parser/package.json | 2 + .../babel-eslint-parser/test/babel-eslint.js | 108 ++--- .../test/fixtures/rules/strict/global-with.js | 2 +- .../test/non-regression.js | 452 +++++++++--------- 12 files changed, 334 insertions(+), 345 deletions(-) create mode 100644 eslint/babel-eslint-parser/.eslintignore delete mode 100644 eslint/babel-eslint-parser/.eslintrc create mode 100644 eslint/babel-eslint-parser/.eslintrc.js diff --git a/eslint/babel-eslint-parser/.eslintignore b/eslint/babel-eslint-parser/.eslintignore new file mode 100644 index 000000000000..a843dc44a197 --- /dev/null +++ b/eslint/babel-eslint-parser/.eslintignore @@ -0,0 +1 @@ +test/fixtures diff --git a/eslint/babel-eslint-parser/.eslintrc b/eslint/babel-eslint-parser/.eslintrc deleted file mode 100644 index 57a95f9d7e45..000000000000 --- a/eslint/babel-eslint-parser/.eslintrc +++ /dev/null @@ -1,28 +0,0 @@ -{ - "root": true, - "rules": { - "strict": 0, - "no-underscore-dangle": 0, - "curly": 0, - "no-multi-spaces": 0, - "key-spacing": 0, - "no-return-assign": 0, - "consistent-return": 0, - "no-shadow": 0, - "comma-dangle": 0, - "no-use-before-define": 0, - "no-empty": 0, - "new-parens": 0, - "no-cond-assign": 0, - "no-fallthrough": 0, - "new-cap": 0, - "no-loop-func": 0, - "no-unreachable": 0, - "no-process-exit": 0, - "quotes": [1, "double", "avoid-escape"] - }, - "env": { - "node": true, - "mocha": true - } -} diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js new file mode 100644 index 000000000000..1f91933ff5b4 --- /dev/null +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + root: true, + extends: "babel", + parserOptions: { + ecmaVersion: 7, + sourceType: "module" + }, + rules: { + "no-var": 0, + "max-len": 0 + }, + env: { + node: true, + mocha: true + } +}; diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 8aac7f25eee0..9f2b522cd50e 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -7,3 +7,5 @@ matrix: - node_js: "4" - node_js: "5" - node_js: "6" + +script: npm run test-ci diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js index 0c3293dcf9d7..c9537ddde0e9 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js @@ -90,4 +90,4 @@ module.exports = function (tokens, tt) { } startingToken++; } -} +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/babylon-to-espree/index.js index 70accfdfcff2..401570b6b199 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/index.js @@ -17,4 +17,4 @@ exports.convertComments = function (comments) { comment.range = [comment.start, comment.end]; } } -} +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index cc680e999e53..388253f1d06e 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -17,6 +17,18 @@ function changeToLiteral(node) { } } +function changeComments(nodeComments) { + for (var i = 0; i < nodeComments.length; i++) { + var comment = nodeComments[i]; + if (comment.type === "CommentLine") { + comment.type = "Line"; + } else if (comment.type === "CommentBlock") { + comment.type = "Block"; + } + comment.range = [comment.start, comment.end]; + } +} + var astTransformVisitor = { noScope: true, enter: function (path) { @@ -33,27 +45,11 @@ var astTransformVisitor = { } if (node.trailingComments) { - for (var i = 0; i < node.trailingComments.length; i++) { - var comment = node.trailingComments[i]; - if (comment.type === "CommentLine") { - comment.type = "Line"; - } else if (comment.type === "CommentBlock") { - comment.type = "Block"; - } - comment.range = [comment.start, comment.end]; - } + changeComments(node.trailingComments); } if (node.leadingComments) { - for (var i = 0; i < node.leadingComments.length; i++) { - var comment = node.leadingComments[i]; - if (comment.type === "CommentLine") { - comment.type = "Line"; - } else if (comment.type === "CommentBlock") { - comment.type = "Block"; - } - comment.range = [comment.start, comment.end]; - } + changeComments(node.leadingComments); } // make '_paths' non-enumerable (babel-eslint #200) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 90c9259fef45..f41deb047605 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -388,7 +388,7 @@ exports.parse = function (code, options) { } return exports.parseNoPatch(code, options); -} +}; exports.parseNoPatch = function (code, options) { var opts = { @@ -397,20 +397,20 @@ exports.parseNoPatch = function (code, options) { allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, plugins: [ - "flow", - "jsx", - "asyncFunctions", - "asyncGenerators", - "classConstructorCall", - "classProperties", - "decorators", - "doExpressions", - "exponentiationOperator", - "exportExtensions", - "functionBind", - "functionSent", - "objectRestSpread", - "trailingFunctionCommas" + "flow", + "jsx", + "asyncFunctions", + "asyncGenerators", + "classConstructorCall", + "classProperties", + "decorators", + "doExpressions", + "exponentiationOperator", + "exportExtensions", + "functionBind", + "functionSent", + "objectRestSpread", + "trailingFunctionCommas" ] }; @@ -458,4 +458,4 @@ exports.parseNoPatch = function (code, options) { babylonToEspree.attachComments(ast, ast.comments, ast.tokens); return ast; -} +}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0234029bdc55..12f568b375ea 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -22,6 +22,7 @@ "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", + "test-ci" "npm test && npm run lint", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", "preversion": "npm test", @@ -38,6 +39,7 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "eslint": "^3.0.0", + "eslint-config-babel": "^1.0.1", "espree": "^3.0.0", "mocha": "^3.0.0" } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 76005da1377f..956354803a09 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -36,20 +36,20 @@ function lookup(obj, keypath, backwardsDepth) { if (!keypath) { return obj; } return keypath.split(".").slice(0, -1 * backwardsDepth) - .reduce(function (base, segment) { return base && base[segment], obj }); + .reduce(function (base, segment) { return base && base[segment], obj; }); } function parseAndAssertSame(code) { var esAST = espree.parse(code, { ecmaFeatures: { // enable JSX parsing - jsx: true, + jsx: true, // enable return in global scope - globalReturn: true, + globalReturn: true, // enable implied strict mode (if ecmaVersion >= 5) - impliedStrict: true, + impliedStrict: true, // allow experimental object rest/spread - experimentalObjectRestSpread: true + experimentalObjectRestSpread: true }, tokens: true, loc: true, @@ -62,7 +62,7 @@ function parseAndAssertSame(code) { var babylonAST = babelEslint.parse(code); try { assertImplementsAST(esAST, babylonAST); - } catch(err) { + } catch (err) { var traversal = err.message.slice(3, err.message.indexOf(":")); if (esAST.tokens) { delete esAST.tokens; @@ -145,10 +145,10 @@ describe("babylon-to-esprima", function () { it("template with destructuring #31", function () { parseAndAssertSame([ "module.exports = {", - "render() {", - "var {name} = this.props;", - "return Math.max(null, `Name: ${name}, Name: ${name}`);", - "}", + "render() {", + "var {name} = this.props;", + "return Math.max(null, `Name: ${name}, Name: ${name}`);", + "}", "};" ].join("\n")); }); @@ -199,19 +199,19 @@ describe("babylon-to-esprima", function () { }); it("default import", function () { - parseAndAssertSame('import foo from "foo";'); + parseAndAssertSame("import foo from \"foo\";"); }); it("import specifier", function () { - parseAndAssertSame('import { foo } from "foo";'); + parseAndAssertSame("import { foo } from \"foo\";"); }); it("import specifier with name", function () { - parseAndAssertSame('import { foo as bar } from "foo";'); + parseAndAssertSame("import { foo as bar } from \"foo\";"); }); it("import bare", function () { - parseAndAssertSame('import "foo";'); + parseAndAssertSame("import \"foo\";"); }); it("export default class declaration", function () { @@ -231,7 +231,7 @@ describe("babylon-to-esprima", function () { }); it("export all", function () { - parseAndAssertSame('export * from "foo";'); + parseAndAssertSame("export * from \"foo\";"); }); it("export named", function () { @@ -272,11 +272,11 @@ describe("babylon-to-esprima", function () { it("block comments #124", function () { parseAndAssertSame([ "React.createClass({", - "render() {", - "// return (", - "//
", - "// ); // <-- this is the line that is reported", - "}", + "render() {", + "// return (", + "//
", + "// ); // <-- this is the line that is reported", + "}", "});" ].join("\n")); }); @@ -308,24 +308,24 @@ describe("babylon-to-esprima", function () { it("jsdoc", function () { parseAndAssertSame([ "/**", - "* @param {object} options", - "* @return {number}", - "*/", + "* @param {object} options", + "* @return {number}", + "*/", "const test = function({ a, b, c }) {", - "return a + b + c;", + "return a + b + c;", "};", "module.exports = test;" ].join("\n")); - }) + }); it("empty block with comment", function () { parseAndAssertSame([ "function a () {", - "try {", - "b();", - "} catch (e) {", - "// asdf", - "}", + "try {", + "b();", + "} catch (e) {", + "// asdf", + "}", "}" ].join("\n")); }); @@ -334,7 +334,7 @@ describe("babylon-to-esprima", function () { it("MethodDefinition", function () { parseAndAssertSame([ "export default class A {", - "a() {}", + "a() {}", "}" ].join("\n")); }); @@ -348,8 +348,8 @@ describe("babylon-to-esprima", function () { it("ClassMethod", function () { parseAndAssertSame([ "class A {", - "constructor() {", - "}", + "constructor() {", + "}", "}" ].join("\n")); }); @@ -357,8 +357,8 @@ describe("babylon-to-esprima", function () { it("ClassMethod multiple params", function () { parseAndAssertSame([ "class A {", - "constructor(a, b, c) {", - "}", + "constructor(a, b, c) {", + "}", "}" ].join("\n")); }); @@ -385,8 +385,8 @@ describe("babylon-to-esprima", function () { it("ObjectMethod", function () { parseAndAssertSame([ "var a = {", - "b(c) {", - "}", + "b(c) {", + "}", "}" ].join("\n")); }); @@ -394,7 +394,7 @@ describe("babylon-to-esprima", function () { it("do not allow import export everywhere", function() { assert.throws(function () { parseAndAssertSame("function F() { import a from \"a\"; }"); - }, /SyntaxError: 'import' and 'export' may only appear at the top level/) + }, /SyntaxError: 'import' and 'export' may only appear at the top level/); }); it("return outside function", function () { @@ -415,31 +415,31 @@ describe("babylon-to-esprima", function () { parseAndAssertSame("class A { get x ( ) { ; } }"); parseAndAssertSame([ "class A {", - "get x(", - ")", - "{", - ";", - "}", + "get x(", + ")", + "{", + ";", + "}", "}" ].join("\n")); parseAndAssertSame("class A { set x (a) { ; } }"); parseAndAssertSame([ "class A {", - "set x(a", - ")", - "{", - ";", - "}", + "set x(a", + ")", + "{", + ";", + "}", "}" ].join("\n")); parseAndAssertSame([ "var B = {", - "get x () {", - "return this.ecks;", - "},", - "set x (ecks) {", - "this.ecks = ecks;", - "}", + "get x () {", + "return this.ecks;", + "},", + "set x (ecks) {", + "this.ecks = ecks;", + "}", "};" ].join("\n")); }); diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js index b28e68be0cd3..e967aa4994d0 100644 --- a/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js +++ b/eslint/babel-eslint-parser/test/fixtures/rules/strict/global-with.js @@ -1,4 +1,4 @@ -"use strict";; +"use strict"; /* The empty statement is intentional. As of now, ESLint won't enforce string: [2, "global"] on a program with an empty body. A test for that without diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index eeb993adb5f6..e75a75a6edaa 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -23,7 +23,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over if (overrideConfig) { for (var key in overrideConfig) { - config[key] = overrideConfig[key] + config[key] = overrideConfig[key]; } } @@ -161,11 +161,11 @@ describe("verify", function () { it("comment with padded-blocks (issue #33)", function () { verifyAndAssertMessages([ - "if (a){", - "// i'm a comment!", - "let b = c", - "}" - ].join("\n"), + "if (a){", + "// i'm a comment!", + "let b = c", + "}" + ].join("\n"), { "padded-blocks": [1, "never"] }, [] ); @@ -174,8 +174,8 @@ describe("verify", function () { describe("flow", function () { it("check regular function", function () { verifyAndAssertMessages([ - "function a(b, c) { b += 1; c += 1; return b + c; } a;", - ].join("\n"), + "function a(b, c) { b += 1; c += 1; return b + c; } a;", + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -199,14 +199,14 @@ describe("verify", function () { it("multiple nullable type annotations and return #108", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "function log(foo: ?Foo, foo2: ?Foo2): ?Foo3 {", - "console.log(foo, foo2);", - "}", - "log(1, 2);" - ].join("\n"), + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "import type Foo3 from 'foo';", + "function log(foo: ?Foo, foo2: ?Foo2): ?Foo3 {", + "console.log(foo, foo2);", + "}", + "log(1, 2);" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -214,11 +214,11 @@ describe("verify", function () { it("type parameters", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "function log(a: T1, b: T2) { return a + b; }", - "log(1, 2);" - ].join("\n"), + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "function log(a: T1, b: T2) { return a + b; }", + "log(1, 2);" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -226,12 +226,12 @@ describe("verify", function () { it("nested type annotations", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "function foo(callback: () => Foo) {", - "return callback();", - "}", - "foo();" - ].join("\n"), + "import type Foo from 'foo';", + "function foo(callback: () => Foo) {", + "return callback();", + "}", + "foo();" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -239,10 +239,10 @@ describe("verify", function () { it("type in var declaration", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var x: Foo = 1;", - "x;" - ].join("\n"), + "import type Foo from 'foo';", + "var x: Foo = 1;", + "x;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -250,10 +250,10 @@ describe("verify", function () { it("object type annotation", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var a: {numVal: Foo};", - "a;" - ].join("\n"), + "import type Foo from 'foo';", + "var a: {numVal: Foo};", + "a;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -261,13 +261,13 @@ describe("verify", function () { it("object property types", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a = {", - "circle: (null : ?{ setNativeProps(props: Foo): Foo2 })", - "};", - "a;" - ].join("\n"), + "import type Foo from 'foo';", + "import type Foo2 from 'foo';", + "var a = {", + "circle: (null : ?{ setNativeProps(props: Foo): Foo2 })", + "};", + "a;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -275,16 +275,16 @@ describe("verify", function () { it("namespaced types", function () { verifyAndAssertMessages([ - "var React = require('react-native');", - "var b = {", - "openExternalExample: (null: ?React.Component)", - "};", - "var c = {", - "render(): React.Component {}", - "};", - "b;", - "c;" - ].join("\n"), + "var React = require('react-native');", + "var b = {", + "openExternalExample: (null: ?React.Component)", + "};", + "var c = {", + "render(): React.Component {}", + "};", + "b;", + "c;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -292,9 +292,9 @@ describe("verify", function () { it("ArrayTypeAnnotation", function () { verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var x: Foo[]; x;" - ].join("\n"), + "import type Foo from 'foo';", + "var x: Foo[]; x;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -302,9 +302,9 @@ describe("verify", function () { it("ClassImplements", function () { verifyAndAssertMessages([ - "import type Bar from 'foo';", - "export default class Foo implements Bar {}" - ].join("\n"), + "import type Bar from 'foo';", + "export default class Foo implements Bar {}" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -312,9 +312,9 @@ describe("verify", function () { it("type alias creates declaration + usage", function () { verifyAndAssertMessages([ - "type Foo = any;", - "var x : Foo = 1; x;" - ].join("\n"), + "type Foo = any;", + "var x : Foo = 1; x;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -322,11 +322,11 @@ describe("verify", function () { it("type alias with type parameters", function () { verifyAndAssertMessages([ - "import type Bar from 'foo';", - "import type Foo3 from 'foo';", - "type Foo = Bar", - "var x : Foo = 1; x;" - ].join("\n"), + "import type Bar from 'foo';", + "import type Foo3 from 'foo';", + "type Foo = Bar", + "var x : Foo = 1; x;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -334,9 +334,9 @@ describe("verify", function () { it("export type alias", function () { verifyAndAssertMessages([ - "import type Foo2 from 'foo';", - "export type Foo = Foo2;" - ].join("\n"), + "import type Foo2 from 'foo';", + "export type Foo = Foo2;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -344,8 +344,8 @@ describe("verify", function () { it("polymorphpic types #109", function () { verifyAndAssertMessages([ - "export default function groupByEveryN(array: Array, n: number): Array> { n; }" - ].join("\n"), + "export default function groupByEveryN(array: Array, n: number): Array> { n; }" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -353,10 +353,10 @@ describe("verify", function () { it("types definition from import", function () { verifyAndAssertMessages([ - "import type Promise from 'bluebird';", - "type Operation = () => Promise;", - "x: Operation;" - ].join("\n"), + "import type Promise from 'bluebird';", + "type Operation = () => Promise;", + "x: Operation;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -364,12 +364,12 @@ describe("verify", function () { it("polymorphpic/generic types for class #123", function () { verifyAndAssertMessages([ - "class Box {", - "value: T;", - "}", - "var box = new Box();", - "console.log(box.value);" - ].join("\n"), + "class Box {", + "value: T;", + "}", + "var box = new Box();", + "console.log(box.value);" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -377,10 +377,10 @@ describe("verify", function () { it("polymorphpic/generic types for function #123", function () { verifyAndAssertMessages([ - "export function identity(value) {", - "var a: T = value; a;", - "}" - ].join("\n"), + "export function identity(value) {", + "var a: T = value; a;", + "}" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -388,9 +388,9 @@ describe("verify", function () { it("polymorphpic/generic types for type alias #123", function () { verifyAndAssertMessages([ - "import Bar from './Bar';", - "type Foo = Bar; var x: Foo = 1; console.log(x);" - ].join("\n"), + "import Bar from './Bar';", + "type Foo = Bar; var x: Foo = 1; console.log(x);" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -398,9 +398,9 @@ describe("verify", function () { it("polymorphpic/generic types - outside of fn scope #123", function () { verifyAndAssertMessages([ - "export function foo(value) { value; };", - "var b: T = 1; b;" - ].join("\n"), + "export function foo(value) { value; };", + "var b: T = 1; b;" + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [ "1:21 'T' is defined but never used. no-unused-vars", "2:8 'T' is not defined. no-undef" ] @@ -409,9 +409,9 @@ describe("verify", function () { it("polymorphpic/generic types - extending unknown #123", function () { verifyAndAssertMessages([ - "import Bar from 'bar';", - "export class Foo extends Bar {}", - ].join("\n"), + "import Bar from 'bar';", + "export class Foo extends Bar {}", + ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [ "2:30 'T' is not defined. no-undef" ] ); @@ -419,12 +419,12 @@ describe("verify", function () { it("support declarations #132", function () { verifyAndAssertMessages([ - "declare class A { static () : number }", - "declare module B { declare var x: number; }", - "declare function foo(): void;", - "declare var bar", - "A; B; foo(); bar;" - ].join("\n"), + "declare class A { static () : number }", + "declare module B { declare var x: number; }", + "declare function foo(): void;", + "declare var bar", + "A; B; foo(); bar;" + ].join("\n"), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -1002,12 +1002,12 @@ describe("verify", function () { it("class definition: gaearon/redux#24", function () { verifyAndAssertMessages([ - "export default function root(stores) {", - "return DecoratedComponent => class ReduxRootDecorator {", - "a() { DecoratedComponent; stores; }", - "};", - "}", - ].join("\n"), + "export default function root(stores) {", + "return DecoratedComponent => class ReduxRootDecorator {", + "a() { DecoratedComponent; stores; }", + "};", + "}", + ].join("\n"), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -1032,10 +1032,10 @@ describe("verify", function () { it("template with destructuring #31", function () { verifyAndAssertMessages([ "module.exports = {", - "render() {", - "var {name} = this.props;", - "return Math.max(null, `Name: ${name}, Name: ${name}`);", - "}", + "render() {", + "var {name} = this.props;", + "return Math.max(null, `Name: ${name}, Name: ${name}`);", + "}", "};"].join("\n"), { "comma-spacing": 1 }, [] @@ -1064,12 +1064,12 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "export class TextareaAutosize {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "methodDeclaration(e) {", - "e();", - "}", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "methodDeclaration(e) {", + "e();", + "}", "}" ].join("\n"), { "no-unused-vars": 1 }, @@ -1083,14 +1083,14 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "export class TextareaAutosize {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "get bar() { }", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "set bar(val) { val; }", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "get bar() { }", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "set bar(val) { val; }", "}" ].join("\n"), { "no-unused-vars": 1 }, @@ -1104,12 +1104,12 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "var obj = {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "methodDeclaration(e) {", - "e();", - "}", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "methodDeclaration(e) {", + "e();", + "}", "};", "obj;" ].join("\n"), @@ -1124,14 +1124,14 @@ describe("verify", function () { "import classMethodDeclarationA from 'decorator';", "import decoratorParameter from 'decorator';", "var obj = {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "get bar() { },", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "set bar(val) { val; }", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "get bar() { },", + "@classMethodDeclarationA((parameter) => parameter)", + "@classMethodDeclarationA(decoratorParameter)", + "@classMethodDeclarationA", + "set bar(val) { val; }", "};", "obj;" ].join("\n"), @@ -1202,13 +1202,13 @@ describe("verify", function () { it("don't warn no-unused-vars with spread #142", function () { verifyAndAssertMessages([ - "export default function test(data) {", - "return {", - "foo: 'bar',", - "...data", - "};", - "}", - ].join("\n"), + "export default function test(data) {", + "return {", + "foo: 'bar',", + "...data", + "};", + "}", + ].join("\n"), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -1218,8 +1218,8 @@ describe("verify", function () { verifyAndAssertMessages( [ "var a = [", - "1,", - "2, // a trailing comment makes this line fail comma-dangle (always-multiline)", + "1,", + "2, // a trailing comment makes this line fail comma-dangle (always-multiline)", "];", ].join("\n"), { "comma-dangle": [2, "always-multiline"] }, @@ -1229,9 +1229,9 @@ describe("verify", function () { verifyAndAssertMessages( [ "switch (a) {", - "// A comment here makes the above line fail brace-style", - "case 1:", - "console.log(a);", + "// A comment here makes the above line fail brace-style", + "case 1:", + "console.log(a);", "}" ].join("\n"), { "brace-style": 2 }, @@ -1241,8 +1241,8 @@ describe("verify", function () { it("ternary and parens #149", function () { verifyAndAssertMessages([ - "true ? (true) : false;" - ].join("\n"), + "true ? (true) : false;" + ].join("\n"), { "space-infix-ops": 1 }, [] ); @@ -1252,67 +1252,67 @@ describe("verify", function () { verifyAndAssertMessages( [ "React.createClass({", - "render() {", - "// return (", - "//
", - "// ); // <-- this is the line that is reported", - "}", + "render() {", + "// return (", + "//
", + "// ); // <-- this is the line that is reported", + "}", "});" ].join("\n"), { "space-in-parens": 1 }, [ ] - ) + ); }); it("block comment space-in-parens #124", function () { verifyAndAssertMessages( [ "React.createClass({", - "render() {", - "/*", - "return (", - "
", - "); // <-- this is the line that is reported", - "*/", - "}", + "render() {", + "/*", + "return (", + "
", + "); // <-- this is the line that is reported", + "*/", + "}", "});" ].join("\n"), { "space-in-parens": 1 }, [ ] - ) + ); }); it("no no-undef error with rest #11", function () { verifyAndAssertMessages("const [a, ...rest] = ['1', '2', '3']; a; rest;", { "no-undef": 1, "no-unused-vars": 1 }, [ ] - ) + ); }); it("async function with space-before-function-paren #168", function () { verifyAndAssertMessages("it('handles updates', async function() {});", { "space-before-function-paren": [1, "never"] }, [ ] - ) + ); }); it("default param flow type no-unused-vars #184", function () { verifyAndAssertMessages( [ "type ResolveOptionType = {", - "depth?: number,", - "identifier?: string", + "depth?: number,", + "identifier?: string", "};", "", "export default function resolve(", - "options: ResolveOptionType = {}", + "options: ResolveOptionType = {}", "): Object {", - "options;", + "options;", "}", ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [ ] - ) + ); }); it("no-use-before-define #192", function () { @@ -1322,8 +1322,8 @@ describe("verify", function () { "var x = 1;" ].join("\n"), { "no-use-before-define": 1 }, - [ "1:13 'x' was used before it was defined no-use-before-define" ] - ) + [ "1:13 'x' was used before it was defined. no-use-before-define" ] + ); }); it("jsx and stringliteral #216", function () { @@ -1331,31 +1331,31 @@ describe("verify", function () { "
", {}, [] - ) + ); }); it("getter/setter #218", function () { verifyAndAssertMessages([ - "class Person {", - " set a (v) { }", - "}" - ].join("\n"), + "class Person {", + " set a (v) { }", + "}" + ].join("\n"), { "space-before-function-paren": 1, "keyword-spacing": [1, {"before": true}], "indent": 1 }, [] - ) + ); }); it("getter/setter #220", function () { verifyAndAssertMessages([ - "var B = {", - "get x () {", - "return this.ecks;", - "},", - "set x (ecks) {", - "this.ecks = ecks;", - "}", - "};" - ].join("\n"), + "var B = {", + "get x () {", + "return this.ecks;", + "},", + "set x (ecks) {", + "this.ecks = ecks;", + "}", + "};" + ].join("\n"), { "no-dupe-keys": 1 }, [] ); @@ -1363,12 +1363,12 @@ describe("verify", function () { it("fixes issues with flow types and ObjectPattern", function () { verifyAndAssertMessages([ - "import type Foo from 'bar';", - "export default class Foobar {", - " foo({ bar }: Foo) { bar; }", - " bar({ foo }: Foo) { foo; }", - "}" - ].join("\n"), + "import type Foo from 'bar';", + "export default class Foobar {", + " foo({ bar }: Foo) { bar; }", + " bar({ foo }: Foo) { foo; }", + "}" + ].join("\n"), { "no-unused-vars": 1, "no-shadow": 1 }, [] ); @@ -1376,22 +1376,22 @@ describe("verify", function () { it("correctly detects redeclares if in script mode #217", function () { verifyAndAssertMessages([ - "var a = 321;", - "var a = 123;", - ].join("\n"), + "var a = 321;", + "var a = 123;", + ].join("\n"), { "no-redeclare": 1 }, - [ "2:5 'a' is already defined no-redeclare" ], + [ "2:5 'a' is already defined. no-redeclare" ], "script" ); }); it("correctly detects redeclares if in module mode #217", function () { verifyAndAssertMessages([ - "var a = 321;", - "var a = 123;", - ].join("\n"), + "var a = 321;", + "var a = 123;", + ].join("\n"), { "no-redeclare": 1 }, - [ "2:5 'a' is already defined no-redeclare" ], + [ "2:5 'a' is already defined. no-redeclare" ], "module" ); }); @@ -1437,10 +1437,10 @@ describe("verify", function () { it("allowImportExportEverywhere option (#327)", function () { verifyAndAssertMessages([ - "if (true) { import Foo from 'foo'; }", - "function foo() { import Bar from 'bar'; }", - "switch (a) { case 1: import FooBar from 'foobar'; }" - ].join("\n"), + "if (true) { import Foo from 'foo'; }", + "function foo() { import Bar from 'bar'; }", + "switch (a) { case 1: import FooBar from 'foobar'; }" + ].join("\n"), {}, [], "module", @@ -1478,11 +1478,11 @@ describe("verify", function () { it("decorator does not create TypeError #229", function () { verifyAndAssertMessages([ - "class A {", - " @test", - " f() {}", - "}" - ].join("\n"), + "class A {", + " @test", + " f() {}", + "}" + ].join("\n"), { "no-undef": 1 }, [ "2:4 'test' is not defined. no-undef" ] ); @@ -1490,9 +1490,9 @@ describe("verify", function () { it("Flow definition does not trigger warnings #223", function () { verifyAndAssertMessages([ - "import { Map as $Map } from 'immutable';", - "function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {}" - ].join("\n"), + "import { Map as $Map } from 'immutable';", + "function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {}" + ].join("\n"), { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 }, [] ); @@ -1500,16 +1500,16 @@ describe("verify", function () { it("newline-before-return with comments #289", function () { verifyAndAssertMessages([ - "function a() {", - "if (b) {", - "/* eslint-disable no-console */", - "console.log('test');", - "/* eslint-enable no-console */", - "}", - "", - "return hasGlobal;", - "}" - ].join("\n"), + "function a() {", + "if (b) {", + "/* eslint-disable no-console */", + "console.log('test');", + "/* eslint-enable no-console */", + "}", + "", + "return hasGlobal;", + "}" + ].join("\n"), { "newline-before-return": 1 }, [] ); From 313388b293ebf5db8d909b9113eedabc806f7d35 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 3 Aug 2016 09:36:15 -0400 Subject: [PATCH 530/965] typo --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 12f568b375ea..1eaf5440e96a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -22,7 +22,7 @@ "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "mocha", - "test-ci" "npm test && npm run lint", + "test-ci": "npm test && npm run lint", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", "preversion": "npm test", From 9c70c76cfdf7bde99500a9bd350ea0ba3cf0fb7c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 9 Sep 2016 11:26:47 -0400 Subject: [PATCH 531/965] add deps for npm 2 --- eslint/babel-eslint-parser/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1eaf5440e96a..ec432f4f72bc 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -40,6 +40,8 @@ "devDependencies": { "eslint": "^3.0.0", "eslint-config-babel": "^1.0.1", + "eslint-plugin-babel": "^3.3.0", + "eslint-plugin-flow-vars": "^0.5.0", "espree": "^3.0.0", "mocha": "^3.0.0" } From f97d83d8471ac46b94e92f66f577a72d44384aeb Mon Sep 17 00:00:00 2001 From: Dan Harper Date: Fri, 9 Sep 2016 16:28:19 +0100 Subject: [PATCH 532/965] eslint-plugin-flow-vars -> eslint-plugin-flowtype (babel/babel-eslint#374) [skip ci] --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 5eadb475df29..1f6e3e350ff3 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -17,7 +17,7 @@ For questions and support please visit the [`#linting`](https://babeljs.slack.co ## Known Issues Flow: -> Check out [eslint-plugin-flow-vars](https://github.com/zertosh/eslint-plugin-flow-vars): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. +> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. - `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` - `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) From 3d4e8cfea38116a3b26bfed5ad50d3ac65496a4b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 27 Sep 2016 08:42:41 -0400 Subject: [PATCH 533/965] update test line number [skip ci] --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index e75a75a6edaa..7067c4d87a1e 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -54,7 +54,7 @@ describe("verify", function () { verifyAndAssertMessages( "module.exports = \"something\";", { "eol-last": 1, "semi": 1 }, - [ "1:2 Newline required at end of file but not found. eol-last" ] + [ "1:30 Newline required at end of file but not found. eol-last" ] ); }); From 93a73cc4837e20c0163c33181bf38dc1fad8b4f3 Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Tue, 27 Sep 2016 14:43:03 +0200 Subject: [PATCH 534/965] chore(package): update eslint to version 3.6.0 (babel/babel-eslint#392) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ec432f4f72bc..18c974d3b31b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -38,7 +38,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "eslint": "^3.0.0", + "eslint": "^3.6.0", "eslint-config-babel": "^1.0.1", "eslint-plugin-babel": "^3.3.0", "eslint-plugin-flow-vars": "^0.5.0", From 2339c8af0f3583f48fa6f0bcd58940f6363ea494 Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Tue, 27 Sep 2016 14:43:14 +0200 Subject: [PATCH 535/965] chore(package): update espree to version 3.3.1 (babel/babel-eslint#394) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 18c974d3b31b..1e7629eb9840 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -42,7 +42,7 @@ "eslint-config-babel": "^1.0.1", "eslint-plugin-babel": "^3.3.0", "eslint-plugin-flow-vars": "^0.5.0", - "espree": "^3.0.0", + "espree": "^3.3.1", "mocha": "^3.0.0" } } From 33343e6688ffd5ba206795b1960b9d756e0952ea Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Tue, 27 Sep 2016 14:43:22 +0200 Subject: [PATCH 536/965] chore(package): update babylon to version 6.11.2 (babel/babel-eslint#391) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1e7629eb9840..083c056c1eba 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -14,7 +14,7 @@ "dependencies": { "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", - "babylon": "^6.0.18", + "babylon": "^6.11.2", "lodash.assign": "^4.0.0", "lodash.pickby": "^4.0.0" }, From ce6d9df1926e5086b4e4fd46b3ba7ec02e282e20 Mon Sep 17 00:00:00 2001 From: Ville Immonen Date: Tue, 27 Sep 2016 18:32:52 +0300 Subject: [PATCH 537/965] Remove the lodash.assign dependency (babel/babel-eslint#393) lodash.assign is deprecated: ``` npm WARN deprecated lodash.assign@4.2.0: This package is deprecated. Use Object.assign. ``` --- eslint/babel-eslint-parser/index.js | 7 +++---- eslint/babel-eslint-parser/package.json | 1 - eslint/babel-eslint-parser/test/integration.js | 7 +++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f41deb047605..643f82156ef5 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,5 +1,4 @@ var babylonToEspree = require("./babylon-to-espree"); -var assign = require("lodash.assign"); var pick = require("lodash.pickby"); var Module = require("module"); var path = require("path"); @@ -54,13 +53,13 @@ function monkeypatch() { // monkeypatch estraverse estraverse = estraverseRelative.require("estraverse"); estraverses.push(estraverse); - assign(estraverse.VisitorKeys, t.VISITOR_KEYS); + Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); // monkeypatch estraverse-fb (only for eslint < 2.3.0) try { var estraverseFb = eslintMod.require("estraverse-fb"); estraverses.push(estraverseFb); - assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); + Object.assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); } catch (err) { // Ignore: ESLint v2.3.0 does not have estraverse-fb } @@ -69,7 +68,7 @@ function monkeypatch() { var estraverseOfEslint = eslintMod.require("estraverse"); if (estraverseOfEslint !== estraverseFb) { estraverses.push(estraverseOfEslint); - assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); + Object.assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); } estraverses.forEach(function (estraverse) { diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 083c056c1eba..545de6ebe87b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,6 @@ "babel-traverse": "^6.0.20", "babel-types": "^6.0.19", "babylon": "^6.11.2", - "lodash.assign": "^4.0.0", "lodash.pickby": "^4.0.0" }, "scripts": { diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index f3f09522e47d..b7f735121a6e 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -1,5 +1,4 @@ var assert = require("assert"); -var assign = require("lodash.assign"); var eslint = require("eslint"); var fs = require("fs"); var path = require("path"); @@ -56,7 +55,7 @@ function strictSuite () { var ruleId = "strict"; describe("when set to 'never'", function () { - var eslintOpts = assign({}, baseEslintOpts, { + var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "never"]; @@ -81,7 +80,7 @@ function strictSuite () { // describe describe("when set to 'global'", function () { - var eslintOpts = assign({}, baseEslintOpts, { + var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {} }); eslintOpts.rules[ruleId] = [errorLevel, "global"]; @@ -145,7 +144,7 @@ function strictSuite () { // describe describe("when set to 'function'", function () { - var eslintOpts = assign({}, baseEslintOpts, { + var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {} }); eslintOpts.rules[ruleId] = [errorLevel, "function"]; From 3c414db3125335ef0486619c71beca07fa4b0582 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 27 Sep 2016 12:32:10 -0400 Subject: [PATCH 538/965] remove eslint 2 logic (babel/babel-eslint#361) * remove old code * remove async/await logic before eslint supported it * not needed --- .../babylon-to-espree/toAST.js | 12 ----- eslint/babel-eslint-parser/index.js | 50 +++++-------------- .../babel-eslint-parser/test/babel-eslint.js | 10 +++- .../test/non-regression.js | 2 +- 4 files changed, 22 insertions(+), 52 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 388253f1d06e..caa6a4e4cbac 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -202,11 +202,6 @@ var astTransformVisitor = { } } - // async function as generator - if (path.isFunction()) { - if (node.async) node.generator = true; - } - // TODO: remove (old esprima) if (path.isFunction()) { if (!node.defaults) { @@ -214,13 +209,6 @@ var astTransformVisitor = { } } - // await transform to yield - if (path.isAwaitExpression()) { - node.type = "YieldExpression"; - node.delegate = node.all; - delete node.all; - } - // template string range fixes if (path.isTemplateLiteral()) { node.quasis.forEach(function (q) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 643f82156ef5..048cdbaca37b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,13 +1,12 @@ var babylonToEspree = require("./babylon-to-espree"); -var pick = require("lodash.pickby"); -var Module = require("module"); -var path = require("path"); -var parse = require("babylon").parse; -var t = require("babel-types"); -var tt = require("babylon").tokTypes; -var traverse = require("babel-traverse").default; - -var estraverse; +var pick = require("lodash.pickby"); +var Module = require("module"); +var path = require("path"); +var parse = require("babylon").parse; +var t = require("babel-types"); +var tt = require("babylon").tokTypes; +var traverse = require("babel-traverse").default; + var hasPatched = false; var eslintOptions = {}; @@ -37,39 +36,12 @@ function monkeypatch() { // get modules relative to what eslint will load var eslintMod = createModule(eslintLoc); - var escopeLoc = Module._resolveFilename("escope", eslintMod); - var escopeMod = createModule(escopeLoc); - - // npm 3: monkeypatch estraverse if it's in escope - var estraverseRelative = escopeMod; - try { - var esrecurseLoc = Module._resolveFilename("esrecurse", eslintMod); - estraverseRelative = createModule(esrecurseLoc); - } catch (err) {} - // contains all the instances of estraverse so we can modify them if necessary var estraverses = []; - - // monkeypatch estraverse - estraverse = estraverseRelative.require("estraverse"); - estraverses.push(estraverse); - Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); - - // monkeypatch estraverse-fb (only for eslint < 2.3.0) - try { - var estraverseFb = eslintMod.require("estraverse-fb"); - estraverses.push(estraverseFb); - Object.assign(estraverseFb.VisitorKeys, t.VISITOR_KEYS); - } catch (err) { - // Ignore: ESLint v2.3.0 does not have estraverse-fb - } - // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 var estraverseOfEslint = eslintMod.require("estraverse"); - if (estraverseOfEslint !== estraverseFb) { - estraverses.push(estraverseOfEslint); - Object.assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); - } + estraverses.push(estraverseOfEslint); + Object.assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); estraverses.forEach(function (estraverse) { estraverse.VisitorKeys.MethodDefinition.push("decorators"); @@ -77,6 +49,8 @@ function monkeypatch() { }); // monkeypatch escope + var escopeLoc = Module._resolveFilename("escope", eslintMod); + var escopeMod = createModule(escopeLoc); var escope = require(escopeLoc); var analyze = escope.analyze; escope.analyze = function (ast, opts) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 956354803a09..1de61af7a056 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -56,7 +56,7 @@ function parseAndAssertSame(code) { range: true, comment: true, attachComment: true, - ecmaVersion: 6, + ecmaVersion: 8, sourceType: "module" }); var babylonAST = babelEslint.parse(code); @@ -455,5 +455,13 @@ describe("babylon-to-esprima", function () { parseAndAssertSame("var a = [ a, ...b ]"); parseAndAssertSame("var a = sum(...b)"); }); + + it("Async/Await", function() { + parseAndAssertSame( + `async function a() { + await 1; + }` + ); + }); }); }); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 7067c4d87a1e..996cc66b2cb6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -11,7 +11,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over es6: true }, parserOptions: { - ecmaVersion: 6, + ecmaVersion: 8, ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true, From aa6c5ccd459794f059cf44575d1dd1bbb209704c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 27 Sep 2016 12:34:26 -0400 Subject: [PATCH 539/965] updates --- eslint/babel-eslint-parser/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 545de6ebe87b..439f15efe615 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-traverse": "^6.0.20", - "babel-types": "^6.0.19", + "babel-traverse": "^6.15.0", + "babel-types": "^6.15.0", "babylon": "^6.11.2", - "lodash.pickby": "^4.0.0" + "lodash.pickby": "^4.6.0" }, "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", @@ -38,7 +38,7 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "eslint": "^3.6.0", - "eslint-config-babel": "^1.0.1", + "eslint-config-babel": "^1.0.2", "eslint-plugin-babel": "^3.3.0", "eslint-plugin-flow-vars": "^0.5.0", "espree": "^3.3.1", From 8d48eecc2f101108e5d2c4b6c34220491b3f2f6e Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 27 Sep 2016 12:35:24 -0400 Subject: [PATCH 540/965] 7.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 439f15efe615..ad1b396ae4ff 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "6.1.2", + "version": "7.0.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 994eea7a534bde77bc4a6449ce7de0d4c67e6920 Mon Sep 17 00:00:00 2001 From: Nick Date: Thu, 29 Sep 2016 21:25:35 +0100 Subject: [PATCH 541/965] docs: Update built-in support notes in README (babel/babel-eslint#398) [skip ci] * docs: Update built-in support notes in README eslint v3.6.0 supports ES2017 features * docs: Update built-in support notes in README eslint v3.6.0 supports ES2017 features --- eslint/babel-eslint-parser/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 1f6e3e350ff3..a26f0baf163a 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -4,15 +4,15 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -#### Note: You don't need to use babel-eslint if you are only using ES6/ES2015. ESLint actually supports ES6/ES7, JSX, and object rest/spread by default now. +#### Note: You don't need to use babel-eslint if you are using ES2015 (ES6), ES2016 (ES7) or ES2017 (ES8). ESLint actually supports ES2015/ES2016/ES2017, JSX, and object rest/spread by default now. -##### At the moment, you'll need it if you use stuff like class properties, decorators, async/await, types. +##### At the moment, you'll need it if you use stuff like class properties, decorators, types. > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! For questions and support please visit the [`#linting`](https://babeljs.slack.com/messages/linting/) babel slack channel (sign up [here](https://babel-slack.herokuapp.com))! -> Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`) +> Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`). ## Known Issues From 610cf28dab873bf65cab70498aec168279b69bdb Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Mon, 10 Oct 2016 14:36:10 +0200 Subject: [PATCH 542/965] =?UTF-8?q?Update=20eslint-config-babel=20to=20ver?= =?UTF-8?q?sion=202.0.1=20=F0=9F=9A=80=20(babel/babel-eslint#408)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update eslint-config-babel to version 2.0.1 https://greenkeeper.io/ * Fix plugin --- eslint/babel-eslint-parser/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ad1b396ae4ff..67d0dc49f2c7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -37,10 +37,11 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { + "babel-eslint": "^7.0.0", "eslint": "^3.6.0", - "eslint-config-babel": "^1.0.2", + "eslint-config-babel": "^2.0.1", "eslint-plugin-babel": "^3.3.0", - "eslint-plugin-flow-vars": "^0.5.0", + "eslint-plugin-flowtype": "^2.4.0", "espree": "^3.3.1", "mocha": "^3.0.0" } From 31f48f0651a8ab3ca2124ace770ef03bd706a5e4 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Sat, 15 Oct 2016 11:04:55 +0200 Subject: [PATCH 543/965] Update test for eslint 3.8 (babel/babel-eslint#412) * Update test for eslint 3.8 also ignore yarn lock * Run lint only on latest version --- eslint/babel-eslint-parser/.gitignore | 1 + eslint/babel-eslint-parser/.travis.yml | 17 +++++++++++------ eslint/babel-eslint-parser/package.json | 4 ++-- .../babel-eslint-parser/test/non-regression.js | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/.gitignore b/eslint/babel-eslint-parser/.gitignore index 93f136199161..2d6ddb5d003c 100644 --- a/eslint/babel-eslint-parser/.gitignore +++ b/eslint/babel-eslint-parser/.gitignore @@ -1,2 +1,3 @@ node_modules npm-debug.log +yarn.lock diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 9f2b522cd50e..7f84d147a4d2 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,11 +1,16 @@ -git: - depth: 1 sudo: false language: node_js +node_js: + - "4" + - "5" + - "6" + matrix: + fast_finish: true include: - - node_js: "4" - - node_js: "5" - - node_js: "6" + - node_js: "node" + env: LINT=true -script: npm run test-ci +script: + - 'if [ -n "${LINT-}" ]; then npm run lint ; fi' + - 'if [ -z "${LINT-}" ]; then npm test ; fi' diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 67d0dc49f2c7..b3fd1282edd9 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -20,8 +20,8 @@ "scripts": { "bootstrap": "git submodule update --init && cd eslint && npm install", "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", - "test": "mocha", - "test-ci": "npm test && npm run lint", + "test": "npm run lint && npm run test-only", + "test-only": "mocha", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", "preversion": "npm test", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 996cc66b2cb6..4ddead6e2083 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1196,7 +1196,7 @@ describe("verify", function () { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:8 'Bacona' is defined but never used. no-unused-vars" ] + [ "1:8 'Bacona' is assigned a value but never used. no-unused-vars" ] ); }); From 1f04cab99fce5777b746b501f796a82955dc2e1c Mon Sep 17 00:00:00 2001 From: Steven Job Date: Mon, 17 Oct 2016 19:27:20 +0100 Subject: [PATCH 544/965] Now using template strings (babel/babel-eslint#410) * Use template strings in non-regression tests * Refactor non-regression tests to fix test failures Moved backtick to fix test 'getter/setter babel/babel-eslint#218' as indent matters Fixed line numbers for some tests * Use template strings in babel-eslint tests * Fix tests for babel-eslint Avoids error that shows when using template strings for tests: line 253 line comments line 260 block comments line 306 jsdoc Error: At loc.start.column: are different (6 !== 0) * Other small template literal changes * Add unpad to correctly indent template literals --- .../babylon-to-espree/toAST.js | 2 +- .../babylon-to-espree/toToken.js | 2 +- eslint/babel-eslint-parser/index.js | 2 +- .../babel-eslint-parser/test/babel-eslint.js | 299 +++-- .../babel-eslint-parser/test/integration.js | 3 +- .../test/non-regression.js | 1156 +++++++++-------- eslint/babel-eslint-parser/utils/unpad.js | 14 + 7 files changed, 776 insertions(+), 702 deletions(-) create mode 100644 eslint/babel-eslint-parser/utils/unpad.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index caa6a4e4cbac..77190f369589 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -160,7 +160,7 @@ var astTransformVisitor = { } if (path.isRestProperty() || path.isSpreadProperty()) { - node.type = "Experimental" + node.type; + node.type = `Experimental${node.type}`; } if (path.isTypeParameter && path.isTypeParameter()) { diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js index 7e13f28e0c8a..dcfd48f87cc1 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js @@ -53,7 +53,7 @@ module.exports = function (token, tt, source) { pattern: value.pattern, flags: value.flags }; - token.value = "/" + value.pattern + "/" + value.flags; + token.value = `/${value.pattern}/${value.flags}`; } return token; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 048cdbaca37b..ab2c3e7a0900 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -396,7 +396,7 @@ exports.parseNoPatch = function (code, options) { err.column = err.loc.column + 1; // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, ""); + err.message = `Line ${err.lineNumber}: ${err.message.replace(/ \((\d+):(\d+)\)$/, "")}`; } throw err; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 1de61af7a056..65e70b10aec6 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -2,6 +2,7 @@ var assert = require("assert"); var babelEslint = require(".."); var espree = require("espree"); var util = require("util"); +var unpad = require("../utils/unpad"); // Checks if the source ast implements the target ast. Ignores extra keys on source ast function assertImplementsAST(target, source, path) { @@ -10,7 +11,7 @@ function assertImplementsAST(target, source, path) { } function error(text) { - var err = new Error("At " + path.join(".") + ": " + text + ":"); + var err = new Error(`At ${path.join(".")}: ${text}:`); err.depth = path.length + 1; throw err; } @@ -18,7 +19,7 @@ function assertImplementsAST(target, source, path) { var typeA = target === null ? "null" : typeof target; var typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { - error("have different types (" + typeA + " !== " + typeB + ") " + "(" + target + " !== " + source + ")"); + error(`have different types (${typeA} !== ${typeB}) (${target} !== ${source})`); } else if (typeA === "object") { var keysTarget = Object.keys(target); for (var i in keysTarget) { @@ -28,7 +29,7 @@ function assertImplementsAST(target, source, path) { path.pop(); } } else if (target !== source) { - error("are different (" + JSON.stringify(target) + " !== " + JSON.stringify(source) + ")"); + error(`are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})`); } } @@ -70,11 +71,12 @@ function parseAndAssertSame(code) { if (babylonAST.tokens) { delete babylonAST.tokens; } - err.message += - "\nespree:\n" + - util.inspect(lookup(esAST, traversal, 2), {depth: err.depth, colors: true}) + - "\nbabel-eslint:\n" + - util.inspect(lookup(babylonAST, traversal, 2), {depth: err.depth, colors: true}); + err.message += unpad(` + espree: + ${util.inspect(lookup(esAST, traversal, 2), {depth: err.depth, colors: true})} + babel-eslint: + ${util.inspect(lookup(babylonAST, traversal, 2), {depth: err.depth, colors: true})} + `); throw err; } // assert.equal(esAST, babylonAST); @@ -132,25 +134,29 @@ describe("babylon-to-esprima", function () { it("template also with braces #96", function () { parseAndAssertSame( - "export default function f1() {" + - "function f2(foo) {" + - "const bar = 3;" + - "return `${foo} ${bar}`;" + - "}" + - "return f2;" + - "}" + unpad(` + export default function f1() { + function f2(foo) { + const bar = 3; + return \`\${foo} \${bar}\`; + } + return f2; + } + `) ); }); it("template with destructuring #31", function () { - parseAndAssertSame([ - "module.exports = {", - "render() {", - "var {name} = this.props;", - "return Math.max(null, `Name: ${name}, Name: ${name}`);", - "}", - "};" - ].join("\n")); + parseAndAssertSame( + unpad(` + module.exports = { + render() { + var {name} = this.props; + return Math.max(null, \`Name: \${name}, Name: \${name}\`); + } + }; + `) + ); }); }); @@ -251,34 +257,40 @@ describe("babylon-to-esprima", function () { }); it("line comments", function () { - parseAndAssertSame([ - " // single comment", - "var foo = 15; // comment next to statement", - "// second comment after statement" - ].join("\n")); + parseAndAssertSame( + unpad(` + // single comment + var foo = 15; // comment next to statement + // second comment after statement + `) + ); }); it("block comments", function () { - parseAndAssertSame([ - " /* single comment */ ", - "var foo = 15; /* comment next to statement */", - "/*", - " * multiline", - " * comment", - " */" - ].join("\n")); + parseAndAssertSame( + unpad(` + /* single comment */ + var foo = 15; /* comment next to statement */ + /* + * multiline + * comment + */ + `) + ); }); it("block comments #124", function () { - parseAndAssertSame([ - "React.createClass({", - "render() {", - "// return (", - "//
", - "// ); // <-- this is the line that is reported", - "}", - "});" - ].join("\n")); + parseAndAssertSame( + unpad(` + React.createClass({ + render() { + // return ( + //
+ // ); // <-- this is the line that is reported + } + }); + `) + ); }); it("null", function () { @@ -306,76 +318,87 @@ describe("babylon-to-esprima", function () { }); it("jsdoc", function () { - parseAndAssertSame([ - "/**", - "* @param {object} options", - "* @return {number}", - "*/", - "const test = function({ a, b, c }) {", - "return a + b + c;", - "};", - "module.exports = test;" - ].join("\n")); + parseAndAssertSame( + unpad(` + /** + * @param {object} options + * @return {number} + */ + const test = function({ a, b, c }) { + return a + b + c; + }; + module.exports = test; + `) + ); }); it("empty block with comment", function () { - parseAndAssertSame([ - "function a () {", - "try {", - "b();", - "} catch (e) {", - "// asdf", - "}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + function a () { + try { + b(); + } catch (e) { + // asdf + } + } + `) + ); }); describe("babel 6 tests", function () { it("MethodDefinition", function () { - parseAndAssertSame([ - "export default class A {", - "a() {}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + export default class A { + a() {} + } + `) + ); }); it("MethodDefinition 2", function () { - parseAndAssertSame([ - "export default class Bar { get bar() { return 42; }}" - ].join("\n")); + parseAndAssertSame("export default class Bar { get bar() { return 42; }}"); }); it("ClassMethod", function () { - parseAndAssertSame([ - "class A {", - "constructor() {", - "}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + class A { + constructor() { + } + } + `) + ); }); it("ClassMethod multiple params", function () { - parseAndAssertSame([ - "class A {", - "constructor(a, b, c) {", - "}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + class A { + constructor(a, b, c) { + } + } + `) + ); }); it("ClassMethod multiline", function () { - parseAndAssertSame([ - "class A {", - " constructor (", - " a,", - " b,", - " c", - " )", - "{", - "", - " }", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + class A { + constructor ( + a, + b, + c + ) + + { + + } + } + `) + ); }); it("ClassMethod oneline", function () { @@ -383,12 +406,14 @@ describe("babylon-to-esprima", function () { }); it("ObjectMethod", function () { - parseAndAssertSame([ - "var a = {", - "b(c) {", - "}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + var a = { + b(c) { + } + } + `) + ); }); it("do not allow import export everywhere", function() { @@ -413,35 +438,41 @@ describe("babylon-to-esprima", function () { it("getters and setters", function () { parseAndAssertSame("class A { get x ( ) { ; } }"); - parseAndAssertSame([ - "class A {", - "get x(", - ")", - "{", - ";", - "}", - "}" - ].join("\n")); + parseAndAssertSame( + unpad(` + class A { + get x( + ) + { + ; + } + } + `) + ); parseAndAssertSame("class A { set x (a) { ; } }"); - parseAndAssertSame([ - "class A {", - "set x(a", - ")", - "{", - ";", - "}", - "}" - ].join("\n")); - parseAndAssertSame([ - "var B = {", - "get x () {", - "return this.ecks;", - "},", - "set x (ecks) {", - "this.ecks = ecks;", - "}", - "};" - ].join("\n")); + parseAndAssertSame( + unpad(` + class A { + set x(a + ) + { + ; + } + } + `) + ); + parseAndAssertSame( + unpad(` + var B = { + get x () { + return this.ecks; + }, + set x (ecks) { + this.ecks = ecks; + } + }; + `) + ); }); it("RestOperator", function () { @@ -458,9 +489,11 @@ describe("babylon-to-esprima", function () { it("Async/Await", function() { parseAndAssertSame( - `async function a() { - await 1; - }` + unpad(` + async function a() { + await 1; + } + `) ); }); }); diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index b7f735121a6e..2e62188e906f 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -61,8 +61,7 @@ function strictSuite () { eslintOpts.rules[ruleId] = [errorLevel, "never"]; ["global-with", "function-with"].forEach(function (fixture) { - it( - "should error on " + fixture.match(/^[^-]+/)[0] + " directive", + it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, function (done) { lint({ fixture: ["strict", fixture], diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4ddead6e2083..2d563782d176 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1,6 +1,7 @@ /*eslint-env mocha*/ "use strict"; var eslint = require("eslint"); +var unpad = require("../utils/unpad"); function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { var config = { @@ -30,13 +31,19 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over var messages = eslint.linter.verify(code, config); if (messages.length !== expectedMessages.length) { - throw new Error("Expected " + expectedMessages.length + " message(s), got " + messages.length + " " + JSON.stringify(messages)); + throw new Error(`Expected ${expectedMessages.length} message(s), got ${messages.length} ${JSON.stringify(messages)}`); } messages.forEach(function (message, i) { - var formatedMessage = message.line + ":" + message.column + " " + message.message + (message.ruleId ? " " + message.ruleId : ""); + var formatedMessage = `${message.line}:${message.column} ${message.message}${(message.ruleId ? ` ${message.ruleId}` : "")}`; if (formatedMessage !== expectedMessages[i]) { - throw new Error("Message " + i + " does not match:\nExpected: " + expectedMessages[i] + "\nActual: " + formatedMessage); + throw new Error( + unpad(` + Message ${i} does not match: + Expected: ${expectedMessages[i]} + Actual: ${formatedMessage} + `) + ); } }); } @@ -68,10 +75,12 @@ describe("verify", function () { it("Modules support (issue #5)", function () { verifyAndAssertMessages( - "import Foo from 'foo';\n" + - "export default Foo;\n" + - "export const c = 'c';\n" + - "export class Store {}", + unpad(` + import Foo from 'foo'; + export default Foo; + export const c = 'c'; + export class Store {} + `), {}, [] ); @@ -160,12 +169,13 @@ describe("verify", function () { }); it("comment with padded-blocks (issue #33)", function () { - verifyAndAssertMessages([ - "if (a){", - "// i'm a comment!", - "let b = c", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + if (a) { + // i'm a comment! + let b = c + } + `), { "padded-blocks": [1, "never"] }, [] ); @@ -173,9 +183,8 @@ describe("verify", function () { describe("flow", function () { it("check regular function", function () { - verifyAndAssertMessages([ + verifyAndAssertMessages( "function a(b, c) { b += 1; c += 1; return b + c; } a;", - ].join("\n"), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -198,209 +207,225 @@ describe("verify", function () { }); it("multiple nullable type annotations and return #108", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "function log(foo: ?Foo, foo2: ?Foo2): ?Foo3 {", - "console.log(foo, foo2);", - "}", - "log(1, 2);" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + function log(foo: ?Foo, foo2: ?Foo2): ?Foo3 { + console.log(foo, foo2); + } + log(1, 2); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("type parameters", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "function log(a: T1, b: T2) { return a + b; }", - "log(1, 2);" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + function log(a: T1, b: T2) { return a + b; } + log(1, 2); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("nested type annotations", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "function foo(callback: () => Foo) {", - "return callback();", - "}", - "foo();" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + function foo(callback: () => Foo) { + return callback(); + } + foo(); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("type in var declaration", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var x: Foo = 1;", - "x;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + var x: Foo = 1; + x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("object type annotation", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var a: {numVal: Foo};", - "a;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + var a: {numVal: Foo}; + a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("object property types", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a = {", - "circle: (null : ?{ setNativeProps(props: Foo): Foo2 })", - "};", - "a;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var a = { + circle: (null : ?{ setNativeProps(props: Foo): Foo2 }) + }; + a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("namespaced types", function () { - verifyAndAssertMessages([ - "var React = require('react-native');", - "var b = {", - "openExternalExample: (null: ?React.Component)", - "};", - "var c = {", - "render(): React.Component {}", - "};", - "b;", - "c;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + var React = require('react-native'); + var b = { + openExternalExample: (null: ?React.Component) + }; + var c = { + render(): React.Component {} + }; + b; + c; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("ArrayTypeAnnotation", function () { - verifyAndAssertMessages([ - "import type Foo from 'foo';", - "var x: Foo[]; x;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'foo'; + var x: Foo[]; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("ClassImplements", function () { - verifyAndAssertMessages([ - "import type Bar from 'foo';", - "export default class Foo implements Bar {}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Bar from 'foo'; + export default class Foo implements Bar {} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("type alias creates declaration + usage", function () { - verifyAndAssertMessages([ - "type Foo = any;", - "var x : Foo = 1; x;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + type Foo = any; + var x : Foo = 1; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("type alias with type parameters", function () { - verifyAndAssertMessages([ - "import type Bar from 'foo';", - "import type Foo3 from 'foo';", - "type Foo = Bar", - "var x : Foo = 1; x;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Bar from 'foo'; + import type Foo3 from 'foo'; + type Foo = Bar + var x : Foo = 1; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("export type alias", function () { - verifyAndAssertMessages([ - "import type Foo2 from 'foo';", - "export type Foo = Foo2;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo2 from 'foo'; + export type Foo = Foo2; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("polymorphpic types #109", function () { - verifyAndAssertMessages([ - "export default function groupByEveryN(array: Array, n: number): Array> { n; }" - ].join("\n"), + verifyAndAssertMessages( + "export default function groupByEveryN(array: Array, n: number): Array> { n; }", { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("types definition from import", function () { - verifyAndAssertMessages([ - "import type Promise from 'bluebird';", - "type Operation = () => Promise;", - "x: Operation;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Promise from 'bluebird'; + type Operation = () => Promise; + x: Operation; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("polymorphpic/generic types for class #123", function () { - verifyAndAssertMessages([ - "class Box {", - "value: T;", - "}", - "var box = new Box();", - "console.log(box.value);" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + class Box { + value: T; + } + var box = new Box(); + console.log(box.value); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("polymorphpic/generic types for function #123", function () { - verifyAndAssertMessages([ - "export function identity(value) {", - "var a: T = value; a;", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + export function identity(value) { + var a: T = value; a; + } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("polymorphpic/generic types for type alias #123", function () { - verifyAndAssertMessages([ - "import Bar from './Bar';", - "type Foo = Bar; var x: Foo = 1; console.log(x);" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import Bar from './Bar'; + type Foo = Bar; var x: Foo = 1; console.log(x); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); }); it("polymorphpic/generic types - outside of fn scope #123", function () { - verifyAndAssertMessages([ - "export function foo(value) { value; };", - "var b: T = 1; b;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + export function foo(value) { value; }; + var b: T = 1; b; + `), { "no-unused-vars": 1, "no-undef": 1 }, [ "1:21 'T' is defined but never used. no-unused-vars", "2:8 'T' is not defined. no-undef" ] @@ -408,23 +433,25 @@ describe("verify", function () { }); it("polymorphpic/generic types - extending unknown #123", function () { - verifyAndAssertMessages([ - "import Bar from 'bar';", - "export class Foo extends Bar {}", - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import Bar from 'bar'; + export class Foo extends Bar {} + `), { "no-unused-vars": 1, "no-undef": 1 }, [ "2:30 'T' is not defined. no-undef" ] ); }); it("support declarations #132", function () { - verifyAndAssertMessages([ - "declare class A { static () : number }", - "declare module B { declare var x: number; }", - "declare function foo(): void;", - "declare var bar", - "A; B; foo(); bar;" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + declare class A { static () : number } + declare module B { declare var x: number; } + declare function foo(): void; + declare var bar + A; B; foo(); bar; + `), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -432,11 +459,11 @@ describe("verify", function () { it("1", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default function(a: Foo, b: ?Foo2, c){ a; b; c; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default function(a: Foo, b: ?Foo2, c){ a; b; c; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -444,10 +471,10 @@ describe("verify", function () { it("2", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "export default function(a: () => Foo){ a; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + export default function(a: () => Foo){ a; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -455,11 +482,11 @@ describe("verify", function () { it("3", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default function(a: (_:Foo) => Foo2){ a; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default function(a: (_:Foo) => Foo2){ a; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -467,12 +494,12 @@ describe("verify", function () { it("4", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "export default function(a: (_1:Foo, _2:Foo2) => Foo3){ a; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + export default function(a: (_1:Foo, _2:Foo2) => Foo3){ a; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -480,11 +507,11 @@ describe("verify", function () { it("5", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default function(a: (_1:Foo, ...foo:Array) => number){ a; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default function(a: (_1:Foo, ...foo:Array) => number){ a; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -492,10 +519,10 @@ describe("verify", function () { it("6", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "export default function(): Foo {}" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + export default function(): Foo {} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -503,10 +530,10 @@ describe("verify", function () { it("7", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "export default function():() => Foo {}" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + export default function():() => Foo {} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -514,11 +541,11 @@ describe("verify", function () { it("8", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default function():(_?:Foo) => Foo2{}" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default function():(_?:Foo) => Foo2{} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -526,9 +553,7 @@ describe("verify", function () { it("9", function () { verifyAndAssertMessages( - [ - "export default function (a: T1, b: T2) { b; }" - ].join("\n"), + "export default function (a: T1, b: T2) { b; }", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -536,9 +561,7 @@ describe("verify", function () { it("10", function () { verifyAndAssertMessages( - [ - "var a=function(a: T1, b: T2) {return a + b;}; a;" - ].join("\n"), + "var a=function(a: T1, b: T2) {return a + b;}; a;", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -546,9 +569,7 @@ describe("verify", function () { it("11", function () { verifyAndAssertMessages( - [ - "var a={*id(x: T): T { x; }}; a;" - ].join("\n"), + "var a={*id(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -556,9 +577,7 @@ describe("verify", function () { it("12", function () { verifyAndAssertMessages( - [ - "var a={async id(x: T): T { x; }}; a;" - ].join("\n"), + "var a={async id(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -566,9 +585,7 @@ describe("verify", function () { it("13", function () { verifyAndAssertMessages( - [ - "var a={123(x: T): T { x; }}; a;" - ].join("\n"), + "var a={123(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -576,11 +593,11 @@ describe("verify", function () { it("14", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default class Bar {set fooProp(value:Foo):Foo2{ value; }}" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default class Bar {set fooProp(value:Foo):Foo2{ value; }} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -588,10 +605,10 @@ describe("verify", function () { it("15", function () { verifyAndAssertMessages( - [ - "import type Foo2 from 'foo';", - "export default class Foo {get fooProp(): Foo2{}}" - ].join("\n"), + unpad(` + import type Foo2 from 'foo'; + export default class Foo {get fooProp(): Foo2{}} + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -599,10 +616,10 @@ describe("verify", function () { it("16", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var numVal:Foo; numVal;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var numVal:Foo; numVal; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -610,10 +627,10 @@ describe("verify", function () { it("17", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: {numVal: Foo;}; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: {numVal: Foo;}; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -621,12 +638,12 @@ describe("verify", function () { it("18", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a: ?{numVal: Foo; [indexer: Foo2]: Foo3}; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + var a: ?{numVal: Foo; [indexer: Foo2]: Foo3}; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -634,11 +651,11 @@ describe("verify", function () { it("19", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a: {numVal: Foo; subObj?: ?{strVal: Foo2}}; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var a: {numVal: Foo; subObj?: ?{strVal: Foo2}}; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -646,13 +663,13 @@ describe("verify", function () { it("20", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "import type Foo4 from 'foo';", - "var a: { [a: Foo]: Foo2; [b: Foo3]: Foo4; }; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + import type Foo4 from 'foo'; + var a: { [a: Foo]: Foo2; [b: Foo3]: Foo4; }; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -660,12 +677,12 @@ describe("verify", function () { it("21", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a: {add(x:Foo, ...y:Array): Foo3}; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + var a: {add(x:Foo, ...y:Array): Foo3}; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -673,12 +690,12 @@ describe("verify", function () { it("22", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a: { id(x: Foo2): Foo3; }; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + var a: { id(x: Foo2): Foo3; }; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -686,10 +703,10 @@ describe("verify", function () { it("23", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a:Array = [1, 2, 3]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a:Array = [1, 2, 3]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -697,10 +714,10 @@ describe("verify", function () { it("24", function () { verifyAndAssertMessages( - [ - "import type Baz from 'baz';", - "export default class Bar extends Baz { };" - ].join("\n"), + unpad(` + import type Baz from 'baz'; + export default class Bar extends Baz { }; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -708,9 +725,7 @@ describe("verify", function () { it("25", function () { verifyAndAssertMessages( - [ - "export default class Bar { bar(): T { return 42; }}" - ].join("\n"), + "export default class Bar { bar(): T { return 42; }}", { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -718,11 +733,11 @@ describe("verify", function () { it("26", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "export default class Bar { static prop1:Foo; prop2:Foo2; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + export default class Bar { static prop1:Foo; prop2:Foo2; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -730,11 +745,11 @@ describe("verify", function () { it("27", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var x : Foo | Foo2 = 4; x;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var x : Foo | Foo2 = 4; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -742,11 +757,11 @@ describe("verify", function () { it("28", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var x : () => Foo | () => Foo2; x;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var x : () => Foo | () => Foo2; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -754,11 +769,11 @@ describe("verify", function () { it("29", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var x: typeof Foo | number = Foo2; x;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var x: typeof Foo | number = Foo2; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -766,10 +781,10 @@ describe("verify", function () { it("30", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var {x}: {x: Foo; } = { x: 'hello' }; x;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var {x}: {x: Foo; } = { x: 'hello' }; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -777,10 +792,10 @@ describe("verify", function () { it("31", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var [x]: Array = [ 'hello' ]; x;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var [x]: Array = [ 'hello' ]; x; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -788,10 +803,10 @@ describe("verify", function () { it("32", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "export default function({x}: { x: Foo; }) { x; }" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + export default function({x}: { x: Foo; }) { x; } + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -799,10 +814,10 @@ describe("verify", function () { it("33", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "function foo([x]: Array) { x; } foo();" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + function foo([x]: Array) { x; } foo(); + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -810,11 +825,11 @@ describe("verify", function () { it("34", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a: Map >; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var a: Map >; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -822,10 +837,10 @@ describe("verify", function () { it("35", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: ?Promise[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: ?Promise[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -833,11 +848,11 @@ describe("verify", function () { it("36", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "var a:(...rest:Array) => Foo2; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + var a:(...rest:Array) => Foo2; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -845,13 +860,13 @@ describe("verify", function () { it("37", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "import type Foo4 from 'foo';", - "var a: (x: Foo2, ...y:Foo3[]) => Foo4; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + import type Foo4 from 'foo'; + var a: (x: Foo2, ...y:Foo3[]) => Foo4; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -859,10 +874,10 @@ describe("verify", function () { it("38", function () { verifyAndAssertMessages( - [ - "import type {foo, bar} from 'baz';", - "foo; bar;" - ].join("\n"), + unpad(` + import type {foo, bar} from 'baz'; + foo; bar; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -870,10 +885,10 @@ describe("verify", function () { it("39", function () { verifyAndAssertMessages( - [ - "import type {foo as bar} from 'baz';", - "bar;" - ].join("\n"), + unpad(` + import type {foo as bar} from 'baz'; + bar; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -881,10 +896,10 @@ describe("verify", function () { it("40", function () { verifyAndAssertMessages( - [ - "import type from 'foo';", - "type;" - ].join("\n"), + unpad(` + import type from 'foo'; + type; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -892,10 +907,10 @@ describe("verify", function () { it("41", function () { verifyAndAssertMessages( - [ - "import type, {foo} from 'bar';", - "type; foo;" - ].join("\n"), + unpad(` + import type, {foo} from 'bar'; + type; foo; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -903,10 +918,10 @@ describe("verify", function () { it("42", function () { verifyAndAssertMessages( - [ - "import type * as namespace from 'bar';", - "namespace;" - ].join("\n"), + unpad(` + import type * as namespace from 'bar'; + namespace; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -914,10 +929,10 @@ describe("verify", function () { it("43", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: Foo[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: Foo[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -925,10 +940,10 @@ describe("verify", function () { it("44", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: ?Foo[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: ?Foo[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -936,10 +951,10 @@ describe("verify", function () { it("45", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: (?Foo)[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: (?Foo)[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -947,10 +962,10 @@ describe("verify", function () { it("46", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: () => Foo[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: () => Foo[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -958,10 +973,10 @@ describe("verify", function () { it("47", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: (() => Foo)[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: (() => Foo)[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -969,10 +984,10 @@ describe("verify", function () { it("48", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "var a: typeof Foo[]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + var a: typeof Foo[]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -980,12 +995,12 @@ describe("verify", function () { it("49", function () { verifyAndAssertMessages( - [ - "import type Foo from 'foo';", - "import type Foo2 from 'foo';", - "import type Foo3 from 'foo';", - "var a : [Foo, Foo2,] = [123, 'duck',]; a;" - ].join("\n"), + unpad(` + import type Foo from 'foo'; + import type Foo2 from 'foo'; + import type Foo3 from 'foo'; + var a : [Foo, Foo2,] = [123, 'duck',]; a; + `), { "no-unused-vars": 1, "no-undef": 1 }, [] ); @@ -1001,13 +1016,14 @@ describe("verify", function () { }); it("class definition: gaearon/redux#24", function () { - verifyAndAssertMessages([ - "export default function root(stores) {", - "return DecoratedComponent => class ReduxRootDecorator {", - "a() { DecoratedComponent; stores; }", - "};", - "}", - ].join("\n"), + verifyAndAssertMessages( + unpad(` + export default function root(stores) { + return DecoratedComponent => class ReduxRootDecorator { + a() { DecoratedComponent; stores; } + }; + } + `), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -1030,13 +1046,15 @@ describe("verify", function () { }); it("template with destructuring #31", function () { - verifyAndAssertMessages([ - "module.exports = {", - "render() {", - "var {name} = this.props;", - "return Math.max(null, `Name: ${name}, Name: ${name}`);", - "}", - "};"].join("\n"), + verifyAndAssertMessages( + unpad(` + module.exports = { + render() { + var {name} = this.props; + return Math.max(null, \`Name: \${name}, Name: \${name}\`); + } + }; + `), { "comma-spacing": 1 }, [] ); @@ -1045,14 +1063,14 @@ describe("verify", function () { describe("decorators #72", function () { it("class declaration", function () { verifyAndAssertMessages( - [ - "import classDeclaration from 'decorator';", - "import decoratorParameter from 'decorator';", - "@classDeclaration((parameter) => parameter)", - "@classDeclaration(decoratorParameter)", - "@classDeclaration", - "export class TextareaAutosize {}" - ].join("\n"), + unpad(` + import classDeclaration from 'decorator'; + import decoratorParameter from 'decorator'; + @classDeclaration((parameter) => parameter) + @classDeclaration(decoratorParameter) + @classDeclaration + export class TextareaAutosize {} + `), { "no-unused-vars": 1 }, [] ); @@ -1060,18 +1078,18 @@ describe("verify", function () { it("method definition", function () { verifyAndAssertMessages( - [ - "import classMethodDeclarationA from 'decorator';", - "import decoratorParameter from 'decorator';", - "export class TextareaAutosize {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "methodDeclaration(e) {", - "e();", - "}", - "}" - ].join("\n"), + unpad(` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + export class TextareaAutosize { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + methodDeclaration(e) { + e(); + } + } + `), { "no-unused-vars": 1 }, [] ); @@ -1079,20 +1097,20 @@ describe("verify", function () { it("method definition get/set", function () { verifyAndAssertMessages( - [ - "import classMethodDeclarationA from 'decorator';", - "import decoratorParameter from 'decorator';", - "export class TextareaAutosize {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "get bar() { }", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "set bar(val) { val; }", - "}" - ].join("\n"), + unpad(` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + export class TextareaAutosize { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + get bar() { } + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + set bar(val) { val; } + } + `), { "no-unused-vars": 1 }, [] ); @@ -1100,19 +1118,19 @@ describe("verify", function () { it("object property", function () { verifyAndAssertMessages( - [ - "import classMethodDeclarationA from 'decorator';", - "import decoratorParameter from 'decorator';", - "var obj = {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "methodDeclaration(e) {", - "e();", - "}", - "};", - "obj;" - ].join("\n"), + unpad(` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + var obj = { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + methodDeclaration(e) { + e(); + } + }; + obj; + `), { "no-unused-vars": 1 }, [] ); @@ -1120,21 +1138,21 @@ describe("verify", function () { it("object property get/set", function () { verifyAndAssertMessages( - [ - "import classMethodDeclarationA from 'decorator';", - "import decoratorParameter from 'decorator';", - "var obj = {", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "get bar() { },", - "@classMethodDeclarationA((parameter) => parameter)", - "@classMethodDeclarationA(decoratorParameter)", - "@classMethodDeclarationA", - "set bar(val) { val; }", - "};", - "obj;" - ].join("\n"), + unpad(` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + var obj = { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + get bar() { }, + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + set bar(val) { val; } + }; + obj; + `), { "no-unused-vars": 1 }, [] ); @@ -1201,14 +1219,15 @@ describe("verify", function () { }); it("don't warn no-unused-vars with spread #142", function () { - verifyAndAssertMessages([ - "export default function test(data) {", - "return {", - "foo: 'bar',", - "...data", - "};", - "}", - ].join("\n"), + verifyAndAssertMessages( + unpad(` + export default function test(data) { + return { + foo: 'bar', + ...data + }; + } + `), { "no-undef": 1, "no-unused-vars": 1 }, [] ); @@ -1216,33 +1235,32 @@ describe("verify", function () { it("excludes comment tokens #153", function () { verifyAndAssertMessages( - [ - "var a = [", - "1,", - "2, // a trailing comment makes this line fail comma-dangle (always-multiline)", - "];", - ].join("\n"), + unpad(` + var a = [ + 1, + 2, // a trailing comment makes this line fail comma-dangle (always-multiline) + ]; + `), { "comma-dangle": [2, "always-multiline"] }, [] ); verifyAndAssertMessages( - [ - "switch (a) {", - "// A comment here makes the above line fail brace-style", - "case 1:", - "console.log(a);", - "}" - ].join("\n"), + unpad(` + switch (a) { + // A comment here makes the above line fail brace-style + case 1: + console.log(a); + } + `), { "brace-style": 2 }, [] ); }); it("ternary and parens #149", function () { - verifyAndAssertMessages([ - "true ? (true) : false;" - ].join("\n"), + verifyAndAssertMessages( + "true ? (true) : false;", { "space-infix-ops": 1 }, [] ); @@ -1250,15 +1268,15 @@ describe("verify", function () { it("line comment space-in-parens #124", function () { verifyAndAssertMessages( - [ - "React.createClass({", - "render() {", - "// return (", - "//
", - "// ); // <-- this is the line that is reported", - "}", - "});" - ].join("\n"), + unpad(` + React.createClass({ + render() { + // return ( + //
+ // ); // <-- this is the line that is reported + } + }); + `), { "space-in-parens": 1 }, [ ] ); @@ -1266,17 +1284,17 @@ describe("verify", function () { it("block comment space-in-parens #124", function () { verifyAndAssertMessages( - [ - "React.createClass({", - "render() {", - "/*", - "return (", - "
", - "); // <-- this is the line that is reported", - "*/", - "}", - "});" - ].join("\n"), + unpad(` + React.createClass({ + render() { + /* + return ( +
+ ); // <-- this is the line that is reported + */ + } + }); + `), { "space-in-parens": 1 }, [ ] ); @@ -1298,18 +1316,18 @@ describe("verify", function () { it("default param flow type no-unused-vars #184", function () { verifyAndAssertMessages( - [ - "type ResolveOptionType = {", - "depth?: number,", - "identifier?: string", - "};", - "", - "export default function resolve(", - "options: ResolveOptionType = {}", - "): Object {", - "options;", - "}", - ].join("\n"), + unpad(` + type ResolveOptionType = { + depth?: number, + identifier?: string + }; + + export default function resolve( + options: ResolveOptionType = {} + ): Object { + options; + } + `), { "no-unused-vars": 1, "no-undef": 1 }, [ ] ); @@ -1317,10 +1335,10 @@ describe("verify", function () { it("no-use-before-define #192", function () { verifyAndAssertMessages( - [ - "console.log(x);", - "var x = 1;" - ].join("\n"), + unpad(` + console.log(x); + var x = 1; + `), { "no-use-before-define": 1 }, [ "1:13 'x' was used before it was defined. no-use-before-define" ] ); @@ -1335,50 +1353,54 @@ describe("verify", function () { }); it("getter/setter #218", function () { - verifyAndAssertMessages([ - "class Person {", - " set a (v) { }", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + class Person { + set a (v) { } + } + `), { "space-before-function-paren": 1, "keyword-spacing": [1, {"before": true}], "indent": 1 }, [] ); }); it("getter/setter #220", function () { - verifyAndAssertMessages([ - "var B = {", - "get x () {", - "return this.ecks;", - "},", - "set x (ecks) {", - "this.ecks = ecks;", - "}", - "};" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + var B = { + get x () { + return this.ecks; + }, + set x (ecks) { + this.ecks = ecks; + } + }; + `), { "no-dupe-keys": 1 }, [] ); }); it("fixes issues with flow types and ObjectPattern", function () { - verifyAndAssertMessages([ - "import type Foo from 'bar';", - "export default class Foobar {", - " foo({ bar }: Foo) { bar; }", - " bar({ foo }: Foo) { foo; }", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import type Foo from 'bar'; + export default class Foobar { + foo({ bar }: Foo) { bar; } + bar({ foo }: Foo) { foo; } + } + `), { "no-unused-vars": 1, "no-shadow": 1 }, [] ); }); it("correctly detects redeclares if in script mode #217", function () { - verifyAndAssertMessages([ - "var a = 321;", - "var a = 123;", - ].join("\n"), + verifyAndAssertMessages( + unpad(` + var a = 321; + var a = 123; + `), { "no-redeclare": 1 }, [ "2:5 'a' is already defined. no-redeclare" ], "script" @@ -1386,10 +1408,11 @@ describe("verify", function () { }); it("correctly detects redeclares if in module mode #217", function () { - verifyAndAssertMessages([ - "var a = 321;", - "var a = 123;", - ].join("\n"), + verifyAndAssertMessages( + unpad(` + var a = 321; + var a = 123; + `), { "no-redeclare": 1 }, [ "2:5 'a' is already defined. no-redeclare" ], "module" @@ -1436,11 +1459,12 @@ describe("verify", function () { }); it("allowImportExportEverywhere option (#327)", function () { - verifyAndAssertMessages([ - "if (true) { import Foo from 'foo'; }", - "function foo() { import Bar from 'bar'; }", - "switch (a) { case 1: import FooBar from 'foobar'; }" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + if (true) { import Foo from 'foo'; } + function foo() { import Bar from 'bar'; } + switch (a) { case 1: import FooBar from 'foobar'; } + `), {}, [], "module", @@ -1477,49 +1501,53 @@ describe("verify", function () { }); it("decorator does not create TypeError #229", function () { - verifyAndAssertMessages([ - "class A {", - " @test", - " f() {}", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + class A { + @test + f() {} + } + `), { "no-undef": 1 }, [ "2:4 'test' is not defined. no-undef" ] ); }); it("Flow definition does not trigger warnings #223", function () { - verifyAndAssertMessages([ - "import { Map as $Map } from 'immutable';", - "function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + import { Map as $Map } from 'immutable'; + function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {} + `), { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 }, [] ); }); it("newline-before-return with comments #289", function () { - verifyAndAssertMessages([ - "function a() {", - "if (b) {", - "/* eslint-disable no-console */", - "console.log('test');", - "/* eslint-enable no-console */", - "}", - "", - "return hasGlobal;", - "}" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + function a() { + if (b) { + /* eslint-disable no-console */ + console.log('test'); + /* eslint-enable no-console */ + } + + return hasGlobal; + } + `), { "newline-before-return": 1 }, [] ); }); it("spaced-comment with shebang #163", function () { - verifyAndAssertMessages(["#!/usr/bin/env babel-node", - "", - "import {spawn} from 'foobar';" - ].join("\n"), + verifyAndAssertMessages( + unpad(` + #!/usr/bin/env babel-node + import {spawn} from 'foobar'; + `), { "spaced-comment": 1 }, [] ); @@ -1528,14 +1556,14 @@ describe("verify", function () { describe("Class Property Declarations", function() { it("no-redeclare false positive 1", function() { verifyAndAssertMessages( - [ - "class Group {", - " static propTypes = {};", - "}", - "class TypicalForm {", - " static propTypes = {};", - "}" - ].join("\n"), + unpad(` + class Group { + static propTypes = {}; + } + class TypicalForm { + static propTypes = {}; + } + `), { "no-redeclare": 1 }, [] ); @@ -1543,12 +1571,12 @@ describe("verify", function () { it("no-redeclare false positive 2", function() { verifyAndAssertMessages( - [ - "function validate() {}", - "class MyComponent {", - " static validate = validate;", - "}" - ].join("\n"), + unpad(` + function validate() {} + class MyComponent { + static validate = validate; + } + `), { "no-redeclare": 1 }, [] ); @@ -1556,15 +1584,15 @@ describe("verify", function () { it("check references", function() { verifyAndAssertMessages( - [ - "var a;", - "class A {", - " prop1;", - " prop2 = a;", - " prop3 = b;", - "}", - "new A" - ].join("\n"), + unpad(` + var a; + class A { + prop1; + prop2 = a; + prop3 = b; + } + new A + `), { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, [ "5:11 'b' is not defined. no-undef" diff --git a/eslint/babel-eslint-parser/utils/unpad.js b/eslint/babel-eslint-parser/utils/unpad.js new file mode 100644 index 000000000000..63aca71efbec --- /dev/null +++ b/eslint/babel-eslint-parser/utils/unpad.js @@ -0,0 +1,14 @@ +// Remove padding from a string. +function unpad(str) { + const lines = str.split("\n"); + const m = lines[1] && lines[1].match(/^\s+/); + if (!m) { + return str; + } + const spaces = m[0].length; + return lines.map( + (line) => line.slice(spaces) + ).join("\n").trim(); +} + +module.exports = unpad; From 1d52247080a995f9c769b725638fe88c4cc82f8e Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Mon, 17 Oct 2016 14:40:06 -0400 Subject: [PATCH 545/965] [import()] Adding support to lint dynamic imports (babel/babel-eslint#413) * [import()] Adding support to lint dynamic imports * [import()] Adding regression test to import --- eslint/babel-eslint-parser/index.js | 3 ++- eslint/babel-eslint-parser/test/non-regression.js | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ab2c3e7a0900..d390a2095da3 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -383,7 +383,8 @@ exports.parseNoPatch = function (code, options) { "functionBind", "functionSent", "objectRestSpread", - "trailingFunctionCommas" + "trailingFunctionCommas", + "dynamicImport" ] }; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 2d563782d176..b940ca6b27c2 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1601,6 +1601,14 @@ describe("verify", function () { }); }); + it("dynamic import support", function () { + verifyAndAssertMessages( + "import('test-module').then(() => {})", + {}, + [] + ); + }); + // it("regex with es6 unicodeCodePointEscapes", function () { // verifyAndAssertMessages( // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", From 93a4c3c69982aa33581ef6638b8daf8b3421e402 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 26 Oct 2016 14:36:47 -0400 Subject: [PATCH 546/965] 7.1.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b3fd1282edd9..df98967f8cdb 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.0.0", + "version": "7.1.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 8c12b515b8f4b30172d048659ab85eb34152c34c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 3 Nov 2016 09:36:59 -0400 Subject: [PATCH 547/965] chore(package): update eslint to version 3.9.1 (babel/babel-eslint#419) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index df98967f8cdb..bcb6bb2aa955 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -38,7 +38,7 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "babel-eslint": "^7.0.0", - "eslint": "^3.6.0", + "eslint": "^3.9.1", "eslint-config-babel": "^2.0.1", "eslint-plugin-babel": "^3.3.0", "eslint-plugin-flowtype": "^2.4.0", From 1be2c47da65157b3b74239700b094e6ba330fb2d Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 3 Nov 2016 09:37:12 -0400 Subject: [PATCH 548/965] chore(package): update babylon to version 6.13.0 (babel/babel-eslint#420) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index bcb6bb2aa955..1001d47a4378 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -14,7 +14,7 @@ "dependencies": { "babel-traverse": "^6.15.0", "babel-types": "^6.15.0", - "babylon": "^6.11.2", + "babylon": "^6.13.0", "lodash.pickby": "^4.6.0" }, "scripts": { From 838bada36d96229d8b9319cc47c2f8ad25c67fdd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 17:48:58 -0500 Subject: [PATCH 549/965] append code frame on parse error (babel/babel-eslint#418) --- eslint/babel-eslint-parser/index.js | 6 +++++- eslint/babel-eslint-parser/package.json | 1 + eslint/babel-eslint-parser/test/non-regression.js | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index d390a2095da3..392d9726c121 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -6,6 +6,7 @@ var parse = require("babylon").parse; var t = require("babel-types"); var tt = require("babylon").tokTypes; var traverse = require("babel-traverse").default; +var codeFrame = require("babel-code-frame"); var hasPatched = false; var eslintOptions = {}; @@ -397,7 +398,10 @@ exports.parseNoPatch = function (code, options) { err.column = err.loc.column + 1; // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = `Line ${err.lineNumber}: ${err.message.replace(/ \((\d+):(\d+)\)$/, "")}`; + err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "") + + // add codeframe + "\n\n" + + codeFrame(code, err.lineNumber, err.column, { highlightCode: true }); } throw err; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1001d47a4378..659604cdd017 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,6 +12,7 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { + "babel-code-frame": "^6.16.0", "babel-traverse": "^6.15.0", "babel-types": "^6.15.0", "babylon": "^6.13.0", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index b940ca6b27c2..e057fd0762d6 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -65,7 +65,7 @@ describe("verify", function () { ); }); - it("Readable error messages (issue #3)", function () { + xit("Readable error messages (issue #3)", function () { verifyAndAssertMessages( "{ , res }", {}, @@ -1484,7 +1484,7 @@ describe("verify", function () { ); }); - it("with does crash parsing in module mode (strict on) #171", function () { + xit("with does crash parsing in module mode (strict on) #171", function () { verifyAndAssertMessages( "with (arguments) { length; }", {}, From 49625639f2277675d5cc24ad124c422633ef4cd0 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 17 Nov 2016 17:57:52 -0500 Subject: [PATCH 550/965] chore(package): update dependencies (babel/babel-eslint#422) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 659604cdd017..f377049f9b01 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -41,7 +41,7 @@ "babel-eslint": "^7.0.0", "eslint": "^3.9.1", "eslint-config-babel": "^2.0.1", - "eslint-plugin-babel": "^3.3.0", + "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0", "espree": "^3.3.1", "mocha": "^3.0.0" From f78ab342fdee2af7b5f2538fc4e5b394868cd25f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 17:59:19 -0500 Subject: [PATCH 551/965] 7.1.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f377049f9b01..bb4294b75fe3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.1.0", + "version": "7.1.1", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 332da936b78c9ad2a0075b9242b2684a9f4ac09d Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 17 Nov 2016 18:05:03 -0500 Subject: [PATCH 552/965] chore(package): update eslint-config-babel to version 3.0.0 (babel/babel-eslint#423) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index bb4294b75fe3..c92bd518b9a7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -40,7 +40,7 @@ "devDependencies": { "babel-eslint": "^7.0.0", "eslint": "^3.9.1", - "eslint-config-babel": "^2.0.1", + "eslint-config-babel": "^3.0.0", "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0", "espree": "^3.3.1", From 122acf8f819c59e8e47e275a09f5e84d3ae0bf07 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 18 Nov 2016 08:52:17 -0500 Subject: [PATCH 553/965] use `*` (babel/babel-eslint#421) --- eslint/babel-eslint-parser/index.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 392d9726c121..4bd3ca2caff0 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -370,23 +370,7 @@ exports.parseNoPatch = function (code, options) { allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, - plugins: [ - "flow", - "jsx", - "asyncFunctions", - "asyncGenerators", - "classConstructorCall", - "classProperties", - "decorators", - "doExpressions", - "exponentiationOperator", - "exportExtensions", - "functionBind", - "functionSent", - "objectRestSpread", - "trailingFunctionCommas", - "dynamicImport" - ] + plugins: ["*"] }; var ast; From 38072c0716ebc53c62e3433f4b510e7dd0f83faf Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 2 Dec 2016 16:51:16 -0500 Subject: [PATCH 554/965] Revert "use `*`" (babel/babel-eslint#426) --- eslint/babel-eslint-parser/index.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 4bd3ca2caff0..392d9726c121 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -370,7 +370,23 @@ exports.parseNoPatch = function (code, options) { allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, - plugins: ["*"] + plugins: [ + "flow", + "jsx", + "asyncFunctions", + "asyncGenerators", + "classConstructorCall", + "classProperties", + "decorators", + "doExpressions", + "exponentiationOperator", + "exportExtensions", + "functionBind", + "functionSent", + "objectRestSpread", + "trailingFunctionCommas", + "dynamicImport" + ] }; var ast; From 10864cfa71a467634ce1790a9b132ebe78f0bda8 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 6 Dec 2016 18:02:37 -0500 Subject: [PATCH 555/965] add badges [skip ci] --- eslint/babel-eslint-parser/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index a26f0baf163a..1e38efd27d8d 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -1,5 +1,4 @@ -# babel-eslint -[![Build Status][travis-image]][travis-url] +# babel-eslint [![npm](https://img.shields.io/npm/v/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) [![travis](https://img.shields.io/travis/babel/babel-eslint/master.svg)](https://travis-ci.org/babel/babel-eslint) [![npm-downloads](https://img.shields.io/npm/dm/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). @@ -99,6 +98,3 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ```sh $ eslint your-files-here ``` - -[travis-url]: https://travis-ci.org/babel/babel-eslint -[travis-image]: https://travis-ci.org/babel/babel-eslint.svg?branch=master From fd2093914efa880f73d1dd618dd0256376703571 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Tue, 10 Jan 2017 19:36:02 +0100 Subject: [PATCH 556/965] chore(package): update eslint-config-babel to version 4.0.0 (babel/babel-eslint#430) https://greenkeeper.io/ --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c92bd518b9a7..a9ba5345a5a1 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -40,7 +40,7 @@ "devDependencies": { "babel-eslint": "^7.0.0", "eslint": "^3.9.1", - "eslint-config-babel": "^3.0.0", + "eslint-config-babel": "^4.0.0", "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0", "espree": "^3.3.1", From d76cfe05b17e714fd17ec0173e01aef436f89f6f Mon Sep 17 00:00:00 2001 From: Nazim Hajidin Date: Sat, 14 Jan 2017 17:15:54 -0500 Subject: [PATCH 557/965] Update to use Node 4 features (babel/babel-eslint#425) * Change for loops to forEach * Change more for loops * Arrow functions * Use object shorthand * Put this on one line * Change back to using for loops --- .../babylon-to-espree/toAST.js | 10 +- .../babylon-to-espree/toTokens.js | 2 +- eslint/babel-eslint-parser/index.js | 8 +- .../babel-eslint-parser/test/babel-eslint.js | 138 ++++----- .../babel-eslint-parser/test/integration.js | 52 ++-- .../test/non-regression.js | 282 +++++++++--------- 6 files changed, 246 insertions(+), 246 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 77190f369589..c26fa5ba1173 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -31,7 +31,7 @@ function changeComments(nodeComments) { var astTransformVisitor = { noScope: true, - enter: function (path) { + enter (path) { var node = path.node; node.range = [node.start, node.end]; @@ -55,12 +55,12 @@ var astTransformVisitor = { // make '_paths' non-enumerable (babel-eslint #200) Object.defineProperty(node, "_paths", { value: node._paths, writable: true }); }, - exit: function (path) { + exit (path) { var node = path.node; [ fixDirectives, - ].forEach(function (fixer) { + ].forEach((fixer) => { fixer(path); }); @@ -211,7 +211,7 @@ var astTransformVisitor = { // template string range fixes if (path.isTemplateLiteral()) { - node.quasis.forEach(function (q) { + node.quasis.forEach((q) => { q.range[0] -= 1; if (q.tail) { q.range[1] += 1; @@ -244,7 +244,7 @@ function fixDirectives (path) { if (!directivesContainer.directives) return; - directivesContainer.directives.reverse().forEach(function (directive) { + directivesContainer.directives.reverse().forEach((directive) => { directive.type = "ExpressionStatement"; directive.expression = directive.value; delete directive.value; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js index dab4b21b96c8..1f06d3e51567 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js @@ -4,7 +4,7 @@ var toToken = require("./toToken"); module.exports = function (tokens, tt, code) { // transform tokens to type "Template" convertTemplateType(tokens, tt); - var transformedTokens = tokens.filter(function (token) { + var transformedTokens = tokens.filter((token) => { return token.type !== "CommentLine" && token.type !== "CommentBlock"; }); diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 392d9726c121..7b742494589b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -44,7 +44,7 @@ function monkeypatch() { estraverses.push(estraverseOfEslint); Object.assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); - estraverses.forEach(function (estraverse) { + estraverses.forEach((estraverse) => { estraverse.VisitorKeys.MethodDefinition.push("decorators"); estraverse.VisitorKeys.Property.push("decorators"); }); @@ -100,7 +100,7 @@ function monkeypatch() { } // iterate through part of t.VISITOR_KEYS - var visitorKeysMap = pick(t.VISITOR_KEYS, function(k) { + var visitorKeysMap = pick(t.VISITOR_KEYS, (k) => { return t.FLIPPED_ALIAS_KEYS.Flow.concat([ "ArrayPattern", "ClassDeclaration", @@ -268,13 +268,13 @@ function monkeypatch() { } // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise // escope will traverse into them and include the identifiers within as declarations - estraverses.forEach(function (estraverse) { + estraverses.forEach((estraverse) => { estraverse.VisitorKeys.ObjectPattern = ["properties"]; estraverse.VisitorKeys.ArrayPattern = ["elements"]; }); visitFunction.call(this, node); // set them back to normal... - estraverses.forEach(function (estraverse) { + estraverses.forEach((estraverse) => { estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; }); diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 65e70b10aec6..62463f443ac9 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -37,7 +37,7 @@ function lookup(obj, keypath, backwardsDepth) { if (!keypath) { return obj; } return keypath.split(".").slice(0, -1 * backwardsDepth) - .reduce(function (base, segment) { return base && base[segment], obj; }); + .reduce((base, segment) => { return base && base[segment], obj; }); } function parseAndAssertSame(code) { @@ -82,57 +82,57 @@ function parseAndAssertSame(code) { // assert.equal(esAST, babylonAST); } -describe("babylon-to-esprima", function () { - describe("templates", function () { - it("empty template string", function () { +describe("babylon-to-esprima", () => { + describe("templates", () => { + it("empty template string", () => { parseAndAssertSame("``"); }); - it("template string", function () { + it("template string", () => { parseAndAssertSame("`test`"); }); - it("template string using $", function () { + it("template string using $", () => { parseAndAssertSame("`$`"); }); - it("template string with expression", function () { + it("template string with expression", () => { parseAndAssertSame("`${a}`"); }); - it("template string with multiple expressions", function () { + it("template string with multiple expressions", () => { parseAndAssertSame("`${a}${b}${c}`"); }); - it("template string with expression and strings", function () { + it("template string with expression and strings", () => { parseAndAssertSame("`a${a}a`"); }); - it("template string with binary expression", function () { + it("template string with binary expression", () => { parseAndAssertSame("`a${a + b}a`"); }); - it("tagged template", function () { + it("tagged template", () => { parseAndAssertSame("jsx``"); }); - it("tagged template with expression", function () { + it("tagged template with expression", () => { parseAndAssertSame("jsx``"); }); - it("tagged template with new operator", function () { + it("tagged template with new operator", () => { parseAndAssertSame("new raw`42`"); }); - it("template with nested function/object", function () { + it("template with nested function/object", () => { parseAndAssertSame("`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`"); }); - it("template with braces inside and outside of template string #96", function () { + it("template with braces inside and outside of template string #96", () => { parseAndAssertSame("if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }"); }); - it("template also with braces #96", function () { + it("template also with braces #96", () => { parseAndAssertSame( unpad(` export default function f1() { @@ -146,7 +146,7 @@ describe("babylon-to-esprima", function () { ); }); - it("template with destructuring #31", function () { + it("template with destructuring #31", () => { parseAndAssertSame( unpad(` module.exports = { @@ -160,103 +160,103 @@ describe("babylon-to-esprima", function () { }); }); - it("simple expression", function () { + it("simple expression", () => { parseAndAssertSame("a = 1"); }); - it("class declaration", function () { + it("class declaration", () => { parseAndAssertSame("class Foo {}"); }); - it("class expression", function () { + it("class expression", () => { parseAndAssertSame("var a = class Foo {}"); }); - it("jsx expression", function () { + it("jsx expression", () => { parseAndAssertSame(""); }); - it("jsx expression with 'this' as identifier", function () { + it("jsx expression with 'this' as identifier", () => { parseAndAssertSame(""); }); - it("jsx expression with a dynamic attribute", function () { + it("jsx expression with a dynamic attribute", () => { parseAndAssertSame(""); }); - it("jsx expression with a member expression as identifier", function () { + it("jsx expression with a member expression as identifier", () => { parseAndAssertSame(""); }); - it("jsx expression with spread", function () { + it("jsx expression with spread", () => { parseAndAssertSame("var myDivElement =
;"); }); - it("empty jsx text", function () { + it("empty jsx text", () => { parseAndAssertSame(""); }); - it("jsx text with content", function () { + it("jsx text with content", () => { parseAndAssertSame("Hello, world!"); }); - it("nested jsx", function () { + it("nested jsx", () => { parseAndAssertSame("
\n

Wat

\n
"); }); - it("default import", function () { + it("default import", () => { parseAndAssertSame("import foo from \"foo\";"); }); - it("import specifier", function () { + it("import specifier", () => { parseAndAssertSame("import { foo } from \"foo\";"); }); - it("import specifier with name", function () { + it("import specifier with name", () => { parseAndAssertSame("import { foo as bar } from \"foo\";"); }); - it("import bare", function () { + it("import bare", () => { parseAndAssertSame("import \"foo\";"); }); - it("export default class declaration", function () { + it("export default class declaration", () => { parseAndAssertSame("export default class Foo {}"); }); - it("export default class expression", function () { + it("export default class expression", () => { parseAndAssertSame("export default class {}"); }); - it("export default function declaration", function () { + it("export default function declaration", () => { parseAndAssertSame("export default function Foo() {}"); }); - it("export default function expression", function () { + it("export default function expression", () => { parseAndAssertSame("export default function () {}"); }); - it("export all", function () { + it("export all", () => { parseAndAssertSame("export * from \"foo\";"); }); - it("export named", function () { + it("export named", () => { parseAndAssertSame("export { foo };"); }); - it("export named alias", function () { + it("export named alias", () => { parseAndAssertSame("export { foo as bar };"); }); - it.skip("empty program with line comment", function () { + it.skip("empty program with line comment", () => { parseAndAssertSame("// single comment"); }); - it.skip("empty program with block comment", function () { + it.skip("empty program with block comment", () => { parseAndAssertSame(" /* multiline\n * comment\n*/"); }); - it("line comments", function () { + it("line comments", () => { parseAndAssertSame( unpad(` // single comment @@ -266,7 +266,7 @@ describe("babylon-to-esprima", function () { ); }); - it("block comments", function () { + it("block comments", () => { parseAndAssertSame( unpad(` /* single comment */ @@ -279,7 +279,7 @@ describe("babylon-to-esprima", function () { ); }); - it("block comments #124", function () { + it("block comments #124", () => { parseAndAssertSame( unpad(` React.createClass({ @@ -293,31 +293,31 @@ describe("babylon-to-esprima", function () { ); }); - it("null", function () { + it("null", () => { parseAndAssertSame("null"); }); - it("boolean", function () { + it("boolean", () => { parseAndAssertSame("if (true) {} else if (false) {}"); }); - it("regexp", function () { + it("regexp", () => { parseAndAssertSame("/affix-top|affix-bottom|affix|[a-z]/"); }); - it("regexp in a template string", function () { + it("regexp in a template string", () => { parseAndAssertSame("`${/\\d/.exec(\"1\")[0]}`"); }); - it("first line is empty", function () { + it("first line is empty", () => { parseAndAssertSame("\nimport Immutable from \"immutable\";"); }); - it("empty", function () { + it("empty", () => { parseAndAssertSame(""); }); - it("jsdoc", function () { + it("jsdoc", () => { parseAndAssertSame( unpad(` /** @@ -332,7 +332,7 @@ describe("babylon-to-esprima", function () { ); }); - it("empty block with comment", function () { + it("empty block with comment", () => { parseAndAssertSame( unpad(` function a () { @@ -346,8 +346,8 @@ describe("babylon-to-esprima", function () { ); }); - describe("babel 6 tests", function () { - it("MethodDefinition", function () { + describe("babel 6 tests", () => { + it("MethodDefinition", () => { parseAndAssertSame( unpad(` export default class A { @@ -357,11 +357,11 @@ describe("babylon-to-esprima", function () { ); }); - it("MethodDefinition 2", function () { + it("MethodDefinition 2", () => { parseAndAssertSame("export default class Bar { get bar() { return 42; }}"); }); - it("ClassMethod", function () { + it("ClassMethod", () => { parseAndAssertSame( unpad(` class A { @@ -372,7 +372,7 @@ describe("babylon-to-esprima", function () { ); }); - it("ClassMethod multiple params", function () { + it("ClassMethod multiple params", () => { parseAndAssertSame( unpad(` class A { @@ -383,7 +383,7 @@ describe("babylon-to-esprima", function () { ); }); - it("ClassMethod multiline", function () { + it("ClassMethod multiline", () => { parseAndAssertSame( unpad(` class A { @@ -401,11 +401,11 @@ describe("babylon-to-esprima", function () { ); }); - it("ClassMethod oneline", function () { + it("ClassMethod oneline", () => { parseAndAssertSame("class A { constructor(a, b, c) {} }"); }); - it("ObjectMethod", function () { + it("ObjectMethod", () => { parseAndAssertSame( unpad(` var a = { @@ -416,27 +416,27 @@ describe("babylon-to-esprima", function () { ); }); - it("do not allow import export everywhere", function() { - assert.throws(function () { + it("do not allow import export everywhere", () => { + assert.throws(() => { parseAndAssertSame("function F() { import a from \"a\"; }"); }, /SyntaxError: 'import' and 'export' may only appear at the top level/); }); - it("return outside function", function () { + it("return outside function", () => { parseAndAssertSame("return;"); }); - it("super outside method", function () { + it("super outside method", () => { parseAndAssertSame("function F() { super(); }"); }); - it("StringLiteral", function () { + it("StringLiteral", () => { parseAndAssertSame(""); parseAndAssertSame(""); parseAndAssertSame("a"); }); - it("getters and setters", function () { + it("getters and setters", () => { parseAndAssertSame("class A { get x ( ) { ; } }"); parseAndAssertSame( unpad(` @@ -475,19 +475,19 @@ describe("babylon-to-esprima", function () { ); }); - it("RestOperator", function () { + it("RestOperator", () => { parseAndAssertSame("var { a, ...b } = c"); parseAndAssertSame("var [ a, ...b ] = c"); parseAndAssertSame("var a = function (...b) {}"); }); - it("SpreadOperator", function () { + it("SpreadOperator", () => { parseAndAssertSame("var a = { b, ...c }"); parseAndAssertSame("var a = [ a, ...b ]"); parseAndAssertSame("var a = sum(...b)"); }); - it("Async/Await", function() { + it("Async/Await", () => { parseAndAssertSame( unpad(` async function a() { diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 2e62188e906f..2814b4c35736 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -24,7 +24,7 @@ var baseEslintOpts = { * @param function done */ function lint (opts, done) { - readFixture(opts.fixture, function (err, src) { + readFixture(opts.fixture, (err, src) => { if (err) return done(err); done(null, eslint.linter.verify(src, opts.eslint)); }); @@ -46,7 +46,7 @@ function readFixture (id, done) { } // readFixture -describe("Rules:", function () { +describe("Rules:", () => { describe("`strict`", strictSuite); }); // describe @@ -54,19 +54,19 @@ describe("Rules:", function () { function strictSuite () { var ruleId = "strict"; - describe("when set to 'never'", function () { + describe("when set to 'never'", () => { var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "never"]; - ["global-with", "function-with"].forEach(function (fixture) { + ["global-with", "function-with"].forEach((fixture) => { it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, - function (done) { + (done) => { lint({ fixture: ["strict", fixture], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); done(); @@ -78,17 +78,17 @@ function strictSuite () { }); // describe - describe("when set to 'global'", function () { + describe("when set to 'global'", () => { var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {} }); eslintOpts.rules[ruleId] = [errorLevel, "global"]; - it("shouldn't error on single global directive", function (done) { + it("shouldn't error on single global directive", (done) => { lint({ fixture: ["strict", "global-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(!report.length); done(); @@ -96,13 +96,13 @@ function strictSuite () { }); // it - it("should error twice on global directive: no and function directive: yes", function (done) { + it("should error twice on global directive: no and function directive: yes", (done) => { lint({ fixture: ["strict", "function-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); - [0, 1].forEach(function (i) { + [0, 1].forEach((i) => { assert(report[i].ruleId === ruleId); }); done(); @@ -110,11 +110,11 @@ function strictSuite () { }); // it - it("should error on function directive", function (done) { + it("should error on function directive", (done) => { lint({ fixture: ["strict", "global-with-function-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); @@ -128,11 +128,11 @@ function strictSuite () { }); // it - it("should error on no directive", function (done) { + it("should error on no directive", (done) => { lint({ fixture: ["strict", "none"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); done(); @@ -142,17 +142,17 @@ function strictSuite () { }); // describe - describe("when set to 'function'", function () { + describe("when set to 'function'", () => { var eslintOpts = Object.assign({}, baseEslintOpts, { rules: {} }); eslintOpts.rules[ruleId] = [errorLevel, "function"]; - it("shouldn't error on single function directive", function (done) { + it("shouldn't error on single function directive", (done) => { lint({ fixture: ["strict", "function-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(!report.length); done(); @@ -160,13 +160,13 @@ function strictSuite () { }); // it - it("should error twice on function directive: no and global directive: yes", function (done) { + it("should error twice on function directive: no and global directive: yes", (done) => { lint({ fixture: ["strict", "global-with-function-without"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); - [0, 1].forEach(function (i) { + [0, 1].forEach((i) => { assert(report[i].ruleId === ruleId); }); done(); @@ -174,11 +174,11 @@ function strictSuite () { }); // it - it("should error on only global directive", function (done) { + it("should error on only global directive", (done) => { lint({ fixture: ["strict", "global-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); done(); @@ -186,11 +186,11 @@ function strictSuite () { }); // it - it("should error on extraneous global directive", function (done) { + it("should error on extraneous global directive", (done) => { lint({ fixture: ["strict", "global-with-function-with"], eslint: eslintOpts, - }, function (err, report) { + }, (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); assert(report[0].nodeType.indexOf("Function") === -1); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index e057fd0762d6..52f30bc7fd2c 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -6,7 +6,7 @@ var unpad = require("../utils/unpad"); function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { var config = { parser: require.resolve(".."), - rules: rules, + rules, env: { node: true, es6: true @@ -18,7 +18,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over experimentalObjectRestSpread: true, globalReturn: true }, - sourceType: sourceType + sourceType } }; @@ -34,7 +34,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over throw new Error(`Expected ${expectedMessages.length} message(s), got ${messages.length} ${JSON.stringify(messages)}`); } - messages.forEach(function (message, i) { + messages.forEach((message, i) => { var formatedMessage = `${message.line}:${message.column} ${message.message}${(message.ruleId ? ` ${message.ruleId}` : "")}`; if (formatedMessage !== expectedMessages[i]) { throw new Error( @@ -48,8 +48,8 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over }); } -describe("verify", function () { - it("arrow function support (issue #1)", function () { +describe("verify", () => { + it("arrow function support (issue #1)", () => { verifyAndAssertMessages( "describe('stuff', () => {});", {}, @@ -57,7 +57,7 @@ describe("verify", function () { ); }); - it("EOL validation (issue #2)", function () { + it("EOL validation (issue #2)", () => { verifyAndAssertMessages( "module.exports = \"something\";", { "eol-last": 1, "semi": 1 }, @@ -65,7 +65,7 @@ describe("verify", function () { ); }); - xit("Readable error messages (issue #3)", function () { + xit("Readable error messages (issue #3)", () => { verifyAndAssertMessages( "{ , res }", {}, @@ -73,7 +73,7 @@ describe("verify", function () { ); }); - it("Modules support (issue #5)", function () { + it("Modules support (issue #5)", () => { verifyAndAssertMessages( unpad(` import Foo from 'foo'; @@ -86,7 +86,7 @@ describe("verify", function () { ); }); - it("Rest parameters (issue #7)", function () { + it("Rest parameters (issue #7)", () => { verifyAndAssertMessages( "function foo(...args) { return args; }", { "no-undef": 1 }, @@ -94,7 +94,7 @@ describe("verify", function () { ); }); - it("Exported classes should be used (issue #8)", function () { + it("Exported classes should be used (issue #8)", () => { verifyAndAssertMessages( "class Foo {} module.exports = Foo;", { "no-unused-vars": 1 }, @@ -102,7 +102,7 @@ describe("verify", function () { ); }); - it("super keyword in class (issue #10)", function () { + it("super keyword in class (issue #10)", () => { verifyAndAssertMessages( "class Foo { constructor() { super() } }", { "no-undef": 1 }, @@ -110,7 +110,7 @@ describe("verify", function () { ); }); - it("Rest parameter in destructuring assignment (issue #11)", function () { + it("Rest parameter in destructuring assignment (issue #11)", () => { verifyAndAssertMessages( "const [a, ...rest] = ['1', '2', '3']; module.exports = rest;", { "no-undef": 1 }, @@ -118,7 +118,7 @@ describe("verify", function () { ); }); - it("JSX attribute names marked as variables (issue #12)", function () { + it("JSX attribute names marked as variables (issue #12)", () => { verifyAndAssertMessages( "module.exports =
", { "no-undef": 1 }, @@ -126,7 +126,7 @@ describe("verify", function () { ); }); - it("Multiple destructured assignment with compound properties (issue #16)", function () { + it("Multiple destructured assignment with compound properties (issue #16)", () => { verifyAndAssertMessages( "module.exports = { ...a.a, ...a.b };", { "no-dupe-keys": 1 }, @@ -134,7 +134,7 @@ describe("verify", function () { ); }); - it("Arrow function with non-block bodies (issue #20)", function () { + it("Arrow function with non-block bodies (issue #20)", () => { verifyAndAssertMessages( "\"use strict\"; () => 1", { "strict": [1, "global"] }, @@ -143,7 +143,7 @@ describe("verify", function () { ); }); - it("#242", function () { + it("#242", () => { verifyAndAssertMessages( "\"use strict\"; asdf;", { "no-irregular-whitespace": 1 }, @@ -152,7 +152,7 @@ describe("verify", function () { ); }); - it("await keyword (issue #22)", function () { + it("await keyword (issue #22)", () => { verifyAndAssertMessages( "async function foo() { await bar(); }", { "no-unused-expressions": 1 }, @@ -160,7 +160,7 @@ describe("verify", function () { ); }); - it("arrow functions (issue #27)", function () { + it("arrow functions (issue #27)", () => { verifyAndAssertMessages( "[1, 2, 3].map(i => i * 2);", { "func-names": 1, "space-before-blocks": 1 }, @@ -168,7 +168,7 @@ describe("verify", function () { ); }); - it("comment with padded-blocks (issue #33)", function () { + it("comment with padded-blocks (issue #33)", () => { verifyAndAssertMessages( unpad(` if (a) { @@ -181,8 +181,8 @@ describe("verify", function () { ); }); - describe("flow", function () { - it("check regular function", function () { + describe("flow", () => { + it("check regular function", () => { verifyAndAssertMessages( "function a(b, c) { b += 1; c += 1; return b + c; } a;", { "no-unused-vars": 1, "no-undef": 1 }, @@ -190,7 +190,7 @@ describe("verify", function () { ); }); - it("type alias", function () { + it("type alias", () => { verifyAndAssertMessages( "type SomeNewType = any;", { "no-undef": 1 }, @@ -198,7 +198,7 @@ describe("verify", function () { ); }); - it("type cast expression #102", function () { + it("type cast expression #102", () => { verifyAndAssertMessages( "for (let a of (a: Array)) {}", {}, @@ -206,7 +206,7 @@ describe("verify", function () { ); }); - it("multiple nullable type annotations and return #108", function () { + it("multiple nullable type annotations and return #108", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -222,7 +222,7 @@ describe("verify", function () { ); }); - it("type parameters", function () { + it("type parameters", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -235,7 +235,7 @@ describe("verify", function () { ); }); - it("nested type annotations", function () { + it("nested type annotations", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -249,7 +249,7 @@ describe("verify", function () { ); }); - it("type in var declaration", function () { + it("type in var declaration", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -261,7 +261,7 @@ describe("verify", function () { ); }); - it("object type annotation", function () { + it("object type annotation", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -273,7 +273,7 @@ describe("verify", function () { ); }); - it("object property types", function () { + it("object property types", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -288,7 +288,7 @@ describe("verify", function () { ); }); - it("namespaced types", function () { + it("namespaced types", () => { verifyAndAssertMessages( unpad(` var React = require('react-native'); @@ -306,7 +306,7 @@ describe("verify", function () { ); }); - it("ArrayTypeAnnotation", function () { + it("ArrayTypeAnnotation", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -317,7 +317,7 @@ describe("verify", function () { ); }); - it("ClassImplements", function () { + it("ClassImplements", () => { verifyAndAssertMessages( unpad(` import type Bar from 'foo'; @@ -328,7 +328,7 @@ describe("verify", function () { ); }); - it("type alias creates declaration + usage", function () { + it("type alias creates declaration + usage", () => { verifyAndAssertMessages( unpad(` type Foo = any; @@ -339,7 +339,7 @@ describe("verify", function () { ); }); - it("type alias with type parameters", function () { + it("type alias with type parameters", () => { verifyAndAssertMessages( unpad(` import type Bar from 'foo'; @@ -352,7 +352,7 @@ describe("verify", function () { ); }); - it("export type alias", function () { + it("export type alias", () => { verifyAndAssertMessages( unpad(` import type Foo2 from 'foo'; @@ -363,7 +363,7 @@ describe("verify", function () { ); }); - it("polymorphpic types #109", function () { + it("polymorphpic types #109", () => { verifyAndAssertMessages( "export default function groupByEveryN(array: Array, n: number): Array> { n; }", { "no-unused-vars": 1, "no-undef": 1 }, @@ -371,7 +371,7 @@ describe("verify", function () { ); }); - it("types definition from import", function () { + it("types definition from import", () => { verifyAndAssertMessages( unpad(` import type Promise from 'bluebird'; @@ -383,7 +383,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types for class #123", function () { + it("polymorphpic/generic types for class #123", () => { verifyAndAssertMessages( unpad(` class Box { @@ -397,7 +397,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types for function #123", function () { + it("polymorphpic/generic types for function #123", () => { verifyAndAssertMessages( unpad(` export function identity(value) { @@ -409,7 +409,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types for type alias #123", function () { + it("polymorphpic/generic types for type alias #123", () => { verifyAndAssertMessages( unpad(` import Bar from './Bar'; @@ -420,7 +420,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types - outside of fn scope #123", function () { + it("polymorphpic/generic types - outside of fn scope #123", () => { verifyAndAssertMessages( unpad(` export function foo(value) { value; }; @@ -432,7 +432,7 @@ describe("verify", function () { ); }); - it("polymorphpic/generic types - extending unknown #123", function () { + it("polymorphpic/generic types - extending unknown #123", () => { verifyAndAssertMessages( unpad(` import Bar from 'bar'; @@ -443,7 +443,7 @@ describe("verify", function () { ); }); - it("support declarations #132", function () { + it("support declarations #132", () => { verifyAndAssertMessages( unpad(` declare class A { static () : number } @@ -457,7 +457,7 @@ describe("verify", function () { ); }); - it("1", function () { + it("1", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -469,7 +469,7 @@ describe("verify", function () { ); }); - it("2", function () { + it("2", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -480,7 +480,7 @@ describe("verify", function () { ); }); - it("3", function () { + it("3", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -492,7 +492,7 @@ describe("verify", function () { ); }); - it("4", function () { + it("4", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -505,7 +505,7 @@ describe("verify", function () { ); }); - it("5", function () { + it("5", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -517,7 +517,7 @@ describe("verify", function () { ); }); - it("6", function () { + it("6", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -528,7 +528,7 @@ describe("verify", function () { ); }); - it("7", function () { + it("7", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -539,7 +539,7 @@ describe("verify", function () { ); }); - it("8", function () { + it("8", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -551,7 +551,7 @@ describe("verify", function () { ); }); - it("9", function () { + it("9", () => { verifyAndAssertMessages( "export default function (a: T1, b: T2) { b; }", { "no-unused-vars": 1, "no-undef": 1 }, @@ -559,7 +559,7 @@ describe("verify", function () { ); }); - it("10", function () { + it("10", () => { verifyAndAssertMessages( "var a=function(a: T1, b: T2) {return a + b;}; a;", { "no-unused-vars": 1, "no-undef": 1 }, @@ -567,7 +567,7 @@ describe("verify", function () { ); }); - it("11", function () { + it("11", () => { verifyAndAssertMessages( "var a={*id(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, @@ -575,7 +575,7 @@ describe("verify", function () { ); }); - it("12", function () { + it("12", () => { verifyAndAssertMessages( "var a={async id(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, @@ -583,7 +583,7 @@ describe("verify", function () { ); }); - it("13", function () { + it("13", () => { verifyAndAssertMessages( "var a={123(x: T): T { x; }}; a;", { "no-unused-vars": 1, "no-undef": 1 }, @@ -591,7 +591,7 @@ describe("verify", function () { ); }); - it("14", function () { + it("14", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -603,7 +603,7 @@ describe("verify", function () { ); }); - it("15", function () { + it("15", () => { verifyAndAssertMessages( unpad(` import type Foo2 from 'foo'; @@ -614,7 +614,7 @@ describe("verify", function () { ); }); - it("16", function () { + it("16", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -625,7 +625,7 @@ describe("verify", function () { ); }); - it("17", function () { + it("17", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -636,7 +636,7 @@ describe("verify", function () { ); }); - it("18", function () { + it("18", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -649,7 +649,7 @@ describe("verify", function () { ); }); - it("19", function () { + it("19", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -661,7 +661,7 @@ describe("verify", function () { ); }); - it("20", function () { + it("20", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -675,7 +675,7 @@ describe("verify", function () { ); }); - it("21", function () { + it("21", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -688,7 +688,7 @@ describe("verify", function () { ); }); - it("22", function () { + it("22", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -701,7 +701,7 @@ describe("verify", function () { ); }); - it("23", function () { + it("23", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -712,7 +712,7 @@ describe("verify", function () { ); }); - it("24", function () { + it("24", () => { verifyAndAssertMessages( unpad(` import type Baz from 'baz'; @@ -723,7 +723,7 @@ describe("verify", function () { ); }); - it("25", function () { + it("25", () => { verifyAndAssertMessages( "export default class Bar { bar(): T { return 42; }}", { "no-unused-vars": 1, "no-undef": 1 }, @@ -731,7 +731,7 @@ describe("verify", function () { ); }); - it("26", function () { + it("26", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -743,7 +743,7 @@ describe("verify", function () { ); }); - it("27", function () { + it("27", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -755,7 +755,7 @@ describe("verify", function () { ); }); - it("28", function () { + it("28", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -767,7 +767,7 @@ describe("verify", function () { ); }); - it("29", function () { + it("29", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -779,7 +779,7 @@ describe("verify", function () { ); }); - it("30", function () { + it("30", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -790,7 +790,7 @@ describe("verify", function () { ); }); - it("31", function () { + it("31", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -801,7 +801,7 @@ describe("verify", function () { ); }); - it("32", function () { + it("32", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -812,7 +812,7 @@ describe("verify", function () { ); }); - it("33", function () { + it("33", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -823,7 +823,7 @@ describe("verify", function () { ); }); - it("34", function () { + it("34", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -835,7 +835,7 @@ describe("verify", function () { ); }); - it("35", function () { + it("35", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -846,7 +846,7 @@ describe("verify", function () { ); }); - it("36", function () { + it("36", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -858,7 +858,7 @@ describe("verify", function () { ); }); - it("37", function () { + it("37", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -872,7 +872,7 @@ describe("verify", function () { ); }); - it("38", function () { + it("38", () => { verifyAndAssertMessages( unpad(` import type {foo, bar} from 'baz'; @@ -883,7 +883,7 @@ describe("verify", function () { ); }); - it("39", function () { + it("39", () => { verifyAndAssertMessages( unpad(` import type {foo as bar} from 'baz'; @@ -894,7 +894,7 @@ describe("verify", function () { ); }); - it("40", function () { + it("40", () => { verifyAndAssertMessages( unpad(` import type from 'foo'; @@ -905,7 +905,7 @@ describe("verify", function () { ); }); - it("41", function () { + it("41", () => { verifyAndAssertMessages( unpad(` import type, {foo} from 'bar'; @@ -916,7 +916,7 @@ describe("verify", function () { ); }); - it("42", function () { + it("42", () => { verifyAndAssertMessages( unpad(` import type * as namespace from 'bar'; @@ -927,7 +927,7 @@ describe("verify", function () { ); }); - it("43", function () { + it("43", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -938,7 +938,7 @@ describe("verify", function () { ); }); - it("44", function () { + it("44", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -949,7 +949,7 @@ describe("verify", function () { ); }); - it("45", function () { + it("45", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -960,7 +960,7 @@ describe("verify", function () { ); }); - it("46", function () { + it("46", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -971,7 +971,7 @@ describe("verify", function () { ); }); - it("47", function () { + it("47", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -982,7 +982,7 @@ describe("verify", function () { ); }); - it("48", function () { + it("48", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -993,7 +993,7 @@ describe("verify", function () { ); }); - it("49", function () { + it("49", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; @@ -1007,7 +1007,7 @@ describe("verify", function () { }); }); - it("class usage", function () { + it("class usage", () => { verifyAndAssertMessages( "class Lol {} module.exports = Lol;", { "no-unused-vars": 1 }, @@ -1015,7 +1015,7 @@ describe("verify", function () { ); }); - it("class definition: gaearon/redux#24", function () { + it("class definition: gaearon/redux#24", () => { verifyAndAssertMessages( unpad(` export default function root(stores) { @@ -1029,7 +1029,7 @@ describe("verify", function () { ); }); - it("class properties #71", function () { + it("class properties #71", () => { verifyAndAssertMessages( "class Lol { foo = 'bar'; }", { "no-undef": 1 }, @@ -1037,7 +1037,7 @@ describe("verify", function () { ); }); - it("template strings #31", function () { + it("template strings #31", () => { verifyAndAssertMessages( "console.log(`${a}, b`);", { "comma-spacing": 1 }, @@ -1045,7 +1045,7 @@ describe("verify", function () { ); }); - it("template with destructuring #31", function () { + it("template with destructuring #31", () => { verifyAndAssertMessages( unpad(` module.exports = { @@ -1060,8 +1060,8 @@ describe("verify", function () { ); }); - describe("decorators #72", function () { - it("class declaration", function () { + describe("decorators #72", () => { + it("class declaration", () => { verifyAndAssertMessages( unpad(` import classDeclaration from 'decorator'; @@ -1076,7 +1076,7 @@ describe("verify", function () { ); }); - it("method definition", function () { + it("method definition", () => { verifyAndAssertMessages( unpad(` import classMethodDeclarationA from 'decorator'; @@ -1095,7 +1095,7 @@ describe("verify", function () { ); }); - it("method definition get/set", function () { + it("method definition get/set", () => { verifyAndAssertMessages( unpad(` import classMethodDeclarationA from 'decorator'; @@ -1116,7 +1116,7 @@ describe("verify", function () { ); }); - it("object property", function () { + it("object property", () => { verifyAndAssertMessages( unpad(` import classMethodDeclarationA from 'decorator'; @@ -1136,7 +1136,7 @@ describe("verify", function () { ); }); - it("object property get/set", function () { + it("object property get/set", () => { verifyAndAssertMessages( unpad(` import classMethodDeclarationA from 'decorator'; @@ -1159,7 +1159,7 @@ describe("verify", function () { }); }); - it("detects minimal no-unused-vars case #120", function () { + it("detects minimal no-unused-vars case #120", () => { verifyAndAssertMessages( "var unused;", { "no-unused-vars": 1 }, @@ -1170,7 +1170,7 @@ describe("verify", function () { // This two tests are disabled, as the feature to visit properties when // there is a spread/rest operator has been removed as it caused problems // with other rules #249 - it.skip("visits excluded properties left of spread #95", function () { + it.skip("visits excluded properties left of spread #95", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", { "no-unused-vars": 1 }, @@ -1178,7 +1178,7 @@ describe("verify", function () { ); }); - it.skip("visits excluded properties left of spread #210", function () { + it.skip("visits excluded properties left of spread #210", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", { "no-unused-vars": 1 }, @@ -1186,7 +1186,7 @@ describe("verify", function () { ); }); - it("does not mark spread variables false-positive", function () { + it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", { "no-undef": 1, "no-redeclare": 1 }, @@ -1194,7 +1194,7 @@ describe("verify", function () { ); }); - it("does not mark spread variables false-positive", function () { + it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", { "no-undef": 1, "no-redeclare": 1 }, @@ -1202,7 +1202,7 @@ describe("verify", function () { ); }); - it("does not mark spread variables as use-before-define #249", function () { + it("does not mark spread variables as use-before-define #249", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", { "no-use-before-define": 1 }, @@ -1210,7 +1210,7 @@ describe("verify", function () { ); }); - it("detects no-unused-vars with object destructuring #142", function () { + it("detects no-unused-vars with object destructuring #142", () => { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, @@ -1218,7 +1218,7 @@ describe("verify", function () { ); }); - it("don't warn no-unused-vars with spread #142", function () { + it("don't warn no-unused-vars with spread #142", () => { verifyAndAssertMessages( unpad(` export default function test(data) { @@ -1233,7 +1233,7 @@ describe("verify", function () { ); }); - it("excludes comment tokens #153", function () { + it("excludes comment tokens #153", () => { verifyAndAssertMessages( unpad(` var a = [ @@ -1258,7 +1258,7 @@ describe("verify", function () { ); }); - it("ternary and parens #149", function () { + it("ternary and parens #149", () => { verifyAndAssertMessages( "true ? (true) : false;", { "space-infix-ops": 1 }, @@ -1266,7 +1266,7 @@ describe("verify", function () { ); }); - it("line comment space-in-parens #124", function () { + it("line comment space-in-parens #124", () => { verifyAndAssertMessages( unpad(` React.createClass({ @@ -1282,7 +1282,7 @@ describe("verify", function () { ); }); - it("block comment space-in-parens #124", function () { + it("block comment space-in-parens #124", () => { verifyAndAssertMessages( unpad(` React.createClass({ @@ -1300,21 +1300,21 @@ describe("verify", function () { ); }); - it("no no-undef error with rest #11", function () { + it("no no-undef error with rest #11", () => { verifyAndAssertMessages("const [a, ...rest] = ['1', '2', '3']; a; rest;", { "no-undef": 1, "no-unused-vars": 1 }, [ ] ); }); - it("async function with space-before-function-paren #168", function () { + it("async function with space-before-function-paren #168", () => { verifyAndAssertMessages("it('handles updates', async function() {});", { "space-before-function-paren": [1, "never"] }, [ ] ); }); - it("default param flow type no-unused-vars #184", function () { + it("default param flow type no-unused-vars #184", () => { verifyAndAssertMessages( unpad(` type ResolveOptionType = { @@ -1333,7 +1333,7 @@ describe("verify", function () { ); }); - it("no-use-before-define #192", function () { + it("no-use-before-define #192", () => { verifyAndAssertMessages( unpad(` console.log(x); @@ -1344,7 +1344,7 @@ describe("verify", function () { ); }); - it("jsx and stringliteral #216", function () { + it("jsx and stringliteral #216", () => { verifyAndAssertMessages( "
", {}, @@ -1352,7 +1352,7 @@ describe("verify", function () { ); }); - it("getter/setter #218", function () { + it("getter/setter #218", () => { verifyAndAssertMessages( unpad(` class Person { @@ -1364,7 +1364,7 @@ describe("verify", function () { ); }); - it("getter/setter #220", function () { + it("getter/setter #220", () => { verifyAndAssertMessages( unpad(` var B = { @@ -1381,7 +1381,7 @@ describe("verify", function () { ); }); - it("fixes issues with flow types and ObjectPattern", function () { + it("fixes issues with flow types and ObjectPattern", () => { verifyAndAssertMessages( unpad(` import type Foo from 'bar'; @@ -1395,7 +1395,7 @@ describe("verify", function () { ); }); - it("correctly detects redeclares if in script mode #217", function () { + it("correctly detects redeclares if in script mode #217", () => { verifyAndAssertMessages( unpad(` var a = 321; @@ -1407,7 +1407,7 @@ describe("verify", function () { ); }); - it("correctly detects redeclares if in module mode #217", function () { + it("correctly detects redeclares if in module mode #217", () => { verifyAndAssertMessages( unpad(` var a = 321; @@ -1419,7 +1419,7 @@ describe("verify", function () { ); }); - it("no-implicit-globals in script", function () { + it("no-implicit-globals in script", () => { verifyAndAssertMessages( "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, @@ -1432,7 +1432,7 @@ describe("verify", function () { ); }); - it("no-implicit-globals in module", function () { + it("no-implicit-globals in module", () => { verifyAndAssertMessages( "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, @@ -1445,7 +1445,7 @@ describe("verify", function () { ); }); - it("no-implicit-globals in default", function () { + it("no-implicit-globals in default", () => { verifyAndAssertMessages( "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, @@ -1458,7 +1458,7 @@ describe("verify", function () { ); }); - it("allowImportExportEverywhere option (#327)", function () { + it("allowImportExportEverywhere option (#327)", () => { verifyAndAssertMessages( unpad(` if (true) { import Foo from 'foo'; } @@ -1475,7 +1475,7 @@ describe("verify", function () { ); }); - it("with does not crash parsing in script mode (strict off) #171", function () { + it("with does not crash parsing in script mode (strict off) #171", () => { verifyAndAssertMessages( "with (arguments) { length; }", {}, @@ -1484,7 +1484,7 @@ describe("verify", function () { ); }); - xit("with does crash parsing in module mode (strict on) #171", function () { + xit("with does crash parsing in module mode (strict on) #171", () => { verifyAndAssertMessages( "with (arguments) { length; }", {}, @@ -1492,7 +1492,7 @@ describe("verify", function () { ); }); - it("new.target is not reported as undef #235", function () { + it("new.target is not reported as undef #235", () => { verifyAndAssertMessages( "function foo () { return new.target }", { "no-undef": 1 }, @@ -1500,7 +1500,7 @@ describe("verify", function () { ); }); - it("decorator does not create TypeError #229", function () { + it("decorator does not create TypeError #229", () => { verifyAndAssertMessages( unpad(` class A { @@ -1513,7 +1513,7 @@ describe("verify", function () { ); }); - it("Flow definition does not trigger warnings #223", function () { + it("Flow definition does not trigger warnings #223", () => { verifyAndAssertMessages( unpad(` import { Map as $Map } from 'immutable'; @@ -1524,7 +1524,7 @@ describe("verify", function () { ); }); - it("newline-before-return with comments #289", function () { + it("newline-before-return with comments #289", () => { verifyAndAssertMessages( unpad(` function a() { @@ -1542,7 +1542,7 @@ describe("verify", function () { ); }); - it("spaced-comment with shebang #163", function () { + it("spaced-comment with shebang #163", () => { verifyAndAssertMessages( unpad(` #!/usr/bin/env babel-node @@ -1553,8 +1553,8 @@ describe("verify", function () { ); }); - describe("Class Property Declarations", function() { - it("no-redeclare false positive 1", function() { + describe("Class Property Declarations", () => { + it("no-redeclare false positive 1", () => { verifyAndAssertMessages( unpad(` class Group { @@ -1569,7 +1569,7 @@ describe("verify", function () { ); }); - it("no-redeclare false positive 2", function() { + it("no-redeclare false positive 2", () => { verifyAndAssertMessages( unpad(` function validate() {} @@ -1582,7 +1582,7 @@ describe("verify", function () { ); }); - it("check references", function() { + it("check references", () => { verifyAndAssertMessages( unpad(` var a; @@ -1601,7 +1601,7 @@ describe("verify", function () { }); }); - it("dynamic import support", function () { + it("dynamic import support", () => { verifyAndAssertMessages( "import('test-module').then(() => {})", {}, From 4f4d229e0ad8fe04f1e91e9066ab0d708914e946 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 15 Jan 2017 06:59:51 -0500 Subject: [PATCH 558/965] chore(package): update eslint-config-babel to version 6.0.0 (babel/babel-eslint#433) * chore(package): update eslint-config-babel to version 6.0.0 Closes babel/babel-eslint#432 https://greenkeeper.io/ * Fix linting --- eslint/babel-eslint-parser/.gitignore | 1 - eslint/babel-eslint-parser/package.json | 2 +- .../babel-eslint-parser/test/babel-eslint.js | 4 +- .../test/non-regression.js | 2 +- eslint/babel-eslint-parser/yarn.lock | 1013 +++++++++++++++++ 5 files changed, 1017 insertions(+), 5 deletions(-) create mode 100644 eslint/babel-eslint-parser/yarn.lock diff --git a/eslint/babel-eslint-parser/.gitignore b/eslint/babel-eslint-parser/.gitignore index 2d6ddb5d003c..93f136199161 100644 --- a/eslint/babel-eslint-parser/.gitignore +++ b/eslint/babel-eslint-parser/.gitignore @@ -1,3 +1,2 @@ node_modules npm-debug.log -yarn.lock diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a9ba5345a5a1..5c616f90f196 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -40,7 +40,7 @@ "devDependencies": { "babel-eslint": "^7.0.0", "eslint": "^3.9.1", - "eslint-config-babel": "^4.0.0", + "eslint-config-babel": "^6.0.0", "eslint-plugin-babel": "^4.0.0", "eslint-plugin-flowtype": "^2.4.0", "espree": "^3.3.1", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 62463f443ac9..41586c097fac 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -73,9 +73,9 @@ function parseAndAssertSame(code) { } err.message += unpad(` espree: - ${util.inspect(lookup(esAST, traversal, 2), {depth: err.depth, colors: true})} + ${util.inspect(lookup(esAST, traversal, 2), { depth: err.depth, colors: true })} babel-eslint: - ${util.inspect(lookup(babylonAST, traversal, 2), {depth: err.depth, colors: true})} + ${util.inspect(lookup(babylonAST, traversal, 2), { depth: err.depth, colors: true })} `); throw err; } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 52f30bc7fd2c..ee8c03a98740 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1359,7 +1359,7 @@ describe("verify", () => { set a (v) { } } `), - { "space-before-function-paren": 1, "keyword-spacing": [1, {"before": true}], "indent": 1 }, + { "space-before-function-paren": 1, "keyword-spacing": [1, { "before": true }], "indent": 1 }, [] ); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock new file mode 100644 index 000000000000..5cfc9dbadfc0 --- /dev/null +++ b/eslint/babel-eslint-parser/yarn.lock @@ -0,0 +1,1013 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^4.0.1: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + +ajv-keywords@^1.0.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c" + +ajv@^4.7.0: + version "4.10.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254" + dependencies: + co "^4.6.0" + json-stable-stringify "^1.0.1" + +ansi-escapes@^1.1.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +babel-code-frame@^6.16.0, babel-code-frame@^6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^2.0.0" + +babel-eslint@^7.0.0: + version "7.1.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" + dependencies: + babel-code-frame "^6.16.0" + babel-traverse "^6.15.0" + babel-types "^6.15.0" + babylon "^6.13.0" + lodash.pickby "^4.6.0" + +babel-messages@^6.8.0: + version "6.8.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" + dependencies: + babel-runtime "^6.0.0" + +babel-runtime@^6.0.0, babel-runtime@^6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-traverse@^6.15.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" + dependencies: + babel-code-frame "^6.20.0" + babel-messages "^6.8.0" + babel-runtime "^6.20.0" + babel-types "^6.21.0" + babylon "^6.11.0" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.15.0, babel-types@^6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" + dependencies: + babel-runtime "^6.20.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.11.0, babylon@^6.13.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + +brace-expansion@^1.0.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +circular-json@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + +cli-cursor@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" + dependencies: + restore-cursor "^1.0.1" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.4.6: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +d@^0.1.1, d@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" + dependencies: + es5-ext "~0.10.2" + +debug@2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +debug@^2.1.1, debug@^2.2.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +diff@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" + +doctrine@^1.2.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: + version "0.10.12" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" + dependencies: + es6-iterator "2" + es6-symbol "~3.1" + +es6-iterator@2: + version "2.0.0" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" + dependencies: + d "^0.1.1" + es5-ext "^0.10.7" + es6-symbol "3" + +es6-map@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + es6-iterator "2" + es6-set "~0.1.3" + es6-symbol "~3.1.0" + event-emitter "~0.3.4" + +es6-set@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + es6-iterator "2" + es6-symbol "3" + event-emitter "~0.3.4" + +es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" + dependencies: + d "~0.1.1" + es5-ext "~0.10.11" + +es6-weak-map@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + dependencies: + d "^0.1.1" + es5-ext "^0.10.8" + es6-iterator "2" + es6-symbol "3" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +escope@^3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" + dependencies: + es6-map "^0.1.3" + es6-weak-map "^2.0.1" + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-config-babel@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" + +eslint-plugin-babel@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.0.0.tgz#a92114e2c493ac3034b030d7ecf96e174a76ef3f" + +eslint-plugin-flowtype@^2.4.0: + version "2.29.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.29.2.tgz#91b4fde0400c4c37ca4440b43bdbc95fc405bea9" + dependencies: + lodash "^4.15.0" + +eslint@^3.9.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" + dependencies: + babel-code-frame "^6.16.0" + chalk "^1.1.3" + concat-stream "^1.4.6" + debug "^2.1.1" + doctrine "^1.2.2" + escope "^3.6.0" + espree "^3.3.1" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + glob "^7.0.3" + globals "^9.14.0" + ignore "^3.2.0" + imurmurhash "^0.1.4" + inquirer "^0.12.0" + is-my-json-valid "^2.10.0" + is-resolvable "^1.0.0" + js-yaml "^3.5.1" + json-stable-stringify "^1.0.0" + levn "^0.3.0" + lodash "^4.0.0" + mkdirp "^0.5.0" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.1" + pluralize "^1.2.1" + progress "^1.1.8" + require-uncached "^1.0.2" + shelljs "^0.7.5" + strip-bom "^3.0.0" + strip-json-comments "~2.0.1" + table "^3.7.8" + text-table "~0.2.0" + user-home "^2.0.0" + +espree@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" + dependencies: + acorn "^4.0.1" + acorn-jsx "^3.0.0" + +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + +esrecurse@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + dependencies: + estraverse "~4.1.0" + object-assign "^4.0.1" + +estraverse@^4.1.1, estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +estraverse@~4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +event-emitter@~0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" + dependencies: + d "~0.1.1" + es5-ext "~0.10.7" + +exit-hook@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^1.3.5: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +glob@7.0.5: + version "7.0.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.0.0, globals@^9.14.0: + version "9.14.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +ignore@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inquirer@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" + dependencies: + ansi-escapes "^1.1.0" + ansi-regex "^2.0.0" + chalk "^1.0.0" + cli-cursor "^1.0.1" + cli-width "^2.0.0" + figures "^1.3.5" + lodash "^4.3.0" + readline2 "^1.0.1" + run-async "^0.1.0" + rx-lite "^3.1.2" + string-width "^1.0.1" + strip-ansi "^3.0.0" + through "^2.3.6" + +interpret@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-my-json-valid@^2.10.0: + version "2.15.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +js-tokens@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" + +js-yaml@^3.5.1: + version "3.7.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + +json3@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + +jsonpointer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" + dependencies: + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash.pickby@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" + +lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +loose-envify@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" + dependencies: + js-tokens "^2.0.0" + +minimatch@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.2.0" + diff "1.4.0" + escape-string-regexp "1.0.5" + glob "7.0.5" + growl "1.9.2" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +ms@0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + +mute-stream@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pluralize@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^1.1.8: + version "1.1.8" + resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" + +readable-stream@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +readline2@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + mute-stream "0.0.5" + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + dependencies: + resolve "^1.1.6" + +regenerator-runtime@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + +require-uncached@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +resolve@^1.1.6: + version "1.2.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" + +restore-cursor@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" + dependencies: + exit-hook "^1.0.0" + onetime "^1.0.0" + +rimraf@^2.2.8: + version "2.5.4" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + dependencies: + glob "^7.0.5" + +run-async@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" + dependencies: + once "^1.3.0" + +rx-lite@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" + +shelljs@^0.7.5: + version "0.7.6" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +slice-ansi@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +string-width@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^3.0.0" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +table@^3.7.8: + version "3.8.3" + resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" + dependencies: + ajv "^4.7.0" + ajv-keywords "^1.0.0" + chalk "^1.1.1" + lodash "^4.0.0" + slice-ansi "0.0.4" + string-width "^2.0.0" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +to-fast-properties@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +user-home@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" + dependencies: + os-homedir "^1.0.0" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +xtend@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From ad8a7e78e155a9cfe4f74f3f30560dafbb238a2c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 23:39:49 -0500 Subject: [PATCH 559/965] update readme [skip ci] --- eslint/babel-eslint-parser/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 1e38efd27d8d..ab69d9ebc0d7 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -3,9 +3,11 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -#### Note: You don't need to use babel-eslint if you are using ES2015 (ES6), ES2016 (ES7) or ES2017 (ES8). ESLint actually supports ES2015/ES2016/ES2017, JSX, and object rest/spread by default now. +### Why Use babel-eslint -##### At the moment, you'll need it if you use stuff like class properties, decorators, types. +You only need to use babel-eslint if you are using types (Flow) or experimental features not supported in ESLint itself yet. Otherwise try the default parser (you don't have to use it just because you are using Babel). + +--- > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! @@ -43,21 +45,19 @@ It just needs to export a `parse` method that takes in a string of code and outp ## Usage +> ESLint 1.x | Use <= 5.x + +> ESLint 2.x | Use >= 6.x + ### Supported ESLint versions ESLint | babel-eslint ------------ | ------------- -1.x | <= 5.x -2.x | >= 6.x 3.x | >= 6.x ### Install ```sh -$ npm install eslint@1.x babel-eslint@5 --save-dev - -$ npm install eslint@2.x babel-eslint@6 --save-dev - $ npm install eslint@3.x babel-eslint@6 --save-dev ``` From b3c41bd5d7024412730b369820a59a5669549379 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 28 Feb 2017 23:41:03 -0500 Subject: [PATCH 560/965] remove deprecated rule examples [skip ci] --- eslint/babel-eslint-parser/README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ab69d9ebc0d7..ff6e41a5fb6a 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -29,9 +29,7 @@ Modules/strict mode Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues - `no-unused-vars` with jsx -Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues such as (and more): -- `generator-star` with async/await functions [#78](https://github.com/babel/babel-eslint/issues/78) -- `object-shorthand` with spread operator [#131](https://github.com/babel/babel-eslint/issues/131) +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues ## How does it work? From dccd5a75931ce0091a61e71338b82f670b08cb81 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 20 Mar 2017 11:44:33 -0400 Subject: [PATCH 561/965] Merge pull request babel/babel-eslint#447 from kaicataldo/clean-up-eslint Chore: Clean up and upgrades --- eslint/babel-eslint-parser/.eslintrc.js | 4 - eslint/babel-eslint-parser/eslint | 1 - eslint/babel-eslint-parser/eslint-tester.js | 6 - eslint/babel-eslint-parser/package.json | 17 +- eslint/babel-eslint-parser/yarn.lock | 283 ++++++++++---------- 5 files changed, 153 insertions(+), 158 deletions(-) delete mode 160000 eslint/babel-eslint-parser/eslint delete mode 100644 eslint/babel-eslint-parser/eslint-tester.js diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js index 1f91933ff5b4..20f31f1eebd5 100644 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -1,10 +1,6 @@ module.exports = { root: true, extends: "babel", - parserOptions: { - ecmaVersion: 7, - sourceType: "module" - }, rules: { "no-var": 0, "max-len": 0 diff --git a/eslint/babel-eslint-parser/eslint b/eslint/babel-eslint-parser/eslint deleted file mode 160000 index fdce86d24e30..000000000000 --- a/eslint/babel-eslint-parser/eslint +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fdce86d24e30a31c0c819262b72ab6b454cb552a diff --git a/eslint/babel-eslint-parser/eslint-tester.js b/eslint/babel-eslint-parser/eslint-tester.js deleted file mode 100644 index 905a625d4689..000000000000 --- a/eslint/babel-eslint-parser/eslint-tester.js +++ /dev/null @@ -1,6 +0,0 @@ -var ESLintTester = require("./eslint").RuleTester; - -console.log("Use babel-eslint for test suite"); -ESLintTester.setDefaultConfig({ - parser: "../../index" -}); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5c616f90f196..9babfabaa49a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,15 +12,13 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "^6.16.0", - "babel-traverse": "^6.15.0", - "babel-types": "^6.15.0", - "babylon": "^6.13.0", + "babel-code-frame": "^6.22.0", + "babel-traverse": "^6.23.1", + "babel-types": "^6.23.0", + "babylon": "^6.16.1", "lodash.pickby": "^4.6.0" }, "scripts": { - "bootstrap": "git submodule update --init && cd eslint && npm install", - "eslint": "cd eslint && mocha -c tests/lib/rules/*.js -r ../eslint-tester.js", "test": "npm run lint && npm run test-only", "test-only": "mocha", "lint": "eslint index.js babylon-to-espree test", @@ -39,11 +37,10 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "babel-eslint": "^7.0.0", - "eslint": "^3.9.1", + "eslint": "^3.18.0", "eslint-config-babel": "^6.0.0", - "eslint-plugin-babel": "^4.0.0", - "eslint-plugin-flowtype": "^2.4.0", - "espree": "^3.3.1", + "eslint-plugin-flowtype": "^2.30.3", + "espree": "^3.4.0", "mocha": "^3.0.0" } } diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 5cfc9dbadfc0..b17637e81f20 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -8,21 +8,21 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn@4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.1: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - ajv-keywords@^1.0.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c" + version "1.5.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0: - version "4.10.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254" + version "4.11.5" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" @@ -59,13 +59,13 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -babel-code-frame@^6.16.0, babel-code-frame@^6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26" +babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: chalk "^1.1.0" esutils "^2.0.2" - js-tokens "^2.0.0" + js-tokens "^3.0.0" babel-eslint@^7.0.0: version "7.1.1" @@ -77,45 +77,45 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" -babel-messages@^6.8.0: - version "6.8.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.8.0.tgz#bf504736ca967e6d65ef0adb5a2a5f947c8e0eb9" +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" dependencies: - babel-runtime "^6.0.0" + babel-runtime "^6.22.0" -babel-runtime@^6.0.0, babel-runtime@^6.20.0: - version "6.20.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.20.0.tgz#87300bdcf4cd770f09bf0048c64204e17806d16f" +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-traverse@^6.15.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.21.0.tgz#69c6365804f1a4f69eb1213f85b00a818b8c21ad" +babel-traverse@^6.15.0, babel-traverse@^6.23.1: + version "6.23.1" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: - babel-code-frame "^6.20.0" - babel-messages "^6.8.0" - babel-runtime "^6.20.0" - babel-types "^6.21.0" - babylon "^6.11.0" + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.23.0" + babylon "^6.15.0" debug "^2.2.0" globals "^9.0.0" invariant "^2.2.0" lodash "^4.2.0" -babel-types@^6.15.0, babel-types@^6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.21.0.tgz#314b92168891ef6d3806b7f7a917fdf87c11a4b2" +babel-types@^6.15.0, babel-types@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" dependencies: - babel-runtime "^6.20.0" + babel-runtime "^6.22.0" esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.11.0, babylon@^6.13.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" +babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: + version "6.16.1" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" balanced-match@^0.4.1: version "0.4.2" @@ -188,7 +188,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.4.6: +concat-stream@^1.5.2: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -204,11 +204,11 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -d@^0.1.1, d@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/d/-/d-0.1.1.tgz#da184c535d18d8ee7ba2aa229b914009fae11309" +d@1: + version "1.0.0" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" dependencies: - es5-ext "~0.10.2" + es5-ext "^0.10.9" debug@2.2.0: version "2.2.0" @@ -217,8 +217,8 @@ debug@2.2.0: ms "0.7.1" debug@^2.1.1, debug@^2.2.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + version "2.6.3" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" dependencies: ms "0.7.2" @@ -242,64 +242,64 @@ diff@1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" -doctrine@^1.2.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" +doctrine@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" dependencies: esutils "^2.0.2" isarray "^1.0.0" -es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7: - version "0.10.12" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047" +es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: + version "0.10.14" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" dependencies: es6-iterator "2" es6-symbol "~3.1" -es6-iterator@2: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.0.tgz#bd968567d61635e33c0b80727613c9cb4b096bac" +es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" dependencies: - d "^0.1.1" - es5-ext "^0.10.7" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-symbol "^3.1" es6-map@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.4.tgz#a34b147be224773a4d7da8072794cefa3632b897" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-set "~0.1.3" - es6-symbol "~3.1.0" - event-emitter "~0.3.4" - -es6-set@~0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.4.tgz#9516b6761c2964b92ff479456233a247dc707ce8" - dependencies: - d "~0.1.1" - es5-ext "~0.10.11" - es6-iterator "2" - es6-symbol "3" - event-emitter "~0.3.4" - -es6-symbol@3, es6-symbol@~3.1, es6-symbol@~3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.0.tgz#94481c655e7a7cad82eba832d97d5433496d7ffa" + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" dependencies: - d "~0.1.1" - es5-ext "~0.10.11" + d "1" + es5-ext "~0.10.14" es6-weak-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.1.tgz#0d2bbd8827eb5fb4ba8f97fbfea50d43db21ea81" + version "2.0.2" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" dependencies: - d "^0.1.1" - es5-ext "^0.10.8" - es6-iterator "2" - es6-symbol "3" + d "1" + es5-ext "^0.10.14" + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" @@ -318,27 +318,24 @@ eslint-config-babel@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" -eslint-plugin-babel@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-4.0.0.tgz#a92114e2c493ac3034b030d7ecf96e174a76ef3f" - -eslint-plugin-flowtype@^2.4.0: - version "2.29.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.29.2.tgz#91b4fde0400c4c37ca4440b43bdbc95fc405bea9" +eslint-plugin-flowtype@^2.30.3: + version "2.30.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.3.tgz#57835d2c0ed388da7a2725803ec32af2f437c301" dependencies: lodash "^4.15.0" -eslint@^3.9.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.13.1.tgz#564d2646b5efded85df96985332edd91a23bff25" +eslint@^3.18.0: + version "3.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" dependencies: babel-code-frame "^6.16.0" chalk "^1.1.3" - concat-stream "^1.4.6" + concat-stream "^1.5.2" debug "^2.1.1" - doctrine "^1.2.2" + doctrine "^2.0.0" escope "^3.6.0" - espree "^3.3.1" + espree "^3.4.0" + esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" @@ -367,16 +364,22 @@ eslint@^3.9.1: text-table "~0.2.0" user-home "^2.0.0" -espree@^3.3.1: - version "3.3.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.3.2.tgz#dbf3fadeb4ecb4d4778303e50103b3d36c88b89c" +espree@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" dependencies: - acorn "^4.0.1" + acorn "4.0.4" acorn-jsx "^3.0.0" -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" +esprima@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" esrecurse@^4.1.0: version "4.1.0" @@ -385,7 +388,7 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" -estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -397,12 +400,12 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.4: - version "0.3.4" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.4.tgz#8d63ddfb4cfe1fae3b32ca265c4c720222080bb5" +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" dependencies: - d "~0.1.1" - es5-ext "~0.10.7" + d "1" + es5-ext "~0.10.14" exit-hook@^1.0.0: version "1.1.1" @@ -472,8 +475,8 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: path-is-absolute "^1.0.0" globals@^9.0.0, globals@^9.14.0: - version "9.14.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034" + version "9.16.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" globby@^5.0.0: version "5.0.0" @@ -509,8 +512,8 @@ has-flag@^1.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" ignore@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435" + version "3.2.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" imurmurhash@^0.1.4: version "0.1.4" @@ -566,8 +569,8 @@ is-fullwidth-code-point@^2.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" is-my-json-valid@^2.10.0: - version "2.15.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" + version "2.16.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: generate-function "^2.0.0" generate-object-property "^1.1.0" @@ -604,16 +607,16 @@ isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" -js-tokens@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5" +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.5.1: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" + version "3.8.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" dependencies: argparse "^1.0.7" - esprima "^2.6.0" + esprima "^3.1.1" json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" @@ -696,10 +699,10 @@ lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" loose-envify@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.0.tgz#6b26248c42f6d4fa4b0d8542f78edfcde35642a8" + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: - js-tokens "^2.0.0" + js-tokens "^3.0.0" minimatch@^3.0.2: version "3.0.3" @@ -754,8 +757,8 @@ number-is-nan@^1.0.0: resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" once@^1.3.0: version "1.4.0" @@ -790,6 +793,10 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -821,8 +828,8 @@ progress@^1.1.8: resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" readable-stream@^2.2.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.2.tgz#a9e6fec3c7dda85f8bb1b3ba7028604556fc825e" + version "2.2.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" dependencies: buffer-shims "^1.0.0" core-util-is "~1.0.0" @@ -847,8 +854,8 @@ rechoir@^0.6.2: resolve "^1.1.6" regenerator-runtime@^0.10.0: - version "0.10.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb" + version "0.10.3" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" require-uncached@^1.0.2: version "1.0.3" @@ -862,8 +869,10 @@ resolve-from@^1.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" resolve@^1.1.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" + version "1.3.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" + dependencies: + path-parse "^1.0.5" restore-cursor@^1.0.1: version "1.0.1" @@ -873,8 +882,8 @@ restore-cursor@^1.0.1: onetime "^1.0.0" rimraf@^2.2.8: - version "2.5.4" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" @@ -889,8 +898,8 @@ rx-lite@^3.1.2: resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" shelljs@^0.7.5: - version "0.7.6" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad" + version "0.7.7" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" dependencies: glob "^7.0.0" interpret "^1.0.0" From 2bee348c9afe9bda68d2b96a76b9b59d7a8e9533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Couto?= Date: Mon, 20 Mar 2017 21:45:11 +0000 Subject: [PATCH 562/965] Add option to disable code frame. (babel/babel-eslint#446) * Add option to disable code hightlight. * Rename codeHighlight with codeFrame * Add codeFrame tests * Remove colors from test assertions --- eslint/babel-eslint-parser/index.js | 19 +++++--- .../test/fixtures/rules/syntax-error.js | 6 +++ .../babel-eslint-parser/test/integration.js | 48 +++++++++++++++++++ 3 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 eslint/babel-eslint-parser/test/fixtures/rules/syntax-error.js diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 7b742494589b..22e791b371c3 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -366,6 +366,7 @@ exports.parse = function (code, options) { exports.parseNoPatch = function (code, options) { var opts = { + codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, sourceType: options.sourceType, allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, @@ -394,14 +395,20 @@ exports.parseNoPatch = function (code, options) { ast = parse(code, opts); } catch (err) { if (err instanceof SyntaxError) { + err.lineNumber = err.loc.line; - err.column = err.loc.column + 1; + err.column = err.loc.column; + + if (opts.codeFrame) { + err.lineNumber = err.loc.line; + err.column = err.loc.column + 1; - // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "") + - // add codeframe - "\n\n" + - codeFrame(code, err.lineNumber, err.column, { highlightCode: true }); + // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start + err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "") + + // add codeframe + "\n\n" + + codeFrame(code, err.lineNumber, err.column, { highlightCode: true }); + } } throw err; diff --git a/eslint/babel-eslint-parser/test/fixtures/rules/syntax-error.js b/eslint/babel-eslint-parser/test/fixtures/rules/syntax-error.js new file mode 100644 index 000000000000..6fa194a18f9e --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/rules/syntax-error.js @@ -0,0 +1,6 @@ +class ClassName { + constructor() { + + }, + aMethod() {} +} diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 2814b4c35736..c446ed342815 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -200,4 +200,52 @@ function strictSuite () { // it }); // describe + describe("When \"codeFrame\"", () => { + // Strip chalk colors, these are not relevant for the test + const stripAnsi = (str) => str.replace( + /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, + "" + ); + + it("should display codeFrame when option is absent", (done) => { + lint({ + fixture: ["syntax-error"], + eslint: baseEslintOpts + }, (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); + done(); + }); + }); + + it("should display codeFrame when option is true", (done) => { + lint({ + fixture: ["syntax-error"], + eslint: Object.assign({}, baseEslintOpts, { + parserOptions: { + codeFrame: true + } + }) + }, (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); + done(); + }); + }); + + it("should not display codeFrame when option is false", (done) => { + lint({ + fixture: ["syntax-error"], + eslint: Object.assign({}, baseEslintOpts, { + parserOptions: { + codeFrame: false + } + }) + }, (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") === -1); + done(); + }); + }); + }); } From 65413344bdf412ea62c4b77c9103f3d69266db12 Mon Sep 17 00:00:00 2001 From: Alex Rattray Date: Mon, 20 Mar 2017 14:46:07 -0700 Subject: [PATCH 563/965] [flow] Process polymorphic type bounds on functions (babel/babel-eslint#444) --- eslint/babel-eslint-parser/index.js | 13 +++++++++++++ eslint/babel-eslint-parser/test/non-regression.js | 6 +++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 22e791b371c3..3bb83811cbac 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -176,6 +176,18 @@ function monkeypatch() { } } + function visitTypeParameters(typeParameters) { + var params = typeParameters.params; + + // visit bounds on polymorphpic types, eg; `Foo` in `fn(a: T): T` + for (var i = 0; i < params.length; i++) { + var param = params[i]; + if (param.typeAnnotation) { + visitTypeAnnotation.call(this, param.typeAnnotation); + } + } + } + function checkIdentifierOrVisit(node) { if (node.typeAnnotation) { visitTypeAnnotation.call(this, node.typeAnnotation); @@ -249,6 +261,7 @@ function monkeypatch() { var typeParamScope; if (node.typeParameters) { typeParamScope = nestTypeParamScope(this.scopeManager, node); + visitTypeParameters.call(this, node.typeParameters); } if (node.returnType) { checkIdentifierOrVisit.call(this, node.returnType); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index ee8c03a98740..395a6de5fec5 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -222,13 +222,13 @@ describe("verify", () => { ); }); - it("type parameters", () => { + it("type parameter bounds", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; import type Foo2 from 'foo'; - function log(a: T1, b: T2) { return a + b; } - log(1, 2); + function log(a: T1, b: T2) { return a + b; } + log(1, 2); `), { "no-unused-vars": 1, "no-undef": 1 }, [] From d3c40a1851bc9d679e5becb4643036402f407d4a Mon Sep 17 00:00:00 2001 From: wtgtybhertgeghgtwtg Date: Mon, 20 Mar 2017 14:50:09 -0700 Subject: [PATCH 564/965] Use `lodash` instead of `lodash.pickby`. (babel/babel-eslint#435) --- eslint/babel-eslint-parser/index.js | 2 +- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/yarn.lock | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3bb83811cbac..fea9d054c0c4 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,5 +1,5 @@ var babylonToEspree = require("./babylon-to-espree"); -var pick = require("lodash.pickby"); +var pick = require("lodash").pickBy; var Module = require("module"); var path = require("path"); var parse = require("babylon").parse; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 9babfabaa49a..5996554d2c02 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -16,7 +16,7 @@ "babel-traverse": "^6.23.1", "babel-types": "^6.23.0", "babylon": "^6.16.1", - "lodash.pickby": "^4.6.0" + "lodash": "^4.17.4" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index b17637e81f20..9cb3a50a074e 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -250,8 +250,8 @@ doctrine@^2.0.0: isarray "^1.0.0" es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.14" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.14.tgz#625bc9ab9cac0f6fb9dc271525823d1800b3d360" + version "0.10.15" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" dependencies: es6-iterator "2" es6-symbol "~3.1" @@ -694,7 +694,7 @@ lodash.pickby@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" From f9b19189d78a9ac65dfff6c4a79b6264309a7551 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 20 Mar 2017 17:53:26 -0400 Subject: [PATCH 565/965] 7.2.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5996554d2c02..5909e7f994d4 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.1.1", + "version": "7.2.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 1cda9b6a802f0137f7b4b06c5336f3ba9d58d2d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Couto?= Date: Tue, 21 Mar 2017 00:11:30 +0000 Subject: [PATCH 566/965] Update README.md with codeFrame option (babel/babel-eslint#448) --- eslint/babel-eslint-parser/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ff6e41a5fb6a..fc5a54035fee 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -78,6 +78,7 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. `allowImportExportEverywhere` can be set to true to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. By default, import and export declarations can only appear at a program's top level. +`codeFrame` can be set to false to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it. **.eslintrc** @@ -86,7 +87,8 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule "parser": "babel-eslint", "parserOptions": { "sourceType": "module", - "allowImportExportEverywhere": false + "allowImportExportEverywhere": false, + "codeFrame": false } } ``` From 371488c1028e8f02ebe0c9dffc83f9f9a9366113 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Wed, 22 Mar 2017 22:34:13 -0400 Subject: [PATCH 567/965] Format non-regression errors for legibility (babel/babel-eslint#451) --- eslint/babel-eslint-parser/test/non-regression.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 395a6de5fec5..ba83722a39bd 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -31,7 +31,7 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over var messages = eslint.linter.verify(code, config); if (messages.length !== expectedMessages.length) { - throw new Error(`Expected ${expectedMessages.length} message(s), got ${messages.length} ${JSON.stringify(messages)}`); + throw new Error(`Expected ${expectedMessages.length} message(s), got ${messages.length}\n${JSON.stringify(messages, null, 2)}`); } messages.forEach((message, i) => { From 700f62e28e8e3d2cdae49b4f1dc956e806a79306 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Wed, 22 Mar 2017 22:35:31 -0400 Subject: [PATCH 568/965] Remove lodash dependency (babel/babel-eslint#450) --- eslint/babel-eslint-parser/index.js | 30 ++++++++++++++----------- eslint/babel-eslint-parser/package.json | 3 +-- eslint/babel-eslint-parser/yarn.lock | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index fea9d054c0c4..39b6142a4e8b 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,5 +1,4 @@ var babylonToEspree = require("./babylon-to-espree"); -var pick = require("lodash").pickBy; var Module = require("module"); var path = require("path"); var parse = require("babylon").parse; @@ -100,18 +99,23 @@ function monkeypatch() { } // iterate through part of t.VISITOR_KEYS - var visitorKeysMap = pick(t.VISITOR_KEYS, (k) => { - return t.FLIPPED_ALIAS_KEYS.Flow.concat([ - "ArrayPattern", - "ClassDeclaration", - "ClassExpression", - "FunctionDeclaration", - "FunctionExpression", - "Identifier", - "ObjectPattern", - "RestElement" - ]).indexOf(k) === -1; - }); + var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ + "ArrayPattern", + "ClassDeclaration", + "ClassExpression", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "ObjectPattern", + "RestElement" + ]); + var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { + var value = t.VISITOR_KEYS[key]; + if (flowFlippedAliasKeys.indexOf(value) === -1) { + acc[key] = value; + } + return acc; + }, {}); var propertyTypes = { // loops diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5909e7f994d4..64fff599ac9d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,8 +15,7 @@ "babel-code-frame": "^6.22.0", "babel-traverse": "^6.23.1", "babel-types": "^6.23.0", - "babylon": "^6.16.1", - "lodash": "^4.17.4" + "babylon": "^6.16.1" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 9cb3a50a074e..afb72f464ba9 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -694,7 +694,7 @@ lodash.pickby@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" From 1c5400a67097a2aa38cac1169762a073a887df2f Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Thu, 23 Mar 2017 12:49:19 -0400 Subject: [PATCH 569/965] Fix type param and interface declaration scoping (babel/babel-eslint#449) --- eslint/babel-eslint-parser/index.js | 40 +++++++----- .../test/non-regression.js | 63 ++++++++++++++++++- 2 files changed, 83 insertions(+), 20 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 39b6142a4e8b..8d05f794a4bb 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -180,18 +180,6 @@ function monkeypatch() { } } - function visitTypeParameters(typeParameters) { - var params = typeParameters.params; - - // visit bounds on polymorphpic types, eg; `Foo` in `fn(a: T): T` - for (var i = 0; i < params.length; i++) { - var param = params[i]; - if (param.typeAnnotation) { - visitTypeAnnotation.call(this, param.typeAnnotation); - } - } - } - function checkIdentifierOrVisit(node) { if (node.typeAnnotation) { visitTypeAnnotation.call(this, node.typeAnnotation); @@ -209,6 +197,9 @@ function monkeypatch() { for (var j = 0; j < node.typeParameters.params.length; j++) { var name = node.typeParameters.params[j]; scope.__define(name, new Definition("TypeParameter", name, name)); + if (name.typeAnnotation) { + checkIdentifierOrVisit.call(this, name); + } } scope.__define = function() { return parentScope.__define.apply(parentScope, arguments); @@ -222,7 +213,7 @@ function monkeypatch() { visitDecorators.call(this, node); var typeParamScope; if (node.typeParameters) { - typeParamScope = nestTypeParamScope(this.scopeManager, node); + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); } // visit flow type: ClassImplements if (node.implements) { @@ -264,8 +255,7 @@ function monkeypatch() { referencer.prototype.visitFunction = function(node) { var typeParamScope; if (node.typeParameters) { - typeParamScope = nestTypeParamScope(this.scopeManager, node); - visitTypeParameters.call(this, node.typeParameters); + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); } if (node.returnType) { checkIdentifierOrVisit.call(this, node.returnType); @@ -328,11 +318,27 @@ function monkeypatch() { ); } + referencer.prototype.InterfaceDeclaration = function(node) { + createScopeVariable.call(this, node, node.id); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + // TODO: Handle mixins + for (var i = 0; i < node.extends.length; i++) { + visitTypeAnnotation.call(this, node.extends[i]); + } + visitTypeAnnotation.call(this, node.body); + if (typeParamScope) { + this.close(node); + } + }; + referencer.prototype.TypeAlias = function(node) { createScopeVariable.call(this, node, node.id); var typeParamScope; if (node.typeParameters) { - typeParamScope = nestTypeParamScope(this.scopeManager, node); + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); } if (node.right) { visitTypeAnnotation.call(this, node.right); @@ -352,7 +358,7 @@ function monkeypatch() { var typeParamScope; if (node.typeParameters) { - typeParamScope = nestTypeParamScope(this.scopeManager, node); + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); } if (typeParamScope) { this.close(node); diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index ba83722a39bd..107802ce508a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -222,16 +222,73 @@ describe("verify", () => { ); }); - it("type parameter bounds", () => { + it("interface declaration", () => { + verifyAndAssertMessages( + unpad(` + interface Foo {}; + interface Bar { + foo: Foo, + }; + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "2:11 'Bar' is defined but never used. no-unused-vars" ] + ); + }); + + it("type parameter bounds (classes)", () => { + verifyAndAssertMessages( + unpad(` + import type {Foo, Foo2} from 'foo'; + import Base from 'base'; + class Log extends Base { + messages: {[T1]: T2}; + } + new Log(); + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "3:34 'T4' is defined but never used. no-unused-vars" ] + ); + }); + + it("type parameter bounds (interfaces)", () => { + verifyAndAssertMessages( + unpad(` + import type {Foo, Foo2, Bar} from ''; + interface Log extends Bar { + messages: {[T1]: T2}; + } + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "2:11 'Log' is defined but never used. no-unused-vars", + "2:38 'T4' is defined but never used. no-unused-vars" ] + ); + }); + + it("type parameter bounds (type aliases)", () => { + verifyAndAssertMessages( + unpad(` + import type {Foo, Foo2, Foo3} from 'foo'; + type Log = { + messages: {[T1]: T2}; + delay: Foo3; + }; + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "2:6 'Log' is defined but never used. no-unused-vars", + "2:29 'T3' is defined but never used. no-unused-vars" ] + ); + }); + + it("type parameter bounds (functions)", () => { verifyAndAssertMessages( unpad(` import type Foo from 'foo'; import type Foo2 from 'foo'; - function log(a: T1, b: T2) { return a + b; } + function log(a: T1, b: T2): T3 { return a + b; } log(1, 2); `), { "no-unused-vars": 1, "no-undef": 1 }, - [] + [ "3:37 'T4' is defined but never used. no-unused-vars" ] ); }); From 26daac869032b3dd6f8b4c088a8f62e72d33a3f4 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Thu, 23 Mar 2017 14:02:24 -0400 Subject: [PATCH 570/965] Remove left over eslint 2 estraverse code (babel/babel-eslint#452) This was missed in babel/babel-eslint#361 --- eslint/babel-eslint-parser/index.js | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 8d05f794a4bb..3b243cc81cd2 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -36,17 +36,12 @@ function monkeypatch() { // get modules relative to what eslint will load var eslintMod = createModule(eslintLoc); - // contains all the instances of estraverse so we can modify them if necessary - var estraverses = []; // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 - var estraverseOfEslint = eslintMod.require("estraverse"); - estraverses.push(estraverseOfEslint); - Object.assign(estraverseOfEslint.VisitorKeys, t.VISITOR_KEYS); + var estraverse = eslintMod.require("estraverse"); - estraverses.forEach((estraverse) => { - estraverse.VisitorKeys.MethodDefinition.push("decorators"); - estraverse.VisitorKeys.Property.push("decorators"); - }); + Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); + estraverse.VisitorKeys.MethodDefinition.push("decorators"); + estraverse.VisitorKeys.Property.push("decorators"); // monkeypatch escope var escopeLoc = Module._resolveFilename("escope", eslintMod); @@ -275,16 +270,12 @@ function monkeypatch() { } // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise // escope will traverse into them and include the identifiers within as declarations - estraverses.forEach((estraverse) => { - estraverse.VisitorKeys.ObjectPattern = ["properties"]; - estraverse.VisitorKeys.ArrayPattern = ["elements"]; - }); + estraverse.VisitorKeys.ObjectPattern = ["properties"]; + estraverse.VisitorKeys.ArrayPattern = ["elements"]; visitFunction.call(this, node); // set them back to normal... - estraverses.forEach((estraverse) => { - estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; - estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; - }); + estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; + estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; if (typeParamScope) { this.close(node); } From e8b91f88629fb4cdbf706b3e362431e61cb9a88b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 23 Mar 2017 14:03:23 -0400 Subject: [PATCH 571/965] 7.2.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 64fff599ac9d..4b3acc0a53e1 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.2.0", + "version": "7.2.1", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 2ca65d5451afcefac451b68e58ff1e898c428c55 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Thu, 23 Mar 2017 15:46:48 -0400 Subject: [PATCH 572/965] Add type parameter scope tests (babel/babel-eslint#454) --- .../test/non-regression.js | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 107802ce508a..711aa25edd82 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -250,6 +250,21 @@ describe("verify", () => { ); }); + it("type parameter scope (classes)", () => { + verifyAndAssertMessages( + unpad(` + T; + class Foo {} + T; + new Foo(); + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "1:1 'T' is not defined. no-undef", + "2:11 'T' is defined but never used. no-unused-vars", + "3:1 'T' is not defined. no-undef" ] + ); + }); + it("type parameter bounds (interfaces)", () => { verifyAndAssertMessages( unpad(` @@ -264,6 +279,21 @@ describe("verify", () => { ); }); + it("type parameter scope (interfaces)", () => { + verifyAndAssertMessages( + unpad(` + T; + interface Foo {}; + T; + Foo; + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "1:1 'T' is not defined. no-undef", + "2:15 'T' is defined but never used. no-unused-vars", + "3:1 'T' is not defined. no-undef" ] + ); + }); + it("type parameter bounds (type aliases)", () => { verifyAndAssertMessages( unpad(` @@ -279,6 +309,21 @@ describe("verify", () => { ); }); + it("type parameter scope (type aliases)", () => { + verifyAndAssertMessages( + unpad(` + T; + type Foo = {}; + T; + Foo; + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "1:1 'T' is not defined. no-undef", + "2:10 'T' is defined but never used. no-unused-vars", + "3:1 'T' is not defined. no-undef" ] + ); + }); + it("type parameter bounds (functions)", () => { verifyAndAssertMessages( unpad(` @@ -292,6 +337,21 @@ describe("verify", () => { ); }); + it("type parameter scope (functions)", () => { + verifyAndAssertMessages( + unpad(` + T; + function log() {} + T; + log; + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [ "1:1 'T' is not defined. no-undef", + "2:14 'T' is defined but never used. no-unused-vars", + "3:1 'T' is not defined. no-undef" ] + ); + }); + it("nested type annotations", () => { verifyAndAssertMessages( unpad(` From 711c1e2f4b9c437a57a832894cb4f2d07cfc5a70 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 25 Mar 2017 19:15:23 -0400 Subject: [PATCH 573/965] Merge pull request babel/babel-eslint#455 from babel/babylon-to-espree-tidy Tidy up babylon-to-espree --- .../babylon-to-espree/attachComments.js | 2 + .../babylon-to-espree/convertComments.js | 17 ++++ .../babylon-to-espree/convertTemplateType.js | 2 + .../babylon-to-espree/index.js | 54 +++++++---- .../babylon-to-espree/toAST.js | 92 ++++++++----------- .../babylon-to-espree/toToken.js | 2 + .../babylon-to-espree/toTokens.js | 13 ++- eslint/babel-eslint-parser/index.js | 28 +----- 8 files changed, 103 insertions(+), 107 deletions(-) create mode 100644 eslint/babel-eslint-parser/babylon-to-espree/convertComments.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js index 4040ce7e4e0b..9fc9f339c2b5 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js @@ -1,3 +1,5 @@ +"use strict"; + // comment fixes module.exports = function (ast, comments, tokens) { if (comments.length) { diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js new file mode 100644 index 000000000000..19c6ce8c97c7 --- /dev/null +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js @@ -0,0 +1,17 @@ +"use strict"; + +module.exports = function (comments) { + for (var i = 0; i < comments.length; i++) { + var comment = comments[i]; + if (comment.type === "CommentBlock") { + comment.type = "Block"; + } else if (comment.type === "CommentLine") { + comment.type = "Line"; + } + // sometimes comments don't get ranges computed, + // even with options.ranges === true + if (!comment.range) { + comment.range = [comment.start, comment.end]; + } + } +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js index c9537ddde0e9..8b647c39ba16 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js @@ -1,3 +1,5 @@ +"use strict"; + module.exports = function (tokens, tt) { var startingToken = 0; var currentToken = 0; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/babylon-to-espree/index.js index 401570b6b199..94e6832f3476 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/index.js @@ -1,20 +1,36 @@ -exports.attachComments = require("./attachComments"); - -exports.toTokens = require("./toTokens"); -exports.toAST = require("./toAST"); - -exports.convertComments = function (comments) { - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; - if (comment.type === "CommentBlock") { - comment.type = "Block"; - } else if (comment.type === "CommentLine") { - comment.type = "Line"; - } - // sometimes comments don't get ranges computed, - // even with options.ranges === true - if (!comment.range) { - comment.range = [comment.start, comment.end]; - } - } +"use strict"; + +var attachComments = require("./attachComments"); +var convertComments = require("./convertComments"); +var toTokens = require("./toTokens"); +var toAST = require("./toAST"); + +module.exports = function (ast, traverse, tt, code) { + // remove EOF token, eslint doesn't use this for anything and it interferes + // with some rules see https://github.com/babel/babel-eslint/issues/2 + // todo: find a more elegant way to do this + ast.tokens.pop(); + + // convert tokens + ast.tokens = toTokens(ast.tokens, tt, code); + + // add comments + convertComments(ast.comments); + + // transform esprima and acorn divergent nodes + toAST(ast, traverse, code); + + // ast.program.tokens = ast.tokens; + // ast.program.comments = ast.comments; + // ast = ast.program; + + // remove File + ast.type = "Program"; + ast.sourceType = ast.program.sourceType; + ast.directives = ast.program.directives; + ast.body = ast.program.body; + delete ast.program; + delete ast._paths; + + attachComments(ast, ast.comments, ast.tokens); }; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index c26fa5ba1173..84d77a53de41 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -1,31 +1,21 @@ -var source; +"use strict"; + +var convertComments = require("./convertComments"); module.exports = function (ast, traverse, code) { - source = code; + var state = { source: code }; ast.range = [ast.start, ast.end]; - traverse(ast, astTransformVisitor); + traverse(ast, astTransformVisitor, null, state); }; -function changeToLiteral(node) { +function changeToLiteral(node, state) { node.type = "Literal"; if (!node.raw) { if (node.extra && node.extra.raw) { node.raw = node.extra.raw; } else { - node.raw = source.slice(node.start, node.end); - } - } -} - -function changeComments(nodeComments) { - for (var i = 0; i < nodeComments.length; i++) { - var comment = nodeComments[i]; - if (comment.type === "CommentLine") { - comment.type = "Line"; - } else if (comment.type === "CommentBlock") { - comment.type = "Block"; + node.raw = state.source.slice(node.start, node.end); } - comment.range = [comment.start, comment.end]; } } @@ -45,24 +35,40 @@ var astTransformVisitor = { } if (node.trailingComments) { - changeComments(node.trailingComments); + convertComments(node.trailingComments); } if (node.leadingComments) { - changeComments(node.leadingComments); + convertComments(node.leadingComments); } // make '_paths' non-enumerable (babel-eslint #200) Object.defineProperty(node, "_paths", { value: node._paths, writable: true }); }, - exit (path) { + exit (path, state) { var node = path.node; - [ - fixDirectives, - ].forEach((fixer) => { - fixer(path); - }); + // fixDirectives + if (path.isFunction() || path.isProgram()) { + var directivesContainer = node; + var body = node.body; + if (node.type !== "Program") { + directivesContainer = body; + body = body.body; + } + if (directivesContainer.directives) { + for (var i = directivesContainer.directives.length - 1; i >= 0; i--) { + var directive = directivesContainer.directives[i]; + directive.type = "ExpressionStatement"; + directive.expression = directive.value; + delete directive.value; + directive.expression.type = "Literal"; + changeToLiteral(directive.expression, state); + body.unshift(directive); + } + delete directivesContainer.directives; + } + } if (path.isJSXText()) { node.type = "Literal"; @@ -71,7 +77,7 @@ var astTransformVisitor = { if (path.isNumericLiteral() || path.isStringLiteral()) { - changeToLiteral(node); + changeToLiteral(node, state); } if (path.isBooleanLiteral()) { @@ -104,7 +110,7 @@ var astTransformVisitor = { } if (path.isClassMethod() || path.isObjectMethod()) { - var code = source.slice(node.key.end, node.body.start); + var code = state.source.slice(node.key.end, node.body.start); var offset = code.indexOf("("); node.value = { @@ -211,7 +217,8 @@ var astTransformVisitor = { // template string range fixes if (path.isTemplateLiteral()) { - node.quasis.forEach((q) => { + for (var j = 0; j < node.quasis.length; j++) { + var q = node.quasis[j]; q.range[0] -= 1; if (q.tail) { q.range[1] += 1; @@ -224,34 +231,7 @@ var astTransformVisitor = { } else { q.loc.end.column += 2; } - }); + } } } }; - - -function fixDirectives (path) { - if (!(path.isProgram() || path.isFunction())) return; - - var node = path.node; - var directivesContainer = node; - var body = node.body; - - if (node.type !== "Program") { - directivesContainer = body; - body = body.body; - } - - if (!directivesContainer.directives) return; - - directivesContainer.directives.reverse().forEach((directive) => { - directive.type = "ExpressionStatement"; - directive.expression = directive.value; - delete directive.value; - directive.expression.type = "Literal"; - changeToLiteral(directive.expression); - body.unshift(directive); - }); - delete directivesContainer.directives; -} -// fixDirectives diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js index dcfd48f87cc1..6173f760d6eb 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js @@ -1,3 +1,5 @@ +"use strict"; + module.exports = function (token, tt, source) { var type = token.type; token.range = [token.start, token.end]; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js index 1f06d3e51567..81ec9850afa6 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js @@ -1,15 +1,18 @@ +"use strict"; + var convertTemplateType = require("./convertTemplateType"); var toToken = require("./toToken"); module.exports = function (tokens, tt, code) { // transform tokens to type "Template" convertTemplateType(tokens, tt); - var transformedTokens = tokens.filter((token) => { - return token.type !== "CommentLine" && token.type !== "CommentBlock"; - }); - for (var i = 0, l = transformedTokens.length; i < l; i++) { - transformedTokens[i] = toToken(transformedTokens[i], tt, code); + var transformedTokens = []; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (token.type !== "CommentLine" && token.type !== "CommentBlock") { + transformedTokens.push(toToken(token, tt, code)); + } } return transformedTokens; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3b243cc81cd2..b56f74e561a1 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -428,33 +428,7 @@ exports.parseNoPatch = function (code, options) { throw err; } - // remove EOF token, eslint doesn't use this for anything and it interferes with some rules - // see https://github.com/babel/babel-eslint/issues/2 for more info - // todo: find a more elegant way to do this - ast.tokens.pop(); - - // convert tokens - ast.tokens = babylonToEspree.toTokens(ast.tokens, tt, code); - - // add comments - babylonToEspree.convertComments(ast.comments); - - // transform esprima and acorn divergent nodes - babylonToEspree.toAST(ast, traverse, code); - - // ast.program.tokens = ast.tokens; - // ast.program.comments = ast.comments; - // ast = ast.program; - - // remove File - ast.type = "Program"; - ast.sourceType = ast.program.sourceType; - ast.directives = ast.program.directives; - ast.body = ast.program.body; - delete ast.program; - delete ast._paths; - - babylonToEspree.attachComments(ast, ast.comments, ast.tokens); + babylonToEspree(ast, traverse, tt, code); return ast; }; From d78b0debd7b76984ce1936e8bb329e991b371ab2 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Sat, 25 Mar 2017 19:32:05 -0400 Subject: [PATCH 574/965] Use dedent for unpadding (babel/babel-eslint#456) --- eslint/babel-eslint-parser/package.json | 1 + eslint/babel-eslint-parser/test/babel-eslint.js | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 2 +- eslint/babel-eslint-parser/utils/unpad.js | 14 -------------- eslint/babel-eslint-parser/yarn.lock | 4 ++++ 5 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 eslint/babel-eslint-parser/utils/unpad.js diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 4b3acc0a53e1..cef295c69c1d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -36,6 +36,7 @@ "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { "babel-eslint": "^7.0.0", + "dedent": "^0.7.0", "eslint": "^3.18.0", "eslint-config-babel": "^6.0.0", "eslint-plugin-flowtype": "^2.30.3", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 41586c097fac..540170df254b 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -2,7 +2,7 @@ var assert = require("assert"); var babelEslint = require(".."); var espree = require("espree"); var util = require("util"); -var unpad = require("../utils/unpad"); +var unpad = require("dedent"); // Checks if the source ast implements the target ast. Ignores extra keys on source ast function assertImplementsAST(target, source, path) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 711aa25edd82..015b0fd331a8 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1,7 +1,7 @@ /*eslint-env mocha*/ "use strict"; var eslint = require("eslint"); -var unpad = require("../utils/unpad"); +var unpad = require("dedent"); function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { var config = { diff --git a/eslint/babel-eslint-parser/utils/unpad.js b/eslint/babel-eslint-parser/utils/unpad.js deleted file mode 100644 index 63aca71efbec..000000000000 --- a/eslint/babel-eslint-parser/utils/unpad.js +++ /dev/null @@ -1,14 +0,0 @@ -// Remove padding from a string. -function unpad(str) { - const lines = str.split("\n"); - const m = lines[1] && lines[1].match(/^\s+/); - if (!m) { - return str; - } - const spaces = m[0].length; - return lines.map( - (line) => line.slice(spaces) - ).join("\n").trim(); -} - -module.exports = unpad; diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index afb72f464ba9..c81f84090b6b 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -222,6 +222,10 @@ debug@^2.1.1, debug@^2.2.0: dependencies: ms "0.7.2" +dedent@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" From 9a558bd94207ef59dbc5485b81842e9d283a5ec0 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Sat, 25 Mar 2017 19:36:10 -0400 Subject: [PATCH 575/965] Remove unused .gitmodules (babel/babel-eslint#457) --- eslint/babel-eslint-parser/.gitmodules | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 eslint/babel-eslint-parser/.gitmodules diff --git a/eslint/babel-eslint-parser/.gitmodules b/eslint/babel-eslint-parser/.gitmodules deleted file mode 100644 index e922d16a4493..000000000000 --- a/eslint/babel-eslint-parser/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "eslint"] - path = eslint - url = https://github.com/eslint/eslint From b8a3af8cd6e0f5e7b1831aedb2b07897d9a9919a Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Thu, 30 Mar 2017 13:49:51 -0400 Subject: [PATCH 576/965] Separate finding peer deps from monkeypatching (babel/babel-eslint#460) --- eslint/babel-eslint-parser/index.js | 79 ++++++++++++----------------- 1 file changed, 33 insertions(+), 46 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index b56f74e561a1..3e8e2ffae82d 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -10,21 +10,10 @@ var codeFrame = require("babel-code-frame"); var hasPatched = false; var eslintOptions = {}; -function createModule(filename) { - var mod = new Module(filename); - mod.filename = filename; - mod.paths = Module._nodeModulePaths(path.dirname(filename)); - return mod; -} - -function monkeypatch() { - if (hasPatched) return; - hasPatched = true; - - var eslintLoc; +function getModules() { try { // avoid importing a local copy of eslint, try to find a peer dependency - eslintLoc = Module._resolveFilename("eslint", module.parent); + var eslintLoc = Module._resolveFilename("eslint", module.parent); } catch (err) { try { // avoids breaking in jest where module.parent is undefined @@ -35,18 +24,35 @@ function monkeypatch() { } // get modules relative to what eslint will load - var eslintMod = createModule(eslintLoc); - // ESLint v1.9.0 uses estraverse directly to work around https://github.com/npm/npm/issues/9663 + var eslintMod = new Module(eslintLoc); + eslintMod.filename = eslintLoc; + eslintMod.paths = Module._nodeModulePaths(path.dirname(eslintLoc)); + + var Definition = eslintMod.require("escope/lib/definition").Definition; + var escope = eslintMod.require("escope"); var estraverse = eslintMod.require("estraverse"); + var referencer = eslintMod.require("escope/lib/referencer"); + + if (referencer.__esModule) referencer = referencer.default; + + return { + Definition, + escope, + estraverse, + referencer, + }; +} + +function monkeypatch(modules) { + var Definition = modules.Definition; + var escope = modules.escope; + var estraverse = modules.estraverse; + var referencer = modules.referencer; Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); estraverse.VisitorKeys.MethodDefinition.push("decorators"); estraverse.VisitorKeys.Property.push("decorators"); - // monkeypatch escope - var escopeLoc = Module._resolveFilename("escope", eslintMod); - var escopeMod = createModule(escopeLoc); - var escope = require(escopeLoc); var analyze = escope.analyze; escope.analyze = function (ast, opts) { opts.ecmaVersion = eslintOptions.ecmaVersion; @@ -59,28 +65,6 @@ function monkeypatch() { return results; }; - // monkeypatch escope/referencer - var referencerLoc; - try { - referencerLoc = Module._resolveFilename("./referencer", escopeMod); - } catch (err) { - throw new ReferenceError("couldn't resolve escope/referencer"); - } - var referencerMod = createModule(referencerLoc); - var referencer = require(referencerLoc); - if (referencer.__esModule) { - referencer = referencer.default; - } - - // reference Definition - var definitionLoc; - try { - definitionLoc = Module._resolveFilename("./definition", referencerMod); - } catch (err) { - throw new ReferenceError("couldn't resolve escope/definition"); - } - var Definition = require(definitionLoc).Definition; - // if there are decorators, then visit each function visitDecorators(node) { if (!node.decorators) { @@ -368,11 +352,14 @@ exports.parse = function (code, options) { delete eslintOptions.globalReturn; } - try { - monkeypatch(); - } catch (err) { - console.error(err.stack); - process.exit(1); + if (!hasPatched) { + hasPatched = true; + try { + monkeypatch(getModules()); + } catch (err) { + console.error(err.stack); + process.exit(1); + } } return exports.parseNoPatch(code, options); From 267731917b07e3e3f9b530ce190cf14a4227321e Mon Sep 17 00:00:00 2001 From: Vitor Balocco Date: Wed, 12 Apr 2017 17:59:23 +0200 Subject: [PATCH 577/965] Fix: use eslint-scope instead of escope if present (babel/babel-eslint#461) --- eslint/babel-eslint-parser/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 3e8e2ffae82d..0f871a90a358 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -28,10 +28,17 @@ function getModules() { eslintMod.filename = eslintLoc; eslintMod.paths = Module._nodeModulePaths(path.dirname(eslintLoc)); - var Definition = eslintMod.require("escope/lib/definition").Definition; - var escope = eslintMod.require("escope"); + try { + var escope = eslintMod.require("eslint-scope"); + var Definition = eslintMod.require("eslint-scope/lib/definition").Definition; + var referencer = eslintMod.require("eslint-scope/lib/referencer"); + } catch (err) { + escope = eslintMod.require("escope"); + Definition = eslintMod.require("escope/lib/definition").Definition; + referencer = eslintMod.require("escope/lib/referencer"); + } + var estraverse = eslintMod.require("estraverse"); - var referencer = eslintMod.require("escope/lib/referencer"); if (referencer.__esModule) referencer = referencer.default; From b5c058bf6e51dbd2aef719fdfdb3072b97e51bde Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 12 Apr 2017 12:07:05 -0400 Subject: [PATCH 578/965] 7.2.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cef295c69c1d..a134201ef8ee 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.2.1", + "version": "7.2.2", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 6feaee84e0d02a08f207df3688d77bf4abeee246 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Fri, 21 Apr 2017 11:48:52 -0400 Subject: [PATCH 579/965] Fix flow type spread handling (babel/babel-eslint#465) --- eslint/babel-eslint-parser/index.js | 7 +++++-- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 12 ++++++++++++ eslint/babel-eslint-parser/yarn.lock | 6 +++--- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 0f871a90a358..b647fbdfda3e 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -107,7 +107,7 @@ function monkeypatch(modules) { // loops callProperties: { type: "loop", values: ["value"] }, indexers: { type: "loop", values: ["key", "value"] }, - properties: { type: "loop", values: ["value"] }, + properties: { type: "loop", values: ["argument", "value"] }, types: { type: "loop" }, params: { type: "loop" }, // single property @@ -142,7 +142,10 @@ function monkeypatch(modules) { for (var j = 0; j < nodeProperty.length; j++) { if (Array.isArray(propertyType.values)) { for (var k = 0; k < propertyType.values.length; k++) { - checkIdentifierOrVisit.call(this, nodeProperty[j][propertyType.values[k]]); + var loopPropertyNode = nodeProperty[j][propertyType.values[k]]; + if (loopPropertyNode) { + checkIdentifierOrVisit.call(this, loopPropertyNode); + } } } else { checkIdentifierOrVisit.call(this, nodeProperty[j]); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a134201ef8ee..343b99fc0ed0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,7 @@ "babel-code-frame": "^6.22.0", "babel-traverse": "^6.23.1", "babel-types": "^6.23.0", - "babylon": "^6.16.1" + "babylon": "^6.17.0" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 015b0fd331a8..f2cf31497392 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -574,6 +574,18 @@ describe("verify", () => { ); }); + it("supports type spreading", () => { + verifyAndAssertMessages( + unpad(` + type U = {}; + type T = {a: number, ...U, ...V}; + `), + { "no-undef": 1, "no-unused-vars": 1 }, + [ "2:6 'T' is defined but never used. no-unused-vars", + "2:31 'V' is not defined. no-undef" ] + ); + }); + it("1", () => { verifyAndAssertMessages( unpad(` diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index c81f84090b6b..f75d231426ae 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -113,9 +113,9 @@ babel-types@^6.15.0, babel-types@^6.23.0: lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.13.0, babylon@^6.15.0, babylon@^6.16.1: - version "6.16.1" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.16.1.tgz#30c5a22f481978a9e7f8cdfdf496b11d94b404d3" +babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: + version "6.17.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" balanced-match@^0.4.1: version "0.4.2" From b4daa5eae2d038ae09c74b87b0c61e8dc1ed2355 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 21 Apr 2017 22:14:19 +0100 Subject: [PATCH 580/965] 7.2.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 343b99fc0ed0..a247678c0de0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.2.2", + "version": "7.2.3", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From cb2eb3a1fb6096ecc398f964365259fede0c93b8 Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Mon, 29 May 2017 20:41:14 -0500 Subject: [PATCH 581/965] Fix: Convert RegExpLieteral value to RegExp object (fixes babel/babel-eslint#477) (babel/babel-eslint#478) --- .../babel-eslint-parser/babylon-to-espree/toAST.js | 6 +++++- eslint/babel-eslint-parser/test/babel-eslint.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 84d77a53de41..53bc76be05d7 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -94,7 +94,11 @@ var astTransformVisitor = { if (path.isRegExpLiteral()) { node.type = "Literal"; node.raw = node.extra.raw; - node.value = {}; + try { + node.value = new RegExp(node.pattern, node.flags); + } catch (err) { + node.value = null; + } node.regex = { pattern: node.pattern, flags: node.flags diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 540170df254b..b7f0e699344b 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -20,6 +20,8 @@ function assertImplementsAST(target, source, path) { var typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { error(`have different types (${typeA} !== ${typeB}) (${target} !== ${source})`); + } else if (typeA === "object" && ["RegExp"].indexOf(target.constructor.name) !== -1 && target.constructor.name !== source.constructor.name) { + error(`object have different constructors (${target.constructor.name} !== ${source.constructor.name}`); } else if (typeA === "object") { var keysTarget = Object.keys(target); for (var i in keysTarget) { @@ -305,6 +307,18 @@ describe("babylon-to-esprima", () => { parseAndAssertSame("/affix-top|affix-bottom|affix|[a-z]/"); }); + it("regexp", () => { + parseAndAssertSame("const foo = /foo/;"); + }); + + it("regexp y flag", () => { + parseAndAssertSame("const foo = /foo/y;"); + }); + + it("regexp u flag", () => { + parseAndAssertSame("const foo = /foo/u;"); + }); + it("regexp in a template string", () => { parseAndAssertSame("`${/\\d/.exec(\"1\")[0]}`"); }); From 4e4aa0563949c0fa5921c136995d95be0a9b2c21 Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Tue, 6 Jun 2017 20:37:57 -0500 Subject: [PATCH 582/965] Update to Babylon 7 (fixes babel/babel-eslint#481) (babel/babel-eslint#482) * Update to Babylon 7 (fixes babel/babel-eslint#481) * Pin dependencies to alpha version * fix deprecation, add other plugins * oops * Update index.js * Add tests for private class properties with rules no-undef no-unused-vars --- .../babylon-to-espree/toAST.js | 9 +- eslint/babel-eslint-parser/index.js | 26 ++++- eslint/babel-eslint-parser/package.json | 8 +- .../test/non-regression.js | 40 +++++-- eslint/babel-eslint-parser/yarn.lock | 107 +++++++++++++++++- 5 files changed, 169 insertions(+), 21 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 53bc76be05d7..738330a0674d 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -157,6 +157,7 @@ var astTransformVisitor = { if (node.kind === "method") { node.kind = "init"; } + node.shorthand = false; } delete node.body; @@ -169,8 +170,12 @@ var astTransformVisitor = { delete node.typeParameters; } - if (path.isRestProperty() || path.isSpreadProperty()) { - node.type = `Experimental${node.type}`; + if (path.isRestElement() && path.parent && path.parent.type === "ObjectPattern") { + node.type = "ExperimentalRestProperty"; + } + + if (path.isSpreadElement() && path.parent && path.parent.type === "ObjectExpression") { + node.type = "ExperimentalSpreadProperty"; } if (path.isTypeParameter && path.isTypeParameter()) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index b647fbdfda3e..f06d04b85478 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -5,7 +5,7 @@ var parse = require("babylon").parse; var t = require("babel-types"); var tt = require("babylon").tokTypes; var traverse = require("babel-traverse").default; -var codeFrame = require("babel-code-frame"); +var codeFrameColumns = require("babel-code-frame").codeFrameColumns; var hasPatched = false; var eslintOptions = {}; @@ -231,13 +231,18 @@ function monkeypatch(modules) { visitProperty.call(this, node); }; - // visit ClassProperty as a Property. - referencer.prototype.ClassProperty = function(node) { + function visitClassProperty(node) { if (node.typeAnnotation) { visitTypeAnnotation.call(this, node.typeAnnotation); } this.visitProperty(node); - }; + } + + // visit ClassProperty as a Property. + referencer.prototype.ClassProperty = visitClassProperty; + + // visit ClassPrivateProperty as a Property. + referencer.prototype.ClassPrivateProperty = visitClassProperty; // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression var visitFunction = referencer.prototype.visitFunction; @@ -397,7 +402,11 @@ exports.parseNoPatch = function (code, options) { "functionSent", "objectRestSpread", "trailingFunctionCommas", - "dynamicImport" + "dynamicImport", + "numericSeparator", + "optionalChaining", + "importMeta", + "classPrivateProperties", ] }; @@ -418,7 +427,12 @@ exports.parseNoPatch = function (code, options) { err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "") + // add codeframe "\n\n" + - codeFrame(code, err.lineNumber, err.column, { highlightCode: true }); + codeFrameColumns(code, { + start: { + line: err.lineNumber, + column: err.column, + }, + }, { highlightCode: true }); } } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a247678c0de0..75c724a8e11c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "^6.22.0", - "babel-traverse": "^6.23.1", - "babel-types": "^6.23.0", - "babylon": "^6.17.0" + "babel-code-frame": "7.0.0-alpha.12", + "babel-traverse": "7.0.0-alpha.12", + "babel-types": "7.0.0-alpha.12", + "babylon": "7.0.0-beta.13" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index f2cf31497392..26bf95af3d43 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1738,11 +1738,37 @@ describe("verify", () => { ); }); - // it("regex with es6 unicodeCodePointEscapes", function () { - // verifyAndAssertMessages( - // "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", - // {}, - // [] - // ); - // }); + it("regex with es6 unicodeCodePointEscapes", () => { + verifyAndAssertMessages( + "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", + {}, + [] + ); + }); + + describe("private class properties", () => { + it("should not be undefined", () => { + verifyAndAssertMessages( + unpad(` + class C { + #d = 1; + } + `), + { "no-undef": 1 }, + [] + ); + }); + + it("should not be unused", () => { + verifyAndAssertMessages( + unpad(` + export class C { + #d = 1; + } + `), + { "no-unused-vars": 1 }, + [] + ); + }); + }); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index f75d231426ae..134eda3e5602 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -59,6 +59,22 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" +babel-code-frame@7.0.0-alpha.12: + version "7.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.12.tgz#26fbb2eab1c20763271fecb6b04a108756fae61f" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-code-frame@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.3.tgz#9ff265eaaac94b58dfc7ca4a4eecf389d5f4d344" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -77,6 +93,29 @@ babel-eslint@^7.0.0: babylon "^6.13.0" lodash.pickby "^4.6.0" +babel-helper-function-name@7.0.0-alpha.7: + version "7.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.7.tgz#19aecddc5402f941c5726802993077b41ea9832d" + dependencies: + babel-helper-get-function-arity "7.0.0-alpha.7" + babel-template "7.0.0-alpha.7" + babel-traverse "7.0.0-alpha.7" + babel-types "7.0.0-alpha.7" + +babel-helper-get-function-arity@7.0.0-alpha.7: + version "7.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.7.tgz#16e6526ecefc5537826012365e577de2ccba02f5" + dependencies: + babel-types "7.0.0-alpha.7" + +babel-messages@7.0.0-alpha.12: + version "7.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.12.tgz#5fda840cb8dfeda06a7894a1e8ab1af695f249c0" + +babel-messages@7.0.0-alpha.3: + version "7.0.0-alpha.3" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -90,7 +129,43 @@ babel-runtime@^6.22.0: core-js "^2.4.0" regenerator-runtime "^0.10.0" -babel-traverse@^6.15.0, babel-traverse@^6.23.1: +babel-template@7.0.0-alpha.7: + version "7.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.7.tgz#82e26500980d1b3f14d9ebe8ae8b9325dc158392" + dependencies: + babel-traverse "7.0.0-alpha.7" + babel-types "7.0.0-alpha.7" + babylon "7.0.0-beta.8" + lodash "^4.2.0" + +babel-traverse@7.0.0-alpha.12: + version "7.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.12.tgz#0c0855a60287e56e54cf61ea9f135cdf759d6ad0" + dependencies: + babel-code-frame "7.0.0-alpha.12" + babel-helper-function-name "7.0.0-alpha.7" + babel-messages "7.0.0-alpha.12" + babel-types "7.0.0-alpha.12" + babylon "7.0.0-beta.12" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-traverse@7.0.0-alpha.7: + version "7.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.7.tgz#61cc89061b0ad0a5f9fc6df81117fac428bc4148" + dependencies: + babel-code-frame "7.0.0-alpha.3" + babel-messages "7.0.0-alpha.3" + babel-types "7.0.0-alpha.7" + babylon "7.0.0-beta.8" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-traverse@^6.15.0: version "6.23.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" dependencies: @@ -104,6 +179,22 @@ babel-traverse@^6.15.0, babel-traverse@^6.23.1: invariant "^2.2.0" lodash "^4.2.0" +babel-types@7.0.0-alpha.12: + version "7.0.0-alpha.12" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.12.tgz#d7b2c6d0c49c518fd36de5ac14f4f50bed6de7e5" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babel-types@7.0.0-alpha.7: + version "7.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.7.tgz#4bdb77386d1f6e2001f42fa9ac21b6c3d6ad0d82" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babel-types@^6.15.0, babel-types@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" @@ -113,7 +204,19 @@ babel-types@^6.15.0, babel-types@^6.23.0: lodash "^4.2.0" to-fast-properties "^1.0.1" -babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: +babylon@7.0.0-beta.12: + version "7.0.0-beta.12" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" + +babylon@7.0.0-beta.13: + version "7.0.0-beta.13" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.13.tgz#12425c1bfd9498be419021ed36b43fe4f0289c0a" + +babylon@7.0.0-beta.8: + version "7.0.0-beta.8" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" + +babylon@^6.13.0, babylon@^6.15.0: version "6.17.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" From 45a9f64174697182b91bbc25d16bada3b90d2c15 Mon Sep 17 00:00:00 2001 From: Reyad Attiyat Date: Tue, 6 Jun 2017 20:38:49 -0500 Subject: [PATCH 583/965] Use Node 8 and drop Node 5 from travis (babel/babel-eslint#483) * Use Node 8 and drop Node 5 from travis * switch the order [skip ci] --- eslint/babel-eslint-parser/.travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 7f84d147a4d2..ad63884c93b7 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,9 +1,9 @@ sudo: false language: node_js node_js: - - "4" - - "5" + - "8" - "6" + - "4" matrix: fast_finish: true From 36a630e0235676dcb7a94a399794fcbcfb1d07d9 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 8 Jun 2017 17:23:08 +0100 Subject: [PATCH 584/965] Fix: allow options to be optional when monkey patching escope.analyze (fixes babel/babel-eslint#470). (babel/babel-eslint#484) --- eslint/babel-eslint-parser/index.js | 1 + eslint/babel-eslint-parser/test/babel-eslint.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index f06d04b85478..a126db9dedc4 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -62,6 +62,7 @@ function monkeypatch(modules) { var analyze = escope.analyze; escope.analyze = function (ast, opts) { + opts = opts || {}; opts.ecmaVersion = eslintOptions.ecmaVersion; opts.sourceType = eslintOptions.sourceType; if (eslintOptions.globalReturn !== undefined) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index b7f0e699344b..28250588cba8 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,6 +1,7 @@ var assert = require("assert"); var babelEslint = require(".."); var espree = require("espree"); +var escope = require("escope"); var util = require("util"); var unpad = require("dedent"); @@ -85,6 +86,16 @@ function parseAndAssertSame(code) { } describe("babylon-to-esprima", () => { + describe("compatibility", () => { + it("should allow ast.analyze to be called without options", function() { + var esAST = babelEslint.parse("`test`"); + + assert.doesNotThrow(() => { + escope.analyze(esAST); + }, TypeError, "Should allow no options argument."); + }); + }); + describe("templates", () => { it("empty template string", () => { parseAndAssertSame("``"); From bffbaff7e2d7f4058d8022b2356871415defb230 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Thu, 15 Jun 2017 23:03:02 +0200 Subject: [PATCH 585/965] Use babylon estree and ranges (babel/babel-eslint#489) --- .../babylon-to-espree/index.js | 1 - .../babylon-to-espree/toAST.js | 165 ++---------------- eslint/babel-eslint-parser/index.js | 2 + .../babel-eslint-parser/test/babel-eslint.js | 2 +- 4 files changed, 17 insertions(+), 153 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/babylon-to-espree/index.js index 94e6832f3476..d19c9b07936f 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/index.js @@ -30,7 +30,6 @@ module.exports = function (ast, traverse, tt, code) { ast.directives = ast.program.directives; ast.body = ast.program.body; delete ast.program; - delete ast._paths; attachComments(ast, ast.comments, ast.tokens); }; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 738330a0674d..2830f5dc4138 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -1,31 +1,26 @@ "use strict"; +var t = require("babel-types"); var convertComments = require("./convertComments"); module.exports = function (ast, traverse, code) { var state = { source: code }; - ast.range = [ast.start, ast.end]; + + // Monkey patch visitor keys in order to be able to traverse the estree nodes + t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; + t.VISITOR_KEYS.MethodDefinition = ["key", "value", "decorators", "returnType", "typeParameters"]; + traverse(ast, astTransformVisitor, null, state); -}; -function changeToLiteral(node, state) { - node.type = "Literal"; - if (!node.raw) { - if (node.extra && node.extra.raw) { - node.raw = node.extra.raw; - } else { - node.raw = state.source.slice(node.start, node.end); - } - } -} + delete t.VISITOR_KEYS.Property; + delete t.VISITOR_KEYS.MethodDefinition; +}; var astTransformVisitor = { noScope: true, enter (path) { var node = path.node; - node.range = [node.start, node.end]; - // private var to track original node type node._babelType = node.type; @@ -41,133 +36,17 @@ var astTransformVisitor = { if (node.leadingComments) { convertComments(node.leadingComments); } - - // make '_paths' non-enumerable (babel-eslint #200) - Object.defineProperty(node, "_paths", { value: node._paths, writable: true }); }, - exit (path, state) { + exit (path) { var node = path.node; - // fixDirectives - if (path.isFunction() || path.isProgram()) { - var directivesContainer = node; - var body = node.body; - if (node.type !== "Program") { - directivesContainer = body; - body = body.body; - } - if (directivesContainer.directives) { - for (var i = directivesContainer.directives.length - 1; i >= 0; i--) { - var directive = directivesContainer.directives[i]; - directive.type = "ExpressionStatement"; - directive.expression = directive.value; - delete directive.value; - directive.expression.type = "Literal"; - changeToLiteral(directive.expression, state); - body.unshift(directive); - } - delete directivesContainer.directives; - } - } - if (path.isJSXText()) { node.type = "Literal"; - node.raw = node.value; - } - - if (path.isNumericLiteral() || - path.isStringLiteral()) { - changeToLiteral(node, state); - } - - if (path.isBooleanLiteral()) { - node.type = "Literal"; - node.raw = String(node.value); - } - - if (path.isNullLiteral()) { - node.type = "Literal"; - node.raw = "null"; - node.value = null; - } - - if (path.isRegExpLiteral()) { - node.type = "Literal"; - node.raw = node.extra.raw; - try { - node.value = new RegExp(node.pattern, node.flags); - } catch (err) { - node.value = null; - } - node.regex = { - pattern: node.pattern, - flags: node.flags - }; - delete node.extra; - delete node.pattern; - delete node.flags; } - if (path.isObjectProperty()) { - node.type = "Property"; - node.kind = "init"; - } - - if (path.isClassMethod() || path.isObjectMethod()) { - var code = state.source.slice(node.key.end, node.body.start); - var offset = code.indexOf("("); - - node.value = { - type: "FunctionExpression", - id: node.id, - params: node.params, - body: node.body, - async: node.async, - generator: node.generator, - expression: node.expression, - defaults: [], // basic support - TODO: remove (old esprima) - loc: { - start: { - line: node.key.loc.start.line, - column: node.key.loc.end.column + offset // a[() {] - }, - end: node.body.loc.end - } - }; - // [asdf]() { - node.value.range = [node.key.end + offset, node.body.end]; - - node.value.start = node.value.range && node.value.range[0] || node.value.loc.start.column; - node.value.end = node.value.range && node.value.range[1] || node.value.loc.end.column; - - if (node.returnType) { - node.value.returnType = node.returnType; - } - - if (node.typeParameters) { - node.value.typeParameters = node.typeParameters; - } - - if (path.isClassMethod()) { - node.type = "MethodDefinition"; - } - - if (path.isObjectMethod()) { - node.type = "Property"; - if (node.kind === "method") { - node.kind = "init"; - } - node.shorthand = false; - } - - delete node.body; - delete node.id; - delete node.async; - delete node.generator; - delete node.expression; - delete node.params; - delete node.returnType; - delete node.typeParameters; + // TODO estree plugin bug + if (node.type === "Property") { + if (!node.shorthand) node.shorthand = false; } if (path.isRestElement() && path.parent && path.parent.type === "ObjectPattern") { @@ -178,7 +57,7 @@ var astTransformVisitor = { node.type = "ExperimentalSpreadProperty"; } - if (path.isTypeParameter && path.isTypeParameter()) { + if (path.isTypeParameter()) { node.type = "Identifier"; node.typeAnnotation = node.bound; delete node.bound; @@ -208,22 +87,6 @@ var astTransformVisitor = { delete node.isType; } - if (path.isExportDeclaration()) { - var declar = path.get("declaration"); - if (declar.isClassExpression()) { - node.declaration.type = "ClassDeclaration"; - } else if (declar.isFunctionExpression()) { - node.declaration.type = "FunctionDeclaration"; - } - } - - // TODO: remove (old esprima) - if (path.isFunction()) { - if (!node.defaults) { - node.defaults = []; - } - } - // template string range fixes if (path.isTemplateLiteral()) { for (var j = 0; j < node.quasis.length; j++) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index a126db9dedc4..5beabc741581 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -388,9 +388,11 @@ exports.parseNoPatch = function (code, options) { allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, + ranges: true, plugins: [ "flow", "jsx", + "estree", "asyncFunctions", "asyncGenerators", "classConstructorCall", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 28250588cba8..31d3918c54b8 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -371,7 +371,7 @@ describe("babylon-to-esprima", () => { ); }); - describe("babel 6 tests", () => { + describe("babel tests", () => { it("MethodDefinition", () => { parseAndAssertSame( unpad(` From 001064885df95009b7c8a6d258a77ea743bd5a92 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 16 Jun 2017 16:56:32 -0400 Subject: [PATCH 586/965] 8.0.0-alpha.12 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 75c724a8e11c..2f4ddc905d50 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "7.2.3", + "version": "8.0.0-alpha.12", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 94e69f399b5db1e54d4d134c6f5be8044c77b6e7 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 17 Jun 2017 14:14:42 -0500 Subject: [PATCH 587/965] Add Prettier (babel/babel-eslint#491) --- eslint/babel-eslint-parser/.eslintrc.js | 6 +- .../babylon-to-espree/attachComments.js | 2 +- .../babylon-to-espree/convertComments.js | 2 +- .../babylon-to-espree/convertTemplateType.js | 30 +- .../babylon-to-espree/index.js | 8 +- .../babylon-to-espree/toAST.js | 28 +- .../babylon-to-espree/toToken.js | 58 ++- .../babylon-to-espree/toTokens.js | 2 +- eslint/babel-eslint-parser/index.js | 91 +++-- eslint/babel-eslint-parser/package.json | 15 +- .../babel-eslint-parser/test/babel-eslint.js | 101 +++-- .../babel-eslint-parser/test/integration.js | 319 ++++++++------- .../test/non-regression.js | 215 ++++++----- eslint/babel-eslint-parser/yarn.lock | 362 +++++++++++++++++- 14 files changed, 856 insertions(+), 383 deletions(-) diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js index 20f31f1eebd5..adce94d69a00 100644 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -1,9 +1,13 @@ module.exports = { root: true, extends: "babel", + "plugins": [ + "prettier" + ], rules: { "no-var": 0, - "max-len": 0 + "max-len": 0, + "prettier/prettier": ["error", { "trailingComma": "es5" }], }, env: { node: true, diff --git a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js index 9fc9f339c2b5..8c608a45ad94 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js @@ -1,7 +1,7 @@ "use strict"; // comment fixes -module.exports = function (ast, comments, tokens) { +module.exports = function(ast, comments, tokens) { if (comments.length) { var firstComment = comments[0]; var lastComment = comments[comments.length - 1]; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js index 19c6ce8c97c7..17d711737294 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js @@ -1,6 +1,6 @@ "use strict"; -module.exports = function (comments) { +module.exports = function(comments) { for (var i = 0; i < comments.length; i++) { var comment = comments[i]; if (comment.type === "CommentBlock") { diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js index 8b647c39ba16..d8892f997260 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js @@ -1,24 +1,25 @@ "use strict"; -module.exports = function (tokens, tt) { - var startingToken = 0; - var currentToken = 0; - var numBraces = 0; // track use of {} - var numBackQuotes = 0; // track number of nested templates +module.exports = function(tokens, tt) { + var startingToken = 0; + var currentToken = 0; + var numBraces = 0; // track use of {} + var numBackQuotes = 0; // track number of nested templates function isBackQuote(token) { return tokens[token].type === tt.backQuote; } function isTemplateStarter(token) { - return isBackQuote(token) || - // only can be a template starter when in a template already - tokens[token].type === tt.braceR && numBackQuotes > 0; + return ( + isBackQuote(token) || + // only can be a template starter when in a template already + (tokens[token].type === tt.braceR && numBackQuotes > 0) + ); } function isTemplateEnder(token) { - return isBackQuote(token) || - tokens[token].type === tt.dollarBraceL; + return isBackQuote(token) || tokens[token].type === tt.dollarBraceL; } // append the values between start and end @@ -44,8 +45,8 @@ module.exports = function (tokens, tt) { end: tokens[end].end, loc: { start: tokens[start].loc.start, - end: tokens[end].loc.end - } + end: tokens[end].loc.end, + }, }; // put new token in place of old tokens @@ -70,7 +71,10 @@ module.exports = function (tokens, tt) { currentToken = startingToken + 1; // check if token after template start is "template" - if (currentToken >= tokens.length - 1 || tokens[currentToken].type !== tt.template) { + if ( + currentToken >= tokens.length - 1 || + tokens[currentToken].type !== tt.template + ) { break; } diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/babylon-to-espree/index.js index d19c9b07936f..ecd8eee6f1d8 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/index.js @@ -1,11 +1,11 @@ "use strict"; -var attachComments = require("./attachComments"); +var attachComments = require("./attachComments"); var convertComments = require("./convertComments"); -var toTokens = require("./toTokens"); -var toAST = require("./toAST"); +var toTokens = require("./toTokens"); +var toAST = require("./toAST"); -module.exports = function (ast, traverse, tt, code) { +module.exports = function(ast, traverse, tt, code) { // remove EOF token, eslint doesn't use this for anything and it interferes // with some rules see https://github.com/babel/babel-eslint/issues/2 // todo: find a more elegant way to do this diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 2830f5dc4138..7e3e6876fc8c 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -3,12 +3,18 @@ var t = require("babel-types"); var convertComments = require("./convertComments"); -module.exports = function (ast, traverse, code) { +module.exports = function(ast, traverse, code) { var state = { source: code }; // Monkey patch visitor keys in order to be able to traverse the estree nodes t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; - t.VISITOR_KEYS.MethodDefinition = ["key", "value", "decorators", "returnType", "typeParameters"]; + t.VISITOR_KEYS.MethodDefinition = [ + "key", + "value", + "decorators", + "returnType", + "typeParameters", + ]; traverse(ast, astTransformVisitor, null, state); @@ -18,7 +24,7 @@ module.exports = function (ast, traverse, code) { var astTransformVisitor = { noScope: true, - enter (path) { + enter(path) { var node = path.node; // private var to track original node type @@ -37,7 +43,7 @@ var astTransformVisitor = { convertComments(node.leadingComments); } }, - exit (path) { + exit(path) { var node = path.node; if (path.isJSXText()) { @@ -49,11 +55,19 @@ var astTransformVisitor = { if (!node.shorthand) node.shorthand = false; } - if (path.isRestElement() && path.parent && path.parent.type === "ObjectPattern") { + if ( + path.isRestElement() && + path.parent && + path.parent.type === "ObjectPattern" + ) { node.type = "ExperimentalRestProperty"; } - if (path.isSpreadElement() && path.parent && path.parent.type === "ObjectExpression") { + if ( + path.isSpreadElement() && + path.parent && + path.parent.type === "ObjectExpression" + ) { node.type = "ExperimentalSpreadProperty"; } @@ -105,5 +119,5 @@ var astTransformVisitor = { } } } - } + }, }; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js index 6173f760d6eb..9c5a49ef11dd 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toToken.js @@ -1,29 +1,47 @@ "use strict"; -module.exports = function (token, tt, source) { +module.exports = function(token, tt, source) { var type = token.type; token.range = [token.start, token.end]; if (type === tt.name) { token.type = "Identifier"; - } else if (type === tt.semi || type === tt.comma || - type === tt.parenL || type === tt.parenR || - type === tt.braceL || type === tt.braceR || - type === tt.slash || type === tt.dot || - type === tt.bracketL || type === tt.bracketR || - type === tt.ellipsis || type === tt.arrow || - type === tt.star || type === tt.incDec || - type === tt.colon || type === tt.question || - type === tt.template || type === tt.backQuote || - type === tt.dollarBraceL || type === tt.at || - type === tt.logicalOR || type === tt.logicalAND || - type === tt.bitwiseOR || type === tt.bitwiseXOR || - type === tt.bitwiseAND || type === tt.equality || - type === tt.relational || type === tt.bitShift || - type === tt.plusMin || type === tt.modulo || - type === tt.exponent || type === tt.prefix || - type === tt.doubleColon || - type.isAssign) { + } else if ( + type === tt.semi || + type === tt.comma || + type === tt.parenL || + type === tt.parenR || + type === tt.braceL || + type === tt.braceR || + type === tt.slash || + type === tt.dot || + type === tt.bracketL || + type === tt.bracketR || + type === tt.ellipsis || + type === tt.arrow || + type === tt.star || + type === tt.incDec || + type === tt.colon || + type === tt.question || + type === tt.template || + type === tt.backQuote || + type === tt.dollarBraceL || + type === tt.at || + type === tt.logicalOR || + type === tt.logicalAND || + type === tt.bitwiseOR || + type === tt.bitwiseXOR || + type === tt.bitwiseAND || + type === tt.equality || + type === tt.relational || + type === tt.bitShift || + type === tt.plusMin || + type === tt.modulo || + type === tt.exponent || + type === tt.prefix || + type === tt.doubleColon || + type.isAssign + ) { token.type = "Punctuator"; if (!token.value) token.value = type.label; } else if (type === tt.jsxTagStart) { @@ -53,7 +71,7 @@ module.exports = function (token, tt, source) { var value = token.value; token.regex = { pattern: value.pattern, - flags: value.flags + flags: value.flags, }; token.value = `/${value.pattern}/${value.flags}`; } diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js index 81ec9850afa6..a863b871b0a8 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js @@ -3,7 +3,7 @@ var convertTemplateType = require("./convertTemplateType"); var toToken = require("./toToken"); -module.exports = function (tokens, tt, code) { +module.exports = function(tokens, tt, code) { // transform tokens to type "Template" convertTemplateType(tokens, tt); diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 5beabc741581..ecedcb50ad84 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -1,10 +1,10 @@ var babylonToEspree = require("./babylon-to-espree"); -var Module = require("module"); -var path = require("path"); -var parse = require("babylon").parse; -var t = require("babel-types"); -var tt = require("babylon").tokTypes; -var traverse = require("babel-traverse").default; +var Module = require("module"); +var path = require("path"); +var parse = require("babylon").parse; +var t = require("babel-types"); +var tt = require("babylon").tokTypes; +var traverse = require("babel-traverse").default; var codeFrameColumns = require("babel-code-frame").codeFrameColumns; var hasPatched = false; @@ -30,10 +30,11 @@ function getModules() { try { var escope = eslintMod.require("eslint-scope"); - var Definition = eslintMod.require("eslint-scope/lib/definition").Definition; + var Definition = eslintMod.require("eslint-scope/lib/definition") + .Definition; var referencer = eslintMod.require("eslint-scope/lib/referencer"); } catch (err) { - escope = eslintMod.require("escope"); + escope = eslintMod.require("escope"); Definition = eslintMod.require("escope/lib/definition").Definition; referencer = eslintMod.require("escope/lib/referencer"); } @@ -61,7 +62,7 @@ function monkeypatch(modules) { estraverse.VisitorKeys.Property.push("decorators"); var analyze = escope.analyze; - escope.analyze = function (ast, opts) { + escope.analyze = function(ast, opts) { opts = opts || {}; opts.ecmaVersion = eslintOptions.ecmaVersion; opts.sourceType = eslintOptions.sourceType; @@ -94,7 +95,7 @@ function monkeypatch(modules) { "FunctionExpression", "Identifier", "ObjectPattern", - "RestElement" + "RestElement", ]); var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { var value = t.VISITOR_KEYS[key]; @@ -120,7 +121,7 @@ function monkeypatch(modules) { // others typeAnnotation: { type: "typeAnnotation" }, typeParameters: { type: "typeParameters" }, - id: { type: "id" } + id: { type: "id" }, }; function visitTypeAnnotation(node) { @@ -182,7 +183,13 @@ function monkeypatch(modules) { function nestTypeParamScope(manager, node) { var parentScope = manager.__currentScope; - var scope = new escope.Scope(manager, "type-parameters", parentScope, node, false); + var scope = new escope.Scope( + manager, + "type-parameters", + parentScope, + node, + false + ); manager.__nestScope(scope); for (var j = 0; j < node.typeParameters.params.length; j++) { var name = node.typeParameters.params[j]; @@ -296,16 +303,10 @@ function monkeypatch(modules) { variableDeclaration.call(this, node); }; - function createScopeVariable (node, name) { - this.currentScope().variableScope.__define(name, - new Definition( - "Variable", - name, - node, - null, - null, - null - ) + function createScopeVariable(node, name) { + this.currentScope().variableScope.__define( + name, + new Definition("Variable", name, node, null, null, null) ); } @@ -339,10 +340,9 @@ function monkeypatch(modules) { } }; - referencer.prototype.DeclareModule = - referencer.prototype.DeclareFunction = - referencer.prototype.DeclareVariable = - referencer.prototype.DeclareClass = function(node) { + referencer.prototype.DeclareModule = referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = referencer.prototype.DeclareClass = function( + node + ) { if (node.id) { createScopeVariable.call(this, node, node.id); } @@ -357,11 +357,13 @@ function monkeypatch(modules) { }; } -exports.parse = function (code, options) { +exports.parse = function(code, options) { options = options || {}; eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; - eslintOptions.sourceType = options.sourceType = options.sourceType || "module"; - eslintOptions.allowImportExportEverywhere = options.allowImportExportEverywhere = options.allowImportExportEverywhere || false; + eslintOptions.sourceType = options.sourceType = + options.sourceType || "module"; + eslintOptions.allowImportExportEverywhere = options.allowImportExportEverywhere = + options.allowImportExportEverywhere || false; if (options.sourceType === "module") { eslintOptions.globalReturn = false; } else { @@ -381,7 +383,7 @@ exports.parse = function (code, options) { return exports.parseNoPatch(code, options); }; -exports.parseNoPatch = function (code, options) { +exports.parseNoPatch = function(code, options) { var opts = { codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, sourceType: options.sourceType, @@ -410,7 +412,7 @@ exports.parseNoPatch = function (code, options) { "optionalChaining", "importMeta", "classPrivateProperties", - ] + ], }; var ast; @@ -418,7 +420,6 @@ exports.parseNoPatch = function (code, options) { ast = parse(code, opts); } catch (err) { if (err instanceof SyntaxError) { - err.lineNumber = err.loc.line; err.column = err.loc.column; @@ -427,15 +428,23 @@ exports.parseNoPatch = function (code, options) { err.column = err.loc.column + 1; // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = "Line " + err.lineNumber + ": " + err.message.replace(/ \((\d+):(\d+)\)$/, "") + - // add codeframe - "\n\n" + - codeFrameColumns(code, { - start: { - line: err.lineNumber, - column: err.column, - }, - }, { highlightCode: true }); + err.message = + "Line " + + err.lineNumber + + ": " + + err.message.replace(/ \((\d+):(\d+)\)$/, "") + + // add codeframe + "\n\n" + + codeFrameColumns( + code, + { + start: { + line: err.lineNumber, + column: err.column, + }, + }, + { highlightCode: true } + ); } } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 2f4ddc905d50..90eb98e74e7b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -22,6 +22,7 @@ "test-only": "mocha", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", + "precommit": "lint-staged", "preversion": "npm test", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, @@ -38,9 +39,19 @@ "babel-eslint": "^7.0.0", "dedent": "^0.7.0", "eslint": "^3.18.0", - "eslint-config-babel": "^6.0.0", + "eslint-config-babel": "^7.0.1", "eslint-plugin-flowtype": "^2.30.3", + "eslint-plugin-prettier": "^2.1.2", "espree": "^3.4.0", - "mocha": "^3.0.0" + "husky": "^0.13.2", + "lint-staged": "^3.6.1", + "mocha": "^3.0.0", + "prettier": "1.4.4" + }, + "lint-staged": { + "*.js": [ + "eslint --format=codeframe --fix", + "git add" + ] } } diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 31d3918c54b8..2ac2d3af581a 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,9 +1,9 @@ -var assert = require("assert"); +var assert = require("assert"); var babelEslint = require(".."); -var espree = require("espree"); -var escope = require("escope"); -var util = require("util"); -var unpad = require("dedent"); +var espree = require("espree"); +var escope = require("escope"); +var util = require("util"); +var unpad = require("dedent"); // Checks if the source ast implements the target ast. Ignores extra keys on source ast function assertImplementsAST(target, source, path) { @@ -20,9 +20,18 @@ function assertImplementsAST(target, source, path) { var typeA = target === null ? "null" : typeof target; var typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { - error(`have different types (${typeA} !== ${typeB}) (${target} !== ${source})`); - } else if (typeA === "object" && ["RegExp"].indexOf(target.constructor.name) !== -1 && target.constructor.name !== source.constructor.name) { - error(`object have different constructors (${target.constructor.name} !== ${source.constructor.name}`); + error( + `have different types (${typeA} !== ${typeB}) (${target} !== ${source})` + ); + } else if ( + typeA === "object" && + ["RegExp"].indexOf(target.constructor.name) !== -1 && + target.constructor.name !== source.constructor.name + ) { + error( + `object have different constructors (${target.constructor + .name} !== ${source.constructor.name}` + ); } else if (typeA === "object") { var keysTarget = Object.keys(target); for (var i in keysTarget) { @@ -32,28 +41,36 @@ function assertImplementsAST(target, source, path) { path.pop(); } } else if (target !== source) { - error(`are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})`); + error( + `are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})` + ); } } function lookup(obj, keypath, backwardsDepth) { - if (!keypath) { return obj; } + if (!keypath) { + return obj; + } - return keypath.split(".").slice(0, -1 * backwardsDepth) - .reduce((base, segment) => { return base && base[segment], obj; }); + return keypath + .split(".") + .slice(0, -1 * backwardsDepth) + .reduce((base, segment) => { + return base && base[segment], obj; + }); } function parseAndAssertSame(code) { var esAST = espree.parse(code, { ecmaFeatures: { - // enable JSX parsing + // enable JSX parsing jsx: true, - // enable return in global scope + // enable return in global scope globalReturn: true, - // enable implied strict mode (if ecmaVersion >= 5) + // enable implied strict mode (if ecmaVersion >= 5) impliedStrict: true, - // allow experimental object rest/spread - experimentalObjectRestSpread: true + // allow experimental object rest/spread + experimentalObjectRestSpread: true, }, tokens: true, loc: true, @@ -61,7 +78,7 @@ function parseAndAssertSame(code) { comment: true, attachComment: true, ecmaVersion: 8, - sourceType: "module" + sourceType: "module", }); var babylonAST = babelEslint.parse(code); try { @@ -76,9 +93,15 @@ function parseAndAssertSame(code) { } err.message += unpad(` espree: - ${util.inspect(lookup(esAST, traversal, 2), { depth: err.depth, colors: true })} + ${util.inspect(lookup(esAST, traversal, 2), { + depth: err.depth, + colors: true, + })} babel-eslint: - ${util.inspect(lookup(babylonAST, traversal, 2), { depth: err.depth, colors: true })} + ${util.inspect(lookup(babylonAST, traversal, 2), { + depth: err.depth, + colors: true, + })} `); throw err; } @@ -90,9 +113,13 @@ describe("babylon-to-esprima", () => { it("should allow ast.analyze to be called without options", function() { var esAST = babelEslint.parse("`test`"); - assert.doesNotThrow(() => { - escope.analyze(esAST); - }, TypeError, "Should allow no options argument."); + assert.doesNotThrow( + () => { + escope.analyze(esAST); + }, + TypeError, + "Should allow no options argument." + ); }); }); @@ -138,11 +165,15 @@ describe("babylon-to-esprima", () => { }); it("template with nested function/object", () => { - parseAndAssertSame("`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`"); + parseAndAssertSame( + "`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`" + ); }); it("template with braces inside and outside of template string #96", () => { - parseAndAssertSame("if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }"); + parseAndAssertSame( + "if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }" + ); }); it("template also with braces #96", () => { @@ -218,19 +249,19 @@ describe("babylon-to-esprima", () => { }); it("default import", () => { - parseAndAssertSame("import foo from \"foo\";"); + parseAndAssertSame('import foo from "foo";'); }); it("import specifier", () => { - parseAndAssertSame("import { foo } from \"foo\";"); + parseAndAssertSame('import { foo } from "foo";'); }); it("import specifier with name", () => { - parseAndAssertSame("import { foo as bar } from \"foo\";"); + parseAndAssertSame('import { foo as bar } from "foo";'); }); it("import bare", () => { - parseAndAssertSame("import \"foo\";"); + parseAndAssertSame('import "foo";'); }); it("export default class declaration", () => { @@ -250,7 +281,7 @@ describe("babylon-to-esprima", () => { }); it("export all", () => { - parseAndAssertSame("export * from \"foo\";"); + parseAndAssertSame('export * from "foo";'); }); it("export named", () => { @@ -331,11 +362,11 @@ describe("babylon-to-esprima", () => { }); it("regexp in a template string", () => { - parseAndAssertSame("`${/\\d/.exec(\"1\")[0]}`"); + parseAndAssertSame('`${/\\d/.exec("1")[0]}`'); }); it("first line is empty", () => { - parseAndAssertSame("\nimport Immutable from \"immutable\";"); + parseAndAssertSame('\nimport Immutable from "immutable";'); }); it("empty", () => { @@ -383,7 +414,9 @@ describe("babylon-to-esprima", () => { }); it("MethodDefinition 2", () => { - parseAndAssertSame("export default class Bar { get bar() { return 42; }}"); + parseAndAssertSame( + "export default class Bar { get bar() { return 42; }}" + ); }); it("ClassMethod", () => { @@ -443,7 +476,7 @@ describe("babylon-to-esprima", () => { it("do not allow import export everywhere", () => { assert.throws(() => { - parseAndAssertSame("function F() { import a from \"a\"; }"); + parseAndAssertSame('function F() { import a from "a"; }'); }, /SyntaxError: 'import' and 'export' may only appear at the top level/); }); diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index c446ed342815..8e93631a5aae 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -13,8 +13,8 @@ var errorLevel = 2; var baseEslintOpts = { parser: require.resolve(".."), parserOptions: { - sourceType: "script" - } + sourceType: "script", + }, }; /** @@ -23,7 +23,7 @@ var baseEslintOpts = { * @param object opts * @param function done */ -function lint (opts, done) { +function lint(opts, done) { readFixture(opts.fixture, (err, src) => { if (err) return done(err); done(null, eslint.linter.verify(src, opts.eslint)); @@ -35,14 +35,10 @@ function lint (opts, done) { * @param string|array id * @param function done */ -function readFixture (id, done) { +function readFixture(id, done) { if (Array.isArray(id)) id = path.join.apply(path, id); if (!path.extname(id)) id += ".js"; - fs.readFile( - path.join(paths.fixtures, id), - encoding, - done - ); + fs.readFile(path.join(paths.fixtures, id), encoding, done); } // readFixture @@ -51,7 +47,7 @@ describe("Rules:", () => { }); // describe -function strictSuite () { +function strictSuite() { var ruleId = "strict"; describe("when set to 'never'", () => { @@ -60,19 +56,20 @@ function strictSuite () { }); eslintOpts.rules[ruleId] = [errorLevel, "never"]; - ["global-with", "function-with"].forEach((fixture) => { - it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, - (done) => { - lint({ + ["global-with", "function-with"].forEach(fixture => { + it(`should error on ${fixture.match(/^[^-]+/)[0]} directive`, done => { + lint( + { fixture: ["strict", fixture], eslint: eslintOpts, - }, (err, report) => { + }, + (err, report) => { if (err) return done(err); assert(report[0].ruleId === ruleId); done(); - }); - } - ); + } + ); + }); // it }); }); @@ -80,63 +77,75 @@ function strictSuite () { describe("when set to 'global'", () => { var eslintOpts = Object.assign({}, baseEslintOpts, { - rules: {} + rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "global"]; - it("shouldn't error on single global directive", (done) => { - lint({ - fixture: ["strict", "global-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(!report.length); - done(); - }); + it("shouldn't error on single global directive", done => { + lint( + { + fixture: ["strict", "global-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(!report.length); + done(); + } + ); }); // it - it("should error twice on global directive: no and function directive: yes", (done) => { - lint({ - fixture: ["strict", "function-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - [0, 1].forEach((i) => { - assert(report[i].ruleId === ruleId); - }); - done(); - }); + it("should error twice on global directive: no and function directive: yes", done => { + lint( + { + fixture: ["strict", "function-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + [0, 1].forEach(i => { + assert(report[i].ruleId === ruleId); + }); + done(); + } + ); }); // it - it("should error on function directive", (done) => { - lint({ - fixture: ["strict", "global-with-function-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(report[0].ruleId === ruleId); - - // This is to make sure the test fails prior to adapting Babel AST - // directive representation to ESLint format. Otherwise it reports an - // error for missing global directive that masquerades as the expected - // result of the previous assertion. - assert(report[0].nodeType !== "Program"); - done(); - }); + it("should error on function directive", done => { + lint( + { + fixture: ["strict", "global-with-function-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + + // This is to make sure the test fails prior to adapting Babel AST + // directive representation to ESLint format. Otherwise it reports an + // error for missing global directive that masquerades as the expected + // result of the previous assertion. + assert(report[0].nodeType !== "Program"); + done(); + } + ); }); // it - it("should error on no directive", (done) => { - lint({ - fixture: ["strict", "none"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(report[0].ruleId === ruleId); - done(); - }); + it("should error on no directive", done => { + lint( + { + fixture: ["strict", "none"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + done(); + } + ); }); // it }); @@ -144,108 +153,130 @@ function strictSuite () { describe("when set to 'function'", () => { var eslintOpts = Object.assign({}, baseEslintOpts, { - rules: {} + rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "function"]; - it("shouldn't error on single function directive", (done) => { - lint({ - fixture: ["strict", "function-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(!report.length); - done(); - }); + it("shouldn't error on single function directive", done => { + lint( + { + fixture: ["strict", "function-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(!report.length); + done(); + } + ); }); // it - it("should error twice on function directive: no and global directive: yes", (done) => { - lint({ - fixture: ["strict", "global-with-function-without"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - [0, 1].forEach((i) => { - assert(report[i].ruleId === ruleId); - }); - done(); - }); + it("should error twice on function directive: no and global directive: yes", done => { + lint( + { + fixture: ["strict", "global-with-function-without"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + [0, 1].forEach(i => { + assert(report[i].ruleId === ruleId); + }); + done(); + } + ); }); // it - it("should error on only global directive", (done) => { - lint({ - fixture: ["strict", "global-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(report[0].ruleId === ruleId); - done(); - }); + it("should error on only global directive", done => { + lint( + { + fixture: ["strict", "global-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + done(); + } + ); }); // it - it("should error on extraneous global directive", (done) => { - lint({ - fixture: ["strict", "global-with-function-with"], - eslint: eslintOpts, - }, (err, report) => { - if (err) return done(err); - assert(report[0].ruleId === ruleId); - assert(report[0].nodeType.indexOf("Function") === -1); - done(); - }); + it("should error on extraneous global directive", done => { + lint( + { + fixture: ["strict", "global-with-function-with"], + eslint: eslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(report[0].ruleId === ruleId); + assert(report[0].nodeType.indexOf("Function") === -1); + done(); + } + ); }); // it }); // describe - describe("When \"codeFrame\"", () => { + describe('When "codeFrame"', () => { // Strip chalk colors, these are not relevant for the test - const stripAnsi = (str) => str.replace( - /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - "" - ); - - it("should display codeFrame when option is absent", (done) => { - lint({ - fixture: ["syntax-error"], - eslint: baseEslintOpts - }, (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); - done(); - }); + const stripAnsi = str => + str.replace( + /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, + "" + ); + + it("should display codeFrame when option is absent", done => { + lint( + { + fixture: ["syntax-error"], + eslint: baseEslintOpts, + }, + (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); + done(); + } + ); }); - it("should display codeFrame when option is true", (done) => { - lint({ - fixture: ["syntax-error"], - eslint: Object.assign({}, baseEslintOpts, { - parserOptions: { - codeFrame: true - } - }) - }, (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); - done(); - }); + it("should display codeFrame when option is true", done => { + lint( + { + fixture: ["syntax-error"], + eslint: Object.assign({}, baseEslintOpts, { + parserOptions: { + codeFrame: true, + }, + }), + }, + (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); + done(); + } + ); }); - it("should not display codeFrame when option is false", (done) => { - lint({ - fixture: ["syntax-error"], - eslint: Object.assign({}, baseEslintOpts, { - parserOptions: { - codeFrame: false - } - }) - }, (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") === -1); - done(); - }); + it("should not display codeFrame when option is false", done => { + lint( + { + fixture: ["syntax-error"], + eslint: Object.assign({}, baseEslintOpts, { + parserOptions: { + codeFrame: false, + }, + }), + }, + (err, report) => { + if (err) return done(err); + assert(stripAnsi(report[0].message).indexOf("^\n 5 |") === -1); + done(); + } + ); }); }); } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 26bf95af3d43..f382801f229d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -3,23 +3,29 @@ var eslint = require("eslint"); var unpad = require("dedent"); -function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, overrideConfig) { +function verifyAndAssertMessages( + code, + rules, + expectedMessages, + sourceType, + overrideConfig +) { var config = { parser: require.resolve(".."), rules, env: { node: true, - es6: true + es6: true, }, parserOptions: { ecmaVersion: 8, ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true, - globalReturn: true + globalReturn: true, }, - sourceType - } + sourceType, + }, }; if (overrideConfig) { @@ -31,11 +37,19 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over var messages = eslint.linter.verify(code, config); if (messages.length !== expectedMessages.length) { - throw new Error(`Expected ${expectedMessages.length} message(s), got ${messages.length}\n${JSON.stringify(messages, null, 2)}`); + throw new Error( + `Expected ${expectedMessages.length} message(s), got ${messages.length}\n${JSON.stringify( + messages, + null, + 2 + )}` + ); } messages.forEach((message, i) => { - var formatedMessage = `${message.line}:${message.column} ${message.message}${(message.ruleId ? ` ${message.ruleId}` : "")}`; + var formatedMessage = `${message.line}:${message.column} ${message.message}${message.ruleId + ? ` ${message.ruleId}` + : ""}`; if (formatedMessage !== expectedMessages[i]) { throw new Error( unpad(` @@ -50,27 +64,21 @@ function verifyAndAssertMessages(code, rules, expectedMessages, sourceType, over describe("verify", () => { it("arrow function support (issue #1)", () => { - verifyAndAssertMessages( - "describe('stuff', () => {});", - {}, - [] - ); + verifyAndAssertMessages("describe('stuff', () => {});", {}, []); }); it("EOL validation (issue #2)", () => { verifyAndAssertMessages( - "module.exports = \"something\";", - { "eol-last": 1, "semi": 1 }, - [ "1:30 Newline required at end of file but not found. eol-last" ] + 'module.exports = "something";', + { "eol-last": 1, semi: 1 }, + ["1:30 Newline required at end of file but not found. eol-last"] ); }); xit("Readable error messages (issue #3)", () => { - verifyAndAssertMessages( - "{ , res }", - {}, - [ "1:3 Parsing error: Unexpected token" ] - ); + verifyAndAssertMessages("{ , res }", {}, [ + "1:3 Parsing error: Unexpected token", + ]); }); it("Modules support (issue #5)", () => { @@ -120,7 +128,7 @@ describe("verify", () => { it("JSX attribute names marked as variables (issue #12)", () => { verifyAndAssertMessages( - "module.exports =
", + 'module.exports =
', { "no-undef": 1 }, [] ); @@ -136,8 +144,8 @@ describe("verify", () => { it("Arrow function with non-block bodies (issue #20)", () => { verifyAndAssertMessages( - "\"use strict\"; () => 1", - { "strict": [1, "global"] }, + '"use strict"; () => 1', + { strict: [1, "global"] }, [], "script" ); @@ -145,7 +153,7 @@ describe("verify", () => { it("#242", () => { verifyAndAssertMessages( - "\"use strict\"; asdf;", + '"use strict"; asdf;', { "no-irregular-whitespace": 1 }, [], {} @@ -191,19 +199,11 @@ describe("verify", () => { }); it("type alias", () => { - verifyAndAssertMessages( - "type SomeNewType = any;", - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("type SomeNewType = any;", { "no-undef": 1 }, []); }); it("type cast expression #102", () => { - verifyAndAssertMessages( - "for (let a of (a: Array)) {}", - {}, - [] - ); + verifyAndAssertMessages("for (let a of (a: Array)) {}", {}, []); }); it("multiple nullable type annotations and return #108", () => { @@ -231,7 +231,7 @@ describe("verify", () => { }; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "2:11 'Bar' is defined but never used. no-unused-vars" ] + ["2:11 'Bar' is defined but never used. no-unused-vars"] ); }); @@ -246,7 +246,7 @@ describe("verify", () => { new Log(); `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "3:34 'T4' is defined but never used. no-unused-vars" ] + ["3:34 'T4' is defined but never used. no-unused-vars"] ); }); @@ -259,9 +259,11 @@ describe("verify", () => { new Foo(); `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:1 'T' is not defined. no-undef", + [ + "1:1 'T' is not defined. no-undef", "2:11 'T' is defined but never used. no-unused-vars", - "3:1 'T' is not defined. no-undef" ] + "3:1 'T' is not defined. no-undef", + ] ); }); @@ -274,8 +276,10 @@ describe("verify", () => { } `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "2:11 'Log' is defined but never used. no-unused-vars", - "2:38 'T4' is defined but never used. no-unused-vars" ] + [ + "2:11 'Log' is defined but never used. no-unused-vars", + "2:38 'T4' is defined but never used. no-unused-vars", + ] ); }); @@ -288,9 +292,11 @@ describe("verify", () => { Foo; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:1 'T' is not defined. no-undef", + [ + "1:1 'T' is not defined. no-undef", "2:15 'T' is defined but never used. no-unused-vars", - "3:1 'T' is not defined. no-undef" ] + "3:1 'T' is not defined. no-undef", + ] ); }); @@ -304,8 +310,10 @@ describe("verify", () => { }; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "2:6 'Log' is defined but never used. no-unused-vars", - "2:29 'T3' is defined but never used. no-unused-vars" ] + [ + "2:6 'Log' is defined but never used. no-unused-vars", + "2:29 'T3' is defined but never used. no-unused-vars", + ] ); }); @@ -318,9 +326,11 @@ describe("verify", () => { Foo; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:1 'T' is not defined. no-undef", + [ + "1:1 'T' is not defined. no-undef", "2:10 'T' is defined but never used. no-unused-vars", - "3:1 'T' is not defined. no-undef" ] + "3:1 'T' is not defined. no-undef", + ] ); }); @@ -333,7 +343,7 @@ describe("verify", () => { log(1, 2); `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "3:37 'T4' is defined but never used. no-unused-vars" ] + ["3:37 'T4' is defined but never used. no-unused-vars"] ); }); @@ -346,9 +356,11 @@ describe("verify", () => { log; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:1 'T' is not defined. no-undef", + [ + "1:1 'T' is not defined. no-undef", "2:14 'T' is defined but never used. no-unused-vars", - "3:1 'T' is not defined. no-undef" ] + "3:1 'T' is not defined. no-undef", + ] ); }); @@ -544,8 +556,10 @@ describe("verify", () => { var b: T = 1; b; `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "1:21 'T' is defined but never used. no-unused-vars", - "2:8 'T' is not defined. no-undef" ] + [ + "1:21 'T' is defined but never used. no-unused-vars", + "2:8 'T' is not defined. no-undef", + ] ); }); @@ -556,7 +570,7 @@ describe("verify", () => { export class Foo extends Bar {} `), { "no-unused-vars": 1, "no-undef": 1 }, - [ "2:30 'T' is not defined. no-undef" ] + ["2:30 'T' is not defined. no-undef"] ); }); @@ -581,8 +595,10 @@ describe("verify", () => { type T = {a: number, ...U, ...V}; `), { "no-undef": 1, "no-unused-vars": 1 }, - [ "2:6 'T' is defined but never used. no-unused-vars", - "2:31 'V' is not defined. no-undef" ] + [ + "2:6 'T' is defined but never used. no-unused-vars", + "2:31 'V' is not defined. no-undef", + ] ); }); @@ -1289,11 +1305,9 @@ describe("verify", () => { }); it("detects minimal no-unused-vars case #120", () => { - verifyAndAssertMessages( - "var unused;", - { "no-unused-vars": 1 }, - [ "1:5 'unused' is defined but never used. no-unused-vars" ] - ); + verifyAndAssertMessages("var unused;", { "no-unused-vars": 1 }, [ + "1:5 'unused' is defined but never used. no-unused-vars", + ]); }); // This two tests are disabled, as the feature to visit properties when @@ -1343,7 +1357,7 @@ describe("verify", () => { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - [ "1:8 'Bacona' is assigned a value but never used. no-unused-vars" ] + ["1:8 'Bacona' is assigned a value but never used. no-unused-vars"] ); }); @@ -1389,7 +1403,7 @@ describe("verify", () => { it("ternary and parens #149", () => { verifyAndAssertMessages( - "true ? (true) : false;", + "true ? (true) : false;", { "space-infix-ops": 1 }, [] ); @@ -1407,7 +1421,7 @@ describe("verify", () => { }); `), { "space-in-parens": 1 }, - [ ] + [] ); }); @@ -1425,21 +1439,23 @@ describe("verify", () => { }); `), { "space-in-parens": 1 }, - [ ] + [] ); }); it("no no-undef error with rest #11", () => { - verifyAndAssertMessages("const [a, ...rest] = ['1', '2', '3']; a; rest;", + verifyAndAssertMessages( + "const [a, ...rest] = ['1', '2', '3']; a; rest;", { "no-undef": 1, "no-unused-vars": 1 }, - [ ] + [] ); }); it("async function with space-before-function-paren #168", () => { - verifyAndAssertMessages("it('handles updates', async function() {});", + verifyAndAssertMessages( + "it('handles updates', async function() {});", { "space-before-function-paren": [1, "never"] }, - [ ] + [] ); }); @@ -1458,7 +1474,7 @@ describe("verify", () => { } `), { "no-unused-vars": 1, "no-undef": 1 }, - [ ] + [] ); }); @@ -1469,16 +1485,12 @@ describe("verify", () => { var x = 1; `), { "no-use-before-define": 1 }, - [ "1:13 'x' was used before it was defined. no-use-before-define" ] + ["1:13 'x' was used before it was defined. no-use-before-define"] ); }); it("jsx and stringliteral #216", () => { - verifyAndAssertMessages( - "
", - {}, - [] - ); + verifyAndAssertMessages("
", {}, []); }); it("getter/setter #218", () => { @@ -1488,7 +1500,11 @@ describe("verify", () => { set a (v) { } } `), - { "space-before-function-paren": 1, "keyword-spacing": [1, { "before": true }], "indent": 1 }, + { + "space-before-function-paren": 1, + "keyword-spacing": [1, { before: true }], + indent: 1, + }, [] ); }); @@ -1531,7 +1547,7 @@ describe("verify", () => { var a = 123; `), { "no-redeclare": 1 }, - [ "2:5 'a' is already defined. no-redeclare" ], + ["2:5 'a' is already defined. no-redeclare"], "script" ); }); @@ -1543,7 +1559,7 @@ describe("verify", () => { var a = 123; `), { "no-redeclare": 1 }, - [ "2:5 'a' is already defined. no-redeclare" ], + ["2:5 'a' is already defined. no-redeclare"], "module" ); }); @@ -1552,11 +1568,13 @@ describe("verify", () => { verifyAndAssertMessages( "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, - [ "1:5 Implicit global variable, assign as global property instead. no-implicit-globals" ], + [ + "1:5 Implicit global variable, assign as global property instead. no-implicit-globals", + ], "script", { env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "script" } + parserOptions: { ecmaVersion: 6, sourceType: "script" }, } ); }); @@ -1569,7 +1587,7 @@ describe("verify", () => { "module", { env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "module" } + parserOptions: { ecmaVersion: 6, sourceType: "module" }, } ); }); @@ -1582,7 +1600,7 @@ describe("verify", () => { null, { env: {}, - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, } ); }); @@ -1599,26 +1617,23 @@ describe("verify", () => { "module", { env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "module", allowImportExportEverywhere: true } + parserOptions: { + ecmaVersion: 6, + sourceType: "module", + allowImportExportEverywhere: true, + }, } ); }); it("with does not crash parsing in script mode (strict off) #171", () => { - verifyAndAssertMessages( - "with (arguments) { length; }", - {}, - [], - "script" - ); + verifyAndAssertMessages("with (arguments) { length; }", {}, [], "script"); }); xit("with does crash parsing in module mode (strict on) #171", () => { - verifyAndAssertMessages( - "with (arguments) { length; }", - {}, - [ "1:1 Parsing error: 'with' in strict mode" ] - ); + verifyAndAssertMessages("with (arguments) { length; }", {}, [ + "1:1 Parsing error: 'with' in strict mode", + ]); }); it("new.target is not reported as undef #235", () => { @@ -1638,7 +1653,7 @@ describe("verify", () => { } `), { "no-undef": 1 }, - [ "2:4 'test' is not defined. no-undef" ] + ["2:4 'test' is not defined. no-undef"] ); }); @@ -1723,24 +1738,18 @@ describe("verify", () => { new A `), { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, - [ - "5:11 'b' is not defined. no-undef" - ] + ["5:11 'b' is not defined. no-undef"] ); }); }); it("dynamic import support", () => { - verifyAndAssertMessages( - "import('test-module').then(() => {})", - {}, - [] - ); + verifyAndAssertMessages("import('test-module').then(() => {})", {}, []); }); it("regex with es6 unicodeCodePointEscapes", () => { verifyAndAssertMessages( - "string.replace(/[\u{0000A0}-\u{10FFFF}<>\&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", + "string.replace(/[\u{0000A0}-\u{10FFFF}<>&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", {}, [] ); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 134eda3e5602..e2c20316226a 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -27,7 +27,7 @@ ajv@^4.7.0: co "^4.6.0" json-stable-stringify "^1.0.1" -ansi-escapes@^1.1.0: +ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -39,6 +39,10 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +app-root-path@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" + argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -259,16 +263,31 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +ci-info@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -cli-cursor@^1.0.1: +cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" +cli-spinners@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" + +cli-truncate@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + dependencies: + slice-ansi "0.0.4" + string-width "^1.0.1" + cli-width@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" @@ -281,7 +300,7 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" -commander@2.9.0: +commander@2.9.0, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -307,12 +326,37 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" +cosmiconfig@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-1.1.0.tgz#0dea0f9804efdfb929fbb1b188e25553ea053d37" + dependencies: + graceful-fs "^4.1.2" + js-yaml "^3.4.3" + minimist "^1.2.0" + object-assign "^4.0.1" + os-homedir "^1.0.1" + parse-json "^2.2.0" + pinkie-promise "^2.0.0" + require-from-string "^1.1.0" + +cross-spawn@^5.0.1: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" dependencies: es5-ext "^0.10.9" +date-fns@^1.27.2: + version "1.28.5" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" + debug@2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" @@ -356,6 +400,16 @@ doctrine@^2.0.0: esutils "^2.0.2" isarray "^1.0.0" +elegant-spinner@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: version "0.10.15" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" @@ -421,9 +475,9 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-babel@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-6.0.0.tgz#66feedf6ce6e04abe585cec1a65b5bcc96bed50a" +eslint-config-babel@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.1.tgz#aac7b79f2f06f52358a5a764fdc01fde23718572" eslint-plugin-flowtype@^2.30.3: version "2.30.3" @@ -431,6 +485,13 @@ eslint-plugin-flowtype@^2.30.3: dependencies: lodash "^4.15.0" +eslint-plugin-prettier@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz#4b90f4ee7f92bfbe2e926017e1ca40eb628965ea" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^20.0.1" + eslint@^3.18.0: version "3.18.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" @@ -514,15 +575,31 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" +execa@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" + dependencies: + cross-spawn "^5.0.1" + get-stream "^3.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" +fast-diff@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -figures@^1.3.5: +figures@^1.3.5, figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: @@ -536,6 +613,10 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -559,6 +640,10 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" +get-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + glob@7.0.5: version "7.0.5" resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95" @@ -618,6 +703,15 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +husky@^0.13.2: + version "0.13.4" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407" + dependencies: + chalk "^1.1.3" + find-parent-dir "^0.3.0" + is-ci "^1.0.9" + normalize-path "^1.0.0" + ignore@^3.2.0: version "3.2.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" @@ -626,6 +720,16 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +indent-string@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -665,6 +769,22 @@ invariant@^2.2.0: dependencies: loose-envify "^1.0.0" +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-ci@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + dependencies: + ci-info "^1.0.0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -700,6 +820,10 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" @@ -710,15 +834,27 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" +is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +jest-docblock@^20.0.1: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" + js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.5.1: +js-yaml@^3.4.3, js-yaml@^3.5.1: version "3.8.2" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" dependencies: @@ -750,6 +886,67 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +lint-staged@^3.6.1: + version "3.6.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.6.1.tgz#24423c8b7bd99d96e15acd1ac8cb392a78e58582" + dependencies: + app-root-path "^2.0.0" + cosmiconfig "^1.1.0" + execa "^0.7.0" + listr "^0.12.0" + lodash.chunk "^4.2.0" + minimatch "^3.0.0" + npm-which "^3.0.1" + p-map "^1.1.1" + staged-git-files "0.0.4" + +listr-silent-renderer@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + +listr-update-renderer@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + elegant-spinner "^1.0.1" + figures "^1.7.0" + indent-string "^3.0.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + strip-ansi "^3.0.1" + +listr-verbose-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.0.tgz#44dc01bb0c34a03c572154d4d08cde9b1dc5620f" + dependencies: + chalk "^1.1.3" + cli-cursor "^1.0.2" + date-fns "^1.27.2" + figures "^1.7.0" + +listr@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" + dependencies: + chalk "^1.1.3" + cli-truncate "^0.2.1" + figures "^1.7.0" + indent-string "^2.1.0" + is-promise "^2.1.0" + is-stream "^1.1.0" + listr-silent-renderer "^1.1.1" + listr-update-renderer "^0.2.0" + listr-verbose-renderer "^0.4.0" + log-symbols "^1.0.2" + log-update "^1.0.2" + ora "^0.2.3" + p-map "^1.1.1" + rxjs "^5.0.0-beta.11" + stream-to-observable "^0.1.0" + strip-ansi "^3.0.1" + lodash._baseassign@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" @@ -773,6 +970,10 @@ lodash._isiterateecall@^3.0.0: version "3.0.9" resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" +lodash.chunk@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" + lodash.create@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" @@ -805,13 +1006,33 @@ lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +log-symbols@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + dependencies: + chalk "^1.0.0" + +log-update@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + dependencies: + ansi-escapes "^1.0.0" + cli-cursor "^1.0.2" + loose-envify@^1.0.0: version "1.3.1" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" dependencies: js-tokens "^3.0.0" -minimatch@^3.0.2: +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +minimatch@^3.0.0, minimatch@^3.0.2: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -821,6 +1042,10 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -859,6 +1084,30 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +normalize-path@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" + +npm-path@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.3.tgz#15cff4e1c89a38da77f56f6055b24f975dfb2bbe" + dependencies: + which "^1.2.10" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + dependencies: + path-key "^2.0.0" + +npm-which@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + dependencies: + commander "^2.9.0" + npm-path "^2.0.2" + which "^1.2.10" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -888,10 +1137,33 @@ optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -os-homedir@^1.0.0: +ora@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" + dependencies: + chalk "^1.1.1" + cli-cursor "^1.0.2" + cli-spinners "^0.1.2" + object-assign "^4.0.1" + +os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + +p-map@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -900,6 +1172,10 @@ path-is-inside@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" +path-key@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" @@ -926,6 +1202,10 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" +prettier@1.4.4: + version "1.4.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.4.tgz#a8d1447b14c9bf67e6d420dcadd10fb9a4fad65a" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -934,6 +1214,10 @@ progress@^1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + readable-stream@^2.2.2: version "2.2.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" @@ -964,6 +1248,16 @@ regenerator-runtime@^0.10.0: version "0.10.3" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +require-from-string@^1.1.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" + require-uncached@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -1004,6 +1298,22 @@ rx-lite@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +rxjs@^5.0.0-beta.11: + version "5.4.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.1.tgz#b62f757f279445d265a18a58fb0a70dc90e91626" + dependencies: + symbol-observable "^1.0.1" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + shelljs@^0.7.5: version "0.7.7" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" @@ -1012,6 +1322,10 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -1020,6 +1334,14 @@ sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" +staged-git-files@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" + +stream-to-observable@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" + string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -1039,7 +1361,7 @@ string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -strip-ansi@^3.0.0: +strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" dependencies: @@ -1049,6 +1371,10 @@ strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -1063,6 +1389,10 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" +symbol-observable@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -1110,6 +1440,12 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +which@^1.2.10, which@^1.2.9: + version "1.2.14" + resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + dependencies: + isexe "^2.0.0" + wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -1127,3 +1463,7 @@ write@^0.2.1: xtend@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" From 6aec93c46858b96aab63b1ae8e88be20e45d10a1 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 18 Jun 2017 18:30:59 -0400 Subject: [PATCH 588/965] Merge pull request babel/babel-eslint#493 from danez/regression-test Test for babylon regression --- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/non-regression.js | 15 +++++++++++++++ eslint/babel-eslint-parser/yarn.lock | 6 +++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 90eb98e74e7b..7b37cfeeb7b0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,7 @@ "babel-code-frame": "7.0.0-alpha.12", "babel-traverse": "7.0.0-alpha.12", "babel-types": "7.0.0-alpha.12", - "babylon": "7.0.0-beta.13" + "babylon": "7.0.0-beta.14" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index f382801f229d..a260f94eeef0 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1780,4 +1780,19 @@ describe("verify", () => { ); }); }); + + it("flow types on class method should be visited correctly", () => { + verifyAndAssertMessages( + unpad(` + import type NodeType from 'foo'; + class NodeUtils { + finishNodeAt(node: T): T { return node; } + } + + new NodeUtils(); + `), + { "no-unused-vars": 1 }, + [] + ); + }); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index e2c20316226a..5e82ccbab562 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -212,9 +212,9 @@ babylon@7.0.0-beta.12: version "7.0.0-beta.12" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" -babylon@7.0.0-beta.13: - version "7.0.0-beta.13" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.13.tgz#12425c1bfd9498be419021ed36b43fe4f0289c0a" +babylon@7.0.0-beta.14: + version "7.0.0-beta.14" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.14.tgz#72aa3c493c984c2edc54d4bc077b74066ed4511d" babylon@7.0.0-beta.8: version "7.0.0-beta.8" From d40a6dd9b7878521368a89fb0e7355f763456422 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 18 Jun 2017 18:33:40 -0400 Subject: [PATCH 589/965] 8.0.0-alpha.13 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7b37cfeeb7b0..575343b9462d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.0-alpha.12", + "version": "8.0.0-alpha.13", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 9a791d175c1ac5c20221f5af5ff484949623c9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kevin=20M=C3=A5rtensson?= Date: Tue, 20 Jun 2017 23:49:46 +0200 Subject: [PATCH 590/965] Update install instructions to use latest stable release (babel/babel-eslint#497) [skip ci] --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index fc5a54035fee..3690e3dff924 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -56,7 +56,7 @@ ESLint | babel-eslint ### Install ```sh -$ npm install eslint@3.x babel-eslint@6 --save-dev +$ npm install eslint@3.x babel-eslint@7 --save-dev ``` ### Setup From dcb4bffee5e24facb150514770e62e892c63864e Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 22 Jun 2017 13:18:47 -0700 Subject: [PATCH 591/965] chore(package): update husky to version 0.14.0 (babel/babel-eslint#498) --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 575343b9462d..521c0807b80c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -43,7 +43,7 @@ "eslint-plugin-flowtype": "^2.30.3", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.4.0", - "husky": "^0.13.2", + "husky": "^0.14.0", "lint-staged": "^3.6.1", "mocha": "^3.0.0", "prettier": "1.4.4" From 469e679b6d8a24846f25af824d639798f13bc671 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Sun, 25 Jun 2017 08:30:29 -0700 Subject: [PATCH 592/965] =?UTF-8?q?Update=20eslint=20to=20the=20latest=20v?= =?UTF-8?q?ersion=20=F0=9F=9A=80=20(babel/babel-eslint#500)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(package): update eslint to version 4.1.0 * escope -> eslint-scope * Fix linting --- eslint/babel-eslint-parser/package.json | 8 +- .../babel-eslint-parser/test/babel-eslint.js | 2 +- eslint/babel-eslint-parser/yarn.lock | 585 +++++++----------- 3 files changed, 245 insertions(+), 350 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 521c0807b80c..d964f539b0bd 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -36,17 +36,17 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "babel-eslint": "^7.0.0", + "babel-eslint": "^8.0.0-alpha.13", "dedent": "^0.7.0", - "eslint": "^3.18.0", + "eslint": "^4.1.0", "eslint-config-babel": "^7.0.1", "eslint-plugin-flowtype": "^2.30.3", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.4.0", "husky": "^0.14.0", - "lint-staged": "^3.6.1", + "lint-staged": "^4.0.0", "mocha": "^3.0.0", - "prettier": "1.4.4" + "prettier": "^1.4.4" }, "lint-staged": { "*.js": [ diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 2ac2d3af581a..4683aa86adeb 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,7 +1,7 @@ var assert = require("assert"); var babelEslint = require(".."); var espree = require("espree"); -var escope = require("escope"); +var escope = require("eslint-scope"); var util = require("util"); var unpad = require("dedent"); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 5e82ccbab562..c59da6113b1f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -8,29 +8,33 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" -acorn@4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a" - acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn@^5.0.1: + version "5.0.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" + ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" ajv@^4.7.0: - version "4.11.5" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd" + version "4.11.8" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" dependencies: co "^4.6.0" json-stable-stringify "^1.0.1" -ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: +ansi-escapes@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -79,7 +83,7 @@ babel-code-frame@7.0.0-alpha.3: esutils "^2.0.2" js-tokens "^3.0.0" -babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: +babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" dependencies: @@ -87,15 +91,14 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-eslint@^7.0.0: - version "7.1.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.1.1.tgz#8a6a884f085aa7060af69cfc77341c2f99370fb2" +babel-eslint@^8.0.0-alpha.13: + version "8.0.0-alpha.13" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.0-alpha.13.tgz#47c6f04d4c7ef5084f5a849ffe5a8a48f17db7df" dependencies: - babel-code-frame "^6.16.0" - babel-traverse "^6.15.0" - babel-types "^6.15.0" - babylon "^6.13.0" - lodash.pickby "^4.6.0" + babel-code-frame "7.0.0-alpha.12" + babel-traverse "7.0.0-alpha.12" + babel-types "7.0.0-alpha.12" + babylon "7.0.0-beta.14" babel-helper-function-name@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -120,19 +123,6 @@ babel-messages@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - dependencies: - babel-runtime "^6.22.0" - -babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - babel-template@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.7.tgz#82e26500980d1b3f14d9ebe8ae8b9325dc158392" @@ -169,20 +159,6 @@ babel-traverse@7.0.0-alpha.7: invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@^6.15.0: - version "6.23.1" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.23.1.tgz#d3cb59010ecd06a97d81310065f966b699e14f48" - dependencies: - babel-code-frame "^6.22.0" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.23.0" - babylon "^6.15.0" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - babel-types@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.12.tgz#d7b2c6d0c49c518fd36de5ac14f4f50bed6de7e5" @@ -199,15 +175,6 @@ babel-types@7.0.0-alpha.7: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@^6.15.0, babel-types@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.23.0.tgz#bb17179d7538bad38cd0c9e115d340f77e7e9acf" - dependencies: - babel-runtime "^6.22.0" - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - babylon@7.0.0-beta.12: version "7.0.0-beta.12" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" @@ -220,29 +187,21 @@ babylon@7.0.0-beta.8: version "7.0.0-beta.8" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" -babylon@^6.13.0, babylon@^6.15.0: - version "6.17.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.0.tgz#37da948878488b9c4e3c4038893fa3314b3fc932" - -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" -brace-expansion@^1.0.0: - version "1.1.6" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" dependencies: - balanced-match "^0.4.1" + balanced-match "^1.0.0" concat-map "0.0.1" browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" -buffer-shims@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" - caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -271,12 +230,18 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -cli-cursor@^1.0.1, cli-cursor@^1.0.2: +cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" dependencies: restore-cursor "^1.0.1" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + cli-spinners@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" @@ -310,7 +275,7 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.5.2: +concat-stream@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" dependencies: @@ -318,10 +283,6 @@ concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" - core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -347,27 +308,21 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - date-fns@^1.27.2: version "1.28.5" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" -debug@2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" +debug@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" dependencies: - ms "0.7.1" + ms "0.7.2" -debug@^2.1.1, debug@^2.2.0: - version "2.6.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.3.tgz#0f7eb8c30965ec08c72accfa0130c8b79984141d" +debug@^2.2.0, debug@^2.6.8: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: - ms "0.7.2" + ms "2.0.0" dedent@^0.7.0: version "0.7.0" @@ -389,9 +344,9 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -diff@1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" doctrine@^2.0.0: version "2.0.0" @@ -410,78 +365,17 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.15" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.15.tgz#c330a5934c1ee21284a7c081a86e5fd937c91ea6" - dependencies: - es6-iterator "2" - es6-symbol "~3.1" - -es6-iterator@2, es6-iterator@^2.0.1, es6-iterator@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.1.tgz#8e319c9f0453bf575d374940a655920e59ca5512" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-symbol "^3.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1, es6-symbol@^3.1.1, es6-symbol@~3.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - eslint-config-babel@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.1.tgz#aac7b79f2f06f52358a5a764fdc01fde23718572" eslint-plugin-flowtype@^2.30.3: - version "2.30.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.30.3.tgz#57835d2c0ed388da7a2725803ec32af2f437c301" + version "2.34.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" dependencies: lodash "^4.15.0" @@ -492,51 +386,56 @@ eslint-plugin-prettier@^2.1.2: fast-diff "^1.1.1" jest-docblock "^20.0.1" -eslint@^3.18.0: - version "3.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b" +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.1.0.tgz#bbb55a28220ee08b69da9554d45a6b2ebfd7d913" dependencies: - babel-code-frame "^6.16.0" + babel-code-frame "^6.22.0" chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" + concat-stream "^1.6.0" + debug "^2.6.8" doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" + eslint-scope "^3.7.1" + espree "^3.4.3" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" + glob "^7.1.2" + globals "^9.17.0" + ignore "^3.3.3" imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" + inquirer "^3.0.6" + is-my-json-valid "^2.16.0" is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" + js-yaml "^3.8.4" + json-stable-stringify "^1.0.1" levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" + path-is-inside "^1.0.2" + pluralize "^4.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" strip-json-comments "~2.0.1" - table "^3.7.8" + table "^4.0.1" text-table "~0.2.0" - user-home "^2.0.0" -espree@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.0.tgz#41656fa5628e042878025ef467e78f125cb86e1d" +espree@^3.4.0, espree@^3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: - acorn "4.0.4" + acorn "^5.0.1" acorn-jsx "^3.0.0" esprima@^3.1.1: @@ -550,31 +449,20 @@ esquery@^1.0.0: estraverse "^4.0.0" esrecurse@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.1.0.tgz#4713b6536adf7f2ac4f327d559e7756bff648220" + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" dependencies: - estraverse "~4.1.0" + estraverse "^4.1.0" object-assign "^4.0.1" -estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -estraverse@~4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.1.1.tgz#f6caca728933a850ef90661d0e17982ba47111a2" - esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - execa@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" @@ -591,6 +479,14 @@ exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" +external-editor@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" + dependencies: + iconv-lite "^0.4.17" + jschardet "^1.4.2" + tmp "^0.0.31" + fast-diff@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b" @@ -599,13 +495,19 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -figures@^1.3.5, figures@^1.7.0: +figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" @@ -613,10 +515,6 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -644,9 +542,9 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" -glob@7.0.5: - version "7.0.5" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.0.5.tgz#b4202a69099bbb4d292a7c1b95b6682b67ebdc95" +glob@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -655,20 +553,20 @@ glob@7.0.5: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" inherits "2" - minimatch "^3.0.2" + minimatch "^3.0.4" once "^1.3.0" path-is-absolute "^1.0.0" -globals@^9.0.0, globals@^9.14.0: - version "9.16.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.16.0.tgz#63e903658171ec2d9f51b1d31de5e2b8dc01fb80" +globals@^9.0.0, globals@^9.17.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" globby@^5.0.0: version "5.0.0" @@ -703,18 +601,21 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" -husky@^0.13.2: - version "0.13.4" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.13.4.tgz#48785c5028de3452a51c48c12c4f94b2124a1407" +husky@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.1.tgz#8edba33e728ceed75343e88bb8002e4cbd8d1b40" dependencies: - chalk "^1.1.3" - find-parent-dir "^0.3.0" - is-ci "^1.0.9" + is-ci "^1.0.10" normalize-path "^1.0.0" + strip-indent "^2.0.0" -ignore@^3.2.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.6.tgz#26e8da0644be0bb4cb39516f6c79f0e0f4ffe48c" +iconv-lite@^0.4.17: + version "0.4.18" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" + +ignore@^3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" imurmurhash@^0.1.4: version "0.1.4" @@ -737,32 +638,29 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@~2.0.1: +inherits@2, inherits@^2.0.3, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" +inquirer@^3.0.6: + version "3.1.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" + ansi-escapes "^2.0.0" chalk "^1.0.0" - cli-cursor "^1.0.1" + cli-cursor "^2.1.0" cli-width "^2.0.0" - figures "^1.3.5" + external-editor "^2.0.4" + figures "^2.0.0" lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.0.0" strip-ansi "^3.0.0" through "^2.3.6" -interpret@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" - invariant@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" @@ -773,7 +671,7 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" -is-ci@^1.0.9: +is-ci@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" dependencies: @@ -795,7 +693,7 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-my-json-valid@^2.10.0: +is-my-json-valid@^2.16.0: version "2.16.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" dependencies: @@ -854,14 +752,18 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.4.3, js-yaml@^3.5.1: - version "3.8.2" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.2.tgz#02d3e2c0f6beab20248d412c352203827d786721" +js-yaml@^3.4.3, js-yaml@^3.8.4: + version "3.8.4" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: +jschardet@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" + +json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" dependencies: @@ -886,9 +788,9 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^3.6.1: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-3.6.1.tgz#24423c8b7bd99d96e15acd1ac8cb392a78e58582" +lint-staged@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.0.tgz#c15669f598614a6e68090303e175a799d48e0d85" dependencies: app-root-path "^2.0.0" cosmiconfig "^1.1.0" @@ -998,11 +900,7 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.pickby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff" - -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -1032,11 +930,15 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -minimatch@^3.0.0, minimatch@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" +mimic-fn@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: - brace-expansion "^1.0.0" + brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" @@ -1046,39 +948,39 @@ minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: +mkdirp@0.5.1, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" mocha@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.2.0.tgz#7dc4f45e5088075171a68896814e6ae9eb7a85e3" + version "3.4.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" dependencies: browser-stdout "1.3.0" commander "2.9.0" - debug "2.2.0" - diff "1.4.0" + debug "2.6.0" + diff "3.2.0" escape-string-regexp "1.0.5" - glob "7.0.5" + glob "7.1.1" growl "1.9.2" json3 "3.3.2" lodash.create "3.1.1" mkdirp "0.5.1" supports-color "3.1.2" -ms@0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" - ms@0.7.2: version "0.7.2" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" natural-compare@^1.4.0: version "1.4.0" @@ -1126,6 +1028,12 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" @@ -1146,10 +1054,14 @@ ora@^0.2.3: cli-spinners "^0.1.2" object-assign "^4.0.1" -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +os-tmpdir@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -1168,7 +1080,7 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" @@ -1176,10 +1088,6 @@ path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -1194,15 +1102,15 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +pluralize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prettier@1.4.4: +prettier@^1.4.4: version "1.4.4" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.4.tgz#a8d1447b14c9bf67e6d420dcadd10fb9a4fad65a" @@ -1210,44 +1118,26 @@ process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" readable-stream@^2.2.2: - version "2.2.6" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.6.tgz#8b43aed76e71483938d12a8d46c6cf1a00b1f816" + version "2.3.2" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.2.tgz#5a04df05e4f57fe3f0dc68fdd11dc5c97c7e6f4d" dependencies: - buffer-shims "^1.0.0" core-util-is "~1.0.0" - inherits "~2.0.1" + inherits "~2.0.3" isarray "~1.0.0" process-nextick-args "~1.0.6" - string_decoder "~0.10.x" + safe-buffer "~5.1.0" + string_decoder "~1.0.0" util-deprecate "~1.0.1" -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - -regenerator-runtime@^0.10.0: - version "0.10.3" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.3.tgz#8c4367a904b51ea62a908ac310bf99ff90a82a3e" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -1258,7 +1148,7 @@ require-from-string@^1.1.0: version "1.2.1" resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" -require-uncached@^1.0.2: +require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" dependencies: @@ -1269,12 +1159,6 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve@^1.1.6: - version "1.3.2" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.2.tgz#1f0442c9e0cbb8136e87b9305f932f46c7f28235" - dependencies: - path-parse "^1.0.5" - restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -1282,21 +1166,34 @@ restore-cursor@^1.0.1: exit-hook "^1.0.0" onetime "^1.0.0" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + rimraf@^2.2.8: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: glob "^7.0.5" -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" dependencies: - once "^1.3.0" + is-promise "^2.1.0" -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" rxjs@^5.0.0-beta.11: version "5.4.1" @@ -1304,6 +1201,10 @@ rxjs@^5.0.0-beta.11: dependencies: symbol-observable "^1.0.1" +safe-buffer@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -1314,15 +1215,7 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shelljs@^0.7.5: - version "0.7.7" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.7.tgz#b2f5c77ef97148f4b4f6e22682e10bba8667cff1" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - -signal-exit@^3.0.0: +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -1357,9 +1250,11 @@ string-width@^2.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^3.0.0" -string_decoder@~0.10.x: - version "0.10.31" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string_decoder@~1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" @@ -1367,14 +1262,14 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" +strip-indent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -1393,9 +1288,9 @@ symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" +table@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435" dependencies: ajv "^4.7.0" ajv-keywords "^1.0.0" @@ -1412,9 +1307,15 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +tmp@^0.0.31: + version "0.0.31" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" + dependencies: + os-tmpdir "~1.0.1" + to-fast-properties@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" tryit@^1.0.1: version "1.0.3" @@ -1430,12 +1331,6 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" From c9b8d2dfd153c93b1be34f2bc29dc8f2a21cb49e Mon Sep 17 00:00:00 2001 From: Evan Brodie Date: Sun, 9 Jul 2017 21:03:59 -0400 Subject: [PATCH 593/965] Readme update usage section (babel/babel-eslint#501) [skip ci] * Updates README: Consolidates versioning table Basically a revert of 52b4a13. It is easier to read a single table instead of two locations in the README for the version compatabilities between ESLint and babel-eslint * Updates README: Add yarn command for installation * [skip ci] --- eslint/babel-eslint-parser/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 3690e3dff924..be6878570a22 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -43,20 +43,22 @@ It just needs to export a `parse` method that takes in a string of code and outp ## Usage -> ESLint 1.x | Use <= 5.x - -> ESLint 2.x | Use >= 6.x - ### Supported ESLint versions ESLint | babel-eslint ------------ | ------------- 3.x | >= 6.x +2.x | >= 6.x +1.x | >= 5.x ### Install +Ensure that you have substituted the correct version lock for `eslint` and `babel-eslint` into this command: + ```sh $ npm install eslint@3.x babel-eslint@7 --save-dev +# or +$ yarn add eslint@3.x babel-eslint@7 -D ``` ### Setup From 522140b43fdef120a9fcd04c20d015a5715fe181 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 13 Jul 2017 12:58:45 -0400 Subject: [PATCH 594/965] update (babel/babel-eslint#504) --- eslint/babel-eslint-parser/index.js | 2 + eslint/babel-eslint-parser/package.json | 8 +-- .../test/non-regression.js | 50 +++++++++++++ eslint/babel-eslint-parser/yarn.lock | 70 +++++++++++++++++++ 4 files changed, 126 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ecedcb50ad84..79eb5a3c7db1 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -391,6 +391,7 @@ exports.parseNoPatch = function(code, options) { allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, ranges: true, + tokens: true, plugins: [ "flow", "jsx", @@ -412,6 +413,7 @@ exports.parseNoPatch = function(code, options) { "optionalChaining", "importMeta", "classPrivateProperties", + "bigInt", ], }; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d964f539b0bd..008e97bd575b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "7.0.0-alpha.12", - "babel-traverse": "7.0.0-alpha.12", - "babel-types": "7.0.0-alpha.12", - "babylon": "7.0.0-beta.14" + "babel-code-frame": "7.0.0-alpha.15", + "babel-traverse": "7.0.0-alpha.15", + "babel-types": "7.0.0-alpha.15", + "babylon": "7.0.0-beta.16" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index a260f94eeef0..72f4ae07a665 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1795,4 +1795,54 @@ describe("verify", () => { [] ); }); + + it("works with dynamicImport", () => { + verifyAndAssertMessages( + unpad(` + import('a'); + `), + {}, + [] + ); + }); + + it("works with numericSeparator", () => { + verifyAndAssertMessages( + unpad(` + 1_000 + `), + {}, + [] + ); + }); + + it("works with optionalChaining", () => { + verifyAndAssertMessages( + unpad(` + a?.b + `), + {}, + [] + ); + }); + + it("works with import.meta", () => { + verifyAndAssertMessages( + unpad(` + import.meta + `), + {}, + [] + ); + }); + + it("works with classPrivateProperties", () => { + verifyAndAssertMessages( + unpad(` + class A { #a = 1; } + `), + {}, + [] + ); + }); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index c59da6113b1f..0975828882c9 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -75,6 +75,14 @@ babel-code-frame@7.0.0-alpha.12: esutils "^2.0.2" js-tokens "^3.0.0" +babel-code-frame@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.15.tgz#381d3e06e17b73201129c4a019e8b62d84e2dde3" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + babel-code-frame@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.3.tgz#9ff265eaaac94b58dfc7ca4a4eecf389d5f4d344" @@ -100,6 +108,15 @@ babel-eslint@^8.0.0-alpha.13: babel-types "7.0.0-alpha.12" babylon "7.0.0-beta.14" +babel-helper-function-name@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.15.tgz#087bb6bb6677acde36b3c19f6bc1afedb3d12e30" + dependencies: + babel-helper-get-function-arity "7.0.0-alpha.15" + babel-template "7.0.0-alpha.15" + babel-traverse "7.0.0-alpha.15" + babel-types "7.0.0-alpha.15" + babel-helper-function-name@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.7.tgz#19aecddc5402f941c5726802993077b41ea9832d" @@ -109,6 +126,12 @@ babel-helper-function-name@7.0.0-alpha.7: babel-traverse "7.0.0-alpha.7" babel-types "7.0.0-alpha.7" +babel-helper-get-function-arity@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.15.tgz#17e93206d0b625c3122f4c674478cbed53281f24" + dependencies: + babel-types "7.0.0-alpha.15" + babel-helper-get-function-arity@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.7.tgz#16e6526ecefc5537826012365e577de2ccba02f5" @@ -119,10 +142,23 @@ babel-messages@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.12.tgz#5fda840cb8dfeda06a7894a1e8ab1af695f249c0" +babel-messages@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.15.tgz#97991d32d86a2130aff08fa75a16cfc5acad9e42" + babel-messages@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" +babel-template@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.15.tgz#08b56562987c9893bbd6646bce4819074ba1cf90" + dependencies: + babel-traverse "7.0.0-alpha.15" + babel-types "7.0.0-alpha.15" + babylon "7.0.0-beta.13" + lodash "^4.2.0" + babel-template@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.7.tgz#82e26500980d1b3f14d9ebe8ae8b9325dc158392" @@ -146,6 +182,20 @@ babel-traverse@7.0.0-alpha.12: invariant "^2.2.0" lodash "^4.2.0" +babel-traverse@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.15.tgz#d7af52cb8ee6e0867b778da17166e6f01498b11a" + dependencies: + babel-code-frame "7.0.0-alpha.15" + babel-helper-function-name "7.0.0-alpha.15" + babel-messages "7.0.0-alpha.15" + babel-types "7.0.0-alpha.15" + babylon "7.0.0-beta.15" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + babel-traverse@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.7.tgz#61cc89061b0ad0a5f9fc6df81117fac428bc4148" @@ -167,6 +217,14 @@ babel-types@7.0.0-alpha.12: lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@7.0.0-alpha.15: + version "7.0.0-alpha.15" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.15.tgz#e4021e6a432e906678dfc6cc89805ba3234f9f48" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + babel-types@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.7.tgz#4bdb77386d1f6e2001f42fa9ac21b6c3d6ad0d82" @@ -179,10 +237,22 @@ babylon@7.0.0-beta.12: version "7.0.0-beta.12" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" +babylon@7.0.0-beta.13: + version "7.0.0-beta.13" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.13.tgz#12425c1bfd9498be419021ed36b43fe4f0289c0a" + babylon@7.0.0-beta.14: version "7.0.0-beta.14" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.14.tgz#72aa3c493c984c2edc54d4bc077b74066ed4511d" +babylon@7.0.0-beta.15: + version "7.0.0-beta.15" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.15.tgz#410348bcd21af470a55abea9698c9c651d87f1c6" + +babylon@7.0.0-beta.16: + version "7.0.0-beta.16" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.16.tgz#448ceedeec0a5ef56b62812e3556bf36c5bb9781" + babylon@7.0.0-beta.8: version "7.0.0-beta.8" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" From 35f79cb272c50b5b66e33c260af515bd56616bfd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 13 Jul 2017 13:01:31 -0400 Subject: [PATCH 595/965] 8.0.0-alpha.15 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 008e97bd575b..7c043bf1e6af 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.0-alpha.13", + "version": "8.0.0-alpha.15", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From cf86d945975f0a17c66382c14724a3e6cbad6925 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 26 Jul 2017 16:18:45 -0400 Subject: [PATCH 596/965] alpha.17 --- eslint/babel-eslint-parser/package.json | 8 +- eslint/babel-eslint-parser/yarn.lock | 130 +++++++++++++++--------- 2 files changed, 86 insertions(+), 52 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7c043bf1e6af..dc48631d79d8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "7.0.0-alpha.15", - "babel-traverse": "7.0.0-alpha.15", - "babel-types": "7.0.0-alpha.15", - "babylon": "7.0.0-beta.16" + "babel-code-frame": "7.0.0-alpha.17", + "babel-traverse": "7.0.0-alpha.17", + "babel-types": "7.0.0-alpha.17", + "babylon": "7.0.0-beta.18" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 0975828882c9..d93d9583385d 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -43,6 +43,12 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" +ansi-styles@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" + dependencies: + color-convert "^1.9.0" + app-root-path@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" @@ -75,11 +81,11 @@ babel-code-frame@7.0.0-alpha.12: esutils "^2.0.2" js-tokens "^3.0.0" -babel-code-frame@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.15.tgz#381d3e06e17b73201129c4a019e8b62d84e2dde3" +babel-code-frame@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.17.tgz#06a5daddb0946d8e95392477065a86480474f19c" dependencies: - chalk "^1.1.0" + chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" @@ -108,14 +114,14 @@ babel-eslint@^8.0.0-alpha.13: babel-types "7.0.0-alpha.12" babylon "7.0.0-beta.14" -babel-helper-function-name@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.15.tgz#087bb6bb6677acde36b3c19f6bc1afedb3d12e30" +babel-helper-function-name@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.17.tgz#b976290af579712345ecd6a146e6dff86b47b8ed" dependencies: - babel-helper-get-function-arity "7.0.0-alpha.15" - babel-template "7.0.0-alpha.15" - babel-traverse "7.0.0-alpha.15" - babel-types "7.0.0-alpha.15" + babel-helper-get-function-arity "7.0.0-alpha.17" + babel-template "7.0.0-alpha.17" + babel-traverse "7.0.0-alpha.17" + babel-types "7.0.0-alpha.17" babel-helper-function-name@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -126,11 +132,11 @@ babel-helper-function-name@7.0.0-alpha.7: babel-traverse "7.0.0-alpha.7" babel-types "7.0.0-alpha.7" -babel-helper-get-function-arity@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.15.tgz#17e93206d0b625c3122f4c674478cbed53281f24" +babel-helper-get-function-arity@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.17.tgz#f9ee3be4b6e892235ee790a8849ada1f88eedcf1" dependencies: - babel-types "7.0.0-alpha.15" + babel-types "7.0.0-alpha.17" babel-helper-get-function-arity@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -142,21 +148,21 @@ babel-messages@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.12.tgz#5fda840cb8dfeda06a7894a1e8ab1af695f249c0" -babel-messages@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.15.tgz#97991d32d86a2130aff08fa75a16cfc5acad9e42" +babel-messages@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.17.tgz#777d7f82656d5e3526c1f4c74aaaba99b260d7db" babel-messages@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" -babel-template@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.15.tgz#08b56562987c9893bbd6646bce4819074ba1cf90" +babel-template@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.17.tgz#085597c0021644c72fa74460a8f76a85e76da943" dependencies: - babel-traverse "7.0.0-alpha.15" - babel-types "7.0.0-alpha.15" - babylon "7.0.0-beta.13" + babel-traverse "7.0.0-alpha.17" + babel-types "7.0.0-alpha.17" + babylon "7.0.0-beta.18" lodash "^4.2.0" babel-template@7.0.0-alpha.7: @@ -182,17 +188,17 @@ babel-traverse@7.0.0-alpha.12: invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.15.tgz#d7af52cb8ee6e0867b778da17166e6f01498b11a" +babel-traverse@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.17.tgz#c8a33788274bc4138c529ec9c29f0bacb573f42c" dependencies: - babel-code-frame "7.0.0-alpha.15" - babel-helper-function-name "7.0.0-alpha.15" - babel-messages "7.0.0-alpha.15" - babel-types "7.0.0-alpha.15" - babylon "7.0.0-beta.15" + babel-code-frame "7.0.0-alpha.17" + babel-helper-function-name "7.0.0-alpha.17" + babel-messages "7.0.0-alpha.17" + babel-types "7.0.0-alpha.17" + babylon "7.0.0-beta.18" debug "^2.2.0" - globals "^9.0.0" + globals "^10.0.0" invariant "^2.2.0" lodash "^4.2.0" @@ -217,13 +223,13 @@ babel-types@7.0.0-alpha.12: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@7.0.0-alpha.15: - version "7.0.0-alpha.15" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.15.tgz#e4021e6a432e906678dfc6cc89805ba3234f9f48" +babel-types@7.0.0-alpha.17: + version "7.0.0-alpha.17" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.17.tgz#bc74e19423b015a5ce88727440fc6ae863463dc0" dependencies: esutils "^2.0.2" lodash "^4.2.0" - to-fast-properties "^1.0.1" + to-fast-properties "^2.0.0" babel-types@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -237,21 +243,13 @@ babylon@7.0.0-beta.12: version "7.0.0-beta.12" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" -babylon@7.0.0-beta.13: - version "7.0.0-beta.13" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.13.tgz#12425c1bfd9498be419021ed36b43fe4f0289c0a" - babylon@7.0.0-beta.14: version "7.0.0-beta.14" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.14.tgz#72aa3c493c984c2edc54d4bc077b74066ed4511d" -babylon@7.0.0-beta.15: - version "7.0.0-beta.15" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.15.tgz#410348bcd21af470a55abea9698c9c651d87f1c6" - -babylon@7.0.0-beta.16: - version "7.0.0-beta.16" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.16.tgz#448ceedeec0a5ef56b62812e3556bf36c5bb9781" +babylon@7.0.0-beta.18: + version "7.0.0-beta.18" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.18.tgz#5c23ee3fdb66358aabf3789779319c5b78a233c7" babylon@7.0.0-beta.8: version "7.0.0-beta.8" @@ -292,6 +290,14 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" +chalk@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" @@ -335,6 +341,16 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +color-convert@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + commander@2.9.0, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" @@ -634,6 +650,10 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +globals@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-10.0.0.tgz#a5803a1abe923b52bc33a59cffeaf6e0748cf3f7" + globals@^9.0.0, globals@^9.17.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -671,6 +691,10 @@ has-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + husky@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.1.tgz#8edba33e728ceed75343e88bb8002e4cbd8d1b40" @@ -1354,6 +1378,12 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" +supports-color@^4.0.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836" + dependencies: + has-flag "^2.0.0" + symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" @@ -1387,6 +1417,10 @@ to-fast-properties@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" From bc9b69590b6577e260c92693981fee7f75c77f5c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 26 Jul 2017 16:19:29 -0400 Subject: [PATCH 597/965] 8.0.0-alpha.17 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dc48631d79d8..664ec6a0ba9b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.0-alpha.15", + "version": "8.0.0-alpha.17", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 15e2aa0a2438c1bd8f827dfd26ede8fa1f495acc Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Wed, 2 Aug 2017 14:37:01 +0200 Subject: [PATCH 598/965] Remove already fixed workaround (babel/babel-eslint#508) --- eslint/babel-eslint-parser/babylon-to-espree/toAST.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 7e3e6876fc8c..07351b135ba3 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -50,11 +50,6 @@ var astTransformVisitor = { node.type = "Literal"; } - // TODO estree plugin bug - if (node.type === "Property") { - if (!node.shorthand) node.shorthand = false; - } - if ( path.isRestElement() && path.parent && From d61b06b8b524b246f48effc20617f2dfb0b17385 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 12 Sep 2017 09:42:30 -0400 Subject: [PATCH 599/965] update to beta.0 --- eslint/babel-eslint-parser/package.json | 8 +- eslint/babel-eslint-parser/yarn.lock | 122 +++++++++++++----------- 2 files changed, 68 insertions(+), 62 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 664ec6a0ba9b..e4dd26ce8c21 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "7.0.0-alpha.17", - "babel-traverse": "7.0.0-alpha.17", - "babel-types": "7.0.0-alpha.17", - "babylon": "7.0.0-beta.18" + "babel-code-frame": "7.0.0-beta.0", + "babel-traverse": "7.0.0-beta.0", + "babel-types": "7.0.0-beta.0", + "babylon": "7.0.0-beta.22" }, "scripts": { "test": "npm run lint && npm run test-only", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index d93d9583385d..3fcbc8d67e62 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -81,14 +81,6 @@ babel-code-frame@7.0.0-alpha.12: esutils "^2.0.2" js-tokens "^3.0.0" -babel-code-frame@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.17.tgz#06a5daddb0946d8e95392477065a86480474f19c" - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - babel-code-frame@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.3.tgz#9ff265eaaac94b58dfc7ca4a4eecf389d5f4d344" @@ -97,6 +89,14 @@ babel-code-frame@7.0.0-alpha.3: esutils "^2.0.2" js-tokens "^3.0.0" +babel-code-frame@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-beta.0.tgz#418a7b5f3f7dc9a4670e61b1158b4c5661bec98d" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -114,15 +114,6 @@ babel-eslint@^8.0.0-alpha.13: babel-types "7.0.0-alpha.12" babylon "7.0.0-beta.14" -babel-helper-function-name@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.17.tgz#b976290af579712345ecd6a146e6dff86b47b8ed" - dependencies: - babel-helper-get-function-arity "7.0.0-alpha.17" - babel-template "7.0.0-alpha.17" - babel-traverse "7.0.0-alpha.17" - babel-types "7.0.0-alpha.17" - babel-helper-function-name@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.7.tgz#19aecddc5402f941c5726802993077b41ea9832d" @@ -132,11 +123,14 @@ babel-helper-function-name@7.0.0-alpha.7: babel-traverse "7.0.0-alpha.7" babel-types "7.0.0-alpha.7" -babel-helper-get-function-arity@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.17.tgz#f9ee3be4b6e892235ee790a8849ada1f88eedcf1" +babel-helper-function-name@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-beta.0.tgz#d1b6779b647e5c5c31ebeb05e13b998e4d352d56" dependencies: - babel-types "7.0.0-alpha.17" + babel-helper-get-function-arity "7.0.0-beta.0" + babel-template "7.0.0-beta.0" + babel-traverse "7.0.0-beta.0" + babel-types "7.0.0-beta.0" babel-helper-get-function-arity@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -144,26 +138,23 @@ babel-helper-get-function-arity@7.0.0-alpha.7: dependencies: babel-types "7.0.0-alpha.7" +babel-helper-get-function-arity@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.0.tgz#9d1ab7213bb5efe1ef1638a8ea1489969b5a8b6e" + dependencies: + babel-types "7.0.0-beta.0" + babel-messages@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.12.tgz#5fda840cb8dfeda06a7894a1e8ab1af695f249c0" -babel-messages@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.17.tgz#777d7f82656d5e3526c1f4c74aaaba99b260d7db" - babel-messages@7.0.0-alpha.3: version "7.0.0-alpha.3" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" -babel-template@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.17.tgz#085597c0021644c72fa74460a8f76a85e76da943" - dependencies: - babel-traverse "7.0.0-alpha.17" - babel-types "7.0.0-alpha.17" - babylon "7.0.0-beta.18" - lodash "^4.2.0" +babel-messages@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-beta.0.tgz#6df01296e49fc8fbd0637394326a167f36da817b" babel-template@7.0.0-alpha.7: version "7.0.0-alpha.7" @@ -174,6 +165,15 @@ babel-template@7.0.0-alpha.7: babylon "7.0.0-beta.8" lodash "^4.2.0" +babel-template@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-beta.0.tgz#85083cf9e4395d5e48bf5154d7a8d6991cafecfb" + dependencies: + babel-traverse "7.0.0-beta.0" + babel-types "7.0.0-beta.0" + babylon "7.0.0-beta.22" + lodash "^4.2.0" + babel-traverse@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.12.tgz#0c0855a60287e56e54cf61ea9f135cdf759d6ad0" @@ -188,20 +188,6 @@ babel-traverse@7.0.0-alpha.12: invariant "^2.2.0" lodash "^4.2.0" -babel-traverse@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.17.tgz#c8a33788274bc4138c529ec9c29f0bacb573f42c" - dependencies: - babel-code-frame "7.0.0-alpha.17" - babel-helper-function-name "7.0.0-alpha.17" - babel-messages "7.0.0-alpha.17" - babel-types "7.0.0-alpha.17" - babylon "7.0.0-beta.18" - debug "^2.2.0" - globals "^10.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - babel-traverse@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.7.tgz#61cc89061b0ad0a5f9fc6df81117fac428bc4148" @@ -215,6 +201,20 @@ babel-traverse@7.0.0-alpha.7: invariant "^2.2.0" lodash "^4.2.0" +babel-traverse@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-beta.0.tgz#da14be9b762f62a2f060db464eaafdd8cd072a41" + dependencies: + babel-code-frame "7.0.0-beta.0" + babel-helper-function-name "7.0.0-beta.0" + babel-messages "7.0.0-beta.0" + babel-types "7.0.0-beta.0" + babylon "7.0.0-beta.22" + debug "^3.0.1" + globals "^10.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + babel-types@7.0.0-alpha.12: version "7.0.0-alpha.12" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.12.tgz#d7b2c6d0c49c518fd36de5ac14f4f50bed6de7e5" @@ -223,14 +223,6 @@ babel-types@7.0.0-alpha.12: lodash "^4.2.0" to-fast-properties "^1.0.1" -babel-types@7.0.0-alpha.17: - version "7.0.0-alpha.17" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.17.tgz#bc74e19423b015a5ce88727440fc6ae863463dc0" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" - babel-types@7.0.0-alpha.7: version "7.0.0-alpha.7" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.7.tgz#4bdb77386d1f6e2001f42fa9ac21b6c3d6ad0d82" @@ -239,6 +231,14 @@ babel-types@7.0.0-alpha.7: lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@7.0.0-beta.0: + version "7.0.0-beta.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.0.tgz#eb8b6e556470e6dcc4aef982d79ad229469b5169" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + babylon@7.0.0-beta.12: version "7.0.0-beta.12" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" @@ -247,9 +247,9 @@ babylon@7.0.0-beta.14: version "7.0.0-beta.14" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.14.tgz#72aa3c493c984c2edc54d4bc077b74066ed4511d" -babylon@7.0.0-beta.18: - version "7.0.0-beta.18" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.18.tgz#5c23ee3fdb66358aabf3789779319c5b78a233c7" +babylon@7.0.0-beta.22: + version "7.0.0-beta.22" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" babylon@7.0.0-beta.8: version "7.0.0-beta.8" @@ -410,6 +410,12 @@ debug@^2.2.0, debug@^2.6.8: dependencies: ms "2.0.0" +debug@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64" + dependencies: + ms "2.0.0" + dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" From b576677e9f69193984c8251e1ea2faf6baf78068 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 12 Sep 2017 09:44:23 -0400 Subject: [PATCH 600/965] 8.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e4dd26ce8c21..02318fd23586 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.0-alpha.17", + "version": "8.0.0", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 04cf4246b850f11581373602629e6599f6f496e6 Mon Sep 17 00:00:00 2001 From: Jordan Gensler Date: Tue, 26 Sep 2017 13:17:44 -0700 Subject: [PATCH 601/965] Adding optionalCatchBinding to plugins. (babel/babel-eslint#521) --- eslint/babel-eslint-parser/index.js | 1 + eslint/babel-eslint-parser/test/non-regression.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index 79eb5a3c7db1..ed1b8ff3a0e0 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -414,6 +414,7 @@ exports.parseNoPatch = function(code, options) { "importMeta", "classPrivateProperties", "bigInt", + "optionalCatchBinding", ], }; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 72f4ae07a665..4161af03d67b 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1845,4 +1845,15 @@ describe("verify", () => { [] ); }); + + it("works with optionalCatchBinding", () => { + verifyAndAssertMessages( + unpad(` + try {} catch {} + try {} catch {} finally {} + `), + {}, + [] + ); + }); }); From 5b3caf7b66980f6fe64541092883ea053725d9d8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Wed, 11 Oct 2017 14:14:29 +0200 Subject: [PATCH 602/965] chore(package): update mocha to version 4.0.0 (babel/babel-eslint#524) --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 02318fd23586..c739f2fb0df0 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -45,7 +45,7 @@ "espree": "^3.4.0", "husky": "^0.14.0", "lint-staged": "^4.0.0", - "mocha": "^3.0.0", + "mocha": "^4.0.0", "prettier": "^1.4.4" }, "lint-staged": { From b0d8baf320efdab952bee64620e9310ebdd84a44 Mon Sep 17 00:00:00 2001 From: Clement Hoang Date: Tue, 31 Oct 2017 11:50:35 -0700 Subject: [PATCH 603/965] Update README.md support (babel/babel-eslint#531) [skip ci] #linting channel is now archived in babel slack. --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index be6878570a22..23f13c3b1080 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -11,7 +11,7 @@ You only need to use babel-eslint if you are using types (Flow) or experimental > If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! -For questions and support please visit the [`#linting`](https://babeljs.slack.com/messages/linting/) babel slack channel (sign up [here](https://babel-slack.herokuapp.com))! +For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) babel slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or eslint [gitter](https://gitter.im/eslint/eslint)! > Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`). From c958724bbd337bf9ba3e21cbe8482aec10523b9c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 26 Sep 2017 16:18:43 -0400 Subject: [PATCH 604/965] 8.0.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c739f2fb0df0..52c726309614 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.0", + "version": "8.0.1", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 38f372b8ea9552b40700acbc3bf435ea146f2afd Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Mon, 6 Nov 2017 12:25:35 -0500 Subject: [PATCH 605/965] fix(package): update babylon to version 7.0.0-beta.31 (babel/babel-eslint#533) --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 52c726309614..1f702c222741 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,7 @@ "babel-code-frame": "7.0.0-beta.0", "babel-traverse": "7.0.0-beta.0", "babel-types": "7.0.0-beta.0", - "babylon": "7.0.0-beta.22" + "babylon": "7.0.0-beta.31" }, "scripts": { "test": "npm run lint && npm run test-only", From f43062ebbbc79f07a1b9408ab0e0b88dcc9e0c2c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Nov 2017 12:47:47 -0500 Subject: [PATCH 606/965] Allow ^ version for babel dependencies (babel/babel-eslint#534) --- eslint/babel-eslint-parser/package.json | 10 +- eslint/babel-eslint-parser/yarn.lock | 311 ++++++++---------------- 2 files changed, 104 insertions(+), 217 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1f702c222741..0d24a1e4fe19 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "babel-code-frame": "7.0.0-beta.0", - "babel-traverse": "7.0.0-beta.0", - "babel-types": "7.0.0-beta.0", - "babylon": "7.0.0-beta.31" + "@babel/code-frame": "^7.0.0-beta.31", + "@babel/traverse": "^7.0.0-beta.31", + "@babel/types": "^7.0.0-beta.31", + "babylon": "^7.0.0-beta.31" }, "scripts": { "test": "npm run lint && npm run test-only", @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "babel-eslint": "^8.0.0-alpha.13", + "babel-eslint": "^8.0.0", "dedent": "^0.7.0", "eslint": "^4.1.0", "eslint-config-babel": "^7.0.1", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 3fcbc8d67e62..438860714273 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,6 +2,59 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.31", "@babel/code-frame@^7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz#473d021ecc573a2cce1c07d5b509d5215f46ba35" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/helper-function-name@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.31.tgz#afe63ad799209989348b1109b44feb66aa245f57" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.31" + "@babel/template" "7.0.0-beta.31" + "@babel/traverse" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + +"@babel/helper-get-function-arity@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.31.tgz#1176d79252741218e0aec872ada07efb2b37a493" + dependencies: + "@babel/types" "7.0.0-beta.31" + +"@babel/template@7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.31.tgz#577bb29389f6c497c3e7d014617e7d6713f68bda" + dependencies: + "@babel/code-frame" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + babylon "7.0.0-beta.31" + lodash "^4.2.0" + +"@babel/traverse@7.0.0-beta.31", "@babel/traverse@^7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.31.tgz#db399499ad74aefda014f0c10321ab255134b1df" + dependencies: + "@babel/code-frame" "7.0.0-beta.31" + "@babel/helper-function-name" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.31" + babylon "7.0.0-beta.31" + debug "^3.0.1" + globals "^10.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/types@7.0.0-beta.31", "@babel/types@^7.0.0-beta.31": + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.31.tgz#42c9c86784f674c173fb21882ca9643334029de4" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -73,22 +126,6 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -babel-code-frame@7.0.0-alpha.12: - version "7.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.12.tgz#26fbb2eab1c20763271fecb6b04a108756fae61f" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-code-frame@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-alpha.3.tgz#9ff265eaaac94b58dfc7ca4a4eecf389d5f4d344" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - babel-code-frame@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-beta.0.tgz#418a7b5f3f7dc9a4670e61b1158b4c5661bec98d" @@ -105,23 +142,14 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-eslint@^8.0.0-alpha.13: - version "8.0.0-alpha.13" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.0-alpha.13.tgz#47c6f04d4c7ef5084f5a849ffe5a8a48f17db7df" +babel-eslint@^8.0.0: + version "8.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.1.tgz#5d718be7a328625d006022eb293ed3008cbd6346" dependencies: - babel-code-frame "7.0.0-alpha.12" - babel-traverse "7.0.0-alpha.12" - babel-types "7.0.0-alpha.12" - babylon "7.0.0-beta.14" - -babel-helper-function-name@7.0.0-alpha.7: - version "7.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-alpha.7.tgz#19aecddc5402f941c5726802993077b41ea9832d" - dependencies: - babel-helper-get-function-arity "7.0.0-alpha.7" - babel-template "7.0.0-alpha.7" - babel-traverse "7.0.0-alpha.7" - babel-types "7.0.0-alpha.7" + babel-code-frame "7.0.0-beta.0" + babel-traverse "7.0.0-beta.0" + babel-types "7.0.0-beta.0" + babylon "7.0.0-beta.22" babel-helper-function-name@7.0.0-beta.0: version "7.0.0-beta.0" @@ -132,39 +160,16 @@ babel-helper-function-name@7.0.0-beta.0: babel-traverse "7.0.0-beta.0" babel-types "7.0.0-beta.0" -babel-helper-get-function-arity@7.0.0-alpha.7: - version "7.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-alpha.7.tgz#16e6526ecefc5537826012365e577de2ccba02f5" - dependencies: - babel-types "7.0.0-alpha.7" - babel-helper-get-function-arity@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.0.tgz#9d1ab7213bb5efe1ef1638a8ea1489969b5a8b6e" dependencies: babel-types "7.0.0-beta.0" -babel-messages@7.0.0-alpha.12: - version "7.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.12.tgz#5fda840cb8dfeda06a7894a1e8ab1af695f249c0" - -babel-messages@7.0.0-alpha.3: - version "7.0.0-alpha.3" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-alpha.3.tgz#c8390a468478b8384da134612e12a6bc31a684e9" - babel-messages@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-beta.0.tgz#6df01296e49fc8fbd0637394326a167f36da817b" -babel-template@7.0.0-alpha.7: - version "7.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-alpha.7.tgz#82e26500980d1b3f14d9ebe8ae8b9325dc158392" - dependencies: - babel-traverse "7.0.0-alpha.7" - babel-types "7.0.0-alpha.7" - babylon "7.0.0-beta.8" - lodash "^4.2.0" - babel-template@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-beta.0.tgz#85083cf9e4395d5e48bf5154d7a8d6991cafecfb" @@ -174,33 +179,6 @@ babel-template@7.0.0-beta.0: babylon "7.0.0-beta.22" lodash "^4.2.0" -babel-traverse@7.0.0-alpha.12: - version "7.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.12.tgz#0c0855a60287e56e54cf61ea9f135cdf759d6ad0" - dependencies: - babel-code-frame "7.0.0-alpha.12" - babel-helper-function-name "7.0.0-alpha.7" - babel-messages "7.0.0-alpha.12" - babel-types "7.0.0-alpha.12" - babylon "7.0.0-beta.12" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-traverse@7.0.0-alpha.7: - version "7.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-alpha.7.tgz#61cc89061b0ad0a5f9fc6df81117fac428bc4148" - dependencies: - babel-code-frame "7.0.0-alpha.3" - babel-messages "7.0.0-alpha.3" - babel-types "7.0.0-alpha.7" - babylon "7.0.0-beta.8" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - babel-traverse@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-beta.0.tgz#da14be9b762f62a2f060db464eaafdd8cd072a41" @@ -215,22 +193,6 @@ babel-traverse@7.0.0-beta.0: invariant "^2.2.0" lodash "^4.2.0" -babel-types@7.0.0-alpha.12: - version "7.0.0-alpha.12" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.12.tgz#d7b2c6d0c49c518fd36de5ac14f4f50bed6de7e5" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - -babel-types@7.0.0-alpha.7: - version "7.0.0-alpha.7" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-alpha.7.tgz#4bdb77386d1f6e2001f42fa9ac21b6c3d6ad0d82" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - babel-types@7.0.0-beta.0: version "7.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.0.tgz#eb8b6e556470e6dcc4aef982d79ad229469b5169" @@ -239,21 +201,13 @@ babel-types@7.0.0-beta.0: lodash "^4.2.0" to-fast-properties "^2.0.0" -babylon@7.0.0-beta.12: - version "7.0.0-beta.12" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.12.tgz#f7b9c8a89ff7d6afb57b906d947a4237f9bf53f9" - -babylon@7.0.0-beta.14: - version "7.0.0-beta.14" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.14.tgz#72aa3c493c984c2edc54d4bc077b74066ed4511d" - babylon@7.0.0-beta.22: version "7.0.0-beta.22" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" -babylon@7.0.0-beta.8: - version "7.0.0-beta.8" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" +babylon@7.0.0-beta.31, babylon@^7.0.0-beta.31: + version "7.0.0-beta.31" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.31.tgz#7ec10f81e0e456fd0f855ad60fa30c2ac454283f" balanced-match@^1.0.0: version "1.0.0" @@ -351,7 +305,11 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -commander@2.9.0, commander@^2.9.0: +commander@2.11.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -398,13 +356,13 @@ date-fns@^1.27.2: version "1.28.5" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" -debug@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: - ms "0.7.2" + ms "2.0.0" -debug@^2.2.0, debug@^2.6.8: +debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -436,9 +394,9 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" +diff@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" doctrine@^2.0.0: version "2.0.0" @@ -634,18 +592,7 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: +glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -660,7 +607,7 @@ globals@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/globals/-/globals-10.0.0.tgz#a5803a1abe923b52bc33a59cffeaf6e0748cf3f7" -globals@^9.0.0, globals@^9.17.0: +globals@^9.17.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -683,9 +630,9 @@ graceful-fs@^4.1.2: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" +growl@1.10.3: + version "1.10.3" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" has-ansi@^2.0.0: version "2.0.0" @@ -693,14 +640,14 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + husky@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.1.tgz#8edba33e728ceed75343e88bb8002e4cbd8d1b40" @@ -869,10 +816,6 @@ json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -949,57 +892,10 @@ listr@^0.12.0: stream-to-observable "^0.1.0" strip-ansi "^3.0.1" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - lodash.chunk@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -1054,25 +950,20 @@ mkdirp@0.5.1, mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mocha@^3.0.0: - version "3.4.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" +mocha@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.0.1.tgz#0aee5a95cf69a4618820f5e51fa31717117daf1b" dependencies: browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.0" - diff "3.2.0" + commander "2.11.0" + debug "3.1.0" + diff "3.3.1" escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - json3 "3.3.2" - lodash.create "3.1.1" + glob "7.1.2" + growl "1.10.3" + he "1.1.1" mkdirp "0.5.1" - supports-color "3.1.2" - -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + supports-color "4.4.0" ms@2.0.0: version "2.0.0" @@ -1374,11 +1265,11 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" +supports-color@4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" dependencies: - has-flag "^1.0.0" + has-flag "^2.0.0" supports-color@^2.0.0: version "2.0.0" @@ -1419,10 +1310,6 @@ tmp@^0.0.31: dependencies: os-tmpdir "~1.0.1" -to-fast-properties@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" From 090269e5a09353675060174fdbb48a481f2ce96f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Nov 2017 12:51:19 -0500 Subject: [PATCH 607/965] Always use unpad (babel/babel-eslint#535) --- .../babel-eslint-parser/test/babel-eslint.js | 267 ++++++++---------- 1 file changed, 118 insertions(+), 149 deletions(-) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 4683aa86adeb..ad9838f8b5ca 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -61,6 +61,7 @@ function lookup(obj, keypath, backwardsDepth) { } function parseAndAssertSame(code) { + code = unpad(code); var esAST = espree.parse(code, { ecmaFeatures: { // enable JSX parsing @@ -177,30 +178,26 @@ describe("babylon-to-esprima", () => { }); it("template also with braces #96", () => { - parseAndAssertSame( - unpad(` - export default function f1() { - function f2(foo) { - const bar = 3; - return \`\${foo} \${bar}\`; - } - return f2; + parseAndAssertSame(` + export default function f1() { + function f2(foo) { + const bar = 3; + return \`\${foo} \${bar}\`; } - `) - ); + return f2; + } + `); }); it("template with destructuring #31", () => { - parseAndAssertSame( - unpad(` - module.exports = { - render() { - var {name} = this.props; - return Math.max(null, \`Name: \${name}, Name: \${name}\`); - } - }; - `) - ); + parseAndAssertSame(` + module.exports = { + render() { + var {name} = this.props; + return Math.max(null, \`Name: \${name}, Name: \${name}\`); + } + }; + `); }); }); @@ -301,40 +298,34 @@ describe("babylon-to-esprima", () => { }); it("line comments", () => { - parseAndAssertSame( - unpad(` - // single comment - var foo = 15; // comment next to statement - // second comment after statement - `) - ); + parseAndAssertSame(` + // single comment + var foo = 15; // comment next to statement + // second comment after statement + `); }); it("block comments", () => { - parseAndAssertSame( - unpad(` - /* single comment */ - var foo = 15; /* comment next to statement */ - /* - * multiline - * comment - */ - `) - ); + parseAndAssertSame(` + /* single comment */ + var foo = 15; /* comment next to statement */ + /* + * multiline + * comment + */ + `); }); it("block comments #124", () => { - parseAndAssertSame( - unpad(` - React.createClass({ - render() { - // return ( - //
- // ); // <-- this is the line that is reported - } - }); - `) - ); + parseAndAssertSame(` + React.createClass({ + render() { + // return ( + //
+ // ); // <-- this is the line that is reported + } + }); + `); }); it("null", () => { @@ -374,43 +365,37 @@ describe("babylon-to-esprima", () => { }); it("jsdoc", () => { - parseAndAssertSame( - unpad(` - /** - * @param {object} options - * @return {number} - */ - const test = function({ a, b, c }) { - return a + b + c; - }; - module.exports = test; - `) - ); + parseAndAssertSame(` + /** + * @param {object} options + * @return {number} + */ + const test = function({ a, b, c }) { + return a + b + c; + }; + module.exports = test; + `); }); it("empty block with comment", () => { - parseAndAssertSame( - unpad(` - function a () { - try { - b(); - } catch (e) { - // asdf - } + parseAndAssertSame(` + function a () { + try { + b(); + } catch (e) { + // asdf } - `) - ); + } + `); }); describe("babel tests", () => { it("MethodDefinition", () => { - parseAndAssertSame( - unpad(` - export default class A { - a() {} - } - `) - ); + parseAndAssertSame(` + export default class A { + a() {} + } + `); }); it("MethodDefinition 2", () => { @@ -420,43 +405,37 @@ describe("babylon-to-esprima", () => { }); it("ClassMethod", () => { - parseAndAssertSame( - unpad(` - class A { - constructor() { - } + parseAndAssertSame(` + class A { + constructor() { } - `) - ); + } + `); }); it("ClassMethod multiple params", () => { - parseAndAssertSame( - unpad(` - class A { - constructor(a, b, c) { - } + parseAndAssertSame(` + class A { + constructor(a, b, c) { } - `) - ); + } + `); }); it("ClassMethod multiline", () => { - parseAndAssertSame( - unpad(` - class A { - constructor ( - a, - b, - c - ) + parseAndAssertSame(` + class A { + constructor ( + a, + b, + c + ) - { + { - } } - `) - ); + } + `); }); it("ClassMethod oneline", () => { @@ -464,14 +443,12 @@ describe("babylon-to-esprima", () => { }); it("ObjectMethod", () => { - parseAndAssertSame( - unpad(` - var a = { - b(c) { - } + parseAndAssertSame(` + var a = { + b(c) { } - `) - ); + } + `); }); it("do not allow import export everywhere", () => { @@ -496,41 +473,35 @@ describe("babylon-to-esprima", () => { it("getters and setters", () => { parseAndAssertSame("class A { get x ( ) { ; } }"); - parseAndAssertSame( - unpad(` - class A { - get x( - ) - { - ; - } + parseAndAssertSame(` + class A { + get x( + ) + { + ; } - `) - ); + } + `); parseAndAssertSame("class A { set x (a) { ; } }"); - parseAndAssertSame( - unpad(` - class A { - set x(a - ) - { - ; - } + parseAndAssertSame(` + class A { + set x(a + ) + { + ; } - `) - ); - parseAndAssertSame( - unpad(` - var B = { - get x () { - return this.ecks; - }, - set x (ecks) { - this.ecks = ecks; - } - }; - `) - ); + } + `); + parseAndAssertSame(` + var B = { + get x () { + return this.ecks; + }, + set x (ecks) { + this.ecks = ecks; + } + }; + `); }); it("RestOperator", () => { @@ -546,13 +517,11 @@ describe("babylon-to-esprima", () => { }); it("Async/Await", () => { - parseAndAssertSame( - unpad(` - async function a() { - await 1; - } - `) - ); + parseAndAssertSame(` + async function a() { + await 1; + } + `); }); }); }); From 0e2bbc370542e601c8a5ab690ba7e3b1de46acd2 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Nov 2017 14:57:56 -0500 Subject: [PATCH 608/965] require correct deps --- eslint/babel-eslint-parser/babylon-to-espree/toAST.js | 2 +- eslint/babel-eslint-parser/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js index 07351b135ba3..b3da41f0cb06 100644 --- a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/babylon-to-espree/toAST.js @@ -1,6 +1,6 @@ "use strict"; -var t = require("babel-types"); +var t = require("@babel/types"); var convertComments = require("./convertComments"); module.exports = function(ast, traverse, code) { diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/index.js index ed1b8ff3a0e0..0fec8e47856a 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/index.js @@ -2,10 +2,10 @@ var babylonToEspree = require("./babylon-to-espree"); var Module = require("module"); var path = require("path"); var parse = require("babylon").parse; -var t = require("babel-types"); +var t = require("@babel/types"); var tt = require("babylon").tokTypes; -var traverse = require("babel-traverse").default; -var codeFrameColumns = require("babel-code-frame").codeFrameColumns; +var traverse = require("@babel/traverse").default; +var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; var hasPatched = false; var eslintOptions = {}; From 39cef9288589a7a1da5b4a85eebd023ea6302bb9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Nov 2017 15:00:41 -0500 Subject: [PATCH 609/965] 8.0.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0d24a1e4fe19..07573703bbb7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.1", + "version": "8.0.2", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From b6172b2ed349365732613fdf54197a187e49cf64 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Fri, 1 Dec 2017 10:05:34 -0800 Subject: [PATCH 610/965] Lock down dependency versions. --- eslint/babel-eslint-parser/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 07573703bbb7..4229cd75edf7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -12,10 +12,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "^7.0.0-beta.31", - "@babel/traverse": "^7.0.0-beta.31", - "@babel/types": "^7.0.0-beta.31", - "babylon": "^7.0.0-beta.31" + "@babel/code-frame": "7.0.0-beta.31", + "@babel/traverse": "7.0.0-beta.31", + "@babel/types": "7.0.0-beta.31", + "babylon": "7.0.0-beta.31" }, "scripts": { "test": "npm run lint && npm run test-only", From 3a36eca1b4d5ed592c3f42d9d6fff60e807c98d8 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Fri, 1 Dec 2017 10:06:24 -0800 Subject: [PATCH 611/965] Fix mocha command path. --- eslint/babel-eslint-parser/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/Makefile b/eslint/babel-eslint-parser/Makefile index 53bfdbc78a5f..d35bcfa016e2 100644 --- a/eslint/babel-eslint-parser/Makefile +++ b/eslint/babel-eslint-parser/Makefile @@ -1,7 +1,7 @@ .PHONY: publish-patch publish-patch: - mocha + ./node_modules/.bin/mocha npm version patch npm publish git push --follow-tags From 7ed6bfb9253ad83b2a2e8cf90a2045d8ca8cb4c7 Mon Sep 17 00:00:00 2001 From: Logan Smyth Date: Fri, 1 Dec 2017 10:06:40 -0800 Subject: [PATCH 612/965] 8.0.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 4229cd75edf7..188478669806 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.2", + "version": "8.0.3", "description": "Custom parser for ESLint", "main": "index.js", "files": [ From 5d6d52f04e17e36640fda0b78b4320368927fdb0 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Sun, 24 Dec 2017 15:42:17 +0900 Subject: [PATCH 613/965] Use new scopeManager/visitorKeys APIs (babel/babel-eslint#542) (fixes https://github.com/eslint/eslint/issues/9762) --- .../babel-eslint-parser/lib/analyze-scope.js | 330 ++++++++++++++++++ .../babylon-to-espree/attachComments.js | 0 .../babylon-to-espree/convertComments.js | 0 .../babylon-to-espree/convertTemplateType.js | 0 .../{ => lib}/babylon-to-espree/index.js | 0 .../{ => lib}/babylon-to-espree/toAST.js | 0 .../{ => lib}/babylon-to-espree/toToken.js | 0 .../{ => lib}/babylon-to-espree/toTokens.js | 0 eslint/babel-eslint-parser/lib/index.js | 17 + .../{index.js => lib/parse-with-patch.js} | 89 +---- .../lib/parse-with-scope.js | 19 + eslint/babel-eslint-parser/lib/parse.js | 83 +++++ .../babel-eslint-parser/lib/visitor-keys.js | 14 + eslint/babel-eslint-parser/package.json | 11 +- .../babel-eslint-parser/test/babel-eslint.js | 10 +- eslint/babel-eslint-parser/yarn.lock | 177 ++++++---- 16 files changed, 592 insertions(+), 158 deletions(-) create mode 100644 eslint/babel-eslint-parser/lib/analyze-scope.js rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/attachComments.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/convertComments.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/convertTemplateType.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/index.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/toAST.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/toToken.js (100%) rename eslint/babel-eslint-parser/{ => lib}/babylon-to-espree/toTokens.js (100%) create mode 100644 eslint/babel-eslint-parser/lib/index.js rename eslint/babel-eslint-parser/{index.js => lib/parse-with-patch.js} (84%) create mode 100644 eslint/babel-eslint-parser/lib/parse-with-scope.js create mode 100644 eslint/babel-eslint-parser/lib/parse.js create mode 100644 eslint/babel-eslint-parser/lib/visitor-keys.js diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js new file mode 100644 index 000000000000..b538dea078d6 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -0,0 +1,330 @@ +"use strict"; + +const t = require("@babel/types"); +const escope = require("eslint-scope"); +const Definition = require("eslint-scope/lib/definition").Definition; +const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor"); +const OriginalReferencer = require("eslint-scope/lib/referencer"); +const fallback = require("eslint-visitor-keys").getKeys; +const childVisitorKeys = require("./visitor-keys"); + +const flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ + "ArrayPattern", + "ClassDeclaration", + "ClassExpression", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "ObjectPattern", + "RestElement", +]); +const visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { + const value = t.VISITOR_KEYS[key]; + if (flowFlippedAliasKeys.indexOf(value) === -1) { + acc[key] = value; + } + return acc; +}, {}); + +const propertyTypes = { + // loops + callProperties: { type: "loop", values: ["value"] }, + indexers: { type: "loop", values: ["key", "value"] }, + properties: { type: "loop", values: ["argument", "value"] }, + types: { type: "loop" }, + params: { type: "loop" }, + // single property + argument: { type: "single" }, + elementType: { type: "single" }, + qualification: { type: "single" }, + rest: { type: "single" }, + returnType: { type: "single" }, + // others + typeAnnotation: { type: "typeAnnotation" }, + typeParameters: { type: "typeParameters" }, + id: { type: "id" }, +}; + +class PatternVisitor extends OriginalPatternVisitor { + ArrayPattern(node) { + node.elements.forEach(this.visit, this); + } + + ObjectPattern(node) { + node.properties.forEach(this.visit, this); + } +} + +class Referencer extends OriginalReferencer { + // inherits. + visitPattern(node, options, callback) { + if (!node) { + return; + } + + // Visit type annotations. + this._checkIdentifierOrVisit(node.typeAnnotation); + if (t.isAssignmentPattern(node)) { + this._checkIdentifierOrVisit(node.left.typeAnnotation); + } + + // Overwrite `super.visitPattern(node, options, callback)` in order to not visit `ArrayPattern#typeAnnotation` and `ObjectPattern#typeAnnotation`. + if (typeof options === "function") { + callback = options; + options = { processRightHandNodes: false }; + } + + const visitor = new PatternVisitor(this.options, node, callback); + visitor.visit(node); + + // Process the right hand nodes recursively. + if (options.processRightHandNodes) { + visitor.rightHandNodes.forEach(this.visit, this); + } + } + + // inherits. + visitClass(node) { + // Decorators. + this._visitArray(node.decorators); + + // Flow type parameters. + const typeParamScope = this._nestTypeParamScope(node); + + // Flow super types. + this._visitTypeAnnotation(node.implements); + this._visitTypeAnnotation( + node.superTypeParameters && node.superTypeParameters.params + ); + + // Basic. + super.visitClass(node); + + // Close the type parameter scope. + if (typeParamScope) { + this.close(node); + } + } + + // inherits. + visitFunction(node) { + const typeParamScope = this._nestTypeParamScope(node); + + // Flow return types. + this._checkIdentifierOrVisit(node.returnType); + + // Basic. + super.visitFunction(node); + + // Close the type parameter scope. + if (typeParamScope) { + this.close(node); + } + } + + // inherits. + visitProperty(node) { + if (node.value && node.value.type === "TypeCastExpression") { + this._visitTypeAnnotation(node.value); + } + this._visitArray(node.decorators); + super.visitProperty(node); + } + + InterfaceDeclaration(node) { + this._createScopeVariable(node, node.id); + + const typeParamScope = this._nestTypeParamScope(node); + + // TODO: Handle mixins + this._visitArray(node.extends); + this.visit(node.body); + + if (typeParamScope) { + this.close(node); + } + } + + TypeAlias(node) { + this._createScopeVariable(node, node.id); + + const typeParamScope = this._nestTypeParamScope(node); + + this.visit(node.right); + + if (typeParamScope) { + this.close(node); + } + } + + ClassProperty(node) { + this._visitClassProperty(node); + } + + ClassPrivateProperty(node) { + this._visitClassProperty(node); + } + + DeclareModule(node) { + this._visitDeclareX(node); + } + + DeclareFunction(node) { + this._visitDeclareX(node); + } + + DeclareVariable(node) { + this._visitDeclareX(node); + } + + DeclareClass(node) { + this._visitDeclareX(node); + } + + _visitClassProperty(node) { + this._visitTypeAnnotation(node.typeAnnotation); + this.visitProperty(node); + } + + _visitDeclareX(node) { + if (node.id) { + this._createScopeVariable(node, node.id); + } + + const typeParamScope = this._nestTypeParamScope(node); + if (typeParamScope) { + this.close(node); + } + } + + _createScopeVariable(node, name) { + this.currentScope().variableScope.__define( + name, + new Definition("Variable", name, node, null, null, null) + ); + } + + _nestTypeParamScope(node) { + if (!node.typeParameters) { + return null; + } + + const parentScope = this.scopeManager.__currentScope; + const scope = new escope.Scope( + this.scopeManager, + "type-parameters", + parentScope, + node, + false + ); + + this.scopeManager.__nestScope(scope); + for (let j = 0; j < node.typeParameters.params.length; j++) { + const name = node.typeParameters.params[j]; + scope.__define(name, new Definition("TypeParameter", name, name)); + if (name.typeAnnotation) { + this._checkIdentifierOrVisit(name); + } + } + scope.__define = function() { + return parentScope.__define.apply(parentScope, arguments); + }; + + return scope; + } + + _visitTypeAnnotation(node) { + if (!node) { + return; + } + if (Array.isArray(node)) { + node.forEach(this._visitTypeAnnotation, this); + return; + } + + // get property to check (params, id, etc...) + const visitorValues = visitorKeysMap[node.type]; + if (!visitorValues) { + return; + } + + // can have multiple properties + for (let i = 0; i < visitorValues.length; i++) { + const visitorValue = visitorValues[i]; + const propertyType = propertyTypes[visitorValue]; + const nodeProperty = node[visitorValue]; + // check if property or type is defined + if (propertyType == null || nodeProperty == null) { + continue; + } + if (propertyType.type === "loop") { + for (let j = 0; j < nodeProperty.length; j++) { + if (Array.isArray(propertyType.values)) { + for (let k = 0; k < propertyType.values.length; k++) { + const loopPropertyNode = nodeProperty[j][propertyType.values[k]]; + if (loopPropertyNode) { + this._checkIdentifierOrVisit(loopPropertyNode); + } + } + } else { + this._checkIdentifierOrVisit(nodeProperty[j]); + } + } + } else if (propertyType.type === "single") { + this._checkIdentifierOrVisit(nodeProperty); + } else if (propertyType.type === "typeAnnotation") { + this._visitTypeAnnotation(node.typeAnnotation); + } else if (propertyType.type === "typeParameters") { + for (let l = 0; l < node.typeParameters.params.length; l++) { + this._checkIdentifierOrVisit(node.typeParameters.params[l]); + } + } else if (propertyType.type === "id") { + if (node.id.type === "Identifier") { + this._checkIdentifierOrVisit(node.id); + } else { + this._visitTypeAnnotation(node.id); + } + } + } + } + + _checkIdentifierOrVisit(node) { + if (node && node.typeAnnotation) { + this._visitTypeAnnotation(node.typeAnnotation); + } else if (node && node.type === "Identifier") { + this.visit(node); + } else { + this._visitTypeAnnotation(node); + } + } + + _visitArray(nodeList) { + if (nodeList) { + for (const node of nodeList) { + this.visit(node); + } + } + } +} + +module.exports = function(ast, parserOptions) { + const options = { + optimistic: false, + directive: false, + nodejsScope: + ast.sourceType === "script" && + (parserOptions.ecmaFeatures && + parserOptions.ecmaFeatures.globalReturn) === true, + impliedStrict: false, + sourceType: ast.sourceType, + ecmaVersion: parserOptions.ecmaVersion || 6, + childVisitorKeys, + fallback, + }; + const scopeManager = new escope.ScopeManager(options); + const referencer = new Referencer(options, scopeManager); + + referencer.visit(ast); + + return scopeManager; +}; diff --git a/eslint/babel-eslint-parser/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/attachComments.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/convertComments.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/convertTemplateType.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/index.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/index.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/index.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/toAST.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/toToken.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js diff --git a/eslint/babel-eslint-parser/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js similarity index 100% rename from eslint/babel-eslint-parser/babylon-to-espree/toTokens.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js new file mode 100644 index 000000000000..35843352bad0 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/index.js @@ -0,0 +1,17 @@ +"use strict"; + +let patched = false; + +exports.parse = function(code, options) { + patched = true; + return require("./parse-with-patch")(code, options); +}; + +exports.parseForESLint = function(code, options) { + if (!patched && options.eslintVisitorKeys && options.eslintScopeManager) { + return require("./parse-with-scope")(code, options); + } + + patched = true; + return { ast: require("./parse-with-patch")(code, options) }; +}; diff --git a/eslint/babel-eslint-parser/index.js b/eslint/babel-eslint-parser/lib/parse-with-patch.js similarity index 84% rename from eslint/babel-eslint-parser/index.js rename to eslint/babel-eslint-parser/lib/parse-with-patch.js index 0fec8e47856a..d8157cfe7271 100644 --- a/eslint/babel-eslint-parser/index.js +++ b/eslint/babel-eslint-parser/lib/parse-with-patch.js @@ -1,12 +1,9 @@ -var babylonToEspree = require("./babylon-to-espree"); +"use strict"; + +var parse = require("./parse"); var Module = require("module"); var path = require("path"); -var parse = require("babylon").parse; var t = require("@babel/types"); -var tt = require("babylon").tokTypes; -var traverse = require("@babel/traverse").default; -var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; - var hasPatched = false; var eslintOptions = {}; @@ -357,7 +354,7 @@ function monkeypatch(modules) { }; } -exports.parse = function(code, options) { +module.exports = function(code, options) { options = options || {}; eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; eslintOptions.sourceType = options.sourceType = @@ -380,81 +377,5 @@ exports.parse = function(code, options) { } } - return exports.parseNoPatch(code, options); -}; - -exports.parseNoPatch = function(code, options) { - var opts = { - codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, - sourceType: options.sourceType, - allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree - allowReturnOutsideFunction: true, - allowSuperOutsideMethod: true, - ranges: true, - tokens: true, - plugins: [ - "flow", - "jsx", - "estree", - "asyncFunctions", - "asyncGenerators", - "classConstructorCall", - "classProperties", - "decorators", - "doExpressions", - "exponentiationOperator", - "exportExtensions", - "functionBind", - "functionSent", - "objectRestSpread", - "trailingFunctionCommas", - "dynamicImport", - "numericSeparator", - "optionalChaining", - "importMeta", - "classPrivateProperties", - "bigInt", - "optionalCatchBinding", - ], - }; - - var ast; - try { - ast = parse(code, opts); - } catch (err) { - if (err instanceof SyntaxError) { - err.lineNumber = err.loc.line; - err.column = err.loc.column; - - if (opts.codeFrame) { - err.lineNumber = err.loc.line; - err.column = err.loc.column + 1; - - // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = - "Line " + - err.lineNumber + - ": " + - err.message.replace(/ \((\d+):(\d+)\)$/, "") + - // add codeframe - "\n\n" + - codeFrameColumns( - code, - { - start: { - line: err.lineNumber, - column: err.column, - }, - }, - { highlightCode: true } - ); - } - } - - throw err; - } - - babylonToEspree(ast, traverse, tt, code); - - return ast; + return parse(code, options); }; diff --git a/eslint/babel-eslint-parser/lib/parse-with-scope.js b/eslint/babel-eslint-parser/lib/parse-with-scope.js new file mode 100644 index 000000000000..a222b79aefe8 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/parse-with-scope.js @@ -0,0 +1,19 @@ +"use strict"; + +const t = require("@babel/types"); +const analyzeScope = require("./analyze-scope"); +const parse = require("./parse"); + +module.exports = function(code, options) { + options = options || {}; + options.ecmaVersion = options.ecmaVersion || 6; + options.sourceType = options.sourceType || "module"; + options.allowImportExportEverywhere = + options.allowImportExportEverywhere || false; + + const ast = parse(code, options); + const scopeManager = analyzeScope(ast, options); + const visitorKeys = t.VISITOR_KEYS; + + return { ast, scopeManager, visitorKeys }; +}; diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js new file mode 100644 index 000000000000..0763d7e056ac --- /dev/null +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -0,0 +1,83 @@ +"use strict"; + +var babylonToEspree = require("./babylon-to-espree"); +var parse = require("babylon").parse; +var tt = require("babylon").tokTypes; +var traverse = require("@babel/traverse").default; +var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; + +module.exports = function(code, options) { + var opts = { + codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, + sourceType: options.sourceType, + allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, + ranges: true, + tokens: true, + plugins: [ + "flow", + "jsx", + "estree", + "asyncFunctions", + "asyncGenerators", + "classConstructorCall", + "classProperties", + "decorators", + "doExpressions", + "exponentiationOperator", + "exportExtensions", + "functionBind", + "functionSent", + "objectRestSpread", + "trailingFunctionCommas", + "dynamicImport", + "numericSeparator", + "optionalChaining", + "importMeta", + "classPrivateProperties", + "bigInt", + "optionalCatchBinding", + ], + }; + + var ast; + try { + ast = parse(code, opts); + } catch (err) { + if (err instanceof SyntaxError) { + err.lineNumber = err.loc.line; + err.column = err.loc.column; + + if (opts.codeFrame) { + err.lineNumber = err.loc.line; + err.column = err.loc.column + 1; + + // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start + err.message = + "Line " + + err.lineNumber + + ": " + + err.message.replace(/ \((\d+):(\d+)\)$/, "") + + // add codeframe + "\n\n" + + codeFrameColumns( + code, + { + start: { + line: err.lineNumber, + column: err.column, + }, + }, + { highlightCode: true } + ); + } + } + + throw err; + } + + babylonToEspree(ast, traverse, tt, code); + + return ast; +}; diff --git a/eslint/babel-eslint-parser/lib/visitor-keys.js b/eslint/babel-eslint-parser/lib/visitor-keys.js new file mode 100644 index 000000000000..9ef7ef970c94 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/visitor-keys.js @@ -0,0 +1,14 @@ +"use strict"; + +const BABEL_VISITOR_KEYS = require("@babel/types").VISITOR_KEYS; +const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS; + +module.exports = Object.assign( + { + MethodDefinition: ["decorators"].concat( + ESLINT_VISITOR_KEYS.MethodDefinition + ), + Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property), + }, + BABEL_VISITOR_KEYS +); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 188478669806..4b884f6d888a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -2,10 +2,9 @@ "name": "babel-eslint", "version": "8.0.3", "description": "Custom parser for ESLint", - "main": "index.js", + "main": "lib/index.js", "files": [ - "index.js", - "babylon-to-espree" + "lib" ], "repository": { "type": "git", @@ -15,7 +14,9 @@ "@babel/code-frame": "7.0.0-beta.31", "@babel/traverse": "7.0.0-beta.31", "@babel/types": "7.0.0-beta.31", - "babylon": "7.0.0-beta.31" + "babylon": "7.0.0-beta.31", + "eslint-scope": "~3.7.1", + "eslint-visitor-keys": "^1.0.0" }, "scripts": { "test": "npm run lint && npm run test-only", @@ -38,7 +39,7 @@ "devDependencies": { "babel-eslint": "^8.0.0", "dedent": "^0.7.0", - "eslint": "^4.1.0", + "eslint": "^4.12.1", "eslint-config-babel": "^7.0.1", "eslint-plugin-flowtype": "^2.30.3", "eslint-plugin-prettier": "^2.1.2", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index ad9838f8b5ca..6e8dd129a7a5 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -81,7 +81,10 @@ function parseAndAssertSame(code) { ecmaVersion: 8, sourceType: "module", }); - var babylonAST = babelEslint.parse(code); + var babylonAST = babelEslint.parseForESLint(code, { + eslintVisitorKeys: true, + eslintScopeManager: true, + }).ast; try { assertImplementsAST(esAST, babylonAST); } catch (err) { @@ -112,7 +115,10 @@ function parseAndAssertSame(code) { describe("babylon-to-esprima", () => { describe("compatibility", () => { it("should allow ast.analyze to be called without options", function() { - var esAST = babelEslint.parse("`test`"); + var esAST = babelEslint.parseForESLint("`test`", { + eslintScopeManager: true, + eslintVisitorKeys: true, + }).ast; assert.doesNotThrow( () => { diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 438860714273..e3f869756116 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0-beta.31", "@babel/code-frame@^7.0.0-beta.31": +"@babel/code-frame@7.0.0-beta.31": version "7.0.0-beta.31" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz#473d021ecc573a2cce1c07d5b509d5215f46ba35" dependencies: @@ -34,7 +34,7 @@ babylon "7.0.0-beta.31" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.31", "@babel/traverse@^7.0.0-beta.31": +"@babel/traverse@7.0.0-beta.31": version "7.0.0-beta.31" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.31.tgz#db399499ad74aefda014f0c10321ab255134b1df" dependencies: @@ -47,7 +47,7 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/types@7.0.0-beta.31", "@babel/types@^7.0.0-beta.31": +"@babel/types@7.0.0-beta.31": version "7.0.0-beta.31" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.31.tgz#42c9c86784f674c173fb21882ca9643334029de4" dependencies: @@ -69,6 +69,10 @@ acorn@^5.0.1: version "5.0.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" +acorn@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" + ajv-keywords@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" @@ -80,6 +84,15 @@ ajv@^4.7.0: co "^4.6.0" json-stable-stringify "^1.0.1" +ajv@^5.3.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.4.0.tgz#32d1cf08dbc80c432f426f12e10b2511f6b46474" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + ansi-escapes@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -92,6 +105,10 @@ ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -205,7 +222,7 @@ babylon@7.0.0-beta.22: version "7.0.0-beta.22" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" -babylon@7.0.0-beta.31, babylon@^7.0.0-beta.31: +babylon@7.0.0-beta.31: version "7.0.0-beta.31" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.31.tgz#7ec10f81e0e456fd0f855ad60fa30c2ac454283f" @@ -252,6 +269,14 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" @@ -344,7 +369,7 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" -cross-spawn@^5.0.1: +cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -362,12 +387,6 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - debug@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64" @@ -398,12 +417,11 @@ diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" -doctrine@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.0.tgz#c73d8d2909d22291e1a007a395804da8b665fe63" +doctrine@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" dependencies: esutils "^2.0.2" - isarray "^1.0.0" elegant-spinner@^1.0.1: version "1.0.1" @@ -436,37 +454,43 @@ eslint-plugin-prettier@^2.1.2: fast-diff "^1.1.1" jest-docblock "^20.0.1" -eslint-scope@^3.7.1: +eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.1.0.tgz#bbb55a28220ee08b69da9554d45a6b2ebfd7d913" +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^4.12.1: + version "4.12.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.12.1.tgz#5ec1973822b4a066b353770c3c6d69a2a188e880" dependencies: + ajv "^5.3.0" babel-code-frame "^6.22.0" - chalk "^1.1.3" + chalk "^2.1.0" concat-stream "^1.6.0" - debug "^2.6.8" - doctrine "^2.0.0" + cross-spawn "^5.1.0" + debug "^3.0.1" + doctrine "^2.0.2" eslint-scope "^3.7.1" - espree "^3.4.3" + espree "^3.5.2" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" glob "^7.1.2" - globals "^9.17.0" + globals "^11.0.1" ignore "^3.3.3" imurmurhash "^0.1.4" inquirer "^3.0.6" - is-my-json-valid "^2.16.0" is-resolvable "^1.0.0" - js-yaml "^3.8.4" - json-stable-stringify "^1.0.1" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" lodash "^4.17.4" minimatch "^3.0.2" @@ -474,24 +498,37 @@ eslint@^4.1.0: natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" - pluralize "^4.0.0" + pluralize "^7.0.0" progress "^2.0.0" require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" strip-json-comments "~2.0.1" table "^4.0.1" text-table "~0.2.0" -espree@^3.4.0, espree@^3.4.3: +espree@^3.4.0: version "3.4.3" resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" dependencies: acorn "^5.0.1" acorn-jsx "^3.0.0" +espree@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + dependencies: + acorn "^5.2.1" + acorn-jsx "^3.0.0" + esprima@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + esquery@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" @@ -537,10 +574,18 @@ external-editor@^2.0.4: jschardet "^1.4.2" tmp "^0.0.31" +fast-deep-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" + fast-diff@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b" +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -578,15 +623,9 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -generate-function@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" get-stream@^3.0.0: version "3.0.0" @@ -607,9 +646,9 @@ globals@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/globals/-/globals-10.0.0.tgz#a5803a1abe923b52bc33a59cffeaf6e0748cf3f7" -globals@^9.17.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" +globals@^11.0.1: + version "11.0.1" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.0.1.tgz#12a87bb010e5154396acc535e1e43fc753b0e5e8" globby@^5.0.0: version "5.0.0" @@ -740,15 +779,6 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" -is-my-json-valid@^2.16.0: - version "2.16.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693" - dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" - is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -769,10 +799,6 @@ is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" - is-resolvable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" @@ -783,7 +809,7 @@ is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" -isarray@^1.0.0, isarray@~1.0.0: +isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -799,17 +825,32 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" -js-yaml@^3.4.3, js-yaml@^3.8.4: +js-yaml@^3.4.3: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" dependencies: argparse "^1.0.7" esprima "^3.1.1" +js-yaml@^3.9.1: + version "3.10.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + jschardet@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -820,10 +861,6 @@ jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -1093,9 +1130,9 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pluralize@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" prelude-ls@~1.1.2: version "1.1.2" @@ -1196,6 +1233,10 @@ safe-buffer@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" +semver@^5.3.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -1253,6 +1294,12 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -1352,10 +1399,6 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -xtend@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" - yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" From d33839a9c306fece26ecc6bb81cf9bf7d1a37e22 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sun, 24 Dec 2017 02:00:29 -0500 Subject: [PATCH 614/965] Re-add parseNoPatch function (accidentally removed) (babel/babel-eslint#557) --- eslint/babel-eslint-parser/lib/index.js | 4 ++++ eslint/babel-eslint-parser/test/babel-eslint.js | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index 35843352bad0..130b10b89868 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -15,3 +15,7 @@ exports.parseForESLint = function(code, options) { patched = true; return { ast: require("./parse-with-patch")(code, options) }; }; + +exports.parseNoPatch = function(code, options) { + return require("./parse")(code, options); +}; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 6e8dd129a7a5..3bebc0acfde0 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -531,3 +531,12 @@ describe("babylon-to-esprima", () => { }); }); }); + +describe("Public API", () => { + it("exports a parseNoPatch function", () => { + assertImplementsAST( + espree.parse("foo"), + babelEslint.parseNoPatch("foo", {}) + ); + }); +}); From 5b08714a4d976ac2790fcb655a8b115a6c0bd200 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Sun, 24 Dec 2017 02:02:44 -0500 Subject: [PATCH 615/965] 8.1.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 4b884f6d888a..0f8892c21dd3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.0.3", + "version": "8.1.0", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From e988a88af042d5b27ed80945d33700ffb0fde172 Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Mon, 25 Dec 2017 01:52:36 -0500 Subject: [PATCH 616/965] Fix: Prevent parseForESLint() behavior from changing after parse() is called (fixes babel/babel-eslint#558)(babel/babel-eslint#559) * Prevent parseForESLint() behavior from changing after parse() is called (fixes https://github.com/babel/babel-eslint/issues/558, fixes https://github.com/eslint/eslint/issues/9767) * Avoid using the enhanced referencer after monkeypatching * Chore: add test for babel/babel-eslint#558 * Pass correct scope analyzer options * fix escope patch and improve tests * remove process.exit(1) --- .../babel-eslint-parser/lib/analyze-scope.js | 9 +- eslint/babel-eslint-parser/lib/index.js | 15 +- .../lib/parse-with-patch.js | 376 +----------------- .../lib/parse-with-scope.js | 6 - .../lib/patch-eslint-scope.js | 370 +++++++++++++++++ eslint/babel-eslint-parser/package.json | 6 +- .../babel-eslint-parser/test/babel-eslint.js | 43 +- .../test/fixtures/assert-implements-ast.js | 41 ++ .../eslint-plugin-import/.eslintrc.yml | 11 + .../test/fixtures/eslint-plugin-import/a.js | 1 + .../test/fixtures/eslint-plugin-import/b.js | 1 + .../test/fixtures/eslint-plugin-import/c.js | 4 + .../test/fixtures/preprocess-to-patch.js | 5 + .../test/fixtures/use-eslint-old.js | 12 + .../test/non-regression.js | 24 +- .../test/z_parser-for-eslint-after-patched.js | 45 +++ eslint/babel-eslint-parser/yarn.lock | 254 +++++++++++- 17 files changed, 779 insertions(+), 444 deletions(-) create mode 100644 eslint/babel-eslint-parser/lib/patch-eslint-scope.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/.eslintrc.yml create mode 100644 eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/a.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/b.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/c.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js create mode 100644 eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index b538dea078d6..6001c13647e4 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -318,9 +318,16 @@ module.exports = function(ast, parserOptions) { impliedStrict: false, sourceType: ast.sourceType, ecmaVersion: parserOptions.ecmaVersion || 6, - childVisitorKeys, fallback, }; + + if (OriginalReferencer._babelEslintPatched) { + require("./patch-eslint-scope")(parserOptions); + return escope.analyze(ast, options); + } + + options.childVisitorKeys = childVisitorKeys; + const scopeManager = new escope.ScopeManager(options); const referencer = new Referencer(options, scopeManager); diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index 130b10b89868..973f742ea592 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -1,18 +1,19 @@ "use strict"; -let patched = false; - exports.parse = function(code, options) { - patched = true; - return require("./parse-with-patch")(code, options); + return exports.parseForESLint(code, options).ast; }; exports.parseForESLint = function(code, options) { - if (!patched && options.eslintVisitorKeys && options.eslintScopeManager) { + options = options || {}; + options.ecmaVersion = options.ecmaVersion || 6; + options.sourceType = options.sourceType || "module"; + options.allowImportExportEverywhere = + options.allowImportExportEverywhere || false; + + if (options.eslintVisitorKeys && options.eslintScopeManager) { return require("./parse-with-scope")(code, options); } - - patched = true; return { ast: require("./parse-with-patch")(code, options) }; }; diff --git a/eslint/babel-eslint-parser/lib/parse-with-patch.js b/eslint/babel-eslint-parser/lib/parse-with-patch.js index d8157cfe7271..ba1b95b5b107 100644 --- a/eslint/babel-eslint-parser/lib/parse-with-patch.js +++ b/eslint/babel-eslint-parser/lib/parse-with-patch.js @@ -1,381 +1,9 @@ "use strict"; var parse = require("./parse"); -var Module = require("module"); -var path = require("path"); -var t = require("@babel/types"); -var hasPatched = false; -var eslintOptions = {}; - -function getModules() { - try { - // avoid importing a local copy of eslint, try to find a peer dependency - var eslintLoc = Module._resolveFilename("eslint", module.parent); - } catch (err) { - try { - // avoids breaking in jest where module.parent is undefined - eslintLoc = require.resolve("eslint"); - } catch (err) { - throw new ReferenceError("couldn't resolve eslint"); - } - } - - // get modules relative to what eslint will load - var eslintMod = new Module(eslintLoc); - eslintMod.filename = eslintLoc; - eslintMod.paths = Module._nodeModulePaths(path.dirname(eslintLoc)); - - try { - var escope = eslintMod.require("eslint-scope"); - var Definition = eslintMod.require("eslint-scope/lib/definition") - .Definition; - var referencer = eslintMod.require("eslint-scope/lib/referencer"); - } catch (err) { - escope = eslintMod.require("escope"); - Definition = eslintMod.require("escope/lib/definition").Definition; - referencer = eslintMod.require("escope/lib/referencer"); - } - - var estraverse = eslintMod.require("estraverse"); - - if (referencer.__esModule) referencer = referencer.default; - - return { - Definition, - escope, - estraverse, - referencer, - }; -} - -function monkeypatch(modules) { - var Definition = modules.Definition; - var escope = modules.escope; - var estraverse = modules.estraverse; - var referencer = modules.referencer; - - Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); - estraverse.VisitorKeys.MethodDefinition.push("decorators"); - estraverse.VisitorKeys.Property.push("decorators"); - - var analyze = escope.analyze; - escope.analyze = function(ast, opts) { - opts = opts || {}; - opts.ecmaVersion = eslintOptions.ecmaVersion; - opts.sourceType = eslintOptions.sourceType; - if (eslintOptions.globalReturn !== undefined) { - opts.nodejsScope = eslintOptions.globalReturn; - } - - var results = analyze.call(this, ast, opts); - return results; - }; - - // if there are decorators, then visit each - function visitDecorators(node) { - if (!node.decorators) { - return; - } - for (var i = 0; i < node.decorators.length; i++) { - if (node.decorators[i].expression) { - this.visit(node.decorators[i]); - } - } - } - - // iterate through part of t.VISITOR_KEYS - var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ - "ArrayPattern", - "ClassDeclaration", - "ClassExpression", - "FunctionDeclaration", - "FunctionExpression", - "Identifier", - "ObjectPattern", - "RestElement", - ]); - var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { - var value = t.VISITOR_KEYS[key]; - if (flowFlippedAliasKeys.indexOf(value) === -1) { - acc[key] = value; - } - return acc; - }, {}); - - var propertyTypes = { - // loops - callProperties: { type: "loop", values: ["value"] }, - indexers: { type: "loop", values: ["key", "value"] }, - properties: { type: "loop", values: ["argument", "value"] }, - types: { type: "loop" }, - params: { type: "loop" }, - // single property - argument: { type: "single" }, - elementType: { type: "single" }, - qualification: { type: "single" }, - rest: { type: "single" }, - returnType: { type: "single" }, - // others - typeAnnotation: { type: "typeAnnotation" }, - typeParameters: { type: "typeParameters" }, - id: { type: "id" }, - }; - - function visitTypeAnnotation(node) { - // get property to check (params, id, etc...) - var visitorValues = visitorKeysMap[node.type]; - if (!visitorValues) { - return; - } - - // can have multiple properties - for (var i = 0; i < visitorValues.length; i++) { - var visitorValue = visitorValues[i]; - var propertyType = propertyTypes[visitorValue]; - var nodeProperty = node[visitorValue]; - // check if property or type is defined - if (propertyType == null || nodeProperty == null) { - continue; - } - if (propertyType.type === "loop") { - for (var j = 0; j < nodeProperty.length; j++) { - if (Array.isArray(propertyType.values)) { - for (var k = 0; k < propertyType.values.length; k++) { - var loopPropertyNode = nodeProperty[j][propertyType.values[k]]; - if (loopPropertyNode) { - checkIdentifierOrVisit.call(this, loopPropertyNode); - } - } - } else { - checkIdentifierOrVisit.call(this, nodeProperty[j]); - } - } - } else if (propertyType.type === "single") { - checkIdentifierOrVisit.call(this, nodeProperty); - } else if (propertyType.type === "typeAnnotation") { - visitTypeAnnotation.call(this, node.typeAnnotation); - } else if (propertyType.type === "typeParameters") { - for (var l = 0; l < node.typeParameters.params.length; l++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[l]); - } - } else if (propertyType.type === "id") { - if (node.id.type === "Identifier") { - checkIdentifierOrVisit.call(this, node.id); - } else { - visitTypeAnnotation.call(this, node.id); - } - } - } - } - - function checkIdentifierOrVisit(node) { - if (node.typeAnnotation) { - visitTypeAnnotation.call(this, node.typeAnnotation); - } else if (node.type === "Identifier") { - this.visit(node); - } else { - visitTypeAnnotation.call(this, node); - } - } - - function nestTypeParamScope(manager, node) { - var parentScope = manager.__currentScope; - var scope = new escope.Scope( - manager, - "type-parameters", - parentScope, - node, - false - ); - manager.__nestScope(scope); - for (var j = 0; j < node.typeParameters.params.length; j++) { - var name = node.typeParameters.params[j]; - scope.__define(name, new Definition("TypeParameter", name, name)); - if (name.typeAnnotation) { - checkIdentifierOrVisit.call(this, name); - } - } - scope.__define = function() { - return parentScope.__define.apply(parentScope, arguments); - }; - return scope; - } - - // visit decorators that are in: ClassDeclaration / ClassExpression - var visitClass = referencer.prototype.visitClass; - referencer.prototype.visitClass = function(node) { - visitDecorators.call(this, node); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - // visit flow type: ClassImplements - if (node.implements) { - for (var i = 0; i < node.implements.length; i++) { - checkIdentifierOrVisit.call(this, node.implements[i]); - } - } - if (node.superTypeParameters) { - for (var k = 0; k < node.superTypeParameters.params.length; k++) { - checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); - } - } - visitClass.call(this, node); - if (typeParamScope) { - this.close(node); - } - }; - - // visit decorators that are in: Property / MethodDefinition - var visitProperty = referencer.prototype.visitProperty; - referencer.prototype.visitProperty = function(node) { - if (node.value && node.value.type === "TypeCastExpression") { - visitTypeAnnotation.call(this, node.value); - } - visitDecorators.call(this, node); - visitProperty.call(this, node); - }; - - function visitClassProperty(node) { - if (node.typeAnnotation) { - visitTypeAnnotation.call(this, node.typeAnnotation); - } - this.visitProperty(node); - } - - // visit ClassProperty as a Property. - referencer.prototype.ClassProperty = visitClassProperty; - - // visit ClassPrivateProperty as a Property. - referencer.prototype.ClassPrivateProperty = visitClassProperty; - - // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression - var visitFunction = referencer.prototype.visitFunction; - referencer.prototype.visitFunction = function(node) { - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (node.returnType) { - checkIdentifierOrVisit.call(this, node.returnType); - } - // only visit if function parameters have types - if (node.params) { - for (var i = 0; i < node.params.length; i++) { - var param = node.params[i]; - if (param.typeAnnotation) { - checkIdentifierOrVisit.call(this, param); - } else if (t.isAssignmentPattern(param)) { - if (param.left.typeAnnotation) { - checkIdentifierOrVisit.call(this, param.left); - } - } - } - } - // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise - // escope will traverse into them and include the identifiers within as declarations - estraverse.VisitorKeys.ObjectPattern = ["properties"]; - estraverse.VisitorKeys.ArrayPattern = ["elements"]; - visitFunction.call(this, node); - // set them back to normal... - estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; - estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; - if (typeParamScope) { - this.close(node); - } - }; - - // visit flow type in VariableDeclaration - var variableDeclaration = referencer.prototype.VariableDeclaration; - referencer.prototype.VariableDeclaration = function(node) { - if (node.declarations) { - for (var i = 0; i < node.declarations.length; i++) { - var id = node.declarations[i].id; - var typeAnnotation = id.typeAnnotation; - if (typeAnnotation) { - checkIdentifierOrVisit.call(this, typeAnnotation); - } - } - } - variableDeclaration.call(this, node); - }; - - function createScopeVariable(node, name) { - this.currentScope().variableScope.__define( - name, - new Definition("Variable", name, node, null, null, null) - ); - } - - referencer.prototype.InterfaceDeclaration = function(node) { - createScopeVariable.call(this, node, node.id); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - // TODO: Handle mixins - for (var i = 0; i < node.extends.length; i++) { - visitTypeAnnotation.call(this, node.extends[i]); - } - visitTypeAnnotation.call(this, node.body); - if (typeParamScope) { - this.close(node); - } - }; - - referencer.prototype.TypeAlias = function(node) { - createScopeVariable.call(this, node, node.id); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (node.right) { - visitTypeAnnotation.call(this, node.right); - } - if (typeParamScope) { - this.close(node); - } - }; - - referencer.prototype.DeclareModule = referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = referencer.prototype.DeclareClass = function( - node - ) { - if (node.id) { - createScopeVariable.call(this, node, node.id); - } - - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (typeParamScope) { - this.close(node); - } - }; -} +var patchEscope = require("./patch-eslint-scope"); module.exports = function(code, options) { - options = options || {}; - eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; - eslintOptions.sourceType = options.sourceType = - options.sourceType || "module"; - eslintOptions.allowImportExportEverywhere = options.allowImportExportEverywhere = - options.allowImportExportEverywhere || false; - if (options.sourceType === "module") { - eslintOptions.globalReturn = false; - } else { - delete eslintOptions.globalReturn; - } - - if (!hasPatched) { - hasPatched = true; - try { - monkeypatch(getModules()); - } catch (err) { - console.error(err.stack); - process.exit(1); - } - } - + patchEscope(options); return parse(code, options); }; diff --git a/eslint/babel-eslint-parser/lib/parse-with-scope.js b/eslint/babel-eslint-parser/lib/parse-with-scope.js index a222b79aefe8..8892076e596c 100644 --- a/eslint/babel-eslint-parser/lib/parse-with-scope.js +++ b/eslint/babel-eslint-parser/lib/parse-with-scope.js @@ -5,12 +5,6 @@ const analyzeScope = require("./analyze-scope"); const parse = require("./parse"); module.exports = function(code, options) { - options = options || {}; - options.ecmaVersion = options.ecmaVersion || 6; - options.sourceType = options.sourceType || "module"; - options.allowImportExportEverywhere = - options.allowImportExportEverywhere || false; - const ast = parse(code, options); const scopeManager = analyzeScope(ast, options); const visitorKeys = t.VISITOR_KEYS; diff --git a/eslint/babel-eslint-parser/lib/patch-eslint-scope.js b/eslint/babel-eslint-parser/lib/patch-eslint-scope.js new file mode 100644 index 000000000000..aec71fc6ca70 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/patch-eslint-scope.js @@ -0,0 +1,370 @@ +"use strict"; + +var Module = require("module"); +var path = require("path"); +var t = require("@babel/types"); + +function getModules() { + try { + // avoid importing a local copy of eslint, try to find a peer dependency + var eslintLoc = Module._resolveFilename("eslint", module.parent); + } catch (err) { + try { + // avoids breaking in jest where module.parent is undefined + eslintLoc = require.resolve("eslint"); + } catch (err) { + throw new ReferenceError("couldn't resolve eslint"); + } + } + + // get modules relative to what eslint will load + var eslintMod = new Module(eslintLoc); + eslintMod.filename = eslintLoc; + eslintMod.paths = Module._nodeModulePaths(path.dirname(eslintLoc)); + + try { + var escope = eslintMod.require("eslint-scope"); + var Definition = eslintMod.require("eslint-scope/lib/definition") + .Definition; + var referencer = eslintMod.require("eslint-scope/lib/referencer"); + } catch (err) { + escope = eslintMod.require("escope"); + Definition = eslintMod.require("escope/lib/definition").Definition; + referencer = eslintMod.require("escope/lib/referencer"); + } + + var estraverse = eslintMod.require("estraverse"); + + if (referencer.__esModule) referencer = referencer.default; + + return { + Definition, + escope, + estraverse, + referencer, + }; +} + +function monkeypatch(modules) { + var Definition = modules.Definition; + var escope = modules.escope; + var estraverse = modules.estraverse; + var referencer = modules.referencer; + + Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); + estraverse.VisitorKeys.MethodDefinition.push("decorators"); + estraverse.VisitorKeys.Property.push("decorators"); + + // if there are decorators, then visit each + function visitDecorators(node) { + if (!node.decorators) { + return; + } + for (var i = 0; i < node.decorators.length; i++) { + if (node.decorators[i].expression) { + this.visit(node.decorators[i]); + } + } + } + + // iterate through part of t.VISITOR_KEYS + var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ + "ArrayPattern", + "ClassDeclaration", + "ClassExpression", + "FunctionDeclaration", + "FunctionExpression", + "Identifier", + "ObjectPattern", + "RestElement", + ]); + var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { + var value = t.VISITOR_KEYS[key]; + if (flowFlippedAliasKeys.indexOf(value) === -1) { + acc[key] = value; + } + return acc; + }, {}); + + var propertyTypes = { + // loops + callProperties: { type: "loop", values: ["value"] }, + indexers: { type: "loop", values: ["key", "value"] }, + properties: { type: "loop", values: ["argument", "value"] }, + types: { type: "loop" }, + params: { type: "loop" }, + // single property + argument: { type: "single" }, + elementType: { type: "single" }, + qualification: { type: "single" }, + rest: { type: "single" }, + returnType: { type: "single" }, + // others + typeAnnotation: { type: "typeAnnotation" }, + typeParameters: { type: "typeParameters" }, + id: { type: "id" }, + }; + + function visitTypeAnnotation(node) { + // get property to check (params, id, etc...) + var visitorValues = visitorKeysMap[node.type]; + if (!visitorValues) { + return; + } + + // can have multiple properties + for (var i = 0; i < visitorValues.length; i++) { + var visitorValue = visitorValues[i]; + var propertyType = propertyTypes[visitorValue]; + var nodeProperty = node[visitorValue]; + // check if property or type is defined + if (propertyType == null || nodeProperty == null) { + continue; + } + if (propertyType.type === "loop") { + for (var j = 0; j < nodeProperty.length; j++) { + if (Array.isArray(propertyType.values)) { + for (var k = 0; k < propertyType.values.length; k++) { + var loopPropertyNode = nodeProperty[j][propertyType.values[k]]; + if (loopPropertyNode) { + checkIdentifierOrVisit.call(this, loopPropertyNode); + } + } + } else { + checkIdentifierOrVisit.call(this, nodeProperty[j]); + } + } + } else if (propertyType.type === "single") { + checkIdentifierOrVisit.call(this, nodeProperty); + } else if (propertyType.type === "typeAnnotation") { + visitTypeAnnotation.call(this, node.typeAnnotation); + } else if (propertyType.type === "typeParameters") { + for (var l = 0; l < node.typeParameters.params.length; l++) { + checkIdentifierOrVisit.call(this, node.typeParameters.params[l]); + } + } else if (propertyType.type === "id") { + if (node.id.type === "Identifier") { + checkIdentifierOrVisit.call(this, node.id); + } else { + visitTypeAnnotation.call(this, node.id); + } + } + } + } + + function checkIdentifierOrVisit(node) { + if (node.typeAnnotation) { + visitTypeAnnotation.call(this, node.typeAnnotation); + } else if (node.type === "Identifier") { + this.visit(node); + } else { + visitTypeAnnotation.call(this, node); + } + } + + function nestTypeParamScope(manager, node) { + var parentScope = manager.__currentScope; + var scope = new escope.Scope( + manager, + "type-parameters", + parentScope, + node, + false + ); + manager.__nestScope(scope); + for (var j = 0; j < node.typeParameters.params.length; j++) { + var name = node.typeParameters.params[j]; + scope.__define(name, new Definition("TypeParameter", name, name)); + if (name.typeAnnotation) { + checkIdentifierOrVisit.call(this, name); + } + } + scope.__define = function() { + return parentScope.__define.apply(parentScope, arguments); + }; + return scope; + } + + // visit decorators that are in: ClassDeclaration / ClassExpression + var visitClass = referencer.prototype.visitClass; + referencer.prototype.visitClass = function(node) { + visitDecorators.call(this, node); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + // visit flow type: ClassImplements + if (node.implements) { + for (var i = 0; i < node.implements.length; i++) { + checkIdentifierOrVisit.call(this, node.implements[i]); + } + } + if (node.superTypeParameters) { + for (var k = 0; k < node.superTypeParameters.params.length; k++) { + checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); + } + } + visitClass.call(this, node); + if (typeParamScope) { + this.close(node); + } + }; + + // visit decorators that are in: Property / MethodDefinition + var visitProperty = referencer.prototype.visitProperty; + referencer.prototype.visitProperty = function(node) { + if (node.value && node.value.type === "TypeCastExpression") { + visitTypeAnnotation.call(this, node.value); + } + visitDecorators.call(this, node); + visitProperty.call(this, node); + }; + + function visitClassProperty(node) { + if (node.typeAnnotation) { + visitTypeAnnotation.call(this, node.typeAnnotation); + } + this.visitProperty(node); + } + + // visit ClassProperty as a Property. + referencer.prototype.ClassProperty = visitClassProperty; + + // visit ClassPrivateProperty as a Property. + referencer.prototype.ClassPrivateProperty = visitClassProperty; + + // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression + var visitFunction = referencer.prototype.visitFunction; + referencer.prototype.visitFunction = function(node) { + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + if (node.returnType) { + checkIdentifierOrVisit.call(this, node.returnType); + } + // only visit if function parameters have types + if (node.params) { + for (var i = 0; i < node.params.length; i++) { + var param = node.params[i]; + if (param.typeAnnotation) { + checkIdentifierOrVisit.call(this, param); + } else if (t.isAssignmentPattern(param)) { + if (param.left.typeAnnotation) { + checkIdentifierOrVisit.call(this, param.left); + } + } + } + } + // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise + // escope will traverse into them and include the identifiers within as declarations + estraverse.VisitorKeys.ObjectPattern = ["properties"]; + estraverse.VisitorKeys.ArrayPattern = ["elements"]; + visitFunction.call(this, node); + // set them back to normal... + estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; + estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; + if (typeParamScope) { + this.close(node); + } + }; + + // visit flow type in VariableDeclaration + var variableDeclaration = referencer.prototype.VariableDeclaration; + referencer.prototype.VariableDeclaration = function(node) { + if (node.declarations) { + for (var i = 0; i < node.declarations.length; i++) { + var id = node.declarations[i].id; + var typeAnnotation = id.typeAnnotation; + if (typeAnnotation) { + checkIdentifierOrVisit.call(this, typeAnnotation); + } + } + } + variableDeclaration.call(this, node); + }; + + function createScopeVariable(node, name) { + this.currentScope().variableScope.__define( + name, + new Definition("Variable", name, node, null, null, null) + ); + } + + referencer.prototype.InterfaceDeclaration = function(node) { + createScopeVariable.call(this, node, node.id); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + // TODO: Handle mixins + for (var i = 0; i < node.extends.length; i++) { + visitTypeAnnotation.call(this, node.extends[i]); + } + visitTypeAnnotation.call(this, node.body); + if (typeParamScope) { + this.close(node); + } + }; + + referencer.prototype.TypeAlias = function(node) { + createScopeVariable.call(this, node, node.id); + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + if (node.right) { + visitTypeAnnotation.call(this, node.right); + } + if (typeParamScope) { + this.close(node); + } + }; + + referencer.prototype.DeclareModule = referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = referencer.prototype.DeclareClass = function( + node + ) { + if (node.id) { + createScopeVariable.call(this, node, node.id); + } + + var typeParamScope; + if (node.typeParameters) { + typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); + } + if (typeParamScope) { + this.close(node); + } + }; + + referencer._babelEslintPatched = true; +} + +// To patch for each call. +var escope = null; +var escopeAnalyze = null; + +module.exports = function(parserOptions) { + // Patch `Referencer.prototype` once. + if (!escope) { + const modules = getModules(); + monkeypatch(modules); + + // Store to patch for each call. + escope = modules.escope; + escopeAnalyze = modules.escope.analyze; + } + + // Patch `escope.analyze` based on the current parserOptions. + escope.analyze = function(ast, opts) { + opts = opts || {}; + opts.ecmaVersion = parserOptions.ecmaVersion; + opts.sourceType = parserOptions.sourceType; + opts.nodejsScope = + ast.sourceType === "script" && + (parserOptions.ecmaFeatures && + parserOptions.ecmaFeatures.globalReturn) === true; + + return escopeAnalyze.call(this, ast, opts); + }; +}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0f8892c21dd3..7338678d294b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -20,7 +20,7 @@ }, "scripts": { "test": "npm run lint && npm run test-only", - "test-only": "mocha", + "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js && mocha --require test/fixtures/use-eslint-old.js", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", "precommit": "lint-staged", @@ -39,9 +39,11 @@ "devDependencies": { "babel-eslint": "^8.0.0", "dedent": "^0.7.0", - "eslint": "^4.12.1", + "eslint": "^4.14.0", "eslint-config-babel": "^7.0.1", + "eslint-old": "npm:eslint@4.13.1", "eslint-plugin-flowtype": "^2.30.3", + "eslint-plugin-import": "^2.8.0", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.4.0", "husky": "^0.14.0", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 3bebc0acfde0..9218a783a4f2 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -4,48 +4,7 @@ var espree = require("espree"); var escope = require("eslint-scope"); var util = require("util"); var unpad = require("dedent"); - -// Checks if the source ast implements the target ast. Ignores extra keys on source ast -function assertImplementsAST(target, source, path) { - if (!path) { - path = []; - } - - function error(text) { - var err = new Error(`At ${path.join(".")}: ${text}:`); - err.depth = path.length + 1; - throw err; - } - - var typeA = target === null ? "null" : typeof target; - var typeB = source === null ? "null" : typeof source; - if (typeA !== typeB) { - error( - `have different types (${typeA} !== ${typeB}) (${target} !== ${source})` - ); - } else if ( - typeA === "object" && - ["RegExp"].indexOf(target.constructor.name) !== -1 && - target.constructor.name !== source.constructor.name - ) { - error( - `object have different constructors (${target.constructor - .name} !== ${source.constructor.name}` - ); - } else if (typeA === "object") { - var keysTarget = Object.keys(target); - for (var i in keysTarget) { - var key = keysTarget[i]; - path.push(key); - assertImplementsAST(target[key], source[key], path); - path.pop(); - } - } else if (target !== source) { - error( - `are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})` - ); - } -} +var assertImplementsAST = require("./fixtures/assert-implements-ast"); function lookup(obj, keypath, backwardsDepth) { if (!keypath) { diff --git a/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js b/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js new file mode 100644 index 000000000000..61e77e21b06b --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js @@ -0,0 +1,41 @@ +// Checks if the source ast implements the target ast. Ignores extra keys on source ast +module.exports = function assertImplementsAST(target, source, path) { + if (!path) { + path = []; + } + + function error(text) { + var err = new Error(`At ${path.join(".")}: ${text}:`); + err.depth = path.length + 1; + throw err; + } + + var typeA = target === null ? "null" : typeof target; + var typeB = source === null ? "null" : typeof source; + if (typeA !== typeB) { + error( + `have different types (${typeA} !== ${typeB}) (${target} !== ${source})` + ); + } else if ( + typeA === "object" && + ["RegExp"].indexOf(target.constructor.name) !== -1 && + target.constructor.name !== source.constructor.name + ) { + error( + `object have different constructors (${target.constructor + .name} !== ${source.constructor.name}` + ); + } else if (typeA === "object") { + var keysTarget = Object.keys(target); + for (var i in keysTarget) { + var key = keysTarget[i]; + path.push(key); + assertImplementsAST(target[key], source[key], path); + path.pop(); + } + } else if (target !== source) { + error( + `are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})` + ); + } +}; diff --git a/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/.eslintrc.yml b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/.eslintrc.yml new file mode 100644 index 000000000000..418b3d0c0ceb --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/.eslintrc.yml @@ -0,0 +1,11 @@ +root: true + +# babel-eslint +parser: ../../../lib/index.js + +# use eslint-plugin-import +plugins: + - import +rules: + import/no-named-as-default: error + no-unused-vars: error diff --git a/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/a.js b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/a.js new file mode 100644 index 000000000000..e8d96fc4d62d --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/a.js @@ -0,0 +1 @@ +export default function foo() { } diff --git a/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/b.js b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/b.js new file mode 100644 index 000000000000..b3a52f870198 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/b.js @@ -0,0 +1 @@ +import foo from './a.js'; diff --git a/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/c.js b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/c.js new file mode 100644 index 000000000000..2beac98f3b74 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/eslint-plugin-import/c.js @@ -0,0 +1,4 @@ +// @flow +type Foo = {}; + +const FlowTypeButton = ({ }: Foo) => { }; diff --git a/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js b/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js new file mode 100644 index 000000000000..1dbfc172a106 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js @@ -0,0 +1,5 @@ +"use strict" +const babelEslint = require("../..") + +// Apply monkeypatch to eslint-scope. +babelEslint.parse("var x = 0;") diff --git a/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js b/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js new file mode 100644 index 000000000000..e26a39c89d06 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js @@ -0,0 +1,12 @@ +"use strict" + +var Module = require('module'); +var originalRequire = Module.prototype.require; + +// Override to eslint-old +Module.prototype.require = function () { + if (arguments[0] === "eslint") { + arguments[0] = "eslint-old"; + } + return originalRequire.apply(this, arguments); +}; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4161af03d67b..8ff223b623a5 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -3,12 +3,13 @@ var eslint = require("eslint"); var unpad = require("dedent"); -function verifyAndAssertMessages( +function verifyAndAssertMessagesWithSpecificESLint( code, rules, expectedMessages, sourceType, - overrideConfig + overrideConfig, + linter ) { var config = { parser: require.resolve(".."), @@ -34,7 +35,7 @@ function verifyAndAssertMessages( } } - var messages = eslint.linter.verify(code, config); + var messages = linter.verify(code, config); if (messages.length !== expectedMessages.length) { throw new Error( @@ -62,6 +63,23 @@ function verifyAndAssertMessages( }); } +function verifyAndAssertMessages( + code, + rules, + expectedMessages, + sourceType, + overrideConfig +) { + verifyAndAssertMessagesWithSpecificESLint( + code, + rules, + expectedMessages, + sourceType, + overrideConfig, + new eslint.Linter() + ); +} + describe("verify", () => { it("arrow function support (issue #1)", () => { verifyAndAssertMessages("describe('stuff', () => {});", {}, []); diff --git a/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js b/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js new file mode 100644 index 000000000000..a7d6882d351e --- /dev/null +++ b/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js @@ -0,0 +1,45 @@ +"use strict"; + +const eslint = require("eslint"); +const assert = require("assert"); +const babelEslint = require(".."); +const espree = require("espree"); +var assertImplementsAST = require("./fixtures/assert-implements-ast"); + +describe("https://github.com/babel/babel-eslint/issues/558", () => { + it("don't crash with eslint-plugin-import", () => { + const engine = new eslint.CLIEngine({ ignore: false }); + engine.executeOnFiles([ + "test/fixtures/eslint-plugin-import/a.js", + "test/fixtures/eslint-plugin-import/b.js", + "test/fixtures/eslint-plugin-import/c.js", + ]); + }); + + /* + * This test ensures that the enhanced referencer does not get used if eslint-scope has already been + * monkeypatched, because this causes some correctness issues. For example, if the enhanced referencer + * is used after the original referencer is monkeypatched, type annotation references are counted twice. + */ + it("does not visit type annotations multiple times after monkeypatching and calling parseForESLint()", () => { + assertImplementsAST( + espree.parse("foo", { sourceType: "module" }), + babelEslint.parse("foo", {}) + ); + const parseResult = babelEslint.parseForESLint( + "type Foo = {}; function x(): Foo {}", + { + eslintVisitorKeys: true, + eslintScopeManager: true, + } + ); + assert(parseResult.visitorKeys); + assert(parseResult.scopeManager); + + const fooVariable = parseResult.scopeManager.getDeclaredVariables( + parseResult.ast.body[0] + )[0]; + + assert.strictEqual(fooVariable.references.length, 1); + }); +}); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index e3f869756116..5cb0ef21fa89 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -241,6 +241,10 @@ browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +builtin-modules@^1.0.0, builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -352,6 +356,10 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -381,12 +389,18 @@ date-fns@^1.27.2: version "1.28.5" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" -debug@3.1.0: +debug@3.1.0, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" +debug@^2.6.8: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + dependencies: + ms "2.0.0" + debug@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64" @@ -417,6 +431,13 @@ diff@3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" +doctrine@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + doctrine@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" @@ -441,12 +462,83 @@ eslint-config-babel@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.1.tgz#aac7b79f2f06f52358a5a764fdc01fde23718572" +eslint-import-resolver-node@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc" + dependencies: + debug "^2.6.8" + resolve "^1.2.0" + +eslint-module-utils@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" + dependencies: + debug "^2.6.8" + pkg-dir "^1.0.0" + +"eslint-old@npm:eslint@4.13.1": + version "4.13.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.0.1" + doctrine "^2.0.2" + eslint-scope "^3.7.1" + espree "^3.5.2" + esquery "^1.0.0" + estraverse "^4.2.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "^4.0.1" + text-table "~0.2.0" + eslint-plugin-flowtype@^2.30.3: version "2.34.0" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" dependencies: lodash "^4.15.0" +eslint-plugin-import@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.6.8" + doctrine "1.5.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.1.1" + has "^1.0.1" + lodash.cond "^4.3.0" + minimatch "^3.0.3" + read-pkg-up "^2.0.0" + eslint-plugin-prettier@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz#4b90f4ee7f92bfbe2e926017e1ca40eb628965ea" @@ -465,21 +557,21 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.12.1: - version "4.12.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.12.1.tgz#5ec1973822b4a066b353770c3c6d69a2a188e880" +eslint@^4.14.0: + version "4.14.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.14.0.tgz#96609768d1dd23304faba2d94b7fefe5a5447a82" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" chalk "^2.1.0" concat-stream "^1.6.0" cross-spawn "^5.1.0" - debug "^3.0.1" + debug "^3.1.0" doctrine "^2.0.2" eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" espree "^3.5.2" esquery "^1.0.0" - estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" functional-red-black-tree "^1.0.1" @@ -610,6 +702,19 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +find-up@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + dependencies: + locate-path "^2.0.0" + flat-cache@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" @@ -623,6 +728,10 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" +function-bind@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" @@ -683,10 +792,20 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + he@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + husky@^0.14.0: version "0.14.1" resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.1.tgz#8edba33e728ceed75343e88bb8002e4cbd8d1b40" @@ -757,6 +876,12 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + is-ci@^1.0.10: version "1.0.10" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" @@ -809,7 +934,7 @@ is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" -isarray@~1.0.0: +isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -929,10 +1054,30 @@ listr@^0.12.0: stream-to-observable "^0.1.0" strip-ansi "^3.0.1" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +locate-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + dependencies: + p-locate "^2.0.0" + path-exists "^3.0.0" + lodash.chunk@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -967,7 +1112,7 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -1014,6 +1159,15 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" @@ -1094,6 +1248,16 @@ p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" +p-limit@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + +p-locate@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + dependencies: + p-limit "^1.1.0" + p-map@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" @@ -1104,6 +1268,16 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1116,6 +1290,16 @@ path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -1130,6 +1314,12 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + dependencies: + find-up "^1.0.0" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" @@ -1154,6 +1344,21 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + readable-stream@^2.2.2: version "2.3.2" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.2.tgz#5a04df05e4f57fe3f0dc68fdd11dc5c97c7e6f4d" @@ -1187,6 +1392,12 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve@^1.2.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -1233,7 +1444,7 @@ safe-buffer@~5.1.0: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" -semver@^5.3.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" @@ -1255,6 +1466,20 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -1300,6 +1525,10 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -1379,6 +1608,13 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + which@^1.2.10, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" From a706e85b19fa25c2e7db1bcf508c2fbaddfd5e55 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Mon, 25 Dec 2017 15:57:19 +0900 Subject: [PATCH 617/965] 8.1.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7338678d294b..501733ce2f40 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.1.0", + "version": "8.1.1", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 3cb154df82f2f96691de1d224a6fe8dcb808d079 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 26 Dec 2017 10:49:36 +0900 Subject: [PATCH 618/965] Fix: ignore eval (fixes babel/babel-eslint#560) (babel/babel-eslint#561) --- eslint/babel-eslint-parser/lib/analyze-scope.js | 1 + eslint/babel-eslint-parser/test/non-regression.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index 6001c13647e4..287763ccef55 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -309,6 +309,7 @@ class Referencer extends OriginalReferencer { module.exports = function(ast, parserOptions) { const options = { + ignoreEval: true, optimistic: false, directive: false, nodejsScope: diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 8ff223b623a5..1d223bd8a87a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1874,4 +1874,16 @@ describe("verify", () => { [] ); }); + + it("ignore eval in scope analysis", () => { + verifyAndAssertMessages( + unpad(` + const a = 1; + console.log(a); + eval(''); + `), + { "no-unused-vars": 1, "no-undef": 1 }, + [] + ); + }); }); From 624a425f7da138772c95092c3b0d07aaac0db0d8 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 26 Dec 2017 10:50:13 +0900 Subject: [PATCH 619/965] Fix: add Literal type to visitorKeys (babel/babel-eslint#562) * Fix: add Literal type to visitorKeys * Fix: use ./visitor-keys --- eslint/babel-eslint-parser/lib/parse-with-scope.js | 3 +-- eslint/babel-eslint-parser/lib/visitor-keys.js | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/parse-with-scope.js b/eslint/babel-eslint-parser/lib/parse-with-scope.js index 8892076e596c..36e3fce5b067 100644 --- a/eslint/babel-eslint-parser/lib/parse-with-scope.js +++ b/eslint/babel-eslint-parser/lib/parse-with-scope.js @@ -1,13 +1,12 @@ "use strict"; -const t = require("@babel/types"); +const visitorKeys = require("./visitor-keys"); const analyzeScope = require("./analyze-scope"); const parse = require("./parse"); module.exports = function(code, options) { const ast = parse(code, options); const scopeManager = analyzeScope(ast, options); - const visitorKeys = t.VISITOR_KEYS; return { ast, scopeManager, visitorKeys }; }; diff --git a/eslint/babel-eslint-parser/lib/visitor-keys.js b/eslint/babel-eslint-parser/lib/visitor-keys.js index 9ef7ef970c94..921a0bb01657 100644 --- a/eslint/babel-eslint-parser/lib/visitor-keys.js +++ b/eslint/babel-eslint-parser/lib/visitor-keys.js @@ -5,6 +5,7 @@ const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS; module.exports = Object.assign( { + Literal: ESLINT_VISITOR_KEYS.Literal, MethodDefinition: ["decorators"].concat( ESLINT_VISITOR_KEYS.MethodDefinition ), From d0d84aca9b1cc70c0cccb8045395165c47eee7e5 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 26 Dec 2017 10:59:19 +0900 Subject: [PATCH 620/965] 8.1.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 501733ce2f40..dc7dce591e48 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.1.1", + "version": "8.1.2", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 660180b93258d9195cc1acfea9b88627edd0c26f Mon Sep 17 00:00:00 2001 From: jony89 Date: Tue, 9 Jan 2018 00:40:11 +0200 Subject: [PATCH 621/965] update babel packages (babel/babel-eslint#565) * update babel packages There is some critical bug fixes in version babylon#7.0.0-beta.33 regard `async` - `await` syntax which is needed pretty immediately :) * remove test 42 (test for import type *) `import type *` is invalid, since the namespace can't be a type --- eslint/babel-eslint-parser/package.json | 8 ++++---- eslint/babel-eslint-parser/test/non-regression.js | 11 ----------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index dc7dce591e48..61f2974d93af 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.31", - "@babel/traverse": "7.0.0-beta.31", - "@babel/types": "7.0.0-beta.31", - "babylon": "7.0.0-beta.31", + "@babel/code-frame": "7.0.0-beta.36", + "@babel/traverse": "7.0.0-beta.36", + "@babel/types": "7.0.0-beta.36", + "babylon": "7.0.0-beta.36", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1d223bd8a87a..67fa66226718 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1079,17 +1079,6 @@ describe("verify", () => { ); }); - it("42", () => { - verifyAndAssertMessages( - unpad(` - import type * as namespace from 'bar'; - namespace; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); - }); - it("43", () => { verifyAndAssertMessages( unpad(` From 97c944251114bb0ef6a40191157914556fc7c1ee Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 8 Jan 2018 17:45:24 -0500 Subject: [PATCH 622/965] Make 2018 the default ecmaVersion for rules relying on parserOptions (babel/babel-eslint#556) --- eslint/babel-eslint-parser/lib/analyze-scope.js | 2 +- eslint/babel-eslint-parser/lib/index.js | 2 +- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/test/babel-eslint.js | 4 ++-- eslint/babel-eslint-parser/test/non-regression.js | 2 +- eslint/babel-eslint-parser/yarn.lock | 11 ----------- 6 files changed, 6 insertions(+), 17 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index 287763ccef55..dd4cc3b35a5a 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -318,7 +318,7 @@ module.exports = function(ast, parserOptions) { parserOptions.ecmaFeatures.globalReturn) === true, impliedStrict: false, sourceType: ast.sourceType, - ecmaVersion: parserOptions.ecmaVersion || 6, + ecmaVersion: parserOptions.ecmaVersion || 2018, fallback, }; diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index 973f742ea592..c4655280afad 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -6,7 +6,7 @@ exports.parse = function(code, options) { exports.parseForESLint = function(code, options) { options = options || {}; - options.ecmaVersion = options.ecmaVersion || 6; + options.ecmaVersion = options.ecmaVersion || 2018; options.sourceType = options.sourceType || "module"; options.allowImportExportEverywhere = options.allowImportExportEverywhere || false; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 61f2974d93af..3c93db711381 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -45,7 +45,7 @@ "eslint-plugin-flowtype": "^2.30.3", "eslint-plugin-import": "^2.8.0", "eslint-plugin-prettier": "^2.1.2", - "espree": "^3.4.0", + "espree": "^3.5.2", "husky": "^0.14.0", "lint-staged": "^4.0.0", "mocha": "^4.0.0", diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 9218a783a4f2..db1b5222de09 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -37,7 +37,7 @@ function parseAndAssertSame(code) { range: true, comment: true, attachComment: true, - ecmaVersion: 8, + ecmaVersion: 2018, sourceType: "module", }); var babylonAST = babelEslint.parseForESLint(code, { @@ -71,7 +71,7 @@ function parseAndAssertSame(code) { // assert.equal(esAST, babylonAST); } -describe("babylon-to-esprima", () => { +describe("babylon-to-espree", () => { describe("compatibility", () => { it("should allow ast.analyze to be called without options", function() { var esAST = babelEslint.parseForESLint("`test`", { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 67fa66226718..da0f4158a405 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -19,7 +19,7 @@ function verifyAndAssertMessagesWithSpecificESLint( es6: true, }, parserOptions: { - ecmaVersion: 8, + ecmaVersion: 2018, ecmaFeatures: { jsx: true, experimentalObjectRestSpread: true, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 5cb0ef21fa89..88c27bf9308f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -65,10 +65,6 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.0.1: - version "5.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" - acorn@^5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" @@ -599,13 +595,6 @@ eslint@^4.14.0: table "^4.0.1" text-table "~0.2.0" -espree@^3.4.0: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" - dependencies: - acorn "^5.0.1" - acorn-jsx "^3.0.0" - espree@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" From 2afde9943402092413bb124bf99c801d3e81c0c6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Jan 2018 17:46:57 -0500 Subject: [PATCH 623/965] Add other parser plugins, update yarn.lock (babel/babel-eslint#569) --- eslint/babel-eslint-parser/lib/parse.js | 3 ++ eslint/babel-eslint-parser/yarn.lock | 71 +++++++++++++------------ 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 0763d7e056ac..14ee9ae17a2a 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -38,6 +38,9 @@ module.exports = function(code, options) { "classPrivateProperties", "bigInt", "optionalCatchBinding", + "throwExpressions", + "pipelineOperator", + "nullishCoalescingOperator", ], }; diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 88c27bf9308f..2687f955f704 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,54 +2,53 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz#473d021ecc573a2cce1c07d5b509d5215f46ba35" +"@babel/code-frame@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/helper-function-name@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.31.tgz#afe63ad799209989348b1109b44feb66aa245f57" +"@babel/helper-function-name@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.31" - "@babel/template" "7.0.0-beta.31" - "@babel/traverse" "7.0.0-beta.31" - "@babel/types" "7.0.0-beta.31" + "@babel/helper-get-function-arity" "7.0.0-beta.36" + "@babel/template" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.31.tgz#1176d79252741218e0aec872ada07efb2b37a493" +"@babel/helper-get-function-arity@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" dependencies: - "@babel/types" "7.0.0-beta.31" + "@babel/types" "7.0.0-beta.36" -"@babel/template@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.31.tgz#577bb29389f6c497c3e7d014617e7d6713f68bda" +"@babel/template@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" dependencies: - "@babel/code-frame" "7.0.0-beta.31" - "@babel/types" "7.0.0-beta.31" - babylon "7.0.0-beta.31" + "@babel/code-frame" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.31.tgz#db399499ad74aefda014f0c10321ab255134b1df" +"@babel/traverse@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" dependencies: - "@babel/code-frame" "7.0.0-beta.31" - "@babel/helper-function-name" "7.0.0-beta.31" - "@babel/types" "7.0.0-beta.31" - babylon "7.0.0-beta.31" + "@babel/code-frame" "7.0.0-beta.36" + "@babel/helper-function-name" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" debug "^3.0.1" - globals "^10.0.0" + globals "^11.1.0" invariant "^2.2.0" lodash "^4.2.0" -"@babel/types@7.0.0-beta.31": - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.31.tgz#42c9c86784f674c173fb21882ca9643334029de4" +"@babel/types@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" dependencies: esutils "^2.0.2" lodash "^4.2.0" @@ -218,9 +217,9 @@ babylon@7.0.0-beta.22: version "7.0.0-beta.22" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" -babylon@7.0.0-beta.31: - version "7.0.0-beta.31" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.31.tgz#7ec10f81e0e456fd0f855ad60fa30c2ac454283f" +babylon@7.0.0-beta.36: + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" balanced-match@^1.0.0: version "1.0.0" @@ -748,6 +747,10 @@ globals@^11.0.1: version "11.0.1" resolved "https://registry.yarnpkg.com/globals/-/globals-11.0.1.tgz#12a87bb010e5154396acc535e1e43fc753b0e5e8" +globals@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" From b6ce2b649f8e5ffcb75ba2c3f42c7cbf83f1a46c Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 8 Jan 2018 18:06:57 -0500 Subject: [PATCH 624/965] 8.2.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3c93db711381..04e02892eb55 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.1.2", + "version": "8.2.0", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 23d12acd1524604d1db785b51d1981cc132c9130 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Jan 2018 19:15:22 -0500 Subject: [PATCH 625/965] fix export change (babel/babel-eslint#571) --- eslint/babel-eslint-parser/lib/parse.js | 3 ++- .../test/non-regression.js | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 14ee9ae17a2a..f29e6af155b5 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -26,7 +26,8 @@ module.exports = function(code, options) { "decorators", "doExpressions", "exponentiationOperator", - "exportExtensions", + "exportDefaultFrom", + "exportNamespaceFrom", "functionBind", "functionSent", "objectRestSpread", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index da0f4158a405..db5bb59c1791 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1864,6 +1864,26 @@ describe("verify", () => { ); }); + it("exportDefaultFrom", () => { + verifyAndAssertMessages( + unpad(` + export v from "mod" + `), + {}, + [] + ); + }); + + it("exportNamespaceFrom", () => { + verifyAndAssertMessages( + unpad(` + export * as ns from "mod" + `), + {}, + [] + ); + }); + it("ignore eval in scope analysis", () => { verifyAndAssertMessages( unpad(` From 6d37c551dd2bf0fc7a15754400d685a7cf76045f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 8 Jan 2018 19:15:40 -0500 Subject: [PATCH 626/965] 8.2.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 04e02892eb55..46f9462b2c08 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.0", + "version": "8.2.1", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From fbb7ff6e44dad0178fc8efd22663df108772d215 Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Wed, 17 Jan 2018 15:10:55 +0900 Subject: [PATCH 627/965] Fix: wrong token type of ! and ~ (fixes babel/babel-eslint#576) (babel/babel-eslint#577) --- .../lib/babylon-to-espree/toToken.js | 3 ++- eslint/babel-eslint-parser/test/babel-eslint.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js index 9c5a49ef11dd..082aef3e3267 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js @@ -38,7 +38,8 @@ module.exports = function(token, tt, source) { type === tt.plusMin || type === tt.modulo || type === tt.exponent || - type === tt.prefix || + type === tt.bang || + type === tt.tilde || type === tt.doubleColon || type.isAssign ) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index db1b5222de09..c066ed280997 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -48,12 +48,6 @@ function parseAndAssertSame(code) { assertImplementsAST(esAST, babylonAST); } catch (err) { var traversal = err.message.slice(3, err.message.indexOf(":")); - if (esAST.tokens) { - delete esAST.tokens; - } - if (babylonAST.tokens) { - delete babylonAST.tokens; - } err.message += unpad(` espree: ${util.inspect(lookup(esAST, traversal, 2), { @@ -170,6 +164,14 @@ describe("babylon-to-espree", () => { parseAndAssertSame("a = 1"); }); + it("logical NOT", () => { + parseAndAssertSame("!0"); + }); + + it("bitwise NOT", () => { + parseAndAssertSame("~0"); + }); + it("class declaration", () => { parseAndAssertSame("class Foo {}"); }); From 7057e9fb73b3f6b127b50636240850418490571c Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 15 Feb 2018 21:39:42 -0600 Subject: [PATCH 628/965] Bump deps (babel/babel-eslint#591) --- eslint/babel-eslint-parser/package.json | 10 +-- eslint/babel-eslint-parser/yarn.lock | 105 +++++++++++++++--------- 2 files changed, 72 insertions(+), 43 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 46f9462b2c08..62edfc262c61 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.36", - "@babel/traverse": "7.0.0-beta.36", - "@babel/types": "7.0.0-beta.36", - "babylon": "7.0.0-beta.36", + "@babel/code-frame": "7.0.0-beta.40", + "@babel/traverse": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, @@ -48,7 +48,7 @@ "espree": "^3.5.2", "husky": "^0.14.0", "lint-staged": "^4.0.0", - "mocha": "^4.0.0", + "mocha": "^5.0.1", "prettier": "^1.4.4" }, "lint-staged": { diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 2687f955f704..06890f7ee2b0 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,53 +2,70 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" +"@babel/code-frame@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" + "@babel/highlight" "7.0.0-beta.40" + +"@babel/generator@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.40.tgz#ab61f9556f4f71dbd1138949c795bb9a21e302ea" + dependencies: + "@babel/types" "7.0.0-beta.40" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz#9d033341ab16517f40d43a73f2d81fc431ccd7b6" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.40" + "@babel/template" "7.0.0-beta.40" + "@babel/types" "7.0.0-beta.40" -"@babel/helper-function-name@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" +"@babel/helper-get-function-arity@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz#ac0419cf067b0ec16453e1274f03878195791c6e" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.36" - "@babel/template" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.40" -"@babel/helper-get-function-arity@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" +"@babel/highlight@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255" dependencies: - "@babel/types" "7.0.0-beta.36" + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" -"@babel/template@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" +"@babel/template@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.40.tgz#034988c6424eb5c3268fe6a608626de1f4410fc8" dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" + "@babel/code-frame" "7.0.0-beta.40" + "@babel/types" "7.0.0-beta.40" + babylon "7.0.0-beta.40" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" +"@babel/traverse@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e" dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/helper-function-name" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" + "@babel/code-frame" "7.0.0-beta.40" + "@babel/generator" "7.0.0-beta.40" + "@babel/helper-function-name" "7.0.0-beta.40" + "@babel/types" "7.0.0-beta.40" + babylon "7.0.0-beta.40" debug "^3.0.1" globals "^11.1.0" invariant "^2.2.0" lodash "^4.2.0" -"@babel/types@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" +"@babel/types@7.0.0-beta.40": + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14" dependencies: esutils "^2.0.2" lodash "^4.2.0" @@ -217,9 +234,9 @@ babylon@7.0.0-beta.22: version "7.0.0-beta.22" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" -babylon@7.0.0-beta.36: - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" +babylon@7.0.0-beta.40: + version "7.0.0-beta.40" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.40.tgz#91fc8cd56d5eb98b28e6fde41045f2957779940a" balanced-match@^1.0.0: version "1.0.0" @@ -960,6 +977,10 @@ jschardet@^1.4.2: version "1.4.2" resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" +jsesc@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -1124,9 +1145,9 @@ mkdirp@0.5.1, mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mocha@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.0.1.tgz#0aee5a95cf69a4618820f5e51fa31717117daf1b" +mocha@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.1.tgz#759b62c836b0732382a62b6b1fb245ec1bc943ac" dependencies: browser-stdout "1.3.0" commander "2.11.0" @@ -1458,6 +1479,10 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -1582,6 +1607,10 @@ to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + tryit@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" From c03d5c41a5d9f3d58f3820d98fcec9085f9910b6 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 20 Feb 2018 11:49:19 +0100 Subject: [PATCH 629/965] chore(package): update lint-staged to version 6.1.1 (babel/babel-eslint#592) Closes babel/babel-eslint#539 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 62edfc262c61..7ba9a610a2de 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -47,7 +47,7 @@ "eslint-plugin-prettier": "^2.1.2", "espree": "^3.5.2", "husky": "^0.14.0", - "lint-staged": "^4.0.0", + "lint-staged": "^6.1.1", "mocha": "^5.0.1", "prettier": "^1.4.4" }, From c27c2b6e68b5066de91cf95847472063c4251336 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 20 Feb 2018 11:54:09 +0100 Subject: [PATCH 630/965] Update dependencies --- eslint/babel-eslint-parser/.eslintrc.js | 2 +- eslint/babel-eslint-parser/.prettierrc | 3 + .../babel-eslint-parser/lib/analyze-scope.js | 4 +- eslint/babel-eslint-parser/package.json | 2 +- .../test/non-regression.js | 14 +- eslint/babel-eslint-parser/yarn.lock | 737 ++++++++++-------- 6 files changed, 404 insertions(+), 358 deletions(-) create mode 100644 eslint/babel-eslint-parser/.prettierrc diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js index adce94d69a00..64dc12e693fe 100644 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -7,7 +7,7 @@ module.exports = { rules: { "no-var": 0, "max-len": 0, - "prettier/prettier": ["error", { "trailingComma": "es5" }], + "prettier/prettier": "error", }, env: { node: true, diff --git a/eslint/babel-eslint-parser/.prettierrc b/eslint/babel-eslint-parser/.prettierrc new file mode 100644 index 000000000000..88a0e9a2990e --- /dev/null +++ b/eslint/babel-eslint-parser/.prettierrc @@ -0,0 +1,3 @@ +{ + "trailingComma": "es5" + } \ No newline at end of file diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index dd4cc3b35a5a..fb9f4d4e8c09 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -314,8 +314,8 @@ module.exports = function(ast, parserOptions) { directive: false, nodejsScope: ast.sourceType === "script" && - (parserOptions.ecmaFeatures && - parserOptions.ecmaFeatures.globalReturn) === true, + (parserOptions.ecmaFeatures && + parserOptions.ecmaFeatures.globalReturn) === true, impliedStrict: false, sourceType: ast.sourceType, ecmaVersion: parserOptions.ecmaVersion || 2018, diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7ba9a610a2de..102de3554c86 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -39,7 +39,7 @@ "devDependencies": { "babel-eslint": "^8.0.0", "dedent": "^0.7.0", - "eslint": "^4.14.0", + "eslint": "npm:eslint@4.13.1", "eslint-config-babel": "^7.0.1", "eslint-old": "npm:eslint@4.13.1", "eslint-plugin-flowtype": "^2.30.3", diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index db5bb59c1791..9031a410f0eb 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -39,18 +39,16 @@ function verifyAndAssertMessagesWithSpecificESLint( if (messages.length !== expectedMessages.length) { throw new Error( - `Expected ${expectedMessages.length} message(s), got ${messages.length}\n${JSON.stringify( - messages, - null, - 2 - )}` + `Expected ${expectedMessages.length} message(s), got ${ + messages.length + }\n${JSON.stringify(messages, null, 2)}` ); } messages.forEach((message, i) => { - var formatedMessage = `${message.line}:${message.column} ${message.message}${message.ruleId - ? ` ${message.ruleId}` - : ""}`; + var formatedMessage = `${message.line}:${message.column} ${ + message.message + }${message.ruleId ? ` ${message.ruleId}` : ""}`; if (formatedMessage !== expectedMessages[i]) { throw new Error( unpad(` diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 06890f7ee2b0..5fb449e52708 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,6 +2,14 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@babel/code-frame@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" @@ -18,6 +26,14 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/helper-function-name@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.36" + "@babel/template" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + "@babel/helper-function-name@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz#9d033341ab16517f40d43a73f2d81fc431ccd7b6" @@ -26,6 +42,12 @@ "@babel/template" "7.0.0-beta.40" "@babel/types" "7.0.0-beta.40" +"@babel/helper-get-function-arity@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" + dependencies: + "@babel/types" "7.0.0-beta.36" + "@babel/helper-get-function-arity@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz#ac0419cf067b0ec16453e1274f03878195791c6e" @@ -40,6 +62,15 @@ esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/template@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + lodash "^4.2.0" + "@babel/template@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.40.tgz#034988c6424eb5c3268fe6a608626de1f4410fc8" @@ -49,6 +80,19 @@ babylon "7.0.0-beta.40" lodash "^4.2.0" +"@babel/traverse@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/helper-function-name" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + debug "^3.0.1" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.2.0" + "@babel/traverse@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e" @@ -63,6 +107,14 @@ invariant "^2.2.0" lodash "^4.2.0" +"@babel/types@7.0.0-beta.36": + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + "@babel/types@7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14" @@ -81,24 +133,17 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" - -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" +acorn@^5.4.0: + version "5.4.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" -ajv@^4.7.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" -ajv@^5.3.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.4.0.tgz#32d1cf08dbc80c432f426f12e10b2511f6b46474" +ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" dependencies: co "^4.6.0" fast-deep-equal "^1.0.0" @@ -109,9 +154,9 @@ ansi-escapes@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" -ansi-escapes@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" +ansi-escapes@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" ansi-regex@^2.0.0: version "2.1.1" @@ -125,19 +170,23 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.1.0: +ansi-styles@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" dependencies: color-convert "^1.9.0" +any-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" + app-root-path@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" dependencies: sprintf-js "~1.0.2" @@ -155,84 +204,28 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" -babel-code-frame@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-7.0.0-beta.0.tgz#418a7b5f3f7dc9a4670e61b1158b4c5661bec98d" - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: - chalk "^1.1.0" + chalk "^1.1.3" esutils "^2.0.2" - js-tokens "^3.0.0" + js-tokens "^3.0.2" babel-eslint@^8.0.0: - version "8.0.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.0.1.tgz#5d718be7a328625d006022eb293ed3008cbd6346" - dependencies: - babel-code-frame "7.0.0-beta.0" - babel-traverse "7.0.0-beta.0" - babel-types "7.0.0-beta.0" - babylon "7.0.0-beta.22" - -babel-helper-function-name@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-7.0.0-beta.0.tgz#d1b6779b647e5c5c31ebeb05e13b998e4d352d56" - dependencies: - babel-helper-get-function-arity "7.0.0-beta.0" - babel-template "7.0.0-beta.0" - babel-traverse "7.0.0-beta.0" - babel-types "7.0.0-beta.0" - -babel-helper-get-function-arity@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-7.0.0-beta.0.tgz#9d1ab7213bb5efe1ef1638a8ea1489969b5a8b6e" - dependencies: - babel-types "7.0.0-beta.0" - -babel-messages@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-7.0.0-beta.0.tgz#6df01296e49fc8fbd0637394326a167f36da817b" - -babel-template@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-7.0.0-beta.0.tgz#85083cf9e4395d5e48bf5154d7a8d6991cafecfb" - dependencies: - babel-traverse "7.0.0-beta.0" - babel-types "7.0.0-beta.0" - babylon "7.0.0-beta.22" - lodash "^4.2.0" - -babel-traverse@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-7.0.0-beta.0.tgz#da14be9b762f62a2f060db464eaafdd8cd072a41" - dependencies: - babel-code-frame "7.0.0-beta.0" - babel-helper-function-name "7.0.0-beta.0" - babel-messages "7.0.0-beta.0" - babel-types "7.0.0-beta.0" - babylon "7.0.0-beta.22" - debug "^3.0.1" - globals "^10.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-types@7.0.0-beta.0: - version "7.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-7.0.0-beta.0.tgz#eb8b6e556470e6dcc4aef982d79ad229469b5169" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" + version "8.2.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951" + dependencies: + "@babel/code-frame" "7.0.0-beta.36" + "@babel/traverse" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.36" + babylon "7.0.0-beta.36" + eslint-scope "~3.7.1" + eslint-visitor-keys "^1.0.0" -babylon@7.0.0-beta.22: - version "7.0.0-beta.22" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.22.tgz#74f0ad82ed7c7c3cfeab74cf684f815104161b65" +babylon@7.0.0-beta.36: + version "7.0.0-beta.36" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" babylon@7.0.0-beta.40: version "7.0.0-beta.40" @@ -243,8 +236,8 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -267,7 +260,7 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" -chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -277,29 +270,25 @@ chalk@^1.0.0, chalk@^1.1.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.0.1.tgz#dbec49436d2ae15f536114e76d14656cdbc0f44d" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" dependencies: - ansi-styles "^3.1.0" + ansi-styles "^3.2.0" escape-string-regexp "^1.0.5" - supports-color "^4.0.0" + supports-color "^5.2.0" -chalk@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" - dependencies: - ansi-styles "^3.1.0" - escape-string-regexp "^1.0.5" - supports-color "^4.0.0" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" ci-info@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" + version "1.1.2" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" circular-json@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" cli-cursor@^1.0.2: version "1.0.2" @@ -325,8 +314,8 @@ cli-truncate@^0.2.1: string-width "^1.0.1" cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" co@^4.6.0: version "4.6.0" @@ -337,8 +326,8 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" color-convert@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" dependencies: color-name "^1.1.1" @@ -350,11 +339,9 @@ commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" -commander@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" +commander@^2.11.0, commander@^2.9.0: + version "2.14.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" concat-map@0.0.1: version "0.0.1" @@ -376,18 +363,14 @@ core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cosmiconfig@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-1.1.0.tgz#0dea0f9804efdfb929fbb1b188e25553ea053d37" +cosmiconfig@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" dependencies: - graceful-fs "^4.1.2" - js-yaml "^3.4.3" - minimist "^1.2.0" - object-assign "^4.0.1" - os-homedir "^1.0.1" - parse-json "^2.2.0" - pinkie-promise "^2.0.0" - require-from-string "^1.1.0" + is-directory "^0.3.1" + js-yaml "^3.9.0" + parse-json "^4.0.0" + require-from-string "^2.0.1" cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" @@ -398,27 +381,21 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: which "^1.2.9" date-fns@^1.27.2: - version "1.28.5" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.28.5.tgz#257cfc45d322df45ef5658665967ee841cd73faf" + version "1.29.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" -debug@3.1.0, debug@^3.1.0: +debug@3.1.0, debug@^3.0.1, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: ms "2.0.0" -debug@^2.6.8: +debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" -debug@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.0.1.tgz#0564c612b521dc92d9f2988f0549e34f9c98db64" - dependencies: - ms "2.0.0" - dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -450,9 +427,9 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.0.2.tgz#68f96ce8efc56cc42651f1faadb4f175273b0075" +doctrine@^2.0.2, doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: esutils "^2.0.2" @@ -460,7 +437,7 @@ elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" -error-ex@^1.2.0: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: @@ -471,15 +448,15 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" eslint-config-babel@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.1.tgz#aac7b79f2f06f52358a5a764fdc01fde23718572" + version "7.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.2.tgz#cbde74f61cee087d8cd6e607fcfa087869a02d99" eslint-import-resolver-node@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz#4422574cde66a9a7b099938ee4d508a199e0e3cc" + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" dependencies: - debug "^2.6.8" - resolve "^1.2.0" + debug "^2.6.9" + resolve "^1.5.0" eslint-module-utils@^2.1.1: version "2.1.1" @@ -488,7 +465,7 @@ eslint-module-utils@^2.1.1: debug "^2.6.8" pkg-dir "^1.0.0" -"eslint-old@npm:eslint@4.13.1": +"eslint-old@npm:eslint@4.13.1", "eslint@npm:eslint@4.13.1": version "4.13.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" dependencies: @@ -531,8 +508,8 @@ eslint-module-utils@^2.1.1: text-table "~0.2.0" eslint-plugin-flowtype@^2.30.3: - version "2.34.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.34.0.tgz#b9875f314652e5081623c9d2b18a346bbb759c09" + version "2.45.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.45.0.tgz#20d8b15d1e1e71ea4e9498e8be3fc62c0752fcbf" dependencies: lodash "^4.15.0" @@ -552,11 +529,11 @@ eslint-plugin-import@^2.8.0: read-pkg-up "^2.0.0" eslint-plugin-prettier@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.1.2.tgz#4b90f4ee7f92bfbe2e926017e1ca40eb628965ea" + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" dependencies: fast-diff "^1.1.1" - jest-docblock "^20.0.1" + jest-docblock "^21.0.0" eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" @@ -570,8 +547,8 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" eslint@^4.14.0: - version "4.14.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.14.0.tgz#96609768d1dd23304faba2d94b7fefe5a5447a82" + version "4.18.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.0.tgz#ebd0ba795af6dc59aa5cee17938160af5950e051" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -579,7 +556,7 @@ eslint@^4.14.0: concat-stream "^1.6.0" cross-spawn "^5.1.0" debug "^3.1.0" - doctrine "^2.0.2" + doctrine "^2.1.0" eslint-scope "^3.7.1" eslint-visitor-keys "^1.0.0" espree "^3.5.2" @@ -612,16 +589,12 @@ eslint@^4.14.0: text-table "~0.2.0" espree@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" + version "3.5.3" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" dependencies: - acorn "^5.2.1" + acorn "^5.4.0" acorn-jsx "^3.0.0" -esprima@^3.1.1: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -647,9 +620,9 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" +execa@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -664,20 +637,20 @@ exit-hook@^1.0.0: resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" external-editor@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.0.4.tgz#1ed9199da9cbfe2ef2f7a31b2fde8b0d12368972" + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" dependencies: + chardet "^0.4.0" iconv-lite "^0.4.17" - jschardet "^1.4.2" - tmp "^0.0.31" + tmp "^0.0.33" fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" fast-diff@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.1.tgz#0aea0e4e605b6a2189f0e936d4b7fbaf1b7cfd9b" + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" fast-json-stable-stringify@^2.0.0: version "2.0.0" @@ -707,6 +680,10 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +find-parent-dir@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -721,8 +698,8 @@ find-up@^2.0.0: locate-path "^2.0.0" flat-cache@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + version "1.3.0" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" dependencies: circular-json "^0.3.1" del "^2.0.2" @@ -741,6 +718,10 @@ functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" +get-own-enumerable-property-symbols@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -756,17 +737,9 @@ glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-10.0.0.tgz#a5803a1abe923b52bc33a59cffeaf6e0748cf3f7" - -globals@^11.0.1: - version "11.0.1" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.0.1.tgz#12a87bb010e5154396acc535e1e43fc753b0e5e8" - -globals@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" +globals@^11.0.1, globals@^11.1.0: + version "11.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" globby@^5.0.0: version "5.0.0" @@ -783,10 +756,6 @@ graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - growl@1.10.3: version "1.10.3" resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" @@ -801,6 +770,10 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -816,20 +789,20 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" husky@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.1.tgz#8edba33e728ceed75343e88bb8002e4cbd8d1b40" + version "0.14.3" + resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" dependencies: is-ci "^1.0.10" normalize-path "^1.0.0" strip-indent "^2.0.0" iconv-lite@^0.4.17: - version "0.4.18" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" ignore@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.3.tgz#432352e57accd87ab3110e82d3fea0e47812156d" + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" imurmurhash@^0.1.4: version "0.1.4" @@ -842,8 +815,8 @@ indent-string@^2.1.0: repeating "^2.0.0" indent-string@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.1.0.tgz#08ff4334603388399b329e6b9538dc7a3cf5de7d" + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" inflight@^1.0.4: version "1.0.6" @@ -857,11 +830,11 @@ inherits@2, inherits@^2.0.3, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" inquirer@^3.0.6: - version "3.1.1" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" dependencies: - ansi-escapes "^2.0.0" - chalk "^1.0.0" + ansi-escapes "^3.0.0" + chalk "^2.0.0" cli-cursor "^2.1.0" cli-width "^2.0.0" external-editor "^2.0.4" @@ -871,13 +844,13 @@ inquirer@^3.0.6: run-async "^2.2.0" rx-lite "^4.0.8" rx-lite-aggregates "^4.0.8" - string-width "^2.0.0" - strip-ansi "^3.0.0" + string-width "^2.1.0" + strip-ansi "^4.0.0" through "^2.3.6" invariant@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + version "2.2.3" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.3.tgz#1a827dfde7dcbd7c323f0ca826be8fa7c5e9d688" dependencies: loose-envify "^1.0.0" @@ -892,11 +865,19 @@ is-builtin-module@^1.0.0: builtin-modules "^1.0.0" is-ci@^1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.0.10.tgz#f739336b2632365061a9d48270cd56ae3369318e" + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" dependencies: ci-info "^1.0.0" +is-directory@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + is-finite@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" @@ -913,6 +894,22 @@ is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" +is-glob@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + dependencies: + is-extglob "^2.1.1" + +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + +is-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" + dependencies: + symbol-observable "^0.2.2" + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -924,8 +921,8 @@ is-path-in-cwd@^1.0.0: is-path-inside "^1.0.0" is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" dependencies: path-is-inside "^1.0.1" @@ -933,11 +930,13 @@ is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" -is-resolvable@^1.0.0: +is-regexp@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" - dependencies: - tryit "^1.0.1" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" is-stream@^1.1.0: version "1.1.0" @@ -951,36 +950,42 @@ isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" -jest-docblock@^20.0.1: - version "20.0.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-20.0.3.tgz#17bea984342cc33d83c50fbe1545ea0efaa44712" +jest-docblock@^21.0.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" +jest-get-type@^21.2.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" -js-yaml@^3.4.3: - version "3.8.4" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" +jest-validate@^21.1.0: + version "21.2.1" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" dependencies: - argparse "^1.0.7" - esprima "^3.1.1" + chalk "^2.0.1" + jest-get-type "^21.2.0" + leven "^2.1.0" + pretty-format "^21.2.1" -js-yaml@^3.9.1: +js-tokens@^3.0.0, js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +js-yaml@^3.9.0, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: argparse "^1.0.7" esprima "^4.0.0" -jschardet@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/jschardet/-/jschardet-1.4.2.tgz#2aa107f142af4121d145659d44f50830961e699a" - jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" +json-parse-better-errors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -989,15 +994,9 @@ json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" -json-stable-stringify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" - -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" levn@^0.3.0, levn@~0.3.0: version "0.3.0" @@ -1006,27 +1005,38 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-4.0.0.tgz#c15669f598614a6e68090303e175a799d48e0d85" +lint-staged@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.1.1.tgz#cd08c4d9b8ccc2d37198d1c47ce77d22be6cf324" dependencies: app-root-path "^2.0.0" - cosmiconfig "^1.1.0" - execa "^0.7.0" - listr "^0.12.0" - lodash.chunk "^4.2.0" + chalk "^2.1.0" + commander "^2.11.0" + cosmiconfig "^4.0.0" + debug "^3.1.0" + dedent "^0.7.0" + execa "^0.8.0" + find-parent-dir "^0.3.0" + is-glob "^4.0.0" + jest-validate "^21.1.0" + listr "^0.13.0" + lodash "^4.17.4" + log-symbols "^2.0.0" minimatch "^3.0.0" npm-which "^3.0.1" p-map "^1.1.1" - staged-git-files "0.0.4" + path-is-inside "^1.0.2" + pify "^3.0.0" + staged-git-files "1.0.0" + stringify-object "^3.2.0" listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" -listr-update-renderer@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.2.0.tgz#ca80e1779b4e70266807e8eed1ad6abe398550f9" +listr-update-renderer@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -1038,33 +1048,34 @@ listr-update-renderer@^0.2.0: strip-ansi "^3.0.1" listr-verbose-renderer@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.0.tgz#44dc01bb0c34a03c572154d4d08cde9b1dc5620f" + version "0.4.1" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" dependencies: chalk "^1.1.3" cli-cursor "^1.0.2" date-fns "^1.27.2" figures "^1.7.0" -listr@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.12.0.tgz#6bce2c0f5603fa49580ea17cd6a00cc0e5fa451a" +listr@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" figures "^1.7.0" indent-string "^2.1.0" + is-observable "^0.2.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.2.0" + listr-update-renderer "^0.4.0" listr-verbose-renderer "^0.4.0" log-symbols "^1.0.2" log-update "^1.0.2" ora "^0.2.3" p-map "^1.1.1" - rxjs "^5.0.0-beta.11" - stream-to-observable "^0.1.0" + rxjs "^5.4.2" + stream-to-observable "^0.2.0" strip-ansi "^3.0.1" load-json-file@^2.0.0: @@ -1083,17 +1094,13 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash.chunk@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.chunk/-/lodash.chunk-4.2.0.tgz#66e5ce1f76ed27b4303d8c6512e8d1216e8106bc" - lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" -lodash@^4.0.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" log-symbols@^1.0.2: version "1.0.2" @@ -1101,6 +1108,12 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" +log-symbols@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + dependencies: + chalk "^2.0.1" + log-update@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" @@ -1122,8 +1135,8 @@ lru-cache@^4.0.1: yallist "^2.1.2" mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" @@ -1135,10 +1148,6 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - mkdirp@0.5.1, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -1186,8 +1195,8 @@ normalize-path@^1.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" npm-path@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.3.tgz#15cff4e1c89a38da77f56f6055b24f975dfb2bbe" + version "2.0.4" + resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" dependencies: which "^1.2.10" @@ -1249,11 +1258,7 @@ ora@^0.2.3: cli-spinners "^0.1.2" object-assign "^4.0.1" -os-homedir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-tmpdir@~1.0.1: +os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -1262,8 +1267,10 @@ p-finally@^1.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" p-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + dependencies: + p-try "^1.0.0" p-locate@^2.0.0: version "2.0.0" @@ -1272,8 +1279,12 @@ p-locate@^2.0.0: p-limit "^1.1.0" p-map@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + +p-try@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" parse-json@^2.2.0: version "2.2.0" @@ -1281,6 +1292,13 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -1317,6 +1335,10 @@ pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + pinkie-promise@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" @@ -1342,12 +1364,19 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" prettier@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.4.4.tgz#a8d1447b14c9bf67e6d420dcadd10fb9a4fad65a" + version "1.10.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +pretty-format@^21.2.1: + version "21.2.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" progress@^2.0.0: version "2.0.0" @@ -1373,15 +1402,15 @@ read-pkg@^2.0.0: path-type "^2.0.0" readable-stream@^2.2.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.2.tgz#5a04df05e4f57fe3f0dc68fdd11dc5c97c7e6f4d" + version "2.3.4" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" dependencies: core-util-is "~1.0.0" inherits "~2.0.3" isarray "~1.0.0" - process-nextick-args "~1.0.6" - safe-buffer "~5.1.0" - string_decoder "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" util-deprecate "~1.0.1" repeating@^2.0.0: @@ -1390,9 +1419,9 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" -require-from-string@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-1.2.1.tgz#529c9ccef27380adfec9a2f965b649bbee636418" +require-from-string@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" require-uncached@^1.0.3: version "1.0.3" @@ -1405,7 +1434,7 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve@^1.2.0: +resolve@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: @@ -1426,8 +1455,8 @@ restore-cursor@^2.0.0: signal-exit "^3.0.2" rimraf@^2.2.8: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" @@ -1447,19 +1476,19 @@ rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" -rxjs@^5.0.0-beta.11: - version "5.4.1" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.4.1.tgz#b62f757f279445d265a18a58fb0a70dc90e91626" +rxjs@^5.4.2: + version "5.5.6" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" dependencies: - symbol-observable "^1.0.1" + symbol-observable "1.0.1" -safe-buffer@~5.1.0: +safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" "semver@2 || 3 || 4 || 5", semver@^5.3.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" shebang-command@^1.2.0: version "1.2.0" @@ -1479,6 +1508,12 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + source-map@^0.5.0: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -1501,13 +1536,15 @@ sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -staged-git-files@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" +staged-git-files@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.0.0.tgz#cdb847837c1fcc52c08a872d4883cc0877668a80" -stream-to-observable@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" +stream-to-observable@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" + dependencies: + any-observable "^0.2.0" string-width@^1.0.1: version "1.0.2" @@ -1517,19 +1554,27 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" +string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: is-fullwidth-code-point "^2.0.0" - strip-ansi "^3.0.0" + strip-ansi "^4.0.0" -string_decoder@~1.0.0: +string_decoder@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" dependencies: safe-buffer "~5.1.0" +stringify-object@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" + dependencies: + get-own-enumerable-property-symbols "^2.0.1" + is-obj "^1.0.1" + is-regexp "^1.0.0" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -1568,26 +1613,30 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^4.0.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.2.1.tgz#65a4bb2631e90e02420dba5554c375a4754bb836" +supports-color@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" dependencies: - has-flag "^2.0.0" + has-flag "^3.0.0" -symbol-observable@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +symbol-observable@^0.2.2: + version "0.2.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" table@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.1.tgz#a8116c133fac2c61f4a420ab6cdf5c4d61f0e435" + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" text-table@~0.2.0: version "0.2.0" @@ -1597,11 +1646,11 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -tmp@^0.0.31: - version "0.0.31" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" dependencies: - os-tmpdir "~1.0.1" + os-tmpdir "~1.0.2" to-fast-properties@^2.0.0: version "2.0.0" @@ -1611,10 +1660,6 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -tryit@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" - type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -1637,8 +1682,8 @@ validate-npm-package-license@^3.0.1: spdx-expression-parse "~1.0.0" which@^1.2.10, which@^1.2.9: - version "1.2.14" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: isexe "^2.0.0" From 1bd58fa018b080117f0bcc7acf43ecb6f8d37a2d Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 20 Feb 2018 11:56:40 +0100 Subject: [PATCH 631/965] Allow newer versions of babel --- eslint/babel-eslint-parser/package.json | 8 ++-- eslint/babel-eslint-parser/yarn.lock | 52 +++---------------------- 2 files changed, 9 insertions(+), 51 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 102de3554c86..143915540dbb 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.40", - "@babel/traverse": "7.0.0-beta.40", - "@babel/types": "7.0.0-beta.40", - "babylon": "7.0.0-beta.40", + "@babel/code-frame": "^7.0.0-beta.40", + "@babel/traverse": "^7.0.0-beta.40", + "@babel/types": "^7.0.0-beta.40", + "babylon": "^7.0.0-beta.40", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 5fb449e52708..5e44c4e1fd33 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,7 +10,7 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.40": +"@babel/code-frame@7.0.0-beta.40", "@babel/code-frame@^7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" dependencies: @@ -93,7 +93,7 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.40": +"@babel/traverse@^7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e" dependencies: @@ -115,7 +115,7 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.40": +"@babel/types@7.0.0-beta.40", "@babel/types@^7.0.0-beta.40": version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14" dependencies: @@ -227,7 +227,7 @@ babylon@7.0.0-beta.36: version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" -babylon@7.0.0-beta.40: +babylon@7.0.0-beta.40, babylon@^7.0.0-beta.40: version "7.0.0-beta.40" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.40.tgz#91fc8cd56d5eb98b28e6fde41045f2957779940a" @@ -427,7 +427,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2, doctrine@^2.1.0: +doctrine@^2.0.2: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -546,48 +546,6 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@^4.14.0: - version "4.18.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.0.tgz#ebd0ba795af6dc59aa5cee17938160af5950e051" - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.2" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "^4.0.1" - text-table "~0.2.0" - espree@^3.5.2: version "3.5.3" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" From f75f7a0601a02615bc9bfc1b2459e6feebcb8c16 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Tue, 20 Feb 2018 11:57:07 +0100 Subject: [PATCH 632/965] 8.2.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 143915540dbb..d857ca0a9b99 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.1", + "version": "8.2.2", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From b2c065976b68697661299e03f3fbdcfec16dfc0f Mon Sep 17 00:00:00 2001 From: Bary Levi Date: Fri, 13 Apr 2018 18:23:03 +0300 Subject: [PATCH 633/965] Save babel beta packages as exact versions (babel/babel-eslint#606) [skip ci] --- eslint/babel-eslint-parser/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d857ca0a9b99..8b25a9968de5 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "^7.0.0-beta.40", - "@babel/traverse": "^7.0.0-beta.40", - "@babel/types": "^7.0.0-beta.40", - "babylon": "^7.0.0-beta.40", + "@babel/code-frame": "7.0.0-beta.40", + "@babel/traverse": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, From 2f7aea98eb1165b2ac7980e8b19f172f4d79023b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 13 Apr 2018 11:23:59 -0400 Subject: [PATCH 634/965] lock to beta.44 --- eslint/babel-eslint-parser/package.json | 8 +-- eslint/babel-eslint-parser/yarn.lock | 91 +++++++++++++------------ 2 files changed, 53 insertions(+), 46 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8b25a9968de5..7f62231b3063 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.40", - "@babel/traverse": "7.0.0-beta.40", - "@babel/types": "7.0.0-beta.40", - "babylon": "7.0.0-beta.40", + "@babel/code-frame": "7.0.0-beta.44", + "@babel/traverse": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 5e44c4e1fd33..53c3bceda635 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,17 +10,17 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.40", "@babel/code-frame@^7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz#37e2b0cf7c56026b4b21d3927cadf81adec32ac6" +"@babel/code-frame@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" dependencies: - "@babel/highlight" "7.0.0-beta.40" + "@babel/highlight" "7.0.0-beta.44" -"@babel/generator@7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.40.tgz#ab61f9556f4f71dbd1138949c795bb9a21e302ea" +"@babel/generator@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" dependencies: - "@babel/types" "7.0.0-beta.40" + "@babel/types" "7.0.0-beta.44" jsesc "^2.5.1" lodash "^4.2.0" source-map "^0.5.0" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz#9d033341ab16517f40d43a73f2d81fc431ccd7b6" +"@babel/helper-function-name@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.40" - "@babel/template" "7.0.0-beta.40" - "@babel/types" "7.0.0-beta.40" + "@babel/helper-get-function-arity" "7.0.0-beta.44" + "@babel/template" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,15 +48,21 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz#ac0419cf067b0ec16453e1274f03878195791c6e" +"@babel/helper-get-function-arity@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" dependencies: - "@babel/types" "7.0.0-beta.40" + "@babel/types" "7.0.0-beta.44" -"@babel/highlight@7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.40.tgz#b43d67d76bf46e1d10d227f68cddcd263786b255" +"@babel/helper-split-export-declaration@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" + dependencies: + "@babel/types" "7.0.0-beta.44" + +"@babel/highlight@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" dependencies: chalk "^2.0.0" esutils "^2.0.2" @@ -71,13 +77,13 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.40.tgz#034988c6424eb5c3268fe6a608626de1f4410fc8" +"@babel/template@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" dependencies: - "@babel/code-frame" "7.0.0-beta.40" - "@babel/types" "7.0.0-beta.40" - babylon "7.0.0-beta.40" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" lodash "^4.2.0" "@babel/traverse@7.0.0-beta.36": @@ -93,16 +99,17 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@^7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.40.tgz#d140e449b2e093ef9fe1a2eecc28421ffb4e521e" +"@babel/traverse@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" dependencies: - "@babel/code-frame" "7.0.0-beta.40" - "@babel/generator" "7.0.0-beta.40" - "@babel/helper-function-name" "7.0.0-beta.40" - "@babel/types" "7.0.0-beta.40" - babylon "7.0.0-beta.40" - debug "^3.0.1" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/generator" "7.0.0-beta.44" + "@babel/helper-function-name" "7.0.0-beta.44" + "@babel/helper-split-export-declaration" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" lodash "^4.2.0" @@ -115,9 +122,9 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.40", "@babel/types@^7.0.0-beta.40": - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.40.tgz#25c3d7aae14126abe05fcb098c65a66b6d6b8c14" +"@babel/types@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" dependencies: esutils "^2.0.2" lodash "^4.2.0" @@ -227,9 +234,9 @@ babylon@7.0.0-beta.36: version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" -babylon@7.0.0-beta.40, babylon@^7.0.0-beta.40: - version "7.0.0-beta.40" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.40.tgz#91fc8cd56d5eb98b28e6fde41045f2957779940a" +babylon@7.0.0-beta.44: + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" balanced-match@^1.0.0: version "1.0.0" From b2bc4fe4f468a8b2ee6e42fb441978b6a2447eba Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 13 Apr 2018 11:25:03 -0400 Subject: [PATCH 635/965] 8.2.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7f62231b3063..62977e549a23 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.2", + "version": "8.2.3", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From cadb22334e87a182767381151abcff59b1052935 Mon Sep 17 00:00:00 2001 From: Ankur Oberoi Date: Fri, 13 Apr 2018 09:26:41 -0700 Subject: [PATCH 636/965] updates readme for latest eslint & babel-eslint (babel/babel-eslint#607) [skip ci] --- eslint/babel-eslint-parser/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 23f13c3b1080..4dbfc84f072b 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -47,6 +47,7 @@ It just needs to export a `parse` method that takes in a string of code and outp ESLint | babel-eslint ------------ | ------------- +4.x | >= 6.x 3.x | >= 6.x 2.x | >= 6.x 1.x | >= 5.x @@ -56,9 +57,9 @@ ESLint | babel-eslint Ensure that you have substituted the correct version lock for `eslint` and `babel-eslint` into this command: ```sh -$ npm install eslint@3.x babel-eslint@7 --save-dev +$ npm install eslint@4.x babel-eslint@8 --save-dev # or -$ yarn add eslint@3.x babel-eslint@7 -D +$ yarn add eslint@4.x babel-eslint@8 -D ``` ### Setup From 735abb06b4a15998aeb462337ea09f394aa19dd2 Mon Sep 17 00:00:00 2001 From: jmurretxactly <35241735+jmurretxactly@users.noreply.github.com> Date: Tue, 8 May 2018 05:52:59 -0600 Subject: [PATCH 637/965] don't require unpad per test fixture, fixes babel/babel-eslint#572 (babel/babel-eslint#618) --- .../test/non-regression.js | 915 ++++++++---------- 1 file changed, 381 insertions(+), 534 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 9031a410f0eb..2a23ee58d00d 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -51,11 +51,11 @@ function verifyAndAssertMessagesWithSpecificESLint( }${message.ruleId ? ` ${message.ruleId}` : ""}`; if (formatedMessage !== expectedMessages[i]) { throw new Error( - unpad(` + ` Message ${i} does not match: Expected: ${expectedMessages[i]} Actual: ${formatedMessage} - `) + ` ); } }); @@ -69,9 +69,9 @@ function verifyAndAssertMessages( overrideConfig ) { verifyAndAssertMessagesWithSpecificESLint( - code, - rules, - expectedMessages, + unpad(`${code}`), + rules || {}, + expectedMessages || [], sourceType, overrideConfig, new eslint.Linter() @@ -80,7 +80,7 @@ function verifyAndAssertMessages( describe("verify", () => { it("arrow function support (issue #1)", () => { - verifyAndAssertMessages("describe('stuff', () => {});", {}, []); + verifyAndAssertMessages("describe('stuff', () => {});"); }); it("EOL validation (issue #2)", () => { @@ -99,63 +99,50 @@ describe("verify", () => { it("Modules support (issue #5)", () => { verifyAndAssertMessages( - unpad(` + ` import Foo from 'foo'; export default Foo; export const c = 'c'; export class Store {} - `), - {}, - [] + ` ); }); it("Rest parameters (issue #7)", () => { - verifyAndAssertMessages( - "function foo(...args) { return args; }", - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("function foo(...args) { return args; }", { + "no-undef": 1, + }); }); it("Exported classes should be used (issue #8)", () => { - verifyAndAssertMessages( - "class Foo {} module.exports = Foo;", - { "no-unused-vars": 1 }, - [] - ); + verifyAndAssertMessages("class Foo {} module.exports = Foo;", { + "no-unused-vars": 1, + }); }); it("super keyword in class (issue #10)", () => { - verifyAndAssertMessages( - "class Foo { constructor() { super() } }", - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("class Foo { constructor() { super() } }", { + "no-undef": 1, + }); }); it("Rest parameter in destructuring assignment (issue #11)", () => { verifyAndAssertMessages( "const [a, ...rest] = ['1', '2', '3']; module.exports = rest;", - { "no-undef": 1 }, - [] + { "no-undef": 1 } ); }); it("JSX attribute names marked as variables (issue #12)", () => { - verifyAndAssertMessages( - 'module.exports =
', - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages('module.exports =
', { + "no-undef": 1, + }); }); it("Multiple destructured assignment with compound properties (issue #16)", () => { - verifyAndAssertMessages( - "module.exports = { ...a.a, ...a.b };", - { "no-dupe-keys": 1 }, - [] - ); + verifyAndAssertMessages("module.exports = { ...a.a, ...a.b };", { + "no-dupe-keys": 1, + }); }); it("Arrow function with non-block bodies (issue #20)", () => { @@ -168,40 +155,33 @@ describe("verify", () => { }); it("#242", () => { - verifyAndAssertMessages( - '"use strict"; asdf;', - { "no-irregular-whitespace": 1 }, - [], - {} - ); + verifyAndAssertMessages('"use strict"; asdf;', { + "no-irregular-whitespace": 1, + }); }); it("await keyword (issue #22)", () => { - verifyAndAssertMessages( - "async function foo() { await bar(); }", - { "no-unused-expressions": 1 }, - [] - ); + verifyAndAssertMessages("async function foo() { await bar(); }", { + "no-unused-expressions": 1, + }); }); it("arrow functions (issue #27)", () => { - verifyAndAssertMessages( - "[1, 2, 3].map(i => i * 2);", - { "func-names": 1, "space-before-blocks": 1 }, - [] - ); + verifyAndAssertMessages("[1, 2, 3].map(i => i * 2);", { + "func-names": 1, + "space-before-blocks": 1, + }); }); it("comment with padded-blocks (issue #33)", () => { verifyAndAssertMessages( - unpad(` + ` if (a) { // i'm a comment! let b = c } - `), - { "padded-blocks": [1, "never"] }, - [] + `, + { "padded-blocks": [1, "never"] } ); }); @@ -209,22 +189,21 @@ describe("verify", () => { it("check regular function", () => { verifyAndAssertMessages( "function a(b, c) { b += 1; c += 1; return b + c; } a;", - { "no-unused-vars": 1, "no-undef": 1 }, - [] + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("type alias", () => { - verifyAndAssertMessages("type SomeNewType = any;", { "no-undef": 1 }, []); + verifyAndAssertMessages("type SomeNewType = any;", { "no-undef": 1 }); }); it("type cast expression #102", () => { - verifyAndAssertMessages("for (let a of (a: Array)) {}", {}, []); + verifyAndAssertMessages("for (let a of (a: Array)) {}"); }); it("multiple nullable type annotations and return #108", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; @@ -232,20 +211,19 @@ describe("verify", () => { console.log(foo, foo2); } log(1, 2); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("interface declaration", () => { verifyAndAssertMessages( - unpad(` + ` interface Foo {}; interface Bar { foo: Foo, }; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, ["2:11 'Bar' is defined but never used. no-unused-vars"] ); @@ -253,14 +231,14 @@ describe("verify", () => { it("type parameter bounds (classes)", () => { verifyAndAssertMessages( - unpad(` + ` import type {Foo, Foo2} from 'foo'; import Base from 'base'; class Log extends Base { messages: {[T1]: T2}; } new Log(); - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, ["3:34 'T4' is defined but never used. no-unused-vars"] ); @@ -268,12 +246,12 @@ describe("verify", () => { it("type parameter scope (classes)", () => { verifyAndAssertMessages( - unpad(` + ` T; class Foo {} T; new Foo(); - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "1:1 'T' is not defined. no-undef", @@ -285,12 +263,12 @@ describe("verify", () => { it("type parameter bounds (interfaces)", () => { verifyAndAssertMessages( - unpad(` + ` import type {Foo, Foo2, Bar} from ''; interface Log extends Bar { messages: {[T1]: T2}; } - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "2:11 'Log' is defined but never used. no-unused-vars", @@ -301,12 +279,12 @@ describe("verify", () => { it("type parameter scope (interfaces)", () => { verifyAndAssertMessages( - unpad(` + ` T; interface Foo {}; T; Foo; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "1:1 'T' is not defined. no-undef", @@ -318,13 +296,13 @@ describe("verify", () => { it("type parameter bounds (type aliases)", () => { verifyAndAssertMessages( - unpad(` + ` import type {Foo, Foo2, Foo3} from 'foo'; type Log = { messages: {[T1]: T2}; delay: Foo3; }; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "2:6 'Log' is defined but never used. no-unused-vars", @@ -335,12 +313,12 @@ describe("verify", () => { it("type parameter scope (type aliases)", () => { verifyAndAssertMessages( - unpad(` + ` T; type Foo = {}; T; Foo; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "1:1 'T' is not defined. no-undef", @@ -352,12 +330,12 @@ describe("verify", () => { it("type parameter bounds (functions)", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; function log(a: T1, b: T2): T3 { return a + b; } log(1, 2); - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, ["3:37 'T4' is defined but never used. no-unused-vars"] ); @@ -365,12 +343,12 @@ describe("verify", () => { it("type parameter scope (functions)", () => { verifyAndAssertMessages( - unpad(` + ` T; function log() {} T; log; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "1:1 'T' is not defined. no-undef", @@ -382,60 +360,56 @@ describe("verify", () => { it("nested type annotations", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; function foo(callback: () => Foo) { return callback(); } foo(); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("type in var declaration", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var x: Foo = 1; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("object type annotation", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: {numVal: Foo}; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("object property types", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var a = { circle: (null : ?{ setNativeProps(props: Foo): Foo2 }) }; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("namespaced types", () => { verifyAndAssertMessages( - unpad(` + ` var React = require('react-native'); var b = { openExternalExample: (null: ?React.Component) @@ -445,132 +419,121 @@ describe("verify", () => { }; b; c; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("ArrayTypeAnnotation", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var x: Foo[]; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("ClassImplements", () => { verifyAndAssertMessages( - unpad(` + ` import type Bar from 'foo'; export default class Foo implements Bar {} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("type alias creates declaration + usage", () => { verifyAndAssertMessages( - unpad(` + ` type Foo = any; var x : Foo = 1; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("type alias with type parameters", () => { verifyAndAssertMessages( - unpad(` + ` import type Bar from 'foo'; import type Foo3 from 'foo'; type Foo = Bar var x : Foo = 1; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("export type alias", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo2 from 'foo'; export type Foo = Foo2; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("polymorphpic types #109", () => { verifyAndAssertMessages( "export default function groupByEveryN(array: Array, n: number): Array> { n; }", - { "no-unused-vars": 1, "no-undef": 1 }, - [] + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("types definition from import", () => { verifyAndAssertMessages( - unpad(` + ` import type Promise from 'bluebird'; type Operation = () => Promise; x: Operation; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("polymorphpic/generic types for class #123", () => { verifyAndAssertMessages( - unpad(` + ` class Box { value: T; } var box = new Box(); console.log(box.value); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("polymorphpic/generic types for function #123", () => { verifyAndAssertMessages( - unpad(` + ` export function identity(value) { var a: T = value; a; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("polymorphpic/generic types for type alias #123", () => { verifyAndAssertMessages( - unpad(` + ` import Bar from './Bar'; type Foo = Bar; var x: Foo = 1; console.log(x); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("polymorphpic/generic types - outside of fn scope #123", () => { verifyAndAssertMessages( - unpad(` + ` export function foo(value) { value; }; var b: T = 1; b; - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, [ "1:21 'T' is defined but never used. no-unused-vars", @@ -581,10 +544,10 @@ describe("verify", () => { it("polymorphpic/generic types - extending unknown #123", () => { verifyAndAssertMessages( - unpad(` + ` import Bar from 'bar'; export class Foo extends Bar {} - `), + `, { "no-unused-vars": 1, "no-undef": 1 }, ["2:30 'T' is not defined. no-undef"] ); @@ -592,24 +555,23 @@ describe("verify", () => { it("support declarations #132", () => { verifyAndAssertMessages( - unpad(` + ` declare class A { static () : number } declare module B { declare var x: number; } declare function foo(): void; declare var bar A; B; foo(); bar; - `), - { "no-undef": 1, "no-unused-vars": 1 }, - [] + `, + { "no-undef": 1, "no-unused-vars": 1 } ); }); it("supports type spreading", () => { verifyAndAssertMessages( - unpad(` + ` type U = {}; type T = {a: number, ...U, ...V}; - `), + `, { "no-undef": 1, "no-unused-vars": 1 }, [ "2:6 'T' is defined but never used. no-unused-vars", @@ -620,615 +582,554 @@ describe("verify", () => { it("1", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default function(a: Foo, b: ?Foo2, c){ a; b; c; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("2", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; export default function(a: () => Foo){ a; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("3", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default function(a: (_:Foo) => Foo2){ a; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("4", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; export default function(a: (_1:Foo, _2:Foo2) => Foo3){ a; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("5", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default function(a: (_1:Foo, ...foo:Array) => number){ a; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("6", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; export default function(): Foo {} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("7", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; export default function():() => Foo {} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("8", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default function():(_?:Foo) => Foo2{} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("9", () => { verifyAndAssertMessages( "export default function (a: T1, b: T2) { b; }", - { "no-unused-vars": 1, "no-undef": 1 }, - [] + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("10", () => { verifyAndAssertMessages( "var a=function(a: T1, b: T2) {return a + b;}; a;", - { "no-unused-vars": 1, "no-undef": 1 }, - [] + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("11", () => { - verifyAndAssertMessages( - "var a={*id(x: T): T { x; }}; a;", - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("var a={*id(x: T): T { x; }}; a;", { + "no-unused-vars": 1, + "no-undef": 1, + }); }); it("12", () => { - verifyAndAssertMessages( - "var a={async id(x: T): T { x; }}; a;", - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("var a={async id(x: T): T { x; }}; a;", { + "no-unused-vars": 1, + "no-undef": 1, + }); }); it("13", () => { - verifyAndAssertMessages( - "var a={123(x: T): T { x; }}; a;", - { "no-unused-vars": 1, "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("var a={123(x: T): T { x; }}; a;", { + "no-unused-vars": 1, + "no-undef": 1, + }); }); it("14", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default class Bar {set fooProp(value:Foo):Foo2{ value; }} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("15", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo2 from 'foo'; export default class Foo {get fooProp(): Foo2{}} - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("16", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var numVal:Foo; numVal; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("17", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: {numVal: Foo;}; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("18", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; var a: ?{numVal: Foo; [indexer: Foo2]: Foo3}; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("19", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var a: {numVal: Foo; subObj?: ?{strVal: Foo2}}; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("20", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; import type Foo4 from 'foo'; var a: { [a: Foo]: Foo2; [b: Foo3]: Foo4; }; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("21", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; var a: {add(x:Foo, ...y:Array): Foo3}; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("22", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; var a: { id(x: Foo2): Foo3; }; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("23", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a:Array = [1, 2, 3]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("24", () => { verifyAndAssertMessages( - unpad(` + ` import type Baz from 'baz'; export default class Bar extends Baz { }; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("25", () => { verifyAndAssertMessages( "export default class Bar { bar(): T { return 42; }}", - { "no-unused-vars": 1, "no-undef": 1 }, - [] + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("26", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; export default class Bar { static prop1:Foo; prop2:Foo2; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("27", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var x : Foo | Foo2 = 4; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("28", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var x : () => Foo | () => Foo2; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("29", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var x: typeof Foo | number = Foo2; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("30", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var {x}: {x: Foo; } = { x: 'hello' }; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("31", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var [x]: Array = [ 'hello' ]; x; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("32", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; export default function({x}: { x: Foo; }) { x; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("33", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; function foo([x]: Array) { x; } foo(); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("34", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var a: Map >; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("35", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: ?Promise[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("36", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; var a:(...rest:Array) => Foo2; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("37", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; import type Foo4 from 'foo'; var a: (x: Foo2, ...y:Foo3[]) => Foo4; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("38", () => { verifyAndAssertMessages( - unpad(` + ` import type {foo, bar} from 'baz'; foo; bar; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("39", () => { verifyAndAssertMessages( - unpad(` + ` import type {foo as bar} from 'baz'; bar; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("40", () => { verifyAndAssertMessages( - unpad(` + ` import type from 'foo'; type; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("41", () => { verifyAndAssertMessages( - unpad(` + ` import type, {foo} from 'bar'; type; foo; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("43", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: Foo[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("44", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: ?Foo[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("45", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: (?Foo)[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("46", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: () => Foo[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("47", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: (() => Foo)[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("48", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; var a: typeof Foo[]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("49", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'foo'; import type Foo2 from 'foo'; import type Foo3 from 'foo'; var a : [Foo, Foo2,] = [123, 'duck',]; a; - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); }); it("class usage", () => { - verifyAndAssertMessages( - "class Lol {} module.exports = Lol;", - { "no-unused-vars": 1 }, - [] - ); + verifyAndAssertMessages("class Lol {} module.exports = Lol;", { + "no-unused-vars": 1, + }); }); it("class definition: gaearon/redux#24", () => { verifyAndAssertMessages( - unpad(` + ` export default function root(stores) { return DecoratedComponent => class ReduxRootDecorator { a() { DecoratedComponent; stores; } }; } - `), - { "no-undef": 1, "no-unused-vars": 1 }, - [] + `, + { "no-undef": 1, "no-unused-vars": 1 } ); }); it("class properties #71", () => { - verifyAndAssertMessages( - "class Lol { foo = 'bar'; }", - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("class Lol { foo = 'bar'; }", { "no-undef": 1 }); }); it("template strings #31", () => { - verifyAndAssertMessages( - "console.log(`${a}, b`);", - { "comma-spacing": 1 }, - [] - ); + verifyAndAssertMessages("console.log(`${a}, b`);", { "comma-spacing": 1 }); }); it("template with destructuring #31", () => { verifyAndAssertMessages( - unpad(` + ` module.exports = { render() { var {name} = this.props; return Math.max(null, \`Name: \${name}, Name: \${name}\`); } }; - `), - { "comma-spacing": 1 }, - [] + `, + { "comma-spacing": 1 } ); }); describe("decorators #72", () => { it("class declaration", () => { verifyAndAssertMessages( - unpad(` + ` import classDeclaration from 'decorator'; import decoratorParameter from 'decorator'; @classDeclaration((parameter) => parameter) @classDeclaration(decoratorParameter) @classDeclaration export class TextareaAutosize {} - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); it("method definition", () => { verifyAndAssertMessages( - unpad(` + ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; export class TextareaAutosize { @@ -1239,15 +1140,14 @@ describe("verify", () => { e(); } } - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); it("method definition get/set", () => { verifyAndAssertMessages( - unpad(` + ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; export class TextareaAutosize { @@ -1260,15 +1160,14 @@ describe("verify", () => { @classMethodDeclarationA set bar(val) { val; } } - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); it("object property", () => { verifyAndAssertMessages( - unpad(` + ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; var obj = { @@ -1280,15 +1179,14 @@ describe("verify", () => { } }; obj; - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); it("object property get/set", () => { verifyAndAssertMessages( - unpad(` + ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; var obj = { @@ -1302,9 +1200,8 @@ describe("verify", () => { set bar(val) { val; } }; obj; - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); }); @@ -1321,40 +1218,35 @@ describe("verify", () => { it.skip("visits excluded properties left of spread #95", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-unused-vars": 1 }, - [] + { "no-unused-vars": 1 } ); }); it.skip("visits excluded properties left of spread #210", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", - { "no-unused-vars": 1 }, - [] + { "no-unused-vars": 1 } ); }); it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-undef": 1, "no-redeclare": 1 }, - [] + { "no-undef": 1, "no-redeclare": 1 } ); }); it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", - { "no-undef": 1, "no-redeclare": 1 }, - [] + { "no-undef": 1, "no-redeclare": 1 } ); }); it("does not mark spread variables as use-before-define #249", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-use-before-define": 1 }, - [] + { "no-use-before-define": 1 } ); }); @@ -1368,55 +1260,48 @@ describe("verify", () => { it("don't warn no-unused-vars with spread #142", () => { verifyAndAssertMessages( - unpad(` + ` export default function test(data) { return { foo: 'bar', ...data }; } - `), - { "no-undef": 1, "no-unused-vars": 1 }, - [] + `, + { "no-undef": 1, "no-unused-vars": 1 } ); }); it("excludes comment tokens #153", () => { verifyAndAssertMessages( - unpad(` + ` var a = [ 1, 2, // a trailing comment makes this line fail comma-dangle (always-multiline) ]; - `), - { "comma-dangle": [2, "always-multiline"] }, - [] + `, + { "comma-dangle": [2, "always-multiline"] } ); verifyAndAssertMessages( - unpad(` + ` switch (a) { // A comment here makes the above line fail brace-style case 1: console.log(a); } - `), - { "brace-style": 2 }, - [] + `, + { "brace-style": 2 } ); }); it("ternary and parens #149", () => { - verifyAndAssertMessages( - "true ? (true) : false;", - { "space-infix-ops": 1 }, - [] - ); + verifyAndAssertMessages("true ? (true) : false;", { "space-infix-ops": 1 }); }); it("line comment space-in-parens #124", () => { verifyAndAssertMessages( - unpad(` + ` React.createClass({ render() { // return ( @@ -1424,15 +1309,14 @@ describe("verify", () => { // ); // <-- this is the line that is reported } }); - `), - { "space-in-parens": 1 }, - [] + `, + { "space-in-parens": 1 } ); }); it("block comment space-in-parens #124", () => { verifyAndAssertMessages( - unpad(` + ` React.createClass({ render() { /* @@ -1442,31 +1326,27 @@ describe("verify", () => { */ } }); - `), - { "space-in-parens": 1 }, - [] + `, + { "space-in-parens": 1 } ); }); it("no no-undef error with rest #11", () => { - verifyAndAssertMessages( - "const [a, ...rest] = ['1', '2', '3']; a; rest;", - { "no-undef": 1, "no-unused-vars": 1 }, - [] - ); + verifyAndAssertMessages("const [a, ...rest] = ['1', '2', '3']; a; rest;", { + "no-undef": 1, + "no-unused-vars": 1, + }); }); it("async function with space-before-function-paren #168", () => { - verifyAndAssertMessages( - "it('handles updates', async function() {});", - { "space-before-function-paren": [1, "never"] }, - [] - ); + verifyAndAssertMessages("it('handles updates', async function() {});", { + "space-before-function-paren": [1, "never"], + }); }); it("default param flow type no-unused-vars #184", () => { verifyAndAssertMessages( - unpad(` + ` type ResolveOptionType = { depth?: number, identifier?: string @@ -1477,46 +1357,44 @@ describe("verify", () => { ): Object { options; } - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); it("no-use-before-define #192", () => { verifyAndAssertMessages( - unpad(` + ` console.log(x); var x = 1; - `), + `, { "no-use-before-define": 1 }, ["1:13 'x' was used before it was defined. no-use-before-define"] ); }); it("jsx and stringliteral #216", () => { - verifyAndAssertMessages("
", {}, []); + verifyAndAssertMessages("
"); }); it("getter/setter #218", () => { verifyAndAssertMessages( - unpad(` + ` class Person { set a (v) { } } - `), + `, { "space-before-function-paren": 1, "keyword-spacing": [1, { before: true }], indent: 1, - }, - [] + } ); }); it("getter/setter #220", () => { verifyAndAssertMessages( - unpad(` + ` var B = { get x () { return this.ecks; @@ -1525,32 +1403,30 @@ describe("verify", () => { this.ecks = ecks; } }; - `), - { "no-dupe-keys": 1 }, - [] + `, + { "no-dupe-keys": 1 } ); }); it("fixes issues with flow types and ObjectPattern", () => { verifyAndAssertMessages( - unpad(` + ` import type Foo from 'bar'; export default class Foobar { foo({ bar }: Foo) { bar; } bar({ foo }: Foo) { foo; } } - `), - { "no-unused-vars": 1, "no-shadow": 1 }, - [] + `, + { "no-unused-vars": 1, "no-shadow": 1 } ); }); it("correctly detects redeclares if in script mode #217", () => { verifyAndAssertMessages( - unpad(` + ` var a = 321; var a = 123; - `), + `, { "no-redeclare": 1 }, ["2:5 'a' is already defined. no-redeclare"], "script" @@ -1559,10 +1435,10 @@ describe("verify", () => { it("correctly detects redeclares if in module mode #217", () => { verifyAndAssertMessages( - unpad(` + ` var a = 321; var a = 123; - `), + `, { "no-redeclare": 1 }, ["2:5 'a' is already defined. no-redeclare"], "module" @@ -1612,11 +1488,11 @@ describe("verify", () => { it("allowImportExportEverywhere option (#327)", () => { verifyAndAssertMessages( - unpad(` + ` if (true) { import Foo from 'foo'; } function foo() { import Bar from 'bar'; } switch (a) { case 1: import FooBar from 'foobar'; } - `), + `, {}, [], "module", @@ -1642,21 +1518,19 @@ describe("verify", () => { }); it("new.target is not reported as undef #235", () => { - verifyAndAssertMessages( - "function foo () { return new.target }", - { "no-undef": 1 }, - [] - ); + verifyAndAssertMessages("function foo () { return new.target }", { + "no-undef": 1, + }); }); it("decorator does not create TypeError #229", () => { verifyAndAssertMessages( - unpad(` + ` class A { @test f() {} } - `), + `, { "no-undef": 1 }, ["2:4 'test' is not defined. no-undef"] ); @@ -1664,18 +1538,17 @@ describe("verify", () => { it("Flow definition does not trigger warnings #223", () => { verifyAndAssertMessages( - unpad(` + ` import { Map as $Map } from 'immutable'; function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {} - `), - { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 }, - [] + `, + { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 } ); }); it("newline-before-return with comments #289", () => { verifyAndAssertMessages( - unpad(` + ` function a() { if (b) { /* eslint-disable no-console */ @@ -1685,55 +1558,51 @@ describe("verify", () => { return hasGlobal; } - `), - { "newline-before-return": 1 }, - [] + `, + { "newline-before-return": 1 } ); }); it("spaced-comment with shebang #163", () => { verifyAndAssertMessages( - unpad(` + ` #!/usr/bin/env babel-node import {spawn} from 'foobar'; - `), - { "spaced-comment": 1 }, - [] + `, + { "spaced-comment": 1 } ); }); describe("Class Property Declarations", () => { it("no-redeclare false positive 1", () => { verifyAndAssertMessages( - unpad(` + ` class Group { static propTypes = {}; } class TypicalForm { static propTypes = {}; } - `), - { "no-redeclare": 1 }, - [] + `, + { "no-redeclare": 1 } ); }); it("no-redeclare false positive 2", () => { verifyAndAssertMessages( - unpad(` + ` function validate() {} class MyComponent { static validate = validate; } - `), - { "no-redeclare": 1 }, - [] + `, + { "no-redeclare": 1 } ); }); it("check references", () => { verifyAndAssertMessages( - unpad(` + ` var a; class A { prop1; @@ -1741,7 +1610,7 @@ describe("verify", () => { prop3 = b; } new A - `), + `, { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, ["5:11 'b' is not defined. no-undef"] ); @@ -1749,148 +1618,126 @@ describe("verify", () => { }); it("dynamic import support", () => { - verifyAndAssertMessages("import('test-module').then(() => {})", {}, []); + verifyAndAssertMessages("import('test-module').then(() => {})"); }); it("regex with es6 unicodeCodePointEscapes", () => { verifyAndAssertMessages( - "string.replace(/[\u{0000A0}-\u{10FFFF}<>&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", - {}, - [] + "string.replace(/[\u{0000A0}-\u{10FFFF}<>&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);" ); }); describe("private class properties", () => { it("should not be undefined", () => { verifyAndAssertMessages( - unpad(` + ` class C { #d = 1; } - `), - { "no-undef": 1 }, - [] + `, + { "no-undef": 1 } ); }); it("should not be unused", () => { verifyAndAssertMessages( - unpad(` + ` export class C { #d = 1; } - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); }); it("flow types on class method should be visited correctly", () => { verifyAndAssertMessages( - unpad(` + ` import type NodeType from 'foo'; class NodeUtils { finishNodeAt(node: T): T { return node; } } new NodeUtils(); - `), - { "no-unused-vars": 1 }, - [] + `, + { "no-unused-vars": 1 } ); }); it("works with dynamicImport", () => { verifyAndAssertMessages( - unpad(` + ` import('a'); - `), - {}, - [] + ` ); }); it("works with numericSeparator", () => { verifyAndAssertMessages( - unpad(` + ` 1_000 - `), - {}, - [] + ` ); }); it("works with optionalChaining", () => { verifyAndAssertMessages( - unpad(` + ` a?.b - `), - {}, - [] + ` ); }); it("works with import.meta", () => { verifyAndAssertMessages( - unpad(` + ` import.meta - `), - {}, - [] + ` ); }); it("works with classPrivateProperties", () => { verifyAndAssertMessages( - unpad(` + ` class A { #a = 1; } - `), - {}, - [] + ` ); }); it("works with optionalCatchBinding", () => { verifyAndAssertMessages( - unpad(` + ` try {} catch {} try {} catch {} finally {} - `), - {}, - [] + ` ); }); it("exportDefaultFrom", () => { verifyAndAssertMessages( - unpad(` + ` export v from "mod" - `), - {}, - [] + ` ); }); it("exportNamespaceFrom", () => { verifyAndAssertMessages( - unpad(` + ` export * as ns from "mod" - `), - {}, - [] + ` ); }); it("ignore eval in scope analysis", () => { verifyAndAssertMessages( - unpad(` + ` const a = 1; console.log(a); eval(''); - `), - { "no-unused-vars": 1, "no-undef": 1 }, - [] + `, + { "no-unused-vars": 1, "no-undef": 1 } ); }); }); From 3477626973a24e18c6fc40b97c7855078ab4e3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 15 Jun 2018 15:31:43 +0100 Subject: [PATCH 638/965] Add support for the optional chaining operator (babel/babel-eslint#630) --- eslint/babel-eslint-parser/lib/patch-eslint-scope.js | 4 ++++ eslint/babel-eslint-parser/test/non-regression.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/patch-eslint-scope.js b/eslint/babel-eslint-parser/lib/patch-eslint-scope.js index aec71fc6ca70..2bf2b350ff03 100644 --- a/eslint/babel-eslint-parser/lib/patch-eslint-scope.js +++ b/eslint/babel-eslint-parser/lib/patch-eslint-scope.js @@ -233,6 +233,10 @@ function monkeypatch(modules) { // visit ClassPrivateProperty as a Property. referencer.prototype.ClassPrivateProperty = visitClassProperty; + // visit OptionalMemberExpression as a MemberExpression. + referencer.prototype.OptionalMemberExpression = + referencer.prototype.MemberExpression; + // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression var visitFunction = referencer.prototype.visitFunction; referencer.prototype.visitFunction = function(node) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 2a23ee58d00d..687af37cc4c9 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1651,6 +1651,18 @@ describe("verify", () => { }); }); + describe("optional chaining operator", () => { + it("should not be undefined #595", () => { + verifyAndAssertMessages( + ` + const foo = {}; + foo?.bar; + `, + { "no-undef": 1 } + ); + }); + }); + it("flow types on class method should be visited correctly", () => { verifyAndAssertMessages( ` From 99968db2b1485e8ab580523b6d228eccee048cb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 15 Jun 2018 15:42:05 +0100 Subject: [PATCH 639/965] Fix token types for experimental operators (babel/babel-eslint#632) * Added failing tests * Recognized nullish coalescing, optional chaining and pipeline operators as Punctuator tokens --- .../lib/babylon-to-espree/toToken.js | 3 ++ .../babel-eslint-parser/test/babel-eslint.js | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js index 082aef3e3267..44c73529a111 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js @@ -19,16 +19,19 @@ module.exports = function(token, tt, source) { type === tt.bracketR || type === tt.ellipsis || type === tt.arrow || + type === tt.pipeline || type === tt.star || type === tt.incDec || type === tt.colon || type === tt.question || + type === tt.questionDot || type === tt.template || type === tt.backQuote || type === tt.dollarBraceL || type === tt.at || type === tt.logicalOR || type === tt.logicalAND || + type === tt.nullishCoalescing || type === tt.bitwiseOR || type === tt.bitwiseXOR || type === tt.bitwiseAND || diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index c066ed280997..b0a2cd10f2ad 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -256,6 +256,36 @@ describe("babylon-to-espree", () => { parseAndAssertSame("export { foo as bar };"); }); + // Espree doesn't support the optional chaining operator yet + it("optional chaining operator (token)", () => { + const code = "foo?.bar"; + var babylonAST = babelEslint.parseForESLint(code, { + eslintVisitorKeys: true, + eslintScopeManager: true, + }).ast; + assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); + }); + + // Espree doesn't support the nullish coalescing operator yet + it("nullish coalescing operator (token)", () => { + const code = "foo ?? bar"; + var babylonAST = babelEslint.parseForESLint(code, { + eslintVisitorKeys: true, + eslintScopeManager: true, + }).ast; + assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); + }); + + // Espree doesn't support the pipeline operator yet + it("pipeline operator (token)", () => { + const code = "foo |> bar"; + var babylonAST = babelEslint.parseForESLint(code, { + eslintVisitorKeys: true, + eslintScopeManager: true, + }).ast; + assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); + }); + it.skip("empty program with line comment", () => { parseAndAssertSame("// single comment"); }); From 077bea0a45f97d451129d0e3e8c46fbdb2a72123 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 18 Jun 2018 16:46:31 -0500 Subject: [PATCH 640/965] Fix converting template types to handle nested templates (babel/babel-eslint#610) Fixes https://github.com/babel/babel-eslint/issues/603 (and the fixture from https://github.com/babel/babel-eslint/issues/609 works). Reworks our code that converts the format of Babylon template tokens to be a bit more robust, especially with things like nested templates with arrows. (Adapted the logic from https://github.com/eslint/espree/blob/master/lib/token-translator.js) --- eslint/babel-eslint-parser/.prettierignore | 1 + .../babylon-to-espree/convertTemplateType.js | 147 +++++++++--------- .../lib/babylon-to-espree/index.js | 5 - .../lib/babylon-to-espree/toTokens.js | 15 +- .../babel-eslint-parser/test/babel-eslint.js | 10 +- .../test/non-regression.js | 12 ++ 6 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 eslint/babel-eslint-parser/.prettierignore diff --git a/eslint/babel-eslint-parser/.prettierignore b/eslint/babel-eslint-parser/.prettierignore new file mode 100644 index 000000000000..a6c57f5fb2ff --- /dev/null +++ b/eslint/babel-eslint-parser/.prettierignore @@ -0,0 +1 @@ +*.json diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js index d8892f997260..accde61e56d6 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js @@ -1,99 +1,92 @@ "use strict"; module.exports = function(tokens, tt) { - var startingToken = 0; - var currentToken = 0; - var numBraces = 0; // track use of {} - var numBackQuotes = 0; // track number of nested templates + let curlyBrace = null; + let templateTokens = []; + const result = []; - function isBackQuote(token) { - return tokens[token].type === tt.backQuote; - } - - function isTemplateStarter(token) { - return ( - isBackQuote(token) || - // only can be a template starter when in a template already - (tokens[token].type === tt.braceR && numBackQuotes > 0) - ); - } - - function isTemplateEnder(token) { - return isBackQuote(token) || tokens[token].type === tt.dollarBraceL; - } + function addTemplateType() { + const start = templateTokens[0]; + const end = templateTokens[templateTokens.length - 1]; - // append the values between start and end - function createTemplateValue(start, end) { - var value = ""; - while (start <= end) { - if (tokens[start].value) { - value += tokens[start].value; - } else if (tokens[start].type !== tt.template) { - value += tokens[start].type.label; + const value = templateTokens.reduce((result, token) => { + if (token.value) { + result += token.value; + } else if (token.type !== tt.template) { + result += token.type.label; } - start++; - } - return value; - } - // create Template token - function replaceWithTemplateType(start, end) { - var templateToken = { + return result; + }, ""); + + result.push({ type: "Template", - value: createTemplateValue(start, end), - start: tokens[start].start, - end: tokens[end].end, + value: value, + start: start.start, + end: end.end, loc: { - start: tokens[start].loc.start, - end: tokens[end].loc.end, + start: start.loc.start, + end: end.loc.end, }, - }; + }); - // put new token in place of old tokens - tokens.splice(start, end - start + 1, templateToken); + templateTokens = []; } - function trackNumBraces(token) { - if (tokens[token].type === tt.braceL) { - numBraces++; - } else if (tokens[token].type === tt.braceR) { - numBraces--; - } - } + tokens.forEach(token => { + switch (token.type) { + case tt.backQuote: + if (curlyBrace) { + result.push(curlyBrace); + curlyBrace = null; + } - while (startingToken < tokens.length) { - // template start: check if ` or } - if (isTemplateStarter(startingToken) && numBraces === 0) { - if (isBackQuote(startingToken)) { - numBackQuotes++; - } + templateTokens.push(token); - currentToken = startingToken + 1; + if (templateTokens.length > 1) { + addTemplateType(); + } - // check if token after template start is "template" - if ( - currentToken >= tokens.length - 1 || - tokens[currentToken].type !== tt.template - ) { break; - } - // template end: find ` or ${ - while (!isTemplateEnder(currentToken)) { - if (currentToken >= tokens.length - 1) { - break; + case tt.dollarBraceL: + templateTokens.push(token); + addTemplateType(); + break; + + case tt.braceR: + if (curlyBrace) { + result.push(curlyBrace); } - currentToken++; - } - if (isBackQuote(currentToken)) { - numBackQuotes--; - } - // template start and end found: create new token - replaceWithTemplateType(startingToken, currentToken); - } else if (numBackQuotes > 0) { - trackNumBraces(startingToken); + curlyBrace = token; + break; + + case tt.template: + if (curlyBrace) { + templateTokens.push(curlyBrace); + curlyBrace = null; + } + + templateTokens.push(token); + break; + + case tt.eof: + if (curlyBrace) { + result.push(curlyBrace); + } + + break; + + default: + if (curlyBrace) { + result.push(curlyBrace); + curlyBrace = null; + } + + result.push(token); } - startingToken++; - } + }); + + return result; }; diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js index ecd8eee6f1d8..6d6e12bfc086 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js @@ -6,11 +6,6 @@ var toTokens = require("./toTokens"); var toAST = require("./toAST"); module.exports = function(ast, traverse, tt, code) { - // remove EOF token, eslint doesn't use this for anything and it interferes - // with some rules see https://github.com/babel/babel-eslint/issues/2 - // todo: find a more elegant way to do this - ast.tokens.pop(); - // convert tokens ast.tokens = toTokens(ast.tokens, tt, code); diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js index a863b871b0a8..bb30819bacf7 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js @@ -4,16 +4,7 @@ var convertTemplateType = require("./convertTemplateType"); var toToken = require("./toToken"); module.exports = function(tokens, tt, code) { - // transform tokens to type "Template" - convertTemplateType(tokens, tt); - - var transformedTokens = []; - for (var i = 0; i < tokens.length; i++) { - var token = tokens[i]; - if (token.type !== "CommentLine" && token.type !== "CommentBlock") { - transformedTokens.push(toToken(token, tt, code)); - } - } - - return transformedTokens; + return convertTemplateType(tokens, tt) + .filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock") + .map(t => toToken(t, tt, code)); }; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index b0a2cd10f2ad..98b7e939288b 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -62,7 +62,7 @@ function parseAndAssertSame(code) { `); throw err; } - // assert.equal(esAST, babylonAST); + //assert.equal(esAST, babylonAST); } describe("babylon-to-espree", () => { @@ -158,6 +158,14 @@ describe("babylon-to-espree", () => { }; `); }); + + it("template with arrow returning template #603", () => { + parseAndAssertSame(` + var a = \`\${() => { + \`\${''}\` + }}\`; + `); + }); }); it("simple expression", () => { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 687af37cc4c9..af36963e5cf2 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1112,6 +1112,18 @@ describe("verify", () => { ); }); + it("template with arrow returning template #603", () => { + verifyAndAssertMessages( + ` + var a = \`\${() => { + \`\${''}\` + }}\`; + `, + { indent: 1 }, + [] + ); + }); + describe("decorators #72", () => { it("class declaration", () => { verifyAndAssertMessages( From da43afb5deb8453c4e4ce2ee670e81ff2fb3f50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Pallar=C3=A9s?= Date: Wed, 6 Jun 2018 00:18:13 +0200 Subject: [PATCH 641/965] refactor: rename babylon to @babel/parser --- eslint/babel-eslint-parser/lib/parse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index f29e6af155b5..013de92dce06 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,8 +1,8 @@ "use strict"; var babylonToEspree = require("./babylon-to-espree"); -var parse = require("babylon").parse; -var tt = require("babylon").tokTypes; +var parse = require("@babel/parser").parse; +var tt = require("@babel/parser").tokTypes; var traverse = require("@babel/traverse").default; var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; From 85d8f7047851a7a9063294578712d5dbe40c3c15 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 11 Jun 2018 08:47:15 -0500 Subject: [PATCH 642/965] Bump Babel deps --- eslint/babel-eslint-parser/lib/parse.js | 2 +- eslint/babel-eslint-parser/package.json | 8 +- eslint/babel-eslint-parser/yarn.lock | 106 ++++++++++++------------ 3 files changed, 60 insertions(+), 56 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 013de92dce06..25105ca254bd 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -23,7 +23,7 @@ module.exports = function(code, options) { "asyncGenerators", "classConstructorCall", "classProperties", - "decorators", + "decorators-legacy", "doExpressions", "exponentiationOperator", "exportDefaultFrom", diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 62977e549a23..d22222b1ded8 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.44", - "@babel/traverse": "7.0.0-beta.44", - "@babel/types": "7.0.0-beta.44", - "babylon": "7.0.0-beta.44", + "@babel/code-frame": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 53c3bceda635..0b1731fbaaaa 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,19 +10,19 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" +"@babel/code-frame@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz#bd71d9b192af978df915829d39d4094456439a0c" dependencies: - "@babel/highlight" "7.0.0-beta.44" + "@babel/highlight" "7.0.0-beta.51" -"@babel/generator@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" +"@babel/generator@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.51.tgz#6c7575ffde761d07485e04baedc0392c6d9e30f6" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" jsesc "^2.5.1" - lodash "^4.2.0" + lodash "^4.17.5" source-map "^0.5.0" trim-right "^1.0.1" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" +"@babel/helper-function-name@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz#21b4874a227cf99ecafcc30a90302da5a2640561" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.44" - "@babel/template" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" + "@babel/helper-get-function-arity" "7.0.0-beta.51" + "@babel/template" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,26 +48,30 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" +"@babel/helper-get-function-arity@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz#3281b2d045af95c172ce91b20825d85ea4676411" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" -"@babel/helper-split-export-declaration@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" +"@babel/helper-split-export-declaration@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz#8a6c3f66c4d265352fc077484f9f6e80a51ab978" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" -"@babel/highlight@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" +"@babel/highlight@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.51.tgz#e8844ae25a1595ccfd42b89623b4376ca06d225d" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/parser@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51.tgz#27cec2df409df60af58270ed8f6aa55409ea86f6" + "@babel/template@7.0.0-beta.36": version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" @@ -77,14 +81,14 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" +"@babel/template@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.51.tgz#9602a40aebcf357ae9677e2532ef5fc810f5fbff" dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - lodash "^4.2.0" + "@babel/code-frame" "7.0.0-beta.51" + "@babel/parser" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" + lodash "^4.17.5" "@babel/traverse@7.0.0-beta.36": version "7.0.0-beta.36" @@ -99,20 +103,20 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" +"@babel/traverse@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.51.tgz#981daf2cec347a6231d3aa1d9e1803b03aaaa4a8" dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/generator" "7.0.0-beta.44" - "@babel/helper-function-name" "7.0.0-beta.44" - "@babel/helper-split-export-declaration" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" + "@babel/code-frame" "7.0.0-beta.51" + "@babel/generator" "7.0.0-beta.51" + "@babel/helper-function-name" "7.0.0-beta.51" + "@babel/helper-split-export-declaration" "7.0.0-beta.51" + "@babel/parser" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" - lodash "^4.2.0" + lodash "^4.17.5" "@babel/types@7.0.0-beta.36": version "7.0.0-beta.36" @@ -122,12 +126,12 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" +"@babel/types@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.51.tgz#d802b7b543b5836c778aa691797abf00f3d97ea9" dependencies: esutils "^2.0.2" - lodash "^4.2.0" + lodash "^4.17.5" to-fast-properties "^2.0.0" acorn-jsx@^3.0.0: @@ -234,10 +238,6 @@ babylon@7.0.0-beta.36: version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" -babylon@7.0.0-beta.44: - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1067,6 +1067,10 @@ lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" +lodash@^4.17.5: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" From b537da9b53524169dc994e45d533a3e9b90f08a6 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 15 Jun 2018 16:39:58 -0500 Subject: [PATCH 643/965] Drop node4 in travis --- eslint/babel-eslint-parser/.travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index ad63884c93b7..d973f98e1b60 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -3,7 +3,6 @@ language: node_js node_js: - "8" - "6" - - "4" matrix: fast_finish: true From 6a6c2bad5071662c7fd4d98521bb0e6309e739f5 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 22 Jun 2018 11:03:15 -0500 Subject: [PATCH 644/965] Support OptionalMemberExpression with scope too (babel/babel-eslint#634) --- .../babel-eslint-parser/lib/analyze-scope.js | 5 ++ eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/yarn.lock | 64 ++++++++++++++++++- 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index fb9f4d4e8c09..9b2a40d6dbf4 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -181,6 +181,11 @@ class Referencer extends OriginalReferencer { this._visitDeclareX(node); } + // visit OptionalMemberExpression as a MemberExpression. + OptionalMemberExpression(node) { + super.MemberExpression(node); + } + _visitClassProperty(node) { this._visitTypeAnnotation(node.typeAnnotation); this.visitProperty(node); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d22222b1ded8..cd21bd483288 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -39,7 +39,7 @@ "devDependencies": { "babel-eslint": "^8.0.0", "dedent": "^0.7.0", - "eslint": "npm:eslint@4.13.1", + "eslint": "npm:eslint@4.19.1", "eslint-config-babel": "^7.0.1", "eslint-old": "npm:eslint@4.13.1", "eslint-plugin-flowtype": "^2.30.3", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 0b1731fbaaaa..bdad6e39ad94 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -148,6 +148,10 @@ acorn@^5.4.0: version "5.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" +acorn@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" + ajv-keywords@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" @@ -434,7 +438,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2: +doctrine@^2.0.2, doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -472,7 +476,7 @@ eslint-module-utils@^2.1.1: debug "^2.6.8" pkg-dir "^1.0.0" -"eslint-old@npm:eslint@4.13.1", "eslint@npm:eslint@4.13.1": +"eslint-old@npm:eslint@4.13.1": version "4.13.1" resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" dependencies: @@ -553,6 +557,49 @@ eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" +"eslint@npm:eslint@4.19.1": + version "4.19.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.4" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^1.0.1" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "4.0.2" + text-table "~0.2.0" + espree@^3.5.2: version "3.5.3" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" @@ -560,6 +607,13 @@ espree@^3.5.2: acorn "^5.4.0" acorn-jsx "^3.0.0" +espree@^3.5.4: + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + esprima@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" @@ -1382,6 +1436,10 @@ readable-stream@^2.2.2: string_decoder "~1.0.3" util-deprecate "~1.0.1" +regexpp@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" + repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -1596,7 +1654,7 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" -table@^4.0.1: +table@4.0.2, table@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" dependencies: From 42d07696831c09e3a2fc5fb8266919e167ce827e Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 22 Jun 2018 11:12:54 -0500 Subject: [PATCH 645/965] Add test for template string with object with template string inside (babel/babel-eslint#639) Closes https://github.com/babel/babel-eslint/pull/538. Fixes https://github.com/babel/babel-eslint/issues/537. Now that https://github.com/babel/babel-eslint/pull/610 has landed, I wanted to make sure this case was covered. --- eslint/babel-eslint-parser/test/babel-eslint.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 98b7e939288b..99b03f25c7ea 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -166,6 +166,10 @@ describe("babylon-to-espree", () => { }}\`; `); }); + + it("template string with object with template string inside", () => { + parseAndAssertSame("`${ { a:`${2}` } }`"); + }); }); it("simple expression", () => { From 92507e598fa62b5da1681d201eb2793252b1f420 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 22 Jun 2018 13:39:23 -0500 Subject: [PATCH 646/965] 8.2.4 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index cd21bd483288..d0a790bc162d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.3", + "version": "8.2.4", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 9342a5b74c91119e1b20a0ae96b3d1f87272edcd Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 23 Jun 2018 08:20:08 -0500 Subject: [PATCH 647/965] Revert bump to babel 51 (babel/babel-eslint#640) --- eslint/babel-eslint-parser/.travis.yml | 1 + eslint/babel-eslint-parser/lib/parse.js | 6 +- eslint/babel-eslint-parser/package.json | 8 +- eslint/babel-eslint-parser/yarn.lock | 106 ++++++++++++------------ 4 files changed, 59 insertions(+), 62 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index d973f98e1b60..ad63884c93b7 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -3,6 +3,7 @@ language: node_js node_js: - "8" - "6" + - "4" matrix: fast_finish: true diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 25105ca254bd..f29e6af155b5 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,8 +1,8 @@ "use strict"; var babylonToEspree = require("./babylon-to-espree"); -var parse = require("@babel/parser").parse; -var tt = require("@babel/parser").tokTypes; +var parse = require("babylon").parse; +var tt = require("babylon").tokTypes; var traverse = require("@babel/traverse").default; var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; @@ -23,7 +23,7 @@ module.exports = function(code, options) { "asyncGenerators", "classConstructorCall", "classProperties", - "decorators-legacy", + "decorators", "doExpressions", "exponentiationOperator", "exportDefaultFrom", diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index d0a790bc162d..1ff8dda5d6bf 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.51", - "@babel/parser": "7.0.0-beta.51", - "@babel/traverse": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51", + "@babel/code-frame": "7.0.0-beta.44", + "@babel/traverse": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index bdad6e39ad94..35d317871554 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,19 +10,19 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz#bd71d9b192af978df915829d39d4094456439a0c" +"@babel/code-frame@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" dependencies: - "@babel/highlight" "7.0.0-beta.51" + "@babel/highlight" "7.0.0-beta.44" -"@babel/generator@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.51.tgz#6c7575ffde761d07485e04baedc0392c6d9e30f6" +"@babel/generator@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.44" jsesc "^2.5.1" - lodash "^4.17.5" + lodash "^4.2.0" source-map "^0.5.0" trim-right "^1.0.1" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz#21b4874a227cf99ecafcc30a90302da5a2640561" +"@babel/helper-function-name@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.51" - "@babel/template" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" + "@babel/helper-get-function-arity" "7.0.0-beta.44" + "@babel/template" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,30 +48,26 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz#3281b2d045af95c172ce91b20825d85ea4676411" +"@babel/helper-get-function-arity@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.44" -"@babel/helper-split-export-declaration@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz#8a6c3f66c4d265352fc077484f9f6e80a51ab978" +"@babel/helper-split-export-declaration@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.44" -"@babel/highlight@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.51.tgz#e8844ae25a1595ccfd42b89623b4376ca06d225d" +"@babel/highlight@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/parser@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51.tgz#27cec2df409df60af58270ed8f6aa55409ea86f6" - "@babel/template@7.0.0-beta.36": version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" @@ -81,14 +77,14 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.51.tgz#9602a40aebcf357ae9677e2532ef5fc810f5fbff" +"@babel/template@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" dependencies: - "@babel/code-frame" "7.0.0-beta.51" - "@babel/parser" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" - lodash "^4.17.5" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + lodash "^4.2.0" "@babel/traverse@7.0.0-beta.36": version "7.0.0-beta.36" @@ -103,20 +99,20 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.51.tgz#981daf2cec347a6231d3aa1d9e1803b03aaaa4a8" +"@babel/traverse@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" dependencies: - "@babel/code-frame" "7.0.0-beta.51" - "@babel/generator" "7.0.0-beta.51" - "@babel/helper-function-name" "7.0.0-beta.51" - "@babel/helper-split-export-declaration" "7.0.0-beta.51" - "@babel/parser" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/generator" "7.0.0-beta.44" + "@babel/helper-function-name" "7.0.0-beta.44" + "@babel/helper-split-export-declaration" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" - lodash "^4.17.5" + lodash "^4.2.0" "@babel/types@7.0.0-beta.36": version "7.0.0-beta.36" @@ -126,12 +122,12 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.51.tgz#d802b7b543b5836c778aa691797abf00f3d97ea9" +"@babel/types@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" dependencies: esutils "^2.0.2" - lodash "^4.17.5" + lodash "^4.2.0" to-fast-properties "^2.0.0" acorn-jsx@^3.0.0: @@ -242,6 +238,10 @@ babylon@7.0.0-beta.36: version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" +babylon@7.0.0-beta.44: + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1121,10 +1121,6 @@ lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" -lodash@^4.17.5: - version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" - log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" From 8dae11e6d25d87963e402df9d3635e129cb933f3 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 23 Jun 2018 08:20:40 -0500 Subject: [PATCH 648/965] 8.2.5 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1ff8dda5d6bf..fddc854a36bf 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.4", + "version": "8.2.5", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 4f9e2a5be6c8eec78c85d0722cce1f6a8014c16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 29 Jun 2018 14:26:43 +0100 Subject: [PATCH 649/965] Breaking: Upgraded Babel to 7.0.0-beta.51 (babel/babel-eslint#642) * Upgraded Babel to 7.0.0-beta.51, with changes to decorators * Removed support for Node 4 and added it for Node 10 * nit: fix typo [skip ci] --- eslint/babel-eslint-parser/.travis.yml | 2 +- eslint/babel-eslint-parser/lib/parse.js | 11 +- eslint/babel-eslint-parser/package.json | 10 +- .../test/non-regression.js | 112 ++++++++++++++++-- eslint/babel-eslint-parser/yarn.lock | 106 +++++++++-------- 5 files changed, 168 insertions(+), 73 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index ad63884c93b7..218432b1103f 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,9 +1,9 @@ sudo: false language: node_js node_js: + - "10" - "8" - "6" - - "4" matrix: fast_finish: true diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index f29e6af155b5..67809026456c 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,12 +1,15 @@ "use strict"; var babylonToEspree = require("./babylon-to-espree"); -var parse = require("babylon").parse; -var tt = require("babylon").tokTypes; +var parse = require("@babel/parser").parse; +var tt = require("@babel/parser").tokTypes; var traverse = require("@babel/traverse").default; var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; module.exports = function(code, options) { + const legacyDecorators = + options.ecmaFeatures && options.ecmaFeatures.legacyDecorators; + var opts = { codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, sourceType: options.sourceType, @@ -16,14 +19,14 @@ module.exports = function(code, options) { ranges: true, tokens: true, plugins: [ - "flow", + ["flow", { all: true }], "jsx", "estree", "asyncFunctions", "asyncGenerators", "classConstructorCall", "classProperties", - "decorators", + legacyDecorators ? "decorators-legacy" : "decorators", "doExpressions", "exponentiationOperator", "exportDefaultFrom", diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index fddc854a36bf..8dbe0f65238d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.44", - "@babel/traverse": "7.0.0-beta.44", - "@babel/types": "7.0.0-beta.44", - "babylon": "7.0.0-beta.44", + "@babel/code-frame": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, @@ -30,7 +30,7 @@ "author": "Sebastian McKenzie ", "license": "MIT", "engines": { - "node": ">=4" + "node": ">=6" }, "bugs": { "url": "https://github.com/babel/babel-eslint/issues" diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index af36963e5cf2..8bafb5547f83 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -476,7 +476,7 @@ describe("verify", () => { ); }); - it("polymorphpic types #109", () => { + it("polymorphic types #109", () => { verifyAndAssertMessages( "export default function groupByEveryN(array: Array, n: number): Array> { n; }", { "no-unused-vars": 1, "no-undef": 1 } @@ -494,7 +494,7 @@ describe("verify", () => { ); }); - it("polymorphpic/generic types for class #123", () => { + it("polymorphic/generic types for class #123", () => { verifyAndAssertMessages( ` class Box { @@ -507,7 +507,7 @@ describe("verify", () => { ); }); - it("polymorphpic/generic types for function #123", () => { + it("polymorphic/generic types for function #123", () => { verifyAndAssertMessages( ` export function identity(value) { @@ -518,7 +518,7 @@ describe("verify", () => { ); }); - it("polymorphpic/generic types for type alias #123", () => { + it("polymorphic/generic types for type alias #123", () => { verifyAndAssertMessages( ` import Bar from './Bar'; @@ -528,7 +528,7 @@ describe("verify", () => { ); }); - it("polymorphpic/generic types - outside of fn scope #123", () => { + it("polymorphic/generic types - outside of fn scope #123", () => { verifyAndAssertMessages( ` export function foo(value) { value; }; @@ -542,7 +542,7 @@ describe("verify", () => { ); }); - it("polymorphpic/generic types - extending unknown #123", () => { + it("polymorphic/generic types - extending unknown #123", () => { verifyAndAssertMessages( ` import Bar from 'bar'; @@ -553,6 +553,16 @@ describe("verify", () => { ); }); + it("polymorphic/generic types - function calls", () => { + verifyAndAssertMessages( + ` + function f(): T {} + f(); + `, + { "no-unused-vars": 1, "no-undef": 1 } + ); + }); + it("support declarations #132", () => { verifyAndAssertMessages( ` @@ -1124,9 +1134,32 @@ describe("verify", () => { ); }); - describe("decorators #72", () => { + describe("decorators #72 (legacy)", () => { + function verifyDecoratorsLegacyAndAssertMessages( + code, + rules, + expectedMessages, + sourceType + ) { + const overrideConfig = { + parserOptions: { + ecmaFeatures: { + legacyDecorators: true, + }, + sourceType, + }, + }; + return verifyAndAssertMessages( + code, + rules, + expectedMessages, + sourceType, + overrideConfig + ); + } + it("class declaration", () => { - verifyAndAssertMessages( + verifyDecoratorsLegacyAndAssertMessages( ` import classDeclaration from 'decorator'; import decoratorParameter from 'decorator'; @@ -1140,7 +1173,7 @@ describe("verify", () => { }); it("method definition", () => { - verifyAndAssertMessages( + verifyDecoratorsLegacyAndAssertMessages( ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; @@ -1158,7 +1191,7 @@ describe("verify", () => { }); it("method definition get/set", () => { - verifyAndAssertMessages( + verifyDecoratorsLegacyAndAssertMessages( ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; @@ -1178,7 +1211,7 @@ describe("verify", () => { }); it("object property", () => { - verifyAndAssertMessages( + verifyDecoratorsLegacyAndAssertMessages( ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; @@ -1197,7 +1230,7 @@ describe("verify", () => { }); it("object property get/set", () => { - verifyAndAssertMessages( + verifyDecoratorsLegacyAndAssertMessages( ` import classMethodDeclarationA from 'decorator'; import decoratorParameter from 'decorator'; @@ -1218,6 +1251,61 @@ describe("verify", () => { }); }); + describe("decorators #72", () => { + it("class declaration", () => { + verifyAndAssertMessages( + ` + import classDeclaration from 'decorator'; + import decoratorParameter from 'decorator'; + export + @classDeclaration((parameter) => parameter) + @classDeclaration(decoratorParameter) + @classDeclaration + class TextareaAutosize {} + `, + { "no-unused-vars": 1 } + ); + }); + + it("method definition", () => { + verifyAndAssertMessages( + ` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + export class TextareaAutosize { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + methodDeclaration(e) { + e(); + } + } + `, + { "no-unused-vars": 1 } + ); + }); + + it("method definition get/set", () => { + verifyAndAssertMessages( + ` + import classMethodDeclarationA from 'decorator'; + import decoratorParameter from 'decorator'; + export class TextareaAutosize { + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + get bar() { } + @classMethodDeclarationA((parameter) => parameter) + @classMethodDeclarationA(decoratorParameter) + @classMethodDeclarationA + set bar(val) { val; } + } + `, + { "no-unused-vars": 1 } + ); + }); + }); + it("detects minimal no-unused-vars case #120", () => { verifyAndAssertMessages("var unused;", { "no-unused-vars": 1 }, [ "1:5 'unused' is defined but never used. no-unused-vars", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 35d317871554..bdad6e39ad94 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,19 +10,19 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" +"@babel/code-frame@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz#bd71d9b192af978df915829d39d4094456439a0c" dependencies: - "@babel/highlight" "7.0.0-beta.44" + "@babel/highlight" "7.0.0-beta.51" -"@babel/generator@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" +"@babel/generator@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.51.tgz#6c7575ffde761d07485e04baedc0392c6d9e30f6" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" jsesc "^2.5.1" - lodash "^4.2.0" + lodash "^4.17.5" source-map "^0.5.0" trim-right "^1.0.1" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" +"@babel/helper-function-name@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz#21b4874a227cf99ecafcc30a90302da5a2640561" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.44" - "@babel/template" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" + "@babel/helper-get-function-arity" "7.0.0-beta.51" + "@babel/template" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,26 +48,30 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" +"@babel/helper-get-function-arity@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz#3281b2d045af95c172ce91b20825d85ea4676411" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" -"@babel/helper-split-export-declaration@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" +"@babel/helper-split-export-declaration@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz#8a6c3f66c4d265352fc077484f9f6e80a51ab978" dependencies: - "@babel/types" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.51" -"@babel/highlight@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" +"@babel/highlight@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.51.tgz#e8844ae25a1595ccfd42b89623b4376ca06d225d" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" +"@babel/parser@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51.tgz#27cec2df409df60af58270ed8f6aa55409ea86f6" + "@babel/template@7.0.0-beta.36": version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" @@ -77,14 +81,14 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" +"@babel/template@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.51.tgz#9602a40aebcf357ae9677e2532ef5fc810f5fbff" dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - lodash "^4.2.0" + "@babel/code-frame" "7.0.0-beta.51" + "@babel/parser" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" + lodash "^4.17.5" "@babel/traverse@7.0.0-beta.36": version "7.0.0-beta.36" @@ -99,20 +103,20 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" +"@babel/traverse@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.51.tgz#981daf2cec347a6231d3aa1d9e1803b03aaaa4a8" dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/generator" "7.0.0-beta.44" - "@babel/helper-function-name" "7.0.0-beta.44" - "@babel/helper-split-export-declaration" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" + "@babel/code-frame" "7.0.0-beta.51" + "@babel/generator" "7.0.0-beta.51" + "@babel/helper-function-name" "7.0.0-beta.51" + "@babel/helper-split-export-declaration" "7.0.0-beta.51" + "@babel/parser" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.51" debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" - lodash "^4.2.0" + lodash "^4.17.5" "@babel/types@7.0.0-beta.36": version "7.0.0-beta.36" @@ -122,12 +126,12 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" +"@babel/types@7.0.0-beta.51": + version "7.0.0-beta.51" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.51.tgz#d802b7b543b5836c778aa691797abf00f3d97ea9" dependencies: esutils "^2.0.2" - lodash "^4.2.0" + lodash "^4.17.5" to-fast-properties "^2.0.0" acorn-jsx@^3.0.0: @@ -238,10 +242,6 @@ babylon@7.0.0-beta.36: version "7.0.0-beta.36" resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" -babylon@7.0.0-beta.44: - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -1121,6 +1121,10 @@ lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" +lodash@^4.17.5: + version "4.17.10" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + log-symbols@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" From 28c45078665f7303a27878e0e8f5a54eda5cae39 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 29 Jun 2018 08:37:18 -0500 Subject: [PATCH 650/965] 9.0.0-beta.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8dbe0f65238d..6db3f8de4ea9 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "8.2.5", + "version": "9.0.0-beta.1", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From dcf55cb730679585708dd838020bd0ef38c55fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 6 Jul 2018 14:50:59 +0100 Subject: [PATCH 651/965] Upgrade Babel to v7.0.0-beta.52 (babel/babel-eslint#650) * Upgrade Babel to v7.0.0-beta.52 * Fixed failing test --- eslint/babel-eslint-parser/package.json | 8 +- .../test/non-regression.js | 3 +- eslint/babel-eslint-parser/yarn.lock | 92 +++++++++---------- 3 files changed, 52 insertions(+), 51 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 6db3f8de4ea9..8e0e599626d7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.51", - "@babel/parser": "7.0.0-beta.51", - "@babel/traverse": "7.0.0-beta.51", - "@babel/types": "7.0.0-beta.51", + "@babel/code-frame": "7.0.0-beta.52", + "@babel/parser": "7.0.0-beta.52", + "@babel/traverse": "7.0.0-beta.52", + "@babel/types": "7.0.0-beta.52", "eslint-scope": "~3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 8bafb5547f83..5fc30b488098 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -559,7 +559,8 @@ describe("verify", () => { function f(): T {} f(); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, + ["2:3 'T' is not defined. no-undef"] ); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index bdad6e39ad94..b8e413905452 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,17 +10,17 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz#bd71d9b192af978df915829d39d4094456439a0c" +"@babel/code-frame@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.52.tgz#192483bfa0d1e467c101571c21029ccb74af2801" dependencies: - "@babel/highlight" "7.0.0-beta.51" + "@babel/highlight" "7.0.0-beta.52" -"@babel/generator@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.51.tgz#6c7575ffde761d07485e04baedc0392c6d9e30f6" +"@babel/generator@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.52.tgz#26968f12fad818cd974c849b286b437e1e8ccd91" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.52" jsesc "^2.5.1" lodash "^4.17.5" source-map "^0.5.0" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz#21b4874a227cf99ecafcc30a90302da5a2640561" +"@babel/helper-function-name@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.52.tgz#a867a58ff571b25772b2d799b32866058573c450" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.51" - "@babel/template" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" + "@babel/helper-get-function-arity" "7.0.0-beta.52" + "@babel/template" "7.0.0-beta.52" + "@babel/types" "7.0.0-beta.52" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,29 +48,29 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz#3281b2d045af95c172ce91b20825d85ea4676411" +"@babel/helper-get-function-arity@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.52.tgz#1c0cda58e0b75f45e92eafbd8fe189a4eee92b74" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.52" -"@babel/helper-split-export-declaration@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz#8a6c3f66c4d265352fc077484f9f6e80a51ab978" +"@babel/helper-split-export-declaration@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.52.tgz#4aac4f30ea6384af3676e04b5246727632e460df" dependencies: - "@babel/types" "7.0.0-beta.51" + "@babel/types" "7.0.0-beta.52" -"@babel/highlight@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.51.tgz#e8844ae25a1595ccfd42b89623b4376ca06d225d" +"@babel/highlight@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.52.tgz#ef24931432f06155e7bc39cdb8a6b37b4a28b3d0" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/parser@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.51.tgz#27cec2df409df60af58270ed8f6aa55409ea86f6" +"@babel/parser@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.52.tgz#4e935b62cd9bf872bd37bcf1f63d82fe7b0237a2" "@babel/template@7.0.0-beta.36": version "7.0.0-beta.36" @@ -81,13 +81,13 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.51.tgz#9602a40aebcf357ae9677e2532ef5fc810f5fbff" +"@babel/template@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.52.tgz#44e18fac38251f57f92511d6748f095ab02f996e" dependencies: - "@babel/code-frame" "7.0.0-beta.51" - "@babel/parser" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" + "@babel/code-frame" "7.0.0-beta.52" + "@babel/parser" "7.0.0-beta.52" + "@babel/types" "7.0.0-beta.52" lodash "^4.17.5" "@babel/traverse@7.0.0-beta.36": @@ -103,16 +103,16 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.51.tgz#981daf2cec347a6231d3aa1d9e1803b03aaaa4a8" +"@babel/traverse@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.52.tgz#9b8ba994f7264d9847858ad2feecc2738c5e2ef3" dependencies: - "@babel/code-frame" "7.0.0-beta.51" - "@babel/generator" "7.0.0-beta.51" - "@babel/helper-function-name" "7.0.0-beta.51" - "@babel/helper-split-export-declaration" "7.0.0-beta.51" - "@babel/parser" "7.0.0-beta.51" - "@babel/types" "7.0.0-beta.51" + "@babel/code-frame" "7.0.0-beta.52" + "@babel/generator" "7.0.0-beta.52" + "@babel/helper-function-name" "7.0.0-beta.52" + "@babel/helper-split-export-declaration" "7.0.0-beta.52" + "@babel/parser" "7.0.0-beta.52" + "@babel/types" "7.0.0-beta.52" debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" @@ -126,9 +126,9 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.51": - version "7.0.0-beta.51" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.51.tgz#d802b7b543b5836c778aa691797abf00f3d97ea9" +"@babel/types@7.0.0-beta.52": + version "7.0.0-beta.52" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.52.tgz#a3e5620b1534b253a50abcf2222b520e23b16da2" dependencies: esutils "^2.0.2" lodash "^4.17.5" From a17917810d55b7b49793a5425f955c4d4ad20943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Fri, 6 Jul 2018 17:20:52 +0100 Subject: [PATCH 652/965] Merge pull request babel/babel-eslint#645 from rubennorte/support-new-flow-syntax-in-scope-analysis Support new flow syntax in scope analysis --- eslint/babel-eslint-parser/test/non-regression.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 5fc30b488098..4c43b29f3f71 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -564,6 +564,17 @@ describe("verify", () => { ); }); + it("polymorphic/generic types - function calls #644", () => { + verifyAndAssertMessages( + ` + import type {Type} from 'Type'; + function f(): T {} + f(); + `, + { "no-unused-vars": 1, "no-undef": 1 } + ); + }); + it("support declarations #132", () => { verifyAndAssertMessages( ` From a1f945805294d1b7b8635ee7af352d88b3a7645a Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 6 Jul 2018 11:24:45 -0500 Subject: [PATCH 653/965] 9.0.0-beta.2 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 8e0e599626d7..135a5a9e5ee7 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "9.0.0-beta.1", + "version": "9.0.0-beta.2", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From e675cd7445910b7642dbbfa764ec13ac0412b7f6 Mon Sep 17 00:00:00 2001 From: Mark Tse Date: Thu, 12 Jul 2018 09:49:43 -0400 Subject: [PATCH 654/965] chore - fixing eslint-scope to a safe version; resolves babel/babel-eslint#656. (babel/babel-eslint#657) --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 135a5a9e5ee7..3097247907a1 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -15,7 +15,7 @@ "@babel/parser": "7.0.0-beta.52", "@babel/traverse": "7.0.0-beta.52", "@babel/types": "7.0.0-beta.52", - "eslint-scope": "~3.7.1", + "eslint-scope": "3.7.1", "eslint-visitor-keys": "^1.0.0" }, "scripts": { From 098ab73be1be98bb9afd7e44b2813ff2ae6b03b9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 12 Jul 2018 09:50:30 -0400 Subject: [PATCH 655/965] update lock --- eslint/babel-eslint-parser/yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index b8e413905452..9c4248eb9517 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -546,7 +546,7 @@ eslint-plugin-prettier@^2.1.2: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-scope@^3.7.1, eslint-scope@~3.7.1: +eslint-scope@3.7.1, eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: From 35c49ddf9756cbf0d6a97fe535e1906ddf0bb2ac Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 12 Jul 2018 09:50:58 -0400 Subject: [PATCH 656/965] 9.0.0-beta.3 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3097247907a1..e96898619667 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "9.0.0-beta.2", + "version": "9.0.0-beta.3", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 6ab458b512be9f2ceaece08a34a2c4e33acea693 Mon Sep 17 00:00:00 2001 From: Leo Yin Date: Wed, 22 Aug 2018 04:00:17 +0800 Subject: [PATCH 657/965] build(deps): upgrade @babel/* to 7.0.0-rc.2 (babel/babel-eslint#668) --- eslint/babel-eslint-parser/lib/parse.js | 6 +- eslint/babel-eslint-parser/package.json | 8 +- eslint/babel-eslint-parser/yarn.lock | 126 ++++++++++++------------ 3 files changed, 72 insertions(+), 68 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 67809026456c..b416c490e7e0 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -26,7 +26,9 @@ module.exports = function(code, options) { "asyncGenerators", "classConstructorCall", "classProperties", - legacyDecorators ? "decorators-legacy" : "decorators", + legacyDecorators + ? "decorators-legacy" + : ["decorators", { decoratorsBeforeExport: false }], "doExpressions", "exponentiationOperator", "exportDefaultFrom", @@ -43,7 +45,7 @@ module.exports = function(code, options) { "bigInt", "optionalCatchBinding", "throwExpressions", - "pipelineOperator", + ["pipelineOperator", { proposal: "minimal" }], "nullishCoalescingOperator", ], }; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e96898619667..22a113de1677 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.52", - "@babel/parser": "7.0.0-beta.52", - "@babel/traverse": "7.0.0-beta.52", - "@babel/types": "7.0.0-beta.52", + "@babel/code-frame": "7.0.0-rc.2", + "@babel/parser": "7.0.0-rc.2", + "@babel/traverse": "7.0.0-rc.2", + "@babel/types": "7.0.0-rc.2", "eslint-scope": "3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 9c4248eb9517..00e6f39f3622 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -10,19 +10,19 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/code-frame@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.52.tgz#192483bfa0d1e467c101571c21029ccb74af2801" +"@babel/code-frame@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.2.tgz#12b6daeb408238360744649d16c0e9fa7ab3859e" dependencies: - "@babel/highlight" "7.0.0-beta.52" + "@babel/highlight" "7.0.0-rc.2" -"@babel/generator@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.52.tgz#26968f12fad818cd974c849b286b437e1e8ccd91" +"@babel/generator@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-rc.2.tgz#7aed8fb4ef1bdcc168225096b5b431744ba76bf8" dependencies: - "@babel/types" "7.0.0-beta.52" + "@babel/types" "7.0.0-rc.2" jsesc "^2.5.1" - lodash "^4.17.5" + lodash "^4.17.10" source-map "^0.5.0" trim-right "^1.0.1" @@ -34,13 +34,13 @@ "@babel/template" "7.0.0-beta.36" "@babel/types" "7.0.0-beta.36" -"@babel/helper-function-name@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.52.tgz#a867a58ff571b25772b2d799b32866058573c450" +"@babel/helper-function-name@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-rc.2.tgz#ad7bb9df383c5f53e4bf38c0fe0c7f93e6a27729" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.52" - "@babel/template" "7.0.0-beta.52" - "@babel/types" "7.0.0-beta.52" + "@babel/helper-get-function-arity" "7.0.0-rc.2" + "@babel/template" "7.0.0-rc.2" + "@babel/types" "7.0.0-rc.2" "@babel/helper-get-function-arity@7.0.0-beta.36": version "7.0.0-beta.36" @@ -48,29 +48,29 @@ dependencies: "@babel/types" "7.0.0-beta.36" -"@babel/helper-get-function-arity@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.52.tgz#1c0cda58e0b75f45e92eafbd8fe189a4eee92b74" +"@babel/helper-get-function-arity@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-rc.2.tgz#323cb82e2d805b40c0c36be1dfcb8ffcbd0434f3" dependencies: - "@babel/types" "7.0.0-beta.52" + "@babel/types" "7.0.0-rc.2" -"@babel/helper-split-export-declaration@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.52.tgz#4aac4f30ea6384af3676e04b5246727632e460df" +"@babel/helper-split-export-declaration@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-rc.2.tgz#726b2dec4e46baeab32db67caa6e88b6521464f8" dependencies: - "@babel/types" "7.0.0-beta.52" + "@babel/types" "7.0.0-rc.2" -"@babel/highlight@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.52.tgz#ef24931432f06155e7bc39cdb8a6b37b4a28b3d0" +"@babel/highlight@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.2.tgz#0af688a69e3709d9cf392e1837cda18c08d34d4f" dependencies: chalk "^2.0.0" esutils "^2.0.2" - js-tokens "^3.0.0" + js-tokens "^4.0.0" -"@babel/parser@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-beta.52.tgz#4e935b62cd9bf872bd37bcf1f63d82fe7b0237a2" +"@babel/parser@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-rc.2.tgz#a98c01af5834e71d48a5108e3aeeee333cdf26c4" "@babel/template@7.0.0-beta.36": version "7.0.0-beta.36" @@ -81,14 +81,13 @@ babylon "7.0.0-beta.36" lodash "^4.2.0" -"@babel/template@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.52.tgz#44e18fac38251f57f92511d6748f095ab02f996e" +"@babel/template@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-rc.2.tgz#53f6be6c1336ddc7744625c9bdca9d10be5d5d72" dependencies: - "@babel/code-frame" "7.0.0-beta.52" - "@babel/parser" "7.0.0-beta.52" - "@babel/types" "7.0.0-beta.52" - lodash "^4.17.5" + "@babel/code-frame" "7.0.0-rc.2" + "@babel/parser" "7.0.0-rc.2" + "@babel/types" "7.0.0-rc.2" "@babel/traverse@7.0.0-beta.36": version "7.0.0-beta.36" @@ -103,20 +102,19 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.52.tgz#9b8ba994f7264d9847858ad2feecc2738c5e2ef3" +"@babel/traverse@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-rc.2.tgz#6e54ebe82aa1b3b3cf5ec05594bc14d7c59c9766" dependencies: - "@babel/code-frame" "7.0.0-beta.52" - "@babel/generator" "7.0.0-beta.52" - "@babel/helper-function-name" "7.0.0-beta.52" - "@babel/helper-split-export-declaration" "7.0.0-beta.52" - "@babel/parser" "7.0.0-beta.52" - "@babel/types" "7.0.0-beta.52" + "@babel/code-frame" "7.0.0-rc.2" + "@babel/generator" "7.0.0-rc.2" + "@babel/helper-function-name" "7.0.0-rc.2" + "@babel/helper-split-export-declaration" "7.0.0-rc.2" + "@babel/parser" "7.0.0-rc.2" + "@babel/types" "7.0.0-rc.2" debug "^3.1.0" globals "^11.1.0" - invariant "^2.2.0" - lodash "^4.17.5" + lodash "^4.17.10" "@babel/types@7.0.0-beta.36": version "7.0.0-beta.36" @@ -126,12 +124,12 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.52": - version "7.0.0-beta.52" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.52.tgz#a3e5620b1534b253a50abcf2222b520e23b16da2" +"@babel/types@7.0.0-rc.2": + version "7.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-rc.2.tgz#8e025b78764cee8751823e308558a3ca144ebd9d" dependencies: esutils "^2.0.2" - lodash "^4.17.5" + lodash "^4.17.10" to-fast-properties "^2.0.0" acorn-jsx@^3.0.0: @@ -548,7 +546,7 @@ eslint-plugin-prettier@^2.1.2: eslint-scope@3.7.1, eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -712,7 +710,7 @@ find-up@^1.0.0: find-up@^2.0.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + resolved "http://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: locate-path "^2.0.0" @@ -921,7 +919,7 @@ is-glob@^4.0.0: is-obj@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + resolved "http://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" is-observable@^0.2.0: version "0.2.0" @@ -990,6 +988,10 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + js-yaml@^3.9.0, js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" @@ -1121,9 +1123,9 @@ lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" -lodash@^4.17.5: +lodash@^4.17.10: version "4.17.10" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" + resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" log-symbols@^1.0.2: version "1.0.2" @@ -1198,7 +1200,7 @@ ms@2.0.0: mute-stream@0.0.7: version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" natural-compare@^1.4.0: version "1.4.0" @@ -1206,7 +1208,7 @@ natural-compare@^1.4.0: normalize-package-data@^2.3.2: version "2.4.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + resolved "http://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" dependencies: hosted-git-info "^2.1.4" is-builtin-module "^1.0.0" @@ -1283,7 +1285,7 @@ ora@^0.2.3: os-tmpdir@~1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + resolved "http://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" p-finally@^1.0.0: version "1.0.0" @@ -1483,7 +1485,7 @@ restore-cursor@^2.0.0: rimraf@^2.2.8: version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: glob "^7.0.5" @@ -1671,7 +1673,7 @@ text-table@~0.2.0: through@^2.3.6: version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" tmp@^0.0.33: version "0.0.33" From 57c825eebb3a364a6b47415ad2148f26d2142ab3 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 21 Aug 2018 15:18:02 -0500 Subject: [PATCH 658/965] Bump some devDeps --- eslint/babel-eslint-parser/package.json | 6 +- eslint/babel-eslint-parser/yarn.lock | 1010 ++++++++++++++++++----- 2 files changed, 821 insertions(+), 195 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 22a113de1677..0599e941be18 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -37,7 +37,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "devDependencies": { - "babel-eslint": "^8.0.0", + "babel-eslint": "^8.2.6", "dedent": "^0.7.0", "eslint": "npm:eslint@4.19.1", "eslint-config-babel": "^7.0.1", @@ -46,8 +46,8 @@ "eslint-plugin-import": "^2.8.0", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.5.2", - "husky": "^0.14.0", - "lint-staged": "^6.1.1", + "husky": "^1.0.0-rc.13", + "lint-staged": "^7.2.2", "mocha": "^5.0.1", "prettier": "^1.4.4" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 00e6f39f3622..a3d39e95dc37 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,13 +2,11 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" +"@babel/code-frame@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" + "@babel/highlight" "7.0.0-beta.44" "@babel/code-frame@7.0.0-rc.2": version "7.0.0-rc.2" @@ -16,6 +14,16 @@ dependencies: "@babel/highlight" "7.0.0-rc.2" +"@babel/generator@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" + dependencies: + "@babel/types" "7.0.0-beta.44" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + "@babel/generator@7.0.0-rc.2": version "7.0.0-rc.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-rc.2.tgz#7aed8fb4ef1bdcc168225096b5b431744ba76bf8" @@ -26,13 +34,13 @@ source-map "^0.5.0" trim-right "^1.0.1" -"@babel/helper-function-name@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" +"@babel/helper-function-name@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.36" - "@babel/template" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" + "@babel/helper-get-function-arity" "7.0.0-beta.44" + "@babel/template" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" "@babel/helper-function-name@7.0.0-rc.2": version "7.0.0-rc.2" @@ -42,11 +50,11 @@ "@babel/template" "7.0.0-rc.2" "@babel/types" "7.0.0-rc.2" -"@babel/helper-get-function-arity@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" +"@babel/helper-get-function-arity@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" dependencies: - "@babel/types" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.44" "@babel/helper-get-function-arity@7.0.0-rc.2": version "7.0.0-rc.2" @@ -54,12 +62,26 @@ dependencies: "@babel/types" "7.0.0-rc.2" +"@babel/helper-split-export-declaration@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" + dependencies: + "@babel/types" "7.0.0-beta.44" + "@babel/helper-split-export-declaration@7.0.0-rc.2": version "7.0.0-rc.2" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-rc.2.tgz#726b2dec4e46baeab32db67caa6e88b6521464f8" dependencies: "@babel/types" "7.0.0-rc.2" +"@babel/highlight@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + "@babel/highlight@7.0.0-rc.2": version "7.0.0-rc.2" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.2.tgz#0af688a69e3709d9cf392e1837cda18c08d34d4f" @@ -72,13 +94,13 @@ version "7.0.0-rc.2" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-rc.2.tgz#a98c01af5834e71d48a5108e3aeeee333cdf26c4" -"@babel/template@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" +"@babel/template@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" lodash "^4.2.0" "@babel/template@7.0.0-rc.2": @@ -89,15 +111,17 @@ "@babel/parser" "7.0.0-rc.2" "@babel/types" "7.0.0-rc.2" -"@babel/traverse@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" +"@babel/traverse@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/helper-function-name" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" - debug "^3.0.1" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/generator" "7.0.0-beta.44" + "@babel/helper-function-name" "7.0.0-beta.44" + "@babel/helper-split-export-declaration" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" lodash "^4.2.0" @@ -116,9 +140,9 @@ globals "^11.1.0" lodash "^4.17.10" -"@babel/types@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" +"@babel/types@7.0.0-beta.44": + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" dependencies: esutils "^2.0.2" lodash "^4.2.0" @@ -132,6 +156,12 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@samverschueren/stream-to-observable@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + dependencies: + any-observable "^0.3.0" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -183,19 +213,15 @@ ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" -ansi-styles@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.0.tgz#c159b8d5be0f9e5a6f346dab94f16ce022161b88" +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" dependencies: color-convert "^1.9.0" -any-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.2.0.tgz#c67870058003579009083f54ac0abafb5c33d242" - -app-root-path@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-2.0.1.tgz#cd62dcf8e4fd5a417efc664d2e5b10653c651b46" +any-observable@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" argparse@^1.0.7: version "1.0.10" @@ -203,6 +229,18 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -213,10 +251,22 @@ array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + babel-code-frame@^6.22.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -225,25 +275,37 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" -babel-eslint@^8.0.0: - version "8.2.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951" +babel-eslint@^8.2.6: + version "8.2.6" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.6.tgz#6270d0c73205628067c0f7ae1693a9e797acefd9" dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/traverse" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" - eslint-scope "~3.7.1" + "@babel/code-frame" "7.0.0-beta.44" + "@babel/traverse" "7.0.0-beta.44" + "@babel/types" "7.0.0-beta.44" + babylon "7.0.0-beta.44" + eslint-scope "3.7.1" eslint-visitor-keys "^1.0.0" -babylon@7.0.0-beta.36: - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" +babylon@7.0.0-beta.44: + version "7.0.0-beta.44" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -251,6 +313,21 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" @@ -259,6 +336,20 @@ builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -279,26 +370,35 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: - ansi-styles "^3.2.0" + ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" - supports-color "^5.2.0" + supports-color "^5.3.0" chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" -ci-info@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" +ci-info@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.4.0.tgz#4841d53cad49f11b827b648ebde27a6e189b412f" circular-json@^0.3.1: version "0.3.3" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -334,23 +434,34 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + version "1.9.2" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" dependencies: - color-name "^1.1.1" + color-name "1.1.1" -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" +color-name@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" commander@2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" -commander@^2.11.0, commander@^2.9.0: - version "2.14.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.14.1.tgz#2235123e37af8ca3c65df45b026dbd357b01b9aa" +commander@^2.14.1, commander@^2.9.0: + version "2.17.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" concat-map@0.0.1: version "0.0.1" @@ -368,18 +479,21 @@ contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cosmiconfig@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-4.0.0.tgz#760391549580bbd2df1e562bc177b13c290972dc" +cosmiconfig@^5.0.2: + version "5.0.6" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" dependencies: is-directory "^0.3.1" js-yaml "^3.9.0" parse-json "^4.0.0" - require-from-string "^2.0.1" cross-spawn@^5.0.1, cross-spawn@^5.1.0: version "5.1.0" @@ -399,12 +513,16 @@ debug@3.1.0, debug@^3.0.1, debug@^3.1.0: dependencies: ms "2.0.0" -debug@^2.6.8, debug@^2.6.9: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: ms "2.0.0" +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -413,6 +531,25 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -446,12 +583,18 @@ elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" -error-ex@^1.2.0, error-ex@^1.3.1: +error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" dependencies: is-arrayish "^0.2.1" +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + dependencies: + is-arrayish "^0.2.1" + escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -544,7 +687,7 @@ eslint-plugin-prettier@^2.1.2: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-scope@3.7.1, eslint-scope@^3.7.1, eslint-scope@~3.7.1: +eslint-scope@3.7.1, eslint-scope@^3.7.1: version "3.7.1" resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: @@ -613,8 +756,8 @@ espree@^3.5.4: acorn-jsx "^3.0.0" esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" esquery@^1.0.0: version "1.0.0" @@ -623,11 +766,10 @@ esquery@^1.0.0: estraverse "^4.0.0" esrecurse@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" - object-assign "^4.0.1" estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" @@ -637,9 +779,9 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -execa@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" +execa@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -653,6 +795,31 @@ exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + external-editor@^2.0.4: version "2.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" @@ -661,6 +828,19 @@ external-editor@^2.0.4: iconv-lite "^0.4.17" tmp "^0.0.33" +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" @@ -697,6 +877,15 @@ file-entry-cache@^2.0.0: flat-cache "^1.2.1" object-assign "^4.0.1" +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" @@ -714,6 +903,12 @@ find-up@^2.0.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" @@ -723,6 +918,16 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + dependencies: + map-cache "^0.2.2" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -739,10 +944,18 @@ get-own-enumerable-property-symbols@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -754,10 +967,14 @@ glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.0.1, globals@^11.1.0: +globals@^11.0.1: version "11.3.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" +globals@^11.1.0: + version "11.7.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -791,6 +1008,33 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -805,13 +1049,20 @@ hosted-git-info@^2.1.4: version "2.5.0" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" -husky@^0.14.0: - version "0.14.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" - dependencies: - is-ci "^1.0.10" - normalize-path "^1.0.0" - strip-indent "^2.0.0" +husky@^1.0.0-rc.13: + version "1.0.0-rc.13" + resolved "https://registry.yarnpkg.com/husky/-/husky-1.0.0-rc.13.tgz#49c3cc210bfeac24d4ad272f770b7505c9091828" + dependencies: + cosmiconfig "^5.0.2" + execa "^0.9.0" + find-up "^3.0.0" + get-stdin "^6.0.0" + is-ci "^1.1.0" + pkg-dir "^3.0.0" + please-upgrade-node "^3.1.1" + read-pkg "^4.0.1" + run-node "^1.0.0" + slash "^2.0.0" iconv-lite@^0.4.17: version "0.4.19" @@ -866,31 +1117,85 @@ inquirer@^3.0.6: through "^2.3.6" invariant@^2.2.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.3.tgz#1a827dfde7dcbd7c323f0ca826be8fa7c5e9d688" + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + dependencies: + kind-of "^6.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + is-builtin-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" dependencies: builtin-modules "^1.0.0" -is-ci@^1.0.10: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5" +is-ci@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.0.tgz#3f4a08d6303a09882cef3f0fb97439c5f5ce2d53" + dependencies: + ci-info "^1.3.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" dependencies: - ci-info "^1.0.0" + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + dependencies: + is-plain-object "^2.0.4" + is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -917,15 +1222,21 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + dependencies: + kind-of "^3.0.2" + is-obj@^1.0.1: version "1.0.1" - resolved "http://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" -is-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-0.2.0.tgz#b361311d83c6e5d726cabf5e250b0237106f5ae2" +is-observable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" dependencies: - symbol-observable "^0.2.2" + symbol-observable "^1.1.0" is-path-cwd@^1.0.0: version "1.0.0" @@ -943,6 +1254,12 @@ is-path-inside@^1.0.0: dependencies: path-is-inside "^1.0.1" +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + dependencies: + isobject "^3.0.1" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -959,7 +1276,11 @@ is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" -isarray@^1.0.0, isarray@~1.0.0: +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + +isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -967,32 +1288,49 @@ isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" -jest-get-type@^21.2.0: - version "21.2.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-21.2.0.tgz#f6376ab9db4b60d81e39f30749c6c466f40d4a23" +jest-get-type@^22.1.0: + version "22.4.3" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" -jest-validate@^21.1.0: - version "21.2.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" +jest-validate@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.5.0.tgz#f5df8f761cf43155e1b2e21d6e9de8a2852d0231" dependencies: chalk "^2.0.1" - jest-get-type "^21.2.0" + jest-get-type "^22.1.0" leven "^2.1.0" - pretty-format "^21.2.1" + pretty-format "^23.5.0" js-tokens@^3.0.0, js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-tokens@^4.0.0: +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.9.0, js-yaml@^3.9.1: +js-yaml@^3.9.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^3.9.1: version "3.10.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" dependencies: @@ -1004,8 +1342,8 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" json-parse-better-errors@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.1.tgz#50183cd1b2d25275de069e9e71b467ac9eab973a" + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" json-schema-traverse@^0.3.0: version "0.3.1" @@ -1015,6 +1353,26 @@ json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" @@ -1026,30 +1384,32 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lint-staged@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.1.1.tgz#cd08c4d9b8ccc2d37198d1c47ce77d22be6cf324" +lint-staged@^7.2.2: + version "7.2.2" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.2.2.tgz#0983d55d497f19f36d11ff2c8242b2f56cc2dd05" dependencies: - app-root-path "^2.0.0" - chalk "^2.1.0" - commander "^2.11.0" - cosmiconfig "^4.0.0" + chalk "^2.3.1" + commander "^2.14.1" + cosmiconfig "^5.0.2" debug "^3.1.0" dedent "^0.7.0" - execa "^0.8.0" + execa "^0.9.0" find-parent-dir "^0.3.0" is-glob "^4.0.0" - jest-validate "^21.1.0" - listr "^0.13.0" - lodash "^4.17.4" - log-symbols "^2.0.0" - minimatch "^3.0.0" + is-windows "^1.0.2" + jest-validate "^23.5.0" + listr "^0.14.1" + lodash "^4.17.5" + log-symbols "^2.2.0" + micromatch "^3.1.8" npm-which "^3.0.1" p-map "^1.1.1" path-is-inside "^1.0.2" pify "^3.0.0" - staged-git-files "1.0.0" - stringify-object "^3.2.0" + please-upgrade-node "^3.0.2" + staged-git-files "1.1.1" + string-argv "^0.0.2" + stringify-object "^3.2.2" listr-silent-renderer@^1.1.1: version "1.1.1" @@ -1077,15 +1437,15 @@ listr-verbose-renderer@^0.4.0: date-fns "^1.27.2" figures "^1.7.0" -listr@^0.13.0: - version "0.13.0" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.13.0.tgz#20bb0ba30bae660ee84cc0503df4be3d5623887d" +listr@^0.14.1: + version "0.14.1" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.1.tgz#8a7afa4a7135cee4c921d128e0b7dfc6e522d43d" dependencies: - chalk "^1.1.3" + "@samverschueren/stream-to-observable" "^0.3.0" cli-truncate "^0.2.1" figures "^1.7.0" indent-string "^2.1.0" - is-observable "^0.2.0" + is-observable "^1.1.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" @@ -1095,8 +1455,7 @@ listr@^0.13.0: log-update "^1.0.2" ora "^0.2.3" p-map "^1.1.1" - rxjs "^5.4.2" - stream-to-observable "^0.2.0" + rxjs "^6.1.0" strip-ansi "^3.0.1" load-json-file@^2.0.0: @@ -1115,15 +1474,22 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + lodash.cond@^4.3.0: version "4.5.2" resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" -lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: +lodash@^4.15.0, lodash@^4.3.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" -lodash@^4.17.10: +lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: version "4.17.10" resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -1133,7 +1499,7 @@ log-symbols@^1.0.2: dependencies: chalk "^1.0.0" -log-symbols@^2.0.0: +log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" dependencies: @@ -1147,23 +1513,51 @@ log-update@^1.0.2: cli-cursor "^1.0.2" loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" dependencies: - js-tokens "^3.0.0" + js-tokens "^3.0.0 || ^4.0.0" lru-cache@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + version "4.1.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: pseudomap "^1.0.2" yallist "^2.1.2" +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + dependencies: + object-visit "^1.0.0" + +micromatch@^3.1.8: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" -minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -1173,6 +1567,13 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + mkdirp@0.5.1, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -1202,6 +1603,22 @@ mute-stream@0.0.7: version "0.0.7" resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -1215,10 +1632,6 @@ normalize-package-data@^2.3.2: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" - npm-path@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" @@ -1247,6 +1660,26 @@ object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + dependencies: + isobject "^3.0.0" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + dependencies: + isobject "^3.0.1" + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1255,7 +1688,7 @@ once@^1.3.0: onetime@^1.0.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" onetime@^2.0.0: version "2.0.1" @@ -1297,12 +1730,24 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" +p-limit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + dependencies: + p-try "^2.0.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" dependencies: p-limit "^1.1.0" +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" @@ -1311,6 +1756,10 @@ p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" +p-try@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" @@ -1324,6 +1773,10 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -1380,21 +1833,37 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + dependencies: + find-up "^3.0.0" + +please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + dependencies: + semver-compare "^1.0.0" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" prettier@^1.4.4: - version "1.10.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" + version "1.14.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9" -pretty-format@^21.2.1: - version "21.2.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-21.2.1.tgz#ae5407f3cf21066cd011aa1ba5fce7b6a2eddb36" +pretty-format@^23.5.0: + version "23.5.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.5.0.tgz#0f9601ad9da70fe690a269cd3efca732c210687c" dependencies: ansi-regex "^3.0.0" ansi-styles "^3.2.0" @@ -1426,6 +1895,14 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" +read-pkg@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + dependencies: + normalize-package-data "^2.3.2" + parse-json "^4.0.0" + pify "^3.0.0" + readable-stream@^2.2.2: version "2.3.4" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" @@ -1438,20 +1915,31 @@ readable-stream@^2.2.2: string_decoder "~1.0.3" util-deprecate "~1.0.1" +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + regexpp@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" dependencies: is-finite "^1.0.0" -require-from-string@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.1.tgz#c545233e9d7da6616e9d59adfb39fc9f588676ff" - require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -1463,6 +1951,10 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + resolve@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" @@ -1483,6 +1975,10 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + rimraf@^2.2.8: version "2.6.2" resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" @@ -1495,6 +1991,10 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-node@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" + rx-lite-aggregates@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" @@ -1505,20 +2005,48 @@ rx-lite@*, rx-lite@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" -rxjs@^5.4.2: - version "5.5.6" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.6.tgz#e31fb96d6fd2ff1fd84bcea8ae9c02d007179c02" +rxjs@^6.1.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" dependencies: - symbol-observable "1.0.1" + tslib "^1.9.0" safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + dependencies: + ret "~0.1.10" + +semver-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + "semver@2 || 3 || 4 || 5", semver@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -1533,6 +2061,10 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -1543,7 +2075,48 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" -source-map@^0.5.0: +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + +source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" @@ -1561,19 +2134,30 @@ spdx-license-ids@^1.0.2: version "1.2.2" resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + dependencies: + extend-shallow "^3.0.0" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" -staged-git-files@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.0.0.tgz#cdb847837c1fcc52c08a872d4883cc0877668a80" +staged-git-files@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" -stream-to-observable@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.2.0.tgz#59d6ea393d87c2c0ddac10aa0d561bc6ba6f0e10" +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" dependencies: - any-observable "^0.2.0" + define-property "^0.2.5" + object-copy "^0.1.0" + +string-argv@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" string-width@^1.0.1: version "1.0.2" @@ -1596,7 +2180,7 @@ string_decoder@~1.0.3: dependencies: safe-buffer "~5.1.0" -stringify-object@^3.2.0: +stringify-object@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" dependencies: @@ -1624,10 +2208,6 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-indent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" - strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -1642,19 +2222,15 @@ supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -supports-color@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.2.0.tgz#b0d5333b1184dd3666cbe5aa0b45c5ac7ac17a4a" +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" dependencies: has-flag "^3.0.0" -symbol-observable@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" - -symbol-observable@^0.2.2: - version "0.2.4" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" +symbol-observable@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" table@4.0.2, table@^4.0.1: version "4.0.2" @@ -1685,10 +2261,36 @@ to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" @@ -1699,6 +2301,30 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -1711,8 +2337,8 @@ validate-npm-package-license@^3.0.1: spdx-expression-parse "~1.0.0" which@^1.2.10, which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" dependencies: isexe "^2.0.0" From 2a1c76e070ca9366ae75dc88b46af409927ee88b Mon Sep 17 00:00:00 2001 From: Alexandre Borela Date: Thu, 23 Aug 2018 02:21:45 -0300 Subject: [PATCH 659/965] Add logical assignment plugin (babel/babel-eslint#674) Fix babel/babel-eslint#672 --- eslint/babel-eslint-parser/lib/parse.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index b416c490e7e0..b23b9dc9fc75 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -47,6 +47,7 @@ module.exports = function(code, options) { "throwExpressions", ["pipelineOperator", { proposal: "minimal" }], "nullishCoalescingOperator", + "logicalAssignment", ], }; From c456fdddd71198827c4a78ae389e8472db59b5d6 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 23 Aug 2018 06:23:06 +0100 Subject: [PATCH 660/965] Docs: Make the default parserOptions more explicit (babel/babel-eslint#673) In particular, previously the `.eslintrc` example implied that the default value for `codeFrame` was `false`, when in fact it is `true`: https://github.com/babel/babel-eslint/blob/v9.0.0-beta.3/lib/parse.js#L14 --- eslint/babel-eslint-parser/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 4dbfc84f072b..6a4f9085e3ac 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -79,9 +79,9 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ### Configuration -`sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. -`allowImportExportEverywhere` can be set to true to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. By default, import and export declarations can only appear at a program's top level. -`codeFrame` can be set to false to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it. +- `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. +- `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. +- `codeFrame` (default `true`) can be set to `false` to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it. **.eslintrc** @@ -91,7 +91,7 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule "parserOptions": { "sourceType": "module", "allowImportExportEverywhere": false, - "codeFrame": false + "codeFrame": true } } ``` From b6a7601e4a5bb2c4047cc4deec7a16eec0d8edeb Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 27 Aug 2018 17:04:26 -0500 Subject: [PATCH 661/965] =?UTF-8?q?Bump=20to=20babel@7.0.0=20=F0=9F=8E=89?= =?UTF-8?q?=20(babel/babel-eslint#676)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint/babel-eslint-parser/package.json | 8 +-- eslint/babel-eslint-parser/yarn.lock | 94 ++++++++++++------------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0599e941be18..f4ca955af68b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -11,10 +11,10 @@ "url": "https://github.com/babel/babel-eslint.git" }, "dependencies": { - "@babel/code-frame": "7.0.0-rc.2", - "@babel/parser": "7.0.0-rc.2", - "@babel/traverse": "7.0.0-rc.2", - "@babel/types": "7.0.0-rc.2", + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", "eslint-scope": "3.7.1", "eslint-visitor-keys": "^1.0.0" }, diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index a3d39e95dc37..d6f8fae16604 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -8,11 +8,11 @@ dependencies: "@babel/highlight" "7.0.0-beta.44" -"@babel/code-frame@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-rc.2.tgz#12b6daeb408238360744649d16c0e9fa7ab3859e" +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" dependencies: - "@babel/highlight" "7.0.0-rc.2" + "@babel/highlight" "^7.0.0" "@babel/generator@7.0.0-beta.44": version "7.0.0-beta.44" @@ -24,11 +24,11 @@ source-map "^0.5.0" trim-right "^1.0.1" -"@babel/generator@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-rc.2.tgz#7aed8fb4ef1bdcc168225096b5b431744ba76bf8" +"@babel/generator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" dependencies: - "@babel/types" "7.0.0-rc.2" + "@babel/types" "^7.0.0" jsesc "^2.5.1" lodash "^4.17.10" source-map "^0.5.0" @@ -42,13 +42,13 @@ "@babel/template" "7.0.0-beta.44" "@babel/types" "7.0.0-beta.44" -"@babel/helper-function-name@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-rc.2.tgz#ad7bb9df383c5f53e4bf38c0fe0c7f93e6a27729" +"@babel/helper-function-name@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0.tgz#a68cc8d04420ccc663dd258f9cc41b8261efa2d4" dependencies: - "@babel/helper-get-function-arity" "7.0.0-rc.2" - "@babel/template" "7.0.0-rc.2" - "@babel/types" "7.0.0-rc.2" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.0.0" + "@babel/types" "^7.0.0" "@babel/helper-get-function-arity@7.0.0-beta.44": version "7.0.0-beta.44" @@ -56,11 +56,11 @@ dependencies: "@babel/types" "7.0.0-beta.44" -"@babel/helper-get-function-arity@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-rc.2.tgz#323cb82e2d805b40c0c36be1dfcb8ffcbd0434f3" +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" dependencies: - "@babel/types" "7.0.0-rc.2" + "@babel/types" "^7.0.0" "@babel/helper-split-export-declaration@7.0.0-beta.44": version "7.0.0-beta.44" @@ -68,11 +68,11 @@ dependencies: "@babel/types" "7.0.0-beta.44" -"@babel/helper-split-export-declaration@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-rc.2.tgz#726b2dec4e46baeab32db67caa6e88b6521464f8" +"@babel/helper-split-export-declaration@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" dependencies: - "@babel/types" "7.0.0-rc.2" + "@babel/types" "^7.0.0" "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" @@ -82,17 +82,17 @@ esutils "^2.0.2" js-tokens "^3.0.0" -"@babel/highlight@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-rc.2.tgz#0af688a69e3709d9cf392e1837cda18c08d34d4f" +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0-rc.2.tgz#a98c01af5834e71d48a5108e3aeeee333cdf26c4" +"@babel/parser@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0.tgz#697655183394facffb063437ddf52c0277698775" "@babel/template@7.0.0-beta.44": version "7.0.0-beta.44" @@ -103,13 +103,13 @@ babylon "7.0.0-beta.44" lodash "^4.2.0" -"@babel/template@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-rc.2.tgz#53f6be6c1336ddc7744625c9bdca9d10be5d5d72" +"@babel/template@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0.tgz#c2bc9870405959c89a9c814376a2ecb247838c80" dependencies: - "@babel/code-frame" "7.0.0-rc.2" - "@babel/parser" "7.0.0-rc.2" - "@babel/types" "7.0.0-rc.2" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/types" "^7.0.0" "@babel/traverse@7.0.0-beta.44": version "7.0.0-beta.44" @@ -126,16 +126,16 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-rc.2.tgz#6e54ebe82aa1b3b3cf5ec05594bc14d7c59c9766" - dependencies: - "@babel/code-frame" "7.0.0-rc.2" - "@babel/generator" "7.0.0-rc.2" - "@babel/helper-function-name" "7.0.0-rc.2" - "@babel/helper-split-export-declaration" "7.0.0-rc.2" - "@babel/parser" "7.0.0-rc.2" - "@babel/types" "7.0.0-rc.2" +"@babel/traverse@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0.tgz#b1fe9b6567fdf3ab542cfad6f3b31f854d799a61" + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.0.0" + "@babel/helper-function-name" "^7.0.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/types" "^7.0.0" debug "^3.1.0" globals "^11.1.0" lodash "^4.17.10" @@ -148,9 +148,9 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-rc.2": - version "7.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-rc.2.tgz#8e025b78764cee8751823e308558a3ca144ebd9d" +"@babel/types@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" dependencies: esutils "^2.0.2" lodash "^4.17.10" From dae75e18532972abf6bd45ad4fb43101aca1b275 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 27 Aug 2018 18:09:21 -0400 Subject: [PATCH 662/965] 9.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f4ca955af68b..2e5fbc206c92 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "9.0.0-beta.3", + "version": "9.0.0", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 990ea0f1ae78ed61c77f3db4b0a57b22e0a36f72 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 25 Sep 2018 13:07:46 -0500 Subject: [PATCH 663/965] Drop old monkeypatching behavior (babel/babel-eslint#689) An alternative to adding a direct dep on estraverse (https://github.com/babel/babel-eslint/pull/685), let's just drop the old monkeypatching behavior. Closes babel/babel-eslint#685, Closes babel/babel-eslint#680 --- eslint/babel-eslint-parser/lib/index.js | 5 +- .../lib/parse-with-patch.js | 9 - .../lib/patch-eslint-scope.js | 374 ------------------ eslint/babel-eslint-parser/package.json | 3 +- .../test/fixtures/use-eslint-old.js | 12 - .../babel-eslint-parser/test/integration.js | 1 + eslint/babel-eslint-parser/yarn.lock | 50 +-- 7 files changed, 7 insertions(+), 447 deletions(-) delete mode 100644 eslint/babel-eslint-parser/lib/parse-with-patch.js delete mode 100644 eslint/babel-eslint-parser/lib/patch-eslint-scope.js delete mode 100644 eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index c4655280afad..9e527d26d7f8 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -11,10 +11,7 @@ exports.parseForESLint = function(code, options) { options.allowImportExportEverywhere = options.allowImportExportEverywhere || false; - if (options.eslintVisitorKeys && options.eslintScopeManager) { - return require("./parse-with-scope")(code, options); - } - return { ast: require("./parse-with-patch")(code, options) }; + return require("./parse-with-scope")(code, options); }; exports.parseNoPatch = function(code, options) { diff --git a/eslint/babel-eslint-parser/lib/parse-with-patch.js b/eslint/babel-eslint-parser/lib/parse-with-patch.js deleted file mode 100644 index ba1b95b5b107..000000000000 --- a/eslint/babel-eslint-parser/lib/parse-with-patch.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; - -var parse = require("./parse"); -var patchEscope = require("./patch-eslint-scope"); - -module.exports = function(code, options) { - patchEscope(options); - return parse(code, options); -}; diff --git a/eslint/babel-eslint-parser/lib/patch-eslint-scope.js b/eslint/babel-eslint-parser/lib/patch-eslint-scope.js deleted file mode 100644 index 2bf2b350ff03..000000000000 --- a/eslint/babel-eslint-parser/lib/patch-eslint-scope.js +++ /dev/null @@ -1,374 +0,0 @@ -"use strict"; - -var Module = require("module"); -var path = require("path"); -var t = require("@babel/types"); - -function getModules() { - try { - // avoid importing a local copy of eslint, try to find a peer dependency - var eslintLoc = Module._resolveFilename("eslint", module.parent); - } catch (err) { - try { - // avoids breaking in jest where module.parent is undefined - eslintLoc = require.resolve("eslint"); - } catch (err) { - throw new ReferenceError("couldn't resolve eslint"); - } - } - - // get modules relative to what eslint will load - var eslintMod = new Module(eslintLoc); - eslintMod.filename = eslintLoc; - eslintMod.paths = Module._nodeModulePaths(path.dirname(eslintLoc)); - - try { - var escope = eslintMod.require("eslint-scope"); - var Definition = eslintMod.require("eslint-scope/lib/definition") - .Definition; - var referencer = eslintMod.require("eslint-scope/lib/referencer"); - } catch (err) { - escope = eslintMod.require("escope"); - Definition = eslintMod.require("escope/lib/definition").Definition; - referencer = eslintMod.require("escope/lib/referencer"); - } - - var estraverse = eslintMod.require("estraverse"); - - if (referencer.__esModule) referencer = referencer.default; - - return { - Definition, - escope, - estraverse, - referencer, - }; -} - -function monkeypatch(modules) { - var Definition = modules.Definition; - var escope = modules.escope; - var estraverse = modules.estraverse; - var referencer = modules.referencer; - - Object.assign(estraverse.VisitorKeys, t.VISITOR_KEYS); - estraverse.VisitorKeys.MethodDefinition.push("decorators"); - estraverse.VisitorKeys.Property.push("decorators"); - - // if there are decorators, then visit each - function visitDecorators(node) { - if (!node.decorators) { - return; - } - for (var i = 0; i < node.decorators.length; i++) { - if (node.decorators[i].expression) { - this.visit(node.decorators[i]); - } - } - } - - // iterate through part of t.VISITOR_KEYS - var flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ - "ArrayPattern", - "ClassDeclaration", - "ClassExpression", - "FunctionDeclaration", - "FunctionExpression", - "Identifier", - "ObjectPattern", - "RestElement", - ]); - var visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { - var value = t.VISITOR_KEYS[key]; - if (flowFlippedAliasKeys.indexOf(value) === -1) { - acc[key] = value; - } - return acc; - }, {}); - - var propertyTypes = { - // loops - callProperties: { type: "loop", values: ["value"] }, - indexers: { type: "loop", values: ["key", "value"] }, - properties: { type: "loop", values: ["argument", "value"] }, - types: { type: "loop" }, - params: { type: "loop" }, - // single property - argument: { type: "single" }, - elementType: { type: "single" }, - qualification: { type: "single" }, - rest: { type: "single" }, - returnType: { type: "single" }, - // others - typeAnnotation: { type: "typeAnnotation" }, - typeParameters: { type: "typeParameters" }, - id: { type: "id" }, - }; - - function visitTypeAnnotation(node) { - // get property to check (params, id, etc...) - var visitorValues = visitorKeysMap[node.type]; - if (!visitorValues) { - return; - } - - // can have multiple properties - for (var i = 0; i < visitorValues.length; i++) { - var visitorValue = visitorValues[i]; - var propertyType = propertyTypes[visitorValue]; - var nodeProperty = node[visitorValue]; - // check if property or type is defined - if (propertyType == null || nodeProperty == null) { - continue; - } - if (propertyType.type === "loop") { - for (var j = 0; j < nodeProperty.length; j++) { - if (Array.isArray(propertyType.values)) { - for (var k = 0; k < propertyType.values.length; k++) { - var loopPropertyNode = nodeProperty[j][propertyType.values[k]]; - if (loopPropertyNode) { - checkIdentifierOrVisit.call(this, loopPropertyNode); - } - } - } else { - checkIdentifierOrVisit.call(this, nodeProperty[j]); - } - } - } else if (propertyType.type === "single") { - checkIdentifierOrVisit.call(this, nodeProperty); - } else if (propertyType.type === "typeAnnotation") { - visitTypeAnnotation.call(this, node.typeAnnotation); - } else if (propertyType.type === "typeParameters") { - for (var l = 0; l < node.typeParameters.params.length; l++) { - checkIdentifierOrVisit.call(this, node.typeParameters.params[l]); - } - } else if (propertyType.type === "id") { - if (node.id.type === "Identifier") { - checkIdentifierOrVisit.call(this, node.id); - } else { - visitTypeAnnotation.call(this, node.id); - } - } - } - } - - function checkIdentifierOrVisit(node) { - if (node.typeAnnotation) { - visitTypeAnnotation.call(this, node.typeAnnotation); - } else if (node.type === "Identifier") { - this.visit(node); - } else { - visitTypeAnnotation.call(this, node); - } - } - - function nestTypeParamScope(manager, node) { - var parentScope = manager.__currentScope; - var scope = new escope.Scope( - manager, - "type-parameters", - parentScope, - node, - false - ); - manager.__nestScope(scope); - for (var j = 0; j < node.typeParameters.params.length; j++) { - var name = node.typeParameters.params[j]; - scope.__define(name, new Definition("TypeParameter", name, name)); - if (name.typeAnnotation) { - checkIdentifierOrVisit.call(this, name); - } - } - scope.__define = function() { - return parentScope.__define.apply(parentScope, arguments); - }; - return scope; - } - - // visit decorators that are in: ClassDeclaration / ClassExpression - var visitClass = referencer.prototype.visitClass; - referencer.prototype.visitClass = function(node) { - visitDecorators.call(this, node); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - // visit flow type: ClassImplements - if (node.implements) { - for (var i = 0; i < node.implements.length; i++) { - checkIdentifierOrVisit.call(this, node.implements[i]); - } - } - if (node.superTypeParameters) { - for (var k = 0; k < node.superTypeParameters.params.length; k++) { - checkIdentifierOrVisit.call(this, node.superTypeParameters.params[k]); - } - } - visitClass.call(this, node); - if (typeParamScope) { - this.close(node); - } - }; - - // visit decorators that are in: Property / MethodDefinition - var visitProperty = referencer.prototype.visitProperty; - referencer.prototype.visitProperty = function(node) { - if (node.value && node.value.type === "TypeCastExpression") { - visitTypeAnnotation.call(this, node.value); - } - visitDecorators.call(this, node); - visitProperty.call(this, node); - }; - - function visitClassProperty(node) { - if (node.typeAnnotation) { - visitTypeAnnotation.call(this, node.typeAnnotation); - } - this.visitProperty(node); - } - - // visit ClassProperty as a Property. - referencer.prototype.ClassProperty = visitClassProperty; - - // visit ClassPrivateProperty as a Property. - referencer.prototype.ClassPrivateProperty = visitClassProperty; - - // visit OptionalMemberExpression as a MemberExpression. - referencer.prototype.OptionalMemberExpression = - referencer.prototype.MemberExpression; - - // visit flow type in FunctionDeclaration, FunctionExpression, ArrowFunctionExpression - var visitFunction = referencer.prototype.visitFunction; - referencer.prototype.visitFunction = function(node) { - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (node.returnType) { - checkIdentifierOrVisit.call(this, node.returnType); - } - // only visit if function parameters have types - if (node.params) { - for (var i = 0; i < node.params.length; i++) { - var param = node.params[i]; - if (param.typeAnnotation) { - checkIdentifierOrVisit.call(this, param); - } else if (t.isAssignmentPattern(param)) { - if (param.left.typeAnnotation) { - checkIdentifierOrVisit.call(this, param.left); - } - } - } - } - // set ArrayPattern/ObjectPattern visitor keys back to their original. otherwise - // escope will traverse into them and include the identifiers within as declarations - estraverse.VisitorKeys.ObjectPattern = ["properties"]; - estraverse.VisitorKeys.ArrayPattern = ["elements"]; - visitFunction.call(this, node); - // set them back to normal... - estraverse.VisitorKeys.ObjectPattern = t.VISITOR_KEYS.ObjectPattern; - estraverse.VisitorKeys.ArrayPattern = t.VISITOR_KEYS.ArrayPattern; - if (typeParamScope) { - this.close(node); - } - }; - - // visit flow type in VariableDeclaration - var variableDeclaration = referencer.prototype.VariableDeclaration; - referencer.prototype.VariableDeclaration = function(node) { - if (node.declarations) { - for (var i = 0; i < node.declarations.length; i++) { - var id = node.declarations[i].id; - var typeAnnotation = id.typeAnnotation; - if (typeAnnotation) { - checkIdentifierOrVisit.call(this, typeAnnotation); - } - } - } - variableDeclaration.call(this, node); - }; - - function createScopeVariable(node, name) { - this.currentScope().variableScope.__define( - name, - new Definition("Variable", name, node, null, null, null) - ); - } - - referencer.prototype.InterfaceDeclaration = function(node) { - createScopeVariable.call(this, node, node.id); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - // TODO: Handle mixins - for (var i = 0; i < node.extends.length; i++) { - visitTypeAnnotation.call(this, node.extends[i]); - } - visitTypeAnnotation.call(this, node.body); - if (typeParamScope) { - this.close(node); - } - }; - - referencer.prototype.TypeAlias = function(node) { - createScopeVariable.call(this, node, node.id); - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (node.right) { - visitTypeAnnotation.call(this, node.right); - } - if (typeParamScope) { - this.close(node); - } - }; - - referencer.prototype.DeclareModule = referencer.prototype.DeclareFunction = referencer.prototype.DeclareVariable = referencer.prototype.DeclareClass = function( - node - ) { - if (node.id) { - createScopeVariable.call(this, node, node.id); - } - - var typeParamScope; - if (node.typeParameters) { - typeParamScope = nestTypeParamScope.call(this, this.scopeManager, node); - } - if (typeParamScope) { - this.close(node); - } - }; - - referencer._babelEslintPatched = true; -} - -// To patch for each call. -var escope = null; -var escopeAnalyze = null; - -module.exports = function(parserOptions) { - // Patch `Referencer.prototype` once. - if (!escope) { - const modules = getModules(); - monkeypatch(modules); - - // Store to patch for each call. - escope = modules.escope; - escopeAnalyze = modules.escope.analyze; - } - - // Patch `escope.analyze` based on the current parserOptions. - escope.analyze = function(ast, opts) { - opts = opts || {}; - opts.ecmaVersion = parserOptions.ecmaVersion; - opts.sourceType = parserOptions.sourceType; - opts.nodejsScope = - ast.sourceType === "script" && - (parserOptions.ecmaFeatures && - parserOptions.ecmaFeatures.globalReturn) === true; - - return escopeAnalyze.call(this, ast, opts); - }; -}; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 2e5fbc206c92..f52170f5277e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -20,7 +20,7 @@ }, "scripts": { "test": "npm run lint && npm run test-only", - "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js && mocha --require test/fixtures/use-eslint-old.js", + "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js", "lint": "eslint index.js babylon-to-espree test", "fix": "eslint index.js babylon-to-espree test --fix", "precommit": "lint-staged", @@ -41,7 +41,6 @@ "dedent": "^0.7.0", "eslint": "npm:eslint@4.19.1", "eslint-config-babel": "^7.0.1", - "eslint-old": "npm:eslint@4.13.1", "eslint-plugin-flowtype": "^2.30.3", "eslint-plugin-import": "^2.8.0", "eslint-plugin-prettier": "^2.1.2", diff --git a/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js b/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js deleted file mode 100644 index e26a39c89d06..000000000000 --- a/eslint/babel-eslint-parser/test/fixtures/use-eslint-old.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict" - -var Module = require('module'); -var originalRequire = Module.prototype.require; - -// Override to eslint-old -Module.prototype.require = function () { - if (arguments[0] === "eslint") { - arguments[0] = "eslint-old"; - } - return originalRequire.apply(this, arguments); -}; diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 8e93631a5aae..09e4af9d6486 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -225,6 +225,7 @@ function strictSuite() { // Strip chalk colors, these are not relevant for the test const stripAnsi = str => str.replace( + // eslint-disable-next-line no-control-regex /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, "" ); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index d6f8fae16604..af0f7387146f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -507,7 +507,7 @@ date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" -debug@3.1.0, debug@^3.0.1, debug@^3.1.0: +debug@3.1.0, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -573,7 +573,7 @@ doctrine@1.5.0: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.2, doctrine@^2.1.0: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -617,48 +617,6 @@ eslint-module-utils@^2.1.1: debug "^2.6.8" pkg-dir "^1.0.0" -"eslint-old@npm:eslint@4.13.1": - version "4.13.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.13.1.tgz#0055e0014464c7eb7878caf549ef2941992b444f" - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.0.1" - doctrine "^2.0.2" - eslint-scope "^3.7.1" - espree "^3.5.2" - esquery "^1.0.0" - estraverse "^4.2.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "^4.0.1" - text-table "~0.2.0" - eslint-plugin-flowtype@^2.30.3: version "2.45.0" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.45.0.tgz#20d8b15d1e1e71ea4e9498e8be3fc62c0752fcbf" @@ -771,7 +729,7 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -2232,7 +2190,7 @@ symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" -table@4.0.2, table@^4.0.1: +table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" dependencies: From 78a2f603ce4bbfa5db3a57ce7ea097842a03eb71 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Sep 2018 14:32:16 -0400 Subject: [PATCH 664/965] Test eslint5, update peerDep (babel/babel-eslint#690) * test against eslint 5 * set peerDep --- eslint/babel-eslint-parser/package.json | 11 +- eslint/babel-eslint-parser/yarn.lock | 343 +++++++++++------------- 2 files changed, 165 insertions(+), 189 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f52170f5277e..ceb3a1d2733a 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -21,8 +21,8 @@ "scripts": { "test": "npm run lint && npm run test-only", "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js", - "lint": "eslint index.js babylon-to-espree test", - "fix": "eslint index.js babylon-to-espree test --fix", + "lint": "eslint lib test", + "fix": "eslint lib test --fix", "precommit": "lint-staged", "preversion": "npm test", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" @@ -36,13 +36,16 @@ "url": "https://github.com/babel/babel-eslint/issues" }, "homepage": "https://github.com/babel/babel-eslint", + "peerDependencies": { + "eslint": ">= 4.12.1" + }, "devDependencies": { "babel-eslint": "^8.2.6", "dedent": "^0.7.0", - "eslint": "npm:eslint@4.19.1", + "eslint": "^5.6.0", "eslint-config-babel": "^7.0.1", "eslint-plugin-flowtype": "^2.30.3", - "eslint-plugin-import": "^2.8.0", + "eslint-plugin-import": "^2.14.0", "eslint-plugin-prettier": "^2.1.2", "espree": "^3.5.2", "husky": "^1.0.0-rc.13", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index af0f7387146f..c3099c04cfff 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -168,30 +168,36 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn-jsx@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" + dependencies: + acorn "^5.0.3" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" +acorn@^5.0.3, acorn@^5.6.0: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + acorn@^5.4.0: version "5.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" -acorn@^5.5.0: - version "5.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.1.tgz#f095829297706a7c9776958c0afc8930a9b9d9d8" - -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" +ajv-keywords@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" -ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" +ajv@^6.0.1, ajv@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" + fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" ansi-escapes@^1.0.0: version "1.4.0" @@ -267,14 +273,6 @@ atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" -babel-code-frame@^6.22.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" - dependencies: - chalk "^1.1.3" - esutils "^2.0.2" - js-tokens "^3.0.2" - babel-eslint@^8.2.6: version "8.2.6" resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.6.tgz#6270d0c73205628067c0f7ae1693a9e797acefd9" @@ -332,7 +330,7 @@ browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" -builtin-modules@^1.0.0, builtin-modules@^1.1.1: +builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -378,9 +376,9 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" ci-info@^1.3.0: version "1.4.0" @@ -426,10 +424,6 @@ cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" @@ -467,14 +461,6 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" - dependencies: - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" @@ -483,10 +469,6 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - cosmiconfig@^5.0.2: version "5.0.6" resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" @@ -495,7 +477,7 @@ cosmiconfig@^5.0.2: js-yaml "^3.9.0" parse-json "^4.0.0" -cross-spawn@^5.0.1, cross-spawn@^5.1.0: +cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" dependencies: @@ -503,6 +485,16 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" @@ -610,9 +602,9 @@ eslint-import-resolver-node@^0.3.1: debug "^2.6.9" resolve "^1.5.0" -eslint-module-utils@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.1.1.tgz#abaec824177613b8a95b299639e1b6facf473449" +eslint-module-utils@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" dependencies: debug "^2.6.8" pkg-dir "^1.0.0" @@ -623,20 +615,20 @@ eslint-plugin-flowtype@^2.30.3: dependencies: lodash "^4.15.0" -eslint-plugin-import@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz#fa1b6ef31fcb3c501c09859c1b86f1fc5b986894" +eslint-plugin-import@^2.14.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" dependencies: - builtin-modules "^1.1.1" contains-path "^0.1.0" debug "^2.6.8" doctrine "1.5.0" eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.1.1" + eslint-module-utils "^2.2.0" has "^1.0.1" - lodash.cond "^4.3.0" + lodash "^4.17.4" minimatch "^3.0.3" read-pkg-up "^2.0.0" + resolve "^1.6.0" eslint-plugin-prettier@^2.1.2: version "2.6.0" @@ -645,59 +637,70 @@ eslint-plugin-prettier@^2.1.2: fast-diff "^1.1.1" jest-docblock "^21.0.0" -eslint-scope@3.7.1, eslint-scope@^3.7.1: +eslint-scope@3.7.1: version "3.7.1" resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -"eslint@npm:eslint@4.19.1": - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" +eslint@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223" dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" + cross-spawn "^6.0.5" debug "^3.1.0" doctrine "^2.1.0" - eslint-scope "^3.7.1" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" + espree "^4.0.0" + esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^2.0.0" functional-red-black-tree "^1.0.1" glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" + globals "^11.7.0" + ignore "^4.0.6" imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" + inquirer "^6.1.0" + is-resolvable "^1.1.0" + js-yaml "^3.12.0" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" + lodash "^4.17.5" + minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" path-is-inside "^1.0.2" pluralize "^7.0.0" progress "^2.0.0" - regexpp "^1.0.1" + regexpp "^2.0.0" require-uncached "^1.0.3" - semver "^5.3.0" + semver "^5.5.1" strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" + strip-json-comments "^2.0.1" + table "^4.0.3" + text-table "^0.2.0" espree@^3.5.2: version "3.5.3" @@ -706,20 +709,20 @@ espree@^3.5.2: acorn "^5.4.0" acorn-jsx "^3.0.0" -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" +espree@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" + acorn "^5.6.0" + acorn-jsx "^4.1.1" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" -esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" dependencies: estraverse "^4.0.0" @@ -778,12 +781,12 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -external-editor@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" +external-editor@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" + chardet "^0.7.0" + iconv-lite "^0.4.24" tmp "^0.0.33" extglob@^2.0.4: @@ -799,9 +802,9 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -fast-deep-equal@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" fast-diff@^1.1.1: version "1.1.2" @@ -925,11 +928,7 @@ glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.0.1: - version "11.3.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" - -globals@^11.1.0: +globals@^11.1.0, globals@^11.7.0: version "11.7.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" @@ -1022,13 +1021,15 @@ husky@^1.0.0-rc.13: run-node "^1.0.0" slash "^2.0.0" -iconv-lite@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + dependencies: + safer-buffer ">= 2.1.2 < 3" -ignore@^3.3.3: - version "3.3.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" imurmurhash@^0.1.4: version "0.1.4" @@ -1051,25 +1052,24 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.3, inherits@~2.0.3: +inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" +inquirer@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" dependencies: ansi-escapes "^3.0.0" chalk "^2.0.0" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^2.0.4" + external-editor "^3.0.0" figures "^2.0.0" - lodash "^4.3.0" + lodash "^4.17.10" mute-stream "0.0.7" run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" + rxjs "^6.1.0" string-width "^2.1.0" strip-ansi "^4.0.0" through "^2.3.6" @@ -1226,7 +1226,7 @@ is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" -is-resolvable@^1.0.0: +is-resolvable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -1238,7 +1238,7 @@ is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" -isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: +isarray@1.0.0, isarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1273,7 +1273,7 @@ jest-validate@^23.5.0: leven "^2.1.0" pretty-format "^23.5.0" -js-tokens@^3.0.0, js-tokens@^3.0.2: +js-tokens@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -1281,20 +1281,13 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" -js-yaml@^3.9.0: +js-yaml@^3.12.0, js-yaml@^3.9.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^3.9.1: - version "3.10.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" @@ -1303,9 +1296,9 @@ json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" @@ -1439,11 +1432,7 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash.cond@^4.3.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" - -lodash@^4.15.0, lodash@^4.3.0: +lodash@^4.15.0: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" @@ -1515,7 +1504,7 @@ mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" -minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: +minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -1581,6 +1570,10 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + normalize-package-data@^2.3.2: version "2.4.0" resolved "http://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -1753,7 +1746,7 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -1826,10 +1819,6 @@ pretty-format@^23.5.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" -process-nextick-args@~2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" - progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" @@ -1838,6 +1827,10 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" @@ -1861,18 +1854,6 @@ read-pkg@^4.0.1: parse-json "^4.0.0" pify "^3.0.0" -readable-stream@^2.2.2: - version "2.3.4" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.4.tgz#c946c3f47fa7d8eabc0b6150f4a12f69a4574071" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.0.3" - util-deprecate "~1.0.1" - regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -1880,9 +1861,9 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab" +regexpp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" repeat-element@^1.1.2: version "1.1.3" @@ -1919,6 +1900,12 @@ resolve@^1.5.0: dependencies: path-parse "^1.0.5" +resolve@^1.6.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + dependencies: + path-parse "^1.0.5" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -1953,40 +1940,34 @@ run-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - rxjs@^6.1.0: version "6.2.2" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" dependencies: tslib "^1.9.0" -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" - safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" dependencies: ret "~0.1.10" +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" -"semver@2 || 3 || 4 || 5", semver@^5.3.0: +"semver@2 || 3 || 4 || 5": version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@^5.5.0, semver@^5.5.1: + version "5.5.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" + set-value@^0.4.3: version "0.4.3" resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" @@ -2132,12 +2113,6 @@ string-width@^2.1.0, string-width@^2.1.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" -string_decoder@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" - dependencies: - safe-buffer "~5.1.0" - stringify-object@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" @@ -2166,7 +2141,7 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2190,18 +2165,18 @@ symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" +table@^4.0.3: + version "4.0.3" + resolved "http://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" + ajv "^6.0.1" + ajv-keywords "^3.0.0" chalk "^2.1.0" lodash "^4.17.4" slice-ansi "1.0.0" string-width "^2.1.1" -text-table@~0.2.0: +text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -2255,10 +2230,6 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" @@ -2275,6 +2246,12 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + dependencies: + punycode "^2.1.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -2283,10 +2260,6 @@ use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - validate-npm-package-license@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" From 22fa8e6f20f401a46d426d3b6848b3be97997151 Mon Sep 17 00:00:00 2001 From: Joa Ebert Date: Tue, 25 Sep 2018 20:39:43 +0200 Subject: [PATCH 665/965] Treat type alias declarationlike function declaration (babel/babel-eslint#584) A type alias shouldn't trigger a no-use-before-define warning just like a function declaration. Cyclic type dependencies are common when using flow. For instance: type Node = { head: T; tail: Node } Fixes babel/babel-eslint#485 --- .../lib/babylon-to-espree/toAST.js | 9 +++++++++ eslint/babel-eslint-parser/test/non-regression.js | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js index b3da41f0cb06..88349d7cd09a 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js @@ -72,6 +72,15 @@ var astTransformVisitor = { delete node.bound; } + if (path.isTypeAlias()) { + node.type = "FunctionDeclaration"; + node.generator = false; + node.async = false; + node.expression = false; + node.params = []; + node.body = node.right; + } + // flow: prevent "no-undef" // for "Component" in: "let x: React.Component" if (path.isQualifiedTypeIdentifier()) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4c43b29f3f71..15c0a2824035 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1091,6 +1091,18 @@ describe("verify", () => { { "no-unused-vars": 1, "no-undef": 1 } ); }); + + it("cyclic type dependencies #485", () => { + verifyAndAssertMessages( + unpad(` + type Node = { head: T, tail: Node }; + type A = B[]; + type B = number; + `), + { "no-use-before-define": 1 }, + [] + ); + }); }); it("class usage", () => { From 742aa412a7b7f10117d013a6cb0d97860587c591 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Sep 2018 15:29:14 -0400 Subject: [PATCH 666/965] test value should be switched --- eslint/babel-eslint-parser/test/non-regression.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 15c0a2824035..1a24f9d7055b 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1092,14 +1092,14 @@ describe("verify", () => { ); }); - it("cyclic type dependencies #485", () => { + it("cyclic type dependencies should not error #485", () => { verifyAndAssertMessages( unpad(` type Node = { head: T, tail: Node }; type A = B[]; type B = number; `), - { "no-use-before-define": 1 }, + { "no-use-before-define": 0 }, [] ); }); From 9adb82e68a0001628a1256370695279eebbb3a96 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Sep 2018 15:32:56 -0400 Subject: [PATCH 667/965] 10.0.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ceb3a1d2733a..04f99dd820a2 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "9.0.0", + "version": "10.0.0", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From e56b342e593677b5c6a6c6f606d4299558539422 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 27 Sep 2018 10:29:29 -0400 Subject: [PATCH 668/965] Revert babel/babel-eslint#584 (babel/babel-eslint#697) * Revert "Treat type alias declarationlike function declaration (babel/babel-eslint#584)" This reverts commit 020d012c554913fea137f4129798ce31a4896dfe. --- .../lib/babylon-to-espree/toAST.js | 9 --------- eslint/babel-eslint-parser/test/non-regression.js | 12 ------------ 2 files changed, 21 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js index 88349d7cd09a..b3da41f0cb06 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js @@ -72,15 +72,6 @@ var astTransformVisitor = { delete node.bound; } - if (path.isTypeAlias()) { - node.type = "FunctionDeclaration"; - node.generator = false; - node.async = false; - node.expression = false; - node.params = []; - node.body = node.right; - } - // flow: prevent "no-undef" // for "Component" in: "let x: React.Component" if (path.isQualifiedTypeIdentifier()) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 1a24f9d7055b..4c43b29f3f71 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1091,18 +1091,6 @@ describe("verify", () => { { "no-unused-vars": 1, "no-undef": 1 } ); }); - - it("cyclic type dependencies should not error #485", () => { - verifyAndAssertMessages( - unpad(` - type Node = { head: T, tail: Node }; - type A = B[]; - type B = number; - `), - { "no-use-before-define": 0 }, - [] - ); - }); }); it("class usage", () => { From 40d9bb3a773ed511a972bdbb256c43766b589e4e Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 27 Sep 2018 10:29:57 -0400 Subject: [PATCH 669/965] 10.0.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 04f99dd820a2..5d3486296fae 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "10.0.0", + "version": "10.0.1", "description": "Custom parser for ESLint", "main": "lib/index.js", "files": [ From 22a1681e11cde120ffc124a5c34b356afd8eddf1 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Tue, 30 Oct 2018 14:48:37 -0500 Subject: [PATCH 670/965] Merge pull request babel/babel-eslint#706 from kaicataldo/es6 Update ESLint config --- eslint/babel-eslint-parser/.eslintrc.js | 18 ++++++++--- eslint/babel-eslint-parser/.npmrc | 1 + .../lib/babylon-to-espree/attachComments.js | 16 +++++----- .../lib/babylon-to-espree/convertComments.js | 4 +-- .../lib/babylon-to-espree/index.js | 8 ++--- .../lib/babylon-to-espree/toAST.js | 16 +++++----- .../lib/babylon-to-espree/toToken.js | 4 +-- .../lib/babylon-to-espree/toTokens.js | 4 +-- eslint/babel-eslint-parser/lib/parse.js | 14 ++++----- .../babel-eslint-parser/test/babel-eslint.js | 30 ++++++++++--------- .../test/fixtures/assert-implements-ast.js | 14 +++++---- .../test/fixtures/preprocess-to-patch.js | 1 + .../babel-eslint-parser/test/integration.js | 26 ++++++++-------- .../test/non-regression.js | 14 ++++----- .../test/z_parser-for-eslint-after-patched.js | 2 +- 15 files changed, 95 insertions(+), 77 deletions(-) create mode 100644 eslint/babel-eslint-parser/.npmrc diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js index 64dc12e693fe..169516cb3f84 100644 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -5,12 +5,22 @@ module.exports = { "prettier" ], rules: { - "no-var": 0, - "max-len": 0, + "max-len": "off", + "strict": "error", "prettier/prettier": "error", }, env: { node: true, - mocha: true - } + }, + parserOptions: { + sourceType: "script", + }, + overrides: [ + { + files: ["test/**/*"], + env: { + mocha: true + } + } + ] }; diff --git a/eslint/babel-eslint-parser/.npmrc b/eslint/babel-eslint-parser/.npmrc new file mode 100644 index 000000000000..c1ca392feaa4 --- /dev/null +++ b/eslint/babel-eslint-parser/.npmrc @@ -0,0 +1 @@ +package-lock = false diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js index 8c608a45ad94..6e198753845f 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js @@ -3,8 +3,8 @@ // comment fixes module.exports = function(ast, comments, tokens) { if (comments.length) { - var firstComment = comments[0]; - var lastComment = comments[comments.length - 1]; + const firstComment = comments[0]; + const lastComment = comments[comments.length - 1]; // fixup program start if (!tokens.length) { // if no tokens, the program starts at the end of the last comment @@ -17,7 +17,7 @@ module.exports = function(ast, comments, tokens) { } } else if (firstComment.start < tokens[0].start) { // if there are comments before the first token, the program starts at the first token - var token = tokens[0]; + const token = tokens[0]; // ast.start = token.start; // ast.loc.start.line = token.loc.start.line; // ast.loc.start.column = token.loc.start.column; @@ -25,18 +25,18 @@ module.exports = function(ast, comments, tokens) { // estraverse do not put leading comments on first node when the comment // appear before the first token if (ast.body.length) { - var node = ast.body[0]; + const node = ast.body[0]; node.leadingComments = []; - var firstTokenStart = token.start; - var len = comments.length; - for (var i = 0; i < len && comments[i].start < firstTokenStart; i++) { + const firstTokenStart = token.start; + const len = comments.length; + for (let i = 0; i < len && comments[i].start < firstTokenStart; i++) { node.leadingComments.push(comments[i]); } } } // fixup program end if (tokens.length) { - var lastToken = tokens[tokens.length - 1]; + const lastToken = tokens[tokens.length - 1]; if (lastComment.end > lastToken.end) { // If there is a comment after the last token, the program ends at the // last token and not the comment diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js index 17d711737294..57b0e44d4d54 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js @@ -1,8 +1,8 @@ "use strict"; module.exports = function(comments) { - for (var i = 0; i < comments.length; i++) { - var comment = comments[i]; + for (let i = 0; i < comments.length; i++) { + const comment = comments[i]; if (comment.type === "CommentBlock") { comment.type = "Block"; } else if (comment.type === "CommentLine") { diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js index 6d6e12bfc086..c0fdf323a884 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js @@ -1,9 +1,9 @@ "use strict"; -var attachComments = require("./attachComments"); -var convertComments = require("./convertComments"); -var toTokens = require("./toTokens"); -var toAST = require("./toAST"); +const attachComments = require("./attachComments"); +const convertComments = require("./convertComments"); +const toTokens = require("./toTokens"); +const toAST = require("./toAST"); module.exports = function(ast, traverse, tt, code) { // convert tokens diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js index b3da41f0cb06..e375f69dd1bd 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js @@ -1,10 +1,10 @@ "use strict"; -var t = require("@babel/types"); -var convertComments = require("./convertComments"); +const t = require("@babel/types"); +const convertComments = require("./convertComments"); module.exports = function(ast, traverse, code) { - var state = { source: code }; + const state = { source: code }; // Monkey patch visitor keys in order to be able to traverse the estree nodes t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; @@ -22,10 +22,10 @@ module.exports = function(ast, traverse, code) { delete t.VISITOR_KEYS.MethodDefinition; }; -var astTransformVisitor = { +const astTransformVisitor = { noScope: true, enter(path) { - var node = path.node; + const node = path.node; // private var to track original node type node._babelType = node.type; @@ -44,7 +44,7 @@ var astTransformVisitor = { } }, exit(path) { - var node = path.node; + const node = path.node; if (path.isJSXText()) { node.type = "Literal"; @@ -98,8 +98,8 @@ var astTransformVisitor = { // template string range fixes if (path.isTemplateLiteral()) { - for (var j = 0; j < node.quasis.length; j++) { - var q = node.quasis[j]; + for (let j = 0; j < node.quasis.length; j++) { + const q = node.quasis[j]; q.range[0] -= 1; if (q.tail) { q.range[1] += 1; diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js index 44c73529a111..3e0ba453c9fb 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js @@ -1,7 +1,7 @@ "use strict"; module.exports = function(token, tt, source) { - var type = token.type; + const type = token.type; token.range = [token.start, token.end]; if (type === tt.name) { @@ -72,7 +72,7 @@ module.exports = function(token, tt, source) { token.value = source.slice(token.start, token.end); } else if (type === tt.regexp) { token.type = "RegularExpression"; - var value = token.value; + const value = token.value; token.regex = { pattern: value.pattern, flags: value.flags, diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js index bb30819bacf7..2927c4b01123 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js @@ -1,7 +1,7 @@ "use strict"; -var convertTemplateType = require("./convertTemplateType"); -var toToken = require("./toToken"); +const convertTemplateType = require("./convertTemplateType"); +const toToken = require("./toToken"); module.exports = function(tokens, tt, code) { return convertTemplateType(tokens, tt) diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index b23b9dc9fc75..0817df4b0783 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,16 +1,16 @@ "use strict"; -var babylonToEspree = require("./babylon-to-espree"); -var parse = require("@babel/parser").parse; -var tt = require("@babel/parser").tokTypes; -var traverse = require("@babel/traverse").default; -var codeFrameColumns = require("@babel/code-frame").codeFrameColumns; +const babylonToEspree = require("./babylon-to-espree"); +const parse = require("@babel/parser").parse; +const tt = require("@babel/parser").tokTypes; +const traverse = require("@babel/traverse").default; +const codeFrameColumns = require("@babel/code-frame").codeFrameColumns; module.exports = function(code, options) { const legacyDecorators = options.ecmaFeatures && options.ecmaFeatures.legacyDecorators; - var opts = { + const opts = { codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, sourceType: options.sourceType, allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree @@ -51,7 +51,7 @@ module.exports = function(code, options) { ], }; - var ast; + let ast; try { ast = parse(code, opts); } catch (err) { diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index 99b03f25c7ea..ce270f113b13 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,10 +1,12 @@ -var assert = require("assert"); -var babelEslint = require(".."); -var espree = require("espree"); -var escope = require("eslint-scope"); -var util = require("util"); -var unpad = require("dedent"); -var assertImplementsAST = require("./fixtures/assert-implements-ast"); +"use strict"; + +const assert = require("assert"); +const babelEslint = require(".."); +const espree = require("espree"); +const escope = require("eslint-scope"); +const util = require("util"); +const unpad = require("dedent"); +const assertImplementsAST = require("./fixtures/assert-implements-ast"); function lookup(obj, keypath, backwardsDepth) { if (!keypath) { @@ -21,7 +23,7 @@ function lookup(obj, keypath, backwardsDepth) { function parseAndAssertSame(code) { code = unpad(code); - var esAST = espree.parse(code, { + const esAST = espree.parse(code, { ecmaFeatures: { // enable JSX parsing jsx: true, @@ -40,14 +42,14 @@ function parseAndAssertSame(code) { ecmaVersion: 2018, sourceType: "module", }); - var babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, }).ast; try { assertImplementsAST(esAST, babylonAST); } catch (err) { - var traversal = err.message.slice(3, err.message.indexOf(":")); + const traversal = err.message.slice(3, err.message.indexOf(":")); err.message += unpad(` espree: ${util.inspect(lookup(esAST, traversal, 2), { @@ -68,7 +70,7 @@ function parseAndAssertSame(code) { describe("babylon-to-espree", () => { describe("compatibility", () => { it("should allow ast.analyze to be called without options", function() { - var esAST = babelEslint.parseForESLint("`test`", { + const esAST = babelEslint.parseForESLint("`test`", { eslintScopeManager: true, eslintVisitorKeys: true, }).ast; @@ -271,7 +273,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the optional chaining operator yet it("optional chaining operator (token)", () => { const code = "foo?.bar"; - var babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, }).ast; @@ -281,7 +283,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the nullish coalescing operator yet it("nullish coalescing operator (token)", () => { const code = "foo ?? bar"; - var babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, }).ast; @@ -291,7 +293,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the pipeline operator yet it("pipeline operator (token)", () => { const code = "foo |> bar"; - var babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, }).ast; diff --git a/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js b/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js index 61e77e21b06b..90dceb0dba26 100644 --- a/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js +++ b/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js @@ -1,3 +1,5 @@ +"use strict" + // Checks if the source ast implements the target ast. Ignores extra keys on source ast module.exports = function assertImplementsAST(target, source, path) { if (!path) { @@ -5,13 +7,13 @@ module.exports = function assertImplementsAST(target, source, path) { } function error(text) { - var err = new Error(`At ${path.join(".")}: ${text}:`); + const err = new Error(`At ${path.join(".")}: ${text}:`); err.depth = path.length + 1; throw err; } - var typeA = target === null ? "null" : typeof target; - var typeB = source === null ? "null" : typeof source; + const typeA = target === null ? "null" : typeof target; + const typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { error( `have different types (${typeA} !== ${typeB}) (${target} !== ${source})` @@ -26,9 +28,9 @@ module.exports = function assertImplementsAST(target, source, path) { .name} !== ${source.constructor.name}` ); } else if (typeA === "object") { - var keysTarget = Object.keys(target); - for (var i in keysTarget) { - var key = keysTarget[i]; + const keysTarget = Object.keys(target); + for (const i in keysTarget) { + const key = keysTarget[i]; path.push(key); assertImplementsAST(target[key], source[key], path); path.pop(); diff --git a/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js b/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js index 1dbfc172a106..8cb4c54fb6de 100644 --- a/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js +++ b/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js @@ -1,4 +1,5 @@ "use strict" + const babelEslint = require("../..") // Apply monkeypatch to eslint-scope. diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 09e4af9d6486..2462cd5d3882 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -1,16 +1,18 @@ -var assert = require("assert"); -var eslint = require("eslint"); -var fs = require("fs"); -var path = require("path"); +"use strict"; -var paths = { +const assert = require("assert"); +const eslint = require("eslint"); +const fs = require("fs"); +const path = require("path"); + +const paths = { fixtures: path.join(__dirname, "fixtures", "rules"), }; -var encoding = "utf8"; -var errorLevel = 2; +const encoding = "utf8"; +const errorLevel = 2; -var baseEslintOpts = { +const baseEslintOpts = { parser: require.resolve(".."), parserOptions: { sourceType: "script", @@ -48,10 +50,10 @@ describe("Rules:", () => { // describe function strictSuite() { - var ruleId = "strict"; + const ruleId = "strict"; describe("when set to 'never'", () => { - var eslintOpts = Object.assign({}, baseEslintOpts, { + const eslintOpts = Object.assign({}, baseEslintOpts, { rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "never"]; @@ -76,7 +78,7 @@ function strictSuite() { // describe describe("when set to 'global'", () => { - var eslintOpts = Object.assign({}, baseEslintOpts, { + const eslintOpts = Object.assign({}, baseEslintOpts, { rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "global"]; @@ -152,7 +154,7 @@ function strictSuite() { // describe describe("when set to 'function'", () => { - var eslintOpts = Object.assign({}, baseEslintOpts, { + const eslintOpts = Object.assign({}, baseEslintOpts, { rules: {}, }); eslintOpts.rules[ruleId] = [errorLevel, "function"]; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 4c43b29f3f71..fc1d3416be88 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1,7 +1,7 @@ -/*eslint-env mocha*/ "use strict"; -var eslint = require("eslint"); -var unpad = require("dedent"); + +const eslint = require("eslint"); +const unpad = require("dedent"); function verifyAndAssertMessagesWithSpecificESLint( code, @@ -11,7 +11,7 @@ function verifyAndAssertMessagesWithSpecificESLint( overrideConfig, linter ) { - var config = { + const config = { parser: require.resolve(".."), rules, env: { @@ -30,12 +30,12 @@ function verifyAndAssertMessagesWithSpecificESLint( }; if (overrideConfig) { - for (var key in overrideConfig) { + for (const key in overrideConfig) { config[key] = overrideConfig[key]; } } - var messages = linter.verify(code, config); + const messages = linter.verify(code, config); if (messages.length !== expectedMessages.length) { throw new Error( @@ -46,7 +46,7 @@ function verifyAndAssertMessagesWithSpecificESLint( } messages.forEach((message, i) => { - var formatedMessage = `${message.line}:${message.column} ${ + const formatedMessage = `${message.line}:${message.column} ${ message.message }${message.ruleId ? ` ${message.ruleId}` : ""}`; if (formatedMessage !== expectedMessages[i]) { diff --git a/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js b/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js index a7d6882d351e..265fb5f04009 100644 --- a/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js +++ b/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js @@ -4,7 +4,7 @@ const eslint = require("eslint"); const assert = require("assert"); const babelEslint = require(".."); const espree = require("espree"); -var assertImplementsAST = require("./fixtures/assert-implements-ast"); +const assertImplementsAST = require("./fixtures/assert-implements-ast"); describe("https://github.com/babel/babel-eslint/issues/558", () => { it("don't crash with eslint-plugin-import", () => { From de38cfc510b6ad8db480e10a369c618eb50d36e6 Mon Sep 17 00:00:00 2001 From: Emerson Laurentino Date: Wed, 7 Nov 2018 16:36:11 -0300 Subject: [PATCH 671/965] fix index path typo (babel/babel-eslint#709) --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 6a4f9085e3ac..26205f38a2ed 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -38,7 +38,7 @@ aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and transformed into code that ESLint can understand. All location info such as line numbers, columns is also retained so you can track down errors with ease. -Basically `babel-eslint` exports an [`index.js`](/index.js) that a linter can use. +Basically `babel-eslint` exports an [`index.js`](/lib/index.js) that a linter can use. It just needs to export a `parse` method that takes in a string of code and outputs an AST. ## Usage From c209725ada5d8ac056c8f1b8ce166a6229b233b4 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 8 Nov 2018 10:43:04 -0500 Subject: [PATCH 672/965] Test Node v11 in CI (babel/babel-eslint#712) --- eslint/babel-eslint-parser/.travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 218432b1103f..21826d3469db 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,6 +1,7 @@ sudo: false language: node_js node_js: + - "11" - "10" - "8" - "6" From bede064c0b58d96b452f437cf9965845b4b5ac41 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 7 Jan 2019 09:55:16 -0500 Subject: [PATCH 673/965] Major: remove parseNoPatch (babel/babel-eslint#733) --- eslint/babel-eslint-parser/lib/index.js | 4 ---- eslint/babel-eslint-parser/test/babel-eslint.js | 9 --------- 2 files changed, 13 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index 9e527d26d7f8..c2611a9d442a 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -13,7 +13,3 @@ exports.parseForESLint = function(code, options) { return require("./parse-with-scope")(code, options); }; - -exports.parseNoPatch = function(code, options) { - return require("./parse")(code, options); -}; diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js index ce270f113b13..1dc611af2692 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -536,12 +536,3 @@ describe("babylon-to-espree", () => { }); }); }); - -describe("Public API", () => { - it("exports a parseNoPatch function", () => { - assertImplementsAST( - espree.parse("foo"), - babelEslint.parseNoPatch("foo", {}) - ); - }); -}); From 47de99e1b864554e0b3e809c8cd2e47bd941605b Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 10 Jan 2019 15:25:00 -0500 Subject: [PATCH 674/965] Use @babel/core#parse (babel/babel-eslint#711) --- eslint/babel-eslint-parser/.eslintignore | 1 + eslint/babel-eslint-parser/.eslintrc.js | 16 +- eslint/babel-eslint-parser/README.md | 140 +-- .../babel-eslint-parser/lib/analyze-scope.js | 2 +- .../lib/babylon-to-espree/toAST.js | 2 +- eslint/babel-eslint-parser/lib/index.js | 21 + eslint/babel-eslint-parser/lib/parse.js | 96 +- .../babel-eslint-parser/lib/visitor-keys.js | 2 +- eslint/babel-eslint-parser/package.json | 52 +- .../babel-eslint-parser/test/babel.config.js | 21 + .../config/babel.config.decorators-legacy.js | 6 + .../assert-implements-ast.js | 7 +- .../test/{ => specs}/babel-eslint.js | 4 +- .../test/{ => specs}/integration.js | 64 +- .../test/{ => specs}/non-regression.js | 17 +- .../z_parser-for-eslint-after-patched.js | 10 +- eslint/babel-eslint-parser/yarn.lock | 962 +++++++++++++++++- 17 files changed, 1144 insertions(+), 279 deletions(-) create mode 100644 eslint/babel-eslint-parser/test/babel.config.js create mode 100644 eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js rename eslint/babel-eslint-parser/test/{fixtures => helpers}/assert-implements-ast.js (89%) rename eslint/babel-eslint-parser/test/{ => specs}/babel-eslint.js (99%) rename eslint/babel-eslint-parser/test/{ => specs}/integration.js (75%) rename eslint/babel-eslint-parser/test/{ => specs}/non-regression.js (99%) rename eslint/babel-eslint-parser/test/{ => specs}/z_parser-for-eslint-after-patched.js (84%) diff --git a/eslint/babel-eslint-parser/.eslintignore b/eslint/babel-eslint-parser/.eslintignore index a843dc44a197..b18b9022cf17 100644 --- a/eslint/babel-eslint-parser/.eslintignore +++ b/eslint/babel-eslint-parser/.eslintignore @@ -1 +1,2 @@ +!.*.js test/fixtures diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js index 169516cb3f84..a8781be62911 100644 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ b/eslint/babel-eslint-parser/.eslintrc.js @@ -1,12 +1,12 @@ +"use strict"; + module.exports = { root: true, extends: "babel", - "plugins": [ - "prettier" - ], + plugins: ["prettier"], rules: { "max-len": "off", - "strict": "error", + strict: "error", "prettier/prettier": "error", }, env: { @@ -19,8 +19,8 @@ module.exports = { { files: ["test/**/*"], env: { - mocha: true - } - } - ] + mocha: true, + }, + }, + ], }; diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 26205f38a2ed..ad8fc01d0d0e 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -3,101 +3,107 @@ **babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -### Why Use babel-eslint +## Breaking change in v11.x.x -You only need to use babel-eslint if you are using types (Flow) or experimental features not supported in ESLint itself yet. Otherwise try the default parser (you don't have to use it just because you are using Babel). +As of the v11.x.x release, babel-eslint now requires Babel as a peer dependency and expects a valid [Babel configuration file](https://babeljs.io/docs/en/configuration) to exist. This ensures that the same Babel configuration is used during both linting and compilation. ---- +## When should I use babel-eslint? -> If there is an issue, first check if it can be reproduced with the regular parser or with the latest versions of `eslint` and `babel-eslint`! +ESLint's default parser and core rules [only suppport the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. babel-eslint is a parser that allows ESLint to run on source code that is transformed by Babel. -For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) babel slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or eslint [gitter](https://gitter.im/eslint/eslint)! - -> Note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. Examples are `globalReturn` and `modules`). - -## Known Issues - -Flow: -> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. -- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) - - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` -- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) - -Modules/strict mode -- `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136) - -Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues -- `no-unused-vars` with jsx - -Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues +**Note:** You only need to use babel-eslint if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). ## How does it work? -ESLint allows custom parsers. This is great but some of the syntax nodes that Babel supports -aren't supported by ESLint. When using this plugin, ESLint is monkeypatched and your code is -transformed into code that ESLint can understand. All location info such as line numbers, +ESLint allows for the use of [custom parsers](https://eslint.org/docs/developer-guide/working-with-custom-parsers). When using this plugin, your code is parsed by Babel's parser (using the configuration specified in your [Babel configuration file](https://babeljs.io/docs/en/configuration)) and the resulting AST is +transformed into an [ESTree](https://github.com/estree/estree)-compliant structure that ESLint can understand. All location info such as line numbers, columns is also retained so you can track down errors with ease. -Basically `babel-eslint` exports an [`index.js`](/lib/index.js) that a linter can use. -It just needs to export a `parse` method that takes in a string of code and outputs an AST. +**Note:** ESLint's core rules do not support experimental syntax and may therefore not work as expected when using babel-eslint. Please use the companion [`eslint-plugin-babel`](https://github.com/babel/eslint-plugin-babel) plugin for core rules that you have issues with. ## Usage -### Supported ESLint versions - -ESLint | babel-eslint ------------- | ------------- -4.x | >= 6.x -3.x | >= 6.x -2.x | >= 6.x -1.x | >= 5.x - -### Install - -Ensure that you have substituted the correct version lock for `eslint` and `babel-eslint` into this command: +### Installation ```sh -$ npm install eslint@4.x babel-eslint@8 --save-dev +$ npm install eslint babel-eslint --save-dev # or -$ yarn add eslint@4.x babel-eslint@8 -D +$ yarn add eslint babel-eslint -D ``` +**Note:** babel-eslint requires `babel/core@>=7.2.0` and a valid Babel configuration file to run. If you do not have this already set up, please see the [Babel Usage Guide](https://babeljs.io/docs/en/usage). + ### Setup -**.eslintrc** +To use babel-eslint, `"babel-eslint"` must be specified as the `parser` in your ESLint configuration file (see [here](https://eslint.org/docs/user-guide/configuring#specifying-parser) for more detailed information). + +**.eslintrc.js** -```json -{ - "parser": "babel-eslint", - "rules": { - "strict": 0 - } -} +```js +module.exports = { + parser: "babel-eslint", +}; ``` -Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rules. +With the parser set, your configuration can be configured as described in the [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) documentation. + +**Note:** The `parserOptions` described in the [official documentation](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) are for the default parser and are not necessarily supported by babel-eslint. Please see the section directly below for supported `parserOptions`. + +### Additional parser configuration -### Configuration +Additional configuration options can be set in your ESLint configuration under the `parserOptions` key. Please note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. -- `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. +- `sourceType` can be set to `"module"`(default) or `"script"` if your code isn't using ECMAScript modules. - `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. -- `codeFrame` (default `true`) can be set to `false` to disable the code frame in the reporter. This is useful since some eslint formatters don't play well with it. - -**.eslintrc** - -```json -{ - "parser": "babel-eslint", - "parserOptions": { - "sourceType": "module", - "allowImportExportEverywhere": false, - "codeFrame": true - } -} +- `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. +- `babelOptions` passes through Babel's configuration [loading](https://babeljs.io/docs/en/options#config-loading-options) and [merging](https://babeljs.io/docs/en/options#config-merging-options) options (for instance, in case of a monorepo). When not defined, babel-eslint will use Babel's default configuration file resolution logic. + +**.eslintrc.js** + +```js +module.exports = { + parser: "babel-eslint", + parserOptions: { + sourceType: "module", + allowImportExportEverywhere: false, + ecmaFeatures: { + globalReturn: false, + }, + babelOptions: { + configFile: "path/to/config.js", + }, + }, +}; ``` ### Run ```sh -$ eslint your-files-here +$ ./node_modules/.bin/eslint yourfile.js ``` + +## Known issues + +Flow: + +> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. + +- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) + - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` +- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) + +Modules/strict mode + +- `no-unused-vars: ["error", { vars: local }]` [#136](https://github.com/babel/babel-eslint/issues/136) + +Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues. + +- `no-unused-vars` with jsx + +Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues. + +## Questions and support + +If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of `eslint` and `babel-eslint`. If it is not reproducible with the default parser, it is most likely an issue with babel-eslint. + +For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) Babel Slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or the ESLint [Gitter](https://gitter.im/eslint/eslint). diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index 9b2a40d6dbf4..aa3431a4cc51 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -1,6 +1,6 @@ "use strict"; -const t = require("@babel/types"); +const t = require("@babel/core").types; const escope = require("eslint-scope"); const Definition = require("eslint-scope/lib/definition").Definition; const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor"); diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js index e375f69dd1bd..2ab165df69ec 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js @@ -1,6 +1,6 @@ "use strict"; -const t = require("@babel/types"); +const t = require("@babel/core").types; const convertComments = require("./convertComments"); module.exports = function(ast, traverse, code) { diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index c2611a9d442a..c9478419f18e 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -1,11 +1,32 @@ "use strict"; +const semver = require("semver"); +const babelCore = require("@babel/core"); +const packageJson = require("../package.json"); + +const CURRENT_BABEL_VERSION = babelCore.version; +const SUPPORTED_BABEL_VERSION_RANGE = + packageJson.peerDependencies["@babel/core"]; +const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies( + CURRENT_BABEL_VERSION, + SUPPORTED_BABEL_VERSION_RANGE +); + exports.parse = function(code, options) { return exports.parseForESLint(code, options).ast; }; exports.parseForESLint = function(code, options) { + if (!IS_RUNNING_SUPPORTED_VERSION) { + throw new Error( + `babel-eslint@${ + packageJson.version + } does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}` + ); + } + options = options || {}; + options.babelOptions = options.babelOptions || {}; options.ecmaVersion = options.ecmaVersion || 2018; options.sourceType = options.sourceType || "module"; options.allowImportExportEverywhere = diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index 0817df4b0783..f6b55a1486ba 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,54 +1,38 @@ "use strict"; const babylonToEspree = require("./babylon-to-espree"); -const parse = require("@babel/parser").parse; -const tt = require("@babel/parser").tokTypes; -const traverse = require("@babel/traverse").default; -const codeFrameColumns = require("@babel/code-frame").codeFrameColumns; +const { parseSync: parse, tokTypes: tt, traverse } = require("@babel/core"); module.exports = function(code, options) { - const legacyDecorators = - options.ecmaFeatures && options.ecmaFeatures.legacyDecorators; - const opts = { - codeFrame: options.hasOwnProperty("codeFrame") ? options.codeFrame : true, sourceType: options.sourceType, - allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree - allowReturnOutsideFunction: true, - allowSuperOutsideMethod: true, - ranges: true, - tokens: true, - plugins: [ - ["flow", { all: true }], - "jsx", - "estree", - "asyncFunctions", - "asyncGenerators", - "classConstructorCall", - "classProperties", - legacyDecorators - ? "decorators-legacy" - : ["decorators", { decoratorsBeforeExport: false }], - "doExpressions", - "exponentiationOperator", - "exportDefaultFrom", - "exportNamespaceFrom", - "functionBind", - "functionSent", - "objectRestSpread", - "trailingFunctionCommas", - "dynamicImport", - "numericSeparator", - "optionalChaining", - "importMeta", - "classPrivateProperties", - "bigInt", - "optionalCatchBinding", - "throwExpressions", - ["pipelineOperator", { proposal: "minimal" }], - "nullishCoalescingOperator", - "logicalAssignment", - ], + filename: options.filePath, + cwd: options.babelOptions.cwd, + root: options.babelOptions.root, + rootMode: options.babelOptions.rootMode, + envName: options.babelOptions.envName, + configFile: options.babelOptions.configFile, + babelrc: options.babelOptions.babelrc, + babelrcRoots: options.babelOptions.babelrcRoots, + extends: options.babelOptions.extends, + env: options.babelOptions.env, + overrides: options.babelOptions.overrides, + test: options.babelOptions.test, + include: options.babelOptions.include, + exclude: options.babelOptions.exclude, + ignore: options.babelOptions.ignore, + only: options.babelOptions.only, + parserOpts: { + allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, + ranges: true, + tokens: true, + plugins: ["estree"], + }, + caller: { + name: "babel-eslint", + }, }; let ast; @@ -58,30 +42,6 @@ module.exports = function(code, options) { if (err instanceof SyntaxError) { err.lineNumber = err.loc.line; err.column = err.loc.column; - - if (opts.codeFrame) { - err.lineNumber = err.loc.line; - err.column = err.loc.column + 1; - - // remove trailing "(LINE:COLUMN)" acorn message and add in esprima syntax error message start - err.message = - "Line " + - err.lineNumber + - ": " + - err.message.replace(/ \((\d+):(\d+)\)$/, "") + - // add codeframe - "\n\n" + - codeFrameColumns( - code, - { - start: { - line: err.lineNumber, - column: err.column, - }, - }, - { highlightCode: true } - ); - } } throw err; diff --git a/eslint/babel-eslint-parser/lib/visitor-keys.js b/eslint/babel-eslint-parser/lib/visitor-keys.js index 921a0bb01657..2ac01887f14c 100644 --- a/eslint/babel-eslint-parser/lib/visitor-keys.js +++ b/eslint/babel-eslint-parser/lib/visitor-keys.js @@ -1,6 +1,6 @@ "use strict"; -const BABEL_VISITOR_KEYS = require("@babel/types").VISITOR_KEYS; +const BABEL_VISITOR_KEYS = require("@babel/core").types.VISITOR_KEYS; const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS; module.exports = Object.assign( diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 5d3486296fae..e43b064a5ed5 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -2,44 +2,56 @@ "name": "babel-eslint", "version": "10.0.1", "description": "Custom parser for ESLint", - "main": "lib/index.js", - "files": [ - "lib" - ], + "author": "Sebastian McKenzie ", + "license": "MIT", "repository": { "type": "git", "url": "https://github.com/babel/babel-eslint.git" }, - "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "^1.0.0" + "bugs": { + "url": "https://github.com/babel/babel-eslint/issues" }, + "homepage": "https://github.com/babel/babel-eslint", "scripts": { "test": "npm run lint && npm run test-only", - "test-only": "mocha && mocha --require test/fixtures/preprocess-to-patch.js", - "lint": "eslint lib test", - "fix": "eslint lib test --fix", + "test-only": "cd test && mocha --require fixtures/preprocess-to-patch.js specs && cd -", + "lint": "eslint .", + "lint-fix": "npm run lint -- --fix", "precommit": "lint-staged", "preversion": "npm test", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, - "author": "Sebastian McKenzie ", - "license": "MIT", "engines": { "node": ">=6" }, - "bugs": { - "url": "https://github.com/babel/babel-eslint/issues" - }, - "homepage": "https://github.com/babel/babel-eslint", + "main": "lib/index.js", + "files": [ + "lib" + ], "peerDependencies": { + "@babel/core": ">=7.2.0", "eslint": ">= 4.12.1" }, + "dependencies": { + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "^1.0.0", + "semver": "^5.6.0" + }, "devDependencies": { + "@babel/core": "^7.2.0", + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-proposal-decorators": "^7.1.2", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-export-namespace-from": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/plugin-syntax-numeric-separator": "^7.0.0", + "@babel/preset-env": "^7.1.5", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-react": "^7.0.0", "babel-eslint": "^8.2.6", "dedent": "^0.7.0", "eslint": "^5.6.0", diff --git a/eslint/babel-eslint-parser/test/babel.config.js b/eslint/babel-eslint-parser/test/babel.config.js new file mode 100644 index 000000000000..4d49158dba90 --- /dev/null +++ b/eslint/babel-eslint-parser/test/babel.config.js @@ -0,0 +1,21 @@ +"use strict"; + +module.exports = { + presets: [ + ["@babel/preset-env", { forceAllTransforms: true }], + ["@babel/preset-flow", { all: true }], + "@babel/preset-react", + ], + plugins: [ + "@babel/plugin-syntax-dynamic-import", + "@babel/plugin-syntax-import-meta", + "@babel/plugin-syntax-export-default-from", + "@babel/plugin-proposal-class-properties", + "@babel/plugin-proposal-nullish-coalescing-operator", + "@babel/plugin-proposal-optional-chaining", + "@babel/plugin-syntax-numeric-separator", + "@babel/plugin-syntax-export-namespace-from", + ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: false }], + ["@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" }], + ], +}; diff --git a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js new file mode 100644 index 000000000000..dbad846412e6 --- /dev/null +++ b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = { + presets: [["@babel/preset-env", { forceAllTransforms: true }]], + plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]], +}; diff --git a/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js similarity index 89% rename from eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js rename to eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js index 90dceb0dba26..892d200c612a 100644 --- a/eslint/babel-eslint-parser/test/fixtures/assert-implements-ast.js +++ b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js @@ -1,4 +1,4 @@ -"use strict" +"use strict"; // Checks if the source ast implements the target ast. Ignores extra keys on source ast module.exports = function assertImplementsAST(target, source, path) { @@ -24,8 +24,9 @@ module.exports = function assertImplementsAST(target, source, path) { target.constructor.name !== source.constructor.name ) { error( - `object have different constructors (${target.constructor - .name} !== ${source.constructor.name}` + `object have different constructors (${target.constructor.name} !== ${ + source.constructor.name + }` ); } else if (typeA === "object") { const keysTarget = Object.keys(target); diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/specs/babel-eslint.js similarity index 99% rename from eslint/babel-eslint-parser/test/babel-eslint.js rename to eslint/babel-eslint-parser/test/specs/babel-eslint.js index 1dc611af2692..becf4e31c590 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/specs/babel-eslint.js @@ -1,12 +1,12 @@ "use strict"; const assert = require("assert"); -const babelEslint = require(".."); +const babelEslint = require("../.."); const espree = require("espree"); const escope = require("eslint-scope"); const util = require("util"); const unpad = require("dedent"); -const assertImplementsAST = require("./fixtures/assert-implements-ast"); +const assertImplementsAST = require("../helpers/assert-implements-ast"); function lookup(obj, keypath, backwardsDepth) { if (!keypath) { diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/specs/integration.js similarity index 75% rename from eslint/babel-eslint-parser/test/integration.js rename to eslint/babel-eslint-parser/test/specs/integration.js index 2462cd5d3882..4e0851d8a42d 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/specs/integration.js @@ -6,14 +6,14 @@ const fs = require("fs"); const path = require("path"); const paths = { - fixtures: path.join(__dirname, "fixtures", "rules"), + fixtures: path.join(__dirname, "..", "fixtures", "rules"), }; const encoding = "utf8"; const errorLevel = 2; const baseEslintOpts = { - parser: require.resolve(".."), + parser: require.resolve("../.."), parserOptions: { sourceType: "script", }, @@ -222,64 +222,4 @@ function strictSuite() { }); // it }); - // describe - describe('When "codeFrame"', () => { - // Strip chalk colors, these are not relevant for the test - const stripAnsi = str => - str.replace( - // eslint-disable-next-line no-control-regex - /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, - "" - ); - - it("should display codeFrame when option is absent", done => { - lint( - { - fixture: ["syntax-error"], - eslint: baseEslintOpts, - }, - (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); - done(); - } - ); - }); - - it("should display codeFrame when option is true", done => { - lint( - { - fixture: ["syntax-error"], - eslint: Object.assign({}, baseEslintOpts, { - parserOptions: { - codeFrame: true, - }, - }), - }, - (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") > -1); - done(); - } - ); - }); - - it("should not display codeFrame when option is false", done => { - lint( - { - fixture: ["syntax-error"], - eslint: Object.assign({}, baseEslintOpts, { - parserOptions: { - codeFrame: false, - }, - }), - }, - (err, report) => { - if (err) return done(err); - assert(stripAnsi(report[0].message).indexOf("^\n 5 |") === -1); - done(); - } - ); - }); - }); } diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/specs/non-regression.js similarity index 99% rename from eslint/babel-eslint-parser/test/non-regression.js rename to eslint/babel-eslint-parser/test/specs/non-regression.js index fc1d3416be88..79754dab5edf 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/specs/non-regression.js @@ -1,6 +1,7 @@ "use strict"; const eslint = require("eslint"); +const path = require("path"); const unpad = require("dedent"); function verifyAndAssertMessagesWithSpecificESLint( @@ -12,20 +13,17 @@ function verifyAndAssertMessagesWithSpecificESLint( linter ) { const config = { - parser: require.resolve(".."), + parser: require.resolve("../.."), rules, env: { node: true, es6: true, }, parserOptions: { - ecmaVersion: 2018, + sourceType, ecmaFeatures: { - jsx: true, - experimentalObjectRestSpread: true, globalReturn: true, }, - sourceType, }, }; @@ -1155,10 +1153,13 @@ describe("verify", () => { ) { const overrideConfig = { parserOptions: { - ecmaFeatures: { - legacyDecorators: true, - }, sourceType, + babelOptions: { + configFile: path.resolve( + __dirname, + "../fixtures/config/babel.config.decorators-legacy.js" + ), + }, }, }; return verifyAndAssertMessages( diff --git a/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js b/eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js similarity index 84% rename from eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js rename to eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js index 265fb5f04009..bc787db34951 100644 --- a/eslint/babel-eslint-parser/test/z_parser-for-eslint-after-patched.js +++ b/eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js @@ -2,17 +2,17 @@ const eslint = require("eslint"); const assert = require("assert"); -const babelEslint = require(".."); +const babelEslint = require("../.."); const espree = require("espree"); -const assertImplementsAST = require("./fixtures/assert-implements-ast"); +const assertImplementsAST = require("../helpers/assert-implements-ast"); describe("https://github.com/babel/babel-eslint/issues/558", () => { it("don't crash with eslint-plugin-import", () => { const engine = new eslint.CLIEngine({ ignore: false }); engine.executeOnFiles([ - "test/fixtures/eslint-plugin-import/a.js", - "test/fixtures/eslint-plugin-import/b.js", - "test/fixtures/eslint-plugin-import/c.js", + "../test/fixtures/eslint-plugin-import/a.js", + "../test/fixtures/eslint-plugin-import/b.js", + "../test/fixtures/eslint-plugin-import/c.js", ]); }); diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index c3099c04cfff..aec76fb40e5f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -14,6 +14,26 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/core@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" + integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.2.2" + "@babel/helpers" "^7.2.0" + "@babel/parser" "^7.2.2" + "@babel/template" "^7.2.2" + "@babel/traverse" "^7.2.2" + "@babel/types" "^7.2.2" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.10" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + "@babel/generator@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" @@ -24,16 +44,77 @@ source-map "^0.5.0" trim-right "^1.0.1" -"@babel/generator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0.tgz#1efd58bffa951dc846449e58ce3a1d7f02d393aa" +"@babel/generator@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.1.5.tgz#615f064d13d95f8f9157c7261f68eddf32ec15b3" + integrity sha512-IO31r62xfMI+wBJVmgx0JR9ZOHty8HkoYpQAjRWUGG9vykBTlGHdArZ8zoFtpUu2gs17K7qTl/TtPpiSi6t+MA== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.1.5" jsesc "^2.5.1" lodash "^4.17.10" source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" + integrity sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg== + dependencies: + "@babel/types" "^7.2.2" + jsesc "^2.5.1" + lodash "^4.17.10" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" + integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-builder-react-jsx@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0.tgz#fa154cb53eb918cf2a9a7ce928e29eb649c5acdb" + integrity sha512-ebJ2JM6NAKW0fQEqN8hOLxK84RbRz9OkUhGS/Xd5u56ejMfVbayJ4+LykERZCOUM6faa6Fp3SZNX3fcT16MKHw== + dependencies: + "@babel/types" "^7.0.0" + esutils "^2.0.0" + +"@babel/helper-call-delegate@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a" + integrity sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ== + dependencies: + "@babel/helper-hoist-variables" "^7.0.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-define-map@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c" + integrity sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/types" "^7.0.0" + lodash "^4.17.10" + +"@babel/helper-explode-assignable-expression@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" + integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== + dependencies: + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + "@babel/helper-function-name@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" @@ -42,12 +123,13 @@ "@babel/template" "7.0.0-beta.44" "@babel/types" "7.0.0-beta.44" -"@babel/helper-function-name@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0.tgz#a68cc8d04420ccc663dd258f9cc41b8261efa2d4" +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== dependencies: "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.0.0" + "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" "@babel/helper-get-function-arity@7.0.0-beta.44": @@ -59,9 +141,91 @@ "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-hoist-variables@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz#46adc4c5e758645ae7a45deb92bab0918c23bb88" + integrity sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w== dependencies: "@babel/types" "^7.0.0" +"@babel/helper-member-expression-to-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" + integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-imports@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" + integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-module-transforms@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" + integrity sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + lodash "^4.17.10" + +"@babel/helper-optimise-call-expression@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" + integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0.tgz#2c1718923b57f9bbe64705ffe5640ac64d9bdb27" + integrity sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg== + dependencies: + lodash "^4.17.10" + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-replace-supers@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz#5fc31de522ec0ef0899dc9b3e7cf6a5dd655f362" + integrity sha512-BvcDWYZRWVuDeXTYZWxekQNO5D4kO55aArwZOTFXw6rlLQA8ZaDicJR1sO47h+HrnCiDFiww0fSPV0d713KBGQ== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-simple-access@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" + integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== + dependencies: + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + "@babel/helper-split-export-declaration@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" @@ -71,9 +235,29 @@ "@babel/helper-split-export-declaration@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-wrap-function@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" + integrity sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA== dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helpers@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" + integrity sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A== + dependencies: + "@babel/template" "^7.1.2" + "@babel/traverse" "^7.1.5" + "@babel/types" "^7.2.0" + "@babel/highlight@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" @@ -90,9 +274,536 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0": +"@babel/parser@^7.1.2", "@babel/parser@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.5.tgz#20b7d5e7e1811ba996f8a868962ea7dd2bfcd2fc" + integrity sha512-WXKf5K5HT6X0kKiCOezJZFljsfxKV1FpU8Tf1A7ZpGvyd/Q4hlrJm2EwoH2onaUq3O4tLDp+4gk0hHPsMyxmOg== + +"@babel/parser@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.2.tgz#37ebdbc88a2e1ebc6c8dd3d35ea9436e3e39e477" + integrity sha512-UNTmQ5cSLDeBGBl+s7JeowkqIHgmFAGBnLDdIzFmUNSuS5JF0XBcN59jsh/vJO/YjfsBqMxhMjoFGmNExmf0FA== + +"@babel/plugin-proposal-async-generator-functions@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" + integrity sha512-Fq803F3Jcxo20MXUSDdmZZXrPe6BWyGcWBPPNB/M7WaUYESKDeKMOGIxEzQOjGSmW/NWb6UaPZrtTB2ekhB/ew== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.0.0" + +"@babel/plugin-proposal-class-properties@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.1.0.tgz#9af01856b1241db60ec8838d84691aa0bd1e8df4" + integrity sha512-/PCJWN+CKt5v1xcGn4vnuu13QDoV+P7NcICP44BoonAJoPSGwVkgrXihFIQGiEjjPlUDBIw1cM7wYFLARS2/hw== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + "@babel/plugin-syntax-class-properties" "^7.0.0" + +"@babel/plugin-proposal-decorators@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.1.2.tgz#79829bd75fced6581ec6c7ab1930e8d738e892e7" + integrity sha512-YooynBO6PmBgHvAd0fl5e5Tq/a0pEC6RqF62ouafme8FzdIVH41Mz/u1dn8fFVm4jzEJ+g/MsOxouwybJPuP8Q== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/plugin-syntax-decorators" "^7.1.0" + +"@babel/plugin-proposal-json-strings@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz#3b4d7b5cf51e1f2e70f52351d28d44fc2970d01e" + integrity sha512-kfVdUkIAGJIVmHmtS/40i/fg/AGnw/rsZBCaapY5yjeO5RA9m165Xbw9KMOu2nqXP5dTFjEjHdfNdoVcHv133Q== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.0.0" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0.tgz#b72ec31adf612d062dc0348316246127a451e45f" + integrity sha512-QIN3UFo1ul4ruAsjIqK43PeXedo1qY74zeGrODJl1KfCGeMc6qJC4rb5Ylml/smzxibqsDeVZGH+TmWHCldRQQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.0.0" + +"@babel/plugin-proposal-object-rest-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz#9a17b547f64d0676b6c9cecd4edf74a82ab85e7e" + integrity sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + +"@babel/plugin-proposal-optional-catch-binding@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz#b610d928fe551ff7117d42c8bb410eec312a6425" + integrity sha512-JPqAvLG1s13B/AuoBjdBYvn38RqW6n1TzrQO839/sIpqLpbnXKacsAgpZHzLD83Sm8SDXMkkrAvEnJ25+0yIpw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + +"@babel/plugin-proposal-optional-chaining@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0.tgz#3d344d4152253379b8758e7d041148e8787c4a9d" + integrity sha512-7x8HLa71OzNiofbQUVakS0Kmg++6a+cXNfS7QKHbbv03SuSaumJyaWsfNgw+T7aqrJlqurYpZqrkPgXu0iZK0w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.0.0" + +"@babel/plugin-proposal-pipeline-operator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.0.0.tgz#ab60169a5c4a598292de59a14f9810d4e47b00b8" + integrity sha512-MN189PDyTMoor/YFh9dk6HpSZLMGHCXRdAhgmzshwcalbgYh5Mkn7Ib17lOo6fmLwHdyQ4GR4yagizfeR2LwQQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-pipeline-operator" "^7.0.0" + +"@babel/plugin-proposal-unicode-property-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz#498b39cd72536cd7c4b26177d030226eba08cd33" + integrity sha512-tM3icA6GhC3ch2SkmSxv7J/hCWKISzwycub6eGsDrFDgukD4dZ/I+x81XgW0YslS6mzNuQ1Cbzh5osjIMgepPQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.2.0" + +"@babel/plugin-syntax-async-generators@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz#bf0891dcdbf59558359d0c626fdc9490e20bc13c" + integrity sha512-im7ged00ddGKAjcZgewXmp1vxSZQQywuQXe2B1A7kajjZmDeY/ekMPmWr9zJgveSaQH0k7BcGrojQhcK06l0zA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-class-properties@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0.tgz#e051af5d300cbfbcec4a7476e37a803489881634" + integrity sha512-cR12g0Qzn4sgkjrbrzWy2GE7m9vMl/sFkqZ3gIpAQdrvPDnLM8180i+ANDFIXfjHo9aqp0ccJlQ0QNZcFUbf9w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-decorators@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.1.0.tgz#2fa7c1a7905a299c9853ebcef340306675f9cbdc" + integrity sha512-uQvRSbgQ0nQg3jsmIixXXDCgSpkBolJ9X7NYThMKCcjvE8dN2uWJUzTUNNAeuKOjARTd+wUQV0ztXpgunZYKzQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-dynamic-import@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0.tgz#6dfb7d8b6c3be14ce952962f658f3b7eb54c33ee" + integrity sha512-Gt9xNyRrCHCiyX/ZxDGOcBnlJl0I3IWicpZRC4CdC0P5a/I07Ya2OAMEBU+J7GmRFVmIetqEYRko6QYRuKOESw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-export-default-from@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.0.0.tgz#084b639bce3d42f3c5bf3f68ccb42220bb2d729d" + integrity sha512-HNnjg/fFFbnuLAqr/Ocp1Y3GB4AjmXcu1xxn3ql3bS2kGrB/qi+Povshb8i3hOkE5jNozzh8r/0/lq1w8oOWbQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-export-namespace-from@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0.tgz#17a7389a1d2571ac4d9b77ea2defa74a930edf5d" + integrity sha512-l314XT1eMa0MWboSmG4BdKukHfSpSpQRenUoZmEpL6hqc5nc1/ddpLETjPB77gZE1dZ9qxy5D3U3UUjjcX2d4g== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-flow@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.0.0.tgz#70638aeaad9ee426bc532e51523cff8ff02f6f17" + integrity sha512-zGcuZWiWWDa5qTZ6iAnpG0fnX/GOu49pGR5PFvkQ9GmKNaSphXQnlNXh/LG20sqWtNrx/eB6krzfEzcwvUyeFA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-import-meta@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.0.0.tgz#ca946b73216c29c39a55ef2d739097fee8a85d69" + integrity sha512-FEoGvhXVAiWzpDjyZIlBGzKyNk/lnRPy7aPke3PjVkiAY0QFsvFfkjUg5diRwVfowBA8SJqvFt0ZoXNSjl70hQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-json-strings@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz#0d259a68090e15b383ce3710e01d5b23f3770cbd" + integrity sha512-UlSfNydC+XLj4bw7ijpldc1uZ/HB84vw+U6BTuqMdIEmz/LDe63w/GHtpQMdXWdqQZFeAI9PjnHe/vDhwirhKA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-jsx@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz#034d5e2b4e14ccaea2e4c137af7e4afb39375ffd" + integrity sha512-PdmL2AoPsCLWxhIr3kG2+F9v4WH06Q3z+NoGVpQgnUNGcagXHq5sB3OXxkSahKq9TLdNMN/AJzFYSOo8UKDMHg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0.tgz#b60931d5a15da82625fff6657c39419969598743" + integrity sha512-oAJmMsAvTSIk9y0sZdU2S/nY44PEUuHN7EzNDMgbuR4e/OwyfR9lSmoBJBZ2lslFZIqhksrTt4i+av7uKfNYDw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-numeric-separator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.0.0.tgz#9594c7ce6ce8089a14d732cb9f6b1eeb047413ba" + integrity sha512-t9RMUPWsFXVeUZxEOhIDkVqYLi1sWOTjxFBAp8wJtaARilvkGlEQvSObd2W5YKicDktINI9XmdV0sB2FZaLOpw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b" + integrity sha512-5A0n4p6bIiVe5OvQPxBnesezsgFJdHhSs3uFSvaPdMqtsovajLZ+G2vZyvNe10EzJBWWo3AcHGKhAFUxqwp2dw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz#886f72008b3a8b185977f7cb70713b45e51ee475" + integrity sha512-Wc+HVvwjcq5qBg1w5RG9o9RVzmCaAg/Vp0erHCKpAYV8La6I94o4GQAmFYNmkzoMO6gzoOSulpKeSSz6mPEoZw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-optional-chaining@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0.tgz#1e6ecba124310b5d3a8fc1e00d50b1c4c2e05e68" + integrity sha512-QXedQsZf8yua1nNrXSePT0TsGSQH9A1iK08m9dhCMdZeJaaxYcQfXdgHWVV6Cp7WE/afPVvSKIsAHK5wP+yxDA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-pipeline-operator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.0.0.tgz#29106ddb293898192780ff48159c77e6f20c1768" + integrity sha512-McK1JV4klGq2r0UZ1SLE2u+u37ElArBcPMGl6JizdgEXD3ttp0dpOB5ZpqpeRHkIgnl46th64UHrFDteQ4P5aw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-arrow-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" + integrity sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz#109e036496c51dd65857e16acab3bafdf3c57811" + integrity sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + +"@babel/plugin-transform-block-scoped-functions@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz#482b3f75103927e37288b3b67b65f848e2aa0d07" + integrity sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-block-scoping@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.1.5.tgz#3e8e0bc9a5104519923302a24f748f72f2f61f37" + integrity sha512-jlYcDrz+5ayWC7mxgpn1Wj8zj0mmjCT2w0mPIMSwO926eXBRxpEgoN/uQVRBfjtr8ayjcmS+xk2G1jaP8JjMJQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + lodash "^4.17.10" + +"@babel/plugin-transform-classes@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz#ab3f8a564361800cbc8ab1ca6f21108038432249" + integrity sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-define-map" "^7.1.0" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.0.0": version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.0.0.tgz#697655183394facffb063437ddf52c0277698775" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz#2fbb8900cd3e8258f2a2ede909b90e7556185e31" + integrity sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-destructuring@^7.0.0": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.1.3.tgz#e69ff50ca01fac6cb72863c544e516c2b193012f" + integrity sha512-Mb9M4DGIOspH1ExHOUnn2UUXFOyVTiX84fXCd+6B5iWrQg/QMeeRmSwpZ9lnjYLSXtZwiw80ytVMr3zue0ucYw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-dotall-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz#73a24da69bc3c370251f43a3d048198546115e58" + integrity sha512-00THs8eJxOJUFVx1w8i1MBF4XH4PsAjKjQ1eqN/uCH3YKwP21GCKfrn6YZFZswbOk9+0cw1zGQPHVc1KBlSxig== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.1.3" + +"@babel/plugin-transform-duplicate-keys@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz#a0601e580991e7cace080e4cf919cfd58da74e86" + integrity sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-exponentiation-operator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz#9c34c2ee7fd77e02779cfa37e403a2e1003ccc73" + integrity sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-flow-strip-types@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.0.0.tgz#c40ced34c2783985d90d9f9ac77a13e6fb396a01" + integrity sha512-WhXUNb4It5a19RsgKKbQPrjmy4yWOY1KynpEbNw7bnd1QTcrT/EIl3MJvnGgpgvrKyKbqX7nUNOJfkpLOnoDKA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.0.0" + +"@babel/plugin-transform-for-of@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" + integrity sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz#29c5550d5c46208e7f730516d41eeddd4affadbb" + integrity sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-literals@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz#2aec1d29cdd24c407359c930cdd89e914ee8ff86" + integrity sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-amd@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz#f9e0a7072c12e296079b5a59f408ff5b97bf86a8" + integrity sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-commonjs@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz#0a9d86451cbbfb29bd15186306897c67f6f9a05c" + integrity sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-simple-access" "^7.1.0" + +"@babel/plugin-transform-modules-systemjs@^7.0.0": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.1.3.tgz#2119a3e3db612fd74a19d88652efbfe9613a5db0" + integrity sha512-PvTxgjxQAq4pvVUZF3mD5gEtVDuId8NtWkJsZLEJZMZAW3TvgQl1pmydLLN1bM8huHFVVU43lf0uvjQj9FRkKw== + dependencies: + "@babel/helper-hoist-variables" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-modules-umd@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz#a29a7d85d6f28c3561c33964442257cc6a21f2a8" + integrity sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig== + dependencies: + "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-new-target@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz#ae8fbd89517fa7892d20e6564e641e8770c3aa4a" + integrity sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-object-super@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz#b1ae194a054b826d8d4ba7ca91486d4ada0f91bb" + integrity sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.1.0" + +"@babel/plugin-transform-parameters@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz#44f492f9d618c9124026e62301c296bf606a7aed" + integrity sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw== + dependencies: + "@babel/helper-call-delegate" "^7.1.0" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-display-name@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.0.0.tgz#93759e6c023782e52c2da3b75eca60d4f10533ee" + integrity sha512-BX8xKuQTO0HzINxT6j/GiCwoJB0AOMs0HmLbEnAvcte8U8rSkNa/eSCAY+l1OA4JnCVq2jw2p6U8QQryy2fTPg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-react-jsx-self@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.0.0.tgz#a84bb70fea302d915ea81d9809e628266bb0bc11" + integrity sha512-pymy+AK12WO4safW1HmBpwagUQRl9cevNX+82AIAtU1pIdugqcH+nuYP03Ja6B+N4gliAaKWAegIBL/ymALPHA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.0.0" + +"@babel/plugin-transform-react-jsx-source@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0.tgz#28e00584f9598c0dd279f6280eee213fa0121c3c" + integrity sha512-OSeEpFJEH5dw/TtxTg4nijl4nHBbhqbKL94Xo/Y17WKIf2qJWeIk/QeXACF19lG1vMezkxqruwnTjVizaW7u7w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.0.0" + +"@babel/plugin-transform-react-jsx@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0.tgz#524379e4eca5363cd10c4446ba163f093da75f3e" + integrity sha512-0TMP21hXsSUjIQJmu/r7RiVxeFrXRcMUigbKu0BLegJK9PkYodHstaszcig7zxXfaBji2LYUdtqIkHs+hgYkJQ== + dependencies: + "@babel/helper-builder-react-jsx" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.0.0" + +"@babel/plugin-transform-regenerator@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1" + integrity sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw== + dependencies: + regenerator-transform "^0.13.3" + +"@babel/plugin-transform-shorthand-properties@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz#85f8af592dcc07647541a0350e8c95c7bf419d15" + integrity sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-spread@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz#93583ce48dd8c85e53f3a46056c856e4af30b49b" + integrity sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-sticky-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz#30a9d64ac2ab46eec087b8530535becd90e73366" + integrity sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + +"@babel/plugin-transform-template-literals@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz#084f1952efe5b153ddae69eb8945f882c7a97c65" + integrity sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-typeof-symbol@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz#4dcf1e52e943e5267b7313bff347fdbe0f81cec9" + integrity sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-unicode-regex@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" + integrity sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.0.0" + regexpu-core "^4.1.3" + +"@babel/preset-env@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.5.tgz#a28b5482ca8bc2f2d0712234d6c690240b92495d" + integrity sha512-pQ+2o0YyCp98XG0ODOHJd9z4GsSoV5jicSedRwCrU8uiqcJahwQiOq0asSZEb/m/lwyu6X5INvH/DSiwnQKncw== + dependencies: + "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-async-generator-functions" "^7.1.0" + "@babel/plugin-proposal-json-strings" "^7.0.0" + "@babel/plugin-proposal-object-rest-spread" "^7.0.0" + "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.0.0" + "@babel/plugin-syntax-async-generators" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + "@babel/plugin-transform-arrow-functions" "^7.0.0" + "@babel/plugin-transform-async-to-generator" "^7.1.0" + "@babel/plugin-transform-block-scoped-functions" "^7.0.0" + "@babel/plugin-transform-block-scoping" "^7.1.5" + "@babel/plugin-transform-classes" "^7.1.0" + "@babel/plugin-transform-computed-properties" "^7.0.0" + "@babel/plugin-transform-destructuring" "^7.0.0" + "@babel/plugin-transform-dotall-regex" "^7.0.0" + "@babel/plugin-transform-duplicate-keys" "^7.0.0" + "@babel/plugin-transform-exponentiation-operator" "^7.1.0" + "@babel/plugin-transform-for-of" "^7.0.0" + "@babel/plugin-transform-function-name" "^7.1.0" + "@babel/plugin-transform-literals" "^7.0.0" + "@babel/plugin-transform-modules-amd" "^7.1.0" + "@babel/plugin-transform-modules-commonjs" "^7.1.0" + "@babel/plugin-transform-modules-systemjs" "^7.0.0" + "@babel/plugin-transform-modules-umd" "^7.1.0" + "@babel/plugin-transform-new-target" "^7.0.0" + "@babel/plugin-transform-object-super" "^7.1.0" + "@babel/plugin-transform-parameters" "^7.1.0" + "@babel/plugin-transform-regenerator" "^7.0.0" + "@babel/plugin-transform-shorthand-properties" "^7.0.0" + "@babel/plugin-transform-spread" "^7.0.0" + "@babel/plugin-transform-sticky-regex" "^7.0.0" + "@babel/plugin-transform-template-literals" "^7.0.0" + "@babel/plugin-transform-typeof-symbol" "^7.0.0" + "@babel/plugin-transform-unicode-regex" "^7.0.0" + browserslist "^4.1.0" + invariant "^2.2.2" + js-levenshtein "^1.1.3" + semver "^5.3.0" + +"@babel/preset-flow@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0.tgz#afd764835d9535ec63d8c7d4caf1c06457263da2" + integrity sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.0.0" + +"@babel/preset-react@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" + integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-react-display-name" "^7.0.0" + "@babel/plugin-transform-react-jsx" "^7.0.0" + "@babel/plugin-transform-react-jsx-self" "^7.0.0" + "@babel/plugin-transform-react-jsx-source" "^7.0.0" "@babel/template@7.0.0-beta.44": version "7.0.0-beta.44" @@ -103,13 +814,23 @@ babylon "7.0.0-beta.44" lodash "^4.2.0" -"@babel/template@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0.tgz#c2bc9870405959c89a9c814376a2ecb247838c80" +"@babel/template@^7.1.0", "@babel/template@^7.1.2": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644" + integrity sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.1.2" + "@babel/types" "^7.1.2" + +"@babel/template@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" + integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" "@babel/traverse@7.0.0-beta.44": version "7.0.0-beta.44" @@ -126,20 +847,36 @@ invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0.tgz#b1fe9b6567fdf3ab542cfad6f3b31f854d799a61" +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.5.tgz#5aafca2039aa058c104cf2bfeb9fc4a857ccbca9" + integrity sha512-eU6XokWypl0MVJo+MTSPUtlfPePkrqsF26O+l1qFGlCKWwmiYAYy2Sy44Qw8m2u/LbPCsxYt90rghmqhYMGpPA== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.0.0" - "@babel/helper-function-name" "^7.0.0" + "@babel/generator" "^7.1.5" + "@babel/helper-function-name" "^7.1.0" "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/types" "^7.0.0" + "@babel/parser" "^7.1.5" + "@babel/types" "^7.1.5" debug "^3.1.0" globals "^11.1.0" lodash "^4.17.10" +"@babel/traverse@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.2.tgz#961039de1f9bcb946d807efe2dba9c92e859d188" + integrity sha512-E5Bn9FSwHpSkUhthw/XEuvFZxIgrqb9M8cX8j5EUQtrUG5DQUy6bFyl7G7iQ1D1Czudor+xkmp81JbLVVM0Sjg== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.2.2" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.10" + "@babel/types@7.0.0-beta.44": version "7.0.0-beta.44" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" @@ -148,9 +885,19 @@ lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0.tgz#6e191793d3c854d19c6749989e3bc55f0e962118" +"@babel/types@^7.0.0", "@babel/types@^7.1.2", "@babel/types@^7.1.5": + version "7.1.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.1.5.tgz#12fe64e91a431234b7017b4227a78cc0eec4e081" + integrity sha512-sJeqa/d9eM/bax8Ivg+fXF7FpN3E/ZmTrWbkk6r+g7biVYfALMnLin4dKijsaqEhpd2xvOGfQTkQkD31YCVV4A== + dependencies: + esutils "^2.0.2" + lodash "^4.17.10" + to-fast-properties "^2.0.0" + +"@babel/types@^7.2.0", "@babel/types@^7.2.2": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" + integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== dependencies: esutils "^2.0.2" lodash "^4.17.10" @@ -330,6 +1077,15 @@ browser-stdout@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +browserslist@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.4.tgz#4477b737db6a1b07077275b24791e680d4300425" + integrity sha512-u5iz+ijIMUlmV8blX82VGFrB9ecnUg5qEt55CMZ/YJEhha+d8qpBfOFuutJ6F/VKRXjZoD33b6uvarpPxcl3RA== + dependencies: + caniuse-lite "^1.0.30000899" + electron-to-chromium "^1.3.82" + node-releases "^1.0.1" + builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -358,6 +1114,11 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +caniuse-lite@^1.0.30000899: + version "1.0.30000906" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000906.tgz#7c44e498a2504f7a5db3b4f91285bbc821157a77" + integrity sha512-ME7JFX6h0402om/nC/8Lw+q23QvPe2ust9U0ntLmkX9F2zaGwq47fZkjlyHKirFBuq1EM+T/LXBcDdW4bvkCTA== + chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -465,6 +1226,13 @@ contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" +convert-source-map@^1.1.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" @@ -511,6 +1279,13 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: dependencies: ms "2.0.0" +debug@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== + dependencies: + ms "^2.1.1" + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -571,6 +1346,11 @@ doctrine@^2.1.0: dependencies: esutils "^2.0.2" +electron-to-chromium@^1.3.82: + version "1.3.83" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz#74584eb0972bb6777811c5d68d988c722f5e6666" + integrity sha512-DqJoDarxq50dcHsOOlMLNoy+qQitlMNbYb6wwbE0oUw2veHdRkpNrhmngiUYKMErdJ8SJ48rpJsZTQgy5SoEAA== + elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -736,7 +1516,7 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" -esutils@^2.0.2: +esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" @@ -1074,7 +1854,7 @@ inquirer@^6.1.0: strip-ansi "^4.0.0" through "^2.3.6" -invariant@^2.2.0: +invariant@^2.2.0, invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -1273,6 +2053,11 @@ jest-validate@^23.5.0: leven "^2.1.0" pretty-format "^23.5.0" +js-levenshtein@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e" + integrity sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow== + js-tokens@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" @@ -1292,6 +2077,11 @@ jsesc@^2.5.1: version "2.5.1" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= + json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -1304,6 +2094,13 @@ json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" @@ -1514,6 +2311,11 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + mixin-deep@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" @@ -1546,6 +2348,11 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + mute-stream@0.0.7: version "0.0.7" resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -1574,6 +2381,13 @@ nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" +node-releases@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.3.tgz#3414ed84595096459c251699bfcb47d88324a9e4" + integrity sha512-ZaZWMsbuDcetpHmYeKWPO6e63pSXLb50M7lJgCbcM2nC/nQC3daNifmtp5a2kp7EWwYfhuvH6zLPWkrF8IiDdw== + dependencies: + semver "^5.3.0" + normalize-package-data@^2.3.2: version "2.4.0" resolved "http://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -1819,6 +2633,11 @@ pretty-format@^23.5.0: ansi-regex "^3.0.0" ansi-styles "^3.2.0" +private@^0.1.6: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== + progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" @@ -1854,6 +2673,25 @@ read-pkg@^4.0.1: parse-json "^4.0.0" pify "^3.0.0" +regenerate-unicode-properties@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" + integrity sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw== + dependencies: + regenerate "^1.4.0" + +regenerate@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" + integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== + +regenerator-transform@^0.13.3: + version "0.13.3" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" + integrity sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA== + dependencies: + private "^0.1.6" + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -1865,6 +2703,30 @@ regexpp@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" +regexpu-core@^4.1.3, regexpu-core@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" + integrity sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw== + dependencies: + regenerate "^1.4.0" + regenerate-unicode-properties "^7.0.0" + regjsgen "^0.4.0" + regjsparser "^0.3.0" + unicode-match-property-ecmascript "^1.0.4" + unicode-match-property-value-ecmascript "^1.0.2" + +regjsgen@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" + integrity sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA== + +regjsparser@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" + integrity sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA== + dependencies: + jsesc "~0.5.0" + repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" @@ -1894,15 +2756,16 @@ resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" +resolve@^1.3.2, resolve@^1.6.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" + integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== dependencies: path-parse "^1.0.5" -resolve@^1.6.0: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" +resolve@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" dependencies: path-parse "^1.0.5" @@ -1946,6 +2809,11 @@ rxjs@^6.1.0: dependencies: tslib "^1.9.0" +safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" @@ -1964,6 +2832,11 @@ semver-compare@^1.0.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@^5.3.0, semver@^5.4.1, semver@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + semver@^5.5.0, semver@^5.5.1: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -2230,6 +3103,29 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +unicode-canonical-property-names-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" + integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== + +unicode-match-property-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" + integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== + dependencies: + unicode-canonical-property-names-ecmascript "^1.0.4" + unicode-property-aliases-ecmascript "^1.0.4" + +unicode-match-property-value-ecmascript@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" + integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== + +unicode-property-aliases-ecmascript@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" + integrity sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg== + union-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" From 2b9ee42ded0436254cf8c37d53bffe78b186131c Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 10 Jan 2019 18:28:40 -0500 Subject: [PATCH 675/965] Remove monkeypatching dead code (babel/babel-eslint#737) --- .../babel-eslint-parser/lib/analyze-scope.js | 5 --- eslint/babel-eslint-parser/package.json | 2 +- .../test/fixtures/preprocess-to-patch.js | 6 --- .../test/specs/integration.js | 11 +++++ .../z_parser-for-eslint-after-patched.js | 45 ------------------- 5 files changed, 12 insertions(+), 57 deletions(-) delete mode 100644 eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js delete mode 100644 eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index aa3431a4cc51..ed2dab65095d 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -327,11 +327,6 @@ module.exports = function(ast, parserOptions) { fallback, }; - if (OriginalReferencer._babelEslintPatched) { - require("./patch-eslint-scope")(parserOptions); - return escope.analyze(ast, options); - } - options.childVisitorKeys = childVisitorKeys; const scopeManager = new escope.ScopeManager(options); diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e43b064a5ed5..31de034c4c5e 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -14,7 +14,7 @@ "homepage": "https://github.com/babel/babel-eslint", "scripts": { "test": "npm run lint && npm run test-only", - "test-only": "cd test && mocha --require fixtures/preprocess-to-patch.js specs && cd -", + "test-only": "cd test && mocha specs && cd -", "lint": "eslint .", "lint-fix": "npm run lint -- --fix", "precommit": "lint-staged", diff --git a/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js b/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js deleted file mode 100644 index 8cb4c54fb6de..000000000000 --- a/eslint/babel-eslint-parser/test/fixtures/preprocess-to-patch.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict" - -const babelEslint = require("../..") - -// Apply monkeypatch to eslint-scope. -babelEslint.parse("var x = 0;") diff --git a/eslint/babel-eslint-parser/test/specs/integration.js b/eslint/babel-eslint-parser/test/specs/integration.js index 4e0851d8a42d..27caec55cb6e 100644 --- a/eslint/babel-eslint-parser/test/specs/integration.js +++ b/eslint/babel-eslint-parser/test/specs/integration.js @@ -223,3 +223,14 @@ function strictSuite() { // it }); } + +describe("https://github.com/babel/babel-eslint/issues/558", () => { + it("doesn't crash with eslint-plugin-import", () => { + const engine = new eslint.CLIEngine({ ignore: false }); + engine.executeOnFiles([ + "fixtures/eslint-plugin-import/a.js", + "fixtures/eslint-plugin-import/b.js", + "fixtures/eslint-plugin-import/c.js", + ]); + }); +}); diff --git a/eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js b/eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js deleted file mode 100644 index bc787db34951..000000000000 --- a/eslint/babel-eslint-parser/test/specs/z_parser-for-eslint-after-patched.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; - -const eslint = require("eslint"); -const assert = require("assert"); -const babelEslint = require("../.."); -const espree = require("espree"); -const assertImplementsAST = require("../helpers/assert-implements-ast"); - -describe("https://github.com/babel/babel-eslint/issues/558", () => { - it("don't crash with eslint-plugin-import", () => { - const engine = new eslint.CLIEngine({ ignore: false }); - engine.executeOnFiles([ - "../test/fixtures/eslint-plugin-import/a.js", - "../test/fixtures/eslint-plugin-import/b.js", - "../test/fixtures/eslint-plugin-import/c.js", - ]); - }); - - /* - * This test ensures that the enhanced referencer does not get used if eslint-scope has already been - * monkeypatched, because this causes some correctness issues. For example, if the enhanced referencer - * is used after the original referencer is monkeypatched, type annotation references are counted twice. - */ - it("does not visit type annotations multiple times after monkeypatching and calling parseForESLint()", () => { - assertImplementsAST( - espree.parse("foo", { sourceType: "module" }), - babelEslint.parse("foo", {}) - ); - const parseResult = babelEslint.parseForESLint( - "type Foo = {}; function x(): Foo {}", - { - eslintVisitorKeys: true, - eslintScopeManager: true, - } - ); - assert(parseResult.visitorKeys); - assert(parseResult.scopeManager); - - const fooVariable = parseResult.scopeManager.getDeclaredVariables( - parseResult.ast.body[0] - )[0]; - - assert.strictEqual(fooVariable.references.length, 1); - }); -}); From bbce2b380734873aa3ba87d0342891bde82c1b88 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 11 Jan 2019 12:23:34 -0500 Subject: [PATCH 676/965] Remove comment attachment (babel/babel-eslint#736) * Remove comment attachment * Simplify error messaging in tests --- .../lib/babylon-to-espree/attachComments.js | 59 ------------------- .../{toAST.js => convertAST.js} | 9 +-- .../babylon-to-espree/convertProgramNode.js | 40 +++++++++++++ .../{toToken.js => convertToken.js} | 0 .../{toTokens.js => convertTokens.js} | 4 +- .../lib/babylon-to-espree/index.js | 27 ++------- .../test/specs/babel-eslint.js | 35 +---------- 7 files changed, 52 insertions(+), 122 deletions(-) delete mode 100644 eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js rename eslint/babel-eslint-parser/lib/babylon-to-espree/{toAST.js => convertAST.js} (92%) create mode 100644 eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js rename eslint/babel-eslint-parser/lib/babylon-to-espree/{toToken.js => convertToken.js} (100%) rename eslint/babel-eslint-parser/lib/babylon-to-espree/{toTokens.js => convertTokens.js} (72%) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js deleted file mode 100644 index 6e198753845f..000000000000 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/attachComments.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; - -// comment fixes -module.exports = function(ast, comments, tokens) { - if (comments.length) { - const firstComment = comments[0]; - const lastComment = comments[comments.length - 1]; - // fixup program start - if (!tokens.length) { - // if no tokens, the program starts at the end of the last comment - ast.start = lastComment.end; - ast.loc.start.line = lastComment.loc.end.line; - ast.loc.start.column = lastComment.loc.end.column; - - if (ast.leadingComments === null && ast.innerComments.length) { - ast.leadingComments = ast.innerComments; - } - } else if (firstComment.start < tokens[0].start) { - // if there are comments before the first token, the program starts at the first token - const token = tokens[0]; - // ast.start = token.start; - // ast.loc.start.line = token.loc.start.line; - // ast.loc.start.column = token.loc.start.column; - - // estraverse do not put leading comments on first node when the comment - // appear before the first token - if (ast.body.length) { - const node = ast.body[0]; - node.leadingComments = []; - const firstTokenStart = token.start; - const len = comments.length; - for (let i = 0; i < len && comments[i].start < firstTokenStart; i++) { - node.leadingComments.push(comments[i]); - } - } - } - // fixup program end - if (tokens.length) { - const lastToken = tokens[tokens.length - 1]; - if (lastComment.end > lastToken.end) { - // If there is a comment after the last token, the program ends at the - // last token and not the comment - // ast.end = lastToken.end; - ast.range[1] = lastToken.end; - ast.loc.end.line = lastToken.loc.end.line; - ast.loc.end.column = lastToken.loc.end.column; - } - } - } else { - if (!tokens.length) { - ast.loc.start.line = 1; - ast.loc.end.line = 1; - } - } - if (ast.body && ast.body.length > 0) { - ast.loc.start.line = ast.body[0].loc.start.line; - ast.range[0] = ast.body[0].start; - } -}; diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js similarity index 92% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js index 2ab165df69ec..0ef37750d7ab 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js @@ -1,7 +1,7 @@ "use strict"; const t = require("@babel/core").types; -const convertComments = require("./convertComments"); +const convertProgramNode = require("./convertProgramNode"); module.exports = function(ast, traverse, code) { const state = { source: code }; @@ -20,6 +20,8 @@ module.exports = function(ast, traverse, code) { delete t.VISITOR_KEYS.Property; delete t.VISITOR_KEYS.MethodDefinition; + + convertProgramNode(ast); }; const astTransformVisitor = { @@ -31,16 +33,15 @@ const astTransformVisitor = { node._babelType = node.type; if (node.innerComments) { - node.trailingComments = node.innerComments; delete node.innerComments; } if (node.trailingComments) { - convertComments(node.trailingComments); + delete node.trailingComments; } if (node.leadingComments) { - convertComments(node.leadingComments); + delete node.leadingComments; } }, exit(path) { diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js new file mode 100644 index 000000000000..810b19888213 --- /dev/null +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js @@ -0,0 +1,40 @@ +"use strict"; + +module.exports = function(ast) { + ast.type = "Program"; + ast.sourceType = ast.program.sourceType; + ast.directives = ast.program.directives; + ast.body = ast.program.body; + delete ast.program; + + if (ast.comments.length) { + const lastComment = ast.comments[ast.comments.length - 1]; + + if (!ast.tokens.length) { + // if no tokens, the program starts at the end of the last comment + ast.start = lastComment.end; + ast.loc.start.line = lastComment.loc.end.line; + ast.loc.start.column = lastComment.loc.end.column; + } else { + const lastToken = ast.tokens[ast.tokens.length - 1]; + + if (lastComment.end > lastToken.end) { + // If there is a comment after the last token, the program ends at the + // last token and not the comment + ast.range[1] = lastToken.end; + ast.loc.end.line = lastToken.loc.end.line; + ast.loc.end.column = lastToken.loc.end.column; + } + } + } else { + if (!ast.tokens.length) { + ast.loc.start.line = 1; + ast.loc.end.line = 1; + } + } + + if (ast.body && ast.body.length > 0) { + ast.loc.start.line = ast.body[0].loc.start.line; + ast.range[0] = ast.body[0].start; + } +}; diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/toToken.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTokens.js similarity index 72% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js rename to eslint/babel-eslint-parser/lib/babylon-to-espree/convertTokens.js index 2927c4b01123..0f49d9373089 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/toTokens.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTokens.js @@ -1,10 +1,10 @@ "use strict"; const convertTemplateType = require("./convertTemplateType"); -const toToken = require("./toToken"); +const convertToken = require("./convertToken"); module.exports = function(tokens, tt, code) { return convertTemplateType(tokens, tt) .filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock") - .map(t => toToken(t, tt, code)); + .map(t => convertToken(t, tt, code)); }; diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js index c0fdf323a884..cc4dda974358 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js @@ -1,30 +1,11 @@ "use strict"; -const attachComments = require("./attachComments"); +const convertTokens = require("./convertTokens"); const convertComments = require("./convertComments"); -const toTokens = require("./toTokens"); -const toAST = require("./toAST"); +const convertAST = require("./convertAST"); module.exports = function(ast, traverse, tt, code) { - // convert tokens - ast.tokens = toTokens(ast.tokens, tt, code); - - // add comments + ast.tokens = convertTokens(ast.tokens, tt, code); convertComments(ast.comments); - - // transform esprima and acorn divergent nodes - toAST(ast, traverse, code); - - // ast.program.tokens = ast.tokens; - // ast.program.comments = ast.comments; - // ast = ast.program; - - // remove File - ast.type = "Program"; - ast.sourceType = ast.program.sourceType; - ast.directives = ast.program.directives; - ast.body = ast.program.body; - delete ast.program; - - attachComments(ast, ast.comments, ast.tokens); + convertAST(ast, traverse, code); }; diff --git a/eslint/babel-eslint-parser/test/specs/babel-eslint.js b/eslint/babel-eslint-parser/test/specs/babel-eslint.js index becf4e31c590..849e37ab97bc 100644 --- a/eslint/babel-eslint-parser/test/specs/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/specs/babel-eslint.js @@ -4,23 +4,9 @@ const assert = require("assert"); const babelEslint = require("../.."); const espree = require("espree"); const escope = require("eslint-scope"); -const util = require("util"); const unpad = require("dedent"); const assertImplementsAST = require("../helpers/assert-implements-ast"); -function lookup(obj, keypath, backwardsDepth) { - if (!keypath) { - return obj; - } - - return keypath - .split(".") - .slice(0, -1 * backwardsDepth) - .reduce((base, segment) => { - return base && base[segment], obj; - }); -} - function parseAndAssertSame(code) { code = unpad(code); const esAST = espree.parse(code, { @@ -38,7 +24,6 @@ function parseAndAssertSame(code) { loc: true, range: true, comment: true, - attachComment: true, ecmaVersion: 2018, sourceType: "module", }); @@ -46,25 +31,7 @@ function parseAndAssertSame(code) { eslintVisitorKeys: true, eslintScopeManager: true, }).ast; - try { - assertImplementsAST(esAST, babylonAST); - } catch (err) { - const traversal = err.message.slice(3, err.message.indexOf(":")); - err.message += unpad(` - espree: - ${util.inspect(lookup(esAST, traversal, 2), { - depth: err.depth, - colors: true, - })} - babel-eslint: - ${util.inspect(lookup(babylonAST, traversal, 2), { - depth: err.depth, - colors: true, - })} - `); - throw err; - } - //assert.equal(esAST, babylonAST); + assertImplementsAST(esAST, babylonAST); } describe("babylon-to-espree", () => { From 0581ce1559038a68f8edc73a9453d88553dec66f Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 11 Jan 2019 15:27:36 -0500 Subject: [PATCH 677/965] Add code of conduct (same as Babel) (babel/babel-eslint#740) [skip ci] --- eslint/babel-eslint-parser/CODE_OF_CONDUCT.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 eslint/babel-eslint-parser/CODE_OF_CONDUCT.md diff --git a/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md b/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md new file mode 100644 index 000000000000..1219f9578c90 --- /dev/null +++ b/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Code of Conduct + +This project shares the same code of conduct as [Babel](https://github.com/babel/babel), which can be found [here](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md). From 37cf65c6f8d12cfcb6cf2fa5ffe5965ce1e13fc4 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 21 Jan 2019 11:06:29 -0500 Subject: [PATCH 678/965] Add requireConfigFile option (babel/babel-eslint#743) * Add requireConfigFile option * Update README.md --- eslint/babel-eslint-parser/README.md | 1 + .../babel-eslint-parser/lib/analyze-scope.js | 2 +- eslint/babel-eslint-parser/lib/index.js | 3 +-- eslint/babel-eslint-parser/lib/parse.js | 26 +++++++++++++++++-- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ad8fc01d0d0e..25373821ddee 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -53,6 +53,7 @@ With the parser set, your configuration can be configured as described in the [C Additional configuration options can be set in your ESLint configuration under the `parserOptions` key. Please note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. +- `requireConfigFile` (default `true`) can be set to `false` to allow babel-eslint to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files), though we recommend using the default parser via [glob-based configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns). Note: babel-eslint will not parse any experimental syntax when no configuration file is found. - `sourceType` can be set to `"module"`(default) or `"script"` if your code isn't using ECMAScript modules. - `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. - `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/lib/analyze-scope.js index ed2dab65095d..38561521d3f8 100644 --- a/eslint/babel-eslint-parser/lib/analyze-scope.js +++ b/eslint/babel-eslint-parser/lib/analyze-scope.js @@ -323,7 +323,7 @@ module.exports = function(ast, parserOptions) { parserOptions.ecmaFeatures.globalReturn) === true, impliedStrict: false, sourceType: ast.sourceType, - ecmaVersion: parserOptions.ecmaVersion || 2018, + ecmaVersion: parserOptions.ecmaVersion, fallback, }; diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index c9478419f18e..459444cf9c2c 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -16,7 +16,7 @@ exports.parse = function(code, options) { return exports.parseForESLint(code, options).ast; }; -exports.parseForESLint = function(code, options) { +exports.parseForESLint = function(code, options = {}) { if (!IS_RUNNING_SUPPORTED_VERSION) { throw new Error( `babel-eslint@${ @@ -25,7 +25,6 @@ exports.parseForESLint = function(code, options) { ); } - options = options || {}; options.babelOptions = options.babelOptions || {}; options.ecmaVersion = options.ecmaVersion || 2018; options.sourceType = options.sourceType || "module"; diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index f6b55a1486ba..c83fcb9c997b 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -1,10 +1,15 @@ "use strict"; const babylonToEspree = require("./babylon-to-espree"); -const { parseSync: parse, tokTypes: tt, traverse } = require("@babel/core"); +const { + parseSync: parse, + tokTypes: tt, + traverse, + loadPartialConfig, +} = require("@babel/core"); module.exports = function(code, options) { - const opts = { + let opts = { sourceType: options.sourceType, filename: options.filePath, cwd: options.babelOptions.cwd, @@ -35,7 +40,24 @@ module.exports = function(code, options) { }, }; + if (options.requireConfigFile !== false) { + const config = loadPartialConfig(opts); + + if (config !== null) { + if (!config.hasFilesystemConfig()) { + throw new Error( + `No Babel config file detected for ${ + config.options.filename + }. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.` + ); + } + + opts = config.options; + } + } + let ast; + try { ast = parse(code, opts); } catch (err) { From 2d64900b46a36c46efbb6224f46c0d460a2ec322 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 21 Jan 2019 16:29:18 -0500 Subject: [PATCH 679/965] 11.0.0-beta.0 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 31de034c4c5e..a3b1d171873c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "10.0.1", + "version": "11.0.0-beta.0", "description": "Custom parser for ESLint", "author": "Sebastian McKenzie ", "license": "MIT", From 025fff787164f23471fc9afbbe1d409ee946779e Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Tue, 29 Jan 2019 10:56:54 -0500 Subject: [PATCH 680/965] Docs: Add glob-based configuration example (babel/babel-eslint#748) * Docs: Add glob-based configuration example * Fix quotes style for consistency --- eslint/babel-eslint-parser/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index 25373821ddee..ca0f16ea38e4 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -77,6 +77,24 @@ module.exports = { }; ``` +**.eslintrc.js using glob-based configuration** + +This configuration would use the default parser for all files except for those found by the `"files/transformed/by/babel/*.js"` glob. + +```js +module.exports = { + rules: { + indent: "error" + }, + overrides: [ + { + files: ["files/transformed/by/babel/*.js"], + parser: "babel-eslint", + } + ] +}; +``` + ### Run ```sh From 3fcfc90a123cf7fd8ab667a593ccc8ff4ab70094 Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Fri, 15 Feb 2019 07:56:30 +0900 Subject: [PATCH 681/965] Fix to convert hash token. (babel/babel-eslint#753) --- .../lib/babylon-to-espree/convertToken.js | 1 + eslint/babel-eslint-parser/test/specs/babel-eslint.js | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js index 3e0ba453c9fb..2d8e9b1aac34 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js @@ -44,6 +44,7 @@ module.exports = function(token, tt, source) { type === tt.bang || type === tt.tilde || type === tt.doubleColon || + type === tt.hash || type.isAssign ) { token.type = "Punctuator"; diff --git a/eslint/babel-eslint-parser/test/specs/babel-eslint.js b/eslint/babel-eslint-parser/test/specs/babel-eslint.js index 849e37ab97bc..02328e868e76 100644 --- a/eslint/babel-eslint-parser/test/specs/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/specs/babel-eslint.js @@ -267,6 +267,17 @@ describe("babylon-to-espree", () => { assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); }); + // Espree doesn't support the private fields yet + it("hash (token)", () => { + const code = "class A { #x }"; + const babylonAST = babelEslint.parseForESLint(code, { + eslintVisitorKeys: true, + eslintScopeManager: true, + }).ast; + assert.strictEqual(babylonAST.tokens[3].type, "Punctuator"); + assert.strictEqual(babylonAST.tokens[3].value, "#"); + }); + it.skip("empty program with line comment", () => { parseAndAssertSame("// single comment"); }); From f9836caee5e546a1bed6378667f75aa7b3769bd7 Mon Sep 17 00:00:00 2001 From: Param Aggarwal Date: Thu, 4 Apr 2019 19:51:25 +0530 Subject: [PATCH 682/965] fix typo in README.md (babel/babel-eslint#762) --- eslint/babel-eslint-parser/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index ca0f16ea38e4..cc7fd8f5141c 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -9,7 +9,7 @@ As of the v11.x.x release, babel-eslint now requires Babel as a peer dependency ## When should I use babel-eslint? -ESLint's default parser and core rules [only suppport the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. babel-eslint is a parser that allows ESLint to run on source code that is transformed by Babel. +ESLint's default parser and core rules [only support the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. babel-eslint is a parser that allows ESLint to run on source code that is transformed by Babel. **Note:** You only need to use babel-eslint if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). From 6748797681a32888dc4aae9a508453da7973fbe8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:25:29 +0200 Subject: [PATCH 683/965] Bump lodash from 4.17.5 to 4.17.14 (babel/babel-eslint#779) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.5 to 4.17.14. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.5...4.17.14) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-parser/yarn.lock | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index aec76fb40e5f..67c15991c84e 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2229,13 +2229,10 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash@^4.15.0: - version "4.17.5" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" - -lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: - version "4.17.10" - resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" +lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" + integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== log-symbols@^1.0.2: version "1.0.2" @@ -2453,7 +2450,7 @@ once@^1.3.0: onetime@^1.0.0: version "1.1.0" - resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" + resolved "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" onetime@^2.0.0: version "2.0.1" @@ -3040,7 +3037,7 @@ symbol-observable@^1.1.0: table@^4.0.3: version "4.0.3" - resolved "http://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" + resolved "https://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" dependencies: ajv "^6.0.1" ajv-keywords "^3.0.0" From 86350631183488c2509204e107b3787aa3b7aa48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:27:39 +0200 Subject: [PATCH 684/965] Bump js-yaml from 3.12.0 to 3.13.1 (babel/babel-eslint#780) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1. - [Release notes](https://github.com/nodeca/js-yaml/releases) - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-parser/yarn.lock | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 67c15991c84e..e0973a435208 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -979,6 +979,7 @@ any-observable@^0.3.0: argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== dependencies: sprintf-js "~1.0.2" @@ -1499,6 +1500,7 @@ espree@^4.0.0: esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== esquery@^1.0.1: version "1.0.1" @@ -2067,8 +2069,9 @@ js-tokens@^3.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" js-yaml@^3.12.0, js-yaml@^3.9.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -2952,6 +2955,7 @@ split-string@^3.0.1, split-string@^3.0.2: sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= staged-git-files@1.1.1: version "1.1.1" From 030fddb0b88b9288fb9f762126107ad3bd8e1b87 Mon Sep 17 00:00:00 2001 From: Daniel Tschinder Date: Mon, 15 Jul 2019 18:49:52 +0200 Subject: [PATCH 685/965] chore: Update deps and fix tests for new mocha and eslint (babel/babel-eslint#781) --- eslint/babel-eslint-parser/.travis.yml | 3 +- eslint/babel-eslint-parser/lib/index.js | 4 +- eslint/babel-eslint-parser/lib/parse.js | 4 +- eslint/babel-eslint-parser/package.json | 12 +- .../test/helpers/assert-implements-ast.js | 4 +- .../test/specs/babel-eslint.js | 4 +- .../test/specs/integration.js | 6 +- .../test/specs/non-regression.js | 9 +- eslint/babel-eslint-parser/yarn.lock | 2802 ++++++++++------- 9 files changed, 1696 insertions(+), 1152 deletions(-) diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml index 21826d3469db..8ece2fc21261 100644 --- a/eslint/babel-eslint-parser/.travis.yml +++ b/eslint/babel-eslint-parser/.travis.yml @@ -1,10 +1,9 @@ sudo: false language: node_js node_js: - - "11" + - "12" - "10" - "8" - - "6" matrix: fast_finish: true diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/lib/index.js index 459444cf9c2c..2769d4a0c09a 100644 --- a/eslint/babel-eslint-parser/lib/index.js +++ b/eslint/babel-eslint-parser/lib/index.js @@ -19,9 +19,7 @@ exports.parse = function(code, options) { exports.parseForESLint = function(code, options = {}) { if (!IS_RUNNING_SUPPORTED_VERSION) { throw new Error( - `babel-eslint@${ - packageJson.version - } does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}` + `babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}` ); } diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/lib/parse.js index c83fcb9c997b..3930bb04057d 100644 --- a/eslint/babel-eslint-parser/lib/parse.js +++ b/eslint/babel-eslint-parser/lib/parse.js @@ -46,9 +46,7 @@ module.exports = function(code, options) { if (config !== null) { if (!config.hasFilesystemConfig()) { throw new Error( - `No Babel config file detected for ${ - config.options.filename - }. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.` + `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.` ); } diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a3b1d171873c..7ba87298d99b 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -52,17 +52,17 @@ "@babel/preset-env": "^7.1.5", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", - "babel-eslint": "^8.2.6", + "babel-eslint": "^10.0.2", "dedent": "^0.7.0", - "eslint": "^5.6.0", - "eslint-config-babel": "^7.0.1", - "eslint-plugin-flowtype": "^2.30.3", + "eslint": "^6.0.1", + "eslint-config-babel": "^9.0.0", + "eslint-plugin-flowtype": "^3.11.1", "eslint-plugin-import": "^2.14.0", - "eslint-plugin-prettier": "^2.1.2", + "eslint-plugin-prettier": "^3.1.0", "espree": "^3.5.2", "husky": "^1.0.0-rc.13", "lint-staged": "^7.2.2", - "mocha": "^5.0.1", + "mocha": "^6.1.4", "prettier": "^1.4.4" }, "lint-staged": { diff --git a/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js index 892d200c612a..84e370f48ed2 100644 --- a/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js +++ b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js @@ -24,9 +24,7 @@ module.exports = function assertImplementsAST(target, source, path) { target.constructor.name !== source.constructor.name ) { error( - `object have different constructors (${target.constructor.name} !== ${ - source.constructor.name - }` + `object have different constructors (${target.constructor.name} !== ${source.constructor.name}` ); } else if (typeA === "object") { const keysTarget = Object.keys(target); diff --git a/eslint/babel-eslint-parser/test/specs/babel-eslint.js b/eslint/babel-eslint-parser/test/specs/babel-eslint.js index 02328e868e76..dd83cc7831a9 100644 --- a/eslint/babel-eslint-parser/test/specs/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/specs/babel-eslint.js @@ -230,11 +230,11 @@ describe("babylon-to-espree", () => { }); it("export named", () => { - parseAndAssertSame("export { foo };"); + parseAndAssertSame("var foo = 1;export { foo };"); }); it("export named alias", () => { - parseAndAssertSame("export { foo as bar };"); + parseAndAssertSame("var foo = 1;export { foo as bar };"); }); // Espree doesn't support the optional chaining operator yet diff --git a/eslint/babel-eslint-parser/test/specs/integration.js b/eslint/babel-eslint-parser/test/specs/integration.js index 27caec55cb6e..d13a5aa3ff97 100644 --- a/eslint/babel-eslint-parser/test/specs/integration.js +++ b/eslint/babel-eslint-parser/test/specs/integration.js @@ -5,6 +5,10 @@ const eslint = require("eslint"); const fs = require("fs"); const path = require("path"); +const parser = require("../.."); + +eslint.linter.defineParser("current-babel-eslint", parser); + const paths = { fixtures: path.join(__dirname, "..", "fixtures", "rules"), }; @@ -13,7 +17,7 @@ const encoding = "utf8"; const errorLevel = 2; const baseEslintOpts = { - parser: require.resolve("../.."), + parser: "current-babel-eslint", parserOptions: { sourceType: "script", }, diff --git a/eslint/babel-eslint-parser/test/specs/non-regression.js b/eslint/babel-eslint-parser/test/specs/non-regression.js index 79754dab5edf..58d7056c42c5 100644 --- a/eslint/babel-eslint-parser/test/specs/non-regression.js +++ b/eslint/babel-eslint-parser/test/specs/non-regression.js @@ -4,6 +4,8 @@ const eslint = require("eslint"); const path = require("path"); const unpad = require("dedent"); +const parser = require("../.."); + function verifyAndAssertMessagesWithSpecificESLint( code, rules, @@ -13,7 +15,7 @@ function verifyAndAssertMessagesWithSpecificESLint( linter ) { const config = { - parser: require.resolve("../.."), + parser: "current-babel-eslint", rules, env: { node: true, @@ -66,13 +68,16 @@ function verifyAndAssertMessages( sourceType, overrideConfig ) { + const linter = new eslint.Linter(); + linter.defineParser("current-babel-eslint", parser); + verifyAndAssertMessagesWithSpecificESLint( unpad(`${code}`), rules || {}, expectedMessages || [], sourceType, overrideConfig, - new eslint.Linter() + linter ); } diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index e0973a435208..73f0201860e2 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -2,67 +2,41 @@ # yarn lockfile v1 -"@babel/code-frame@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9" - dependencies: - "@babel/highlight" "7.0.0-beta.44" - "@babel/code-frame@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== dependencies: "@babel/highlight" "^7.0.0" "@babel/core@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.2.2.tgz#07adba6dde27bb5ad8d8672f15fde3e08184a687" - integrity sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw== + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" + integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helpers" "^7.2.0" - "@babel/parser" "^7.2.2" - "@babel/template" "^7.2.2" - "@babel/traverse" "^7.2.2" - "@babel/types" "^7.2.2" + "@babel/generator" "^7.5.0" + "@babel/helpers" "^7.5.4" + "@babel/parser" "^7.5.0" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" convert-source-map "^1.1.0" debug "^4.1.0" json5 "^2.1.0" - lodash "^4.17.10" + lodash "^4.17.11" resolve "^1.3.2" semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42" - dependencies: - "@babel/types" "7.0.0-beta.44" - jsesc "^2.5.1" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/generator@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.1.5.tgz#615f064d13d95f8f9157c7261f68eddf32ec15b3" - integrity sha512-IO31r62xfMI+wBJVmgx0JR9ZOHty8HkoYpQAjRWUGG9vykBTlGHdArZ8zoFtpUu2gs17K7qTl/TtPpiSi6t+MA== +"@babel/generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" + integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== dependencies: - "@babel/types" "^7.1.5" + "@babel/types" "^7.5.0" jsesc "^2.5.1" - lodash "^4.17.10" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/generator@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" - integrity sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg== - dependencies: - "@babel/types" "^7.2.2" - jsesc "^2.5.1" - lodash "^4.17.10" + lodash "^4.17.11" source-map "^0.5.0" trim-right "^1.0.1" @@ -81,31 +55,43 @@ "@babel/helper-explode-assignable-expression" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-builder-react-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0.tgz#fa154cb53eb918cf2a9a7ce928e29eb649c5acdb" - integrity sha512-ebJ2JM6NAKW0fQEqN8hOLxK84RbRz9OkUhGS/Xd5u56ejMfVbayJ4+LykERZCOUM6faa6Fp3SZNX3fcT16MKHw== +"@babel/helper-builder-react-jsx@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" + integrity sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.3.0" esutils "^2.0.0" -"@babel/helper-call-delegate@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.1.0.tgz#6a957f105f37755e8645343d3038a22e1449cc4a" - integrity sha512-YEtYZrw3GUK6emQHKthltKNZwszBcHK58Ygcis+gVUrF4/FmTVr5CCqQNSfmvg2y+YDEANyYoaLz/SHsnusCwQ== +"@babel/helper-call-delegate@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" + integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== dependencies: - "@babel/helper-hoist-variables" "^7.0.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-hoist-variables" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" -"@babel/helper-define-map@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.1.0.tgz#3b74caec329b3c80c116290887c0dd9ae468c20c" - integrity sha512-yPPcW8dc3gZLN+U1mhYV91QU3n5uTbx7DUdf8NnPbjS0RMwBuHi9Xt2MUgppmNz7CJxTBWsGczTiEp1CSOTPRg== +"@babel/helper-create-class-features-plugin@^7.4.4", "@babel/helper-create-class-features-plugin@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz#02edb97f512d44ba23b3227f1bf2ed43454edac5" + integrity sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA== dependencies: "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.0.0" - lodash "^4.17.10" + "@babel/helper-member-expression-to-functions" "^7.0.0" + "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-split-export-declaration" "^7.4.4" + +"@babel/helper-define-map@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" + integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/types" "^7.4.4" + lodash "^4.17.11" "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" @@ -115,14 +101,6 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-function-name@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd" - dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.44" - "@babel/template" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - "@babel/helper-function-name@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" @@ -132,12 +110,6 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-get-function-arity@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15" - dependencies: - "@babel/types" "7.0.0-beta.44" - "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -145,12 +117,12 @@ dependencies: "@babel/types" "^7.0.0" -"@babel/helper-hoist-variables@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0.tgz#46adc4c5e758645ae7a45deb92bab0918c23bb88" - integrity sha512-Ggv5sldXUeSKsuzLkddtyhyHe2YantsxWKNi7A+7LeD12ExRDWTRk29JCXpaHPAbMaIPZSil7n+lq78WY2VY7w== +"@babel/helper-hoist-variables@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" + integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.4.4" "@babel/helper-member-expression-to-functions@^7.0.0": version "7.0.0" @@ -166,17 +138,17 @@ dependencies: "@babel/types" "^7.0.0" -"@babel/helper-module-transforms@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.1.0.tgz#470d4f9676d9fad50b324cdcce5fbabbc3da5787" - integrity sha512-0JZRd2yhawo79Rcm4w0LwSMILFmFXjugG3yqf+P/UsKsRS1mJCmMwwlHDlMg7Avr9LrvSpp4ZSULO9r8jpCzcw== +"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" + integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - lodash "^4.17.10" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/template" "^7.4.4" + "@babel/types" "^7.4.4" + lodash "^4.17.11" "@babel/helper-optimise-call-expression@^7.0.0": version "7.0.0" @@ -190,12 +162,12 @@ resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== -"@babel/helper-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0.tgz#2c1718923b57f9bbe64705ffe5640ac64d9bdb27" - integrity sha512-TR0/N0NDCcUIUEbqV6dCO+LptmmSQFQ7q70lfcEB4URsjD0E1HzicrwUH+ap6BAQ2jhCX9Q4UqZy4wilujWlkg== +"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" + integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== dependencies: - lodash "^4.17.10" + lodash "^4.17.11" "@babel/helper-remap-async-to-generator@^7.1.0": version "7.1.0" @@ -208,15 +180,15 @@ "@babel/traverse" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-replace-supers@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.1.0.tgz#5fc31de522ec0ef0899dc9b3e7cf6a5dd655f362" - integrity sha512-BvcDWYZRWVuDeXTYZWxekQNO5D4kO55aArwZOTFXw6rlLQA8ZaDicJR1sO47h+HrnCiDFiww0fSPV0d713KBGQ== +"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" + integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== dependencies: "@babel/helper-member-expression-to-functions" "^7.0.0" "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" "@babel/helper-simple-access@^7.1.0": version "7.1.0" @@ -226,565 +198,583 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" -"@babel/helper-split-export-declaration@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc" +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== dependencies: - "@babel/types" "7.0.0-beta.44" - -"@babel/helper-split-export-declaration@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" - integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== - dependencies: - "@babel/types" "^7.0.0" + "@babel/types" "^7.4.4" "@babel/helper-wrap-function@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" - integrity sha512-R6HU3dete+rwsdAfrOzTlE9Mcpk4RjU3aX3gi9grtmugQY0u79X7eogUvfXA5sI81Mfq1cn6AgxihfN33STjJA== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/template" "^7.1.0" "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helpers@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.2.0.tgz#8335f3140f3144270dc63c4732a4f8b0a50b7a21" - integrity sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A== - dependencies: - "@babel/template" "^7.1.2" - "@babel/traverse" "^7.1.5" "@babel/types" "^7.2.0" -"@babel/highlight@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5" +"@babel/helpers@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" + integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.5.0" + "@babel/types" "^7.5.0" "@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== dependencies: chalk "^2.0.0" esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.2", "@babel/parser@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.5.tgz#20b7d5e7e1811ba996f8a868962ea7dd2bfcd2fc" - integrity sha512-WXKf5K5HT6X0kKiCOezJZFljsfxKV1FpU8Tf1A7ZpGvyd/Q4hlrJm2EwoH2onaUq3O4tLDp+4gk0hHPsMyxmOg== - -"@babel/parser@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.2.tgz#37ebdbc88a2e1ebc6c8dd3d35ea9436e3e39e477" - integrity sha512-UNTmQ5cSLDeBGBl+s7JeowkqIHgmFAGBnLDdIzFmUNSuS5JF0XBcN59jsh/vJO/YjfsBqMxhMjoFGmNExmf0FA== +"@babel/parser@^7.0.0", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" + integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== -"@babel/plugin-proposal-async-generator-functions@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" - integrity sha512-Fq803F3Jcxo20MXUSDdmZZXrPe6BWyGcWBPPNB/M7WaUYESKDeKMOGIxEzQOjGSmW/NWb6UaPZrtTB2ekhB/ew== +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.0.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" "@babel/plugin-proposal-class-properties@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.1.0.tgz#9af01856b1241db60ec8838d84691aa0bd1e8df4" - integrity sha512-/PCJWN+CKt5v1xcGn4vnuu13QDoV+P7NcICP44BoonAJoPSGwVkgrXihFIQGiEjjPlUDBIw1cM7wYFLARS2/hw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.0.tgz#5bc6a0537d286fcb4fd4e89975adbca334987007" + integrity sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ== dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" + "@babel/helper-create-class-features-plugin" "^7.5.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - "@babel/plugin-syntax-class-properties" "^7.0.0" "@babel/plugin-proposal-decorators@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.1.2.tgz#79829bd75fced6581ec6c7ab1930e8d738e892e7" - integrity sha512-YooynBO6PmBgHvAd0fl5e5Tq/a0pEC6RqF62ouafme8FzdIVH41Mz/u1dn8fFVm4jzEJ+g/MsOxouwybJPuP8Q== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.4.tgz#de9b2a1a8ab0196f378e2a82f10b6e2a36f21cc0" + integrity sha512-z7MpQz3XC/iQJWXH9y+MaWcLPNSMY9RQSthrLzak8R8hCj0fuyNk+Dzi9kfNe/JxxlWQ2g7wkABbgWjW36MTcw== dependencies: + "@babel/helper-create-class-features-plugin" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/plugin-syntax-decorators" "^7.1.0" + "@babel/plugin-syntax-decorators" "^7.2.0" -"@babel/plugin-proposal-json-strings@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.0.0.tgz#3b4d7b5cf51e1f2e70f52351d28d44fc2970d01e" - integrity sha512-kfVdUkIAGJIVmHmtS/40i/fg/AGnw/rsZBCaapY5yjeO5RA9m165Xbw9KMOu2nqXP5dTFjEjHdfNdoVcHv133Q== +"@babel/plugin-proposal-dynamic-import@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" + integrity sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.0.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0.tgz#b72ec31adf612d062dc0348316246127a451e45f" - integrity sha512-QIN3UFo1ul4ruAsjIqK43PeXedo1qY74zeGrODJl1KfCGeMc6qJC4rb5Ylml/smzxibqsDeVZGH+TmWHCldRQQ== +"@babel/plugin-proposal-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" + integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.0.0" + "@babel/plugin-syntax-json-strings" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz#9a17b547f64d0676b6c9cecd4edf74a82ab85e7e" - integrity sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz#41c360d59481d88e0ce3a3f837df10121a769b39" + integrity sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0" -"@babel/plugin-proposal-optional-catch-binding@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0.tgz#b610d928fe551ff7117d42c8bb410eec312a6425" - integrity sha512-JPqAvLG1s13B/AuoBjdBYvn38RqW6n1TzrQO839/sIpqLpbnXKacsAgpZHzLD83Sm8SDXMkkrAvEnJ25+0yIpw== +"@babel/plugin-proposal-object-rest-spread@^7.5.4": + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.4.tgz#250de35d867ce8260a31b1fdac6c4fc1baa99331" + integrity sha512-KCx0z3y7y8ipZUMAEEJOyNi11lMb/FOPUjjB113tfowgw0c16EGYos7worCKBcUAh2oG+OBnoUhsnTSoLpV9uA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" + "@babel/plugin-syntax-object-rest-spread" "^7.2.0" -"@babel/plugin-proposal-optional-chaining@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0.tgz#3d344d4152253379b8758e7d041148e8787c4a9d" - integrity sha512-7x8HLa71OzNiofbQUVakS0Kmg++6a+cXNfS7QKHbbv03SuSaumJyaWsfNgw+T7aqrJlqurYpZqrkPgXu0iZK0w== +"@babel/plugin-proposal-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" + integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-chaining" "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" -"@babel/plugin-proposal-pipeline-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.0.0.tgz#ab60169a5c4a598292de59a14f9810d4e47b00b8" - integrity sha512-MN189PDyTMoor/YFh9dk6HpSZLMGHCXRdAhgmzshwcalbgYh5Mkn7Ib17lOo6fmLwHdyQ4GR4yagizfeR2LwQQ== +"@babel/plugin-proposal-optional-chaining@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz#ae454f4c21c6c2ce8cb2397dc332ae8b420c5441" + integrity sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-pipeline-operator" "^7.0.0" + "@babel/plugin-syntax-optional-chaining" "^7.2.0" -"@babel/plugin-proposal-unicode-property-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0.tgz#498b39cd72536cd7c4b26177d030226eba08cd33" - integrity sha512-tM3icA6GhC3ch2SkmSxv7J/hCWKISzwycub6eGsDrFDgukD4dZ/I+x81XgW0YslS6mzNuQ1Cbzh5osjIMgepPQ== +"@babel/plugin-proposal-pipeline-operator@^7.0.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.5.0.tgz#4100ec55ef4f6a4c2490b5f5a4f2a22dfa272c06" + integrity sha512-HFYuu/yGnkn69ligXxU0ohOVvQDsMNOUJs/c4PYLUVS6ntCYOyGmRQQaSYJARJ9rvc7/ulZKIzxd4wk91hN63A== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.2.0" + "@babel/plugin-syntax-pipeline-operator" "^7.5.0" -"@babel/plugin-syntax-async-generators@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0.tgz#bf0891dcdbf59558359d0c626fdc9490e20bc13c" - integrity sha512-im7ged00ddGKAjcZgewXmp1vxSZQQywuQXe2B1A7kajjZmDeY/ekMPmWr9zJgveSaQH0k7BcGrojQhcK06l0zA== +"@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" + integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" -"@babel/plugin-syntax-class-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0.tgz#e051af5d300cbfbcec4a7476e37a803489881634" - integrity sha512-cR12g0Qzn4sgkjrbrzWy2GE7m9vMl/sFkqZ3gIpAQdrvPDnLM8180i+ANDFIXfjHo9aqp0ccJlQ0QNZcFUbf9w== +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-decorators@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.1.0.tgz#2fa7c1a7905a299c9853ebcef340306675f9cbdc" - integrity sha512-uQvRSbgQ0nQg3jsmIixXXDCgSpkBolJ9X7NYThMKCcjvE8dN2uWJUzTUNNAeuKOjARTd+wUQV0ztXpgunZYKzQ== +"@babel/plugin-syntax-decorators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" + integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-dynamic-import@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0.tgz#6dfb7d8b6c3be14ce952962f658f3b7eb54c33ee" - integrity sha512-Gt9xNyRrCHCiyX/ZxDGOcBnlJl0I3IWicpZRC4CdC0P5a/I07Ya2OAMEBU+J7GmRFVmIetqEYRko6QYRuKOESw== +"@babel/plugin-syntax-dynamic-import@^7.0.0", "@babel/plugin-syntax-dynamic-import@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" + integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-export-default-from@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.0.0.tgz#084b639bce3d42f3c5bf3f68ccb42220bb2d729d" - integrity sha512-HNnjg/fFFbnuLAqr/Ocp1Y3GB4AjmXcu1xxn3ql3bS2kGrB/qi+Povshb8i3hOkE5jNozzh8r/0/lq1w8oOWbQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.2.0.tgz#edd83b7adc2e0d059e2467ca96c650ab6d2f3820" + integrity sha512-c7nqUnNST97BWPtoe+Ssi+fJukc9P9/JMZ71IOMNQWza2E+Psrd46N6AEvtw6pqK+gt7ChjXyrw4SPDO79f3Lw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-export-namespace-from@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0.tgz#17a7389a1d2571ac4d9b77ea2defa74a930edf5d" - integrity sha512-l314XT1eMa0MWboSmG4BdKukHfSpSpQRenUoZmEpL6hqc5nc1/ddpLETjPB77gZE1dZ9qxy5D3U3UUjjcX2d4g== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" + integrity sha512-1zGA3UNch6A+A11nIzBVEaE3DDJbjfB+eLIcf0GGOh/BJr/8NxL3546MGhV/r0RhH4xADFIEso39TKCfEMlsGA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-flow@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.0.0.tgz#70638aeaad9ee426bc532e51523cff8ff02f6f17" - integrity sha512-zGcuZWiWWDa5qTZ6iAnpG0fnX/GOu49pGR5PFvkQ9GmKNaSphXQnlNXh/LG20sqWtNrx/eB6krzfEzcwvUyeFA== +"@babel/plugin-syntax-flow@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" + integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-import-meta@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.0.0.tgz#ca946b73216c29c39a55ef2d739097fee8a85d69" - integrity sha512-FEoGvhXVAiWzpDjyZIlBGzKyNk/lnRPy7aPke3PjVkiAY0QFsvFfkjUg5diRwVfowBA8SJqvFt0ZoXNSjl70hQ== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.2.0.tgz#2333ef4b875553a3bcd1e93f8ebc09f5b9213a40" + integrity sha512-Hq6kFSZD7+PHkmBN8bCpHR6J8QEoCuEV/B38AIQscYjgMZkGlXB7cHNFzP5jR4RCh5545yP1ujHdmO7hAgKtBA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-json-strings@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.0.0.tgz#0d259a68090e15b383ce3710e01d5b23f3770cbd" - integrity sha512-UlSfNydC+XLj4bw7ijpldc1uZ/HB84vw+U6BTuqMdIEmz/LDe63w/GHtpQMdXWdqQZFeAI9PjnHe/vDhwirhKA== +"@babel/plugin-syntax-json-strings@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" + integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz#034d5e2b4e14ccaea2e4c137af7e4afb39375ffd" - integrity sha512-PdmL2AoPsCLWxhIr3kG2+F9v4WH06Q3z+NoGVpQgnUNGcagXHq5sB3OXxkSahKq9TLdNMN/AJzFYSOo8UKDMHg== +"@babel/plugin-syntax-jsx@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" + integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0.tgz#b60931d5a15da82625fff6657c39419969598743" - integrity sha512-oAJmMsAvTSIk9y0sZdU2S/nY44PEUuHN7EzNDMgbuR4e/OwyfR9lSmoBJBZ2lslFZIqhksrTt4i+av7uKfNYDw== +"@babel/plugin-syntax-nullish-coalescing-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz#f75083dfd5ade73e783db729bbd87e7b9efb7624" + integrity sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.0.0.tgz#9594c7ce6ce8089a14d732cb9f6b1eeb047413ba" - integrity sha512-t9RMUPWsFXVeUZxEOhIDkVqYLi1sWOTjxFBAp8wJtaARilvkGlEQvSObd2W5YKicDktINI9XmdV0sB2FZaLOpw== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.2.0.tgz#7470fe070c2944469a756752a69a6963135018be" + integrity sha512-DroeVNkO/BnGpL2R7+ZNZqW+E24aR/4YWxP3Qb15d6lPU8KDzF8HlIUIRCOJRn4X77/oyW4mJY+7FHfY82NLtQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0.tgz#37d8fbcaf216bd658ea1aebbeb8b75e88ebc549b" - integrity sha512-5A0n4p6bIiVe5OvQPxBnesezsgFJdHhSs3uFSvaPdMqtsovajLZ+G2vZyvNe10EzJBWWo3AcHGKhAFUxqwp2dw== +"@babel/plugin-syntax-object-rest-spread@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-catch-binding@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0.tgz#886f72008b3a8b185977f7cb70713b45e51ee475" - integrity sha512-Wc+HVvwjcq5qBg1w5RG9o9RVzmCaAg/Vp0erHCKpAYV8La6I94o4GQAmFYNmkzoMO6gzoOSulpKeSSz6mPEoZw== +"@babel/plugin-syntax-optional-catch-binding@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" + integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-chaining@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0.tgz#1e6ecba124310b5d3a8fc1e00d50b1c4c2e05e68" - integrity sha512-QXedQsZf8yua1nNrXSePT0TsGSQH9A1iK08m9dhCMdZeJaaxYcQfXdgHWVV6Cp7WE/afPVvSKIsAHK5wP+yxDA== +"@babel/plugin-syntax-optional-chaining@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" + integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-pipeline-operator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.0.0.tgz#29106ddb293898192780ff48159c77e6f20c1768" - integrity sha512-McK1JV4klGq2r0UZ1SLE2u+u37ElArBcPMGl6JizdgEXD3ttp0dpOB5ZpqpeRHkIgnl46th64UHrFDteQ4P5aw== +"@babel/plugin-syntax-pipeline-operator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.5.0.tgz#8ea7c2c22847c797748bf07752722a317079dc1e" + integrity sha512-5FVxPiMTMXWk4R7Kq9pt272nDu8VImJdaIzvXFSTcXFbgKWWaOdbic12TvUvl6cK+AE5EgnhwvxuWik4ZYYdzg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-arrow-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz#a6c14875848c68a3b4b3163a486535ef25c7e749" - integrity sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w== +"@babel/plugin-transform-arrow-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" + integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz#109e036496c51dd65857e16acab3bafdf3c57811" - integrity sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g== +"@babel/plugin-transform-async-to-generator@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" + integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-remap-async-to-generator" "^7.1.0" -"@babel/plugin-transform-block-scoped-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz#482b3f75103927e37288b3b67b65f848e2aa0d07" - integrity sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ== +"@babel/plugin-transform-block-scoped-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" + integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.1.5.tgz#3e8e0bc9a5104519923302a24f748f72f2f61f37" - integrity sha512-jlYcDrz+5ayWC7mxgpn1Wj8zj0mmjCT2w0mPIMSwO926eXBRxpEgoN/uQVRBfjtr8ayjcmS+xk2G1jaP8JjMJQ== +"@babel/plugin-transform-block-scoping@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" + integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.10" + lodash "^4.17.11" -"@babel/plugin-transform-classes@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz#ab3f8a564361800cbc8ab1ca6f21108038432249" - integrity sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg== +"@babel/plugin-transform-classes@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" + integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.1.0" + "@babel/helper-define-map" "^7.4.4" "@babel/helper-function-name" "^7.1.0" "@babel/helper-optimise-call-expression" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/helper-replace-supers" "^7.4.4" + "@babel/helper-split-export-declaration" "^7.4.4" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz#2fbb8900cd3e8258f2a2ede909b90e7556185e31" - integrity sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA== +"@babel/plugin-transform-computed-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" + integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.0.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.1.3.tgz#e69ff50ca01fac6cb72863c544e516c2b193012f" - integrity sha512-Mb9M4DGIOspH1ExHOUnn2UUXFOyVTiX84fXCd+6B5iWrQg/QMeeRmSwpZ9lnjYLSXtZwiw80ytVMr3zue0ucYw== +"@babel/plugin-transform-destructuring@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" + integrity sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0.tgz#73a24da69bc3c370251f43a3d048198546115e58" - integrity sha512-00THs8eJxOJUFVx1w8i1MBF4XH4PsAjKjQ1eqN/uCH3YKwP21GCKfrn6YZFZswbOk9+0cw1zGQPHVc1KBlSxig== +"@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" + integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.1.3" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" -"@babel/plugin-transform-duplicate-keys@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz#a0601e580991e7cace080e4cf919cfd58da74e86" - integrity sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ== +"@babel/plugin-transform-duplicate-keys@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" + integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-exponentiation-operator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz#9c34c2ee7fd77e02779cfa37e403a2e1003ccc73" - integrity sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ== +"@babel/plugin-transform-exponentiation-operator@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" + integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== dependencies: "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.0.0.tgz#c40ced34c2783985d90d9f9ac77a13e6fb396a01" - integrity sha512-WhXUNb4It5a19RsgKKbQPrjmy4yWOY1KynpEbNw7bnd1QTcrT/EIl3MJvnGgpgvrKyKbqX7nUNOJfkpLOnoDKA== + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.4.tgz#d267a081f49a8705fc9146de0768c6b58dccd8f7" + integrity sha512-WyVedfeEIILYEaWGAUWzVNyqG4sfsNooMhXWsu/YzOvVGcsnPb5PguysjJqI3t3qiaYj0BR8T2f5njdjTGe44Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.2.0" -"@babel/plugin-transform-for-of@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" - integrity sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA== +"@babel/plugin-transform-for-of@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" + integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz#29c5550d5c46208e7f730516d41eeddd4affadbb" - integrity sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg== +"@babel/plugin-transform-function-name@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" + integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== dependencies: "@babel/helper-function-name" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz#2aec1d29cdd24c407359c930cdd89e914ee8ff86" - integrity sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA== +"@babel/plugin-transform-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" + integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz#f9e0a7072c12e296079b5a59f408ff5b97bf86a8" - integrity sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A== +"@babel/plugin-transform-member-expression-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" + integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== dependencies: - "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-commonjs@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz#0a9d86451cbbfb29bd15186306897c67f6f9a05c" - integrity sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA== +"@babel/plugin-transform-modules-amd@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" + integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" + +"@babel/plugin-transform-modules-commonjs@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" + integrity sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ== + dependencies: + "@babel/helper-module-transforms" "^7.4.4" + "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-simple-access" "^7.1.0" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.0.0": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.1.3.tgz#2119a3e3db612fd74a19d88652efbfe9613a5db0" - integrity sha512-PvTxgjxQAq4pvVUZF3mD5gEtVDuId8NtWkJsZLEJZMZAW3TvgQl1pmydLLN1bM8huHFVVU43lf0uvjQj9FRkKw== +"@babel/plugin-transform-modules-systemjs@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" + integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== dependencies: - "@babel/helper-hoist-variables" "^7.0.0" + "@babel/helper-hoist-variables" "^7.4.4" "@babel/helper-plugin-utils" "^7.0.0" + babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz#a29a7d85d6f28c3561c33964442257cc6a21f2a8" - integrity sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig== +"@babel/plugin-transform-modules-umd@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" + integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== dependencies: "@babel/helper-module-transforms" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-new-target@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0.tgz#ae8fbd89517fa7892d20e6564e641e8770c3aa4a" - integrity sha512-yin069FYjah+LbqfGeTfzIBODex/e++Yfa0rH0fpfam9uTbuEeEOx5GLGr210ggOV77mVRNoeqSYqeuaqSzVSw== +"@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" + integrity sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg== + dependencies: + regexp-tree "^0.1.6" + +"@babel/plugin-transform-new-target@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" + integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz#b1ae194a054b826d8d4ba7ca91486d4ada0f91bb" - integrity sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw== +"@babel/plugin-transform-object-super@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" + integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-replace-supers" "^7.1.0" -"@babel/plugin-transform-parameters@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz#44f492f9d618c9124026e62301c296bf606a7aed" - integrity sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw== +"@babel/plugin-transform-parameters@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" + integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== dependencies: - "@babel/helper-call-delegate" "^7.1.0" + "@babel/helper-call-delegate" "^7.4.4" "@babel/helper-get-function-arity" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-transform-property-literals@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" + integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-transform-react-display-name@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.0.0.tgz#93759e6c023782e52c2da3b75eca60d4f10533ee" - integrity sha512-BX8xKuQTO0HzINxT6j/GiCwoJB0AOMs0HmLbEnAvcte8U8rSkNa/eSCAY+l1OA4JnCVq2jw2p6U8QQryy2fTPg== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" + integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-react-jsx-self@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.0.0.tgz#a84bb70fea302d915ea81d9809e628266bb0bc11" - integrity sha512-pymy+AK12WO4safW1HmBpwagUQRl9cevNX+82AIAtU1pIdugqcH+nuYP03Ja6B+N4gliAaKWAegIBL/ymALPHA== + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" + integrity sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" "@babel/plugin-transform-react-jsx-source@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0.tgz#28e00584f9598c0dd279f6280eee213fa0121c3c" - integrity sha512-OSeEpFJEH5dw/TtxTg4nijl4nHBbhqbKL94Xo/Y17WKIf2qJWeIk/QeXACF19lG1vMezkxqruwnTjVizaW7u7w== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.5.0.tgz#583b10c49cf057e237085bcbd8cc960bd83bd96b" + integrity sha512-58Q+Jsy4IDCZx7kqEZuSDdam/1oW8OdDX8f+Loo6xyxdfg1yF0GE2XNJQSTZCaMol93+FBzpWiPEwtbMloAcPg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" "@babel/plugin-transform-react-jsx@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0.tgz#524379e4eca5363cd10c4446ba163f093da75f3e" - integrity sha512-0TMP21hXsSUjIQJmu/r7RiVxeFrXRcMUigbKu0BLegJK9PkYodHstaszcig7zxXfaBji2LYUdtqIkHs+hgYkJQ== + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" + integrity sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg== dependencies: - "@babel/helper-builder-react-jsx" "^7.0.0" + "@babel/helper-builder-react-jsx" "^7.3.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.0.0" + "@babel/plugin-syntax-jsx" "^7.2.0" -"@babel/plugin-transform-regenerator@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz#5b41686b4ed40bef874d7ed6a84bdd849c13e0c1" - integrity sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw== +"@babel/plugin-transform-regenerator@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" + integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== dependencies: - regenerator-transform "^0.13.3" + regenerator-transform "^0.14.0" -"@babel/plugin-transform-shorthand-properties@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz#85f8af592dcc07647541a0350e8c95c7bf419d15" - integrity sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw== +"@babel/plugin-transform-reserved-words@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" + integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz#93583ce48dd8c85e53f3a46056c856e4af30b49b" - integrity sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ== +"@babel/plugin-transform-shorthand-properties@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" + integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-sticky-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz#30a9d64ac2ab46eec087b8530535becd90e73366" - integrity sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw== +"@babel/plugin-transform-spread@^7.2.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" + integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-transform-sticky-regex@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" + integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" -"@babel/plugin-transform-template-literals@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz#084f1952efe5b153ddae69eb8945f882c7a97c65" - integrity sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg== +"@babel/plugin-transform-template-literals@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" + integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== dependencies: "@babel/helper-annotate-as-pure" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-typeof-symbol@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz#4dcf1e52e943e5267b7313bff347fdbe0f81cec9" - integrity sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg== +"@babel/plugin-transform-typeof-symbol@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" + integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-unicode-regex@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz#c6780e5b1863a76fe792d90eded9fcd5b51d68fc" - integrity sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw== +"@babel/plugin-transform-unicode-regex@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" + integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - regexpu-core "^4.1.3" + "@babel/helper-regex" "^7.4.4" + regexpu-core "^4.5.4" "@babel/preset-env@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.1.5.tgz#a28b5482ca8bc2f2d0712234d6c690240b92495d" - integrity sha512-pQ+2o0YyCp98XG0ODOHJd9z4GsSoV5jicSedRwCrU8uiqcJahwQiOq0asSZEb/m/lwyu6X5INvH/DSiwnQKncw== + version "7.5.4" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.4.tgz#64bc15041a3cbb0798930319917e70fcca57713d" + integrity sha512-hFnFnouyRNiH1rL8YkX1ANCNAUVC8Djwdqfev8i1415tnAG+7hlA5zhZ0Q/3Q5gkop4HioIPbCEWAalqcbxRoQ== dependencies: "@babel/helper-module-imports" "^7.0.0" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.1.0" - "@babel/plugin-proposal-json-strings" "^7.0.0" - "@babel/plugin-proposal-object-rest-spread" "^7.0.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.0.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.0.0" - "@babel/plugin-syntax-async-generators" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.0.0" - "@babel/plugin-transform-arrow-functions" "^7.0.0" - "@babel/plugin-transform-async-to-generator" "^7.1.0" - "@babel/plugin-transform-block-scoped-functions" "^7.0.0" - "@babel/plugin-transform-block-scoping" "^7.1.5" - "@babel/plugin-transform-classes" "^7.1.0" - "@babel/plugin-transform-computed-properties" "^7.0.0" - "@babel/plugin-transform-destructuring" "^7.0.0" - "@babel/plugin-transform-dotall-regex" "^7.0.0" - "@babel/plugin-transform-duplicate-keys" "^7.0.0" - "@babel/plugin-transform-exponentiation-operator" "^7.1.0" - "@babel/plugin-transform-for-of" "^7.0.0" - "@babel/plugin-transform-function-name" "^7.1.0" - "@babel/plugin-transform-literals" "^7.0.0" - "@babel/plugin-transform-modules-amd" "^7.1.0" - "@babel/plugin-transform-modules-commonjs" "^7.1.0" - "@babel/plugin-transform-modules-systemjs" "^7.0.0" - "@babel/plugin-transform-modules-umd" "^7.1.0" - "@babel/plugin-transform-new-target" "^7.0.0" - "@babel/plugin-transform-object-super" "^7.1.0" - "@babel/plugin-transform-parameters" "^7.1.0" - "@babel/plugin-transform-regenerator" "^7.0.0" - "@babel/plugin-transform-shorthand-properties" "^7.0.0" - "@babel/plugin-transform-spread" "^7.0.0" - "@babel/plugin-transform-sticky-regex" "^7.0.0" - "@babel/plugin-transform-template-literals" "^7.0.0" - "@babel/plugin-transform-typeof-symbol" "^7.0.0" - "@babel/plugin-transform-unicode-regex" "^7.0.0" - browserslist "^4.1.0" + "@babel/plugin-proposal-async-generator-functions" "^7.2.0" + "@babel/plugin-proposal-dynamic-import" "^7.5.0" + "@babel/plugin-proposal-json-strings" "^7.2.0" + "@babel/plugin-proposal-object-rest-spread" "^7.5.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@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-transform-arrow-functions" "^7.2.0" + "@babel/plugin-transform-async-to-generator" "^7.5.0" + "@babel/plugin-transform-block-scoped-functions" "^7.2.0" + "@babel/plugin-transform-block-scoping" "^7.4.4" + "@babel/plugin-transform-classes" "^7.4.4" + "@babel/plugin-transform-computed-properties" "^7.2.0" + "@babel/plugin-transform-destructuring" "^7.5.0" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/plugin-transform-duplicate-keys" "^7.5.0" + "@babel/plugin-transform-exponentiation-operator" "^7.2.0" + "@babel/plugin-transform-for-of" "^7.4.4" + "@babel/plugin-transform-function-name" "^7.4.4" + "@babel/plugin-transform-literals" "^7.2.0" + "@babel/plugin-transform-member-expression-literals" "^7.2.0" + "@babel/plugin-transform-modules-amd" "^7.5.0" + "@babel/plugin-transform-modules-commonjs" "^7.5.0" + "@babel/plugin-transform-modules-systemjs" "^7.5.0" + "@babel/plugin-transform-modules-umd" "^7.2.0" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" + "@babel/plugin-transform-new-target" "^7.4.4" + "@babel/plugin-transform-object-super" "^7.2.0" + "@babel/plugin-transform-parameters" "^7.4.4" + "@babel/plugin-transform-property-literals" "^7.2.0" + "@babel/plugin-transform-regenerator" "^7.4.5" + "@babel/plugin-transform-reserved-words" "^7.2.0" + "@babel/plugin-transform-shorthand-properties" "^7.2.0" + "@babel/plugin-transform-spread" "^7.2.0" + "@babel/plugin-transform-sticky-regex" "^7.2.0" + "@babel/plugin-transform-template-literals" "^7.4.4" + "@babel/plugin-transform-typeof-symbol" "^7.2.0" + "@babel/plugin-transform-unicode-regex" "^7.4.4" + "@babel/types" "^7.5.0" + browserslist "^4.6.0" + core-js-compat "^3.1.1" invariant "^2.2.2" js-levenshtein "^1.1.3" - semver "^5.3.0" + semver "^5.5.0" "@babel/preset-flow@^7.0.0": version "7.0.0" @@ -805,176 +795,124 @@ "@babel/plugin-transform-react-jsx-self" "^7.0.0" "@babel/plugin-transform-react-jsx-source" "^7.0.0" -"@babel/template@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f" - dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - lodash "^4.2.0" - -"@babel/template@^7.1.0", "@babel/template@^7.1.2": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.1.2.tgz#090484a574fef5a2d2d7726a674eceda5c5b5644" - integrity sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag== +"@babel/template@^7.1.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.1.2" - "@babel/types" "^7.1.2" - -"@babel/template@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" - integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.2.2" - "@babel/types" "^7.2.2" - -"@babel/traverse@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966" - dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/generator" "7.0.0-beta.44" - "@babel/helper-function-name" "7.0.0-beta.44" - "@babel/helper-split-export-declaration" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" - debug "^3.1.0" - globals "^11.1.0" - invariant "^2.2.0" - lodash "^4.2.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.5.tgz#5aafca2039aa058c104cf2bfeb9fc4a857ccbca9" - integrity sha512-eU6XokWypl0MVJo+MTSPUtlfPePkrqsF26O+l1qFGlCKWwmiYAYy2Sy44Qw8m2u/LbPCsxYt90rghmqhYMGpPA== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" + integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.1.5" + "@babel/generator" "^7.5.0" "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.1.5" - "@babel/types" "^7.1.5" - debug "^3.1.0" - globals "^11.1.0" - lodash "^4.17.10" - -"@babel/traverse@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.2.tgz#961039de1f9bcb946d807efe2dba9c92e859d188" - integrity sha512-E5Bn9FSwHpSkUhthw/XEuvFZxIgrqb9M8cX8j5EUQtrUG5DQUy6bFyl7G7iQ1D1Czudor+xkmp81JbLVVM0Sjg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.2.2" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.2.2" - "@babel/types" "^7.2.2" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.5.0" + "@babel/types" "^7.5.0" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.10" - -"@babel/types@7.0.0-beta.44": - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" + lodash "^4.17.11" -"@babel/types@^7.0.0", "@babel/types@^7.1.2", "@babel/types@^7.1.5": - version "7.1.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.1.5.tgz#12fe64e91a431234b7017b4227a78cc0eec4e081" - integrity sha512-sJeqa/d9eM/bax8Ivg+fXF7FpN3E/ZmTrWbkk6r+g7biVYfALMnLin4dKijsaqEhpd2xvOGfQTkQkD31YCVV4A== +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" + integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== dependencies: esutils "^2.0.2" - lodash "^4.17.10" - to-fast-properties "^2.0.0" - -"@babel/types@^7.2.0", "@babel/types@^7.2.2": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.2.2.tgz#44e10fc24e33af524488b716cdaee5360ea8ed1e" - integrity sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg== - dependencies: - esutils "^2.0.2" - lodash "^4.17.10" + lodash "^4.17.11" to-fast-properties "^2.0.0" "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" + integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== dependencies: any-observable "^0.3.0" acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= dependencies: acorn "^3.0.4" -acorn-jsx@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" - dependencies: - acorn "^5.0.3" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= -acorn@^5.0.3, acorn@^5.6.0: +acorn@^5.5.0: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^5.4.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.4.1.tgz#fdc58d9d17f4a4e98d102ded826a9b9759125102" - -ajv-keywords@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" +acorn@^6.0.7: + version "6.2.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" + integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== -ajv@^6.0.1, ajv@^6.5.3: - version "6.5.4" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.4.tgz#247d5274110db653706b550fcc2b797ca28cfc59" +ajv@^6.10.0, ajv@^6.9.1: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== dependencies: fast-deep-equal "^2.0.1" fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ansi-escapes@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-colors@3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== -ansi-escapes@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.0.0.tgz#ec3e8b4e9f8064fc02c3ac9b65f1c275bda8ef92" +ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= ansi-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" any-observable@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" + integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== argparse@^1.0.7: version "1.0.10" @@ -986,63 +924,74 @@ argparse@^1.0.7: arr-diff@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= arr-flatten@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + define-properties "^1.1.2" + es-abstract "^1.7.0" array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= assign-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== atob@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -babel-eslint@^8.2.6: - version "8.2.6" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.6.tgz#6270d0c73205628067c0f7ae1693a9e797acefd9" +babel-eslint@^10.0.2: + version "10.0.2" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456" + integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q== dependencies: - "@babel/code-frame" "7.0.0-beta.44" - "@babel/traverse" "7.0.0-beta.44" - "@babel/types" "7.0.0-beta.44" - babylon "7.0.0-beta.44" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" eslint-scope "3.7.1" eslint-visitor-keys "^1.0.0" -babylon@7.0.0-beta.44: - version "7.0.0-beta.44" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d" +babel-plugin-dynamic-import-node@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" + integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== + dependencies: + object.assign "^4.1.0" balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== dependencies: cache-base "^1.0.1" class-utils "^0.3.5" @@ -1055,6 +1004,7 @@ base@^0.11.1: brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1062,6 +1012,7 @@ brace-expansion@^1.1.7: braces@^2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1074,26 +1025,24 @@ braces@^2.3.1: split-string "^3.0.2" to-regex "^3.0.1" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.3.4.tgz#4477b737db6a1b07077275b24791e680d4300425" - integrity sha512-u5iz+ijIMUlmV8blX82VGFrB9ecnUg5qEt55CMZ/YJEhha+d8qpBfOFuutJ6F/VKRXjZoD33b6uvarpPxcl3RA== +browserslist@^4.6.0, browserslist@^4.6.2: + version "4.6.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" + integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== dependencies: - caniuse-lite "^1.0.30000899" - electron-to-chromium "^1.3.82" - node-releases "^1.0.1" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + caniuse-lite "^1.0.30000984" + electron-to-chromium "^1.3.191" + node-releases "^1.1.25" cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== dependencies: collection-visit "^1.0.0" component-emitter "^1.2.1" @@ -1105,24 +1054,44 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" +caller-callsite@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" + integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= dependencies: - callsites "^0.2.0" + callsites "^2.0.0" -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +caller-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" + integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= + dependencies: + caller-callsite "^2.0.0" + +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000899: - version "1.0.30000906" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000906.tgz#7c44e498a2504f7a5db3b4f91285bbc821157a77" - integrity sha512-ME7JFX6h0402om/nC/8Lw+q23QvPe2ust9U0ntLmkX9F2zaGwq47fZkjlyHKirFBuq1EM+T/LXBcDdW4bvkCTA== +caniuse-lite@^1.0.30000984: + version "1.0.30000984" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz#dc96c3c469e9bcfc6ad5bdd24c77ec918ea76fe0" + integrity sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA== -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= dependencies: ansi-styles "^2.2.1" escape-string-regexp "^1.0.2" @@ -1130,9 +1099,10 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" @@ -1141,43 +1111,34 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1: chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -ci-info@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.4.0.tgz#4841d53cad49f11b827b648ebde27a6e189b412f" - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== dependencies: arr-union "^3.1.0" define-property "^0.2.5" isobject "^3.0.0" static-extend "^0.1.1" -cli-cursor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - dependencies: - restore-cursor "^1.0.1" - -cli-cursor@^2.1.0: +cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= dependencies: restore-cursor "^2.0.0" -cli-spinners@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-0.1.2.tgz#bb764d88e185fb9e1e6a2a1f19772318f605e31c" - cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" + integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= dependencies: slice-ansi "0.0.4" string-width "^1.0.1" @@ -1185,47 +1146,61 @@ cli-truncate@^0.2.1: cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= dependencies: map-visit "^1.0.0" object-visit "^1.0.0" color-convert@^1.9.0: - version "1.9.2" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.2.tgz#49881b8fba67df12a96bdf3f56c0aab9e7913147" + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: - color-name "1.1.1" + color-name "1.1.3" -color-name@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" - -commander@2.11.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= commander@^2.14.1, commander@^2.9.0: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== component-emitter@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= contains-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= convert-source-map@^1.1.0: version "1.6.0" @@ -1237,26 +1212,45 @@ convert-source-map@^1.1.0: copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js-compat@^3.1.1: + version "3.1.4" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.4.tgz#e4d0c40fbd01e65b1d457980fe4112d4358a7408" + integrity sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg== + dependencies: + browserslist "^4.6.2" + core-js-pure "3.1.4" + semver "^6.1.1" + +core-js-pure@3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.4.tgz#5fa17dc77002a169a3566cc48dc774d2e13e3769" + integrity sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA== -cosmiconfig@^5.0.2: - version "5.0.6" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.6.tgz#dca6cf680a0bd03589aff684700858c81abeeb39" +cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: + version "5.2.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" + integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== dependencies: + import-fresh "^2.0.0" is-directory "^0.3.1" - js-yaml "^3.9.0" + js-yaml "^3.13.1" parse-json "^4.0.0" cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= dependencies: lru-cache "^4.0.1" shebang-command "^1.2.0" which "^1.2.9" -cross-spawn@^6.0.5: +cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -1265,237 +1259,293 @@ cross-spawn@^6.0.5: which "^1.2.9" date-fns@^1.27.2: - version "1.29.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" + version "1.30.1" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" + integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -debug@3.1.0, debug@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" +debug@3.2.6, debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== dependencies: - ms "2.0.0" + ms "^2.1.1" debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== dependencies: ms "2.0.0" -debug@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== +debug@^4.0.1, debug@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== dependencies: ms "^2.1.1" +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" + integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +define-properties@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" define-property@^0.2.5: version "0.2.5" resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= dependencies: is-descriptor "^0.1.0" define-property@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= dependencies: is-descriptor "^1.0.0" define-property@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== dependencies: is-descriptor "^1.0.2" isobject "^3.0.1" -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -diff@3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= dependencies: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== dependencies: esutils "^2.0.2" -electron-to-chromium@^1.3.82: - version "1.3.83" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.83.tgz#74584eb0972bb6777811c5d68d988c722f5e6666" - integrity sha512-DqJoDarxq50dcHsOOlMLNoy+qQitlMNbYb6wwbE0oUw2veHdRkpNrhmngiUYKMErdJ8SJ48rpJsZTQgy5SoEAA== +electron-to-chromium@^1.3.191: + version "1.3.191" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.191.tgz#c451b422cd8b2eab84dedabab5abcae1eaefb6f0" + integrity sha512-jasjtY5RUy/TOyiUYM2fb4BDaPZfm6CXRFeJDMfFsXYADGxUN49RBqtgB7EL2RmJXeIRUk9lM1U6A5yk2YJMPQ== elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" + integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= -error-ex@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== dependencies: - is-arrayish "^0.2.1" + once "^1.4.0" -error-ex@^1.3.1: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== dependencies: is-arrayish "^0.2.1" +es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -eslint-config-babel@^7.0.1: - version "7.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.2.tgz#cbde74f61cee087d8cd6e607fcfa087869a02d99" +eslint-config-babel@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-9.0.0.tgz#bcfb9e9a1892aff29b8773cb9d2c76639de83c07" + integrity sha512-J7l2KdDKi2y9QifMqXdSIkghrVXr6fcpxegj+803C+4xBfpp0h2LcY9X5N+ivJMBoX6G2PJ/TBTM1Kro0MELBA== -eslint-import-resolver-node@^0.3.1: +eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" + integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== dependencies: debug "^2.6.9" resolve "^1.5.0" -eslint-module-utils@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" +eslint-module-utils@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" + integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== dependencies: debug "^2.6.8" - pkg-dir "^1.0.0" + pkg-dir "^2.0.0" -eslint-plugin-flowtype@^2.30.3: - version "2.45.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.45.0.tgz#20d8b15d1e1e71ea4e9498e8be3fc62c0752fcbf" +eslint-plugin-flowtype@^3.11.1: + version "3.11.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.11.1.tgz#1aae15a10dbcd5aecc89897f810f2e9fcc18a5e3" + integrity sha512-4NiaaGZuz9iEGRTK8j4lkA/scibOXSYaYoHbsTtgLOxxqQCkbWV3xt8ETqILKg7DAYDqB69z1H5U71UmtdF9hw== dependencies: - lodash "^4.15.0" + lodash "^4.17.11" eslint-plugin-import@^2.14.0: - version "2.14.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" + version "2.18.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" + integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== dependencies: + array-includes "^3.0.3" contains-path "^0.1.0" - debug "^2.6.8" + debug "^2.6.9" doctrine "1.5.0" - eslint-import-resolver-node "^0.3.1" - eslint-module-utils "^2.2.0" - has "^1.0.1" - lodash "^4.17.4" - minimatch "^3.0.3" + eslint-import-resolver-node "^0.3.2" + eslint-module-utils "^2.4.0" + has "^1.0.3" + lodash "^4.17.11" + minimatch "^3.0.4" read-pkg-up "^2.0.0" - resolve "^1.6.0" + resolve "^1.11.0" -eslint-plugin-prettier@^2.1.2: - version "2.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" +eslint-plugin-prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" + integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== dependencies: - fast-diff "^1.1.1" - jest-docblock "^21.0.0" + prettier-linter-helpers "^1.0.0" eslint-scope@3.7.1: version "3.7.1" - resolved "http://registry.npm.taobao.org/eslint-scope/download/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" +eslint-scope@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" + integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + version "1.4.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" + integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + dependencies: + eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223" +eslint@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" + integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== dependencies: "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" + ajv "^6.10.0" chalk "^2.1.0" cross-spawn "^6.0.5" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^4.0.0" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^4.0.3" eslint-utils "^1.3.1" eslint-visitor-keys "^1.0.0" - espree "^4.0.0" + espree "^6.0.0" esquery "^1.0.1" esutils "^2.0.2" - file-entry-cache "^2.0.0" + file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob "^7.1.2" + glob-parent "^3.1.0" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" - js-yaml "^3.12.0" + inquirer "^6.2.2" + is-glob "^4.0.0" + js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.5" + lodash "^4.17.11" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" progress "^2.0.0" - regexpp "^2.0.0" - require-uncached "^1.0.3" + regexpp "^2.0.1" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" - table "^4.0.3" + table "^5.2.3" text-table "^0.2.0" espree@^3.5.2: - version "3.5.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.3.tgz#931e0af64e7fbbed26b050a29daad1fc64799fa6" + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== dependencies: - acorn "^5.4.0" + acorn "^5.5.0" acorn-jsx "^3.0.0" -espree@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" +espree@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" + integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== dependencies: - acorn "^5.6.0" - acorn-jsx "^4.1.1" + acorn "^6.0.7" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" esprima@^4.0.0: version "4.0.1" @@ -1505,26 +1555,31 @@ esprima@^4.0.0: esquery@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== dependencies: estraverse "^4.0.0" esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== dependencies: estraverse "^4.1.0" estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= esutils@^2.0.0, esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= execa@^0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" + integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== dependencies: cross-spawn "^5.0.1" get-stream "^3.0.0" @@ -1534,13 +1589,23 @@ execa@^0.9.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" expand-brackets@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= dependencies: debug "^2.3.3" define-property "^0.2.5" @@ -1553,19 +1618,22 @@ expand-brackets@^2.1.4: extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= dependencies: is-extendable "^0.1.0" extend-shallow@^3.0.0, extend-shallow@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= dependencies: assign-symbols "^1.0.0" is-extendable "^1.0.1" -external-editor@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== dependencies: chardet "^0.7.0" iconv-lite "^0.4.24" @@ -1574,6 +1642,7 @@ external-editor@^3.0.0: extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== dependencies: array-unique "^0.3.2" define-property "^1.0.0" @@ -1587,22 +1656,27 @@ extglob@^2.0.4: fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= -fast-diff@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= dependencies: escape-string-regexp "^1.0.5" object-assign "^4.1.0" @@ -1610,19 +1684,21 @@ figures@^1.7.0: figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= dependencies: escape-string-regexp "^1.0.5" -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" + flat-cache "^2.0.1" fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= dependencies: extend-shallow "^2.0.1" is-number "^3.0.0" @@ -1632,76 +1708,119 @@ fill-range@^4.0.0: find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" + integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" +find-up@3.0.0, find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" + locate-path "^3.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" - resolved "http://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= dependencies: locate-path "^2.0.0" -find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== dependencies: - locate-path "^3.0.0" + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" -flat-cache@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" +flat@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" + integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" + is-buffer "~2.0.3" + +flatted@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= dependencies: map-cache "^0.2.2" fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -function-bind@^1.0.2: +function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= -get-own-enumerable-property-symbols@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-2.0.1.tgz#5c4ad87f2834c4b9b4e84549dc1e0650fb38c24b" +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" + integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== get-stdin@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" + integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" get-value@^2.0.3, get-value@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= -glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" +glob-parent@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" + integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= + dependencies: + is-glob "^3.1.0" + path-dirname "^1.0.0" + +glob@7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -1710,46 +1829,54 @@ glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0, globals@^11.7.0: - version "11.7.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0, globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== -growl@1.10.3: - version "1.10.3" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= dependencies: ansi-regex "^2.0.0" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= has-value@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= dependencies: get-value "^2.0.3" has-values "^0.1.4" @@ -1758,6 +1885,7 @@ has-value@^0.3.1: has-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= dependencies: get-value "^2.0.6" has-values "^1.0.0" @@ -1766,37 +1894,43 @@ has-value@^1.0.0: has-values@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= has-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= dependencies: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: - function-bind "^1.0.2" + function-bind "^1.1.1" -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== hosted-git-info@^2.1.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== husky@^1.0.0-rc.13: - version "1.0.0-rc.13" - resolved "https://registry.yarnpkg.com/husky/-/husky-1.0.0-rc.13.tgz#49c3cc210bfeac24d4ad272f770b7505c9091828" + version "1.3.1" + resolved "https://registry.yarnpkg.com/husky/-/husky-1.3.1.tgz#26823e399300388ca2afff11cfa8a86b0033fae0" + integrity sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg== dependencies: - cosmiconfig "^5.0.2" - execa "^0.9.0" + cosmiconfig "^5.0.7" + execa "^1.0.0" find-up "^3.0.0" get-stdin "^6.0.0" - is-ci "^1.1.0" + is-ci "^2.0.0" pkg-dir "^3.0.0" please-upgrade-node "^3.1.1" read-pkg "^4.0.1" @@ -1806,109 +1940,149 @@ husky@^1.0.0-rc.13: iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" + integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= + dependencies: + caller-path "^2.0.0" + resolve-from "^3.0.0" + +import-fresh@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -indent-string@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" - dependencies: - repeating "^2.0.0" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= dependencies: once "^1.3.0" wrappy "1" inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inquirer@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" +inquirer@^6.2.2: + version "6.5.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" + integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" + ansi-escapes "^3.2.0" + chalk "^2.4.2" cli-cursor "^2.1.0" cli-width "^2.0.0" - external-editor "^3.0.0" + external-editor "^3.0.3" figures "^2.0.0" - lodash "^4.17.10" + lodash "^4.17.12" mute-stream "0.0.7" run-async "^2.2.0" - rxjs "^6.1.0" + rxjs "^6.4.0" string-width "^2.1.0" - strip-ansi "^4.0.0" + strip-ansi "^5.1.0" through "^2.3.6" -invariant@^2.2.0, invariant@^2.2.2: +invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== dependencies: loose-envify "^1.0.0" +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + is-accessor-descriptor@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= dependencies: kind-of "^3.0.2" is-accessor-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== dependencies: kind-of "^6.0.0" is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" +is-buffer@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" + integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== -is-ci@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.0.tgz#3f4a08d6303a09882cef3f0fb97439c5f5ce2d53" +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== dependencies: - ci-info "^1.3.0" + ci-info "^2.0.0" is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= dependencies: kind-of "^3.0.2" is-data-descriptor@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== dependencies: kind-of "^6.0.0" +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== dependencies: is-accessor-descriptor "^0.1.6" is-data-descriptor "^0.1.4" @@ -1917,6 +2091,7 @@ is-descriptor@^0.1.0: is-descriptor@^1.0.0, is-descriptor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== dependencies: is-accessor-descriptor "^1.0.0" is-data-descriptor "^1.0.0" @@ -1925,150 +2100,159 @@ is-descriptor@^1.0.0, is-descriptor@^1.0.2: is-directory@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" + integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= is-extendable@^0.1.0, is-extendable@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= is-extendable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== dependencies: is-plain-object "^2.0.4" -is-extglob@^2.1.1: +is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= dependencies: number-is-nan "^1.0.0" is-fullwidth-code-point@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= + dependencies: + is-extglob "^2.1.0" is-glob@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.0.tgz#9521c76845cc2610a85203ddf080a958c2ffabc0" + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== dependencies: is-extglob "^2.1.1" is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= dependencies: kind-of "^3.0.2" is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" + integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== dependencies: symbol-observable "^1.1.0" -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" - dependencies: - path-is-inside "^1.0.1" - -is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: +is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== dependencies: isobject "^3.0.1" is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" is-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - -is-resolvable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== isarray@1.0.0, isarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= isobject@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= dependencies: isarray "1.0.0" isobject@^3.0.0, isobject@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - -jest-docblock@^21.0.0: - version "21.2.0" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= jest-get-type@^22.1.0: version "22.4.3" resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" + integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== jest-validate@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.5.0.tgz#f5df8f761cf43155e1b2e21d6e9de8a2852d0231" + version "23.6.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" + integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== dependencies: chalk "^2.0.1" jest-get-type "^22.1.0" leven "^2.1.0" - pretty-format "^23.5.0" + pretty-format "^23.6.0" js-levenshtein@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.4.tgz#3a56e3cbf589ca0081eb22cd9ba0b1290a16d26e" - integrity sha512-PxfGzSs0ztShKrUYPIn5r0MtyAhYcCwmndozzpz8YObbPnD1jFxzlBGbRnX2mIu6Z13xN6+PTu05TQFnZFlzow== - -js-tokens@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + version "1.1.6" + resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" + integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.12.0, js-yaml@^3.9.0: +js-yaml@3.13.1, js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -2077,8 +2261,9 @@ js-yaml@^3.12.0, js-yaml@^3.9.0: esprima "^4.0.0" jsesc@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== jsesc@~0.5.0: version "0.5.0" @@ -2088,14 +2273,17 @@ jsesc@~0.5.0: json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= json5@^2.1.0: version "2.1.0" @@ -2107,37 +2295,51 @@ json5@^2.1.0: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= dependencies: is-buffer "^1.1.5" kind-of@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= dependencies: is-buffer "^1.1.5" kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" leven@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= dependencies: prelude-ls "~1.1.2" type-check "~0.3.2" lint-staged@^7.2.2: - version "7.2.2" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.2.2.tgz#0983d55d497f19f36d11ff2c8242b2f56cc2dd05" + version "7.3.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.3.0.tgz#90ff33e5ca61ed3dbac35b6f6502dbefdc0db58d" + integrity sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw== dependencies: chalk "^2.3.1" commander "^2.14.1" @@ -2165,10 +2367,12 @@ lint-staged@^7.2.2: listr-silent-renderer@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" + integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= -listr-update-renderer@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.4.0.tgz#344d980da2ca2e8b145ba305908f32ae3f4cc8a7" +listr-update-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" + integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== dependencies: chalk "^1.1.3" cli-truncate "^0.2.1" @@ -2176,42 +2380,38 @@ listr-update-renderer@^0.4.0: figures "^1.7.0" indent-string "^3.0.0" log-symbols "^1.0.2" - log-update "^1.0.2" + log-update "^2.3.0" strip-ansi "^3.0.1" -listr-verbose-renderer@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.4.1.tgz#8206f4cf6d52ddc5827e5fd14989e0e965933a35" +listr-verbose-renderer@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" + integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== dependencies: - chalk "^1.1.3" - cli-cursor "^1.0.2" + chalk "^2.4.1" + cli-cursor "^2.1.0" date-fns "^1.27.2" - figures "^1.7.0" + figures "^2.0.0" listr@^0.14.1: - version "0.14.1" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.1.tgz#8a7afa4a7135cee4c921d128e0b7dfc6e522d43d" + version "0.14.3" + resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" + integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== dependencies: "@samverschueren/stream-to-observable" "^0.3.0" - cli-truncate "^0.2.1" - figures "^1.7.0" - indent-string "^2.1.0" is-observable "^1.1.0" is-promise "^2.1.0" is-stream "^1.1.0" listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.4.0" - listr-verbose-renderer "^0.4.0" - log-symbols "^1.0.2" - log-update "^1.0.2" - ora "^0.2.3" - p-map "^1.1.1" - rxjs "^6.1.0" - strip-ansi "^3.0.1" + listr-update-renderer "^0.5.0" + listr-verbose-renderer "^0.5.0" + p-map "^2.0.0" + rxjs "^6.3.3" load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= dependencies: graceful-fs "^4.1.2" parse-json "^2.2.0" @@ -2221,6 +2421,7 @@ load-json-file@^2.0.0: locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= dependencies: p-locate "^2.0.0" path-exists "^3.0.0" @@ -2228,60 +2429,86 @@ locate-path@^2.0.0: locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== dependencies: p-locate "^3.0.0" path-exists "^3.0.0" -lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0: +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.5: version "4.17.14" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" - dependencies: - chalk "^1.0.0" - -log-symbols@^2.2.0: +log-symbols@2.2.0, log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" + integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== dependencies: chalk "^2.0.1" -log-update@^1.0.2: +log-symbols@^1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-1.0.2.tgz#19929f64c4093d2d2e7075a1dad8af59c296b8d1" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" + integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= + dependencies: + chalk "^1.0.0" + +log-update@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" + integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= dependencies: - ansi-escapes "^1.0.0" - cli-cursor "^1.0.2" + ansi-escapes "^3.0.0" + cli-cursor "^2.0.0" + wrap-ansi "^3.0.1" loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== dependencies: js-tokens "^3.0.0 || ^4.0.0" lru-cache@^4.0.1: - version "4.1.3" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== dependencies: pseudomap "^1.0.2" yallist "^2.1.2" +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= dependencies: object-visit "^1.0.0" +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -2300,16 +2527,24 @@ micromatch@^3.1.8: mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -minimatch@^3.0.3, minimatch@^3.0.4: +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@3.0.4, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== dependencies: brace-expansion "^1.1.7" minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= minimist@^1.2.0: version "1.2.0" @@ -2317,8 +2552,9 @@ minimist@^1.2.0: integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" @@ -2326,40 +2562,63 @@ mixin-deep@^1.2.0: mkdirp@0.5.1, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= dependencies: minimist "0.0.8" -mocha@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.1.tgz#759b62c836b0732382a62b6b1fb245ec1bc943ac" +mocha@^6.1.4: + version "6.1.4" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.1.4.tgz#e35fada242d5434a7e163d555c705f6875951640" + integrity sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg== dependencies: - browser-stdout "1.3.0" - commander "2.11.0" - debug "3.1.0" - diff "3.3.1" + ansi-colors "3.2.3" + browser-stdout "1.3.1" + debug "3.2.6" + diff "3.5.0" escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.3" - he "1.1.1" + find-up "3.0.0" + glob "7.1.3" + growl "1.10.5" + he "1.2.0" + js-yaml "3.13.1" + log-symbols "2.2.0" + minimatch "3.0.4" mkdirp "0.5.1" - supports-color "4.4.0" + ms "2.1.1" + node-environment-flags "1.0.5" + object.assign "4.1.0" + strip-json-comments "2.0.1" + supports-color "6.0.0" + which "1.3.1" + wide-align "1.1.3" + yargs "13.2.2" + yargs-parser "13.0.0" + yargs-unparser "1.5.0" ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.1.1: +ms@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + mute-stream@0.0.7: version "0.0.7" - resolved "http://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" @@ -2376,42 +2635,56 @@ nanomatch@^1.2.9: natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -node-releases@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.0.3.tgz#3414ed84595096459c251699bfcb47d88324a9e4" - integrity sha512-ZaZWMsbuDcetpHmYeKWPO6e63pSXLb50M7lJgCbcM2nC/nQC3daNifmtp5a2kp7EWwYfhuvH6zLPWkrF8IiDdw== +node-environment-flags@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" + integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== + dependencies: + object.getownpropertydescriptors "^2.0.3" + semver "^5.7.0" + +node-releases@^1.1.25: + version "1.1.25" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" + integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== dependencies: semver "^5.3.0" normalize-package-data@^2.3.2: - version "2.4.0" - resolved "http://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== dependencies: hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" + resolve "^1.10.0" semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" npm-path@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" + integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== dependencies: which "^1.2.10" npm-run-path@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= dependencies: path-key "^2.0.0" npm-which@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" + integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= dependencies: commander "^2.9.0" npm-path "^2.0.2" @@ -2420,50 +2693,77 @@ npm-which@^3.0.1: number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= object-copy@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= dependencies: copy-descriptor "^0.1.0" define-property "^0.2.5" kind-of "^3.0.3" +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= dependencies: isobject "^3.0.0" +object.assign@4.1.0, object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= dependencies: isobject "^3.0.1" -once@^1.3.0: +once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= dependencies: mimic-fn "^1.0.0" optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= dependencies: deep-is "~0.1.3" fast-levenshtein "~2.0.4" @@ -2472,68 +2772,101 @@ optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -ora@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/ora/-/ora-0.2.3.tgz#37527d220adcd53c39b73571d754156d5db657a4" +os-locale@^3.0.0, os-locale@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== dependencies: - chalk "^1.1.1" - cli-cursor "^1.0.2" - cli-spinners "^0.1.2" - object-assign "^4.0.1" + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" os-tmpdir@~1.0.2: version "1.0.2" - resolved "http://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== p-limit@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.2.0.tgz#0e92b6bedcb59f022c13d0f1949dc82d15909f1c" + version "1.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-limit@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== dependencies: p-try "^2.0.0" p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= dependencies: p-limit "^1.1.0" p-locate@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== dependencies: p-limit "^2.0.0" p-map@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== + +p-map@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" + integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= p-try@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" parse-json@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= dependencies: error-ex "^1.2.0" parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= dependencies: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" @@ -2541,94 +2874,102 @@ parse-json@^4.0.0: pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" +path-dirname@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" + integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1, path-is-inside@^1.0.2: +path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== path-type@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= dependencies: pify "^2.0.0" pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" +pkg-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" + integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= dependencies: - find-up "^1.0.0" + find-up "^2.1.0" pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== dependencies: find-up "^3.0.0" please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" + integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== dependencies: semver-compare "^1.0.0" -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" prettier@^1.4.4: - version "1.14.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.14.2.tgz#0ac1c6e1a90baa22a62925f41963c841983282f9" + version "1.18.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" + integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== -pretty-format@^23.5.0: - version "23.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.5.0.tgz#0f9601ad9da70fe690a269cd3efca732c210687c" +pretty-format@^23.6.0: + version "23.6.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" + integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== dependencies: ansi-regex "^3.0.0" ansi-styles "^3.2.0" @@ -2639,20 +2980,32 @@ private@^0.1.6: integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== progress@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== read-pkg-up@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= dependencies: find-up "^2.0.0" read-pkg "^2.0.0" @@ -2660,6 +3013,7 @@ read-pkg-up@^2.0.0: read-pkg@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= dependencies: load-json-file "^2.0.0" normalize-package-data "^2.3.2" @@ -2668,15 +3022,16 @@ read-pkg@^2.0.0: read-pkg@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" + integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= dependencies: normalize-package-data "^2.3.2" parse-json "^4.0.0" pify "^3.0.0" -regenerate-unicode-properties@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" - integrity sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw== +regenerate-unicode-properties@^8.0.2: + version "8.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" + integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== dependencies: regenerate "^1.4.0" @@ -2685,100 +3040,106 @@ regenerate@^1.4.0: resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== -regenerator-transform@^0.13.3: - version "0.13.3" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.3.tgz#264bd9ff38a8ce24b06e0636496b2c856b57bcbb" - integrity sha512-5ipTrZFSq5vU2YoGoww4uaRVAK4wyYC4TSICibbfEPOruUu8FFP7ErV0BjmbIOEpn3O/k9na9UEdYR/3m7N6uA== +regenerator-transform@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.0.tgz#2ca9aaf7a2c239dd32e4761218425b8c7a86ecaf" + integrity sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w== dependencies: private "^0.1.6" regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== dependencies: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" +regexp-tree@^0.1.6: + version "0.1.11" + resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" + integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== -regexpu-core@^4.1.3, regexpu-core@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.2.0.tgz#a3744fa03806cffe146dea4421a3e73bdcc47b1d" - integrity sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw== +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +regexpu-core@^4.5.4: + version "4.5.4" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" + integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== dependencies: regenerate "^1.4.0" - regenerate-unicode-properties "^7.0.0" - regjsgen "^0.4.0" - regjsparser "^0.3.0" + regenerate-unicode-properties "^8.0.2" + regjsgen "^0.5.0" + regjsparser "^0.6.0" unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.0.2" + unicode-match-property-value-ecmascript "^1.1.0" -regjsgen@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.4.0.tgz#c1eb4c89a209263f8717c782591523913ede2561" - integrity sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA== +regjsgen@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" + integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== -regjsparser@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.3.0.tgz#3c326da7fcfd69fa0d332575a41c8c0cdf588c96" - integrity sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA== +regjsparser@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" + integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== dependencies: jsesc "~0.5.0" repeat-element@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= -resolve-from@^1.0.0: +require-main-filename@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= -resolve@^1.3.2, resolve@^1.6.0: - version "1.8.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" - integrity sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA== - dependencies: - path-parse "^1.0.5" - -resolve@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" - dependencies: - path-parse "^1.0.5" - -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" +resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" + path-parse "^1.0.6" restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= dependencies: onetime "^2.0.0" signal-exit "^3.0.2" @@ -2786,26 +3147,31 @@ restore-cursor@^2.0.0: ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rimraf@^2.2.8: - version "2.6.2" - resolved "http://registry.npm.taobao.org/rimraf/download/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: - glob "^7.0.5" + glob "^7.1.3" run-async@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= dependencies: is-promise "^2.1.0" run-node@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" + integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== -rxjs@^6.1.0: - version "6.2.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.2.2.tgz#eb75fa3c186ff5289907d06483a77884586e1cf9" +rxjs@^6.3.3, rxjs@^6.4.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== dependencies: tslib "^1.9.0" @@ -2817,42 +3183,39 @@ safe-buffer@~5.1.1: safe-regex@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= dependencies: ret "~0.1.10" "safer-buffer@>= 2.1.2 < 3": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== semver-compare@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" + integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5": - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -semver@^5.3.0, semver@^5.4.1, semver@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -semver@^5.5.0, semver@^5.5.1: - version "5.5.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== -set-value@^0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.1" - to-object-path "^0.3.0" +semver@^6.1.1: + version "6.2.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" + integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== -set-value@^2.0.0: +set-blocking@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== dependencies: extend-shallow "^2.0.1" is-extendable "^0.1.1" @@ -2862,34 +3225,43 @@ set-value@^2.0.0: shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= dependencies: shebang-regex "^1.0.0" shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" + integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== dependencies: define-property "^1.0.0" isobject "^3.0.0" @@ -2898,12 +3270,14 @@ snapdragon-node@^2.0.1: snapdragon-util@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== dependencies: kind-of "^3.2.0" snapdragon@^0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== dependencies: base "^0.11.1" debug "^2.2.0" @@ -2917,6 +3291,7 @@ snapdragon@^0.8.1: source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== dependencies: atob "^2.1.1" decode-uri-component "^0.2.0" @@ -2927,28 +3302,43 @@ source-map-resolve@^0.5.0: source-map-url@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== dependencies: - spdx-license-ids "^1.0.2" + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" +spdx-license-ids@^3.0.0: + version "3.0.5" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" + integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== dependencies: extend-shallow "^3.0.0" @@ -2960,10 +3350,12 @@ sprintf-js@~1.0.2: staged-git-files@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" + integrity sha512-H89UNKr1rQJvI1c/PIR3kiAMBV23yvR7LItZiV74HWZwzt7f3YHuujJ9nJZlt58WlFox7XQsOahexwk7nTe69A== static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= dependencies: define-property "^0.2.5" object-copy "^0.1.0" @@ -2971,112 +3363,146 @@ static-extend@^0.1.1: string-argv@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" + integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= dependencies: code-point-at "^1.0.0" is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== dependencies: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + stringify-object@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.2.tgz#9853052e5a88fb605a44cd27445aa257ad7ffbcd" + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== dependencies: - get-own-enumerable-property-symbols "^2.0.1" + get-own-enumerable-property-symbols "^3.0.0" is-obj "^1.0.1" is-regexp "^1.0.0" strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= dependencies: ansi-regex "^2.0.0" strip-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= -strip-json-comments@^2.0.1: +strip-json-comments@2.0.1, strip-json-comments@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -supports-color@4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" +supports-color@6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" + integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== dependencies: - has-flag "^2.0.0" + has-flag "^3.0.0" supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" + integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -table@^4.0.3: - version "4.0.3" - resolved "https://registry.npmjs.org/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" +table@^5.2.3: + version "5.4.1" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.1.tgz#0691ae2ebe8259858efb63e550b6d5f9300171e8" + integrity sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w== dependencies: - ajv "^6.0.1" - ajv-keywords "^3.0.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" + ajv "^6.9.1" + lodash "^4.17.11" + slice-ansi "^2.1.0" + string-width "^3.0.0" text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= through@^2.3.6: version "2.3.8" - resolved "http://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= to-object-path@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= dependencies: kind-of "^3.0.2" to-regex-range@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= dependencies: is-number "^3.0.0" repeat-string "^1.6.1" @@ -3084,6 +3510,7 @@ to-regex-range@^2.1.0: to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== dependencies: define-property "^2.0.2" extend-shallow "^3.0.2" @@ -3093,14 +3520,17 @@ to-regex@^3.0.1, to-regex@^3.0.2: trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== type-check@~0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= dependencies: prelude-ls "~1.1.2" @@ -3117,28 +3547,30 @@ unicode-match-property-ecmascript@^1.0.4: unicode-canonical-property-names-ecmascript "^1.0.4" unicode-property-aliases-ecmascript "^1.0.4" -unicode-match-property-value-ecmascript@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz#9f1dc76926d6ccf452310564fd834ace059663d4" - integrity sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ== +unicode-match-property-value-ecmascript@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" + integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== unicode-property-aliases-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz#5a533f31b4317ea76f17d807fa0d116546111dd0" - integrity sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg== + version "1.0.5" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" + integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== union-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== dependencies: arr-union "^3.1.0" get-value "^2.0.6" is-extendable "^0.1.1" - set-value "^0.4.3" + set-value "^2.0.1" unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= dependencies: has-value "^0.3.1" isobject "^3.0.0" @@ -3146,44 +3578,154 @@ unset-value@^1.0.0: uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== dependencies: punycode "^2.1.0" urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" -which@^1.2.10, which@^1.2.9: +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@1.3.1, which@^1.2.10, which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== dependencies: isexe "^2.0.0" +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrap-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" + integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== dependencies: mkdirp "^0.5.1" +"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + yallist@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= + +yargs-parser@13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.0.0.tgz#3fc44f3e76a8bdb1cc3602e860108602e5ccde8b" + integrity sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-parser@^13.0.0: + version "13.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" + integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-unparser@1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.5.0.tgz#f2bb2a7e83cbc87bb95c8e572828a06c9add6e0d" + integrity sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw== + dependencies: + flat "^4.1.0" + lodash "^4.17.11" + yargs "^12.0.5" + +yargs@13.2.2: + version "13.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993" + integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA== + dependencies: + cliui "^4.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + os-locale "^3.1.0" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.0.0" + +yargs@^12.0.5: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" From 6b3e9e3f1e857507ce2b826288e5c3dccf8cf693 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2019 21:16:13 -0500 Subject: [PATCH 686/965] Bump eslint-utils from 1.4.0 to 1.4.2 (babel/babel-eslint#796) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-parser/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index 73f0201860e2..d07a7c381491 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -1477,16 +1477,16 @@ eslint-scope@^4.0.3: estraverse "^4.1.1" eslint-utils@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c" - integrity sha512-7ehnzPaP5IIEh1r1tkjuIrxqhNkzUJa9z3R92tLJdZIVdWaczEhr3EbhGtsMrVxi1KeR8qA7Off6SWc5WNQqyQ== + version "1.4.2" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" + integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== dependencies: eslint-visitor-keys "^1.0.0" eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== eslint@^6.0.1: version "6.0.1" From 3396fdd7f7aff3c50e6fb9388b1e40cfc333e5e7 Mon Sep 17 00:00:00 2001 From: Chiawen Chen Date: Sat, 2 Nov 2019 07:08:32 +0800 Subject: [PATCH 687/965] Breaking: make AST match Espree 6 (babel/babel-eslint#785) --- .../lib/babylon-to-espree/convertAST.js | 20 --------------- eslint/babel-eslint-parser/package.json | 2 +- .../test/specs/babel-eslint.js | 4 ++- eslint/babel-eslint-parser/yarn.lock | 25 ------------------- 4 files changed, 4 insertions(+), 47 deletions(-) diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js index 0ef37750d7ab..9f2fb000b920 100644 --- a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js +++ b/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js @@ -47,26 +47,6 @@ const astTransformVisitor = { exit(path) { const node = path.node; - if (path.isJSXText()) { - node.type = "Literal"; - } - - if ( - path.isRestElement() && - path.parent && - path.parent.type === "ObjectPattern" - ) { - node.type = "ExperimentalRestProperty"; - } - - if ( - path.isSpreadElement() && - path.parent && - path.parent.type === "ObjectExpression" - ) { - node.type = "ExperimentalSpreadProperty"; - } - if (path.isTypeParameter()) { node.type = "Identifier"; node.typeAnnotation = node.bound; diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7ba87298d99b..f0369ede4ede 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -59,7 +59,7 @@ "eslint-plugin-flowtype": "^3.11.1", "eslint-plugin-import": "^2.14.0", "eslint-plugin-prettier": "^3.1.0", - "espree": "^3.5.2", + "espree": "^6.0.0", "husky": "^1.0.0-rc.13", "lint-staged": "^7.2.2", "mocha": "^6.1.4", diff --git a/eslint/babel-eslint-parser/test/specs/babel-eslint.js b/eslint/babel-eslint-parser/test/specs/babel-eslint.js index dd83cc7831a9..7dedf3819243 100644 --- a/eslint/babel-eslint-parser/test/specs/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/specs/babel-eslint.js @@ -451,7 +451,9 @@ describe("babylon-to-espree", () => { }); it("super outside method", () => { - parseAndAssertSame("function F() { super(); }"); + assert.throws(() => { + parseAndAssertSame("function F() { super(); }"); + }, /SyntaxError: 'super' keyword outside a method/); }); it("StringLiteral", () => { diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index d07a7c381491..dbb24b80454f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -835,28 +835,11 @@ dependencies: any-observable "^0.3.0" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= - dependencies: - acorn "^3.0.4" - acorn-jsx@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= - -acorn@^5.5.0: - version "5.7.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" - integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== - acorn@^6.0.7: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" @@ -1530,14 +1513,6 @@ eslint@^6.0.1: table "^5.2.3" text-table "^0.2.0" -espree@^3.5.2: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== - dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" - espree@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" From 5b35722d632b01691682e546209757f35df09d7a Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 1 Nov 2019 18:08:47 -0500 Subject: [PATCH 688/965] Bump semver@6 (babel/babel-eslint#802) --- eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-parser/yarn.lock | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index f0369ede4ede..3a5d1d282b74 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -35,7 +35,7 @@ "dependencies": { "eslint-scope": "3.7.1", "eslint-visitor-keys": "^1.0.0", - "semver": "^5.6.0" + "semver": "^6.3.0" }, "devDependencies": { "@babel/core": "^7.2.0", diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock index dbb24b80454f..aab080f5cb3f 100644 --- a/eslint/babel-eslint-parser/yarn.lock +++ b/eslint/babel-eslint-parser/yarn.lock @@ -3172,7 +3172,7 @@ semver-compare@^1.0.0: resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.7.0: version "5.7.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== @@ -3182,6 +3182,11 @@ semver@^6.1.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" From c442efa7c5a44f19f321a3d6aa839118081ef75b Mon Sep 17 00:00:00 2001 From: jquense Date: Fri, 19 Jun 2015 00:01:10 -0400 Subject: [PATCH 689/965] Initial --- eslint/babel-eslint-plugin/.gitignore | 1 + eslint/babel-eslint-plugin/.travis.yml | 7 + eslint/babel-eslint-plugin/LICENSE | 23 + eslint/babel-eslint-plugin/README.md | 38 + eslint/babel-eslint-plugin/helpers.js | 15 + eslint/babel-eslint-plugin/index.js | 8 + eslint/babel-eslint-plugin/package.json | 37 + .../rules/generator-star-spacing.js | 92 +++ .../rules/generator-star.js | 84 +++ .../rules/object-shorthand.js | 73 ++ .../tests/generator-star-spacing.js | 680 ++++++++++++++++++ .../tests/generator-star.js | 32 + .../tests/object-shorthand.js | 100 +++ 13 files changed, 1190 insertions(+) create mode 100644 eslint/babel-eslint-plugin/.gitignore create mode 100644 eslint/babel-eslint-plugin/.travis.yml create mode 100644 eslint/babel-eslint-plugin/LICENSE create mode 100644 eslint/babel-eslint-plugin/README.md create mode 100644 eslint/babel-eslint-plugin/helpers.js create mode 100644 eslint/babel-eslint-plugin/index.js create mode 100644 eslint/babel-eslint-plugin/package.json create mode 100644 eslint/babel-eslint-plugin/rules/generator-star-spacing.js create mode 100644 eslint/babel-eslint-plugin/rules/generator-star.js create mode 100644 eslint/babel-eslint-plugin/rules/object-shorthand.js create mode 100644 eslint/babel-eslint-plugin/tests/generator-star-spacing.js create mode 100644 eslint/babel-eslint-plugin/tests/generator-star.js create mode 100644 eslint/babel-eslint-plugin/tests/object-shorthand.js diff --git a/eslint/babel-eslint-plugin/.gitignore b/eslint/babel-eslint-plugin/.gitignore new file mode 100644 index 000000000000..3c3629e647f5 --- /dev/null +++ b/eslint/babel-eslint-plugin/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml new file mode 100644 index 000000000000..5a7ce2a7f99e --- /dev/null +++ b/eslint/babel-eslint-plugin/.travis.yml @@ -0,0 +1,7 @@ +--- +git: + depth: 1 +language: node_js +node_js: + - '0.12' + - 'io.js' \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/LICENSE b/eslint/babel-eslint-plugin/LICENSE new file mode 100644 index 000000000000..3d0e2f3067b8 --- /dev/null +++ b/eslint/babel-eslint-plugin/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2014-2015 Jason Quense +Original work by respective rule authors; copywrites noted in files. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md new file mode 100644 index 000000000000..5de7ba997ef2 --- /dev/null +++ b/eslint/babel-eslint-plugin/README.md @@ -0,0 +1,38 @@ +# eslint-plugin-babel + +An eslint plugin companion to babel-eslint. babel-eslint does a great job of adapting the eslint parser to valid babel code, it can't change built in rules to deal with the syntactic differences. eslint-plugin-babel reimplements problematic rules to not give false positives or negatives. + +### Install + +```sh +npm install eslint-plugin-babel -S +``` + +enable the plugin by adjusting your `.eslintrc` file to include the plugin: + +```json +{ + "plugins": [ + "babel" + ] +} +``` + +Finally enable all the rules you like to use (remember to disable the originals as well!). + +```json +{ + "rules": { + "babel/object-shorthand": 1, + "babel/generator-star": 1, + "babel/generator-star-spacing": 1, + } +} +``` +### Rules + +Each rule cooresponds to a core eslint rule, and has the same options. + +- `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) +- `babel/generator-star`: Handles async/await functions correctly +- `babel/generator-star-spacing`: Handles async/await functions correctly diff --git a/eslint/babel-eslint-plugin/helpers.js b/eslint/babel-eslint-plugin/helpers.js new file mode 100644 index 000000000000..77f42a3bf404 --- /dev/null +++ b/eslint/babel-eslint-plugin/helpers.js @@ -0,0 +1,15 @@ +var _parse = require('babel-core').parse; + +module.exports = { + parse: function(code){ + var ast = null + try { + ast = _parse(code, { locations: true, ranges: true }).body[0] //unwrap body + } + catch (err){ + console.warn(err) + } + + return ast + } +} \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js new file mode 100644 index 000000000000..86fbe85988ba --- /dev/null +++ b/eslint/babel-eslint-plugin/index.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = { + rules: { + 'object-shorthand': require('./rules/object-shorthand'), + 'generator-star': require('./rules/object-shorthand') + } +}; diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json new file mode 100644 index 000000000000..39201ad510a1 --- /dev/null +++ b/eslint/babel-eslint-plugin/package.json @@ -0,0 +1,37 @@ +{ + "name": "eslint-plugin-babel", + "version": "1.0.0", + "description": "eslint rule plugin companion to babel-eslint", + "main": "index.js", + "scripts": { + "test": "mocha -R spec ./tests/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/babel/eslint-plugin-babel.git" + }, + "keywords": [ + "babel", + "eslint", + "eslintplugin", + "babel-eslint" + ], + "author": "jquense @monasticpanic", + "license": "MIT", + "bugs": { + "url": "https://github.com/babel/eslint-plugin-babel/issues" + }, + "homepage": "https://github.com/babel/eslint-plugin-babel#readme", + "devDependencies": { + "babel-eslint": "^3.1.17", + "eslint": "^0.23.0", + "eslint-tester": "^0.8.0", + "is-my-json-valid": "^2.12.0", + "mocha": "^2.2.5", + "mocha-phantomjs": "^3.5.3", + "phantomjs": "^1.9.17" + }, + "dependencies": { + "babel-core": "^5.5.8" + } +} diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js new file mode 100644 index 000000000000..b122ed19c8b1 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -0,0 +1,92 @@ +/** + * @fileoverview Rule to check the spacing around the * in generator functions. + * @author Jamund Ferguson + * @copyright 2015 Brandon Mills. All rights reserved. + * @copyright 2014 Jamund Ferguson. All rights reserved. + */ + +"use strict"; + +module.exports = function(context) { + + var mode = { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[context.options[0] || "before"]; + + function isAsyncGenerator(node){ + return context.getFirstToken(node, 2).value === '*' + } + + /** + * Checks the spacing between two tokens before or after the star token. + * @param {string} side Either "before" or "after". + * @param {Token} leftToken `function` keyword token if side is "before", or + * star token if side is "after". + * @param {Token} rightToken Star token if side is "before", or identifier + * token if side is "after". + * @returns {void} + */ + function checkSpacing(side, leftToken, rightToken) { + if (!!(rightToken.range[0] - leftToken.range[1]) !== mode[side]) { + context.report( + leftToken.value === "*" ? leftToken : rightToken, + "{{type}} space {{side}} *.", + { + type: mode[side] ? "Missing" : "Unexpected", + side: side + } + ); + } + } + + /** + * Enforces the spacing around the star if node is a generator function. + * @param {ASTNode} node A function expression or declaration node. + * @returns {void} + */ + function checkFunction(node) { + var first = context.getFirstToken(node) + , isMethod = node.parent.method || node.parent.type === "MethodDefinition" + , isAsync = first.value === 'async'; + + var prevToken, starToken, nextToken; + + + if ( !node.generator || (isAsync && !isAsyncGenerator(node))) { + return; + } + + if (isMethod) { + starToken = context.getTokenBefore(node, 1); + } else { + starToken = context.getFirstToken(node, isAsync ? 2 : 1); + } + + // Only check before when preceded by `function` keyword + prevToken = context.getTokenBefore(starToken); + if (prevToken.value === "function" || prevToken.value === "static") { + checkSpacing("before", prevToken, starToken); + } + + // Only check after when followed by an identifier + nextToken = context.getTokenAfter(starToken); + if (nextToken.type === "Identifier") { + checkSpacing("after", starToken, nextToken); + } + } + + return { + "FunctionDeclaration": checkFunction, + "FunctionExpression": checkFunction + }; + +}; + +module.exports.schema = [ + { + "enum": ["before", "after", "both", "neither"] + } +]; \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/rules/generator-star.js b/eslint/babel-eslint-plugin/rules/generator-star.js new file mode 100644 index 000000000000..b5247f4f6880 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/generator-star.js @@ -0,0 +1,84 @@ +/** + * @fileoverview Rule to check for the position of the * in your generator functions + * @author Jamund Ferguson + * @copyright 2014 Jamund Ferguson. All rights reserved. + */ + +"use strict"; + +var parse = require('../helpers').parse + +module.exports = function(context) { + + var position = context.options[0] || "end"; + + function isAsyncGenerator(node){ + return context.getFirstToken(node, 2).value === '*' + } + + /** + * Check the position of the star compared to the expected position. + * @param {ASTNode} node - the entire function node + * @returns {void} + */ + function checkStarPosition(node) { + + var first = context.getFirstToken(node) + , isAsync = first.value === 'async' + , starToken; + + + if (!node.generator || (isAsync && !isAsyncGenerator(node))) { + return; + } + + // Blocked, pending decision to fix or work around in eslint/espree#36 + if (context.getAncestors().pop().method) { + return; + } + + starToken = context.getFirstToken(node, isAsync ? 2 : 1); + + //console.log(declaration, starToken) + + // check for function *name() {} + if (position === "end") { + if (starToken.range[1] !== context.getTokenAfter(starToken).range[0]) { + // * starts where the next identifier begins + context.report(node, "Expected a space before *."); + } + } + + // check for function* name() {} + if (position === "start") { + + // * begins where the previous identifier ends + if (starToken.range[0] !== context.getTokenBefore(starToken).range[1]) { + context.report(node, "Expected no space before *."); + } + } + + // check for function * name() {} + if (position === "middle") { + + // must be a space before and afer the * + if (starToken.range[0] <= context.getTokenBefore(starToken).range[1] || + starToken.range[1] >= context.getTokenAfter(starToken).range[0]) { + context.report(node, "Expected spaces around *."); + } + } + + } + + return { + "FunctionDeclaration": checkStarPosition, + "FunctionExpression": checkStarPosition + }; + +}; + +module.exports.schema = [ + { + "enum": ["start", "middle", "end"] + } +]; \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js new file mode 100644 index 000000000000..e584bfb684c9 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -0,0 +1,73 @@ + +/** + * @fileoverview Rule to enforce concise object methods and properties. + * @author Jamund Ferguson + * @copyright 2015 Jamund Ferguson. All rights reserved. + */ + +'use strict'; + +var OPTIONS = { + always: 'always', + never: 'never', + methods: 'methods', + properties: 'properties' + }; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var APPLY = context.options[0] || OPTIONS.always; + var APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; + var APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; + var APPLY_NEVER = APPLY === OPTIONS.never; + + return { + Property: function(node) { + var isConciseProperty = node.method || node.shorthand + , isSpreadProperty = !!this.getSource(node).match(/^\.\.\./) + , type; + + // if we're 'never' and concise we should warn now + if (APPLY_NEVER && isConciseProperty) { + type = node.method ? 'method' : 'property'; + context.report(node, 'Expected longform ' + type + ' syntax.'); + } + + // at this point if we're concise or if we're 'never' we can leave + if (APPLY_NEVER || isConciseProperty) { + return; + } + + if (node.kind === 'get' || node.kind === 'set') { + return; + } + + if (isSpreadProperty) { + return; + } + + if (node.value.type === 'FunctionExpression' && node.value.id == null && APPLY_TO_METHODS) { + // {x: function(){}} should be written as {x() {}} + context.report(node, 'Expected method shorthand.'); + } + else if (node.value.type === 'Identifier' && node.key.name === node.value.name && APPLY_TO_PROPS) { + // {x: x} should be written as {x} + context.report(node, 'Expected property shorthand.'); + } + else if (node.value.type === 'Identifier' && node.key.type === 'Literal' && node.key.value === node.value.name && APPLY_TO_PROPS) { + // {'x': x} should be written as {x} + context.report(node, 'Expected property shorthand.'); + } + } + }; +}; + +module.exports.schema = [ + { + 'enum': ['always', 'methods', 'properties', 'never'] + } +]; diff --git a/eslint/babel-eslint-plugin/tests/generator-star-spacing.js b/eslint/babel-eslint-plugin/tests/generator-star-spacing.js new file mode 100644 index 000000000000..4de1141b1023 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/generator-star-spacing.js @@ -0,0 +1,680 @@ +/* eslint-disable */ +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + +var features = { + generators: true +}; + +function ok(code, args){ + return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } +} + +function err(code, errors, args){ + var e = ok(code, args) + e.errors = errors + return e +} + +var features = { + generators: true +}; + +function ok(code, args){ + return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } +} + +function err(code, errors, args){ + var e = ok(code, args) + e.errors = errors + return e +} + + +eslintTester.addRuleTest('rules/generator-star-spacing', { + valid: [ + ok('var test = async function(){}'), + ok('async function test(){}'), + ok('var test = async function *(){}'), + ok('async function *test(){}', [1, "before"]) , + ok('async function* test(){}', [1, "after"]), + ok('async function * test(){}', [1, "both"]), + ok('async function*test(){}', [1, "neither"]), + { + code: "function foo(){}" + }, + { + code: "function *foo(){}", + ecmaFeatures: { generators: true } + }, + { + code: "function *foo(arg1, arg2){}", + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *foo(){};", + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *(){};", + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * (){};", + ecmaFeatures: { generators: true } + }, + { + code: "var foo = { *foo(){} };", + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = {*foo(){} };", + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo { *foo(){} }", + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo {*foo(){} }", + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static *foo(){} }", + ecmaFeatures: { classes: true, generators: true } + }, + + // "before" + { + code: "function foo(){}", + args: [2, "before"] + }, + { + code: "function *foo(){}", + args: [2, "before"], + ecmaFeatures: { generators: true } + }, + { + code: "function *foo(arg1, arg2){}", + args: [2, "before"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *foo(){};", + args: [2, "before"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *(){};", + args: [2, "before"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * (){};", + args: [2, "before"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = { *foo(){} };", + args: [2, "before"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = {*foo(){} };", + args: [2, "before"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo { *foo(){} }", + args: [2, "before"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo {*foo(){} }", + args: [2, "before"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static *foo(){} }", + args: [2, "before"], + ecmaFeatures: { classes: true, generators: true } + }, + + // "after" + { + code: "function foo(){}", + args: [2, "after"] + }, + { + code: "function* foo(){}", + args: [2, "after"], + ecmaFeatures: { generators: true } + }, + { + code: "function* foo(arg1, arg2){}", + args: [2, "after"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* foo(){};", + args: [2, "after"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* (){};", + args: [2, "after"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*(){};", + args: [2, "after"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = {* foo(){} };", + args: [2, "after"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = { * foo(){} };", + args: [2, "after"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo {* foo(){} }", + args: [2, "after"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { * foo(){} }", + args: [2, "after"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static* foo(){} }", + args: [2, "after"], + ecmaFeatures: { classes: true, generators: true } + }, + + // "both" + { + code: "function foo(){}", + args: [2, "both"] + }, + { + code: "function * foo(){}", + args: [2, "both"], + ecmaFeatures: { generators: true } + }, + { + code: "function * foo(arg1, arg2){}", + args: [2, "both"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * foo(){};", + args: [2, "both"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * (){};", + args: [2, "both"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *(){};", + args: [2, "both"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = { * foo(){} };", + args: [2, "both"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = {* foo(){} };", + args: [2, "both"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo { * foo(){} }", + args: [2, "both"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo {* foo(){} }", + args: [2, "both"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static * foo(){} }", + args: [2, "both"], + ecmaFeatures: { classes: true, generators: true } + }, + + // "neither" + { + code: "function foo(){}", + args: [2, "neither"] + }, + { + code: "function*foo(){}", + args: [2, "neither"], + ecmaFeatures: { generators: true } + }, + { + code: "function*foo(arg1, arg2){}", + args: [2, "neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*foo(){};", + args: [2, "neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*(){};", + args: [2, "neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* (){};", + args: [2, "neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = {*foo(){} };", + args: [2, "neither"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = { *foo(){} };", + args: [2, "neither"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo {*foo(){} }", + args: [2, "neither"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { *foo(){} }", + args: [2, "neither"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static*foo(){} }", + args: [2, "neither"], + ecmaFeatures: { classes: true, generators: true } + } + + ], + + invalid: [ + // Default ("before") + err('async function*test(){}', [ + { message: 'Missing space before *.' }, + ]), + err('async function* test(){}', [ + { + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + } + ]), + + { + code: "function*foo(){}", + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "function* foo(arg1, arg2){}", + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*foo(){};", + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function* (){};", + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = {* foo(){} };", + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo {* foo(){} }", + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static* foo(){} }", + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + + // "before" + { + code: "function*foo(){}", + args: [2, "before"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "function* foo(arg1, arg2){}", + args: [2, "before"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*foo(){};", + args: [2, "before"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function* (){};", + args: [2, "before"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = {* foo(){} };", + args: [2, "before"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo {* foo(){} }", + args: [2, "before"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + + // "after" + { + code: "function*foo(){}", + args: [2, "after"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "function *foo(arg1, arg2){}", + args: [2, "after"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function *foo(){};", + args: [2, "after"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function *(){};", + args: [2, "after"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = { *foo(){} };", + args: [2, "after"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { *foo(){} }", + args: [2, "after"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static *foo(){} }", + args: [2, "after"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + + // "both" + { + code: "function*foo(){}", + args: [2, "both"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "function*foo(arg1, arg2){}", + args: [2, "both"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*foo(){};", + args: [2, "both"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*(){};", + args: [2, "both"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = {*foo(){} };", + args: [2, "both"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo {*foo(){} }", + args: [2, "both"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static*foo(){} }", + args: [2, "both"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + + // "neither" + { + code: "function * foo(){}", + args: [2, "neither"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "function * foo(arg1, arg2){}", + args: [2, "neither"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function * foo(){};", + args: [2, "neither"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function * (){};", + args: [2, "neither"], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = { * foo(){} };", + args: [2, "neither"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { * foo(){} }", + args: [2, "neither"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static * foo(){} }", + args: [2, "neither"], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + } + + ] +}); \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/tests/generator-star.js b/eslint/babel-eslint-plugin/tests/generator-star.js new file mode 100644 index 000000000000..131d41f9c667 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/generator-star.js @@ -0,0 +1,32 @@ +/* eslint-disable */ +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + +var features = { + generators: true +}; + +function ok(code, args){ + return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } +} + +function err(code, errors, args){ + var e = ok(code, args) + e.errors = errors + return e +} + + +eslintTester.addRuleTest('rules/generator-star', { + valid: [ + ok('async function test(){}'), + ok('async function *test(){}', [1, "end"]) , + ok('async function* test(){}', [1, "start"]), + ok('async function * test(){}', [1, "middle"]) + ], + invalid: [ + err('async function* test(){}', [ { message: 'Expected a space before *.' }]), + err('async function *test(){}', [ { message: 'Expected no space before *.' }], [1, 'start']) + ] +}); \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/tests/object-shorthand.js b/eslint/babel-eslint-plugin/tests/object-shorthand.js new file mode 100644 index 000000000000..9a89b10cc65b --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/object-shorthand.js @@ -0,0 +1,100 @@ +/* eslint-disable */ +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + +var features = { + objectLiteralShorthandMethods: true, + objectLiteralShorthandProperties: true, + arrowFunctions: true, + destructuring: true, + generators: true +}; + +function ok(code, args){ + return { code: code, parser: 'babel-eslint', ecmaFeatures: features} +} + + +eslintTester.addRuleTest('rules/object-shorthand', { + valid: [ + ok('let { ...spread } = obj'), + ok('let { ...spread } = obj', [2, 'never']), + + //original test cases + { code: "var x = {y() {}}", ecmaFeatures: features }, + { code: "var x = {y}", ecmaFeatures: features }, + { code: "var x = {a: b}", ecmaFeatures: features }, + { code: "var x = {a: 'a'}", ecmaFeatures: features }, + { code: "var x = {'a': 'a'}", ecmaFeatures: features }, + { code: "var x = {'a': b}", ecmaFeatures: features }, + { code: "var x = {y(x) {}}", ecmaFeatures: features }, + { code: "var {x,y,z} = x", ecmaFeatures: features }, + { code: "var {x: {y}} = z", ecmaFeatures: features }, + { code: "var x = {*x() {}}", ecmaFeatures: features }, + { code: "var x = {x: y}", ecmaFeatures: features }, + { code: "var x = {x: y, y: z}", ecmaFeatures: features}, + { code: "var x = {x: y, y: z, z: 'z'}", ecmaFeatures: features}, + { code: "var x = {x() {}, y: z, l(){}}", ecmaFeatures: features}, + { code: "var x = {x: y, y: z, a: b}", ecmaFeatures: features}, + { code: "var x = {x: y, y: z, 'a': b}", ecmaFeatures: features}, + { code: "var x = {x: y, y() {}, z: a}", ecmaFeatures: features}, + { code: "doSomething({x: y})", ecmaFeatures: features}, + { code: "doSomething({'x': y})", ecmaFeatures: features}, + { code: "doSomething({x: 'x'})", ecmaFeatures: features}, + { code: "doSomething({'x': 'x'})", ecmaFeatures: features}, + { code: "doSomething({y() {}})", ecmaFeatures: features}, + { code: "doSomething({x: y, y() {}})", ecmaFeatures: features}, + { code: "doSomething({y() {}, z: a})", ecmaFeatures: features}, + { code: "!{ a: function a(){} };", ecmaFeatures: features }, + + // arrows functions are still alright + { code: "var x = {y: (x)=>x}", ecmaFeatures: features }, + { code: "doSomething({y: (x)=>x})", ecmaFeatures: features }, + { code: "var x = {y: (x)=>x, y: a}", ecmaFeatures: features }, + { code: "doSomething({x, y: (x)=>x})", ecmaFeatures: features }, + + // getters and setters are ok + { code: "var x = {get y() {}}", ecmaFeatures: features }, + { code: "var x = {set y(z) {}}", ecmaFeatures: features }, + { code: "var x = {get y() {}, set y(z) {}}", ecmaFeatures: features }, + { code: "doSomething({get y() {}})", ecmaFeatures: features }, + { code: "doSomething({set y(z) {}})", ecmaFeatures: features }, + { code: "doSomething({get y() {}, set y(z) {}})", ecmaFeatures: features }, + + // options + { code: "var x = {y() {}}", ecmaFeatures: features, args: [2, "methods"] }, + { code: "var x = {x, y() {}, a:b}", ecmaFeatures: features, args: [2, "methods"] }, + { code: "var x = {y}", ecmaFeatures: features, args: [2, "properties"] }, + { code: "var x = {y: {b}}", ecmaFeatures: features, args: [2, "properties"] }, + { code: "var x = {a: n, c: d, f: g}", ecmaFeatures: features, args: [2, "never"] }, + { code: "var x = {a: function(){}, b: {c: d}}", ecmaFeatures: features, args: [2, "never"] } + ], + + invalid: [ + { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "var x = {'x': x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "var x = {y: y, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }, { message: "Expected property shorthand.", type: "Property" }] }, + { code: "var x = {y: z, x: x, a: b}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, + { code: "var x = {y: function*() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, + { code: "var x = {x: y, y: z, a: a}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "var x = {x: y, y: z, a: function(){}, b() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, + { code: "var x = {x: x, y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }, { message: "Expected method shorthand.", type: "Property" }]}, + { code: "doSomething({x: x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "doSomething({'x': x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "doSomething({a: 'a', 'x': x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, + { code: "doSomething({y: function() {}})", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, + + // options + { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], args: [2, "methods"] }, + { code: "var x = {x, y() {}, z: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], args: [2, "methods"] }, + { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], args: [2, "properties"] }, + { code: "var x = {a, b, c(){}, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], args: [2, "properties"] }, + { code: "var x = {y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"] }, + { code: "var x = {*y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"] }, + { code: "var x = {y}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], args: [2, "never"]}, + { code: "var x = {y, a: b, *x(){}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }, { message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"]}, + { code: "var x = {y: {x}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], args: [2, "never"]} + ] +}); \ No newline at end of file From cc35677cffcb2a8ff10c2ec9ba24030ca7c22f40 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Fri, 19 Jun 2015 00:04:01 -0400 Subject: [PATCH 690/965] Update README.md --- eslint/babel-eslint-plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 5de7ba997ef2..d2496f5679bc 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,6 +1,6 @@ # eslint-plugin-babel -An eslint plugin companion to babel-eslint. babel-eslint does a great job of adapting the eslint parser to valid babel code, it can't change built in rules to deal with the syntactic differences. eslint-plugin-babel reimplements problematic rules to not give false positives or negatives. +An eslint plugin companion to babel-eslint. babel-eslint does a great job of adapting eslint for use with Babel, but to it can't change the built in rules to support experimental features. eslint-plugin-babel reimplements problematic rules so they do not give false positives or negatives. ### Install From e9e6dee39a258f1fa273b125d17335e0546a0455 Mon Sep 17 00:00:00 2001 From: jquense Date: Fri, 19 Jun 2015 00:08:09 -0400 Subject: [PATCH 691/965] Typos and copy --- eslint/babel-eslint-plugin/index.js | 8 +++++++- eslint/babel-eslint-plugin/package.json | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 86fbe85988ba..e2cc71b92365 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -3,6 +3,12 @@ module.exports = { rules: { 'object-shorthand': require('./rules/object-shorthand'), - 'generator-star': require('./rules/object-shorthand') + 'generator-star-spacing': require('./rules/generator-star-spacing'), + 'generator-star': require('./rules/generator-star') + }, + rulesConfig: { + 'generator-star-spacing': 0, + 'generator-star': 0, + 'object-shorthand': 0 } }; diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 39201ad510a1..39305fd98c90 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,10 +1,10 @@ { "name": "eslint-plugin-babel", "version": "1.0.0", - "description": "eslint rule plugin companion to babel-eslint", + "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { - "test": "mocha -R spec ./tests/*.js" + "test": "mocha ./tests/*.js" }, "repository": { "type": "git", @@ -14,21 +14,24 @@ "babel", "eslint", "eslintplugin", + "eslint-plugin", "babel-eslint" ], - "author": "jquense @monasticpanic", + "author": "Jason Quense @monasticpanic", "license": "MIT", "bugs": { "url": "https://github.com/babel/eslint-plugin-babel/issues" }, "homepage": "https://github.com/babel/eslint-plugin-babel#readme", + "peerDependencies": { + "eslint": ">=0.8.0" + }, "devDependencies": { "babel-eslint": "^3.1.17", "eslint": "^0.23.0", "eslint-tester": "^0.8.0", "is-my-json-valid": "^2.12.0", "mocha": "^2.2.5", - "mocha-phantomjs": "^3.5.3", "phantomjs": "^1.9.17" }, "dependencies": { From 382c3f2bb9ee16f407a426936901cd3c95e50096 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Wed, 1 Jul 2015 13:39:08 -0400 Subject: [PATCH 692/965] Merge pull request babel/eslint-plugin-babel#2 from mathieumg/newcap_decorators Added support for decorators in the new-cap rule. --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 6 +- eslint/babel-eslint-plugin/rules/new-cap.js | 234 ++++++++++++++++++++ eslint/babel-eslint-plugin/tests/new-cap.js | 122 ++++++++++ 4 files changed, 362 insertions(+), 2 deletions(-) create mode 100644 eslint/babel-eslint-plugin/rules/new-cap.js create mode 100644 eslint/babel-eslint-plugin/tests/new-cap.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index d2496f5679bc..94db5b984d9e 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -26,6 +26,7 @@ Finally enable all the rules you like to use (remember to disable the originals "babel/object-shorthand": 1, "babel/generator-star": 1, "babel/generator-star-spacing": 1, + "babel/new-cap": 1, } } ``` @@ -36,3 +37,4 @@ Each rule cooresponds to a core eslint rule, and has the same options. - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/generator-star`: Handles async/await functions correctly - `babel/generator-star-spacing`: Handles async/await functions correctly +- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index e2cc71b92365..6c76dbe4cd55 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -4,11 +4,13 @@ module.exports = { rules: { 'object-shorthand': require('./rules/object-shorthand'), 'generator-star-spacing': require('./rules/generator-star-spacing'), - 'generator-star': require('./rules/generator-star') + 'generator-star': require('./rules/generator-star'), + 'new-cap': require('./rules/new-cap') }, rulesConfig: { 'generator-star-spacing': 0, 'generator-star': 0, - 'object-shorthand': 0 + 'object-shorthand': 0, + 'new-cap': 0 } }; diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js new file mode 100644 index 000000000000..b1ab732d87fe --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -0,0 +1,234 @@ +/** + * @fileoverview Rule to flag use of constructors without capital letters + * @author Nicholas C. Zakas + * @copyright 2014 Jordan Harband. All rights reserved. + * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved. + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + */ + +"use strict"; + +var CAPS_ALLOWED = [ + "Array", + "Boolean", + "Date", + "Error", + "Function", + "Number", + "Object", + "RegExp", + "String", + "Symbol" +]; + +/** + * Ensure that if the key is provided, it must be an array. + * @param {Object} obj Object to check with `key`. + * @param {string} key Object key to check on `obj`. + * @param {*} fallback If obj[key] is not present, this will be returned. + * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` + */ +function checkArray(obj, key, fallback) { + if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { + throw new TypeError(key + ", if provided, must be an Array"); + } + return obj[key] || fallback; +} + +/** + * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. + * @param {Object} map Accumulator object for the reduce. + * @param {string} key Object key to set to `true`. + * @returns {Object} Returns the updated Object for further reduction. + */ +function invert(map, key) { + map[key] = true; + return map; +} + +/** + * Creates an object with the cap is new exceptions as its keys and true as their values. + * @param {Object} config Rule configuration + * @returns {Object} Object with cap is new exceptions. + */ +function calculateCapIsNewExceptions(config) { + var capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); + + if (capIsNewExceptions !== CAPS_ALLOWED) { + capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); + } + + return capIsNewExceptions.reduce(invert, {}); +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var config = context.options[0] || {}; + config.newIsCap = config.newIsCap !== false; + config.capIsNew = config.capIsNew !== false; + + var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); + + var capIsNewExceptions = calculateCapIsNewExceptions(config); + + var listeners = {}; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Get exact callee name from expression + * @param {ASTNode} node CallExpression or NewExpression node + * @returns {string} name + */ + function extractNameFromExpression(node) { + + var name = "", + property; + + if (node.callee.type === "MemberExpression") { + property = node.callee.property; + + if (property.type === "Literal" && (typeof property.value === "string")) { + name = property.value; + } else if (property.type === "Identifier" && !node.callee.computed) { + name = property.name; + } + } else { + name = node.callee.name; + } + return name; + } + + /** + * Returns the capitalization state of the string - + * Whether the first character is uppercase, lowercase, or non-alphabetic + * @param {string} str String + * @returns {string} capitalization state: "non-alpha", "lower", or "upper" + */ + function getCap(str) { + var firstChar = str.charAt(0); + + var firstCharLower = firstChar.toLowerCase(); + var firstCharUpper = firstChar.toUpperCase(); + + if (firstCharLower === firstCharUpper) { + // char has no uppercase variant, so it's non-alphabetic + return "non-alpha"; + } else if (firstChar === firstCharLower) { + return "lower"; + } else { + return "upper"; + } + } + + /** + * Returns whether a node is under a decorator or not. + * @param {ASTNode} node CallExpression node + * @returns {Boolean} Returns true if the node is under a decorator. + */ + function isDecorator(node) { + return node.parent.type === "Decorator"; + } + + /** + * Check if capitalization is allowed for a CallExpression + * @param {Object} allowedMap Object mapping calleeName to a Boolean + * @param {ASTNode} node CallExpression node + * @param {string} calleeName Capitalized callee name from a CallExpression + * @returns {Boolean} Returns true if the callee may be capitalized + */ + function isCapAllowed(allowedMap, node, calleeName) { + if (allowedMap[calleeName]) { + return true; + } + if (calleeName === "UTC" && node.callee.type === "MemberExpression") { + // allow if callee is Date.UTC + return node.callee.object.type === "Identifier" && + node.callee.object.name === "Date"; + } + return false; + } + + /** + * Reports the given message for the given node. The location will be the start of the property or the callee. + * @param {ASTNode} node CallExpression or NewExpression node. + * @param {string} message The message to report. + * @returns {void} + */ + function report(node, message) { + var callee = node.callee; + + if (callee.type === "MemberExpression") { + callee = callee.property; + } + + context.report(node, callee.loc.start, message); + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + if (config.newIsCap) { + listeners.NewExpression = function(node) { + + var constructorName = extractNameFromExpression(node); + if (constructorName) { + var capitalization = getCap(constructorName); + var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName); + if (!isAllowed) { + report(node, "A constructor name should not start with a lowercase letter."); + } + } + }; + } + + if (config.capIsNew) { + listeners.CallExpression = function(node) { + + var calleeName = extractNameFromExpression(node); + if (calleeName) { + var capitalization = getCap(calleeName); + var isAllowed = capitalization !== "upper" || isDecorator(node) || isCapAllowed(capIsNewExceptions, node, calleeName); + if (!isAllowed) { + report(node, "A function with a name starting with an uppercase letter should only be used as a constructor."); + } + } + }; + } + + return listeners; +}; + +module.exports.schema = [ + { + "type": "object", + "properties": { + "newIsCap": { + "type": "boolean" + }, + "capIsNew": { + "type": "boolean" + }, + "newIsCapExceptions": { + "type": "array", + "items": { + "type": "string" + } + }, + "capIsNewExceptions": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } +]; diff --git a/eslint/babel-eslint-plugin/tests/new-cap.js b/eslint/babel-eslint-plugin/tests/new-cap.js new file mode 100644 index 000000000000..d25f5d2ad362 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/new-cap.js @@ -0,0 +1,122 @@ +/* eslint-disable */ + +/** + * @fileoverview Tests for new-cap rule. + * @author Nicholas C. Zakas + */ + +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + + +eslintTester.addRuleTest("rules/new-cap", { + valid: [ + // Original test cases. + "var x = new Constructor();", + "var x = new a.b.Constructor();", + "var x = new a.b['Constructor']();", + "var x = new a.b[Constructor]();", + "var x = new a.b[constructor]();", + "var x = new function(){};", + "var x = new _;", + "var x = new $;", + "var x = new Σ;", + "var x = new _x;", + "var x = new $x;", + "var x = new this;", + "var x = Array(42)", + "var x = Boolean(42)", + "var x = Date(42)", + "var x = Date.UTC(2000, 0)", + "var x = Error('error')", + "var x = Function('return 0')", + "var x = Number(42)", + "var x = Object(null)", + "var x = RegExp(42)", + "var x = String(42)", + "var x = Symbol('symbol')", + "var x = _();", + "var x = $();", + { code: "var x = Foo(42)", args: [1, {"capIsNew": false}] }, + { code: "var x = bar.Foo(42)", args: [1, {"capIsNew": false}] }, + "var x = bar[Foo](42)", + {code: "var x = bar['Foo'](42)", args: [1, {"capIsNew": false}] }, + "var x = Foo.bar(42)", + { code: "var x = new foo(42)", args: [1, {"newIsCap": false}] }, + "var o = { 1: function () {} }; o[1]();", + "var o = { 1: function () {} }; new o[1]();", + { code: "var x = Foo(42);", args: [1, { capIsNew: true, capIsNewExceptions: ["Foo"] }] }, + { code: "var x = new foo(42);", args: [1, { newIsCap: true, newIsCapExceptions: ["foo"] }] }, + { code: "var x = Object(42);", args: [1, { capIsNewExceptions: ["Foo"] }] }, + + // Babel-specific test cases. + { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, + ], + invalid: [ + { code: "var x = new c();", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, + { code: "var x = new φ;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, + { code: "var x = new a.b.c;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, + { code: "var x = new a.b['c'];", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, + { code: "var b = Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { code: "var b = a.Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { code: "var b = a['Foo']();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { code: "var b = a.Date.UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { code: "var b = UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { + code: "var a = B.C();", + errors: [ + { + message: "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + line: 1, + column: 10 + } + ] + }, + { + code: "var a = B\n.C();", + errors: [ + { + message: "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + line: 2, + column: 1 + } + ] + }, + { + code: "var a = new B.c();", + errors: [ + { + message: "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 1, + column: 14 + } + ] + }, + { + code: "var a = new B.\nc();", + errors: [ + { + message: "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 2, + column: 0 + } + ] + }, + { + code: "var a = new c();", + errors: [ + { + message: "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 1, + column: 12 + } + ] + } + ] +}); From c2c993379746920063638b53c5966797e939ec3a Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Fri, 3 Jul 2015 23:14:57 -0400 Subject: [PATCH 693/965] Merge pull request babel/eslint-plugin-babel#1 from mathieumg/blockscopedvar_export Added support for experimental export types --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 2 + .../rules/block-scoped-var.js | 340 ++++++++++++++++++ .../tests/block-scoped-var.js | 105 ++++++ 4 files changed, 449 insertions(+) create mode 100644 eslint/babel-eslint-plugin/rules/block-scoped-var.js create mode 100644 eslint/babel-eslint-plugin/tests/block-scoped-var.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 94db5b984d9e..e29161738898 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -23,6 +23,7 @@ Finally enable all the rules you like to use (remember to disable the originals ```json { "rules": { + "babel/block-scoped-var": 1, "babel/object-shorthand": 1, "babel/generator-star": 1, "babel/generator-star-spacing": 1, @@ -34,6 +35,7 @@ Finally enable all the rules you like to use (remember to disable the originals Each rule cooresponds to a core eslint rule, and has the same options. +- `babel/block-scoped-var`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/generator-star`: Handles async/await functions correctly - `babel/generator-star-spacing`: Handles async/await functions correctly diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 6c76dbe4cd55..8bfde48f91a3 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -2,12 +2,14 @@ module.exports = { rules: { + 'block-scoped-var': require('./rules/block-scoped-var'), 'object-shorthand': require('./rules/object-shorthand'), 'generator-star-spacing': require('./rules/generator-star-spacing'), 'generator-star': require('./rules/generator-star'), 'new-cap': require('./rules/new-cap') }, rulesConfig: { + 'block-scoped-var': 0, 'generator-star-spacing': 0, 'generator-star': 0, 'object-shorthand': 0, diff --git a/eslint/babel-eslint-plugin/rules/block-scoped-var.js b/eslint/babel-eslint-plugin/rules/block-scoped-var.js new file mode 100644 index 000000000000..71479e20d7be --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/block-scoped-var.js @@ -0,0 +1,340 @@ +/** + * @fileoverview Rule to check for "block scoped" variables by binding context + * @author Matt DuVall + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var scopeStack = []; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines whether an identifier is in declaration position or is a non-declaration reference. + * @param {ASTNode} id The identifier. + * @param {ASTNode} parent The identifier's parent AST node. + * @returns {Boolean} true when the identifier is in declaration position. + */ + function isDeclaration(id, parent) { + switch (parent.type) { + case "FunctionDeclaration": + case "FunctionExpression": + return parent.params.indexOf(id) > -1 || id === parent.id; + + case "VariableDeclarator": + return id === parent.id; + + case "CatchClause": + return id === parent.param; + + default: + return false; + } + } + + /** + * Determines whether an identifier is in property position. + * @param {ASTNode} id The identifier. + * @param {ASTNode} parent The identifier's parent AST node. + * @returns {Boolean} true when the identifier is in property position. + */ + function isProperty(id, parent) { + switch (parent.type) { + case "MemberExpression": + return id === parent.property && !parent.computed; + + case "Property": + return id === parent.key; + + default: + return false; + } + } + + /** + * Pushes a new scope object on the scope stack. + * @returns {void} + */ + function pushScope() { + scopeStack.push([]); + } + + /** + * Removes the topmost scope object from the scope stack. + * @returns {void} + */ + function popScope() { + scopeStack.pop(); + } + + /** + * Declares the given names in the topmost scope object. + * @param {[String]} names A list of names to declare. + * @returns {void} + */ + function declare(names) { + [].push.apply(scopeStack[scopeStack.length - 1], names); + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + /** + * Declares all relevant identifiers for module imports. + * @param {ASTNode} node The AST node representing an import. + * @returns {void} + * @private + */ + function declareImports(node) { + declare([node.local.name]); + + if (node.imported && node.imported.name !== node.local.name) { + declare([node.imported.name]); + } + } + + /** + * Declares all relevant identifiers for module exports. + * @param {ASTNode} node The AST node representing an export. + * @returns {void} + * @private + */ + function declareExports(node) { + if (node.exported && node.exported.name) { + declare([node.exported.name]); + + if (node.local) { + declare([node.local.name]); + } + } + } + + /** + * Declares all relevant identifiers for classes. + * @param {ASTNode} node The AST node representing a class. + * @returns {void} + * @private + */ + function declareClass(node) { + + if (node.id) { + declare([node.id.name]); + } + + pushScope(); + } + + /** + * Declares all relevant identifiers for classes. + * @param {ASTNode} node The AST node representing a class. + * @returns {void} + * @private + */ + function declareClassMethod(node) { + pushScope(); + + declare([node.key.name]); + } + + /** + * Add declarations based on the type of node being passed. + * @param {ASTNode} node The node containing declarations. + * @returns {void} + * @private + */ + function declareByNodeType(node) { + + var declarations = []; + + switch (node.type) { + case "Identifier": + declarations.push(node.name); + break; + + case "ObjectPattern": + node.properties.forEach(function(property) { + declarations.push(property.key.name); + if (property.value) { + declarations.push(property.value.name); + } + }); + break; + + case "ArrayPattern": + node.elements.forEach(function(element) { + if (element) { + declarations.push(element.name); + } + }); + break; + + case "AssignmentPattern": + declareByNodeType(node.left); + break; + + case "RestElement": + declareByNodeType(node.argument); + break; + + // no default + } + + declare(declarations); + + } + + /** + * Adds declarations of the function parameters and pushes the scope + * @param {ASTNode} node The node containing declarations. + * @returns {void} + * @private + */ + function functionHandler(node) { + pushScope(); + + node.params.forEach(function(param) { + declareByNodeType(param); + }); + + declare(node.rest ? [node.rest.name] : []); + declare(["arguments"]); + } + + /** + * Adds declaration of the function name in its parent scope then process the function + * @param {ASTNode} node The node containing declarations. + * @returns {void} + * @private + */ + function functionDeclarationHandler(node) { + declare(node.id ? [node.id.name] : []); + functionHandler(node); + } + + /** + * Process function declarations and declares its name in its own scope + * @param {ASTNode} node The node containing declarations. + * @returns {void} + * @private + */ + function functionExpressionHandler(node) { + functionHandler(node); + declare(node.id ? [node.id.name] : []); + } + + function variableDeclarationHandler(node) { + node.declarations.forEach(function(declaration) { + declareByNodeType(declaration.id); + }); + + } + + return { + "Program": function() { + var scope = context.getScope(); + scopeStack = [scope.variables.map(function(v) { + return v.name; + })]; + + // global return creates another scope + if (context.ecmaFeatures.globalReturn) { + scope = scope.childScopes[0]; + scopeStack.push(scope.variables.map(function(v) { + return v.name; + })); + } + }, + + "ImportSpecifier": declareImports, + "ImportDefaultSpecifier": declareImports, + "ImportNamespaceSpecifier": declareImports, + + "ExportSpecifier": declareExports, + "ExportDefaultSpecifier": declareExports, + "ExportNamespaceSpecifier": declareExports, + + "BlockStatement": function(node) { + var statements = node.body; + pushScope(); + statements.forEach(function(stmt) { + if (stmt.type === "VariableDeclaration") { + variableDeclarationHandler(stmt); + } else if (stmt.type === "FunctionDeclaration") { + declare([stmt.id.name]); + } + }); + }, + + "VariableDeclaration": function (node) { + variableDeclarationHandler(node); + }, + + "BlockStatement:exit": popScope, + + "CatchClause": function(node) { + pushScope(); + declare([node.param.name]); + }, + "CatchClause:exit": popScope, + + "FunctionDeclaration": functionDeclarationHandler, + "FunctionDeclaration:exit": popScope, + + "ClassDeclaration": declareClass, + "ClassDeclaration:exit": popScope, + + "ClassExpression": declareClass, + "ClassExpression:exit": popScope, + + "MethodDefinition": declareClassMethod, + "MethodDefinition:exit": popScope, + + "FunctionExpression": functionExpressionHandler, + "FunctionExpression:exit": popScope, + + // Arrow functions cannot have names + "ArrowFunctionExpression": functionHandler, + "ArrowFunctionExpression:exit": popScope, + + "ForStatement": function() { + pushScope(); + }, + "ForStatement:exit": popScope, + + "ForInStatement": function() { + pushScope(); + }, + "ForInStatement:exit": popScope, + + "ForOfStatement": function() { + pushScope(); + }, + "ForOfStatement:exit": popScope, + + "Identifier": function(node) { + var ancestor = context.getAncestors().pop(); + if (isDeclaration(node, ancestor) || isProperty(node, ancestor) || ancestor.type === "LabeledStatement") { + return; + } + + for (var i = 0, l = scopeStack.length; i < l; i++) { + if (scopeStack[i].indexOf(node.name) > -1) { + return; + } + } + + context.report(node, "\"" + node.name + "\" used outside of binding context."); + } + }; + +}; + +module.exports.schema = []; diff --git a/eslint/babel-eslint-plugin/tests/block-scoped-var.js b/eslint/babel-eslint-plugin/tests/block-scoped-var.js new file mode 100644 index 000000000000..61297094ea21 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/block-scoped-var.js @@ -0,0 +1,105 @@ +/* eslint-disable */ + +/** + * @fileoverview Tests for block-scoped-var rule + * @author Matt DuVall + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + */ + +var eslint = require("eslint").linter, + ESLintTester = require("eslint-tester"), + eslintTester = new ESLintTester(eslint); + +eslintTester.addRuleTest("rules/block-scoped-var", { + valid: [ + //original test cases + { code: "function f() { } f(); var exports = { f: f };", ecmaFeatures: {modules: true} }, + { code: "var f = () => {}; f(); var exports = { f: f };", ecmaFeatures: {arrowFunctions: true, modules: true} }, + "!function f(){ f; }", + "function f() { } f(); var exports = { f: f };", + "function f() { var a, b; { a = true; } b = a; }", + "var a; function f() { var b = a; }", + "function f(a) { }", + "!function(a) { };", + "!function f(a) { };", + "function f(a) { var b = a; }", + "!function f(a) { var b = a; };", + "function f() { var g = f; }", + "function f() { } function g() { var f = g; }", + "function f() { var hasOwnProperty; { hasOwnProperty; } }", + "function f(){ a; b; var a, b; }", + "function f(){ g(); function g(){} }", + { code: "function myFunc(foo) { \"use strict\"; var { bar } = foo; bar.hello();}", ecmaFeatures: { destructuring: true } }, + { code: "function myFunc(foo) { \"use strict\"; var [ bar ] = foo; bar.hello();}", ecmaFeatures: { destructuring: true } }, + { code: "function myFunc(...foo) { return foo;}", ecmaFeatures: { restParams: true } }, + { code: "var f = () => { var g = f; }", ecmaFeatures: { arrowFunctions: true } }, + { code: "class Foo {}\nexport default Foo;", ecmaFeatures: { modules: true, classes: true } }, + { code: "new Date", globals: {Date: false} }, + { code: "new Date", globals: {} }, + { code: "var eslint = require('eslint');", globals: {require: false} }, + { code: "var fun = function({x}) {return x;};", ecmaFeatures: { destructuring: true } }, + { code: "var fun = function([,x]) {return x;};", ecmaFeatures: { destructuring: true } }, + "function f(a) { return a.b; }", + "var a = { \"foo\": 3 };", + "var a = { foo: 3 };", + "var a = { foo: 3, bar: 5 };", + "var a = { set foo(a){}, get bar(){} };", + "function f(a) { return arguments[0]; }", + "function f() { }; var a = f;", + "var a = f; function f() { };", + "function f(){ for(var i; i; i) i; }", + "function f(){ for(var a=0, b=1; a; b) a, b; }", + "function f(){ for(var a in {}) a; }", + "function f(){ switch(2) { case 1: var b = 2; b; break; default: b; break;} b; }", + "a:;", + { code: "const React = require(\"react/addons\");const cx = React.addons.classSet;", globals: { require: false }, ecmaFeatures: { globalReturn: true, modules: true, blockBindings: true }}, + { code: "var v = 1; function x() { return v; };", ecmaFeatures: { globalReturn: true }}, + { code: "import * as y from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, + { code: "import y from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, + { code: "import {x as y} from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, + { code: "var x; export {x};", ecmaFeatures: { modules: true }}, + { code: "var x; export {x as v};", ecmaFeatures: { modules: true }}, + { code: "export {x} from \"./other.js\";", ecmaFeatures: { modules: true }}, + { code: "export {x as v} from \"./other.js\";", ecmaFeatures: { modules: true }}, + { code: "class Test { myFunction() { return true; }}", ecmaFeatures: { classes: true }}, + { code: "class Test { get flag() { return true; }}", ecmaFeatures: { classes: true }}, + { code: "var Test = class { myFunction() { return true; }}", ecmaFeatures: { classes: true }}, + { code: "var doStuff; let {x: y} = {x: 1}; doStuff(y);", ecmaFeatures: { blockBindings: true, destructuring: true }}, + { code: "function foo({x: y}) { return y; }", ecmaFeatures: { blockBindings: true, destructuring: true }}, + + // Babel-specific test-cases. + { code: "export x from \"./other.js\";", parser: "babel-eslint", ecmaFeatures: {modules: true} }, + { code: "export * as x from \"./other.js\";", parser: "babel-eslint", ecmaFeatures: {modules: true} }, + ], + invalid: [ + { code: "!function f(){}; f", errors: [{ message: "\"f\" used outside of binding context." }] }, + { code: "var f = function foo() { }; foo(); var exports = { f: foo };", errors: [{ message: "\"foo\" used outside of binding context." }, { message: "\"foo\" used outside of binding context."}] }, + { code: "var f = () => { x; }", ecmaFeatures: { arrowFunctions: true }, errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f(){ x; }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f(){ x; { var x; } }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f(){ { var x; } x; }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f() { var a; { var b = 0; } a = b; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f() { try { var a = 0; } catch (e) { var b = a; } }", errors: [{ message: "\"a\" used outside of binding context.", type: "Identifier" }] }, + { code: "var eslint = require('eslint');", globals: {}, errors: [{ message: "\"require\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f(a) { return a[b]; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f() { return b.a; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { code: "var a = { foo: bar };", errors: [{ message: "\"bar\" used outside of binding context.", type: "Identifier" }] }, + { code: "var a = { foo: foo };", errors: [{ message: "\"foo\" used outside of binding context.", type: "Identifier" }] }, + { code: "var a = { bar: 7, foo: bar };", errors: [{ message: "\"bar\" used outside of binding context.", type: "Identifier" }] }, + { code: "var a = arguments;", errors: [{ message: "\"arguments\" used outside of binding context.", type: "Identifier" }] }, + { code: "function x(){}; var a = arguments;", errors: [{ message: "\"arguments\" used outside of binding context.", type: "Identifier" }] }, + { code: "function z(b){}; var a = b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { code: "function z(){var b;}; var a = b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { code: "function f(){ try{}catch(e){} e }", errors: [{ message: "\"e\" used outside of binding context.", type: "Identifier" }] }, + { code: "a:b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, + { + code: "function a() { for(var b in {}) { var c = b; } c; }", + errors: [{ message: "\"c\" used outside of binding context.", type: "Identifier" }] + }, + { + code: "function a() { for(var b of {}) { var c = b;} c; }", + ecmaFeatures: { forOf: true }, + errors: [{ message: "\"c\" used outside of binding context.", type: "Identifier" }] + } + ] +}); From fadd5b55cafd0076a1a9a3be7fc4bb4c606c5572 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Fri, 3 Jul 2015 23:15:14 -0400 Subject: [PATCH 694/965] Merge pull request babel/eslint-plugin-babel#3 from mathieumg/spaceinbrackets_export Added support for experimental exports in the `space-in-brackets` rule. --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 6 +- .../rules/space-in-brackets.js | 309 +++++++ .../tests/space-in-brackets.js | 761 ++++++++++++++++++ 4 files changed, 1076 insertions(+), 2 deletions(-) create mode 100644 eslint/babel-eslint-plugin/rules/space-in-brackets.js create mode 100644 eslint/babel-eslint-plugin/tests/space-in-brackets.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index e29161738898..997a6148aabf 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -28,6 +28,7 @@ Finally enable all the rules you like to use (remember to disable the originals "babel/generator-star": 1, "babel/generator-star-spacing": 1, "babel/new-cap": 1, + "babel/space-in-brackets": 1, } } ``` @@ -40,3 +41,4 @@ Each rule cooresponds to a core eslint rule, and has the same options. - `babel/generator-star`: Handles async/await functions correctly - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) +- `babel/space-in-brackets`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 8bfde48f91a3..a486a4c1205d 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -6,13 +6,15 @@ module.exports = { 'object-shorthand': require('./rules/object-shorthand'), 'generator-star-spacing': require('./rules/generator-star-spacing'), 'generator-star': require('./rules/generator-star'), - 'new-cap': require('./rules/new-cap') + 'new-cap': require('./rules/new-cap'), + 'space-in-brackets': require('./rules/space-in-brackets'), }, rulesConfig: { 'block-scoped-var': 0, 'generator-star-spacing': 0, 'generator-star': 0, 'object-shorthand': 0, - 'new-cap': 0 + 'new-cap': 0, + 'space-in-brackets': 0 } }; diff --git a/eslint/babel-eslint-plugin/rules/space-in-brackets.js b/eslint/babel-eslint-plugin/rules/space-in-brackets.js new file mode 100644 index 000000000000..566ac351e839 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/space-in-brackets.js @@ -0,0 +1,309 @@ +/** + * @fileoverview Disallows or enforces spaces inside of brackets. + * @author Ian Christian Myers + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + * @copyright 2014 Brandyn Bennett. All rights reserved. + * @copyright 2014 Michael Ficarra. No rights reserved. + * @copyright 2014 Vignesh Anand. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var spaced = context.options[0] === "always"; + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option - The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] != null ? context.options[1][option] === !spaced : false; + } + + var options = { + spaced: spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays"), + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects"), + propertyNameException: isOptionSet("propertyName") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines whether two adjacent tokens are have whitespace between them. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not there is space between the tokens. + */ + function isSpaced(left, right) { + return left.range[1] < right.range[0]; + } + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + */ + function isSameLine(left, right) { + return left.loc.start.line === right.loc.start.line; + } + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + context.report(node, token.loc.start, + "There should be no space after '" + token.value + "'"); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + context.report(node, token.loc.start, + "There should be no space before '" + token.value + "'"); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report(node, token.loc.start, + "A space is required after '" + token.value + "'"); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report(node, token.loc.start, + "A space is required before '" + token.value + "'"); + } + + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + var closingCurlyBraceMustBeSpaced = + options.arraysInObjectsException && penultimate.value === "]" || + options.objectsInObjectsException && penultimate.value === "}" + ? !options.spaced : options.spaced; + + if (isSameLine(first, second)) { + if (options.spaced && !isSpaced(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && isSpaced(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (isSameLine(penultimate, last)) { + if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + MemberExpression: function(node) { + if (!node.computed) { + return; + } + + var property = node.property, + before = context.getTokenBefore(property), + first = context.getFirstToken(property), + last = context.getLastToken(property), + after = context.getTokenAfter(property); + + var propertyNameMustBeSpaced = options.propertyNameException ? + !options.spaced : options.spaced; + + if (isSameLine(before, first)) { + if (propertyNameMustBeSpaced) { + if (!isSpaced(before, first) && isSameLine(before, first)) { + reportRequiredBeginningSpace(node, before); + } + } else { + if (isSpaced(before, first)) { + reportNoBeginningSpace(node, before); + } + } + } + + if (isSameLine(last, after)) { + if (propertyNameMustBeSpaced) { + if (!isSpaced(last, after) && isSameLine(last, after)) { + reportRequiredEndingSpace(node, after); + } + } else { + if (isSpaced(last, after)) { + reportNoEndingSpace(node, after); + } + } + } + }, + + ArrayExpression: function(node) { + if (node.elements.length === 0) { + return; + } + + var first = context.getFirstToken(node), + second = context.getFirstToken(node, 1), + penultimate = context.getLastToken(node, 1), + last = context.getLastToken(node); + + var openingBracketMustBeSpaced = + options.objectsInArraysException && second.value === "{" || + options.arraysInArraysException && second.value === "[" || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + var closingBracketMustBeSpaced = + options.objectsInArraysException && penultimate.value === "}" || + options.arraysInArraysException && penultimate.value === "]" || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (isSameLine(first, second)) { + if (openingBracketMustBeSpaced && !isSpaced(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && isSpaced(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (isSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + }, + + ImportDeclaration: function(node) { + + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1]; + + // don't do anything for namespace or default imports + if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { + var first = context.getTokenBefore(firstSpecifier), + second = context.getFirstToken(firstSpecifier), + penultimate = context.getLastToken(lastSpecifier), + last = context.getTokenAfter(lastSpecifier); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + }, + + ExportNamedDeclaration: function(node) { + if (!node.specifiers.length) { + return; + } + + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = context.getTokenBefore(firstSpecifier), + second = context.getFirstToken(firstSpecifier), + penultimate = context.getLastToken(lastSpecifier), + last = context.getTokenAfter(lastSpecifier); + + if (first.value === "export") { + return; + } + + validateBraceSpacing(node, first, second, penultimate, last); + }, + + ObjectExpression: function(node) { + if (node.properties.length === 0) { + return; + } + + var first = context.getFirstToken(node), + second = context.getFirstToken(node, 1), + penultimate = context.getLastToken(node, 1), + last = context.getLastToken(node); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + }; + +}; + +module.exports.schema = [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "singleValue": { + "type": "boolean" + }, + "objectsInArrays": { + "type": "boolean" + }, + "arraysInArrays": { + "type": "boolean" + }, + "arraysInObjects": { + "type": "boolean" + }, + "objectsInObjects": { + "type": "boolean" + }, + "propertyName": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/eslint/babel-eslint-plugin/tests/space-in-brackets.js b/eslint/babel-eslint-plugin/tests/space-in-brackets.js new file mode 100644 index 000000000000..106120dd80b0 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/space-in-brackets.js @@ -0,0 +1,761 @@ +/* eslint-disable */ + +/** + * @fileoverview Disallows or enforces spaces inside of brackets. + * @author Ian Christian Myers + * @copyright 2014 Vignesh Anand. All rights reserved. + */ + +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + +eslintTester.addRuleTest("rules/space-in-brackets", { + + valid: [ + { code: "var foo = obj[ 1 ]", options: ["always"] }, + { code: "var foo = obj[ 'foo' ];", options: ["always"] }, + { code: "var foo = obj[ [ 1, 1 ] ];", options: ["always"] }, + + // always - singleValue + { code: "var foo = ['foo']", options: ["always", {singleValue: false}] }, + { code: "var foo = [2]", options: ["always", {singleValue: false}] }, + { code: "var foo = [[ 1, 1 ]]", options: ["always", {singleValue: false}] }, + { code: "var foo = [{ 'foo': 'bar' }]", options: ["always", {singleValue: false}] }, + { code: "var foo = [bar]", options: ["always", {singleValue: false}] }, + + // always - objectsInArrays + { code: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, 5, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{\n'bar': 'baz', \n'qux': [{ 'bar': 'baz' }], \n'quxx': 1 \n}]", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{ 'bar': 'baz' }]", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{ 'bar': 'baz' }, 1, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, { 'bar': 'baz' }, 5 ];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, { 'bar': 'baz' }, [{ 'bar': 'baz' }] ];", options: ["always", {objectsInArrays: false}] }, + + // always - arraysInArrays + { code: "var arr = [[ 1, 2 ], 2, 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, + { code: "var arr = [[ 1, 2 ], [[[ 1 ]]], 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, + + // always - arraysInArrays, objectsInArrays + { code: "var arr = [[ 1, 2 ], 2, 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false}] }, + + // always - arraysInArrays, objectsInArrays, singleValue + { code: "var arr = [[ 1, 2 ], [2], 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false, singleValue: false}] }, + + // always - arraysInObjects + { code: "var obj = { 'foo': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false}] }, + + // always - objectsInObjects + { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"objectsInObjects": false}] }, + + // always - arraysInObjects, objectsInObjects + { code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + + // always - arraysInObjects, objectsInObjects (reverse) + { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + + // always + { code: "obj[ foo ]", options: ["always"] }, + { code: "obj[\nfoo\n]", options: ["always"] }, + { code: "obj[ 'foo' ]", options: ["always"] }, + { code: "obj[ 'foo' + 'bar' ]", options: ["always"] }, + { code: "obj[ obj2[ foo ] ]", options: ["always"] }, + { code: "obj.map(function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + { code: "obj[ 'map' ](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + { code: "obj[ 'for' + 'Each' ](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + + { code: "var arr = [ 1, 2, 3, 4 ];", options: ["always"] }, + { code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", options: ["always"] }, + { code: "var arr = [\n1, 2, 3, 4\n];", options: ["always"] }, + + { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, + { code: "var obj = { foo: { bar: quxx }, baz: qux };", options: ["always"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, + + { code: "var foo = {};", options: ["always"] }, + { code: "var foo = [];", options: ["always"] }, + + { code: "this.db.mappings.insert([\n { alias: 'a', url: 'http://www.amazon.de' },\n { alias: 'g', url: 'http://www.google.de' }\n], function () {});", options: ["always", {singleValue: false, objectsInArrays: true, arraysInArrays: true}] }, + + // never + { code: "obj[foo]", options: ["never"] }, + { code: "obj['foo']", options: ["never"] }, + { code: "obj['foo' + 'bar']", options: ["never"] }, + { code: "obj['foo'+'bar']", options: ["never"] }, + { code: "obj[obj2[foo]]", options: ["never"] }, + { code: "obj.map(function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj['map'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj['for' + 'Each'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj[ obj2[ foo ] ]", options: ["never", {"propertyName": true}] }, + { code: "obj['for' + 'Each'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + + + { code: "obj[\nfoo]", options: ["never"] }, + { code: "obj[foo\n]", options: ["never"] }, + { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, + { code: "var arr = [1,\n2,\n3,\n4\n];", options: ["never"] }, + { code: "var arr = [\n1,\n2,\n3,\n4];", options: ["never"] }, + + // never - singleValue + { code: "var foo = [ 'foo' ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ 2 ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ [1, 1] ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ {'foo': 'bar'} ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ bar ]", options: ["never", {singleValue: true}] }, + + // never - objectsInArrays + { code: "var foo = [ {'bar': 'baz'}, 1, 5];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, 5, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {\n'bar': 'baz', \n'qux': [ {'bar': 'baz'} ], \n'quxx': 1 \n} ]", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {'bar': 'baz'} ]", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {'bar': 'baz'}, 1, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, {'bar': 'baz'} , 5];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, {'bar': 'baz'}, [ {'bar': 'baz'} ]];", options: ["never", {objectsInArrays: true}] }, + + // never - arraysInArrays + { code: "var arr = [ [1, 2], 2, 3, 4];", options: ["never", {"arraysInArrays": true}] }, + + // never - arraysInArrays, singleValue + { code: "var arr = [ [1, 2], [ [ [ 1 ] ] ], 3, 4];", options: ["never", {"arraysInArrays": true, singleValue: true}] }, + + // never - arraysInArrays, objectsInArrays + { code: "var arr = [ [1, 2], 2, 3, {'foo': 'bar'} ];", options: ["never", {"arraysInArrays": true, objectsInArrays: true}] }, + + { code: "var arr = [1, 2, 3, 4];", options: ["never"] }, + { code: "var arr = [[1, 2], 2, 3, 4];", options: ["never"] }, + { code: "var arr = [\n1, 2, 3, 4\n];", options: ["never"] }, + + { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, + { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, + + { code: "var foo = {};", options: ["never"] }, + { code: "var foo = [];", options: ["never"] }, + + { code: "var foo = [{'bar':'baz'}, 1, {'bar': 'baz'}];", options: ["never"] }, + { code: "var foo = [{'bar': 'baz'}];", options: ["never"] }, + { code: "var foo = [{\n'bar': 'baz', \n'qux': [{'bar': 'baz'}], \n'quxx': 1 \n}]", options: ["never"] }, + { code: "var foo = [1, {'bar': 'baz'}, 5];", options: ["never"] }, + { code: "var foo = [{'bar': 'baz'}, 1, 5];", options: ["never"] }, + { code: "var foo = [1, 5, {'bar': 'baz'}];", options: ["never"] }, + { code: "var obj = {'foo': [1, 2]}", options: ["never"] }, + + // propertyName: false + { code: "var foo = obj[1]", options: ["always", {propertyName: false}] }, + { code: "var foo = obj['foo'];", options: ["always", {propertyName: false}] }, + { code: "var foo = obj[[ 1, 1 ]];", options: ["always", {propertyName: false}] }, + + { code: "var foo = obj[ 1 ]", options: ["never", {propertyName: true}] }, + { code: "var foo = obj[ 'foo' ];", options: ["never", {propertyName: true}] }, + { code: "var foo = obj[ [1, 1] ];", options: ["never", {propertyName: true}] }, + { code: "import 'test.js';", ecmaFeatures: { modules: true } }, + { code: "export const thing = {\n value: 1 \n};", ecmaFeatures: { modules: true, blockBindings: true } }, + { code: "export const thing = {};", ecmaFeatures: { modules: true, blockBindings: true } }, + { code: "export let thing = {};", ecmaFeatures: { modules: true, blockBindings: true } }, + { code: "export var thing = {};", ecmaFeatures: { modules: true } }, + + // Babel test cases. + { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + ], + + invalid: [ + // objectsInArrays + { + code: "var foo = [ { 'bar': 'baz' }, 1, 5];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "A space is required before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "import {bar} from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration" + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration" + } + ] + }, + { + code: "export {bar};", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ExportNamedDeclaration" + }, + { + message: "A space is required before '}'", + type: "ExportNamedDeclaration" + } + ] + }, + { + code: "var foo = [1, 5, { 'bar': 'baz' } ];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var foo = [ { 'bar':'baz' }, 1, { 'bar': 'baz' } ];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + + // singleValue + { + code: "var obj = [ 'foo' ];", + options: ["always", {singleValue: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var obj = ['foo' ];", + options: ["always", {singleValue: false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + // singleValue + { + code: "var obj = ['foo'];", + options: ["never", {singleValue: true}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression" + }, + { + message: "A space is required before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var foo = obj[ 1];", + options: ["always"], + errors: [ + { + message: "A space is required before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "var foo = obj[1 ];", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "MemberExpression" + } + ] + }, + // propertyName + { + code: "var foo = obj[ 1];", + options: ["always", {propertyName: false}], + errors: [ + { + message: "There should be no space after '['", + type: "MemberExpression" + } + ] + }, + { + code: "var foo = obj[1 ];", + options: ["always", {propertyName: false}], + errors: [ + { + message: "There should be no space before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "var foo = obj[ 1];", + options: ["never", {propertyName: true}], + errors: [ + { + message: "A space is required before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "var foo = obj[1 ];", + options: ["never", {propertyName: true}], + errors: [ + { + message: "A space is required after '['", + type: "MemberExpression" + } + ] + }, + + // always - arraysInArrays + { + code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ 1, 2, 2, [ 3, 4 ] ];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [[ 1, 2 ], 2, [ 3, 4 ] ];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ]];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + + // never - arraysInArrays + { + code: "var arr = [[1, 2], 2, [3, 4]];", + options: ["never", {"arraysInArrays": true}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression" + }, + { + message: "A space is required before ']'", + type: "ArrayExpression" + } + ] + }, + + // always - arraysInObjects + { + code: "var obj = { 'foo': [ 1, 2 ] };", + options: ["always", {"arraysInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", + options: ["always", {"arraysInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + + // never - arraysInObjects + { + code: "var obj = {'foo': [1, 2]};", + options: ["never", {"arraysInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", + options: ["never", {"arraysInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + + // always-objectsInObjects + { + code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", + options: ["always", {"objectsInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", + options: ["always", {"objectsInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + + // never-objectsInObjects + { + code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", + options: ["never", {"objectsInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", + options: ["never", {"objectsInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + + // always & never + { + code: "var obj = {foo: bar, baz: qux};", + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression" + }, + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {foo: bar, baz: qux };", + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux};", + options: ["always"], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression" + }, + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {foo: bar, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { foo: { bar: quxx}, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression" + }, + { + message: "There should be no space after '{'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {foo: {bar: quxx }, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + }, + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var arr = [1, 2, 3, 4];", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression" + }, + { + message: "A space is required before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [1, 2, 3, 4 ];", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ 1, 2, 3, 4];", + options: ["always"], + errors: [ + { + message: "A space is required before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ 1, 2, 3, 4 ];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [1, 2, 3, 4 ];", + options: ["never"], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ 1, 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [ [ 1], 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression" + }, + { + message: "There should be no space after '['", + type: "ArrayExpression" + } + ] + }, + { + code: "var arr = [[1 ], 2, 3, 4 ];", + options: ["never"], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression" + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression" + } + ] + }, + { + code: "obj[ foo ]", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "MemberExpression" + }, + { + message: "There should be no space before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "obj[foo ]", + options: ["never"], + errors: [ + { + message: "There should be no space before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "obj[ foo]", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "MemberExpression" + } + ] + }, + { + code: "var foo = obj[1]", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "MemberExpression" + }, + { + message: "A space is required before ']'", + type: "MemberExpression" + } + ] + }, + { + code: "export const thing = {value: 1 };", + ecmaFeatures: { + modules: true, + blockBindings: true + }, + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression" + } + ] + } + ] +}); From 1bfe4aa02f0ec3e4f88981f5a5c4b89c9666ee8d Mon Sep 17 00:00:00 2001 From: jquense Date: Tue, 7 Jul 2015 19:40:03 -0400 Subject: [PATCH 695/965] v1.1.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 39305fd98c90..333e3871e4ea 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "1.0.0", + "version": "1.1.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 51d6ba733f5169ad1aaf72987201972461e21b66 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Thu, 16 Jul 2015 09:17:20 -0400 Subject: [PATCH 696/965] Merge pull request babel/eslint-plugin-babel#4 from mathieumg/objectcurlyspacing_export Added support for experimental exports in the `object-curly-spacing` rule --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 1 + .../rules/object-curly-spacing.js | 236 +++++++++ .../tests/object-curly-spacing.js | 500 ++++++++++++++++++ 4 files changed, 739 insertions(+) create mode 100644 eslint/babel-eslint-plugin/rules/object-curly-spacing.js create mode 100644 eslint/babel-eslint-plugin/tests/object-curly-spacing.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 997a6148aabf..d6507bf78222 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -28,6 +28,7 @@ Finally enable all the rules you like to use (remember to disable the originals "babel/generator-star": 1, "babel/generator-star-spacing": 1, "babel/new-cap": 1, + "babel/object-curly-spacing": 1, "babel/space-in-brackets": 1, } } @@ -41,4 +42,5 @@ Each rule cooresponds to a core eslint rule, and has the same options. - `babel/generator-star`: Handles async/await functions correctly - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) +- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/space-in-brackets`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index a486a4c1205d..8ff696b7a70e 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -7,6 +7,7 @@ module.exports = { 'generator-star-spacing': require('./rules/generator-star-spacing'), 'generator-star': require('./rules/generator-star'), 'new-cap': require('./rules/new-cap'), + 'object-curly-spacing': require('./rules/object-curly-spacing'), 'space-in-brackets': require('./rules/space-in-brackets'), }, rulesConfig: { diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js new file mode 100644 index 000000000000..d498211a998b --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -0,0 +1,236 @@ +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + * @copyright 2014 Brandyn Bennett. All rights reserved. + * @copyright 2014 Michael Ficarra. No rights reserved. + * @copyright 2014 Vignesh Anand. All rights reserved. + * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var spaced = context.options[0] === "always"; + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option - The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] != null ? context.options[1][option] === !spaced : false; + } + + var options = { + spaced: spaced, + arraysInObjectsException: isOptionSet("arraysInObjects"), + objectsInObjectsException: isOptionSet("objectsInObjects") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines whether two adjacent tokens are have whitespace between them. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not there is space between the tokens. + */ + function isSpaced(left, right) { + return left.range[1] < right.range[0]; + } + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + */ + function isSameLine(left, right) { + return left.loc.start.line === right.loc.start.line; + } + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + context.report(node, token.loc.start, + "There should be no space after '" + token.value + "'"); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + context.report(node, token.loc.start, + "There should be no space before '" + token.value + "'"); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report(node, token.loc.start, + "A space is required after '" + token.value + "'"); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report(node, token.loc.start, + "A space is required before '" + token.value + "'"); + } + + /** + * Determines if spacing in curly braces is valid. + * @param {ASTNode} node The AST node to check. + * @param {Token} first The first token to check (should be the opening brace) + * @param {Token} second The second token to check (should be first after the opening brace) + * @param {Token} penultimate The penultimate token to check (should be last before closing brace) + * @param {Token} last The last token to check (should be closing brace) + * @returns {void} + */ + function validateBraceSpacing(node, first, second, penultimate, last) { + var closingCurlyBraceMustBeSpaced = + options.arraysInObjectsException && penultimate.value === "]" || + options.objectsInObjectsException && penultimate.value === "}" + ? !options.spaced : options.spaced; + + if (isSameLine(first, second)) { + if (options.spaced && !isSpaced(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!options.spaced && isSpaced(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (isSameLine(penultimate, last)) { + if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + + // var {x} = y; + ObjectPattern: function(node) { + var firstSpecifier = node.properties[0], + lastSpecifier = node.properties[node.properties.length - 1]; + + var first = context.getTokenBefore(firstSpecifier), + second = context.getFirstToken(firstSpecifier), + penultimate = context.getLastToken(lastSpecifier), + last = context.getTokenAfter(lastSpecifier); + + // support trailing commas + if (last.value === ",") { + penultimate = last; + last = context.getTokenAfter(last); + } + + validateBraceSpacing(node, first, second, penultimate, last); + }, + + // import {y} from 'x'; + ImportDeclaration: function(node) { + + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1]; + + // don't do anything for namespace or default imports + if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { + var first = context.getTokenBefore(firstSpecifier), + second = context.getFirstToken(firstSpecifier), + penultimate = context.getLastToken(lastSpecifier), + last = context.getTokenAfter(lastSpecifier); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + }, + + // export {name} from 'yo'; + ExportNamedDeclaration: function(node) { + if (!node.specifiers.length) { + return; + } + + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = context.getTokenBefore(firstSpecifier), + second = context.getFirstToken(firstSpecifier), + penultimate = context.getLastToken(lastSpecifier), + last = context.getTokenAfter(lastSpecifier); + + if (first.value === "export") { + return; + } + + validateBraceSpacing(node, first, second, penultimate, last); + + }, + + // var y = {x: 'y'} + ObjectExpression: function(node) { + if (node.properties.length === 0) { + return; + } + + var first = context.getFirstToken(node), + second = context.getFirstToken(node, 1), + penultimate = context.getLastToken(node, 1), + last = context.getLastToken(node); + + validateBraceSpacing(node, first, second, penultimate, last); + } + + }; + +}; + +module.exports.schema = [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "arraysInObjects": { + "type": "boolean" + }, + "objectsInObjects": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js new file mode 100644 index 000000000000..fb97a70130bb --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -0,0 +1,500 @@ +/* eslint-disable */ + +/** + * @fileoverview Disallows or enforces spaces inside of object literals. + * @author Jamund Ferguson + * @copyright 2014 Vignesh Anand. All rights reserved. + * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + */ + +var linter = require('eslint').linter + , ESLintTester = require('eslint-tester') + , eslintTester = new ESLintTester(linter); + +eslintTester.addRuleTest("rules/object-curly-spacing", { + + valid: [ + + // always - object literals + { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, + { code: "var obj = { foo: { bar: quxx }, baz: qux };", options: ["always"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, + + // always - destructuring + { code: "var { x } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { x, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { x,y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var {\nx,y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var {\nx,y\n} = z", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { x = 10, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { x: { z }, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var {\ny,\n} = x", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { y, } = x", options: ["always"], ecmaFeatures: { destructuring: true } }, + + // always - import / export + { code: "import { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import {\ndoor } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export { door }", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + + // always - empty object + { code: "var foo = {};", options: ["always"] }, + + // always - objectsInObjects + { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"objectsInObjects": false}] }, + + // always - arraysInObjects + { code: "var obj = { 'foo': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false}] }, + + // always - arraysInObjects, objectsInObjects + { code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + + // always - arraysInObjects, objectsInObjects (reverse) + { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + + // never + { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, + + // never - object literals + { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, + { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, + { code: "var obj = {foo: {\nbar: quxx}, baz: qux\n};", options: ["never"] }, + { code: "var obj = {foo: {\nbar: quxx\n}, baz: qux};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, + + // never - destructuring + { code: "var {x} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {x, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {x,y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {\nx,y\n} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {x = 10} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {x = 10, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {x: {z}, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {\nx: {z\n}, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {\ny,\n} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {y,} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, + + // never - import / export + { code: "import {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {\ndoor} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {\ndoor\n} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {house,mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {house, mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {door}", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + + // never - empty object + { code: "var foo = {};", options: ["never"] }, + + // never - objectsInObjects + { code: "var obj = {'foo': {'bar': 1, 'baz': 2} };", options: ["never", {"objectsInObjects": true}]}, + + // Babel test cases. + { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + ], + + invalid: [ + { + code: "import {bar} from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration", + line: 1, + column: 7 + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 11 + } + ] + }, + { + code: "export {bar};", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ExportNamedDeclaration", + line: 1, + column: 7 + }, + { + message: "A space is required before '}'", + type: "ExportNamedDeclaration", + line: 1, + column: 11 + } + ] + }, + + // always - arraysInObjects + { + code: "var obj = { 'foo': [ 1, 2 ] };", + options: ["always", {"arraysInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", + options: ["always", {"arraysInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression" + } + ] + }, + + // always-objectsInObjects + { + code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", + options: ["always", {"objectsInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 42 + } + ] + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", + options: ["always", {"objectsInObjects": false}], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 60 + } + ] + }, + + // always-destructuring trailing comma + { + code: "var { a,} = x;", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "A space is required before '}'", + type: "ObjectPattern", + line: 1, + column: 8 + } + ] + }, + { + code: "var {a, } = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 8 + } + ] + }, + + // never-objectsInObjects + { + code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", + options: ["never", {"objectsInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression", + line: 1, + column: 38 + } + ] + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", + options: ["never", {"objectsInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression", + line: 1, + column: 54 + } + ] + }, + + // always & never + { + code: "var obj = {foo: bar, baz: qux};", + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression", + line: 1, + column: 10 + }, + { + message: "A space is required before '}'", + type: "ObjectExpression", + line: 1, + column: 29 + } + ] + }, + { + code: "var obj = {foo: bar, baz: qux };", + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression", + line: 1, + column: 10 + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux};", + options: ["always"], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression", + line: 1, + column: 30 + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression", + line: 1, + column: 10 + }, + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 31 + } + ] + }, + { + code: "var obj = {foo: bar, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 30 + } + ] + }, + { + code: "var obj = { foo: bar, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression", + line: 1, + column: 10 + } + ] + }, + { + code: "var obj = { foo: { bar: quxx}, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectExpression", + line: 1, + column: 10 + }, + { + message: "There should be no space after '{'", + type: "ObjectExpression", + line: 1, + column: 17 + } + ] + }, + { + code: "var obj = {foo: {bar: quxx }, baz: qux };", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 27 + }, + { + message: "There should be no space before '}'", + type: "ObjectExpression", + line: 1, + column: 39 + } + ] + }, + { + code: "export const thing = {value: 1 };", + ecmaFeatures: { + modules: true, + blockBindings: true + }, + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectExpression", + line: 1, + column: 21 + } + ] + }, + + // destructuring + { + code: "var {x, y} = y", + ecmaFeatures: {destructuring: true}, + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectPattern", + line: 1, + column: 4 + }, + { + message: "A space is required before '}'", + type: "ObjectPattern", + line: 1, + column: 9 + } + ] + }, + { + code: "var { x, y} = y", + ecmaFeatures: {destructuring: true}, + options: ["always"], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectPattern", + line: 1, + column: 10 + } + ] + }, + { + code: "var { x, y } = y", + ecmaFeatures: {destructuring: true}, + options: ["never"], + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectPattern", + line: 1, + column: 4 + }, + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 11 + } + ] + }, + { + code: "var {x, y } = y", + ecmaFeatures: {destructuring: true}, + options: ["never"], + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 10 + } + ] + }, + { + code: "var { x=10} = y", + ecmaFeatures: {destructuring: true}, + options: ["always"], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectPattern", + line: 1, + column: 10 + } + ] + }, + { + code: "var {x=10 } = y", + ecmaFeatures: {destructuring: true}, + options: ["always"], + errors: [ + { + message: "A space is required after '{'", + type: "ObjectPattern", + line: 1, + column: 4 + } + ] + }, + + // never - arraysInObjects + { + code: "var obj = {'foo': [1, 2]};", + options: ["never", {"arraysInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", + options: ["never", {"arraysInObjects": true}], + errors: [ + { + message: "A space is required before '}'", + type: "ObjectExpression" + } + ] + } + ] +}); From f0a2fb6b7bcec680b09fb9c36bfe973cfa479f90 Mon Sep 17 00:00:00 2001 From: jquense Date: Mon, 20 Jul 2015 14:55:25 -0400 Subject: [PATCH 697/965] v1.2.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 333e3871e4ea..39f8ad4876bc 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "1.1.0", + "version": "1.2.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 89011d92fc949be3b1d222fc04b9b7ba795c57c0 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Fri, 24 Jul 2015 14:14:14 -0400 Subject: [PATCH 698/965] Merge pull request babel/eslint-plugin-babel#5 from deepsweet/eslint-1.0-rc support eslint@>=1.0.0-rc-1 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 39f8ad4876bc..c955b1115156 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/babel/eslint-plugin-babel#readme", "peerDependencies": { - "eslint": ">=0.8.0" + "eslint": ">=0.8.0 || >=1.0.0-rc-1" }, "devDependencies": { "babel-eslint": "^3.1.17", From 3eeaa4aa36bbf0829518594a48cac4b9ece91d6b Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 4 Aug 2015 23:30:13 -0400 Subject: [PATCH 699/965] Merge pull request babel/eslint-plugin-babel#7 from mathieumg/eslint1.0 Updated for ESLint 1.0 --- eslint/babel-eslint-plugin/README.md | 10 +- eslint/babel-eslint-plugin/index.js | 11 +- eslint/babel-eslint-plugin/package.json | 7 +- .../rules/block-scoped-var.js | 340 -------- .../rules/generator-star-spacing.js | 33 +- .../rules/generator-star.js | 84 -- eslint/babel-eslint-plugin/rules/new-cap.js | 3 +- .../rules/object-shorthand.js | 3 +- .../rules/space-in-brackets.js | 309 ------- .../tests/block-scoped-var.js | 105 --- .../tests/generator-star-spacing.js | 724 ++++++++++++++--- .../tests/generator-star.js | 32 - eslint/babel-eslint-plugin/tests/new-cap.js | 53 +- .../tests/object-curly-spacing.js | 70 +- .../tests/object-shorthand.js | 54 +- .../tests/space-in-brackets.js | 761 ------------------ 16 files changed, 747 insertions(+), 1852 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/rules/block-scoped-var.js delete mode 100644 eslint/babel-eslint-plugin/rules/generator-star.js delete mode 100644 eslint/babel-eslint-plugin/rules/space-in-brackets.js delete mode 100644 eslint/babel-eslint-plugin/tests/block-scoped-var.js delete mode 100644 eslint/babel-eslint-plugin/tests/generator-star.js delete mode 100644 eslint/babel-eslint-plugin/tests/space-in-brackets.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index d6507bf78222..c76c666ca32d 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -23,13 +23,10 @@ Finally enable all the rules you like to use (remember to disable the originals ```json { "rules": { - "babel/block-scoped-var": 1, - "babel/object-shorthand": 1, - "babel/generator-star": 1, "babel/generator-star-spacing": 1, "babel/new-cap": 1, "babel/object-curly-spacing": 1, - "babel/space-in-brackets": 1, + "babel/object-shorthand": 1, } } ``` @@ -37,10 +34,7 @@ Finally enable all the rules you like to use (remember to disable the originals Each rule cooresponds to a core eslint rule, and has the same options. -- `babel/block-scoped-var`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` -- `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) -- `babel/generator-star`: Handles async/await functions correctly - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` -- `babel/space-in-brackets`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` +- `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 8ff696b7a70e..369b9c11b6f8 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -2,20 +2,15 @@ module.exports = { rules: { - 'block-scoped-var': require('./rules/block-scoped-var'), - 'object-shorthand': require('./rules/object-shorthand'), 'generator-star-spacing': require('./rules/generator-star-spacing'), - 'generator-star': require('./rules/generator-star'), 'new-cap': require('./rules/new-cap'), 'object-curly-spacing': require('./rules/object-curly-spacing'), - 'space-in-brackets': require('./rules/space-in-brackets'), + 'object-shorthand': require('./rules/object-shorthand'), }, rulesConfig: { - 'block-scoped-var': 0, 'generator-star-spacing': 0, - 'generator-star': 0, - 'object-shorthand': 0, 'new-cap': 0, - 'space-in-brackets': 0 + 'object-curly-spacing': 0, + 'object-shorthand': 0, } }; diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index c955b1115156..cfce981c1fc8 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -24,12 +24,11 @@ }, "homepage": "https://github.com/babel/eslint-plugin-babel#readme", "peerDependencies": { - "eslint": ">=0.8.0 || >=1.0.0-rc-1" + "eslint": ">=1.0.0" }, "devDependencies": { - "babel-eslint": "^3.1.17", - "eslint": "^0.23.0", - "eslint-tester": "^0.8.0", + "babel-eslint": "^4.0.5", + "eslint": "^1.0.0", "is-my-json-valid": "^2.12.0", "mocha": "^2.2.5", "phantomjs": "^1.9.17" diff --git a/eslint/babel-eslint-plugin/rules/block-scoped-var.js b/eslint/babel-eslint-plugin/rules/block-scoped-var.js deleted file mode 100644 index 71479e20d7be..000000000000 --- a/eslint/babel-eslint-plugin/rules/block-scoped-var.js +++ /dev/null @@ -1,340 +0,0 @@ -/** - * @fileoverview Rule to check for "block scoped" variables by binding context - * @author Matt DuVall - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var scopeStack = []; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether an identifier is in declaration position or is a non-declaration reference. - * @param {ASTNode} id The identifier. - * @param {ASTNode} parent The identifier's parent AST node. - * @returns {Boolean} true when the identifier is in declaration position. - */ - function isDeclaration(id, parent) { - switch (parent.type) { - case "FunctionDeclaration": - case "FunctionExpression": - return parent.params.indexOf(id) > -1 || id === parent.id; - - case "VariableDeclarator": - return id === parent.id; - - case "CatchClause": - return id === parent.param; - - default: - return false; - } - } - - /** - * Determines whether an identifier is in property position. - * @param {ASTNode} id The identifier. - * @param {ASTNode} parent The identifier's parent AST node. - * @returns {Boolean} true when the identifier is in property position. - */ - function isProperty(id, parent) { - switch (parent.type) { - case "MemberExpression": - return id === parent.property && !parent.computed; - - case "Property": - return id === parent.key; - - default: - return false; - } - } - - /** - * Pushes a new scope object on the scope stack. - * @returns {void} - */ - function pushScope() { - scopeStack.push([]); - } - - /** - * Removes the topmost scope object from the scope stack. - * @returns {void} - */ - function popScope() { - scopeStack.pop(); - } - - /** - * Declares the given names in the topmost scope object. - * @param {[String]} names A list of names to declare. - * @returns {void} - */ - function declare(names) { - [].push.apply(scopeStack[scopeStack.length - 1], names); - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - /** - * Declares all relevant identifiers for module imports. - * @param {ASTNode} node The AST node representing an import. - * @returns {void} - * @private - */ - function declareImports(node) { - declare([node.local.name]); - - if (node.imported && node.imported.name !== node.local.name) { - declare([node.imported.name]); - } - } - - /** - * Declares all relevant identifiers for module exports. - * @param {ASTNode} node The AST node representing an export. - * @returns {void} - * @private - */ - function declareExports(node) { - if (node.exported && node.exported.name) { - declare([node.exported.name]); - - if (node.local) { - declare([node.local.name]); - } - } - } - - /** - * Declares all relevant identifiers for classes. - * @param {ASTNode} node The AST node representing a class. - * @returns {void} - * @private - */ - function declareClass(node) { - - if (node.id) { - declare([node.id.name]); - } - - pushScope(); - } - - /** - * Declares all relevant identifiers for classes. - * @param {ASTNode} node The AST node representing a class. - * @returns {void} - * @private - */ - function declareClassMethod(node) { - pushScope(); - - declare([node.key.name]); - } - - /** - * Add declarations based on the type of node being passed. - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function declareByNodeType(node) { - - var declarations = []; - - switch (node.type) { - case "Identifier": - declarations.push(node.name); - break; - - case "ObjectPattern": - node.properties.forEach(function(property) { - declarations.push(property.key.name); - if (property.value) { - declarations.push(property.value.name); - } - }); - break; - - case "ArrayPattern": - node.elements.forEach(function(element) { - if (element) { - declarations.push(element.name); - } - }); - break; - - case "AssignmentPattern": - declareByNodeType(node.left); - break; - - case "RestElement": - declareByNodeType(node.argument); - break; - - // no default - } - - declare(declarations); - - } - - /** - * Adds declarations of the function parameters and pushes the scope - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionHandler(node) { - pushScope(); - - node.params.forEach(function(param) { - declareByNodeType(param); - }); - - declare(node.rest ? [node.rest.name] : []); - declare(["arguments"]); - } - - /** - * Adds declaration of the function name in its parent scope then process the function - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionDeclarationHandler(node) { - declare(node.id ? [node.id.name] : []); - functionHandler(node); - } - - /** - * Process function declarations and declares its name in its own scope - * @param {ASTNode} node The node containing declarations. - * @returns {void} - * @private - */ - function functionExpressionHandler(node) { - functionHandler(node); - declare(node.id ? [node.id.name] : []); - } - - function variableDeclarationHandler(node) { - node.declarations.forEach(function(declaration) { - declareByNodeType(declaration.id); - }); - - } - - return { - "Program": function() { - var scope = context.getScope(); - scopeStack = [scope.variables.map(function(v) { - return v.name; - })]; - - // global return creates another scope - if (context.ecmaFeatures.globalReturn) { - scope = scope.childScopes[0]; - scopeStack.push(scope.variables.map(function(v) { - return v.name; - })); - } - }, - - "ImportSpecifier": declareImports, - "ImportDefaultSpecifier": declareImports, - "ImportNamespaceSpecifier": declareImports, - - "ExportSpecifier": declareExports, - "ExportDefaultSpecifier": declareExports, - "ExportNamespaceSpecifier": declareExports, - - "BlockStatement": function(node) { - var statements = node.body; - pushScope(); - statements.forEach(function(stmt) { - if (stmt.type === "VariableDeclaration") { - variableDeclarationHandler(stmt); - } else if (stmt.type === "FunctionDeclaration") { - declare([stmt.id.name]); - } - }); - }, - - "VariableDeclaration": function (node) { - variableDeclarationHandler(node); - }, - - "BlockStatement:exit": popScope, - - "CatchClause": function(node) { - pushScope(); - declare([node.param.name]); - }, - "CatchClause:exit": popScope, - - "FunctionDeclaration": functionDeclarationHandler, - "FunctionDeclaration:exit": popScope, - - "ClassDeclaration": declareClass, - "ClassDeclaration:exit": popScope, - - "ClassExpression": declareClass, - "ClassExpression:exit": popScope, - - "MethodDefinition": declareClassMethod, - "MethodDefinition:exit": popScope, - - "FunctionExpression": functionExpressionHandler, - "FunctionExpression:exit": popScope, - - // Arrow functions cannot have names - "ArrowFunctionExpression": functionHandler, - "ArrowFunctionExpression:exit": popScope, - - "ForStatement": function() { - pushScope(); - }, - "ForStatement:exit": popScope, - - "ForInStatement": function() { - pushScope(); - }, - "ForInStatement:exit": popScope, - - "ForOfStatement": function() { - pushScope(); - }, - "ForOfStatement:exit": popScope, - - "Identifier": function(node) { - var ancestor = context.getAncestors().pop(); - if (isDeclaration(node, ancestor) || isProperty(node, ancestor) || ancestor.type === "LabeledStatement") { - return; - } - - for (var i = 0, l = scopeStack.length; i < l; i++) { - if (scopeStack[i].indexOf(node.name) > -1) { - return; - } - } - - context.report(node, "\"" + node.name + "\" used outside of binding context."); - } - }; - -}; - -module.exports.schema = []; diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js index b122ed19c8b1..416efff8e2e1 100644 --- a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -9,12 +9,17 @@ module.exports = function(context) { - var mode = { - before: { before: true, after: false }, - after: { before: false, after: true }, - both: { before: true, after: true }, - neither: { before: false, after: false } - }[context.options[0] || "before"]; + var mode = (function(option) { + if (option == null || typeof option === "string") { + return { + before: { before: true, after: false }, + after: { before: false, after: true }, + both: { before: true, after: true }, + neither: { before: false, after: false } + }[option || "before"]; + } + return option; + }(context.options[0])); function isAsyncGenerator(node){ return context.getFirstToken(node, 2).value === '*' @@ -87,6 +92,18 @@ module.exports = function(context) { module.exports.schema = [ { - "enum": ["before", "after", "both", "neither"] + "oneOf": [ + { + "enum": ["before", "after", "both", "neither"] + }, + { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"} + }, + "additionalProperties": false + } + ] } -]; \ No newline at end of file +]; diff --git a/eslint/babel-eslint-plugin/rules/generator-star.js b/eslint/babel-eslint-plugin/rules/generator-star.js deleted file mode 100644 index b5247f4f6880..000000000000 --- a/eslint/babel-eslint-plugin/rules/generator-star.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @fileoverview Rule to check for the position of the * in your generator functions - * @author Jamund Ferguson - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - -"use strict"; - -var parse = require('../helpers').parse - -module.exports = function(context) { - - var position = context.options[0] || "end"; - - function isAsyncGenerator(node){ - return context.getFirstToken(node, 2).value === '*' - } - - /** - * Check the position of the star compared to the expected position. - * @param {ASTNode} node - the entire function node - * @returns {void} - */ - function checkStarPosition(node) { - - var first = context.getFirstToken(node) - , isAsync = first.value === 'async' - , starToken; - - - if (!node.generator || (isAsync && !isAsyncGenerator(node))) { - return; - } - - // Blocked, pending decision to fix or work around in eslint/espree#36 - if (context.getAncestors().pop().method) { - return; - } - - starToken = context.getFirstToken(node, isAsync ? 2 : 1); - - //console.log(declaration, starToken) - - // check for function *name() {} - if (position === "end") { - if (starToken.range[1] !== context.getTokenAfter(starToken).range[0]) { - // * starts where the next identifier begins - context.report(node, "Expected a space before *."); - } - } - - // check for function* name() {} - if (position === "start") { - - // * begins where the previous identifier ends - if (starToken.range[0] !== context.getTokenBefore(starToken).range[1]) { - context.report(node, "Expected no space before *."); - } - } - - // check for function * name() {} - if (position === "middle") { - - // must be a space before and afer the * - if (starToken.range[0] <= context.getTokenBefore(starToken).range[1] || - starToken.range[1] >= context.getTokenAfter(starToken).range[0]) { - context.report(node, "Expected spaces around *."); - } - } - - } - - return { - "FunctionDeclaration": checkStarPosition, - "FunctionExpression": checkStarPosition - }; - -}; - -module.exports.schema = [ - { - "enum": ["start", "middle", "end"] - } -]; \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js index b1ab732d87fe..a1d4575c2a80 100644 --- a/eslint/babel-eslint-plugin/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -29,6 +29,7 @@ var CAPS_ALLOWED = [ * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` */ function checkArray(obj, key, fallback) { + /* istanbul ignore if */ if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { throw new TypeError(key + ", if provided, must be an Array"); } @@ -144,7 +145,7 @@ module.exports = function(context) { * @returns {Boolean} Returns true if the callee may be capitalized */ function isCapAllowed(allowedMap, node, calleeName) { - if (allowedMap[calleeName]) { + if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) { return true; } if (calleeName === "UTC" && node.callee.type === "MemberExpression") { diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js index e584bfb684c9..4bed9e832164 100644 --- a/eslint/babel-eslint-plugin/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -42,7 +42,8 @@ module.exports = function(context) { return; } - if (node.kind === 'get' || node.kind === 'set') { + // getters, setters and computed properties are ignored + if (node.kind === "get" || node.kind === "set" || node.computed) { return; } diff --git a/eslint/babel-eslint-plugin/rules/space-in-brackets.js b/eslint/babel-eslint-plugin/rules/space-in-brackets.js deleted file mode 100644 index 566ac351e839..000000000000 --- a/eslint/babel-eslint-plugin/rules/space-in-brackets.js +++ /dev/null @@ -1,309 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of brackets. - * @author Ian Christian Myers - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === "always"; - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] != null ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - singleElementException: isOptionSet("singleValue"), - objectsInArraysException: isOptionSet("objectsInArrays"), - arraysInArraysException: isOptionSet("arraysInArrays"), - arraysInObjectsException: isOptionSet("arraysInObjects"), - objectsInObjectsException: isOptionSet("objectsInObjects"), - propertyNameException: isOptionSet("propertyName") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return left.range[1] < right.range[0]; - } - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space after '" + token.value + "'"); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, - "A space is required after '" + token.value + "'"); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); - } - - - /** - * Determines if spacing in curly braces is valid. - * @param {ASTNode} node The AST node to check. - * @param {Token} first The first token to check (should be the opening brace) - * @param {Token} second The second token to check (should be first after the opening brace) - * @param {Token} penultimate The penultimate token to check (should be last before closing brace) - * @param {Token} last The last token to check (should be closing brace) - * @returns {void} - */ - function validateBraceSpacing(node, first, second, penultimate, last) { - var closingCurlyBraceMustBeSpaced = - options.arraysInObjectsException && penultimate.value === "]" || - options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (options.spaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!options.spaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (isSameLine(penultimate, last)) { - if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - - MemberExpression: function(node) { - if (!node.computed) { - return; - } - - var property = node.property, - before = context.getTokenBefore(property), - first = context.getFirstToken(property), - last = context.getLastToken(property), - after = context.getTokenAfter(property); - - var propertyNameMustBeSpaced = options.propertyNameException ? - !options.spaced : options.spaced; - - if (isSameLine(before, first)) { - if (propertyNameMustBeSpaced) { - if (!isSpaced(before, first) && isSameLine(before, first)) { - reportRequiredBeginningSpace(node, before); - } - } else { - if (isSpaced(before, first)) { - reportNoBeginningSpace(node, before); - } - } - } - - if (isSameLine(last, after)) { - if (propertyNameMustBeSpaced) { - if (!isSpaced(last, after) && isSameLine(last, after)) { - reportRequiredEndingSpace(node, after); - } - } else { - if (isSpaced(last, after)) { - reportNoEndingSpace(node, after); - } - } - } - }, - - ArrayExpression: function(node) { - if (node.elements.length === 0) { - return; - } - - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); - - var openingBracketMustBeSpaced = - options.objectsInArraysException && second.value === "{" || - options.arraysInArraysException && second.value === "[" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - var closingBracketMustBeSpaced = - options.objectsInArraysException && penultimate.value === "}" || - options.arraysInArraysException && penultimate.value === "]" || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (openingBracketMustBeSpaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!openingBracketMustBeSpaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (isSameLine(penultimate, last)) { - if (closingBracketMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingBracketMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - }, - - ImportDeclaration: function(node) { - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; - - // don't do anything for namespace or default imports - if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - }, - - ExportNamedDeclaration: function(node) { - if (!node.specifiers.length) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - if (first.value === "export") { - return; - } - - validateBraceSpacing(node, first, second, penultimate, last); - }, - - ObjectExpression: function(node) { - if (node.properties.length === 0) { - return; - } - - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" - }, - "arraysInObjects": { - "type": "boolean" - }, - "objectsInObjects": { - "type": "boolean" - }, - "propertyName": { - "type": "boolean" - } - }, - "additionalProperties": false - } -]; diff --git a/eslint/babel-eslint-plugin/tests/block-scoped-var.js b/eslint/babel-eslint-plugin/tests/block-scoped-var.js deleted file mode 100644 index 61297094ea21..000000000000 --- a/eslint/babel-eslint-plugin/tests/block-scoped-var.js +++ /dev/null @@ -1,105 +0,0 @@ -/* eslint-disable */ - -/** - * @fileoverview Tests for block-scoped-var rule - * @author Matt DuVall - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - */ - -var eslint = require("eslint").linter, - ESLintTester = require("eslint-tester"), - eslintTester = new ESLintTester(eslint); - -eslintTester.addRuleTest("rules/block-scoped-var", { - valid: [ - //original test cases - { code: "function f() { } f(); var exports = { f: f };", ecmaFeatures: {modules: true} }, - { code: "var f = () => {}; f(); var exports = { f: f };", ecmaFeatures: {arrowFunctions: true, modules: true} }, - "!function f(){ f; }", - "function f() { } f(); var exports = { f: f };", - "function f() { var a, b; { a = true; } b = a; }", - "var a; function f() { var b = a; }", - "function f(a) { }", - "!function(a) { };", - "!function f(a) { };", - "function f(a) { var b = a; }", - "!function f(a) { var b = a; };", - "function f() { var g = f; }", - "function f() { } function g() { var f = g; }", - "function f() { var hasOwnProperty; { hasOwnProperty; } }", - "function f(){ a; b; var a, b; }", - "function f(){ g(); function g(){} }", - { code: "function myFunc(foo) { \"use strict\"; var { bar } = foo; bar.hello();}", ecmaFeatures: { destructuring: true } }, - { code: "function myFunc(foo) { \"use strict\"; var [ bar ] = foo; bar.hello();}", ecmaFeatures: { destructuring: true } }, - { code: "function myFunc(...foo) { return foo;}", ecmaFeatures: { restParams: true } }, - { code: "var f = () => { var g = f; }", ecmaFeatures: { arrowFunctions: true } }, - { code: "class Foo {}\nexport default Foo;", ecmaFeatures: { modules: true, classes: true } }, - { code: "new Date", globals: {Date: false} }, - { code: "new Date", globals: {} }, - { code: "var eslint = require('eslint');", globals: {require: false} }, - { code: "var fun = function({x}) {return x;};", ecmaFeatures: { destructuring: true } }, - { code: "var fun = function([,x]) {return x;};", ecmaFeatures: { destructuring: true } }, - "function f(a) { return a.b; }", - "var a = { \"foo\": 3 };", - "var a = { foo: 3 };", - "var a = { foo: 3, bar: 5 };", - "var a = { set foo(a){}, get bar(){} };", - "function f(a) { return arguments[0]; }", - "function f() { }; var a = f;", - "var a = f; function f() { };", - "function f(){ for(var i; i; i) i; }", - "function f(){ for(var a=0, b=1; a; b) a, b; }", - "function f(){ for(var a in {}) a; }", - "function f(){ switch(2) { case 1: var b = 2; b; break; default: b; break;} b; }", - "a:;", - { code: "const React = require(\"react/addons\");const cx = React.addons.classSet;", globals: { require: false }, ecmaFeatures: { globalReturn: true, modules: true, blockBindings: true }}, - { code: "var v = 1; function x() { return v; };", ecmaFeatures: { globalReturn: true }}, - { code: "import * as y from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, - { code: "import y from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, - { code: "import {x as y} from \"./other.js\"; y();", ecmaFeatures: { modules: true }}, - { code: "var x; export {x};", ecmaFeatures: { modules: true }}, - { code: "var x; export {x as v};", ecmaFeatures: { modules: true }}, - { code: "export {x} from \"./other.js\";", ecmaFeatures: { modules: true }}, - { code: "export {x as v} from \"./other.js\";", ecmaFeatures: { modules: true }}, - { code: "class Test { myFunction() { return true; }}", ecmaFeatures: { classes: true }}, - { code: "class Test { get flag() { return true; }}", ecmaFeatures: { classes: true }}, - { code: "var Test = class { myFunction() { return true; }}", ecmaFeatures: { classes: true }}, - { code: "var doStuff; let {x: y} = {x: 1}; doStuff(y);", ecmaFeatures: { blockBindings: true, destructuring: true }}, - { code: "function foo({x: y}) { return y; }", ecmaFeatures: { blockBindings: true, destructuring: true }}, - - // Babel-specific test-cases. - { code: "export x from \"./other.js\";", parser: "babel-eslint", ecmaFeatures: {modules: true} }, - { code: "export * as x from \"./other.js\";", parser: "babel-eslint", ecmaFeatures: {modules: true} }, - ], - invalid: [ - { code: "!function f(){}; f", errors: [{ message: "\"f\" used outside of binding context." }] }, - { code: "var f = function foo() { }; foo(); var exports = { f: foo };", errors: [{ message: "\"foo\" used outside of binding context." }, { message: "\"foo\" used outside of binding context."}] }, - { code: "var f = () => { x; }", ecmaFeatures: { arrowFunctions: true }, errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f(){ x; }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f(){ x; { var x; } }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f(){ { var x; } x; }", errors: [{ message: "\"x\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f() { var a; { var b = 0; } a = b; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f() { try { var a = 0; } catch (e) { var b = a; } }", errors: [{ message: "\"a\" used outside of binding context.", type: "Identifier" }] }, - { code: "var eslint = require('eslint');", globals: {}, errors: [{ message: "\"require\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f(a) { return a[b]; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f() { return b.a; }", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { code: "var a = { foo: bar };", errors: [{ message: "\"bar\" used outside of binding context.", type: "Identifier" }] }, - { code: "var a = { foo: foo };", errors: [{ message: "\"foo\" used outside of binding context.", type: "Identifier" }] }, - { code: "var a = { bar: 7, foo: bar };", errors: [{ message: "\"bar\" used outside of binding context.", type: "Identifier" }] }, - { code: "var a = arguments;", errors: [{ message: "\"arguments\" used outside of binding context.", type: "Identifier" }] }, - { code: "function x(){}; var a = arguments;", errors: [{ message: "\"arguments\" used outside of binding context.", type: "Identifier" }] }, - { code: "function z(b){}; var a = b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { code: "function z(){var b;}; var a = b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { code: "function f(){ try{}catch(e){} e }", errors: [{ message: "\"e\" used outside of binding context.", type: "Identifier" }] }, - { code: "a:b;", errors: [{ message: "\"b\" used outside of binding context.", type: "Identifier" }] }, - { - code: "function a() { for(var b in {}) { var c = b; } c; }", - errors: [{ message: "\"c\" used outside of binding context.", type: "Identifier" }] - }, - { - code: "function a() { for(var b of {}) { var c = b;} c; }", - ecmaFeatures: { forOf: true }, - errors: [{ message: "\"c\" used outside of binding context.", type: "Identifier" }] - } - ] -}); diff --git a/eslint/babel-eslint-plugin/tests/generator-star-spacing.js b/eslint/babel-eslint-plugin/tests/generator-star-spacing.js index 4de1141b1023..cf93add7c9e0 100644 --- a/eslint/babel-eslint-plugin/tests/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/tests/generator-star-spacing.js @@ -1,14 +1,13 @@ /* eslint-disable */ -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); +var rule = require('../rules/generator-star-spacing'), + RuleTester = require('eslint').RuleTester; var features = { generators: true }; function ok(code, args){ - return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } + return { code: code, options: args, parser: 'babel-eslint', ecmaFeatures: features } } function err(code, errors, args){ @@ -17,30 +16,10 @@ function err(code, errors, args){ return e } -var features = { - generators: true -}; - -function ok(code, args){ - return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } -} - -function err(code, errors, args){ - var e = ok(code, args) - e.errors = errors - return e -} - - -eslintTester.addRuleTest('rules/generator-star-spacing', { +var ruleTester = new RuleTester(); +ruleTester.run('babel/generator-star-spacing', rule, { valid: [ - ok('var test = async function(){}'), - ok('async function test(){}'), - ok('var test = async function *(){}'), - ok('async function *test(){}', [1, "before"]) , - ok('async function* test(){}', [1, "after"]), - ok('async function * test(){}', [1, "both"]), - ok('async function*test(){}', [1, "neither"]), + // Default ("before") { code: "function foo(){}" }, @@ -88,244 +67,462 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { // "before" { code: "function foo(){}", - args: [2, "before"] + options: ["before"] }, { code: "function *foo(){}", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true } }, { code: "function *foo(arg1, arg2){}", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true } }, { code: "var foo = function *foo(){};", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true } }, { code: "var foo = function *(){};", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true } }, { code: "var foo = function * (){};", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true } }, { code: "var foo = { *foo(){} };", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "var foo = {*foo(){} };", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "class Foo { *foo(){} }", - args: [2, "before"], + options: ["before"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo {*foo(){} }", - args: [2, "before"], + options: ["before"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { static *foo(){} }", - args: [2, "before"], + options: ["before"], ecmaFeatures: { classes: true, generators: true } }, // "after" { code: "function foo(){}", - args: [2, "after"] + options: ["after"] }, { code: "function* foo(){}", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true } }, { code: "function* foo(arg1, arg2){}", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true } }, { code: "var foo = function* foo(){};", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true } }, { code: "var foo = function* (){};", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true } }, { code: "var foo = function*(){};", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true } }, { code: "var foo = {* foo(){} };", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "var foo = { * foo(){} };", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "class Foo {* foo(){} }", - args: [2, "after"], + options: ["after"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { * foo(){} }", - args: [2, "after"], + options: ["after"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { static* foo(){} }", - args: [2, "after"], + options: ["after"], ecmaFeatures: { classes: true, generators: true } }, // "both" { code: "function foo(){}", - args: [2, "both"] + options: ["both"] }, { code: "function * foo(){}", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true } }, { code: "function * foo(arg1, arg2){}", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true } }, { code: "var foo = function * foo(){};", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true } }, { code: "var foo = function * (){};", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true } }, { code: "var foo = function *(){};", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true } }, { code: "var foo = { * foo(){} };", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "var foo = {* foo(){} };", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "class Foo { * foo(){} }", - args: [2, "both"], + options: ["both"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo {* foo(){} }", - args: [2, "both"], + options: ["both"], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { static * foo(){} }", - args: [2, "both"], + options: ["both"], ecmaFeatures: { classes: true, generators: true } }, // "neither" { code: "function foo(){}", - args: [2, "neither"] + options: ["neither"] + }, + { + code: "function*foo(){}", + options: ["neither"], + ecmaFeatures: { generators: true } + }, + { + code: "function*foo(arg1, arg2){}", + options: ["neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*foo(){};", + options: ["neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*(){};", + options: ["neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* (){};", + options: ["neither"], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = {*foo(){} };", + options: ["neither"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = { *foo(){} };", + options: ["neither"], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo {*foo(){} }", + options: ["neither"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { *foo(){} }", + options: ["neither"], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static*foo(){} }", + options: ["neither"], + ecmaFeatures: { classes: true, generators: true } + }, + + // {"before": true, "after": false} + { + code: "function foo(){}", + options: [{"before": true, "after": false}] + }, + { + code: "function *foo(){}", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true } + }, + { + code: "function *foo(arg1, arg2){}", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *foo(){};", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *(){};", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * (){};", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = { *foo(){} };", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = {*foo(){} };", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo { *foo(){} }", + options: [{"before": true, "after": false}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo {*foo(){} }", + options: [{"before": true, "after": false}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static *foo(){} }", + options: [{"before": true, "after": false}], + ecmaFeatures: { classes: true, generators: true } + }, + + // {"before": false, "after": true} + { + code: "function foo(){}", + options: [{"before": false, "after": true}] + }, + { + code: "function* foo(){}", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "function* foo(arg1, arg2){}", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* foo(){};", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function* (){};", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function*(){};", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = {* foo(){} };", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = { * foo(){} };", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo {* foo(){} }", + options: [{"before": false, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { * foo(){} }", + options: [{"before": false, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static* foo(){} }", + options: [{"before": false, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + + // {"before": true, "after": true} + { + code: "function foo(){}", + options: [{"before": true, "after": true}] + }, + { + code: "function * foo(){}", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "function * foo(arg1, arg2){}", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * foo(){};", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function * (){};", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = function *(){};", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true } + }, + { + code: "var foo = { * foo(){} };", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "var foo = {* foo(){} };", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } + }, + { + code: "class Foo { * foo(){} }", + options: [{"before": true, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo {* foo(){} }", + options: [{"before": true, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + { + code: "class Foo { static * foo(){} }", + options: [{"before": true, "after": true}], + ecmaFeatures: { classes: true, generators: true } + }, + + // {"before": false, "after": false} + { + code: "function foo(){}", + options: [{"before": false, "after": false}] }, { code: "function*foo(){}", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true } }, { code: "function*foo(arg1, arg2){}", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true } }, { code: "var foo = function*foo(){};", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true } }, { code: "var foo = function*(){};", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true } }, { code: "var foo = function* (){};", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true } }, { code: "var foo = {*foo(){} };", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "var foo = { *foo(){} };", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } }, { code: "class Foo {*foo(){} }", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { *foo(){} }", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { classes: true, generators: true } }, { code: "class Foo { static*foo(){} }", - args: [2, "neither"], + options: [{"before": false, "after": false}], ecmaFeatures: { classes: true, generators: true } - } + }, + ok('var test = async function(){}'), + ok('async function test(){}'), + ok('var test = async function *(){}'), + ok('async function *test(){}', ["before"]) , + ok('async function* test(){}', ["after"]), + ok('async function * test(){}', ["both"]), + ok('async function*test(){}', ["neither"]), ], invalid: [ // Default ("before") - err('async function*test(){}', [ - { message: 'Missing space before *.' }, - ]), - err('async function* test(){}', [ - { - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - } - ]), - { code: "function*foo(){}", ecmaFeatures: { generators: true }, @@ -392,7 +589,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { // "before" { code: "function*foo(){}", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -401,7 +598,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "function* foo(arg1, arg2){}", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -413,7 +610,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function*foo(){};", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -422,7 +619,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function* (){};", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -431,7 +628,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = {* foo(){} };", - args: [2, "before"], + options: ["before"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, errors: [{ message: "Unexpected space after *.", @@ -440,7 +637,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo {* foo(){} }", - args: [2, "before"], + options: ["before"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Unexpected space after *.", @@ -451,7 +648,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { // "after" { code: "function*foo(){}", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space after *.", @@ -460,7 +657,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "function *foo(arg1, arg2){}", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -472,7 +669,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function *foo(){};", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -484,7 +681,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function *(){};", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -493,7 +690,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = { *foo(){} };", - args: [2, "after"], + options: ["after"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, errors: [{ message: "Missing space after *.", @@ -502,7 +699,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo { *foo(){} }", - args: [2, "after"], + options: ["after"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Missing space after *.", @@ -511,7 +708,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo { static *foo(){} }", - args: [2, "after"], + options: ["after"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Unexpected space before *.", @@ -525,7 +722,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { // "both" { code: "function*foo(){}", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -537,7 +734,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "function*foo(arg1, arg2){}", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -549,7 +746,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function*foo(){};", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -561,7 +758,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function*(){};", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true }, errors: [{ message: "Missing space before *.", @@ -570,7 +767,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = {*foo(){} };", - args: [2, "both"], + options: ["both"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, errors: [{ message: "Missing space after *.", @@ -579,7 +776,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo {*foo(){} }", - args: [2, "both"], + options: ["both"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Missing space after *.", @@ -588,7 +785,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo { static*foo(){} }", - args: [2, "both"], + options: ["both"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Missing space before *.", @@ -602,7 +799,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { // "neither" { code: "function * foo(){}", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -614,7 +811,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "function * foo(arg1, arg2){}", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -626,7 +823,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function * foo(){};", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -638,7 +835,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = function * (){};", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { generators: true }, errors: [{ message: "Unexpected space before *.", @@ -647,7 +844,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "var foo = { * foo(){} };", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, errors: [{ message: "Unexpected space after *.", @@ -656,7 +853,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo { * foo(){} }", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Unexpected space after *.", @@ -665,7 +862,7 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { }, { code: "class Foo { static * foo(){} }", - args: [2, "neither"], + options: ["neither"], ecmaFeatures: { classes: true, generators: true }, errors: [{ message: "Unexpected space before *.", @@ -674,7 +871,306 @@ eslintTester.addRuleTest('rules/generator-star-spacing', { message: "Unexpected space after *.", type: "Punctuator" }] - } + }, + + // {"before": true, "after": false} + { + code: "function*foo(){}", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "function* foo(arg1, arg2){}", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*foo(){};", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function* (){};", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = {* foo(){} };", + options: [{"before": true, "after": false}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo {* foo(){} }", + options: [{"before": true, "after": false}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + + // {"before": false, "after": true} + { + code: "function*foo(){}", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "function *foo(arg1, arg2){}", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function *foo(){};", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function *(){};", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = { *foo(){} };", + options: [{"before": false, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { *foo(){} }", + options: [{"before": false, "after": true}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static *foo(){} }", + options: [{"before": false, "after": true}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + + // {"before": true, "after": true} + { + code: "function*foo(){}", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "function*foo(arg1, arg2){}", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*foo(){};", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function*(){};", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = {*foo(){} };", + options: [{"before": true, "after": true}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo {*foo(){} }", + options: [{"before": true, "after": true}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static*foo(){} }", + options: [{"before": true, "after": true}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Missing space after *.", + type: "Punctuator" + }] + }, + + // {"before": false, "after": false} + { + code: "function * foo(){}", + options: [{"before": false, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "function * foo(arg1, arg2){}", + options: [{"before": false, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function * foo(){};", + options: [{"before": false, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "var foo = function * (){};", + options: [{"before": false, "after": false}], + ecmaFeatures: { generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }] + }, + { + code: "var foo = { * foo(){} };", + options: [{"before": false, "after": false}], + ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { * foo(){} }", + options: [{"before": false, "after": false}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + { + code: "class Foo { static * foo(){} }", + options: [{"before": false, "after": false}], + ecmaFeatures: { classes: true, generators: true }, + errors: [{ + message: "Unexpected space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + }] + }, + err('async function*test(){}', [ + { message: 'Missing space before *.' }, + ]), + err('async function* test(){}', [ + { + message: "Missing space before *.", + type: "Punctuator" + }, { + message: "Unexpected space after *.", + type: "Punctuator" + } + ]), ] -}); \ No newline at end of file +}); diff --git a/eslint/babel-eslint-plugin/tests/generator-star.js b/eslint/babel-eslint-plugin/tests/generator-star.js deleted file mode 100644 index 131d41f9c667..000000000000 --- a/eslint/babel-eslint-plugin/tests/generator-star.js +++ /dev/null @@ -1,32 +0,0 @@ -/* eslint-disable */ -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); - -var features = { - generators: true -}; - -function ok(code, args){ - return { code: code, args: args, parser: 'babel-eslint', ecmaFeatures: features } -} - -function err(code, errors, args){ - var e = ok(code, args) - e.errors = errors - return e -} - - -eslintTester.addRuleTest('rules/generator-star', { - valid: [ - ok('async function test(){}'), - ok('async function *test(){}', [1, "end"]) , - ok('async function* test(){}', [1, "start"]), - ok('async function * test(){}', [1, "middle"]) - ], - invalid: [ - err('async function* test(){}', [ { message: 'Expected a space before *.' }]), - err('async function *test(){}', [ { message: 'Expected no space before *.' }], [1, 'start']) - ] -}); \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/tests/new-cap.js b/eslint/babel-eslint-plugin/tests/new-cap.js index d25f5d2ad362..b7a9da45a0e1 100644 --- a/eslint/babel-eslint-plugin/tests/new-cap.js +++ b/eslint/babel-eslint-plugin/tests/new-cap.js @@ -5,12 +5,11 @@ * @author Nicholas C. Zakas */ -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); +var rule = require('../rules/new-cap'), + RuleTester = require('eslint').RuleTester; - -eslintTester.addRuleTest("rules/new-cap", { +var ruleTester = new RuleTester(); +ruleTester.run('babel/new-cap', rule, { valid: [ // Original test cases. "var x = new Constructor();", @@ -38,17 +37,22 @@ eslintTester.addRuleTest("rules/new-cap", { "var x = Symbol('symbol')", "var x = _();", "var x = $();", - { code: "var x = Foo(42)", args: [1, {"capIsNew": false}] }, - { code: "var x = bar.Foo(42)", args: [1, {"capIsNew": false}] }, + { code: "var x = Foo(42)", options: [{"capIsNew": false}] }, + { code: "var x = bar.Foo(42)", options: [{"capIsNew": false}] }, "var x = bar[Foo](42)", - {code: "var x = bar['Foo'](42)", args: [1, {"capIsNew": false}] }, + {code: "var x = bar['Foo'](42)", options: [{"capIsNew": false}] }, "var x = Foo.bar(42)", - { code: "var x = new foo(42)", args: [1, {"newIsCap": false}] }, - "var o = { 1: function () {} }; o[1]();", - "var o = { 1: function () {} }; new o[1]();", - { code: "var x = Foo(42);", args: [1, { capIsNew: true, capIsNewExceptions: ["Foo"] }] }, - { code: "var x = new foo(42);", args: [1, { newIsCap: true, newIsCapExceptions: ["foo"] }] }, - { code: "var x = Object(42);", args: [1, { capIsNewExceptions: ["Foo"] }] }, + { code: "var x = new foo(42)", options: [{"newIsCap": false}] }, + "var o = { 1: function() {} }; o[1]();", + "var o = { 1: function() {} }; new o[1]();", + { code: "var x = Foo(42);", options: [{ capIsNew: true, capIsNewExceptions: ["Foo"] }] }, + { code: "var x = new foo(42);", options: [{ newIsCap: true, newIsCapExceptions: ["foo"] }] }, + { code: "var x = Object(42);", options: [{ capIsNewExceptions: ["Foo"] }] }, + + { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Bar"] }] }, + { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Foo.Bar"] }] }, + { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["bar"] }] }, + { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["foo.bar"] }] }, // Babel-specific test cases. { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, @@ -70,7 +74,7 @@ eslintTester.addRuleTest("rules/new-cap", { message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression", line: 1, - column: 10 + column: 11 } ] }, @@ -81,7 +85,7 @@ eslintTester.addRuleTest("rules/new-cap", { message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression", line: 2, - column: 1 + column: 2 } ] }, @@ -92,7 +96,7 @@ eslintTester.addRuleTest("rules/new-cap", { message: "A constructor name should not start with a lowercase letter.", type: "NewExpression", line: 1, - column: 14 + column: 15 } ] }, @@ -103,7 +107,7 @@ eslintTester.addRuleTest("rules/new-cap", { message: "A constructor name should not start with a lowercase letter.", type: "NewExpression", line: 2, - column: 0 + column: 1 } ] }, @@ -114,9 +118,20 @@ eslintTester.addRuleTest("rules/new-cap", { message: "A constructor name should not start with a lowercase letter.", type: "NewExpression", line: 1, - column: 12 + column: 13 } ] + }, + + { + code: "var x = Foo.Bar(42);", + options: [{capIsNewExceptions: ["Foo"]}], + errors: [{type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor."}] + }, + { + code: "var x = new foo.bar(42);", + options: [{newIsCapExceptions: ["foo"]}], + errors: [{type: "NewExpression", message: "A constructor name should not start with a lowercase letter."}] } ] }); diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js index fb97a70130bb..4b13e9d43d91 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -8,11 +8,11 @@ * @copyright 2015 Mathieu M-Gosselin. All rights reserved. */ -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); +var rule = require('../rules/object-curly-spacing'), + RuleTester = require('eslint').RuleTester; -eslintTester.addRuleTest("rules/object-curly-spacing", { +var ruleTester = new RuleTester(); +ruleTester.run('babel/object-curly-spacing', rule, { valid: [ @@ -111,13 +111,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ImportDeclaration", line: 1, - column: 7 + column: 8 }, { message: "A space is required before '}'", type: "ImportDeclaration", line: 1, - column: 11 + column: 12 } ] }, @@ -132,13 +132,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ExportNamedDeclaration", line: 1, - column: 7 + column: 8 }, { message: "A space is required before '}'", type: "ExportNamedDeclaration", line: 1, - column: 11 + column: 12 } ] }, @@ -174,7 +174,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 42 + column: 43 } ] }, @@ -186,7 +186,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 60 + column: 61 } ] }, @@ -201,7 +201,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectPattern", line: 1, - column: 8 + column: 9 } ] }, @@ -214,7 +214,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectPattern", line: 1, - column: 8 + column: 9 } ] }, @@ -228,7 +228,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectExpression", line: 1, - column: 38 + column: 39 } ] }, @@ -240,7 +240,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectExpression", line: 1, - column: 54 + column: 55 } ] }, @@ -254,13 +254,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 10 + column: 11 }, { message: "A space is required before '}'", type: "ObjectExpression", line: 1, - column: 29 + column: 30 } ] }, @@ -272,7 +272,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 10 + column: 11 } ] }, @@ -284,7 +284,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectExpression", line: 1, - column: 30 + column: 31 } ] }, @@ -296,13 +296,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 10 + column: 11 }, { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 31 + column: 32 } ] }, @@ -314,7 +314,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 30 + column: 31 } ] }, @@ -326,7 +326,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 10 + column: 11 } ] }, @@ -338,13 +338,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 10 + column: 11 }, { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 17 + column: 18 } ] }, @@ -356,13 +356,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 27 + column: 28 }, { message: "There should be no space before '}'", type: "ObjectExpression", line: 1, - column: 39 + column: 40 } ] }, @@ -378,7 +378,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 21 + column: 22 } ] }, @@ -393,13 +393,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ObjectPattern", line: 1, - column: 4 + column: 5 }, { message: "A space is required before '}'", type: "ObjectPattern", line: 1, - column: 9 + column: 10 } ] }, @@ -412,7 +412,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectPattern", line: 1, - column: 10 + column: 11 } ] }, @@ -425,13 +425,13 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space after '{'", type: "ObjectPattern", line: 1, - column: 4 + column: 5 }, { message: "There should be no space before '}'", type: "ObjectPattern", line: 1, - column: 11 + column: 12 } ] }, @@ -444,7 +444,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "There should be no space before '}'", type: "ObjectPattern", line: 1, - column: 10 + column: 11 } ] }, @@ -457,7 +457,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required before '}'", type: "ObjectPattern", line: 1, - column: 10 + column: 11 } ] }, @@ -470,7 +470,7 @@ eslintTester.addRuleTest("rules/object-curly-spacing", { message: "A space is required after '{'", type: "ObjectPattern", line: 1, - column: 4 + column: 5 } ] }, diff --git a/eslint/babel-eslint-plugin/tests/object-shorthand.js b/eslint/babel-eslint-plugin/tests/object-shorthand.js index 9a89b10cc65b..0dfe5fb51c39 100644 --- a/eslint/babel-eslint-plugin/tests/object-shorthand.js +++ b/eslint/babel-eslint-plugin/tests/object-shorthand.js @@ -1,10 +1,10 @@ /* eslint-disable */ -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); +var rule = require('../rules/object-shorthand'), + RuleTester = require('eslint').RuleTester; var features = { objectLiteralShorthandMethods: true, + objectLiteralComputedProperties: true, objectLiteralShorthandProperties: true, arrowFunctions: true, destructuring: true, @@ -16,11 +16,9 @@ function ok(code, args){ } -eslintTester.addRuleTest('rules/object-shorthand', { +var ruleTester = new RuleTester(); +ruleTester.run('babel/object-shorthand', rule, { valid: [ - ok('let { ...spread } = obj'), - ok('let { ...spread } = obj', [2, 'never']), - //original test cases { code: "var x = {y() {}}", ecmaFeatures: features }, { code: "var x = {y}", ecmaFeatures: features }, @@ -62,13 +60,22 @@ eslintTester.addRuleTest('rules/object-shorthand', { { code: "doSomething({set y(z) {}})", ecmaFeatures: features }, { code: "doSomething({get y() {}, set y(z) {}})", ecmaFeatures: features }, + // object literal computed properties + { code: "var x = {[y]: y}", ecmaFeatures: features, options: ["properties"] }, + { code: "var x = {['y']: 'y'}", ecmaFeatures: features, options: ["properties"] }, + { code: "var x = {['y']: y}", ecmaFeatures: features, options: ["properties"] }, + // options - { code: "var x = {y() {}}", ecmaFeatures: features, args: [2, "methods"] }, - { code: "var x = {x, y() {}, a:b}", ecmaFeatures: features, args: [2, "methods"] }, - { code: "var x = {y}", ecmaFeatures: features, args: [2, "properties"] }, - { code: "var x = {y: {b}}", ecmaFeatures: features, args: [2, "properties"] }, - { code: "var x = {a: n, c: d, f: g}", ecmaFeatures: features, args: [2, "never"] }, - { code: "var x = {a: function(){}, b: {c: d}}", ecmaFeatures: features, args: [2, "never"] } + { code: "var x = {y() {}}", ecmaFeatures: features, options: ["methods"] }, + { code: "var x = {x, y() {}, a:b}", ecmaFeatures: features, options: ["methods"] }, + { code: "var x = {y}", ecmaFeatures: features, options: ["properties"] }, + { code: "var x = {y: {b}}", ecmaFeatures: features, options: ["properties"] }, + { code: "var x = {a: n, c: d, f: g}", ecmaFeatures: features, options: ["never"] }, + { code: "var x = {a: function(){}, b: {c: d}}", ecmaFeatures: features, options: ["never"] }, + + // Babel test cases. + ok('let { ...spread } = obj'), + ok('let { ...spread } = obj', [2, 'never']), ], invalid: [ @@ -87,14 +94,15 @@ eslintTester.addRuleTest('rules/object-shorthand', { { code: "doSomething({y: function() {}})", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, // options - { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], args: [2, "methods"] }, - { code: "var x = {x, y() {}, z: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], args: [2, "methods"] }, - { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], args: [2, "properties"] }, - { code: "var x = {a, b, c(){}, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], args: [2, "properties"] }, - { code: "var x = {y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"] }, - { code: "var x = {*y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"] }, - { code: "var x = {y}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], args: [2, "never"]}, - { code: "var x = {y, a: b, *x(){}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }, { message: "Expected longform method syntax.", type: "Property" }], args: [2, "never"]}, - { code: "var x = {y: {x}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], args: [2, "never"]} + { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], options: ["methods"] }, + { code: "var x = {x, y() {}, z: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], options: ["methods"] }, + { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], options: ["properties"] }, + { code: "var x = {a, b, c(){}, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], options: ["properties"] }, + { code: "var x = {y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], options: ["never"] }, + { code: "var x = {*y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], options: ["never"] }, + { code: "var x = {y}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], options: ["never"]}, + { code: "var x = {y, a: b, *x(){}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }, { message: "Expected longform method syntax.", type: "Property" }], options: ["never"]}, + { code: "var x = {y: {x}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], options: ["never"]} + ] -}); \ No newline at end of file +}); diff --git a/eslint/babel-eslint-plugin/tests/space-in-brackets.js b/eslint/babel-eslint-plugin/tests/space-in-brackets.js deleted file mode 100644 index 106120dd80b0..000000000000 --- a/eslint/babel-eslint-plugin/tests/space-in-brackets.js +++ /dev/null @@ -1,761 +0,0 @@ -/* eslint-disable */ - -/** - * @fileoverview Disallows or enforces spaces inside of brackets. - * @author Ian Christian Myers - * @copyright 2014 Vignesh Anand. All rights reserved. - */ - -var linter = require('eslint').linter - , ESLintTester = require('eslint-tester') - , eslintTester = new ESLintTester(linter); - -eslintTester.addRuleTest("rules/space-in-brackets", { - - valid: [ - { code: "var foo = obj[ 1 ]", options: ["always"] }, - { code: "var foo = obj[ 'foo' ];", options: ["always"] }, - { code: "var foo = obj[ [ 1, 1 ] ];", options: ["always"] }, - - // always - singleValue - { code: "var foo = ['foo']", options: ["always", {singleValue: false}] }, - { code: "var foo = [2]", options: ["always", {singleValue: false}] }, - { code: "var foo = [[ 1, 1 ]]", options: ["always", {singleValue: false}] }, - { code: "var foo = [{ 'foo': 'bar' }]", options: ["always", {singleValue: false}] }, - { code: "var foo = [bar]", options: ["always", {singleValue: false}] }, - - // always - objectsInArrays - { code: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, 5, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{\n'bar': 'baz', \n'qux': [{ 'bar': 'baz' }], \n'quxx': 1 \n}]", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{ 'bar': 'baz' }]", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{ 'bar': 'baz' }, 1, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, { 'bar': 'baz' }, 5 ];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, { 'bar': 'baz' }, [{ 'bar': 'baz' }] ];", options: ["always", {objectsInArrays: false}] }, - - // always - arraysInArrays - { code: "var arr = [[ 1, 2 ], 2, 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, - { code: "var arr = [[ 1, 2 ], [[[ 1 ]]], 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, - - // always - arraysInArrays, objectsInArrays - { code: "var arr = [[ 1, 2 ], 2, 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false}] }, - - // always - arraysInArrays, objectsInArrays, singleValue - { code: "var arr = [[ 1, 2 ], [2], 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false, singleValue: false}] }, - - // always - arraysInObjects - { code: "var obj = { 'foo': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false}] }, - - // always - objectsInObjects - { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"objectsInObjects": false}] }, - - // always - arraysInObjects, objectsInObjects - { code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, - - // always - arraysInObjects, objectsInObjects (reverse) - { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, - - // always - { code: "obj[ foo ]", options: ["always"] }, - { code: "obj[\nfoo\n]", options: ["always"] }, - { code: "obj[ 'foo' ]", options: ["always"] }, - { code: "obj[ 'foo' + 'bar' ]", options: ["always"] }, - { code: "obj[ obj2[ foo ] ]", options: ["always"] }, - { code: "obj.map(function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - { code: "obj[ 'map' ](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - { code: "obj[ 'for' + 'Each' ](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - - { code: "var arr = [ 1, 2, 3, 4 ];", options: ["always"] }, - { code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", options: ["always"] }, - { code: "var arr = [\n1, 2, 3, 4\n];", options: ["always"] }, - - { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, - { code: "var obj = { foo: { bar: quxx }, baz: qux };", options: ["always"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, - - { code: "var foo = {};", options: ["always"] }, - { code: "var foo = [];", options: ["always"] }, - - { code: "this.db.mappings.insert([\n { alias: 'a', url: 'http://www.amazon.de' },\n { alias: 'g', url: 'http://www.google.de' }\n], function () {});", options: ["always", {singleValue: false, objectsInArrays: true, arraysInArrays: true}] }, - - // never - { code: "obj[foo]", options: ["never"] }, - { code: "obj['foo']", options: ["never"] }, - { code: "obj['foo' + 'bar']", options: ["never"] }, - { code: "obj['foo'+'bar']", options: ["never"] }, - { code: "obj[obj2[foo]]", options: ["never"] }, - { code: "obj.map(function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj['map'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj['for' + 'Each'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj[ obj2[ foo ] ]", options: ["never", {"propertyName": true}] }, - { code: "obj['for' + 'Each'](function (item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - - - { code: "obj[\nfoo]", options: ["never"] }, - { code: "obj[foo\n]", options: ["never"] }, - { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, - { code: "var arr = [1,\n2,\n3,\n4\n];", options: ["never"] }, - { code: "var arr = [\n1,\n2,\n3,\n4];", options: ["never"] }, - - // never - singleValue - { code: "var foo = [ 'foo' ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ 2 ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ [1, 1] ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ {'foo': 'bar'} ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ bar ]", options: ["never", {singleValue: true}] }, - - // never - objectsInArrays - { code: "var foo = [ {'bar': 'baz'}, 1, 5];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, 5, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {\n'bar': 'baz', \n'qux': [ {'bar': 'baz'} ], \n'quxx': 1 \n} ]", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {'bar': 'baz'} ]", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {'bar': 'baz'}, 1, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, {'bar': 'baz'} , 5];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, {'bar': 'baz'}, [ {'bar': 'baz'} ]];", options: ["never", {objectsInArrays: true}] }, - - // never - arraysInArrays - { code: "var arr = [ [1, 2], 2, 3, 4];", options: ["never", {"arraysInArrays": true}] }, - - // never - arraysInArrays, singleValue - { code: "var arr = [ [1, 2], [ [ [ 1 ] ] ], 3, 4];", options: ["never", {"arraysInArrays": true, singleValue: true}] }, - - // never - arraysInArrays, objectsInArrays - { code: "var arr = [ [1, 2], 2, 3, {'foo': 'bar'} ];", options: ["never", {"arraysInArrays": true, objectsInArrays: true}] }, - - { code: "var arr = [1, 2, 3, 4];", options: ["never"] }, - { code: "var arr = [[1, 2], 2, 3, 4];", options: ["never"] }, - { code: "var arr = [\n1, 2, 3, 4\n];", options: ["never"] }, - - { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, - { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, - - { code: "var foo = {};", options: ["never"] }, - { code: "var foo = [];", options: ["never"] }, - - { code: "var foo = [{'bar':'baz'}, 1, {'bar': 'baz'}];", options: ["never"] }, - { code: "var foo = [{'bar': 'baz'}];", options: ["never"] }, - { code: "var foo = [{\n'bar': 'baz', \n'qux': [{'bar': 'baz'}], \n'quxx': 1 \n}]", options: ["never"] }, - { code: "var foo = [1, {'bar': 'baz'}, 5];", options: ["never"] }, - { code: "var foo = [{'bar': 'baz'}, 1, 5];", options: ["never"] }, - { code: "var foo = [1, 5, {'bar': 'baz'}];", options: ["never"] }, - { code: "var obj = {'foo': [1, 2]}", options: ["never"] }, - - // propertyName: false - { code: "var foo = obj[1]", options: ["always", {propertyName: false}] }, - { code: "var foo = obj['foo'];", options: ["always", {propertyName: false}] }, - { code: "var foo = obj[[ 1, 1 ]];", options: ["always", {propertyName: false}] }, - - { code: "var foo = obj[ 1 ]", options: ["never", {propertyName: true}] }, - { code: "var foo = obj[ 'foo' ];", options: ["never", {propertyName: true}] }, - { code: "var foo = obj[ [1, 1] ];", options: ["never", {propertyName: true}] }, - { code: "import 'test.js';", ecmaFeatures: { modules: true } }, - { code: "export const thing = {\n value: 1 \n};", ecmaFeatures: { modules: true, blockBindings: true } }, - { code: "export const thing = {};", ecmaFeatures: { modules: true, blockBindings: true } }, - { code: "export let thing = {};", ecmaFeatures: { modules: true, blockBindings: true } }, - { code: "export var thing = {};", ecmaFeatures: { modules: true } }, - - // Babel test cases. - { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, - { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, - ], - - invalid: [ - // objectsInArrays - { - code: "var foo = [ { 'bar': 'baz' }, 1, 5];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "A space is required before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "import {bar} from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'", - type: "ImportDeclaration" - }, - { - message: "A space is required before '}'", - type: "ImportDeclaration" - } - ] - }, - { - code: "export {bar};", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'", - type: "ExportNamedDeclaration" - }, - { - message: "A space is required before '}'", - type: "ExportNamedDeclaration" - } - ] - }, - { - code: "var foo = [1, 5, { 'bar': 'baz' } ];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var foo = [ { 'bar':'baz' }, 1, { 'bar': 'baz' } ];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - - // singleValue - { - code: "var obj = [ 'foo' ];", - options: ["always", {singleValue: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var obj = ['foo' ];", - options: ["always", {singleValue: false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - // singleValue - { - code: "var obj = ['foo'];", - options: ["never", {singleValue: true}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression" - }, - { - message: "A space is required before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var foo = obj[ 1];", - options: ["always"], - errors: [ - { - message: "A space is required before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "var foo = obj[1 ];", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "MemberExpression" - } - ] - }, - // propertyName - { - code: "var foo = obj[ 1];", - options: ["always", {propertyName: false}], - errors: [ - { - message: "There should be no space after '['", - type: "MemberExpression" - } - ] - }, - { - code: "var foo = obj[1 ];", - options: ["always", {propertyName: false}], - errors: [ - { - message: "There should be no space before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "var foo = obj[ 1];", - options: ["never", {propertyName: true}], - errors: [ - { - message: "A space is required before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "var foo = obj[1 ];", - options: ["never", {propertyName: true}], - errors: [ - { - message: "A space is required after '['", - type: "MemberExpression" - } - ] - }, - - // always - arraysInArrays - { - code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ 1, 2, 2, [ 3, 4 ] ];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [[ 1, 2 ], 2, [ 3, 4 ] ];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ]];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - - // never - arraysInArrays - { - code: "var arr = [[1, 2], 2, [3, 4]];", - options: ["never", {"arraysInArrays": true}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression" - }, - { - message: "A space is required before ']'", - type: "ArrayExpression" - } - ] - }, - - // always - arraysInObjects - { - code: "var obj = { 'foo': [ 1, 2 ] };", - options: ["always", {"arraysInObjects": false}], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", - options: ["always", {"arraysInObjects": false}], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - - // never - arraysInObjects - { - code: "var obj = {'foo': [1, 2]};", - options: ["never", {"arraysInObjects": true}], - errors: [ - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", - options: ["never", {"arraysInObjects": true}], - errors: [ - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - - // always-objectsInObjects - { - code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", - options: ["always", {"objectsInObjects": false}], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", - options: ["always", {"objectsInObjects": false}], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - - // never-objectsInObjects - { - code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", - options: ["never", {"objectsInObjects": true}], - errors: [ - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", - options: ["never", {"objectsInObjects": true}], - errors: [ - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - - // always & never - { - code: "var obj = {foo: bar, baz: qux};", - options: ["always"], - errors: [ - { - message: "A space is required after '{'", - type: "ObjectExpression" - }, - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required after '{'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux};", - options: ["always"], - errors: [ - { - message: "A space is required before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux };", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'", - type: "ObjectExpression" - }, - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {foo: bar, baz: qux };", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { foo: { bar: quxx}, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'", - type: "ObjectExpression" - }, - { - message: "There should be no space after '{'", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {foo: {bar: quxx }, baz: qux };", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'", - type: "ObjectExpression" - }, - { - message: "There should be no space before '}'", - type: "ObjectExpression" - } - ] - }, - { - code: "var arr = [1, 2, 3, 4];", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression" - }, - { - message: "A space is required before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [1, 2, 3, 4 ];", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ 1, 2, 3, 4];", - options: ["always"], - errors: [ - { - message: "A space is required before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ 1, 2, 3, 4 ];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [1, 2, 3, 4 ];", - options: ["never"], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ 1, 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [ [ 1], 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression" - }, - { - message: "There should be no space after '['", - type: "ArrayExpression" - } - ] - }, - { - code: "var arr = [[1 ], 2, 3, 4 ];", - options: ["never"], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression" - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression" - } - ] - }, - { - code: "obj[ foo ]", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "MemberExpression" - }, - { - message: "There should be no space before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "obj[foo ]", - options: ["never"], - errors: [ - { - message: "There should be no space before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "obj[ foo]", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "MemberExpression" - } - ] - }, - { - code: "var foo = obj[1]", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "MemberExpression" - }, - { - message: "A space is required before ']'", - type: "MemberExpression" - } - ] - }, - { - code: "export const thing = {value: 1 };", - ecmaFeatures: { - modules: true, - blockBindings: true - }, - options: ["always"], - errors: [ - { - message: "A space is required after '{'", - type: "ObjectExpression" - } - ] - } - ] -}); From fc31183a20cf317acf46638e15ae449d45051381 Mon Sep 17 00:00:00 2001 From: jquense Date: Tue, 4 Aug 2015 23:33:06 -0400 Subject: [PATCH 700/965] v2.0.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index cfce981c1fc8..5acdaaa6a275 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "1.2.0", + "version": "2.0.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From f5f7b50e179b79aa4ae29ceabbfb9455c54da52c Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 21:05:46 -0400 Subject: [PATCH 701/965] Merge pull request babel/eslint-plugin-babel#9 from babel/arrow-parens Add support for async functions in arrow-parens --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/package.json | 4 +- .../babel-eslint-plugin/rules/arrow-parens.js | 53 ++++++ .../babel-eslint-plugin/tests/arrow-parens.js | 177 ++++++++++++++++++ 4 files changed, 234 insertions(+), 2 deletions(-) create mode 100644 eslint/babel-eslint-plugin/rules/arrow-parens.js create mode 100644 eslint/babel-eslint-plugin/tests/arrow-parens.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index c76c666ca32d..3d28839d67fb 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -27,6 +27,7 @@ Finally enable all the rules you like to use (remember to disable the originals "babel/new-cap": 1, "babel/object-curly-spacing": 1, "babel/object-shorthand": 1, + "babel/arrow-parens": 1 } } ``` @@ -38,3 +39,4 @@ Each rule cooresponds to a core eslint rule, and has the same options. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) +- `babel/arrow-parens`: Handles async functions correctly \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 5acdaaa6a275..dacdf7518afa 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -27,8 +27,8 @@ "eslint": ">=1.0.0" }, "devDependencies": { - "babel-eslint": "^4.0.5", - "eslint": "^1.0.0", + "babel-eslint": "^4.0.7", + "eslint": "^1.1.0", "is-my-json-valid": "^2.12.0", "mocha": "^2.2.5", "phantomjs": "^1.9.17" diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js new file mode 100644 index 000000000000..b3ee3a765262 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -0,0 +1,53 @@ +/** + * @fileoverview Rule to require parens in arrow function arguments. + * @author Jxck + * @copyright 2015 Jxck. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var message = "Expected parentheses around arrow function argument."; + var asNeededMessage = "Unexpected parentheses around single function argument"; + var asNeeded = context.options[0] === "as-needed"; + + /** + * Determines whether a arrow function argument end with `)` + * @param {ASTNode} node The arrow function node. + * @returns {void} + */ + function parens(node) { + var token = context.getFirstToken(node); + if (node.async) token = context.getTokenAfter(token); + + // as-needed: x => x + if (asNeeded && node.params.length === 1 && node.params[0].type === "Identifier") { + if (token.type === "Punctuator" && token.value === "(") { + context.report(node, asNeededMessage); + } + return; + } + + if (token.type === "Identifier") { + var after = context.getTokenAfter(token); + + // (x) => x + if (after.value !== ")") { + context.report(node, message); + } + } + } + + return { + "ArrowFunctionExpression": parens + }; +}; + +module.exports.schema = [ + { + "enum": ["always", "as-needed"] + } +]; \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/tests/arrow-parens.js b/eslint/babel-eslint-plugin/tests/arrow-parens.js new file mode 100644 index 000000000000..74a03f62c564 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/arrow-parens.js @@ -0,0 +1,177 @@ +/* eslint-disable */ + +/** + * @fileoverview Tests for arrow-parens + * @author Jxck + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var rule = require("../rules/arrow-parens"), + RuleTester = require('eslint').RuleTester; + +function ok(code, args){ + return { code: code, options: args, parser: 'babel-eslint' } +} + +function err(code, errors, args){ + var e = ok(code, args) + e.errors = errors + return e +} + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ +var ruleTester = new RuleTester(); + +var valid = [ + { code: "() => {}", ecmaFeatures: { arrowFunctions: true } }, + { code: "(a) => {}", ecmaFeatures: { arrowFunctions: true } }, + { code: "(a) => a", ecmaFeatures: { arrowFunctions: true } }, + { code: "(a) => {\n}", ecmaFeatures: { arrowFunctions: true } }, + { code: "a.then((foo) => {});", ecmaFeatures: { arrowFunctions: true } }, + { code: "a.then((foo) => { if (true) {}; });", ecmaFeatures: { arrowFunctions: true } }, + + // // as-needed + { code: "() => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, + { code: "a => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, + { code: "a => a", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, + { code: "([a, b]) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true } }, + { code: "({ a, b }) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true } }, + { code: "(a = 10) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true, defaultParams: true } }, + { code: "(...a) => a[0]", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, restParams: true } }, + { code: "(a, b) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, + + // async + ok("async () => {}"), + ok("async (a) => {}"), + ok("async (a) => a"), + ok("async (a) => {\n}"), + ok("a.then(async (foo) => {});"), + ok("a.then((foo) => { if (true) {}; })"), + + ok("async () => {}", ["as-needed"]), + ok("async a => {}", ["as-needed"]), + ok("async a => a", ["as-needed"]), + ok("async ([a, b]) => {}", ["as-needed"]), + ok("async ({ a, b }) => {}", ["as-needed"]), + ok("async (a = 10) => {}", ["as-needed"]), + ok("async (...a) => a[0]", ["as-needed"]), + ok("async (a, b) => {}", ["as-needed"]), + +]; + +var message = message; +var asNeededMessage = asNeededMessage; +var type = type; + +var invalid = [ + { + code: "a => {}", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 1, + message: message, + type: type + }] + }, + { + code: "a => a", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 1, + message: message, + type: type + }] + }, + { + code: "a => {\n}", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 1, + message: message, + type: type + }] + }, + { + code: "a.then(foo => {});", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 8, + message: message, + type: type + }] + }, + { + code: "a.then(foo => a);", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 8, + message: message, + type: type + }] + }, + { + code: "a(foo => { if (true) {}; });", + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 3, + message: message, + type: type + }] + }, + + // as-needed + { + code: "(a) => a", + options: ["as-needed"], + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 1, + message: asNeededMessage, + type: type + }] + }, + { + code: "(b) => b", + options: ["as-needed"], + ecmaFeatures: { arrowFunctions: true }, + errors: [{ + line: 1, + column: 1, + message: asNeededMessage, + type: type + }] + }, + + // async + err('async a => {}', [ + { message: 'Expected parentheses around arrow function argument.' }, + ]), + + err('async a => a', [ + { message: 'Expected parentheses around arrow function argument.' }, + ]), + + err('async (a) => a', [ + { message: 'Unexpected parentheses around single function argument' }, + ], + ["as-needed"]) +]; + +ruleTester.run("arrow-parens", rule, { + valid: valid, + invalid: invalid +}); \ No newline at end of file From 902ae7e6e7e7a9b891cf623d37c85983cd0cab97 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 15 Aug 2015 21:08:57 -0400 Subject: [PATCH 702/965] 2.1.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index dacdf7518afa..cf091648556d 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "2.0.0", + "version": "2.1.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From cc73bb56b67757740b175fe296916b154dbe00f7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 18 Aug 2015 10:52:55 -0400 Subject: [PATCH 703/965] Merge pull request babel/eslint-plugin-babel#10 from aruberto/master add arrow-parens to index.js --- eslint/babel-eslint-plugin/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 369b9c11b6f8..5fde6a2cbc6b 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -6,11 +6,13 @@ module.exports = { 'new-cap': require('./rules/new-cap'), 'object-curly-spacing': require('./rules/object-curly-spacing'), 'object-shorthand': require('./rules/object-shorthand'), + 'arrow-parens': require('./rules/arrow-parens'), }, rulesConfig: { 'generator-star-spacing': 0, 'new-cap': 0, 'object-curly-spacing': 0, 'object-shorthand': 0, + 'arrow-parens': 0, } }; From eb438f0f9873b46c007cb1fab74ff14b9561381f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 18 Aug 2015 10:53:41 -0400 Subject: [PATCH 704/965] 2.1.1 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index cf091648556d..3d7d0c5e5807 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "2.1.0", + "version": "2.1.1", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 64291d8d52a7c0a61af1ed2fd60fbbd93be26ff0 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 18 Aug 2015 15:30:38 -0400 Subject: [PATCH 705/965] Merge pull request babel/eslint-plugin-babel#11 from pascalduez/pr__fix-readme Improve the Readme --- eslint/babel-eslint-plugin/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 3d28839d67fb..50200eb65eff 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,14 +1,14 @@ # eslint-plugin-babel -An eslint plugin companion to babel-eslint. babel-eslint does a great job of adapting eslint for use with Babel, but to it can't change the built in rules to support experimental features. eslint-plugin-babel reimplements problematic rules so they do not give false positives or negatives. +An `eslint` plugin companion to `babel-eslint`. `babel-eslint` does a great job at adapting `eslint` for use with Babel, but it can't change the built in rules to support experimental features. `eslint-plugin-babel` reimplements problematic rules so they do not give false positives or negatives. ### Install ```sh -npm install eslint-plugin-babel -S +npm install eslint-plugin-babel -D ``` -enable the plugin by adjusting your `.eslintrc` file to include the plugin: +Load the plugin in your `.eslintrc` file: ```json { @@ -18,7 +18,8 @@ enable the plugin by adjusting your `.eslintrc` file to include the plugin: } ``` -Finally enable all the rules you like to use (remember to disable the originals as well!). +Finally enable all the rules you would like to use (remember to disable the +original ones as well!). ```json { @@ -33,10 +34,10 @@ Finally enable all the rules you like to use (remember to disable the originals ``` ### Rules -Each rule cooresponds to a core eslint rule, and has the same options. +Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) -- `babel/arrow-parens`: Handles async functions correctly \ No newline at end of file +- `babel/arrow-parens`: Handles async functions correctly From 9d8a2f14dd03a766ec694b29e314743579b932f1 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Mon, 26 Oct 2015 10:36:36 +0700 Subject: [PATCH 706/965] Merge pull request babel/eslint-plugin-babel#23 from LegNeato/master Support trailing commas in import and export statements. Fixes babel/eslint-plugin-babel#21 --- .../rules/object-curly-spacing.js | 12 ++++++++++++ .../tests/object-curly-spacing.js | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js index d498211a998b..93e3ac17a4e9 100644 --- a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -173,6 +173,12 @@ module.exports = function(context) { penultimate = context.getLastToken(lastSpecifier), last = context.getTokenAfter(lastSpecifier); + // support trailing commas + if (last.value === ",") { + penultimate = last; + last = context.getTokenAfter(last); + } + validateBraceSpacing(node, first, second, penultimate, last); } @@ -195,6 +201,12 @@ module.exports = function(context) { return; } + // support trailing commas + if (last.value === ",") { + penultimate = last; + last = context.getTokenAfter(last); + } + validateBraceSpacing(node, first, second, penultimate, last); }, diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js index 4b13e9d43d91..83332d4539a9 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -37,7 +37,11 @@ ruleTester.run('babel/object-curly-spacing', rule, { { code: "import {\ndoor } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import {\nhouse,\nmouse\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import {\nhouse,\nmouse,\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export { door }", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export {\ndoor,\nhouse\n}", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export {\ndoor,\nhouse,\n}", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import 'room'", options: ["always"], ecmaFeatures: { modules: true } }, // always - empty object @@ -85,7 +89,11 @@ ruleTester.run('babel/object-curly-spacing', rule, { { code: "export {\ndoor\n} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import {house,mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import {house, mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {\nhouse,\nmouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {\nhouse,\nmouse,\n} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "export {door}", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {\ndoor,\nmouse\n}", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {\ndoor,\nmouse,\n}", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import 'room'", options: ["never"], ecmaFeatures: { modules: true } }, // never - empty object From dd8f357639f9c299dbd8558c77234a9260d309e9 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 1 Nov 2015 11:46:24 -0500 Subject: [PATCH 707/965] Merge pull request babel/eslint-plugin-babel#22 from nmote/await Add no-await-in-loop rule. --- eslint/babel-eslint-plugin/index.js | 2 + .../rules/no-await-in-loop.js | 72 ++++++++++++ .../tests/no-await-in-loop.js | 106 ++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 eslint/babel-eslint-plugin/rules/no-await-in-loop.js create mode 100644 eslint/babel-eslint-plugin/tests/no-await-in-loop.js diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 5fde6a2cbc6b..9bb58310c19d 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -7,6 +7,7 @@ module.exports = { 'object-curly-spacing': require('./rules/object-curly-spacing'), 'object-shorthand': require('./rules/object-shorthand'), 'arrow-parens': require('./rules/arrow-parens'), + 'no-await-in-loop': require('./rules/no-await-in-loop'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -14,5 +15,6 @@ module.exports = { 'object-curly-spacing': 0, 'object-shorthand': 0, 'arrow-parens': 0, + 'no-await-in-loop': 0, } }; diff --git a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js new file mode 100644 index 000000000000..cc3bb91af4f0 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js @@ -0,0 +1,72 @@ +/** + * @fileoverview Rule to disallow uses of await inside of loops. + * @author Nat Mote + */ +"use strict"; + +// Node types which are considered loops. +var loopTypes = { + 'ForStatement': true, + 'ForOfStatement': true, + 'ForInStatement': true, + 'WhileStatement': true, + 'DoWhileStatement': true, +}; + +// Node types at which we should stop looking for loops. For example, it is fine to declare an async +// function within a loop, and use await inside of that. +var boundaryTypes = { + 'FunctionDeclaration': true, + 'FunctionExpression': true, + 'ArrowFunctionExpression': true, +}; + +module.exports = function(context) { + return { + // babel-eslint transpiles AwaitExpressions to YieldExpressions, but the actual node kind is + // still available in _babelType. + YieldExpression: function(node) { + if (node._babelType === 'AwaitExpression') { + var ancestors = context.getAncestors(); + // Reverse so that we can traverse from the deepest node upwards. + ancestors.reverse(); + // Create a set of all the ancestors plus this node so that we can check + // if this use of await appears in the body of the loop as opposed to + // the right-hand side of a for...of, for example. + // + // Implement the set with an Array since there are likely to be very few + // elements. An Object would not be appropriate since the elements are + // not strings. + var ancestorSet = [].concat(ancestors, [node]); + var ancestorSetHas = function(element) { + return ancestorSet.indexOf(element) !== -1; + } + for (var i = 0; i < ancestors.length; i++) { + var ancestor = ancestors[i]; + if (boundaryTypes.hasOwnProperty(ancestor.type)) { + // Short-circuit out if we encounter a boundary type. Loops above + // this do not matter. + return; + } + if (loopTypes.hasOwnProperty(ancestor.type)) { + // Only report if we are actually in the body or another part that gets executed on + // every iteration. + if ( + ancestorSetHas(ancestor.body) || + ancestorSetHas(ancestor.test) || + ancestorSetHas(ancestor.update) + ) { + context.report( + node, + 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + + 'you are sure you want to do this, add `// eslint-disable-line ' + + context.id + '` at the end of this line.' + ); + return; + } + } + } + } + }, + }; +} diff --git a/eslint/babel-eslint-plugin/tests/no-await-in-loop.js b/eslint/babel-eslint-plugin/tests/no-await-in-loop.js new file mode 100644 index 000000000000..ba82e4e78cbb --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/no-await-in-loop.js @@ -0,0 +1,106 @@ +/** + * @fileoverview Tests for no-await-in-loop. + * @author Nat Mote + */ + +"use strict"; + +var rule = require("../rules/no-await-in-loop"), + RuleTester = require('eslint').RuleTester; + +var features = { +}; + +function test(code, errors){ + var result = { + code: code, + parser: 'babel-eslint', + ecmaFeatures: features, + }; + if (errors != null) { + result.errors = errors; + } + return result; +} + +var ruleName = 'babel/no-await-in-loop'; + +var message = 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + + 'you are sure you want to do this, add `// eslint-disable-line ' + + ruleName + '` at the end of this line.' + +function ok(code) { + return test(code); +} + +function err(code) { + return test(code, [message]); +} + +// Construct an async function with the given body +function fun(body) { + return "async function foo() { " + body + " }"; +} + +// Construct a loop +function loop(kind, condition, body) { + return kind + " (" + condition + ") { " + body + " }"; +} + +// Construct a class with the given body +function cls(body) { + return "class Foo { " + body + " }"; +} + +var cases = [ + ok(fun("await bar;")), + + // While loops + ok(fun(loop("while", "true", fun("await bar;")))), // Blocked by a function declaration + err(fun(loop("while", "baz", "await bar;"))), + err(fun(loop("while", "await foo()", ""))), + + // For of loops + err(fun(loop("for", "var bar of baz", "await bar;"))), + + // For in loops + err(fun(loop("for", "var bar in baz", "await bar;"))), + + // For loops + ok(fun(loop("for", "var i = await bar; i < n; i++", ""))), + err(fun(loop("for", "var i; i < n; i++", "await bar;"))), + err(fun(loop("for", "var i; await foo(i); i++", ""))), + err(fun(loop("for", "var i; i < n; i = await bar", ""))), + + // Do while loops + ok(fun("do { } while (bar);")), + err(fun("do { await bar; } while (baz);")), + err(fun("do { } while (await bar);")), + + // Blocked by a function expression + ok(fun(loop("while", "true", "var y = async function() { await bar; }"))), + // Blocked by an arrow function + ok(fun(loop("while", "true", "var y = async () => await foo;"))), + ok(fun(loop("while", "true", "var y = async () => { await foo; }"))), + // Blocked by a class method, + ok(fun(loop("while", "true", cls("async foo() { await bar; }")))), + + // Deep in a loop body + err(fun(loop("while", "true", "if (bar) { foo(await bar); }"))), + // Deep in a loop condition + err(fun(loop("while", "xyz || 5 > await x", ""))), +]; + +function hasError(testCase) { + return testCase.errors != null && testCase.errors.length > 0; +} + +function hasNoError(testCase) { + return !hasError(testCase); +} + +var ruleTester = new RuleTester(); +ruleTester.run(ruleName, rule, { + valid: cases.filter(hasNoError), + invalid: cases.filter(hasError), +}); From fcdf7ec95de763558bc0ab7bad51b81c0eb7ebaf Mon Sep 17 00:00:00 2001 From: jquense Date: Mon, 23 Nov 2015 19:16:41 -0500 Subject: [PATCH 708/965] v2.2.0 --- eslint/babel-eslint-plugin/README.md | 4 +++- eslint/babel-eslint-plugin/package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 50200eb65eff..2d613fbf3af2 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -28,7 +28,8 @@ original ones as well!). "babel/new-cap": 1, "babel/object-curly-spacing": 1, "babel/object-shorthand": 1, - "babel/arrow-parens": 1 + "babel/arrow-parens": 1, + "babel/no-await-in-loop": 1 } } ``` @@ -41,3 +42,4 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly +- `bael/no-await-in-loop`: guard against awaiting async functions inside of a loop diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 3d7d0c5e5807..29c67dcbd6cd 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "2.1.1", + "version": "2.2.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From a2c695275d7ae28cd837ed1673865060ad61fe10 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Wed, 25 Nov 2015 14:47:17 -0500 Subject: [PATCH 709/965] Merge pull request babel/eslint-plugin-babel#29 from evocateur/no-deps Future-proofing --- eslint/babel-eslint-plugin/helpers.js | 15 --------------- eslint/babel-eslint-plugin/package.json | 3 --- eslint/babel-eslint-plugin/rules/new-cap.js | 8 ++++---- 3 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/helpers.js diff --git a/eslint/babel-eslint-plugin/helpers.js b/eslint/babel-eslint-plugin/helpers.js deleted file mode 100644 index 77f42a3bf404..000000000000 --- a/eslint/babel-eslint-plugin/helpers.js +++ /dev/null @@ -1,15 +0,0 @@ -var _parse = require('babel-core').parse; - -module.exports = { - parse: function(code){ - var ast = null - try { - ast = _parse(code, { locations: true, ranges: true }).body[0] //unwrap body - } - catch (err){ - console.warn(err) - } - - return ast - } -} \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 29c67dcbd6cd..28a10bd21103 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -32,8 +32,5 @@ "is-my-json-valid": "^2.12.0", "mocha": "^2.2.5", "phantomjs": "^1.9.17" - }, - "dependencies": { - "babel-core": "^5.5.8" } } diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js index a1d4575c2a80..0e17a9baae58 100644 --- a/eslint/babel-eslint-plugin/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -69,8 +69,8 @@ function calculateCapIsNewExceptions(config) { module.exports = function(context) { var config = context.options[0] || {}; - config.newIsCap = config.newIsCap !== false; - config.capIsNew = config.capIsNew !== false; + var NEW_IS_CAP = config.newIsCap !== false; + var CAP_IS_NEW = config.capIsNew !== false; var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); @@ -176,7 +176,7 @@ module.exports = function(context) { // Public //-------------------------------------------------------------------------- - if (config.newIsCap) { + if (NEW_IS_CAP) { listeners.NewExpression = function(node) { var constructorName = extractNameFromExpression(node); @@ -190,7 +190,7 @@ module.exports = function(context) { }; } - if (config.capIsNew) { + if (CAP_IS_NEW) { listeners.CallExpression = function(node) { var calleeName = extractNameFromExpression(node); From 1168d6056475010e214039f582a198be06aafa22 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 25 Nov 2015 18:51:45 -0500 Subject: [PATCH 710/965] 3.0.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 28a10bd21103..fdcbb5058d6e 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "2.2.0", + "version": "3.0.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 885bfe95dc15bfe84f086aab1e194b3af5ff10db Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sun, 29 Nov 2015 19:28:01 -0500 Subject: [PATCH 711/965] Merge pull request babel/eslint-plugin-babel#32 from hawkrives/patch-1 Fix typo in README rules section --- eslint/babel-eslint-plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 2d613fbf3af2..d0b799a5852f 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -42,4 +42,4 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly -- `bael/no-await-in-loop`: guard against awaiting async functions inside of a loop +- `babel/no-await-in-loop`: guard against awaiting async functions inside of a loop From 9eebd7b05742d97c5ebf34cac724f1f08ceff926 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 20 Dec 2015 16:43:33 -0500 Subject: [PATCH 712/965] Merge pull request babel/eslint-plugin-babel#38 from zaygraveyard/issue36 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix: `object-curly-spacing` had been crashing on an empty object patt… --- .../rules/object-curly-spacing.js | 172 ++++++----- .../tests/object-curly-spacing.js | 272 +++++++++++++++++- 2 files changed, 357 insertions(+), 87 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js index 93e3ac17a4e9..781d41562b7e 100644 --- a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -6,6 +6,8 @@ * @copyright 2014 Vignesh Anand. All rights reserved. * @copyright 2015 Jamund Ferguson. All rights reserved. * @copyright 2015 Mathieu M-Gosselin. All rights reserved. + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. */ "use strict"; @@ -14,7 +16,8 @@ //------------------------------------------------------------------------------ module.exports = function(context) { - var spaced = context.options[0] === "always"; + var spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); /** * Determines whether an option is set, relative to the spacing option. @@ -44,7 +47,7 @@ module.exports = function(context) { * @returns {boolean} Whether or not there is space between the tokens. */ function isSpaced(left, right) { - return left.range[1] < right.range[0]; + return sourceCode.isSpaceBetweenTokens(left, right); } /** @@ -64,7 +67,7 @@ module.exports = function(context) { * @returns {void} */ function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.start, + context.report(node, token.loc.end, "There should be no space after '" + token.value + "'"); } @@ -86,7 +89,7 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.start, + context.report(node, token.loc.end, "A space is required after '" + token.value + "'"); } @@ -135,96 +138,115 @@ module.exports = function(context) { } } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + /** + * Reports a given object node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check. + * @returns {void} + */ + function checkForObject(node) { + if (node.properties.length === 0) { + return; + } - return { + var firstSpecifier = node.properties[0], + lastSpecifier = node.properties[node.properties.length - 1]; - // var {x} = y; - ObjectPattern: function(node) { - var firstSpecifier = node.properties[0], - lastSpecifier = node.properties[node.properties.length - 1]; - - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); - - // support trailing commas - if (last.value === ",") { - penultimate = last; - last = context.getTokenAfter(last); - } + var first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier); - validateBraceSpacing(node, first, second, penultimate, last); - }, + // support trailing commas + if (last.value === ",") { + last = sourceCode.getTokenAfter(last); + } - // import {y} from 'x'; - ImportDeclaration: function(node) { + var second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; + validateBraceSpacing(node, first, second, penultimate, last); + } - // don't do anything for namespace or default imports - if (firstSpecifier && lastSpecifier && firstSpecifier.type === "ImportSpecifier" && lastSpecifier.type === "ImportSpecifier") { - var first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); + /** + * Reports a given import node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ImportDeclaration node to check. + * @returns {void} + */ + function checkForImport(node) { + if (node.specifiers.length === 0) { + return; + } - // support trailing commas - if (last.value === ",") { - penultimate = last; - last = context.getTokenAfter(last); - } + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1]; - validateBraceSpacing(node, first, second, penultimate, last); - } + if (lastSpecifier.type !== "ImportSpecifier") { + return; + } + if (firstSpecifier.type !== "ImportSpecifier") { + firstSpecifier = node.specifiers[1]; + } - }, + var first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier); - // export {name} from 'yo'; - ExportNamedDeclaration: function(node) { - if (!node.specifiers.length) { - return; - } + // to support a trailing comma. + if (last.value === ",") { + last = sourceCode.getTokenAfter(last); + } - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = context.getTokenBefore(firstSpecifier), - second = context.getFirstToken(firstSpecifier), - penultimate = context.getLastToken(lastSpecifier), - last = context.getTokenAfter(lastSpecifier); + var second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - if (first.value === "export") { - return; - } + validateBraceSpacing(node, first, second, penultimate, last); + } - // support trailing commas - if (last.value === ",") { - penultimate = last; - last = context.getTokenAfter(last); - } + /** + * Reports a given export node if spacing in curly braces is invalid. + * @param {ASTNode} node - An ExportNamedDeclaration node to check. + * @returns {void} + */ + function checkForExport(node) { + if (node.specifiers.length === 0) { + return; + } - validateBraceSpacing(node, first, second, penultimate, last); + var firstSpecifier = node.specifiers[0], + lastSpecifier = node.specifiers[node.specifiers.length - 1], + first = sourceCode.getTokenBefore(firstSpecifier), + last = sourceCode.getTokenAfter(lastSpecifier); - }, + // export * as x from '...'; + // export x from '...'; + if (first.value === "export") { + return; + } - // var y = {x: 'y'} - ObjectExpression: function(node) { - if (node.properties.length === 0) { - return; - } + // to support a trailing comma. + if (last.value === ",") { + last = sourceCode.getTokenAfter(last); + } - var first = context.getFirstToken(node), - second = context.getFirstToken(node, 1), - penultimate = context.getLastToken(node, 1), - last = context.getLastToken(node); + var second = sourceCode.getTokenAfter(first), + penultimate = sourceCode.getTokenBefore(last); - validateBraceSpacing(node, first, second, penultimate, last); - } + validateBraceSpacing(node, first, second, penultimate, last); + } + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + // var {x} = y; + ObjectPattern: checkForObject, + + // var y = {x: 'y'} + ObjectExpression: checkForObject, + + // import {y} from 'x'; + ImportDeclaration: checkForImport, + + // export {name} from 'yo'; + ExportNamedDeclaration: checkForExport }; }; diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js index 83332d4539a9..a94312a4c3e9 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -31,18 +31,28 @@ ruleTester.run('babel/object-curly-spacing', rule, { { code: "var { x: { z }, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, { code: "var {\ny,\n} = x", options: ["always"], ecmaFeatures: { destructuring: true } }, { code: "var { y, } = x", options: ["always"], ecmaFeatures: { destructuring: true } }, + { code: "var { y: x } = x", options: ["always"], ecmaFeatures: { destructuring: true } }, // always - import / export + { code: "import door from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import * as door from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import {\ndoor } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import {\nhouse,\nmouse\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import {\nhouse,\nmouse,\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import house, { mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import door, { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export { door }", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export {\ndoor,\nhouse\n}", options: ["always"], ecmaFeatures: { modules: true } }, { code: "export {\ndoor,\nhouse,\n}", options: ["always"], ecmaFeatures: { modules: true } }, { code: "import 'room'", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import { bar as x } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import { x, } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "import {\nx,\n} from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export { x, } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, + { code: "export {\nx,\n} from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, // always - empty object { code: "var foo = {};", options: ["always"] }, @@ -81,8 +91,11 @@ ruleTester.run('babel/object-curly-spacing', rule, { { code: "var {\nx: {z\n}, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, { code: "var {\ny,\n} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, { code: "var {y,} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, + { code: "var {y:x} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, // never - import / export + { code: "import door from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import * as door from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "export {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import {\ndoor} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, @@ -95,6 +108,14 @@ ruleTester.run('babel/object-curly-spacing', rule, { { code: "export {\ndoor,\nmouse\n}", options: ["never"], ecmaFeatures: { modules: true } }, { code: "export {\ndoor,\nmouse,\n}", options: ["never"], ecmaFeatures: { modules: true } }, { code: "import 'room'", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import x, {bar} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import x, {bar, baz} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {bar as y} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {x,} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "import {\nx,\n} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {x,} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + { code: "export {\nx,\n} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + // never - empty object { code: "var foo = {};", options: ["never"] }, @@ -102,9 +123,32 @@ ruleTester.run('babel/object-curly-spacing', rule, { // never - objectsInObjects { code: "var obj = {'foo': {'bar': 1, 'baz': 2} };", options: ["never", {"objectsInObjects": true}]}, + // https://github.com/eslint/eslint/issues/3658 + // Empty cases. + { code: "var {} = foo;", ecmaFeatures: { destructuring: true }}, + { code: "var [] = foo;", ecmaFeatures: { destructuring: true }}, + { code: "var {a: {}} = foo;", ecmaFeatures: { destructuring: true }}, + { code: "var {a: []} = foo;", ecmaFeatures: { destructuring: true }}, + { code: "import {} from 'foo';", ecmaFeatures: { modules: true }}, + { code: "export {} from 'foo';", ecmaFeatures: { modules: true }}, + { code: "export {};", ecmaFeatures: { modules: true }}, + { code: "var {} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, + { code: "var [] = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, + { code: "var {a: {}} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, + { code: "var {a: []} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, + { code: "import {} from 'foo';", options: ["never"], ecmaFeatures: { modules: true }}, + { code: "export {} from 'foo';", options: ["never"], ecmaFeatures: { modules: true }}, + { code: "export {};", options: ["never"], ecmaFeatures: { modules: true }}, + // Babel test cases. { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + + // always - destructuring typed object param + { code: "function fn({ a,b }:Object){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, + + // never - destructuring typed object param + { code: "function fn({a,b}: Object){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, ], invalid: [ @@ -119,13 +163,182 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ImportDeclaration", line: 1, - column: 8 + column: 9 + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 12 + } + ] + }, + { + code: "import { bar as y} from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 18 + } + ] + }, + { + code: "import {bar as y} from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration", + line: 1, + column: 9 + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 17 + } + ] + }, + { + code: "import { bar} from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 13 + } + ] + }, + { + code: "import x, { bar} from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 16 + } + + ] + }, + { + code: "import x, { bar, baz} from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 21 + } + + ] + }, + { + code: "import x, {bar} from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration", + line: 1, + column: 12 }, { message: "A space is required before '}'", type: "ImportDeclaration", line: 1, + column: 15 + } + + ] + }, + { + code: "import x, {bar, baz} from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration", + line: 1, column: 12 + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 20 + } + ] + }, + { + code: "import {bar,} from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ImportDeclaration", + line: 1, + column: 9 + }, + { + message: "A space is required before '}'", + type: "ImportDeclaration", + line: 1, + column: 13 + } + + ] + }, + { + code: "import { bar, } from 'foo';", + options: ["never"], + ecmaFeatures: { + modules: true + }, + errors: [ + { + message: "There should be no space after '{'", + type: "ImportDeclaration", + line: 1, + column: 9 + }, + { + message: "There should be no space before '}'", + type: "ImportDeclaration", + line: 1, + column: 15 } ] }, @@ -140,7 +353,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ExportNamedDeclaration", line: 1, - column: 8 + column: 9 }, { message: "A space is required before '}'", @@ -226,6 +439,38 @@ ruleTester.run('babel/object-curly-spacing', rule, { } ] }, + { + code: "var {a:b } = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 10 + } + ] + }, + { + code: "var { a:b } = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectPattern", + line: 1, + column: 6 + }, + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 11 + } + ] + }, // never-objectsInObjects { @@ -262,7 +507,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 11 + column: 12 }, { message: "A space is required before '}'", @@ -280,7 +525,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 11 + column: 12 } ] }, @@ -304,7 +549,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 11 + column: 12 }, { message: "There should be no space before '}'", @@ -334,7 +579,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 11 + column: 12 } ] }, @@ -346,13 +591,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 11 + column: 12 }, { message: "There should be no space after '{'", type: "ObjectExpression", line: 1, - column: 18 + column: 19 } ] }, @@ -386,7 +631,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ObjectExpression", line: 1, - column: 22 + column: 23 } ] }, @@ -394,6 +639,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // destructuring { code: "var {x, y} = y", + utput: "var { x, y = y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -401,7 +647,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ObjectPattern", line: 1, - column: 5 + column: 6 }, { message: "A space is required before '}'", @@ -413,6 +659,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { x, y} = y", + ouput: "var { x, y } y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -426,6 +673,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { x, y } = y", + ouput: "var {x, y} = ", ecmaFeatures: {destructuring: true}, options: ["never"], errors: [ @@ -433,7 +681,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "There should be no space after '{'", type: "ObjectPattern", line: 1, - column: 5 + column: 6 }, { message: "There should be no space before '}'", @@ -478,7 +726,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { message: "A space is required after '{'", type: "ObjectPattern", line: 1, - column: 5 + column: 6 } ] }, From b5cdcbe06e93125247e1a0b19bed6a0823a6bcf4 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 20 Dec 2015 17:14:32 -0500 Subject: [PATCH 713/965] Merge pull request babel/eslint-plugin-babel#39 from zaygraveyard/issue37 Update: Implement auto fix for object-curly-spacing (fixes babel/eslint-plugin-babel#37) --- .../rules/object-curly-spacing.js | 42 +++++++++++++---- .../tests/object-curly-spacing.js | 47 +++++++++++++++---- 2 files changed, 72 insertions(+), 17 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js index 781d41562b7e..54d8becae9a7 100644 --- a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -67,8 +67,15 @@ module.exports = function(context) { * @returns {void} */ function reportNoBeginningSpace(node, token) { - context.report(node, token.loc.end, - "There should be no space after '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.end, + message: "There should be no space after '" + token.value + "'", + fix: function(fixer) { + var nextToken = sourceCode.getTokenAfter(token); + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); } /** @@ -78,8 +85,15 @@ module.exports = function(context) { * @returns {void} */ function reportNoEndingSpace(node, token) { - context.report(node, token.loc.start, - "There should be no space before '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space before '" + token.value + "'", + fix: function(fixer) { + var previousToken = sourceCode.getTokenBefore(token); + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); } /** @@ -89,8 +103,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredBeginningSpace(node, token) { - context.report(node, token.loc.end, - "A space is required after '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.end, + message: "A space is required after '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); } /** @@ -100,8 +120,14 @@ module.exports = function(context) { * @returns {void} */ function reportRequiredEndingSpace(node, token) { - context.report(node, token.loc.start, - "A space is required before '" + token.value + "'"); + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required before '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); } /** diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js index a94312a4c3e9..70fbfaa6c809 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -143,17 +143,12 @@ ruleTester.run('babel/object-curly-spacing', rule, { // Babel test cases. { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, - - // always - destructuring typed object param - { code: "function fn({ a,b }:Object){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, - - // never - destructuring typed object param - { code: "function fn({a,b}: Object){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, ], invalid: [ { code: "import {bar} from 'foo.js';", + output: "import { bar } from 'foo.js';", options: ["always"], ecmaFeatures: { modules: true @@ -175,6 +170,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import { bar as y} from 'foo.js';", + output: "import { bar as y } from 'foo.js';", options: ["always"], ecmaFeatures: { modules: true @@ -190,6 +186,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import {bar as y} from 'foo.js';", + output: "import { bar as y } from 'foo.js';", options: ["always"], ecmaFeatures: { modules: true @@ -211,6 +208,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import { bar} from 'foo.js';", + output: "import { bar } from 'foo.js';", options: ["always"], ecmaFeatures: { modules: true @@ -226,6 +224,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import x, { bar} from 'foo';", + output: "import x, { bar } from 'foo';", options: ["always"], ecmaFeatures: { modules: true @@ -242,6 +241,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import x, { bar, baz} from 'foo';", + output: "import x, { bar, baz } from 'foo';", options: ["always"], ecmaFeatures: { modules: true @@ -258,6 +258,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import x, {bar} from 'foo';", + output: "import x, { bar } from 'foo';", options: ["always"], ecmaFeatures: { modules: true @@ -280,6 +281,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import x, {bar, baz} from 'foo';", + output: "import x, { bar, baz } from 'foo';", options: ["always"], ecmaFeatures: { modules: true @@ -301,6 +303,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import {bar,} from 'foo';", + output: "import { bar, } from 'foo';", options: ["always"], ecmaFeatures: { modules: true @@ -323,6 +326,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "import { bar, } from 'foo';", + output: "import {bar,} from 'foo';", options: ["never"], ecmaFeatures: { modules: true @@ -344,6 +348,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "export {bar};", + output: "export { bar };", options: ["always"], ecmaFeatures: { modules: true @@ -367,6 +372,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // always - arraysInObjects { code: "var obj = { 'foo': [ 1, 2 ] };", + output: "var obj = { 'foo': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false}], errors: [ { @@ -377,6 +383,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", + output: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ]};", options: ["always", {"arraysInObjects": false}], errors: [ { @@ -389,6 +396,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // always-objectsInObjects { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", + output: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"objectsInObjects": false}], errors: [ { @@ -401,6 +409,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", + output: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 }};", options: ["always", {"objectsInObjects": false}], errors: [ { @@ -415,6 +424,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // always-destructuring trailing comma { code: "var { a,} = x;", + output: "var { a, } = x;", options: ["always"], ecmaFeatures: { destructuring: true }, errors: [ @@ -428,6 +438,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var {a, } = x;", + output: "var {a,} = x;", options: ["never"], ecmaFeatures: { destructuring: true }, errors: [ @@ -441,6 +452,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var {a:b } = x;", + output: "var {a:b} = x;", options: ["never"], ecmaFeatures: { destructuring: true }, errors: [ @@ -454,6 +466,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { a:b } = x;", + output: "var {a:b} = x;", options: ["never"], ecmaFeatures: { destructuring: true }, errors: [ @@ -475,6 +488,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // never-objectsInObjects { code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", + output: "var obj = {'foo': {'bar': 1, 'baz': 2} };", options: ["never", {"objectsInObjects": true}], errors: [ { @@ -487,6 +501,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", + output: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2} };", options: ["never", {"objectsInObjects": true}], errors: [ { @@ -501,6 +516,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // always & never { code: "var obj = {foo: bar, baz: qux};", + output: "var obj = { foo: bar, baz: qux };", options: ["always"], errors: [ { @@ -519,6 +535,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = {foo: bar, baz: qux };", + output: "var obj = { foo: bar, baz: qux };", options: ["always"], errors: [ { @@ -531,6 +548,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { foo: bar, baz: qux};", + output: "var obj = { foo: bar, baz: qux };", options: ["always"], errors: [ { @@ -543,6 +561,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { foo: bar, baz: qux };", + output: "var obj = {foo: bar, baz: qux};", options: ["never"], errors: [ { @@ -561,6 +580,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = {foo: bar, baz: qux };", + output: "var obj = {foo: bar, baz: qux};", options: ["never"], errors: [ { @@ -573,6 +593,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { foo: bar, baz: qux};", + output: "var obj = {foo: bar, baz: qux};", options: ["never"], errors: [ { @@ -585,6 +606,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = { foo: { bar: quxx}, baz: qux};", + output: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"], errors: [ { @@ -603,6 +625,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = {foo: {bar: quxx }, baz: qux };", + output: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"], errors: [ { @@ -621,6 +644,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "export const thing = {value: 1 };", + output: "export const thing = { value: 1 };", ecmaFeatures: { modules: true, blockBindings: true @@ -639,7 +663,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // destructuring { code: "var {x, y} = y", - utput: "var { x, y = y", + output: "var { x, y } = y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -659,7 +683,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { x, y} = y", - ouput: "var { x, y } y", + output: "var { x, y } = y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -673,7 +697,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { x, y } = y", - ouput: "var {x, y} = ", + output: "var {x, y} = y", ecmaFeatures: {destructuring: true}, options: ["never"], errors: [ @@ -693,6 +717,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var {x, y } = y", + output: "var {x, y} = y", ecmaFeatures: {destructuring: true}, options: ["never"], errors: [ @@ -706,6 +731,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var { x=10} = y", + output: "var { x=10 } = y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -719,6 +745,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var {x=10 } = y", + output: "var { x=10 } = y", ecmaFeatures: {destructuring: true}, options: ["always"], errors: [ @@ -734,6 +761,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { // never - arraysInObjects { code: "var obj = {'foo': [1, 2]};", + output: "var obj = {'foo': [1, 2] };", options: ["never", {"arraysInObjects": true}], errors: [ { @@ -744,6 +772,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, { code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", + output: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux'] };", options: ["never", {"arraysInObjects": true}], errors: [ { From 8bc70e3aac37367817c20c1dd465851c0028a02e Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 20 Dec 2015 19:13:30 -0500 Subject: [PATCH 714/965] Merge pull request babel/eslint-plugin-babel#40 from zaygraveyard/issue18 Update: Add tests to check the issue babel/eslint-plugin-babel#18 --- .../tests/object-curly-spacing.js | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js index 70fbfaa6c809..5e70fc5bbcae 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/object-curly-spacing.js @@ -143,6 +143,12 @@ ruleTester.run('babel/object-curly-spacing', rule, { // Babel test cases. { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, + + // always - destructuring typed object param + { code: "function fn({ a,b }:Object){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, + + // never - destructuring typed object param + { code: "function fn({a,b}: Object){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, ], invalid: [ @@ -780,6 +786,58 @@ ruleTester.run('babel/object-curly-spacing', rule, { type: "ObjectExpression" } ] + }, + + // Babel test cases. + + // always - destructuring typed object param + { + code: "function fn({a,b}: Object){}", + output: "function fn({ a,b }: Object){}", + options: ["always"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true + }, + errors: [ + { + message: "A space is required after '{'", + type: "ObjectPattern", + line: 1, + column: 14 + }, + { + message: "A space is required before '}'", + type: "ObjectPattern", + line: 1, + column: 17 + } + ] + }, + + // never - destructuring typed object param + { + code: "function fn({ a,b }: Object){}", + output: "function fn({a,b}: Object){}", + options: ["never"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true + }, + errors: [ + { + message: "There should be no space after '{'", + type: "ObjectPattern", + line: 1, + column: 14 + }, + { + message: "There should be no space before '}'", + type: "ObjectPattern", + line: 1, + column: 19 + } + ] } ] }); From d58dc7bd1d055ee0a47686697c3f3c9c26b226af Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sun, 20 Dec 2015 19:45:01 -0500 Subject: [PATCH 715/965] Merge pull request babel/eslint-plugin-babel#41 from zaygraveyard/issue35 Fix: array-bracket-spacing for destructuring typed parameter (fixes babel/eslint-plugin-babel#35) --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 2 + .../rules/array-bracket-spacing.js | 222 ++++++ .../tests/array-bracket-spacing.js | 733 ++++++++++++++++++ 4 files changed, 959 insertions(+) create mode 100644 eslint/babel-eslint-plugin/rules/array-bracket-spacing.js create mode 100644 eslint/babel-eslint-plugin/tests/array-bracket-spacing.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index d0b799a5852f..19cbf5389921 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -26,6 +26,7 @@ original ones as well!). "rules": { "babel/generator-star-spacing": 1, "babel/new-cap": 1, + "babel/array-bracket-spacing": 1, "babel/object-curly-spacing": 1, "babel/object-shorthand": 1, "babel/arrow-parens": 1, @@ -39,6 +40,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) +- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parametres - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 9bb58310c19d..43c631615e16 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -5,6 +5,7 @@ module.exports = { 'generator-star-spacing': require('./rules/generator-star-spacing'), 'new-cap': require('./rules/new-cap'), 'object-curly-spacing': require('./rules/object-curly-spacing'), + 'array-bracket-spacing': require('./rules/array-bracket-spacing'), 'object-shorthand': require('./rules/object-shorthand'), 'arrow-parens': require('./rules/arrow-parens'), 'no-await-in-loop': require('./rules/no-await-in-loop'), @@ -13,6 +14,7 @@ module.exports = { 'generator-star-spacing': 0, 'new-cap': 0, 'object-curly-spacing': 0, + 'array-bracket-spacing': 0, 'object-shorthand': 0, 'arrow-parens': 0, 'no-await-in-loop': 0, diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js new file mode 100644 index 000000000000..b67fbe92fbce --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js @@ -0,0 +1,222 @@ +/** + * @fileoverview Disallows or enforces spaces inside of array brackets. + * @author Jamund Ferguson + * @copyright 2015 Jamund Ferguson. All rights reserved. + * @copyright 2014 Brandyn Bennett. All rights reserved. + * @copyright 2014 Michael Ficarra. No rights reserved. + * @copyright 2014 Vignesh Anand. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var spaced = context.options[0] === "always", + sourceCode = context.getSourceCode(); + + /** + * Determines whether an option is set, relative to the spacing option. + * If spaced is "always", then check whether option is set to false. + * If spaced is "never", then check whether option is set to true. + * @param {Object} option - The option to exclude. + * @returns {boolean} Whether or not the property is excluded. + */ + function isOptionSet(option) { + return context.options[1] ? context.options[1][option] === !spaced : false; + } + + var options = { + spaced: spaced, + singleElementException: isOptionSet("singleValue"), + objectsInArraysException: isOptionSet("objectsInArrays"), + arraysInArraysException: isOptionSet("arraysInArrays") + }; + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + */ + function isSameLine(left, right) { + return left.loc.start.line === right.loc.start.line; + } + + /** + * Reports that there shouldn't be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoBeginningSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space after '" + token.value + "'", + fix: function(fixer) { + var nextToken = sourceCode.getTokenAfter(token); + return fixer.removeRange([token.range[1], nextToken.range[0]]); + } + }); + } + + /** + * Reports that there shouldn't be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportNoEndingSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "There should be no space before '" + token.value + "'", + fix: function(fixer) { + var previousToken = sourceCode.getTokenBefore(token); + return fixer.removeRange([previousToken.range[1], token.range[0]]); + } + }); + } + + /** + * Reports that there should be a space after the first token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredBeginningSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required after '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextAfter(token, " "); + } + }); + } + + /** + * Reports that there should be a space before the last token + * @param {ASTNode} node - The node to report in the event of an error. + * @param {Token} token - The token to use for the report. + * @returns {void} + */ + function reportRequiredEndingSpace(node, token) { + context.report({ + node: node, + loc: token.loc.start, + message: "A space is required before '" + token.value + "'", + fix: function(fixer) { + return fixer.insertTextBefore(token, " "); + } + }); + } + + /** + * Determines if a node is an object type + * @param {ASTNode} node - The node to check. + * @returns {boolean} Whether or not the node is an object type. + */ + function isObjectType(node) { + return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); + } + + /** + * Determines if a node is an array type + * @param {ASTNode} node - The node to check. + * @returns {boolean} Whether or not the node is an array type. + */ + function isArrayType(node) { + return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); + } + + /** + * Validates the spacing around array brackets + * @param {ASTNode} node - The node we're checking for spacing + * @returns {void} + */ + function validateArraySpacing(node) { + if (options.spaced && node.elements.length === 0) { + return; + } + + var first = sourceCode.getFirstToken(node), + second = sourceCode.getFirstToken(node, 1), + last = sourceCode.getLastToken(node), + firstElement = node.elements[0], + lastElement = node.elements[node.elements.length - 1]; + + while (last.type !== "Punctuation" && last.value !== "]") { + last = sourceCode.getTokenBefore(last); + } + + var penultimate = sourceCode.getTokenBefore(last); + + var openingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(firstElement) || + options.arraysInArraysException && isArrayType(firstElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + var closingBracketMustBeSpaced = + options.objectsInArraysException && isObjectType(lastElement) || + options.arraysInArraysException && isArrayType(lastElement) || + options.singleElementException && node.elements.length === 1 + ? !options.spaced : options.spaced; + + if (isSameLine(first, second)) { + if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { + reportRequiredBeginningSpace(node, first); + } + if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { + reportNoBeginningSpace(node, first); + } + } + + if (first !== penultimate && isSameLine(penultimate, last)) { + if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportRequiredEndingSpace(node, last); + } + if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { + reportNoEndingSpace(node, last); + } + } + } + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + return { + ArrayPattern: validateArraySpacing, + ArrayExpression: validateArraySpacing + }; + +}; + +module.exports.schema = [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "singleValue": { + "type": "boolean" + }, + "objectsInArrays": { + "type": "boolean" + }, + "arraysInArrays": { + "type": "boolean" + } + }, + "additionalProperties": false + } +]; diff --git a/eslint/babel-eslint-plugin/tests/array-bracket-spacing.js b/eslint/babel-eslint-plugin/tests/array-bracket-spacing.js new file mode 100644 index 000000000000..e4d743d2542a --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/array-bracket-spacing.js @@ -0,0 +1,733 @@ +/** + * @fileoverview Disallows or enforces spaces inside of brackets. + * @author Ian Christian Myers + * @copyright 2014 Vignesh Anand. All rights reserved. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var rule = require('../rules/array-bracket-spacing'), + RuleTester = require('eslint').RuleTester; + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +var ruleTester = new RuleTester(); +ruleTester.run("array-bracket-spacing", rule, { + + valid: [ + { code: "var foo = obj[ 1 ]", options: ["always"] }, + { code: "var foo = obj[ 'foo' ];", options: ["always"] }, + { code: "var foo = obj[ [ 1, 1 ] ];", options: ["always"] }, + + // always - singleValue + { code: "var foo = ['foo']", options: ["always", {singleValue: false}] }, + { code: "var foo = [2]", options: ["always", {singleValue: false}] }, + { code: "var foo = [[ 1, 1 ]]", options: ["always", {singleValue: false}] }, + { code: "var foo = [{ 'foo': 'bar' }]", options: ["always", {singleValue: false}] }, + { code: "var foo = [bar]", options: ["always", {singleValue: false}] }, + + // always - objectsInArrays + { code: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, 5, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{\n'bar': 'baz', \n'qux': [{ 'bar': 'baz' }], \n'quxx': 1 \n}]", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{ 'bar': 'baz' }]", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [{ 'bar': 'baz' }, 1, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, { 'bar': 'baz' }, 5 ];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ 1, { 'bar': 'baz' }, [{ 'bar': 'baz' }] ];", options: ["always", {objectsInArrays: false}] }, + { code: "var foo = [ function(){} ];", options: ["always", {objectsInArrays: false}] }, + + // always - arraysInArrays + { code: "var arr = [[ 1, 2 ], 2, 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, + { code: "var arr = [[ 1, 2 ], [[[ 1 ]]], 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, + { code: "var foo = [ arr[i], arr[j] ];", options: ["always", {"arraysInArrays": false}] }, + + // always - arraysInArrays, objectsInArrays + { code: "var arr = [[ 1, 2 ], 2, 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false}] }, + + // always - arraysInArrays, objectsInArrays, singleValue + { code: "var arr = [[ 1, 2 ], [2], 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false, singleValue: false}] }, + + // always + { code: "obj[ foo ]", options: ["always"] }, + { code: "obj[\nfoo\n]", options: ["always"] }, + { code: "obj[ 'foo' ]", options: ["always"] }, + { code: "obj[ 'foo' + 'bar' ]", options: ["always"] }, + { code: "obj[ obj2[ foo ] ]", options: ["always"] }, + { code: "obj.map(function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + { code: "obj[ 'map' ](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + { code: "obj[ 'for' + 'Each' ](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, + + { code: "var arr = [ 1, 2, 3, 4 ];", options: ["always"] }, + { code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", options: ["always"] }, + { code: "var arr = [\n1, 2, 3, 4\n];", options: ["always"] }, + { code: "var foo = [];", options: ["always"] }, + + // singleValue: false, objectsInArrays: true, arraysInArrays + { code: "this.db.mappings.insert([\n { alias: 'a', url: 'http://www.amazon.de' },\n { alias: 'g', url: 'http://www.google.de' }\n], function() {});", options: ["always", {singleValue: false, objectsInArrays: true, arraysInArrays: true}] }, + + // always - destructuring assignment + { code: "var [ x, y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [ x,y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [ x, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [\nx, y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [\nx,,,\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [ ,x, ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, + { code: "var [\nx, ...y\n] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["always"] }, + { code: "var [\nx, ...y ] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["always"] }, + { code: "var [[ x, y ], z ] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {"arraysInArrays": false}] }, + { code: "var [ x, [ y, z ]] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {"arraysInArrays": false}] }, + { code: "[{ x, y }, z ] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {objectsInArrays: false}] }, + { code: "[ x, { y, z }] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {objectsInArrays: false}] }, + + // never + { code: "obj[foo]", options: ["never"] }, + { code: "obj['foo']", options: ["never"] }, + { code: "obj['foo' + 'bar']", options: ["never"] }, + { code: "obj['foo'+'bar']", options: ["never"] }, + { code: "obj[obj2[foo]]", options: ["never"] }, + { code: "obj.map(function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj['map'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj['for' + 'Each'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "obj['for' + 'Each'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, + { code: "var arr = [1, 2, 3, 4];", options: ["never"] }, + { code: "var arr = [[1, 2], 2, 3, 4];", options: ["never"] }, + { code: "var arr = [\n1, 2, 3, 4\n];", options: ["never"] }, + { code: "obj[\nfoo]", options: ["never"] }, + { code: "obj[foo\n]", options: ["never"] }, + { code: "var arr = [1,\n2,\n3,\n4\n];", options: ["never"] }, + { code: "var arr = [\n1,\n2,\n3,\n4];", options: ["never"] }, + + // never - destructuring assignment + { code: "var [x, y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [x,y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [x, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [\nx, y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [\nx,,,\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [,x,] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, + { code: "var [\nx, ...y\n] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["never"] }, + { code: "var [\nx, ...y] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["never"] }, + { code: "var [ [x, y], z] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {"arraysInArrays": true}] }, + { code: "var [x, [y, z] ] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {"arraysInArrays": true}] }, + { code: "[ { x, y }, z] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {objectsInArrays: true}] }, + { code: "[x, { y, z } ] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {objectsInArrays: true}] }, + + // never - singleValue + { code: "var foo = [ 'foo' ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ 2 ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ [1, 1] ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ {'foo': 'bar'} ]", options: ["never", {singleValue: true}] }, + { code: "var foo = [ bar ]", options: ["never", {singleValue: true}] }, + + // never - objectsInArrays + { code: "var foo = [ {'bar': 'baz'}, 1, 5];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, 5, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {\n'bar': 'baz', \n'qux': [ {'bar': 'baz'} ], \n'quxx': 1 \n} ]", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {'bar': 'baz'} ]", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [ {'bar': 'baz'}, 1, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, {'bar': 'baz'} , 5];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [1, {'bar': 'baz'}, [ {'bar': 'baz'} ]];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [function(){}];", options: ["never", {objectsInArrays: true}] }, + { code: "var foo = [];", options: ["never", {objectsInArrays: true}] }, + + // never - arraysInArrays + { code: "var arr = [ [1, 2], 2, 3, 4];", options: ["never", {"arraysInArrays": true}] }, + { code: "var foo = [arr[i], arr[j]];", options: ["never", {"arraysInArrays": true}] }, + { code: "var foo = [];", options: ["never", {"arraysInArrays": true}] }, + + // never - arraysInArrays, singleValue + { code: "var arr = [ [1, 2], [ [ [ 1 ] ] ], 3, 4];", options: ["never", {"arraysInArrays": true, singleValue: true}] }, + + // never - arraysInArrays, objectsInArrays + { code: "var arr = [ [1, 2], 2, 3, {'foo': 'bar'} ];", options: ["never", {"arraysInArrays": true, objectsInArrays: true}] }, + + // should not warn + { code: "var foo = {};", options: ["never"] }, + { code: "var foo = [];", options: ["never"] }, + + { code: "var foo = [{'bar':'baz'}, 1, {'bar': 'baz'}];", options: ["never"] }, + { code: "var foo = [{'bar': 'baz'}];", options: ["never"] }, + { code: "var foo = [{\n'bar': 'baz', \n'qux': [{'bar': 'baz'}], \n'quxx': 1 \n}]", options: ["never"] }, + { code: "var foo = [1, {'bar': 'baz'}, 5];", options: ["never"] }, + { code: "var foo = [{'bar': 'baz'}, 1, 5];", options: ["never"] }, + { code: "var foo = [1, 5, {'bar': 'baz'}];", options: ["never"] }, + { code: "var obj = {'foo': [1, 2]}", options: ["never"] }, + + // Babel test cases. + // always - destructuring typed array param + { code: "function fn([ a,b ]: Array){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, + + // never - destructuring typed array param + { code: "function fn([a,b]: Array){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, + + ], + + invalid: [ + { + code: "var foo = [ ]", + output: "var foo = []", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + // objectsInArrays + { + code: "var foo = [ { 'bar': 'baz' }, 1, 5];", + output: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "A space is required before ']'", + type: "ArrayExpression", + line: 1, + column: 36 + } + ] + }, + { + code: "var foo = [1, 5, { 'bar': 'baz' } ];", + output: "var foo = [ 1, 5, { 'bar': 'baz' }];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 35 + } + ] + }, + { + code: "var foo = [ { 'bar':'baz' }, 1, { 'bar': 'baz' } ];", + output: "var foo = [{ 'bar':'baz' }, 1, { 'bar': 'baz' }];", + options: ["always", {objectsInArrays: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 50 + } + ] + }, + + // singleValue + { + code: "var obj = [ 'foo' ];", + output: "var obj = ['foo'];", + options: ["always", {singleValue: false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 19 + } + ] + }, + { + code: "var obj = ['foo' ];", + output: "var obj = ['foo'];", + options: ["always", {singleValue: false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 18 + } + ] + }, + { + code: "var obj = ['foo'];", + output: "var obj = [ 'foo' ];", + options: ["never", {singleValue: true}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "A space is required before ']'", + type: "ArrayExpression", + line: 1, + column: 17 + } + ] + }, + + // always - arraysInArrays + { + code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", + output: "var arr = [[ 1, 2 ], 2, 3, 4 ];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + { + code: "var arr = [ 1, 2, 2, [ 3, 4 ] ];", + output: "var arr = [ 1, 2, 2, [ 3, 4 ]];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 31 + } + ] + }, + { + code: "var arr = [[ 1, 2 ], 2, [ 3, 4 ] ];", + output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 34 + } + ] + }, + { + code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ]];", + output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + { + code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];", + output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", + options: ["always", {"arraysInArrays": false}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 35 + } + ] + }, + + // always - destructuring + { + code: "var [x,y] = y", + output: "var [ x,y ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }, + { + message: "A space is required before ']'", + type: "ArrayPattern", + line: 1, + column: 9 + }] + }, + { + code: "var [x,y ] = y", + output: "var [ x,y ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }] + }, + { + code: "var [,,,x,,] = y", + output: "var [ ,,,x,, ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }, + { + message: "A space is required before ']'", + type: "ArrayPattern", + line: 1, + column: 12 + }] + }, + { + code: "var [ ,,,x,,] = y", + output: "var [ ,,,x,, ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "A space is required before ']'", + type: "ArrayPattern", + line: 1, + column: 13 + }] + }, + { + code: "var [...horse] = y", + output: "var [ ...horse ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true, spread:true }, + errors: [{ + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }, + { + message: "A space is required before ']'", + type: "ArrayPattern", + line: 1, + column: 14 + }] + }, + { + code: "var [...horse ] = y", + output: "var [ ...horse ] = y", + options: ["always"], + ecmaFeatures: { destructuring: true, spread:true }, + errors: [{ + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }] + }, + { + code: "var [ [ x, y ], z ] = arr;", + output: "var [[ x, y ], z ] = arr;", + options: ["always", {"arraysInArrays": false}], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "There should be no space after '['", + type: "ArrayPattern", + line: 1, + column: 5 + }] + }, + { + code: "[ { x, y }, z ] = arr;", + output: "[{ x, y }, z ] = arr;", + options: ["always", {"objectsInArrays": false}], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "There should be no space after '['", + type: "ArrayPattern", + line: 1, + column: 1 + }] + }, + { + code: "[ x, { y, z } ] = arr;", + output: "[ x, { y, z }] = arr;", + options: ["always", {"objectsInArrays": false}], + ecmaFeatures: { destructuring: true }, + errors: [{ + message: "There should be no space before ']'", + type: "ArrayPattern", + line: 1, + column: 15 + }] + }, + + // never - arraysInArrays + { + code: "var arr = [[1, 2], 2, [3, 4]];", + output: "var arr = [ [1, 2], 2, [3, 4] ];", + options: ["never", {"arraysInArrays": true}], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "A space is required before ']'", + type: "ArrayExpression", + line: 1, + column: 29 + } + ] + }, + { + code: "var arr = [ ];", + output: "var arr = [];", + options: ["never", {"arraysInArrays": true}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + + // never - objectsInArrays + { + code: "var arr = [ ];", + output: "var arr = [];", + options: ["never", {"objectsInArrays": true}], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + + // always + { + code: "var arr = [1, 2, 3, 4];", + output: "var arr = [ 1, 2, 3, 4 ];", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "A space is required before ']'", + type: "ArrayExpression", + line: 1, + column: 22 + } + ] + }, + { + code: "var arr = [1, 2, 3, 4 ];", + output: "var arr = [ 1, 2, 3, 4 ];", + options: ["always"], + errors: [ + { + message: "A space is required after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + { + code: "var arr = [ 1, 2, 3, 4];", + output: "var arr = [ 1, 2, 3, 4 ];", + options: ["always"], + errors: [ + { + message: "A space is required before ']'", + type: "ArrayExpression", + line: 1, + column: 23 + } + ] + }, + + // never + { + code: "var arr = [ 1, 2, 3, 4 ];", + output: "var arr = [1, 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 24 + } + ] + }, + { + code: "var arr = [1, 2, 3, 4 ];", + output: "var arr = [1, 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 23 + } + ] + }, + { + code: "var arr = [ 1, 2, 3, 4];", + output: "var arr = [1, 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + } + ] + }, + { + code: "var arr = [ [ 1], 2, 3, 4];", + output: "var arr = [[1], 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 11 + }, + { + message: "There should be no space after '['", + type: "ArrayExpression", + line: 1, + column: 13 + } + ] + }, + { + code: "var arr = [[1 ], 2, 3, 4 ];", + output: "var arr = [[1], 2, 3, 4];", + options: ["never"], + errors: [ + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 15 + }, + { + message: "There should be no space before ']'", + type: "ArrayExpression", + line: 1, + column: 26 + } + ] + }, + + // Babel test cases. + + // always - destructuring typed array param + { + code: "function fn([a,b]: Array){}", + output: "function fn([ a,b ]: Array){}", + options: ["always"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true + }, + errors: [ + { + message: "A space is required after '['", + type: "ArrayPattern", + line: 1, + column: 13 + }, + { + message: "A space is required before ']'", + type: "ArrayPattern", + line: 1, + column: 17 + } + ] + }, + + // never - destructuring typed array param + { + code: "function fn([ a,b ]: Array){}", + output: "function fn([a,b]: Array){}", + options: ["never"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true + }, + errors: [ + { + message: "There should be no space after '['", + type: "ArrayPattern", + line: 1, + column: 13 + }, + { + message: "There should be no space before ']'", + type: "ArrayPattern", + line: 1, + column: 19 + } + ] + } + ] +}); From 7a2ecd251685d7e5ce24416acae4b350f9146d2b Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Thu, 21 Jan 2016 20:20:23 -0500 Subject: [PATCH 716/965] Merge pull request babel/eslint-plugin-babel#44 from ssorallen/arrow-type-annotations Add type annotations to arrow-parens "as-needed" --- eslint/babel-eslint-plugin/rules/arrow-parens.js | 6 ++++-- eslint/babel-eslint-plugin/tests/arrow-parens.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index b3ee3a765262..8e7c9456be51 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -24,7 +24,9 @@ module.exports = function(context) { if (node.async) token = context.getTokenAfter(token); // as-needed: x => x - if (asNeeded && node.params.length === 1 && node.params[0].type === "Identifier") { + if (asNeeded && node.params.length === 1 + && node.params[0].type === "Identifier" + && node.params[0].typeAnnotation === undefined) { if (token.type === "Punctuator" && token.value === "(") { context.report(node, asNeededMessage); } @@ -50,4 +52,4 @@ module.exports.schema = [ { "enum": ["always", "as-needed"] } -]; \ No newline at end of file +]; diff --git a/eslint/babel-eslint-plugin/tests/arrow-parens.js b/eslint/babel-eslint-plugin/tests/arrow-parens.js index 74a03f62c564..3616fa7022ba 100644 --- a/eslint/babel-eslint-plugin/tests/arrow-parens.js +++ b/eslint/babel-eslint-plugin/tests/arrow-parens.js @@ -46,6 +46,7 @@ var valid = [ { code: "(a = 10) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true, defaultParams: true } }, { code: "(...a) => a[0]", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, restParams: true } }, { code: "(a, b) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, + ok("(a: string) => a", ["as-needed"]), // async ok("async () => {}"), @@ -174,4 +175,4 @@ var invalid = [ ruleTester.run("arrow-parens", rule, { valid: valid, invalid: invalid -}); \ No newline at end of file +}); From 7fa3aa9116c7d842615b8eb354cfcf5a5b43584b Mon Sep 17 00:00:00 2001 From: jquense Date: Wed, 3 Feb 2016 19:28:25 -0500 Subject: [PATCH 717/965] 3.1.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index fdcbb5058d6e..5bccf2083f8a 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "3.0.0", + "version": "3.1.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 6ac58744fe06ff61194689d7dd6a4653c6b93d55 Mon Sep 17 00:00:00 2001 From: jquense Date: Wed, 3 Feb 2016 19:30:16 -0500 Subject: [PATCH 718/965] update readme --- eslint/babel-eslint-plugin/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 19cbf5389921..29a817b31459 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,6 +1,8 @@ # eslint-plugin-babel -An `eslint` plugin companion to `babel-eslint`. `babel-eslint` does a great job at adapting `eslint` for use with Babel, but it can't change the built in rules to support experimental features. `eslint-plugin-babel` reimplements problematic rules so they do not give false positives or negatives. +An `eslint` plugin companion to `babel-eslint`. `babel-eslint` does a great job at adapting `eslint` +for use with Babel, but it can't change the built in rules to support experimental features. +`eslint-plugin-babel` re-implements problematic rules so they do not give false positives or negatives. ### Install @@ -40,7 +42,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parametres +- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parameters - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly From 5363ff85ccbeadc3370dd2190d7a3d73da58abc2 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 5 Apr 2016 16:19:28 -0400 Subject: [PATCH 719/965] Merge pull request babel/eslint-plugin-babel#56 from nmote/flow-object-type Add flow-object-type rule --- eslint/babel-eslint-plugin/index.js | 2 + .../rules/flow-object-type.js | 52 ++++++++++++++ .../tests/flow-object-type.js | 69 +++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 eslint/babel-eslint-plugin/rules/flow-object-type.js create mode 100644 eslint/babel-eslint-plugin/tests/flow-object-type.js diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 43c631615e16..7a3f7f46172d 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -9,6 +9,7 @@ module.exports = { 'object-shorthand': require('./rules/object-shorthand'), 'arrow-parens': require('./rules/arrow-parens'), 'no-await-in-loop': require('./rules/no-await-in-loop'), + 'flow-object-type': require('./rules/flow-object-type'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -18,5 +19,6 @@ module.exports = { 'object-shorthand': 0, 'arrow-parens': 0, 'no-await-in-loop': 0, + 'flow-object-type': 0, } }; diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/rules/flow-object-type.js new file mode 100644 index 000000000000..f452832d6bf4 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/flow-object-type.js @@ -0,0 +1,52 @@ +/** + * @fileoverview Enforces a choice between semicolons and commas in Flow object and class types. + * @author Nat Mote + */ +"use strict"; + +var SEMICOLON = { + char: ';', + name: 'semicolon', +} + +var COMMA = { + char: ',', + name: 'comma', +}; + +module.exports = function(context) { + var GOOD; + var BAD; + if (context.options[0] === undefined || context.options[0] === SEMICOLON.name) { + GOOD = SEMICOLON; + BAD = COMMA; + } else { + GOOD = COMMA; + BAD = SEMICOLON; + } + function requireProperPunctuation(node) { + var tokens = context.getSourceCode().getTokens(node); + var lastToken = tokens[tokens.length - 1]; + if (lastToken.type === 'Punctuator') { + if (lastToken.value === BAD.char) { + context.report({ + message: 'Prefer ' + GOOD.name + 's to ' + BAD.name + 's in object and class types', + node: lastToken, + fix: function(fixer) { + return fixer.replaceText(lastToken, GOOD.char); + }, + }); + } + } + } + + return { + ObjectTypeProperty: requireProperPunctuation, + }; +}; + +module.exports.schema = [ + { + 'enum': ['semicolon', 'comma'], + } +]; diff --git a/eslint/babel-eslint-plugin/tests/flow-object-type.js b/eslint/babel-eslint-plugin/tests/flow-object-type.js new file mode 100644 index 000000000000..f98c63266454 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/flow-object-type.js @@ -0,0 +1,69 @@ +/** + * @fileoverview Tests for flow-object-type. + * @author Nat Mote + */ + +"use strict"; + +var rule = require("../rules/flow-object-type"), + RuleTester = require('eslint').RuleTester; + +var features = { +}; + +function test(code, options, errors, output){ + var result = { + code: code, + parser: 'babel-eslint', + ecmaFeatures: features, + }; + if (options != null) { + result.options = options; + } + if (errors != null) { + result.errors = errors; + } + if (output != null) { + result.output = output; + } + return result; +} + +var commaMessage = 'Prefer commas to semicolons in object and class types'; +var semiMessage = 'Prefer semicolons to commas in object and class types'; + +function ok(code, commaOrSemi) { + return test(code, [commaOrSemi]); +} + +function err(code, commaOrSemi, errorMessage, output) { + return test(code, [commaOrSemi], [errorMessage], output); +} + +var cases = [ + ok('type Foo = { a: Foo; b: Bar }', 'semicolon'), + err('type Foo = { a: Foo, b: Bar }', 'semicolon', semiMessage, 'type Foo = { a: Foo; b: Bar }'), + + ok('type Foo = { a: Foo, b: Bar }', 'comma'), + err('type Foo = { a: Foo; b: Bar }', 'comma', commaMessage, 'type Foo = { a: Foo, b: Bar }'), + + ok('declare class Foo { a: Foo; }', 'semicolon'), + err('declare class Foo { a: Foo, }', 'semicolon', semiMessage, 'declare class Foo { a: Foo; }'), + + ok('declare class Foo { a: Foo, }', 'comma'), + err('declare class Foo { a: Foo; }', 'comma', commaMessage, 'declare class Foo { a: Foo, }'), +]; + +function hasError(testCase) { + return testCase.errors != null && testCase.errors.length > 0; +} + +function hasNoError(testCase) { + return !hasError(testCase); +} + +var ruleTester = new RuleTester(); +ruleTester.run('flow-object-type', rule, { + valid: cases.filter(hasNoError), + invalid: cases.filter(hasError), +}); From ba2b2bc04d50353eef0753904237407413be03cd Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 7 Apr 2016 18:24:59 -0400 Subject: [PATCH 720/965] Merge pull request babel/eslint-plugin-babel#57 from nmote/docs Add docs for flow-object-type rule --- eslint/babel-eslint-plugin/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 29a817b31459..4fc00c0cdf70 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -32,7 +32,8 @@ original ones as well!). "babel/object-curly-spacing": 1, "babel/object-shorthand": 1, "babel/arrow-parens": 1, - "babel/no-await-in-loop": 1 + "babel/no-await-in-loop": 1, + "babel/flow-object-type": 1 } } ``` @@ -46,4 +47,11 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly + +The following rules are not in `eslint`, but are relevant only to syntax that is not specified by +the current JavaScript standard or supported by `eslint`. + - `babel/no-await-in-loop`: guard against awaiting async functions inside of a loop +- `babel/flow-object-type`: Require a particular separator between properties in Flow object types. + - Use the option `semicolon` to require semicolons (e.g. `type Foo = { bar: number; baz: string }`). + - Use the option `comma` to require commas (e.g. `type Foo = { bar: number, baz: string }`). From 8487ec8a67d5b78c68b5bbbf3e2742ae4ae1595b Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 7 Apr 2016 18:25:57 -0400 Subject: [PATCH 721/965] 3.2.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 5bccf2083f8a..35d923259738 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "3.1.0", + "version": "3.2.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From f57dc5227ab45f271dad7b803c076428be1142da Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Wed, 1 Jun 2016 16:45:26 -0400 Subject: [PATCH 722/965] Merge pull request babel/eslint-plugin-babel#62 from lemonmade/fix-for-arrow-parens Add an automated fix for arrow-parens --- .../babel-eslint-plugin/rules/arrow-parens.js | 21 +++++++++++++++++-- .../babel-eslint-plugin/tests/arrow-parens.js | 17 +++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index 8e7c9456be51..6ca3ffc776bf 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -28,7 +28,18 @@ module.exports = function(context) { && node.params[0].type === "Identifier" && node.params[0].typeAnnotation === undefined) { if (token.type === "Punctuator" && token.value === "(") { - context.report(node, asNeededMessage); + context.report({ + node: node, + message: asNeededMessage, + fix: function(fixer) { + var paramToken = context.getTokenAfter(token); + var closingParenToken = context.getTokenAfter(paramToken); + return fixer.replaceTextRange([ + token.range[0], + closingParenToken.range[1] + ], paramToken.value); + } + }); } return; } @@ -38,7 +49,13 @@ module.exports = function(context) { // (x) => x if (after.value !== ")") { - context.report(node, message); + context.report({ + node: node, + message: message, + fix: function(fixer) { + return fixer.replaceText(token, '(' + token.value + ')'); + } + }); } } } diff --git a/eslint/babel-eslint-plugin/tests/arrow-parens.js b/eslint/babel-eslint-plugin/tests/arrow-parens.js index 3616fa7022ba..f129f77f71b8 100644 --- a/eslint/babel-eslint-plugin/tests/arrow-parens.js +++ b/eslint/babel-eslint-plugin/tests/arrow-parens.js @@ -18,9 +18,10 @@ function ok(code, args){ return { code: code, options: args, parser: 'babel-eslint' } } -function err(code, errors, args){ +function err(code, output, errors, args){ var e = ok(code, args) e.errors = errors + e.output = output return e } @@ -74,6 +75,7 @@ var type = type; var invalid = [ { code: "a => {}", + output: "(a) => {}", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -84,6 +86,7 @@ var invalid = [ }, { code: "a => a", + output: "(a) => a", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -94,6 +97,7 @@ var invalid = [ }, { code: "a => {\n}", + output: "(a) => {\n}", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -104,6 +108,7 @@ var invalid = [ }, { code: "a.then(foo => {});", + output: "a.then((foo) => {});", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -114,6 +119,7 @@ var invalid = [ }, { code: "a.then(foo => a);", + output: "a.then((foo) => a);", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -124,6 +130,7 @@ var invalid = [ }, { code: "a(foo => { if (true) {}; });", + output: "a((foo) => { if (true) {}; });", ecmaFeatures: { arrowFunctions: true }, errors: [{ line: 1, @@ -136,6 +143,7 @@ var invalid = [ // as-needed { code: "(a) => a", + output: "a => a", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true }, errors: [{ @@ -147,6 +155,7 @@ var invalid = [ }, { code: "(b) => b", + output: "b => b", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true }, errors: [{ @@ -158,15 +167,15 @@ var invalid = [ }, // async - err('async a => {}', [ + err('async a => {}', 'async (a) => {}', [ { message: 'Expected parentheses around arrow function argument.' }, ]), - err('async a => a', [ + err('async a => a', 'async (a) => a', [ { message: 'Expected parentheses around arrow function argument.' }, ]), - err('async (a) => a', [ + err('async (a) => a', 'async a => a', [ { message: 'Unexpected parentheses around single function argument' }, ], ["as-needed"]) From 148e6be60f5d753b51b4cbc27b96d08ffe85bf76 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 1 Jun 2016 18:13:06 -0400 Subject: [PATCH 723/965] show which rules are fixable --- eslint/babel-eslint-plugin/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 4fc00c0cdf70..48611f3cd376 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -41,17 +41,19 @@ original ones as well!). Each rule corresponds to a core `eslint` rule, and has the same options. +🛠 : means it's autofixable with `--fix`. + - `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parameters -- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` +- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parameters (🛠 ) +- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠 ) - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) -- `babel/arrow-parens`: Handles async functions correctly +- `babel/arrow-parens`: Handles async functions correctly (🛠 ) The following rules are not in `eslint`, but are relevant only to syntax that is not specified by the current JavaScript standard or supported by `eslint`. - `babel/no-await-in-loop`: guard against awaiting async functions inside of a loop -- `babel/flow-object-type`: Require a particular separator between properties in Flow object types. +- `babel/flow-object-type`: Require a particular separator between properties in Flow object types. (🛠 ) - Use the option `semicolon` to require semicolons (e.g. `type Foo = { bar: number; baz: string }`). - Use the option `comma` to require commas (e.g. `type Foo = { bar: number, baz: string }`). From 8cd329f61189b714e97f1f887d8c67f3d9fbc739 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 21 Jun 2016 16:15:36 -0400 Subject: [PATCH 724/965] Merge pull request babel/eslint-plugin-babel#64 from zertosh/master Add func-params-comma-dangle rule --- eslint/babel-eslint-plugin/README.md | 4 +- eslint/babel-eslint-plugin/index.js | 2 + .../rules/func-params-comma-dangle.js | 137 +++++++++ .../tests/func-params-comma-dangle.js | 278 ++++++++++++++++++ 4 files changed, 420 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js create mode 100644 eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 48611f3cd376..a712dee52ca9 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -33,7 +33,8 @@ original ones as well!). "babel/object-shorthand": 1, "babel/arrow-parens": 1, "babel/no-await-in-loop": 1, - "babel/flow-object-type": 1 + "babel/flow-object-type": 1, + "babel/func-params-comma-dangle": 1 } } ``` @@ -57,3 +58,4 @@ the current JavaScript standard or supported by `eslint`. - `babel/flow-object-type`: Require a particular separator between properties in Flow object types. (🛠 ) - Use the option `semicolon` to require semicolons (e.g. `type Foo = { bar: number; baz: string }`). - Use the option `comma` to require commas (e.g. `type Foo = { bar: number, baz: string }`). +- `babel/func-params-comma-dangle`: Require or forbid trailing commas for function paramater lists. Behaves like, and takes the same options as, `eslint`'s [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle). (🛠 ) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 7a3f7f46172d..3656458f0b3a 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -10,6 +10,7 @@ module.exports = { 'arrow-parens': require('./rules/arrow-parens'), 'no-await-in-loop': require('./rules/no-await-in-loop'), 'flow-object-type': require('./rules/flow-object-type'), + 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -20,5 +21,6 @@ module.exports = { 'arrow-parens': 0, 'no-await-in-loop': 0, 'flow-object-type': 0, + 'func-params-comma-dangle': 0, } }; diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js new file mode 100644 index 000000000000..d750323d392a --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js @@ -0,0 +1,137 @@ +'use strict'; + +// Based on https://github.com/eslint/eslint/blob/v2.11.1/lib/rules/comma-dangle.js + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +function last(arr) { + return arr.length !== 0 ? arr[arr.length - 1] : undefined; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + var mode = context.options[0]; + var UNEXPECTED_MESSAGE = 'Unexpected trailing comma.'; + var MISSING_MESSAGE = 'Missing trailing comma.'; + + function isMultiline(node) { + var lastItem = last(node.params || node.arguments); + + if (!lastItem) { + return false; + } + + var sourceCode = context.getSourceCode(); + var penultimateToken = sourceCode.getLastToken(lastItem); + var lastToken = sourceCode.getTokenAfter(penultimateToken); + + if (lastToken.value === ',') { + penultimateToken = lastToken; + lastToken = sourceCode.getTokenAfter(lastToken); + } + + return lastToken.loc.end.line !== penultimateToken.loc.end.line; + } + + function forbidTrailingComma(node) { + var lastItem = last(node.params || node.arguments); + + if (!lastItem) { + return; + } + + var sourceCode = context.getSourceCode(); + var trailingToken = sourceCode.getTokenAfter(lastItem); + + if (trailingToken.value === ',') { + context.report({ + node: lastItem, + loc: trailingToken.loc.start, + message: UNEXPECTED_MESSAGE, + fix: function(fixer) { + return fixer.remove(trailingToken); + } + }); + } + } + + function forceTrailingComma(node) { + var lastItem = last(node.params || node.arguments); + + if (!lastItem) { + return; + } + + // `f(...a,)` is ok, but `function f(...a,) {}` is invalid syntax. + if (lastItem.type === 'RestElement') { + return; + } + + var sourceCode = context.getSourceCode(); + var penultimateToken = lastItem; + var trailingToken = sourceCode.getTokenAfter(lastItem); + + // `f = a, => {}` is invalid syntax. + if (node.type === 'ArrowFunctionExpression' && + node.params.length === 1 && + sourceCode.getTokenBefore(lastItem).value !== '(') { + return; + } + + if (trailingToken.value !== ',') { + context.report({ + node: lastItem, + loc: lastItem.loc.end, + message: MISSING_MESSAGE, + fix: function(fixer) { + return fixer.insertTextAfter(penultimateToken, ','); + } + }); + } + } + + function forceTrailingCommaIfMultiline(node) { + if (isMultiline(node)) { + forceTrailingComma(node); + } else { + forbidTrailingComma(node); + } + } + + function allowTrailingCommaIfMultiline(node) { + if (!isMultiline(node)) { + forbidTrailingComma(node); + } + } + + var checkForTrailingComma; + if (mode === 'always') { + checkForTrailingComma = forceTrailingComma; + } else if (mode === 'always-multiline') { + checkForTrailingComma = forceTrailingCommaIfMultiline; + } else if (mode === 'only-multiline') { + checkForTrailingComma = allowTrailingCommaIfMultiline; + } else { + checkForTrailingComma = forbidTrailingComma; + } + + return { + ArrowFunctionExpression: checkForTrailingComma, + FunctionDeclaration: checkForTrailingComma, + FunctionExpression: checkForTrailingComma, + CallExpression: checkForTrailingComma, + NewExpression: checkForTrailingComma, + }; +}; + +module.exports.fixable = 'code'; +module.exports.schema = [ + { + enum: ['always', 'always-multiline', 'only-multiline', 'never'] + } +]; diff --git a/eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js new file mode 100644 index 000000000000..9fc5c2110f66 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js @@ -0,0 +1,278 @@ +'use strict'; + +var rule = require('../rules/func-params-comma-dangle'); +var RuleTester = require('eslint').RuleTester; + +var MISSING_I = [{message: 'Missing trailing comma.', type: 'Identifier'}]; +var MISSING_AP = [{message: 'Missing trailing comma.', type: 'AssignmentPattern'}]; +var MISSING_SE = [{message: 'Missing trailing comma.', type: 'SpreadElement'}]; +var UNEXPECTED_I = [{message: 'Unexpected trailing comma.', type: 'Identifier'}]; +var UNEXPECTED_AP = [{message: 'Unexpected trailing comma.', type: 'AssignmentPattern'}]; +var UNEXPECTED_SE = [{message: 'Unexpected trailing comma.', type: 'SpreadElement'}]; + +var ruleTester = new RuleTester({parser: 'babel-eslint'}); +ruleTester.run('func-params-comma-dangle', rule, { + valid: [ + {code: 'function f() {}'}, + {code: 'function f(\n) {}'}, + {code: 'function f(...a) {}'}, + {code: 'function f(...a\n) {}'}, + + {code: 'f()'}, + {code: 'f(\n)'}, + + {code: 'new F()'}, + {code: 'new F(\n)'}, + + // FunctionDeclaration + {code: 'function f(a) {}', options: ['always-multiline']}, + {code: 'function f(a) {}', options: ['never']}, + {code: 'function f(a) {}', options: ['only-multiline']}, + {code: 'function f(a,) {}', options: ['always']}, + {code: 'function f(a,\n) {}', options: ['always']}, + {code: 'function f(a,\n) {}', options: ['always-multiline']}, + {code: 'function f(a,\n) {}', options: ['only-multiline']}, + {code: 'function f(a\n) {}', options: ['never']}, + {code: 'function f(a\n) {}', options: ['only-multiline']}, + + {code: 'function f(a=1) {}', options: ['always-multiline']}, + {code: 'function f(a=1) {}', options: ['never']}, + {code: 'function f(a=1) {}', options: ['only-multiline']}, + {code: 'function f(a=1,) {}', options: ['always']}, + {code: 'function f(a=1,\n) {}', options: ['always']}, + {code: 'function f(a=1,\n) {}', options: ['always-multiline']}, + {code: 'function f(a=1,\n) {}', options: ['only-multiline']}, + {code: 'function f(a=1\n) {}', options: ['never']}, + {code: 'function f(a=1\n) {}', options: ['only-multiline']}, + + {code: 'function f(a:T) {}', options: ['always-multiline']}, + {code: 'function f(a:T) {}', options: ['never']}, + {code: 'function f(a:T) {}', options: ['only-multiline']}, + {code: 'function f(a:T,) {}', options: ['always']}, + {code: 'function f(a:T,\n) {}', options: ['always']}, + {code: 'function f(a:T,\n) {}', options: ['always-multiline']}, + {code: 'function f(a:T,\n) {}', options: ['only-multiline']}, + {code: 'function f(a:T\n) {}', options: ['never']}, + {code: 'function f(a:T\n) {}', options: ['only-multiline']}, + + // FunctionExpression + {code: 'f = function(a) {}', options: ['always-multiline']}, + {code: 'f = function(a) {}', options: ['never']}, + {code: 'f = function(a) {}', options: ['only-multiline']}, + {code: 'f = function(a,) {}', options: ['always']}, + {code: 'f = function(a,\n) {}', options: ['always']}, + {code: 'f = function(a,\n) {}', options: ['always-multiline']}, + {code: 'f = function(a,\n) {}', options: ['only-multiline']}, + {code: 'f = function(a\n) {}', options: ['never']}, + {code: 'f = function(a\n) {}', options: ['only-multiline']}, + + {code: 'f = function(a=1) {}', options: ['always-multiline']}, + {code: 'f = function(a=1) {}', options: ['never']}, + {code: 'f = function(a=1) {}', options: ['only-multiline']}, + {code: 'f = function(a=1,) {}', options: ['always']}, + {code: 'f = function(a=1,\n) {}', options: ['always']}, + {code: 'f = function(a=1,\n) {}', options: ['always-multiline']}, + {code: 'f = function(a=1,\n) {}', options: ['only-multiline']}, + {code: 'f = function(a=1\n) {}', options: ['never']}, + {code: 'f = function(a=1\n) {}', options: ['only-multiline']}, + + {code: 'f = function(a:T) {}', options: ['always-multiline']}, + {code: 'f = function(a:T) {}', options: ['never']}, + {code: 'f = function(a:T) {}', options: ['only-multiline']}, + {code: 'f = function(a:T,) {}', options: ['always']}, + {code: 'f = function(a:T,\n) {}', options: ['always']}, + {code: 'f = function(a:T,\n) {}', options: ['always-multiline']}, + {code: 'f = function(a:T,\n) {}', options: ['only-multiline']}, + {code: 'f = function(a:T\n) {}', options: ['never']}, + {code: 'f = function(a:T\n) {}', options: ['only-multiline']}, + + // ArrowFunctionExpression + {code: 'f = (a) => {}', options: ['always-multiline']}, + {code: 'f = (a) => {}', options: ['never']}, + {code: 'f = (a) => {}', options: ['only-multiline']}, + {code: 'f = (a,) => {}', options: ['always']}, + {code: 'f = (a,\n) => {}', options: ['always']}, + {code: 'f = (a,\n) => {}', options: ['always-multiline']}, + {code: 'f = (a,\n) => {}', options: ['only-multiline']}, + {code: 'f = (a\n) => {}', options: ['never']}, + {code: 'f = (a\n) => {}', options: ['only-multiline']}, + + {code: 'f = a => {}', options: ['always-multiline']}, + {code: 'f = a => {}', options: ['never']}, + {code: 'f = a => {}', options: ['only-multiline']}, + {code: 'f = a => {}', options: ['always']}, + + {code: 'f = (a=1) => {}', options: ['always-multiline']}, + {code: 'f = (a=1) => {}', options: ['never']}, + {code: 'f = (a=1) => {}', options: ['only-multiline']}, + {code: 'f = (a=1,) => {}', options: ['always']}, + {code: 'f = (a=1,\n) => {}', options: ['always']}, + {code: 'f = (a=1,\n) => {}', options: ['always-multiline']}, + {code: 'f = (a=1,\n) => {}', options: ['only-multiline']}, + {code: 'f = (a=1\n) => {}', options: ['never']}, + {code: 'f = (a=1\n) => {}', options: ['only-multiline']}, + + {code: 'f = (a:T) => {}', options: ['always-multiline']}, + {code: 'f = (a:T) => {}', options: ['never']}, + {code: 'f = (a:T) => {}', options: ['only-multiline']}, + // Arrow functions with flow types aren't getting the correct loc. + // {code: 'f = (a:T,) => {}', options: ['always']}, + // {code: 'f = (a:T,\n) => {}', options: ['always']}, + {code: 'f = (a:T,\n) => {}', options: ['always-multiline']}, + {code: 'f = (a:T,\n) => {}', options: ['only-multiline']}, + {code: 'f = (a:T\n) => {}', options: ['never']}, + {code: 'f = (a:T\n) => {}', options: ['only-multiline']}, + + // CallExpression + {code: 'f(a)', options: ['always-multiline']}, + {code: 'f(a)', options: ['never']}, + {code: 'f(a)', options: ['only-multiline']}, + {code: 'f(a,)', options: ['always']}, + {code: 'f(a,\n)', options: ['always']}, + {code: 'f(a,\n)', options: ['always-multiline']}, + {code: 'f(a,\n)', options: ['only-multiline']}, + {code: 'f(a\n)', options: ['never']}, + {code: 'f(a\n)', options: ['only-multiline']}, + {code: 'f(...a)', options: ['always-multiline']}, + {code: 'f(...a)', options: ['never']}, + {code: 'f(...a)', options: ['only-multiline']}, + {code: 'f(...a,)', options: ['always']}, + {code: 'f(...a,\n)', options: ['always']}, + {code: 'f(...a,\n)', options: ['always-multiline']}, + {code: 'f(...a,\n)', options: ['only-multiline']}, + {code: 'f(...a\n)', options: ['never']}, + {code: 'f(...a\n)', options: ['only-multiline']}, + + // NewExpression + {code: 'new F(a)', options: ['always-multiline']}, + {code: 'new F(a)', options: ['never']}, + {code: 'new F(a)', options: ['only-multiline']}, + {code: 'new F(a,)', options: ['always']}, + {code: 'new F(a,\n)', options: ['always']}, + {code: 'new F(a,\n)', options: ['always-multiline']}, + {code: 'new F(a,\n)', options: ['only-multiline']}, + {code: 'new F(a\n)', options: ['never']}, + {code: 'new F(a\n)', options: ['only-multiline']}, + {code: 'new F(...a)', options: ['always-multiline']}, + {code: 'new F(...a)', options: ['never']}, + {code: 'new F(...a)', options: ['only-multiline']}, + {code: 'new F(...a,)', options: ['always']}, + {code: 'new F(...a,\n)', options: ['always']}, + {code: 'new F(...a,\n)', options: ['always-multiline']}, + {code: 'new F(...a,\n)', options: ['only-multiline']}, + {code: 'new F(...a\n)', options: ['never']}, + {code: 'new F(...a\n)', options: ['only-multiline']}, + ], + invalid: [ + // FunctionDeclaration + {code: 'function f(a) {}', output: 'function f(a,) {}', options: ['always'], errors: MISSING_I}, + {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'function f(a,\n) {}', output: 'function f(a\n) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'function f(a\n) {}', output: 'function f(a,\n) {}', options: ['always'], errors: MISSING_I}, + {code: 'function f(a\n) {}', output: 'function f(a,\n) {}', options: ['always-multiline'], errors: MISSING_I}, + + {code: 'function f(a=1) {}', output: 'function f(a=1,) {}', options: ['always'], errors: MISSING_AP}, + {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, + {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, + {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, + {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'function f(a=1,\n) {}', output: 'function f(a=1\n) {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'function f(a=1\n) {}', output: 'function f(a=1,\n) {}', options: ['always'], errors: MISSING_AP}, + {code: 'function f(a=1\n) {}', output: 'function f(a=1,\n) {}', options: ['always-multiline'], errors: MISSING_AP}, + + {code: 'function f(a:T) {}', output: 'function f(a:T,) {}', options: ['always'], errors: MISSING_I}, + {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'function f(a:T,\n) {}', output: 'function f(a:T\n) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'function f(a:T\n) {}', output: 'function f(a:T,\n) {}', options: ['always'], errors: MISSING_I}, + {code: 'function f(a:T\n) {}', output: 'function f(a:T,\n) {}', options: ['always-multiline'], errors: MISSING_I}, + + // FunctionExpression + {code: 'f = function f(a) {}', output: 'f = function f(a,) {}', options: ['always'], errors: MISSING_I}, + {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = function f(a,\n) {}', output: 'f = function f(a\n) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = function f(a\n) {}', output: 'f = function f(a,\n) {}', options: ['always'], errors: MISSING_I}, + {code: 'f = function f(a\n) {}', output: 'f = function f(a,\n) {}', options: ['always-multiline'], errors: MISSING_I}, + + {code: 'f = function f(a=1) {}', output: 'f = function f(a=1,) {}', options: ['always'], errors: MISSING_AP}, + {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, + {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, + {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'f = function f(a=1,\n) {}', output: 'f = function f(a=1\n) {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'f = function f(a=1\n) {}', output: 'f = function f(a=1,\n) {}', options: ['always'], errors: MISSING_AP}, + {code: 'f = function f(a=1\n) {}', output: 'f = function f(a=1,\n) {}', options: ['always-multiline'], errors: MISSING_AP}, + + {code: 'f = function f(a:T) {}', output: 'f = function f(a:T,) {}', options: ['always'], errors: MISSING_I}, + {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = function f(a:T,\n) {}', output: 'f = function f(a:T\n) {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = function f(a:T\n) {}', output: 'f = function f(a:T,\n) {}', options: ['always'], errors: MISSING_I}, + {code: 'f = function f(a:T\n) {}', output: 'f = function f(a:T,\n) {}', options: ['always-multiline'], errors: MISSING_I}, + + // ArrowFunctionExpression + {code: 'f = (a) => {}', output: 'f = (a,) => {}', options: ['always'], errors: MISSING_I}, + {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = (a,\n) => {}', output: 'f = (a\n) => {}', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f = (a\n) => {}', output: 'f = (a,\n) => {}', options: ['always'], errors: MISSING_I}, + {code: 'f = (a\n) => {}', output: 'f = (a,\n) => {}', options: ['always-multiline'], errors: MISSING_I}, + + {code: 'f = (a=1) => {}', output: 'f = (a=1,) => {}', options: ['always'], errors: MISSING_AP}, + {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, + {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, + {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'f = (a=1,\n) => {}', output: 'f = (a=1\n) => {}', options: ['never'], errors: UNEXPECTED_AP}, + {code: 'f = (a=1\n) => {}', output: 'f = (a=1,\n) => {}', options: ['always'], errors: MISSING_AP}, + {code: 'f = (a=1\n) => {}', output: 'f = (a=1,\n) => {}', options: ['always-multiline'], errors: MISSING_AP}, + + // Arrow functions with flow types aren't getting the correct loc. + // {code: 'f = (a:T) => {}', output: 'f = (a:T,) => {}', options: ['always'], errors: MISSING_I}, + // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['always-multiline'], errors: UNEXPECTED_I}, + // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['only-multiline'], errors: UNEXPECTED_I}, + // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['never'], errors: UNEXPECTED_I}, + // {code: 'f = (a:T,\n) => {}', output: 'f = (a:T\n) => {}', options: ['never'], errors: UNEXPECTED_I}, + // {code: 'f = (a:T\n) => {}', output: 'f = (a:T,\n) => {}', options: ['always'], errors: MISSING_I}, + // {code: 'f = (a:T\n) => {}', output: 'f = (a:T,\n) => {}', options: ['always-multiline'], errors: MISSING_I}, + + // CallExpression + {code: 'f(a)', output: 'f(a,)', options: ['always'], errors: MISSING_I}, + {code: 'f(a,)', output: 'f(a)', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'f(a,)', output: 'f(a)', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'f(a,)', output: 'f(a)', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f(a,\n)', output: 'f(a\n)', options: ['never'], errors: UNEXPECTED_I}, + {code: 'f(a\n)', output: 'f(a,\n)', options: ['always'], errors: MISSING_I}, + {code: 'f(a\n)', output: 'f(a,\n)', options: ['always-multiline'], errors: MISSING_I}, + + {code: 'f(...a)', output: 'f(...a,)', options: ['always'], errors: MISSING_SE}, + {code: 'f(...a,)', output: 'f(...a)', options: ['always-multiline'], errors: UNEXPECTED_SE}, + {code: 'f(...a,)', output: 'f(...a)', options: ['only-multiline'], errors: UNEXPECTED_SE}, + {code: 'f(...a,)', output: 'f(...a)', options: ['never'], errors: UNEXPECTED_SE}, + {code: 'f(...a,\n)', output: 'f(...a\n)', options: ['never'], errors: UNEXPECTED_SE}, + {code: 'f(...a\n)', output: 'f(...a,\n)', options: ['always'], errors: MISSING_SE}, + {code: 'f(...a\n)', output: 'f(...a,\n)', options: ['always-multiline'], errors: MISSING_SE}, + + // NewExpression + {code: 'new F(a)', output: 'new F(a,)', options: ['always'], errors: MISSING_I}, + {code: 'new F(a,)', output: 'new F(a)', options: ['always-multiline'], errors: UNEXPECTED_I}, + {code: 'new F(a,)', output: 'new F(a)', options: ['only-multiline'], errors: UNEXPECTED_I}, + {code: 'new F(a,)', output: 'new F(a)', options: ['never'], errors: UNEXPECTED_I}, + {code: 'new F(a,\n)', output: 'new F(a\n)', options: ['never'], errors: UNEXPECTED_I}, + {code: 'new F(a\n)', output: 'new F(a,\n)', options: ['always'], errors: MISSING_I}, + {code: 'new F(a\n)', output: 'new F(a,\n)', options: ['always-multiline'], errors: MISSING_I}, + + {code: 'new F(...a)', output: 'new F(...a,)', options: ['always'], errors: MISSING_SE}, + {code: 'new F(...a,)', output: 'new F(...a)', options: ['always-multiline'], errors: UNEXPECTED_SE}, + {code: 'new F(...a,)', output: 'new F(...a)', options: ['only-multiline'], errors: UNEXPECTED_SE}, + {code: 'new F(...a,)', output: 'new F(...a)', options: ['never'], errors: UNEXPECTED_SE}, + {code: 'new F(...a,\n)', output: 'new F(...a\n)', options: ['never'], errors: UNEXPECTED_SE}, + {code: 'new F(...a\n)', output: 'new F(...a,\n)', options: ['always'], errors: MISSING_SE}, + {code: 'new F(...a\n)', output: 'new F(...a,\n)', options: ['always-multiline'], errors: MISSING_SE}, + ], +}); From cae851363613c712c356ae0c6e278a7f048e19cf Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 21 Jun 2016 16:17:06 -0400 Subject: [PATCH 725/965] 3.3.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 35d923259738..1487c6b70653 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "3.2.0", + "version": "3.3.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 1daf7f986599978dc71db15dc120b82a8b279838 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 1 Jul 2016 07:58:05 -0400 Subject: [PATCH 726/965] Run Travis CI in same Node versions as babel-eslint (babel/eslint-plugin-babel#68) --- eslint/babel-eslint-plugin/.travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml index 5a7ce2a7f99e..2d156dd6d5e0 100644 --- a/eslint/babel-eslint-plugin/.travis.yml +++ b/eslint/babel-eslint-plugin/.travis.yml @@ -1,7 +1,11 @@ --- git: depth: 1 +sudo: false language: node_js node_js: + - '0.10' - '0.12' - - 'io.js' \ No newline at end of file + - '4' + - '5' + - '6' From f6c2d2e0e525f49f553f412ce14390774f3f3cd6 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Fri, 1 Jul 2016 08:24:41 -0400 Subject: [PATCH 727/965] `--save-dev` instead of `-D` [skip ci] --- eslint/babel-eslint-plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index a712dee52ca9..419cafa07c22 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -7,7 +7,7 @@ for use with Babel, but it can't change the built in rules to support experiment ### Install ```sh -npm install eslint-plugin-babel -D +npm install eslint-plugin-babel --save-dev ``` Load the plugin in your `.eslintrc` file: From 6e4d44f312129d1e5bb83498c718a601d428fe26 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 1 Jul 2016 10:15:59 -0400 Subject: [PATCH 728/965] Update Dependencies (babel/eslint-plugin-babel#67) * Update Dependencies fixes babel/eslint-plugin-babel#65 * Remove PhantomJS & is-my-json-valid PhantomJS & is-my-json-valid is not actually used anywhere * Change ESLint peerDependency version back to >=1.0.0 --- eslint/babel-eslint-plugin/package.json | 10 ++++------ eslint/babel-eslint-plugin/tests/RuleTester.js | 7 +++++++ .../tests/{ => rules}/array-bracket-spacing.js | 4 ++-- .../tests/{ => rules}/arrow-parens.js | 4 ++-- .../tests/{ => rules}/flow-object-type.js | 4 ++-- .../tests/{ => rules}/func-params-comma-dangle.js | 4 ++-- .../tests/{ => rules}/generator-star-spacing.js | 4 ++-- .../babel-eslint-plugin/tests/{ => rules}/new-cap.js | 4 ++-- .../tests/{ => rules}/no-await-in-loop.js | 4 ++-- .../tests/{ => rules}/object-curly-spacing.js | 4 ++-- .../tests/{ => rules}/object-shorthand.js | 4 ++-- 11 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 eslint/babel-eslint-plugin/tests/RuleTester.js rename eslint/babel-eslint-plugin/tests/{ => rules}/array-bracket-spacing.js (99%) rename eslint/babel-eslint-plugin/tests/{ => rules}/arrow-parens.js (98%) rename eslint/babel-eslint-plugin/tests/{ => rules}/flow-object-type.js (94%) rename eslint/babel-eslint-plugin/tests/{ => rules}/func-params-comma-dangle.js (99%) rename eslint/babel-eslint-plugin/tests/{ => rules}/generator-star-spacing.js (99%) rename eslint/babel-eslint-plugin/tests/{ => rules}/new-cap.js (98%) rename eslint/babel-eslint-plugin/tests/{ => rules}/no-await-in-loop.js (96%) rename eslint/babel-eslint-plugin/tests/{ => rules}/object-curly-spacing.js (99%) rename eslint/babel-eslint-plugin/tests/{ => rules}/object-shorthand.js (98%) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 1487c6b70653..fe4173229ddd 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -4,7 +4,7 @@ "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { - "test": "mocha ./tests/*.js" + "test": "mocha ./tests/rules/*.js" }, "repository": { "type": "git", @@ -27,10 +27,8 @@ "eslint": ">=1.0.0" }, "devDependencies": { - "babel-eslint": "^4.0.7", - "eslint": "^1.1.0", - "is-my-json-valid": "^2.12.0", - "mocha": "^2.2.5", - "phantomjs": "^1.9.17" + "babel-eslint": "^6.1.0", + "eslint": "^2.13.1", + "mocha": "^2.2.5" } } diff --git a/eslint/babel-eslint-plugin/tests/RuleTester.js b/eslint/babel-eslint-plugin/tests/RuleTester.js new file mode 100644 index 000000000000..e183277bfb40 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/RuleTester.js @@ -0,0 +1,7 @@ +var RuleTester = require("eslint").RuleTester; + +RuleTester.setDefaultConfig({ + parser: 'babel-eslint' +}); + +module.exports = RuleTester; diff --git a/eslint/babel-eslint-plugin/tests/array-bracket-spacing.js b/eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/array-bracket-spacing.js rename to eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js index e4d743d2542a..ea5aa2f45875 100644 --- a/eslint/babel-eslint-plugin/tests/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js @@ -9,8 +9,8 @@ // Requirements //------------------------------------------------------------------------------ -var rule = require('../rules/array-bracket-spacing'), - RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/array-bracket-spacing'), + RuleTester = require('../RuleTester'); //------------------------------------------------------------------------------ // Tests diff --git a/eslint/babel-eslint-plugin/tests/arrow-parens.js b/eslint/babel-eslint-plugin/tests/rules/arrow-parens.js similarity index 98% rename from eslint/babel-eslint-plugin/tests/arrow-parens.js rename to eslint/babel-eslint-plugin/tests/rules/arrow-parens.js index f129f77f71b8..1962be7b8891 100644 --- a/eslint/babel-eslint-plugin/tests/arrow-parens.js +++ b/eslint/babel-eslint-plugin/tests/rules/arrow-parens.js @@ -11,8 +11,8 @@ // Requirements //------------------------------------------------------------------------------ -var rule = require("../rules/arrow-parens"), - RuleTester = require('eslint').RuleTester; +var rule = require("../../rules/arrow-parens"), + RuleTester = require('../RuleTester'); function ok(code, args){ return { code: code, options: args, parser: 'babel-eslint' } diff --git a/eslint/babel-eslint-plugin/tests/flow-object-type.js b/eslint/babel-eslint-plugin/tests/rules/flow-object-type.js similarity index 94% rename from eslint/babel-eslint-plugin/tests/flow-object-type.js rename to eslint/babel-eslint-plugin/tests/rules/flow-object-type.js index f98c63266454..9d34036b0f68 100644 --- a/eslint/babel-eslint-plugin/tests/flow-object-type.js +++ b/eslint/babel-eslint-plugin/tests/rules/flow-object-type.js @@ -5,8 +5,8 @@ "use strict"; -var rule = require("../rules/flow-object-type"), - RuleTester = require('eslint').RuleTester; +var rule = require("../../rules/flow-object-type"), + RuleTester = require('../RuleTester'); var features = { }; diff --git a/eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js rename to eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js index 9fc5c2110f66..a1676e4fc4b1 100644 --- a/eslint/babel-eslint-plugin/tests/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js @@ -1,7 +1,7 @@ 'use strict'; -var rule = require('../rules/func-params-comma-dangle'); -var RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/func-params-comma-dangle'); +var RuleTester = require('../RuleTester'); var MISSING_I = [{message: 'Missing trailing comma.', type: 'Identifier'}]; var MISSING_AP = [{message: 'Missing trailing comma.', type: 'AssignmentPattern'}]; diff --git a/eslint/babel-eslint-plugin/tests/generator-star-spacing.js b/eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/generator-star-spacing.js rename to eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js index cf93add7c9e0..86438a940c7f 100644 --- a/eslint/babel-eslint-plugin/tests/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js @@ -1,6 +1,6 @@ /* eslint-disable */ -var rule = require('../rules/generator-star-spacing'), - RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/generator-star-spacing'), + RuleTester = require('../RuleTester'); var features = { generators: true diff --git a/eslint/babel-eslint-plugin/tests/new-cap.js b/eslint/babel-eslint-plugin/tests/rules/new-cap.js similarity index 98% rename from eslint/babel-eslint-plugin/tests/new-cap.js rename to eslint/babel-eslint-plugin/tests/rules/new-cap.js index b7a9da45a0e1..5fe53cbe3996 100644 --- a/eslint/babel-eslint-plugin/tests/new-cap.js +++ b/eslint/babel-eslint-plugin/tests/rules/new-cap.js @@ -5,8 +5,8 @@ * @author Nicholas C. Zakas */ -var rule = require('../rules/new-cap'), - RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/new-cap'), + RuleTester = require('../RuleTester'); var ruleTester = new RuleTester(); ruleTester.run('babel/new-cap', rule, { diff --git a/eslint/babel-eslint-plugin/tests/no-await-in-loop.js b/eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js similarity index 96% rename from eslint/babel-eslint-plugin/tests/no-await-in-loop.js rename to eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js index ba82e4e78cbb..97de50fdd940 100644 --- a/eslint/babel-eslint-plugin/tests/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js @@ -5,8 +5,8 @@ "use strict"; -var rule = require("../rules/no-await-in-loop"), - RuleTester = require('eslint').RuleTester; +var rule = require("../../rules/no-await-in-loop"), + RuleTester = require('../RuleTester'); var features = { }; diff --git a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/object-curly-spacing.js rename to eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js index 5e70fc5bbcae..44c188fdd0a3 100644 --- a/eslint/babel-eslint-plugin/tests/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js @@ -8,8 +8,8 @@ * @copyright 2015 Mathieu M-Gosselin. All rights reserved. */ -var rule = require('../rules/object-curly-spacing'), - RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/object-curly-spacing'), + RuleTester = require('../RuleTester'); var ruleTester = new RuleTester(); ruleTester.run('babel/object-curly-spacing', rule, { diff --git a/eslint/babel-eslint-plugin/tests/object-shorthand.js b/eslint/babel-eslint-plugin/tests/rules/object-shorthand.js similarity index 98% rename from eslint/babel-eslint-plugin/tests/object-shorthand.js rename to eslint/babel-eslint-plugin/tests/rules/object-shorthand.js index 0dfe5fb51c39..c35c086b51a1 100644 --- a/eslint/babel-eslint-plugin/tests/object-shorthand.js +++ b/eslint/babel-eslint-plugin/tests/rules/object-shorthand.js @@ -1,6 +1,6 @@ /* eslint-disable */ -var rule = require('../rules/object-shorthand'), - RuleTester = require('eslint').RuleTester; +var rule = require('../../rules/object-shorthand'), + RuleTester = require('../RuleTester'); var features = { objectLiteralShorthandMethods: true, From 57b06a504aeedb40113dc8a2b3298ac29bcafbd1 Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Fri, 1 Jul 2016 21:27:59 +0200 Subject: [PATCH 729/965] chore(package): update eslint to version 3.0.0 (babel/eslint-plugin-babel#70) https://greenkeeper.io/ --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index fe4173229ddd..0e2b1ff0d446 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "babel-eslint": "^6.1.0", - "eslint": "^2.13.1", + "eslint": "^3.0.0", "mocha": "^2.2.5" } } From 831a217d006c9cfb6acda091ced26ccc4f7c0f95 Mon Sep 17 00:00:00 2001 From: Greenkeeper Date: Thu, 22 Sep 2016 10:27:31 +0200 Subject: [PATCH 730/965] chore(package): update mocha to version 3.0.0 (babel/eslint-plugin-babel#79) https://greenkeeper.io/ --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 0e2b1ff0d446..80cc7a38e0f7 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -29,6 +29,6 @@ "devDependencies": { "babel-eslint": "^6.1.0", "eslint": "^3.0.0", - "mocha": "^2.2.5" + "mocha": "^3.0.0" } } From 2b52d67ebcba973ce7452cf1815a897993d57fdc Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Wed, 2 Nov 2016 14:38:46 -0400 Subject: [PATCH 731/965] Merge pull request babel/eslint-plugin-babel#101 from mathieumg/no-invalid-this Added `babel/no-invalid-this` --- eslint/babel-eslint-plugin/README.md | 4 +- eslint/babel-eslint-plugin/ast-utils.js | 727 ++++++++++++++++++ eslint/babel-eslint-plugin/index.js | 2 + eslint/babel-eslint-plugin/package.json | 1 + .../rules/no-invalid-this.js | 143 ++++ .../tests/rules/no-invalid-this.js | 609 +++++++++++++++ 6 files changed, 1485 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/ast-utils.js create mode 100644 eslint/babel-eslint-plugin/rules/no-invalid-this.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 419cafa07c22..171a4083fa5c 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -34,7 +34,8 @@ original ones as well!). "babel/arrow-parens": 1, "babel/no-await-in-loop": 1, "babel/flow-object-type": 1, - "babel/func-params-comma-dangle": 1 + "babel/func-params-comma-dangle": 1, + "babel/no-invalid-this": 1 } } ``` @@ -50,6 +51,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠 ) - `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) - `babel/arrow-parens`: Handles async functions correctly (🛠 ) +- `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) The following rules are not in `eslint`, but are relevant only to syntax that is not specified by the current JavaScript standard or supported by `eslint`. diff --git a/eslint/babel-eslint-plugin/ast-utils.js b/eslint/babel-eslint-plugin/ast-utils.js new file mode 100644 index 000000000000..9f0d91f7edbb --- /dev/null +++ b/eslint/babel-eslint-plugin/ast-utils.js @@ -0,0 +1,727 @@ +/** + * @fileoverview Common utils for AST. + * @author Gyandeep Singh + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/; +const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/; +const arrayOrTypedArrayPattern = /Array$/; +const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/; +const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/; +const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/; +const thisTagPattern = /^[\s\*]*@this/m; + +/** + * Checks reference if is non initializer and writable. + * @param {Reference} reference - A reference to check. + * @param {int} index - The index of the reference in the references. + * @param {Reference[]} references - The array that the reference belongs to. + * @returns {boolean} Success/Failure + * @private + */ +function isModifyingReference(reference, index, references) { + const identifier = reference.identifier; + + /* + * Destructuring assignments can have multiple default value, so + * possibly there are multiple writeable references for the same + * identifier. + */ + const modifyingDifferentIdentifier = index === 0 || + references[index - 1].identifier !== identifier; + + return (identifier && + reference.init === false && + reference.isWrite() && + modifyingDifferentIdentifier + ); +} + +/** + * Checks whether the given string starts with uppercase or not. + * + * @param {string} s - The string to check. + * @returns {boolean} `true` if the string starts with uppercase. + */ +function startsWithUpperCase(s) { + return s[0] !== s[0].toLocaleLowerCase(); +} + +/** + * Checks whether or not a node is a constructor. + * @param {ASTNode} node - A function node to check. + * @returns {boolean} Wehether or not a node is a constructor. + */ +function isES5Constructor(node) { + return (node.id && startsWithUpperCase(node.id.name)); +} + +/** + * Finds a function node from ancestors of a node. + * @param {ASTNode} node - A start node to find. + * @returns {Node|null} A found function node. + */ +function getUpperFunction(node) { + while (node) { + if (anyFunctionPattern.test(node.type)) { + return node; + } + node = node.parent; + } + return null; +} + +/** + * Checks whether or not a node is `null` or `undefined`. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a `null` or `undefined`. + * @public + */ +function isNullOrUndefined(node) { + return ( + (node.type === "Literal" && node.value === null) || + (node.type === "Identifier" && node.name === "undefined") || + (node.type === "UnaryExpression" && node.operator === "void") + ); +} + +/** + * Checks whether or not a node is callee. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is callee. + */ +function isCallee(node) { + return node.parent.type === "CallExpression" && node.parent.callee === node; +} + +/** + * Checks whether or not a node is `Reclect.apply`. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a `Reclect.apply`. + */ +function isReflectApply(node) { + return ( + node.type === "MemberExpression" && + node.object.type === "Identifier" && + node.object.name === "Reflect" && + node.property.type === "Identifier" && + node.property.name === "apply" && + node.computed === false + ); +} + +/** + * Checks whether or not a node is `Array.from`. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a `Array.from`. + */ +function isArrayFromMethod(node) { + return ( + node.type === "MemberExpression" && + node.object.type === "Identifier" && + arrayOrTypedArrayPattern.test(node.object.name) && + node.property.type === "Identifier" && + node.property.name === "from" && + node.computed === false + ); +} + +/** + * Checks whether or not a node is a method which has `thisArg`. + * @param {ASTNode} node - A node to check. + * @returns {boolean} Whether or not the node is a method which has `thisArg`. + */ +function isMethodWhichHasThisArg(node) { + while (node) { + if (node.type === "Identifier") { + return arrayMethodPattern.test(node.name); + } + if (node.type === "MemberExpression" && !node.computed) { + node = node.property; + continue; + } + + break; + } + + return false; +} + +/** + * Checks whether or not a node has a `@this` tag in its comments. + * @param {ASTNode} node - A node to check. + * @param {SourceCode} sourceCode - A SourceCode instance to get comments. + * @returns {boolean} Whether or not the node has a `@this` tag in its comments. + */ +function hasJSDocThisTag(node, sourceCode) { + const jsdocComment = sourceCode.getJSDocComment(node); + + if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { + return true; + } + + // Checks `@this` in its leading comments for callbacks, + // because callbacks don't have its JSDoc comment. + // e.g. + // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); + return sourceCode.getComments(node).leading.some(function(comment) { + return thisTagPattern.test(comment.value); + }); +} + +/** + * Determines if a node is surrounded by parentheses. + * @param {SourceCode} sourceCode The ESLint source code object + * @param {ASTNode} node The node to be checked. + * @returns {boolean} True if the node is parenthesised. + * @private + */ +function isParenthesised(sourceCode, node) { + const previousToken = sourceCode.getTokenBefore(node), + nextToken = sourceCode.getTokenAfter(node); + + return Boolean(previousToken && nextToken) && + previousToken.value === "(" && previousToken.range[1] <= node.range[0] && + nextToken.value === ")" && nextToken.range[0] >= node.range[1]; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + /** + * Determines whether two adjacent tokens are on the same line. + * @param {Object} left - The left token object. + * @param {Object} right - The right token object. + * @returns {boolean} Whether or not the tokens are on the same line. + * @public + */ + isTokenOnSameLine(left, right) { + return left.loc.end.line === right.loc.start.line; + }, + + isNullOrUndefined, + isCallee, + isES5Constructor, + getUpperFunction, + isArrayFromMethod, + isParenthesised, + + /** + * Checks whether or not a given node is a string literal. + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is a string literal. + */ + isStringLiteral(node) { + return ( + (node.type === "Literal" && typeof node.value === "string") || + node.type === "TemplateLiteral" + ); + }, + + /** + * Checks whether a given node is a breakable statement or not. + * The node is breakable if the node is one of the following type: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - SwitchStatement + * - WhileStatement + * + * @param {ASTNode} node - A node to check. + * @returns {boolean} `true` if the node is breakable. + */ + isBreakableStatement(node) { + return breakableTypePattern.test(node.type); + }, + + /** + * Gets the label if the parent node of a given node is a LabeledStatement. + * + * @param {ASTNode} node - A node to get. + * @returns {string|null} The label or `null`. + */ + getLabel(node) { + if (node.parent.type === "LabeledStatement") { + return node.parent.label.name; + } + return null; + }, + + /** + * Gets references which are non initializer and writable. + * @param {Reference[]} references - An array of references. + * @returns {Reference[]} An array of only references which are non initializer and writable. + * @public + */ + getModifyingReferences(references) { + return references.filter(isModifyingReference); + }, + + /** + * Validate that a string passed in is surrounded by the specified character + * @param {string} val The text to check. + * @param {string} character The character to see if it's surrounded by. + * @returns {boolean} True if the text is surrounded by the character, false if not. + * @private + */ + isSurroundedBy(val, character) { + return val[0] === character && val[val.length - 1] === character; + }, + + /** + * Returns whether the provided node is an ESLint directive comment or not + * @param {LineComment|BlockComment} node The node to be checked + * @returns {boolean} `true` if the node is an ESLint directive comment + */ + isDirectiveComment(node) { + const comment = node.value.trim(); + + return ( + node.type === "Line" && comment.indexOf("eslint-") === 0 || + node.type === "Block" && ( + comment.indexOf("global ") === 0 || + comment.indexOf("eslint ") === 0 || + comment.indexOf("eslint-") === 0 + ) + ); + }, + + /** + * Finds the variable by a given name in a given scope and its upper scopes. + * + * @param {escope.Scope} initScope - A scope to start find. + * @param {string} name - A variable name to find. + * @returns {escope.Variable|null} A found variable or `null`. + */ + getVariableByName(initScope, name) { + let scope = initScope; + + while (scope) { + const variable = scope.set.get(name); + + if (variable) { + return variable; + } + + scope = scope.upper; + } + + return null; + }, + + /** + * Checks whether or not a given function node is the default `this` binding. + * + * First, this checks the node: + * + * - The function name does not start with uppercase (it's a constructor). + * - The function does not have a JSDoc comment that has a @this tag. + * + * Next, this checks the location of the node. + * If the location is below, this judges `this` is valid. + * + * - The location is not on an object literal. + * - The location is not assigned to a variable which starts with an uppercase letter. + * - The location is not on an ES2015 class. + * - Its `bind`/`call`/`apply` method is not called directly. + * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. + * + * @param {ASTNode} node - A function node to check. + * @param {SourceCode} sourceCode - A SourceCode instance to get comments. + * @returns {boolean} The function node is the default `this` binding. + */ + isDefaultThisBinding(node, sourceCode) { + if (isES5Constructor(node) || hasJSDocThisTag(node, sourceCode)) { + return false; + } + const isAnonymous = node.id === null; + + while (node) { + const parent = node.parent; + + switch (parent.type) { + + /* + * Looks up the destination. + * e.g., obj.foo = nativeFoo || function foo() { ... }; + */ + case "LogicalExpression": + case "ConditionalExpression": + node = parent; + break; + + // If the upper function is IIFE, checks the destination of the return value. + // e.g. + // obj.foo = (function() { + // // setup... + // return function foo() { ... }; + // })(); + case "ReturnStatement": { + const func = getUpperFunction(parent); + + if (func === null || !isCallee(func)) { + return true; + } + node = func.parent; + break; + } + + // e.g. + // var obj = { foo() { ... } }; + // var obj = { foo: function() { ... } }; + // class A { constructor() { ... } } + // class A { foo() { ... } } + // class A { get foo() { ... } } + // class A { set foo() { ... } } + // class A { static foo() { ... } } + case "Property": + case "MethodDefinition": + return parent.value !== node; + + // e.g. + // obj.foo = function foo() { ... }; + // Foo = function() { ... }; + // [obj.foo = function foo() { ... }] = a; + // [Foo = function() { ... }] = a; + case "AssignmentExpression": + case "AssignmentPattern": + if (parent.right === node) { + if (parent.left.type === "MemberExpression") { + return false; + } + if (isAnonymous && + parent.left.type === "Identifier" && + startsWithUpperCase(parent.left.name) + ) { + return false; + } + } + return true; + + // e.g. + // var Foo = function() { ... }; + case "VariableDeclarator": + return !( + isAnonymous && + parent.init === node && + parent.id.type === "Identifier" && + startsWithUpperCase(parent.id.name) + ); + + // e.g. + // var foo = function foo() { ... }.bind(obj); + // (function foo() { ... }).call(obj); + // (function foo() { ... }).apply(obj, []); + case "MemberExpression": + return ( + parent.object !== node || + parent.property.type !== "Identifier" || + !bindOrCallOrApplyPattern.test(parent.property.name) || + !isCallee(parent) || + parent.parent.arguments.length === 0 || + isNullOrUndefined(parent.parent.arguments[0]) + ); + + // e.g. + // Reflect.apply(function() {}, obj, []); + // Array.from([], function() {}, obj); + // list.forEach(function() {}, obj); + case "CallExpression": + if (isReflectApply(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[0] !== node || + isNullOrUndefined(parent.arguments[1]) + ); + } + if (isArrayFromMethod(parent.callee)) { + return ( + parent.arguments.length !== 3 || + parent.arguments[1] !== node || + isNullOrUndefined(parent.arguments[2]) + ); + } + if (isMethodWhichHasThisArg(parent.callee)) { + return ( + parent.arguments.length !== 2 || + parent.arguments[0] !== node || + isNullOrUndefined(parent.arguments[1]) + ); + } + return true; + + // Otherwise `this` is default. + default: + return true; + } + } + + /* istanbul ignore next */ + return true; + }, + + /** + * Get the precedence level based on the node type + * @param {ASTNode} node node to evaluate + * @returns {int} precedence level + * @private + */ + getPrecedence(node) { + switch (node.type) { + case "SequenceExpression": + return 0; + + case "AssignmentExpression": + case "ArrowFunctionExpression": + case "YieldExpression": + return 1; + + case "ConditionalExpression": + return 3; + + case "LogicalExpression": + switch (node.operator) { + case "||": + return 4; + case "&&": + return 5; + + // no default + } + + /* falls through */ + + case "BinaryExpression": + + switch (node.operator) { + case "|": + return 6; + case "^": + return 7; + case "&": + return 8; + case "==": + case "!=": + case "===": + case "!==": + return 9; + case "<": + case "<=": + case ">": + case ">=": + case "in": + case "instanceof": + return 10; + case "<<": + case ">>": + case ">>>": + return 11; + case "+": + case "-": + return 12; + case "*": + case "/": + case "%": + return 13; + + // no default + } + + /* falls through */ + + case "UnaryExpression": + case "AwaitExpression": + return 14; + + case "UpdateExpression": + return 15; + + case "CallExpression": + + // IIFE is allowed to have parens in any position (#655) + if (node.callee.type === "FunctionExpression") { + return -1; + } + return 16; + + case "NewExpression": + return 17; + + // no default + } + return 18; + }, + + /** + * Checks whether a given node is a loop node or not. + * The following types are loop nodes: + * + * - DoWhileStatement + * - ForInStatement + * - ForOfStatement + * - ForStatement + * - WhileStatement + * + * @param {ASTNode|null} node - A node to check. + * @returns {boolean} `true` if the node is a loop node. + */ + isLoop(node) { + return Boolean(node && anyLoopPattern.test(node.type)); + }, + + /** + * Checks whether a given node is a function node or not. + * The following types are function nodes: + * + * - ArrowFunctionExpression + * - FunctionDeclaration + * - FunctionExpression + * + * @param {ASTNode|null} node - A node to check. + * @returns {boolean} `true` if the node is a function node. + */ + isFunction(node) { + return Boolean(node && anyFunctionPattern.test(node.type)); + }, + + /** + * Gets the property name of a given node. + * The node can be a MemberExpression, a Property, or a MethodDefinition. + * + * If the name is dynamic, this returns `null`. + * + * For examples: + * + * a.b // => "b" + * a["b"] // => "b" + * a['b'] // => "b" + * a[`b`] // => "b" + * a[100] // => "100" + * a[b] // => null + * a["a" + "b"] // => null + * a[tag`b`] // => null + * a[`${b}`] // => null + * + * let a = {b: 1} // => "b" + * let a = {["b"]: 1} // => "b" + * let a = {['b']: 1} // => "b" + * let a = {[`b`]: 1} // => "b" + * let a = {[100]: 1} // => "100" + * let a = {[b]: 1} // => null + * let a = {["a" + "b"]: 1} // => null + * let a = {[tag`b`]: 1} // => null + * let a = {[`${b}`]: 1} // => null + * + * @param {ASTNode} node - The node to get. + * @returns {string|null} The property name if static. Otherwise, null. + */ + getStaticPropertyName(node) { + let prop; + + switch (node && node.type) { + case "Property": + case "MethodDefinition": + prop = node.key; + break; + + case "MemberExpression": + prop = node.property; + break; + + // no default + } + + switch (prop && prop.type) { + case "Literal": + return String(prop.value); + + case "TemplateLiteral": + if (prop.expressions.length === 0 && prop.quasis.length === 1) { + return prop.quasis[0].value.cooked; + } + break; + + case "Identifier": + if (!node.computed) { + return prop.name; + } + break; + + // no default + } + + return null; + }, + + /** + * Get directives from directive prologue of a Program or Function node. + * @param {ASTNode} node - The node to check. + * @returns {ASTNode[]} The directives found in the directive prologue. + */ + getDirectivePrologue(node) { + const directives = []; + + // Directive prologues only occur at the top of files or functions. + if ( + node.type === "Program" || + node.type === "FunctionDeclaration" || + node.type === "FunctionExpression" || + + // Do not check arrow functions with implicit return. + // `() => "use strict";` returns the string `"use strict"`. + (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") + ) { + const statements = node.type === "Program" ? node.body : node.body.body; + + for (const statement of statements) { + if ( + statement.type === "ExpressionStatement" && + statement.expression.type === "Literal" + ) { + directives.push(statement); + } else { + break; + } + } + } + + return directives; + }, + + + /** + * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added + after the node will be parsed as a decimal point, rather than a property-access dot. + * @param {ASTNode} node - The node to check. + * @returns {boolean} `true` if this node is a decimal integer. + * @example + * + * 5 // true + * 5. // false + * 5.0 // false + * 05 // false + * 0x5 // false + * 0b101 // false + * 0o5 // false + * 5e0 // false + * '5' // false + */ + isDecimalInteger(node) { + return node.type === "Literal" && typeof node.value === "number" && /^(0|[1-9]\d*)$/.test(node.raw); + } +}; diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 3656458f0b3a..efba7b74eb37 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -11,6 +11,7 @@ module.exports = { 'no-await-in-loop': require('./rules/no-await-in-loop'), 'flow-object-type': require('./rules/flow-object-type'), 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), + 'no-invalid-this': require('./rules/no-invalid-this'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -22,5 +23,6 @@ module.exports = { 'no-await-in-loop': 0, 'flow-object-type': 0, 'func-params-comma-dangle': 0, + 'no-invalid-this': 0, } }; diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 80cc7a38e0f7..69228e6099ff 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -29,6 +29,7 @@ "devDependencies": { "babel-eslint": "^6.1.0", "eslint": "^3.0.0", + "lodash.clonedeep": "^4.5.0", "mocha": "^3.0.0" } } diff --git a/eslint/babel-eslint-plugin/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/rules/no-invalid-this.js new file mode 100644 index 000000000000..a8478a852f5b --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/no-invalid-this.js @@ -0,0 +1,143 @@ +/** + * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const astUtils = require("../ast-utils"); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + docs: { + description: "disallow `this` keywords outside of classes or class-like objects", + category: "Best Practices", + recommended: false + }, + + schema: [] + }, + + create(context) { + const stack = [], + sourceCode = context.getSourceCode(); + + let insideClassProperty = false; + + /** + * Gets the current checking context. + * + * The return value has a flag that whether or not `this` keyword is valid. + * The flag is initialized when got at the first time. + * + * @returns {{valid: boolean}} + * an object which has a flag that whether or not `this` keyword is valid. + */ + stack.getCurrent = function() { + const current = this[this.length - 1]; + + if (!current.init) { + current.init = true; + current.valid = !astUtils.isDefaultThisBinding( + current.node, + sourceCode); + } + return current; + }; + + /** + * `this` should be fair game anywhere inside a class property. + * + * @returns {void} + */ + function enterClassProperty() { + insideClassProperty = true; + } + + /** + * Back to the normal check. + * @returns {void} + */ + function exitClassProperty() { + insideClassProperty = false; + } + + /** + * Pushs new checking context into the stack. + * + * The checking context is not initialized yet. + * Because most functions don't have `this` keyword. + * When `this` keyword was found, the checking context is initialized. + * + * @param {ASTNode} node - A function node that was entered. + * @returns {void} + */ + function enterFunction(node) { + + // `this` can be invalid only under strict mode. + stack.push({ + init: !context.getScope().isStrict, + node, + valid: true + }); + } + + /** + * Pops the current checking context from the stack. + * @returns {void} + */ + function exitFunction() { + stack.pop(); + } + + return { + + /* + * `this` is invalid only under strict mode. + * Modules is always strict mode. + */ + Program(node) { + const scope = context.getScope(), + features = context.parserOptions.ecmaFeatures || {}; + + stack.push({ + init: true, + node, + valid: !( + scope.isStrict || + node.sourceType === "module" || + (features.globalReturn && scope.childScopes[0].isStrict) + ) + }); + }, + + "Program:exit"() { + stack.pop(); + }, + + ClassProperty: enterClassProperty, + "ClassProperty:exit": exitClassProperty, + FunctionDeclaration: enterFunction, + "FunctionDeclaration:exit": exitFunction, + FunctionExpression: enterFunction, + "FunctionExpression:exit": exitFunction, + + // Reports if `this` of the current context is invalid. + ThisExpression(node) { + const current = stack.getCurrent(); + + if (!insideClassProperty && current && !current.valid) { + context.report(node, "Unexpected 'this'."); + } + } + }; + } +}; diff --git a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js new file mode 100644 index 000000000000..5e1c67c8b8ae --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js @@ -0,0 +1,609 @@ +/** + * @fileoverview Tests for no-invalid-this rule. + * @author Toru Nagashima + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const cloneDeep = require("lodash.clonedeep"); +const rule = require("../../rules/no-invalid-this"); +const RuleTester = require("../RuleTester"); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * A constant value for non strict mode environment. + * @returns {void} + */ +function NORMAL(pattern) { + pattern.parserOptions.sourceType = "script"; +} + +/** + * A constant value for strict mode environment. + * This modifies pattern object to make strict mode. + * @param {Object} pattern - A pattern object to modify. + * @returns {void} + */ +function USE_STRICT(pattern) { + pattern.code = "\"use strict\"; " + pattern.code; +} + +/** + * A constant value for implied strict mode. + * This modifies pattern object to impose strict mode. + * @param {Object} pattern - A pattern object to modify. + * @returns {void} + */ +function IMPLIED_STRICT(pattern) { + pattern.code = "/* implied strict mode */ " + pattern.code; + pattern.parserOptions.ecmaFeatures = pattern.parserOptions.ecmaFeatures || {}; + pattern.parserOptions.ecmaFeatures.impliedStrict = true; +} + +/** + * A constant value for modules environment. + * This modifies pattern object to make modules. + * @param {Object} pattern - A pattern object to modify. + * @returns {void} + */ +function MODULES(pattern) { + pattern.code = "/* modules */ " + pattern.code; +} + +/** + * Extracts patterns each condition for a specified type. The type is `valid` or `invalid`. + * @param {Object[]} patterns - Original patterns. + * @param {string} type - One of `"valid"` or `"invalid"`. + * @returns {Object[]} Test patterns. + */ +function extractPatterns(patterns, type) { + + // Clone and apply the pattern environment. + const patternsList = patterns.map(function(pattern) { + return pattern[type].map(function(applyCondition) { + const thisPattern = cloneDeep(pattern); + + applyCondition(thisPattern); + + if (type === "valid") { + thisPattern.errors = []; + } else { + thisPattern.code += " /* should error */"; + } + + return thisPattern; + }); + }); + + // Flatten. + return Array.prototype.concat.apply([], patternsList); +} + + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const errors = [ + {message: "Unexpected 'this'.", type: "ThisExpression"}, + {message: "Unexpected 'this'.", type: "ThisExpression"} +]; + +const patterns = [ + + // Global. + { + code: "console.log(this); z(x => console.log(x, this));", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "console.log(this); z(x => console.log(x, this));", + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: {globalReturn: true} + }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // IIFE. + { + code: "(function() { console.log(this); z(x => console.log(x, this)); })();", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // Just functions. + { + code: "function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "function foo() { \"use strict\"; console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "return function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: {globalReturn: true} + }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT] // modules cannot return on global. + }, + { + code: "var foo = (function() { console.log(this); z(x => console.log(x, this)); }).bar(obj);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // Functions in methods. + { + code: "var obj = {foo: function() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "var obj = {foo() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "var obj = {foo: function() { return function() { console.log(this); z(x => console.log(x, this)); }; }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "var obj = {foo: function() { \"use strict\"; return function() { console.log(this); z(x => console.log(x, this)); }; }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "obj.foo = function() { return function() { console.log(this); z(x => console.log(x, this)); }; };", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "obj.foo = function() { \"use strict\"; return function() { console.log(this); z(x => console.log(x, this)); }; };", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "class A { foo() { return function() { console.log(this); z(x => console.log(x, this)); }; } }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // Class Static methods. + { + code: "class A {static foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // Constructors. + { + code: "function Foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var Foo = function Foo() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "class A {constructor() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // On a property. + { + code: "var obj = {foo: function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var obj = {foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var obj = {foo: foo || function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var obj = {foo: hasNative ? foo : function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var obj = {foo: (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })()};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "Object.defineProperty(obj, \"foo\", {value: function() { console.log(this); z(x => console.log(x, this)); }})", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "Object.defineProperties(obj, {foo: {value: function() { console.log(this); z(x => console.log(x, this)); }}})", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // Assigns to a property. + { + code: "obj.foo = function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "obj.foo = foo || function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "obj.foo = foo ? bar : function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "obj.foo = (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })();", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // Class Instance Methods. + { + code: "class A {foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // Bind/Call/Apply + { + code: "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(null);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "(function() { console.log(this); z(x => console.log(x, this)); }).call(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "(function() { console.log(this); z(x => console.log(x, this)); }).call(undefined);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "(function() { console.log(this); z(x => console.log(x, this)); }).apply(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "(function() { console.log(this); z(x => console.log(x, this)); }).apply(void 0);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "Reflect.apply(function() { console.log(this); z(x => console.log(x, this)); }, obj, []);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // Array methods. + { + code: "Array.from([], function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.every(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.filter(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.find(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.map(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo.some(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "Array.from([], function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.every(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.filter(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.find(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.map(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.some(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, null);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // @this tag. + { + code: "/** @this Obj */ function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "/**\n * @returns {void}\n * @this Obj\n */\nfunction foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "/** @returns {void} */ function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "/** @this Obj */ foo(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "foo(/* @this Obj */ function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // https://github.com/eslint/eslint/issues/3254 + { + code: "function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // https://github.com/eslint/eslint/issues/3287 + { + code: "function foo() { /** @this Obj*/ return function bar() { console.log(this); z(x => console.log(x, this)); }; }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + // https://github.com/eslint/eslint/issues/6824 + { + code: "var Ctor = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "var func = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "Ctor = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "func = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "function foo(Ctor = function() { console.log(this); z(x => console.log(x, this)); }) {}", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "function foo(func = function() { console.log(this); z(x => console.log(x, this)); }) {}", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + { + code: "[obj.method = function() { console.log(this); z(x => console.log(x, this)); }] = a", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + { + code: "[func = function() { console.log(this); z(x => console.log(x, this)); }] = a", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] + }, + + // babel/no-invalid-this + + // Class Instance Properties. + { + code: "class A {a = this.b;};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + { + code: "class A {a = () => {return this.b;};};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, +]; + +const ruleTester = new RuleTester(); + +ruleTester.run("no-invalid-this", rule, { + valid: extractPatterns(patterns, "valid"), + invalid: extractPatterns(patterns, "invalid") +}); From c7d8d991a8024edf819969310077e9a01ff12077 Mon Sep 17 00:00:00 2001 From: Plusb Preco Date: Fri, 18 Nov 2016 05:21:46 +0900 Subject: [PATCH 732/965] Drop support of Node < 4 (babel/eslint-plugin-babel#113) * Drop support Node < 4 * Add missing changes * Update `.travis.yml` --- eslint/babel-eslint-plugin/.travis.yml | 2 -- eslint/babel-eslint-plugin/package.json | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml index 2d156dd6d5e0..a3fd2dd36664 100644 --- a/eslint/babel-eslint-plugin/.travis.yml +++ b/eslint/babel-eslint-plugin/.travis.yml @@ -4,8 +4,6 @@ git: sudo: false language: node_js node_js: - - '0.10' - - '0.12' - '4' - '5' - '6' diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 69228e6099ff..8950f6bf05e8 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -19,12 +19,15 @@ ], "author": "Jason Quense @monasticpanic", "license": "MIT", + "engines": { + "node": ">=4" + }, "bugs": { "url": "https://github.com/babel/eslint-plugin-babel/issues" }, "homepage": "https://github.com/babel/eslint-plugin-babel#readme", "peerDependencies": { - "eslint": ">=1.0.0" + "eslint": ">=3.0.0" }, "devDependencies": { "babel-eslint": "^6.1.0", From 5b5f8e32a0418982e1c930780fbfebcd087d3a51 Mon Sep 17 00:00:00 2001 From: Mathieu M-Gosselin Date: Thu, 17 Nov 2016 15:23:23 -0500 Subject: [PATCH 733/965] Updated Node versions to test against in the Travis configuration. (babel/eslint-plugin-babel#110) --- eslint/babel-eslint-plugin/.travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml index a3fd2dd36664..6dbd2e233605 100644 --- a/eslint/babel-eslint-plugin/.travis.yml +++ b/eslint/babel-eslint-plugin/.travis.yml @@ -5,5 +5,5 @@ sudo: false language: node_js node_js: - '4' - - '5' - '6' + - '7' From 48010c551bf50db3c9e5513dbc9bbcbad82376d8 Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Thu, 17 Nov 2016 15:23:38 -0500 Subject: [PATCH 734/965] chore(package): update dependencies (babel/eslint-plugin-babel#109) https://greenkeeper.io/ --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 8950f6bf05e8..f372bd09cf1c 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -30,7 +30,7 @@ "eslint": ">=3.0.0" }, "devDependencies": { - "babel-eslint": "^6.1.0", + "babel-eslint": "^7.1.0", "eslint": "^3.0.0", "lodash.clonedeep": "^4.5.0", "mocha": "^3.0.0" From d38551cc23292f30cef5d61c6eef95510205684f Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 16:39:04 -0500 Subject: [PATCH 735/965] Breaking: Deprecate built-in rules (babel/eslint-plugin-babel#115) * Deprecate built-in rules * fix update to babel-eslint 7 with awaitexpression * deprecate flow-object-type --- eslint/babel-eslint-plugin/README.md | 22 +- .../rules/array-bracket-spacing.js | 205 +-- .../babel-eslint-plugin/rules/arrow-parens.js | 70 +- .../rules/flow-object-type.js | 57 +- .../rules/func-params-comma-dangle.js | 139 +- .../rules/generator-star-spacing.js | 97 +- .../rules/no-await-in-loop.js | 74 +- .../rules/object-shorthand.js | 82 +- .../tests/rules/array-bracket-spacing.js | 733 ---------- .../tests/rules/arrow-parens.js | 187 --- .../tests/rules/flow-object-type.js | 69 - .../tests/rules/func-params-comma-dangle.js | 278 ---- .../tests/rules/generator-star-spacing.js | 1176 ----------------- .../tests/rules/object-shorthand.js | 108 -- 14 files changed, 122 insertions(+), 3175 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js delete mode 100644 eslint/babel-eslint-plugin/tests/rules/arrow-parens.js delete mode 100644 eslint/babel-eslint-plugin/tests/rules/flow-object-type.js delete mode 100644 eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js delete mode 100644 eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js delete mode 100644 eslint/babel-eslint-plugin/tests/rules/object-shorthand.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 171a4083fa5c..5a84afbabe8f 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -26,15 +26,10 @@ original ones as well!). ```json { "rules": { - "babel/generator-star-spacing": 1, "babel/new-cap": 1, - "babel/array-bracket-spacing": 1, "babel/object-curly-spacing": 1, - "babel/object-shorthand": 1, - "babel/arrow-parens": 1, "babel/no-await-in-loop": 1, "babel/flow-object-type": 1, - "babel/func-params-comma-dangle": 1, "babel/no-invalid-this": 1 } } @@ -45,19 +40,20 @@ Each rule corresponds to a core `eslint` rule, and has the same options. 🛠 : means it's autofixable with `--fix`. -- `babel/generator-star-spacing`: Handles async/await functions correctly - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/array-bracket-spacing`: Handles destructuring arrays with flow type in function parameters (🛠 ) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠 ) -- `babel/object-shorthand`: doesn't fail when using object spread (`...obj`) -- `babel/arrow-parens`: Handles async functions correctly (🛠 ) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) The following rules are not in `eslint`, but are relevant only to syntax that is not specified by the current JavaScript standard or supported by `eslint`. - `babel/no-await-in-loop`: guard against awaiting async functions inside of a loop -- `babel/flow-object-type`: Require a particular separator between properties in Flow object types. (🛠 ) - - Use the option `semicolon` to require semicolons (e.g. `type Foo = { bar: number; baz: string }`). - - Use the option `comma` to require commas (e.g. `type Foo = { bar: number, baz: string }`). -- `babel/func-params-comma-dangle`: Require or forbid trailing commas for function paramater lists. Behaves like, and takes the same options as, `eslint`'s [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle). (🛠 ) + +#### Deprecated + +- `babel/generator-star-spacing`: Use [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing). +- `babel/object-shorthand`: Use [`object-shorthand`](http://eslint.org/docs/rules/object-shorthand). +- `babel/arrow-parens`: Use [`arrow-parens`](http://eslint.org/docs/rules/arrow-parens). +- `babel/func-params-comma-dangle`: Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle). +- `babel/array-bracket-spacing`: Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing). +- `babel/flow-object-type`: Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter). diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js index b67fbe92fbce..a7da50b78573 100644 --- a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js @@ -1,203 +1,20 @@ -/** - * @fileoverview Disallows or enforces spaces inside of array brackets. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - */ "use strict"; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - singleElementException: isOptionSet("singleValue"), - objectsInArraysException: isOptionSet("objectsInArrays"), - arraysInArraysException: isOptionSet("arraysInArrays") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space after '" + token.value + "'", - fix: function(fixer) { - var nextToken = sourceCode.getTokenAfter(token); - return fixer.removeRange([token.range[1], nextToken.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space before '" + token.value + "'", - fix: function(fixer) { - var previousToken = sourceCode.getTokenBefore(token); - return fixer.removeRange([previousToken.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required after '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextAfter(token, " "); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required before '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextBefore(token, " "); - } - }); - } - - /** - * Determines if a node is an object type - * @param {ASTNode} node - The node to check. - * @returns {boolean} Whether or not the node is an object type. - */ - function isObjectType(node) { - return node && (node.type === "ObjectExpression" || node.type === "ObjectPattern"); - } - - /** - * Determines if a node is an array type - * @param {ASTNode} node - The node to check. - * @returns {boolean} Whether or not the node is an array type. - */ - function isArrayType(node) { - return node && (node.type === "ArrayExpression" || node.type === "ArrayPattern"); - } - - /** - * Validates the spacing around array brackets - * @param {ASTNode} node - The node we're checking for spacing - * @returns {void} - */ - function validateArraySpacing(node) { - if (options.spaced && node.elements.length === 0) { - return; - } - - var first = sourceCode.getFirstToken(node), - second = sourceCode.getFirstToken(node, 1), - last = sourceCode.getLastToken(node), - firstElement = node.elements[0], - lastElement = node.elements[node.elements.length - 1]; - - while (last.type !== "Punctuation" && last.value !== "]") { - last = sourceCode.getTokenBefore(last); - } - - var penultimate = sourceCode.getTokenBefore(last); - - var openingBracketMustBeSpaced = - options.objectsInArraysException && isObjectType(firstElement) || - options.arraysInArraysException && isArrayType(firstElement) || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - var closingBracketMustBeSpaced = - options.objectsInArraysException && isObjectType(lastElement) || - options.arraysInArraysException && isArrayType(lastElement) || - options.singleElementException && node.elements.length === 1 - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (openingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!openingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(first, second)) { - reportNoBeginningSpace(node, first); +var isWarnedForDeprecation = false; +module.exports = function() { + return { + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; } - } - if (first !== penultimate && isSameLine(penultimate, last)) { - if (closingBracketMustBeSpaced && !sourceCode.isSpaceBetweenTokens(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingBracketMustBeSpaced && sourceCode.isSpaceBetweenTokens(penultimate, last)) { - reportNoEndingSpace(node, last); - } + /* eslint-disable no-console */ + console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + + 'use the built in array-bracket-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; } - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - ArrayPattern: validateArraySpacing, - ArrayExpression: validateArraySpacing }; - }; module.exports.schema = [ diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index 6ca3ffc776bf..03f50dcfd07c 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -1,67 +1,19 @@ -/** - * @fileoverview Rule to require parens in arrow function arguments. - * @author Jxck - * @copyright 2015 Jxck. All rights reserved. - */ "use strict"; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var message = "Expected parentheses around arrow function argument."; - var asNeededMessage = "Unexpected parentheses around single function argument"; - var asNeeded = context.options[0] === "as-needed"; - - /** - * Determines whether a arrow function argument end with `)` - * @param {ASTNode} node The arrow function node. - * @returns {void} - */ - function parens(node) { - var token = context.getFirstToken(node); - if (node.async) token = context.getTokenAfter(token); - - // as-needed: x => x - if (asNeeded && node.params.length === 1 - && node.params[0].type === "Identifier" - && node.params[0].typeAnnotation === undefined) { - if (token.type === "Punctuator" && token.value === "(") { - context.report({ - node: node, - message: asNeededMessage, - fix: function(fixer) { - var paramToken = context.getTokenAfter(token); - var closingParenToken = context.getTokenAfter(paramToken); - return fixer.replaceTextRange([ - token.range[0], - closingParenToken.range[1] - ], paramToken.value); - } - }); +var isWarnedForDeprecation = false; +module.exports = function() { + return { + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; } - return; - } - if (token.type === "Identifier") { - var after = context.getTokenAfter(token); - - // (x) => x - if (after.value !== ")") { - context.report({ - node: node, - message: message, - fix: function(fixer) { - return fixer.replaceText(token, '(' + token.value + ')'); - } - }); - } + /* eslint-disable no-console */ + console.log('The babel/arrow-parens rule is deprecated. Please ' + + 'use the built in arrow-parens rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; } - } - - return { - "ArrowFunctionExpression": parens }; }; diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/rules/flow-object-type.js index f452832d6bf4..530efb8d653d 100644 --- a/eslint/babel-eslint-plugin/rules/flow-object-type.js +++ b/eslint/babel-eslint-plugin/rules/flow-object-type.js @@ -1,48 +1,21 @@ -/** - * @fileoverview Enforces a choice between semicolons and commas in Flow object and class types. - * @author Nat Mote - */ "use strict"; -var SEMICOLON = { - char: ';', - name: 'semicolon', -} +var isWarnedForDeprecation = false; +module.exports = function() { + return { + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } -var COMMA = { - char: ',', - name: 'comma', -}; - -module.exports = function(context) { - var GOOD; - var BAD; - if (context.options[0] === undefined || context.options[0] === SEMICOLON.name) { - GOOD = SEMICOLON; - BAD = COMMA; - } else { - GOOD = COMMA; - BAD = SEMICOLON; - } - function requireProperPunctuation(node) { - var tokens = context.getSourceCode().getTokens(node); - var lastToken = tokens[tokens.length - 1]; - if (lastToken.type === 'Punctuator') { - if (lastToken.value === BAD.char) { - context.report({ - message: 'Prefer ' + GOOD.name + 's to ' + BAD.name + 's in object and class types', - node: lastToken, - fix: function(fixer) { - return fixer.replaceText(lastToken, GOOD.char); - }, - }); - } - } - } - - return { - ObjectTypeProperty: requireProperPunctuation, - }; + /* eslint-disable no-console */ + console.log('The babel/flow-object-type rule is deprecated. Please ' + + 'use the flowtype/object-type-delimiter rule instead.\n' + + 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; }; module.exports.schema = [ diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js index d750323d392a..bf5c1eee5c3d 100644 --- a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js @@ -1,135 +1,22 @@ 'use strict'; -// Based on https://github.com/eslint/eslint/blob/v2.11.1/lib/rules/comma-dangle.js - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -function last(arr) { - return arr.length !== 0 ? arr[arr.length - 1] : undefined; -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - var mode = context.options[0]; - var UNEXPECTED_MESSAGE = 'Unexpected trailing comma.'; - var MISSING_MESSAGE = 'Missing trailing comma.'; - - function isMultiline(node) { - var lastItem = last(node.params || node.arguments); - - if (!lastItem) { - return false; - } - - var sourceCode = context.getSourceCode(); - var penultimateToken = sourceCode.getLastToken(lastItem); - var lastToken = sourceCode.getTokenAfter(penultimateToken); - - if (lastToken.value === ',') { - penultimateToken = lastToken; - lastToken = sourceCode.getTokenAfter(lastToken); - } - - return lastToken.loc.end.line !== penultimateToken.loc.end.line; - } - - function forbidTrailingComma(node) { - var lastItem = last(node.params || node.arguments); - - if (!lastItem) { - return; - } - - var sourceCode = context.getSourceCode(); - var trailingToken = sourceCode.getTokenAfter(lastItem); - - if (trailingToken.value === ',') { - context.report({ - node: lastItem, - loc: trailingToken.loc.start, - message: UNEXPECTED_MESSAGE, - fix: function(fixer) { - return fixer.remove(trailingToken); - } - }); - } - } - - function forceTrailingComma(node) { - var lastItem = last(node.params || node.arguments); - - if (!lastItem) { - return; - } - - // `f(...a,)` is ok, but `function f(...a,) {}` is invalid syntax. - if (lastItem.type === 'RestElement') { - return; - } - - var sourceCode = context.getSourceCode(); - var penultimateToken = lastItem; - var trailingToken = sourceCode.getTokenAfter(lastItem); - - // `f = a, => {}` is invalid syntax. - if (node.type === 'ArrowFunctionExpression' && - node.params.length === 1 && - sourceCode.getTokenBefore(lastItem).value !== '(') { - return; - } - - if (trailingToken.value !== ',') { - context.report({ - node: lastItem, - loc: lastItem.loc.end, - message: MISSING_MESSAGE, - fix: function(fixer) { - return fixer.insertTextAfter(penultimateToken, ','); - } - }); - } - } - - function forceTrailingCommaIfMultiline(node) { - if (isMultiline(node)) { - forceTrailingComma(node); - } else { - forbidTrailingComma(node); - } - } - - function allowTrailingCommaIfMultiline(node) { - if (!isMultiline(node)) { - forbidTrailingComma(node); - } - } - - var checkForTrailingComma; - if (mode === 'always') { - checkForTrailingComma = forceTrailingComma; - } else if (mode === 'always-multiline') { - checkForTrailingComma = forceTrailingCommaIfMultiline; - } else if (mode === 'only-multiline') { - checkForTrailingComma = allowTrailingCommaIfMultiline; - } else { - checkForTrailingComma = forbidTrailingComma; - } - +var isWarnedForDeprecation = false; +module.exports = function() { return { - ArrowFunctionExpression: checkForTrailingComma, - FunctionDeclaration: checkForTrailingComma, - FunctionExpression: checkForTrailingComma, - CallExpression: checkForTrailingComma, - NewExpression: checkForTrailingComma, + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + + 'use the built in comma-dangle rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } }; }; -module.exports.fixable = 'code'; module.exports.schema = [ { enum: ['always', 'always-multiline', 'only-multiline', 'never'] diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js index 416efff8e2e1..38d586c6e365 100644 --- a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -1,93 +1,20 @@ -/** - * @fileoverview Rule to check the spacing around the * in generator functions. - * @author Jamund Ferguson - * @copyright 2015 Brandon Mills. All rights reserved. - * @copyright 2014 Jamund Ferguson. All rights reserved. - */ - "use strict"; -module.exports = function(context) { - - var mode = (function(option) { - if (option == null || typeof option === "string") { - return { - before: { before: true, after: false }, - after: { before: false, after: true }, - both: { before: true, after: true }, - neither: { before: false, after: false } - }[option || "before"]; - } - return option; - }(context.options[0])); - - function isAsyncGenerator(node){ - return context.getFirstToken(node, 2).value === '*' - } - - /** - * Checks the spacing between two tokens before or after the star token. - * @param {string} side Either "before" or "after". - * @param {Token} leftToken `function` keyword token if side is "before", or - * star token if side is "after". - * @param {Token} rightToken Star token if side is "before", or identifier - * token if side is "after". - * @returns {void} - */ - function checkSpacing(side, leftToken, rightToken) { - if (!!(rightToken.range[0] - leftToken.range[1]) !== mode[side]) { - context.report( - leftToken.value === "*" ? leftToken : rightToken, - "{{type}} space {{side}} *.", - { - type: mode[side] ? "Missing" : "Unexpected", - side: side - } - ); - } - } - - /** - * Enforces the spacing around the star if node is a generator function. - * @param {ASTNode} node A function expression or declaration node. - * @returns {void} - */ - function checkFunction(node) { - var first = context.getFirstToken(node) - , isMethod = node.parent.method || node.parent.type === "MethodDefinition" - , isAsync = first.value === 'async'; - - var prevToken, starToken, nextToken; - - - if ( !node.generator || (isAsync && !isAsyncGenerator(node))) { - return; - } - - if (isMethod) { - starToken = context.getTokenBefore(node, 1); - } else { - starToken = context.getFirstToken(node, isAsync ? 2 : 1); - } - - // Only check before when preceded by `function` keyword - prevToken = context.getTokenBefore(starToken); - if (prevToken.value === "function" || prevToken.value === "static") { - checkSpacing("before", prevToken, starToken); - } +var isWarnedForDeprecation = false; +module.exports = function() { + return { + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - // Only check after when followed by an identifier - nextToken = context.getTokenAfter(starToken); - if (nextToken.type === "Identifier") { - checkSpacing("after", starToken, nextToken); + /* eslint-disable no-console */ + console.log('The babel/generator-star-spacing rule is deprecated. Please ' + + 'use the built in generator-star-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; } - } - - return { - "FunctionDeclaration": checkFunction, - "FunctionExpression": checkFunction }; - }; module.exports.schema = [ diff --git a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js index cc3bb91af4f0..037f29be74c9 100644 --- a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js @@ -23,48 +23,44 @@ var boundaryTypes = { module.exports = function(context) { return { - // babel-eslint transpiles AwaitExpressions to YieldExpressions, but the actual node kind is - // still available in _babelType. - YieldExpression: function(node) { - if (node._babelType === 'AwaitExpression') { - var ancestors = context.getAncestors(); - // Reverse so that we can traverse from the deepest node upwards. - ancestors.reverse(); - // Create a set of all the ancestors plus this node so that we can check - // if this use of await appears in the body of the loop as opposed to - // the right-hand side of a for...of, for example. - // - // Implement the set with an Array since there are likely to be very few - // elements. An Object would not be appropriate since the elements are - // not strings. - var ancestorSet = [].concat(ancestors, [node]); - var ancestorSetHas = function(element) { - return ancestorSet.indexOf(element) !== -1; + AwaitExpression(node) { + var ancestors = context.getAncestors(); + // Reverse so that we can traverse from the deepest node upwards. + ancestors.reverse(); + // Create a set of all the ancestors plus this node so that we can check + // if this use of await appears in the body of the loop as opposed to + // the right-hand side of a for...of, for example. + // + // Implement the set with an Array since there are likely to be very few + // elements. An Object would not be appropriate since the elements are + // not strings. + var ancestorSet = [].concat(ancestors, [node]); + var ancestorSetHas = function(element) { + return ancestorSet.indexOf(element) !== -1; + } + for (var i = 0; i < ancestors.length; i++) { + var ancestor = ancestors[i]; + if (boundaryTypes.hasOwnProperty(ancestor.type)) { + // Short-circuit out if we encounter a boundary type. Loops above + // this do not matter. + return; } - for (var i = 0; i < ancestors.length; i++) { - var ancestor = ancestors[i]; - if (boundaryTypes.hasOwnProperty(ancestor.type)) { - // Short-circuit out if we encounter a boundary type. Loops above - // this do not matter. + if (loopTypes.hasOwnProperty(ancestor.type)) { + // Only report if we are actually in the body or another part that gets executed on + // every iteration. + if ( + ancestorSetHas(ancestor.body) || + ancestorSetHas(ancestor.test) || + ancestorSetHas(ancestor.update) + ) { + context.report( + node, + 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + + 'you are sure you want to do this, add `// eslint-disable-line ' + + context.id + '` at the end of this line.' + ); return; } - if (loopTypes.hasOwnProperty(ancestor.type)) { - // Only report if we are actually in the body or another part that gets executed on - // every iteration. - if ( - ancestorSetHas(ancestor.body) || - ancestorSetHas(ancestor.test) || - ancestorSetHas(ancestor.update) - ) { - context.report( - node, - 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + - 'you are sure you want to do this, add `// eslint-disable-line ' + - context.id + '` at the end of this line.' - ); - return; - } - } } } }, diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js index 4bed9e832164..eaf24a1803ed 100644 --- a/eslint/babel-eslint-plugin/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -1,70 +1,20 @@ - -/** - * @fileoverview Rule to enforce concise object methods and properties. - * @author Jamund Ferguson - * @copyright 2015 Jamund Ferguson. All rights reserved. - */ - -'use strict'; - -var OPTIONS = { - always: 'always', - never: 'never', - methods: 'methods', - properties: 'properties' +"use strict"; + +var isWarnedForDeprecation = false; +module.exports = function() { + return { + Program() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/object-shorthand rule is deprecated. Please ' + + 'use the built in object-shorthand rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } }; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var APPLY = context.options[0] || OPTIONS.always; - var APPLY_TO_METHODS = APPLY === OPTIONS.methods || APPLY === OPTIONS.always; - var APPLY_TO_PROPS = APPLY === OPTIONS.properties || APPLY === OPTIONS.always; - var APPLY_NEVER = APPLY === OPTIONS.never; - - return { - Property: function(node) { - var isConciseProperty = node.method || node.shorthand - , isSpreadProperty = !!this.getSource(node).match(/^\.\.\./) - , type; - - // if we're 'never' and concise we should warn now - if (APPLY_NEVER && isConciseProperty) { - type = node.method ? 'method' : 'property'; - context.report(node, 'Expected longform ' + type + ' syntax.'); - } - - // at this point if we're concise or if we're 'never' we can leave - if (APPLY_NEVER || isConciseProperty) { - return; - } - - // getters, setters and computed properties are ignored - if (node.kind === "get" || node.kind === "set" || node.computed) { - return; - } - - if (isSpreadProperty) { - return; - } - - if (node.value.type === 'FunctionExpression' && node.value.id == null && APPLY_TO_METHODS) { - // {x: function(){}} should be written as {x() {}} - context.report(node, 'Expected method shorthand.'); - } - else if (node.value.type === 'Identifier' && node.key.name === node.value.name && APPLY_TO_PROPS) { - // {x: x} should be written as {x} - context.report(node, 'Expected property shorthand.'); - } - else if (node.value.type === 'Identifier' && node.key.type === 'Literal' && node.key.value === node.value.name && APPLY_TO_PROPS) { - // {'x': x} should be written as {x} - context.report(node, 'Expected property shorthand.'); - } - } - }; }; module.exports.schema = [ diff --git a/eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js deleted file mode 100644 index ea5aa2f45875..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/array-bracket-spacing.js +++ /dev/null @@ -1,733 +0,0 @@ -/** - * @fileoverview Disallows or enforces spaces inside of brackets. - * @author Ian Christian Myers - * @copyright 2014 Vignesh Anand. All rights reserved. - */ -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var rule = require('../../rules/array-bracket-spacing'), - RuleTester = require('../RuleTester'); - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -var ruleTester = new RuleTester(); -ruleTester.run("array-bracket-spacing", rule, { - - valid: [ - { code: "var foo = obj[ 1 ]", options: ["always"] }, - { code: "var foo = obj[ 'foo' ];", options: ["always"] }, - { code: "var foo = obj[ [ 1, 1 ] ];", options: ["always"] }, - - // always - singleValue - { code: "var foo = ['foo']", options: ["always", {singleValue: false}] }, - { code: "var foo = [2]", options: ["always", {singleValue: false}] }, - { code: "var foo = [[ 1, 1 ]]", options: ["always", {singleValue: false}] }, - { code: "var foo = [{ 'foo': 'bar' }]", options: ["always", {singleValue: false}] }, - { code: "var foo = [bar]", options: ["always", {singleValue: false}] }, - - // always - objectsInArrays - { code: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, 5, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{\n'bar': 'baz', \n'qux': [{ 'bar': 'baz' }], \n'quxx': 1 \n}]", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{ 'bar': 'baz' }]", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [{ 'bar': 'baz' }, 1, { 'bar': 'baz' }];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, { 'bar': 'baz' }, 5 ];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ 1, { 'bar': 'baz' }, [{ 'bar': 'baz' }] ];", options: ["always", {objectsInArrays: false}] }, - { code: "var foo = [ function(){} ];", options: ["always", {objectsInArrays: false}] }, - - // always - arraysInArrays - { code: "var arr = [[ 1, 2 ], 2, 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, - { code: "var arr = [[ 1, 2 ], [[[ 1 ]]], 3, 4 ];", options: ["always", {"arraysInArrays": false}] }, - { code: "var foo = [ arr[i], arr[j] ];", options: ["always", {"arraysInArrays": false}] }, - - // always - arraysInArrays, objectsInArrays - { code: "var arr = [[ 1, 2 ], 2, 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false}] }, - - // always - arraysInArrays, objectsInArrays, singleValue - { code: "var arr = [[ 1, 2 ], [2], 3, { 'foo': 'bar' }];", options: ["always", {"arraysInArrays": false, objectsInArrays: false, singleValue: false}] }, - - // always - { code: "obj[ foo ]", options: ["always"] }, - { code: "obj[\nfoo\n]", options: ["always"] }, - { code: "obj[ 'foo' ]", options: ["always"] }, - { code: "obj[ 'foo' + 'bar' ]", options: ["always"] }, - { code: "obj[ obj2[ foo ] ]", options: ["always"] }, - { code: "obj.map(function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - { code: "obj[ 'map' ](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - { code: "obj[ 'for' + 'Each' ](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["always"] }, - - { code: "var arr = [ 1, 2, 3, 4 ];", options: ["always"] }, - { code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", options: ["always"] }, - { code: "var arr = [\n1, 2, 3, 4\n];", options: ["always"] }, - { code: "var foo = [];", options: ["always"] }, - - // singleValue: false, objectsInArrays: true, arraysInArrays - { code: "this.db.mappings.insert([\n { alias: 'a', url: 'http://www.amazon.de' },\n { alias: 'g', url: 'http://www.google.de' }\n], function() {});", options: ["always", {singleValue: false, objectsInArrays: true, arraysInArrays: true}] }, - - // always - destructuring assignment - { code: "var [ x, y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [ x,y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [ x, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [\nx, y ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [\nx,,,\n] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [ ,x, ] = z", ecmaFeatures: { destructuring: true }, options: ["always"] }, - { code: "var [\nx, ...y\n] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["always"] }, - { code: "var [\nx, ...y ] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["always"] }, - { code: "var [[ x, y ], z ] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {"arraysInArrays": false}] }, - { code: "var [ x, [ y, z ]] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {"arraysInArrays": false}] }, - { code: "[{ x, y }, z ] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {objectsInArrays: false}] }, - { code: "[ x, { y, z }] = arr;", ecmaFeatures: { destructuring: true }, options: ["always", {objectsInArrays: false}] }, - - // never - { code: "obj[foo]", options: ["never"] }, - { code: "obj['foo']", options: ["never"] }, - { code: "obj['foo' + 'bar']", options: ["never"] }, - { code: "obj['foo'+'bar']", options: ["never"] }, - { code: "obj[obj2[foo]]", options: ["never"] }, - { code: "obj.map(function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj['map'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj['for' + 'Each'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "obj['for' + 'Each'](function(item) { return [\n1,\n2,\n3,\n4\n]; })", options: ["never"] }, - { code: "var arr = [1, 2, 3, 4];", options: ["never"] }, - { code: "var arr = [[1, 2], 2, 3, 4];", options: ["never"] }, - { code: "var arr = [\n1, 2, 3, 4\n];", options: ["never"] }, - { code: "obj[\nfoo]", options: ["never"] }, - { code: "obj[foo\n]", options: ["never"] }, - { code: "var arr = [1,\n2,\n3,\n4\n];", options: ["never"] }, - { code: "var arr = [\n1,\n2,\n3,\n4];", options: ["never"] }, - - // never - destructuring assignment - { code: "var [x, y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [x,y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [x, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [\nx, y] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [\nx, y\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [\nx,,,\n] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [,x,] = z", ecmaFeatures: { destructuring: true }, options: ["never"] }, - { code: "var [\nx, ...y\n] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["never"] }, - { code: "var [\nx, ...y] = z", ecmaFeatures: { destructuring: true, spread:true }, options: ["never"] }, - { code: "var [ [x, y], z] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {"arraysInArrays": true}] }, - { code: "var [x, [y, z] ] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {"arraysInArrays": true}] }, - { code: "[ { x, y }, z] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {objectsInArrays: true}] }, - { code: "[x, { y, z } ] = arr;", ecmaFeatures: { destructuring: true }, options: ["never", {objectsInArrays: true}] }, - - // never - singleValue - { code: "var foo = [ 'foo' ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ 2 ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ [1, 1] ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ {'foo': 'bar'} ]", options: ["never", {singleValue: true}] }, - { code: "var foo = [ bar ]", options: ["never", {singleValue: true}] }, - - // never - objectsInArrays - { code: "var foo = [ {'bar': 'baz'}, 1, 5];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, 5, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {\n'bar': 'baz', \n'qux': [ {'bar': 'baz'} ], \n'quxx': 1 \n} ]", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {'bar': 'baz'} ]", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [ {'bar': 'baz'}, 1, {'bar': 'baz'} ];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, {'bar': 'baz'} , 5];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [1, {'bar': 'baz'}, [ {'bar': 'baz'} ]];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [function(){}];", options: ["never", {objectsInArrays: true}] }, - { code: "var foo = [];", options: ["never", {objectsInArrays: true}] }, - - // never - arraysInArrays - { code: "var arr = [ [1, 2], 2, 3, 4];", options: ["never", {"arraysInArrays": true}] }, - { code: "var foo = [arr[i], arr[j]];", options: ["never", {"arraysInArrays": true}] }, - { code: "var foo = [];", options: ["never", {"arraysInArrays": true}] }, - - // never - arraysInArrays, singleValue - { code: "var arr = [ [1, 2], [ [ [ 1 ] ] ], 3, 4];", options: ["never", {"arraysInArrays": true, singleValue: true}] }, - - // never - arraysInArrays, objectsInArrays - { code: "var arr = [ [1, 2], 2, 3, {'foo': 'bar'} ];", options: ["never", {"arraysInArrays": true, objectsInArrays: true}] }, - - // should not warn - { code: "var foo = {};", options: ["never"] }, - { code: "var foo = [];", options: ["never"] }, - - { code: "var foo = [{'bar':'baz'}, 1, {'bar': 'baz'}];", options: ["never"] }, - { code: "var foo = [{'bar': 'baz'}];", options: ["never"] }, - { code: "var foo = [{\n'bar': 'baz', \n'qux': [{'bar': 'baz'}], \n'quxx': 1 \n}]", options: ["never"] }, - { code: "var foo = [1, {'bar': 'baz'}, 5];", options: ["never"] }, - { code: "var foo = [{'bar': 'baz'}, 1, 5];", options: ["never"] }, - { code: "var foo = [1, 5, {'bar': 'baz'}];", options: ["never"] }, - { code: "var obj = {'foo': [1, 2]}", options: ["never"] }, - - // Babel test cases. - // always - destructuring typed array param - { code: "function fn([ a,b ]: Array){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, - - // never - destructuring typed array param - { code: "function fn([a,b]: Array){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, - - ], - - invalid: [ - { - code: "var foo = [ ]", - output: "var foo = []", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - // objectsInArrays - { - code: "var foo = [ { 'bar': 'baz' }, 1, 5];", - output: "var foo = [{ 'bar': 'baz' }, 1, 5 ];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "A space is required before ']'", - type: "ArrayExpression", - line: 1, - column: 36 - } - ] - }, - { - code: "var foo = [1, 5, { 'bar': 'baz' } ];", - output: "var foo = [ 1, 5, { 'bar': 'baz' }];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 35 - } - ] - }, - { - code: "var foo = [ { 'bar':'baz' }, 1, { 'bar': 'baz' } ];", - output: "var foo = [{ 'bar':'baz' }, 1, { 'bar': 'baz' }];", - options: ["always", {objectsInArrays: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 50 - } - ] - }, - - // singleValue - { - code: "var obj = [ 'foo' ];", - output: "var obj = ['foo'];", - options: ["always", {singleValue: false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 19 - } - ] - }, - { - code: "var obj = ['foo' ];", - output: "var obj = ['foo'];", - options: ["always", {singleValue: false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 18 - } - ] - }, - { - code: "var obj = ['foo'];", - output: "var obj = [ 'foo' ];", - options: ["never", {singleValue: true}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "A space is required before ']'", - type: "ArrayExpression", - line: 1, - column: 17 - } - ] - }, - - // always - arraysInArrays - { - code: "var arr = [ [ 1, 2 ], 2, 3, 4 ];", - output: "var arr = [[ 1, 2 ], 2, 3, 4 ];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var arr = [ 1, 2, 2, [ 3, 4 ] ];", - output: "var arr = [ 1, 2, 2, [ 3, 4 ]];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 31 - } - ] - }, - { - code: "var arr = [[ 1, 2 ], 2, [ 3, 4 ] ];", - output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 34 - } - ] - }, - { - code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ]];", - output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var arr = [ [ 1, 2 ], 2, [ 3, 4 ] ];", - output: "var arr = [[ 1, 2 ], 2, [ 3, 4 ]];", - options: ["always", {"arraysInArrays": false}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 35 - } - ] - }, - - // always - destructuring - { - code: "var [x,y] = y", - output: "var [ x,y ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }, - { - message: "A space is required before ']'", - type: "ArrayPattern", - line: 1, - column: 9 - }] - }, - { - code: "var [x,y ] = y", - output: "var [ x,y ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }] - }, - { - code: "var [,,,x,,] = y", - output: "var [ ,,,x,, ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }, - { - message: "A space is required before ']'", - type: "ArrayPattern", - line: 1, - column: 12 - }] - }, - { - code: "var [ ,,,x,,] = y", - output: "var [ ,,,x,, ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "A space is required before ']'", - type: "ArrayPattern", - line: 1, - column: 13 - }] - }, - { - code: "var [...horse] = y", - output: "var [ ...horse ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true, spread:true }, - errors: [{ - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }, - { - message: "A space is required before ']'", - type: "ArrayPattern", - line: 1, - column: 14 - }] - }, - { - code: "var [...horse ] = y", - output: "var [ ...horse ] = y", - options: ["always"], - ecmaFeatures: { destructuring: true, spread:true }, - errors: [{ - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }] - }, - { - code: "var [ [ x, y ], z ] = arr;", - output: "var [[ x, y ], z ] = arr;", - options: ["always", {"arraysInArrays": false}], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "There should be no space after '['", - type: "ArrayPattern", - line: 1, - column: 5 - }] - }, - { - code: "[ { x, y }, z ] = arr;", - output: "[{ x, y }, z ] = arr;", - options: ["always", {"objectsInArrays": false}], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "There should be no space after '['", - type: "ArrayPattern", - line: 1, - column: 1 - }] - }, - { - code: "[ x, { y, z } ] = arr;", - output: "[ x, { y, z }] = arr;", - options: ["always", {"objectsInArrays": false}], - ecmaFeatures: { destructuring: true }, - errors: [{ - message: "There should be no space before ']'", - type: "ArrayPattern", - line: 1, - column: 15 - }] - }, - - // never - arraysInArrays - { - code: "var arr = [[1, 2], 2, [3, 4]];", - output: "var arr = [ [1, 2], 2, [3, 4] ];", - options: ["never", {"arraysInArrays": true}], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "A space is required before ']'", - type: "ArrayExpression", - line: 1, - column: 29 - } - ] - }, - { - code: "var arr = [ ];", - output: "var arr = [];", - options: ["never", {"arraysInArrays": true}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - - // never - objectsInArrays - { - code: "var arr = [ ];", - output: "var arr = [];", - options: ["never", {"objectsInArrays": true}], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - - // always - { - code: "var arr = [1, 2, 3, 4];", - output: "var arr = [ 1, 2, 3, 4 ];", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "A space is required before ']'", - type: "ArrayExpression", - line: 1, - column: 22 - } - ] - }, - { - code: "var arr = [1, 2, 3, 4 ];", - output: "var arr = [ 1, 2, 3, 4 ];", - options: ["always"], - errors: [ - { - message: "A space is required after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var arr = [ 1, 2, 3, 4];", - output: "var arr = [ 1, 2, 3, 4 ];", - options: ["always"], - errors: [ - { - message: "A space is required before ']'", - type: "ArrayExpression", - line: 1, - column: 23 - } - ] - }, - - // never - { - code: "var arr = [ 1, 2, 3, 4 ];", - output: "var arr = [1, 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 24 - } - ] - }, - { - code: "var arr = [1, 2, 3, 4 ];", - output: "var arr = [1, 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 23 - } - ] - }, - { - code: "var arr = [ 1, 2, 3, 4];", - output: "var arr = [1, 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var arr = [ [ 1], 2, 3, 4];", - output: "var arr = [[1], 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space after '['", - type: "ArrayExpression", - line: 1, - column: 13 - } - ] - }, - { - code: "var arr = [[1 ], 2, 3, 4 ];", - output: "var arr = [[1], 2, 3, 4];", - options: ["never"], - errors: [ - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 15 - }, - { - message: "There should be no space before ']'", - type: "ArrayExpression", - line: 1, - column: 26 - } - ] - }, - - // Babel test cases. - - // always - destructuring typed array param - { - code: "function fn([a,b]: Array){}", - output: "function fn([ a,b ]: Array){}", - options: ["always"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true - }, - errors: [ - { - message: "A space is required after '['", - type: "ArrayPattern", - line: 1, - column: 13 - }, - { - message: "A space is required before ']'", - type: "ArrayPattern", - line: 1, - column: 17 - } - ] - }, - - // never - destructuring typed array param - { - code: "function fn([ a,b ]: Array){}", - output: "function fn([a,b]: Array){}", - options: ["never"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true - }, - errors: [ - { - message: "There should be no space after '['", - type: "ArrayPattern", - line: 1, - column: 13 - }, - { - message: "There should be no space before ']'", - type: "ArrayPattern", - line: 1, - column: 19 - } - ] - } - ] -}); diff --git a/eslint/babel-eslint-plugin/tests/rules/arrow-parens.js b/eslint/babel-eslint-plugin/tests/rules/arrow-parens.js deleted file mode 100644 index 1962be7b8891..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/arrow-parens.js +++ /dev/null @@ -1,187 +0,0 @@ -/* eslint-disable */ - -/** - * @fileoverview Tests for arrow-parens - * @author Jxck - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -var rule = require("../../rules/arrow-parens"), - RuleTester = require('../RuleTester'); - -function ok(code, args){ - return { code: code, options: args, parser: 'babel-eslint' } -} - -function err(code, output, errors, args){ - var e = ok(code, args) - e.errors = errors - e.output = output - return e -} - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ -var ruleTester = new RuleTester(); - -var valid = [ - { code: "() => {}", ecmaFeatures: { arrowFunctions: true } }, - { code: "(a) => {}", ecmaFeatures: { arrowFunctions: true } }, - { code: "(a) => a", ecmaFeatures: { arrowFunctions: true } }, - { code: "(a) => {\n}", ecmaFeatures: { arrowFunctions: true } }, - { code: "a.then((foo) => {});", ecmaFeatures: { arrowFunctions: true } }, - { code: "a.then((foo) => { if (true) {}; });", ecmaFeatures: { arrowFunctions: true } }, - - // // as-needed - { code: "() => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, - { code: "a => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, - { code: "a => a", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, - { code: "([a, b]) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true } }, - { code: "({ a, b }) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true } }, - { code: "(a = 10) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, destructuring: true, defaultParams: true } }, - { code: "(...a) => a[0]", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true, restParams: true } }, - { code: "(a, b) => {}", options: ["as-needed"], ecmaFeatures: { arrowFunctions: true } }, - ok("(a: string) => a", ["as-needed"]), - - // async - ok("async () => {}"), - ok("async (a) => {}"), - ok("async (a) => a"), - ok("async (a) => {\n}"), - ok("a.then(async (foo) => {});"), - ok("a.then((foo) => { if (true) {}; })"), - - ok("async () => {}", ["as-needed"]), - ok("async a => {}", ["as-needed"]), - ok("async a => a", ["as-needed"]), - ok("async ([a, b]) => {}", ["as-needed"]), - ok("async ({ a, b }) => {}", ["as-needed"]), - ok("async (a = 10) => {}", ["as-needed"]), - ok("async (...a) => a[0]", ["as-needed"]), - ok("async (a, b) => {}", ["as-needed"]), - -]; - -var message = message; -var asNeededMessage = asNeededMessage; -var type = type; - -var invalid = [ - { - code: "a => {}", - output: "(a) => {}", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 1, - message: message, - type: type - }] - }, - { - code: "a => a", - output: "(a) => a", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 1, - message: message, - type: type - }] - }, - { - code: "a => {\n}", - output: "(a) => {\n}", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 1, - message: message, - type: type - }] - }, - { - code: "a.then(foo => {});", - output: "a.then((foo) => {});", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 8, - message: message, - type: type - }] - }, - { - code: "a.then(foo => a);", - output: "a.then((foo) => a);", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 8, - message: message, - type: type - }] - }, - { - code: "a(foo => { if (true) {}; });", - output: "a((foo) => { if (true) {}; });", - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 3, - message: message, - type: type - }] - }, - - // as-needed - { - code: "(a) => a", - output: "a => a", - options: ["as-needed"], - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 1, - message: asNeededMessage, - type: type - }] - }, - { - code: "(b) => b", - output: "b => b", - options: ["as-needed"], - ecmaFeatures: { arrowFunctions: true }, - errors: [{ - line: 1, - column: 1, - message: asNeededMessage, - type: type - }] - }, - - // async - err('async a => {}', 'async (a) => {}', [ - { message: 'Expected parentheses around arrow function argument.' }, - ]), - - err('async a => a', 'async (a) => a', [ - { message: 'Expected parentheses around arrow function argument.' }, - ]), - - err('async (a) => a', 'async a => a', [ - { message: 'Unexpected parentheses around single function argument' }, - ], - ["as-needed"]) -]; - -ruleTester.run("arrow-parens", rule, { - valid: valid, - invalid: invalid -}); diff --git a/eslint/babel-eslint-plugin/tests/rules/flow-object-type.js b/eslint/babel-eslint-plugin/tests/rules/flow-object-type.js deleted file mode 100644 index 9d34036b0f68..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/flow-object-type.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @fileoverview Tests for flow-object-type. - * @author Nat Mote - */ - -"use strict"; - -var rule = require("../../rules/flow-object-type"), - RuleTester = require('../RuleTester'); - -var features = { -}; - -function test(code, options, errors, output){ - var result = { - code: code, - parser: 'babel-eslint', - ecmaFeatures: features, - }; - if (options != null) { - result.options = options; - } - if (errors != null) { - result.errors = errors; - } - if (output != null) { - result.output = output; - } - return result; -} - -var commaMessage = 'Prefer commas to semicolons in object and class types'; -var semiMessage = 'Prefer semicolons to commas in object and class types'; - -function ok(code, commaOrSemi) { - return test(code, [commaOrSemi]); -} - -function err(code, commaOrSemi, errorMessage, output) { - return test(code, [commaOrSemi], [errorMessage], output); -} - -var cases = [ - ok('type Foo = { a: Foo; b: Bar }', 'semicolon'), - err('type Foo = { a: Foo, b: Bar }', 'semicolon', semiMessage, 'type Foo = { a: Foo; b: Bar }'), - - ok('type Foo = { a: Foo, b: Bar }', 'comma'), - err('type Foo = { a: Foo; b: Bar }', 'comma', commaMessage, 'type Foo = { a: Foo, b: Bar }'), - - ok('declare class Foo { a: Foo; }', 'semicolon'), - err('declare class Foo { a: Foo, }', 'semicolon', semiMessage, 'declare class Foo { a: Foo; }'), - - ok('declare class Foo { a: Foo, }', 'comma'), - err('declare class Foo { a: Foo; }', 'comma', commaMessage, 'declare class Foo { a: Foo, }'), -]; - -function hasError(testCase) { - return testCase.errors != null && testCase.errors.length > 0; -} - -function hasNoError(testCase) { - return !hasError(testCase); -} - -var ruleTester = new RuleTester(); -ruleTester.run('flow-object-type', rule, { - valid: cases.filter(hasNoError), - invalid: cases.filter(hasError), -}); diff --git a/eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js deleted file mode 100644 index a1676e4fc4b1..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/func-params-comma-dangle.js +++ /dev/null @@ -1,278 +0,0 @@ -'use strict'; - -var rule = require('../../rules/func-params-comma-dangle'); -var RuleTester = require('../RuleTester'); - -var MISSING_I = [{message: 'Missing trailing comma.', type: 'Identifier'}]; -var MISSING_AP = [{message: 'Missing trailing comma.', type: 'AssignmentPattern'}]; -var MISSING_SE = [{message: 'Missing trailing comma.', type: 'SpreadElement'}]; -var UNEXPECTED_I = [{message: 'Unexpected trailing comma.', type: 'Identifier'}]; -var UNEXPECTED_AP = [{message: 'Unexpected trailing comma.', type: 'AssignmentPattern'}]; -var UNEXPECTED_SE = [{message: 'Unexpected trailing comma.', type: 'SpreadElement'}]; - -var ruleTester = new RuleTester({parser: 'babel-eslint'}); -ruleTester.run('func-params-comma-dangle', rule, { - valid: [ - {code: 'function f() {}'}, - {code: 'function f(\n) {}'}, - {code: 'function f(...a) {}'}, - {code: 'function f(...a\n) {}'}, - - {code: 'f()'}, - {code: 'f(\n)'}, - - {code: 'new F()'}, - {code: 'new F(\n)'}, - - // FunctionDeclaration - {code: 'function f(a) {}', options: ['always-multiline']}, - {code: 'function f(a) {}', options: ['never']}, - {code: 'function f(a) {}', options: ['only-multiline']}, - {code: 'function f(a,) {}', options: ['always']}, - {code: 'function f(a,\n) {}', options: ['always']}, - {code: 'function f(a,\n) {}', options: ['always-multiline']}, - {code: 'function f(a,\n) {}', options: ['only-multiline']}, - {code: 'function f(a\n) {}', options: ['never']}, - {code: 'function f(a\n) {}', options: ['only-multiline']}, - - {code: 'function f(a=1) {}', options: ['always-multiline']}, - {code: 'function f(a=1) {}', options: ['never']}, - {code: 'function f(a=1) {}', options: ['only-multiline']}, - {code: 'function f(a=1,) {}', options: ['always']}, - {code: 'function f(a=1,\n) {}', options: ['always']}, - {code: 'function f(a=1,\n) {}', options: ['always-multiline']}, - {code: 'function f(a=1,\n) {}', options: ['only-multiline']}, - {code: 'function f(a=1\n) {}', options: ['never']}, - {code: 'function f(a=1\n) {}', options: ['only-multiline']}, - - {code: 'function f(a:T) {}', options: ['always-multiline']}, - {code: 'function f(a:T) {}', options: ['never']}, - {code: 'function f(a:T) {}', options: ['only-multiline']}, - {code: 'function f(a:T,) {}', options: ['always']}, - {code: 'function f(a:T,\n) {}', options: ['always']}, - {code: 'function f(a:T,\n) {}', options: ['always-multiline']}, - {code: 'function f(a:T,\n) {}', options: ['only-multiline']}, - {code: 'function f(a:T\n) {}', options: ['never']}, - {code: 'function f(a:T\n) {}', options: ['only-multiline']}, - - // FunctionExpression - {code: 'f = function(a) {}', options: ['always-multiline']}, - {code: 'f = function(a) {}', options: ['never']}, - {code: 'f = function(a) {}', options: ['only-multiline']}, - {code: 'f = function(a,) {}', options: ['always']}, - {code: 'f = function(a,\n) {}', options: ['always']}, - {code: 'f = function(a,\n) {}', options: ['always-multiline']}, - {code: 'f = function(a,\n) {}', options: ['only-multiline']}, - {code: 'f = function(a\n) {}', options: ['never']}, - {code: 'f = function(a\n) {}', options: ['only-multiline']}, - - {code: 'f = function(a=1) {}', options: ['always-multiline']}, - {code: 'f = function(a=1) {}', options: ['never']}, - {code: 'f = function(a=1) {}', options: ['only-multiline']}, - {code: 'f = function(a=1,) {}', options: ['always']}, - {code: 'f = function(a=1,\n) {}', options: ['always']}, - {code: 'f = function(a=1,\n) {}', options: ['always-multiline']}, - {code: 'f = function(a=1,\n) {}', options: ['only-multiline']}, - {code: 'f = function(a=1\n) {}', options: ['never']}, - {code: 'f = function(a=1\n) {}', options: ['only-multiline']}, - - {code: 'f = function(a:T) {}', options: ['always-multiline']}, - {code: 'f = function(a:T) {}', options: ['never']}, - {code: 'f = function(a:T) {}', options: ['only-multiline']}, - {code: 'f = function(a:T,) {}', options: ['always']}, - {code: 'f = function(a:T,\n) {}', options: ['always']}, - {code: 'f = function(a:T,\n) {}', options: ['always-multiline']}, - {code: 'f = function(a:T,\n) {}', options: ['only-multiline']}, - {code: 'f = function(a:T\n) {}', options: ['never']}, - {code: 'f = function(a:T\n) {}', options: ['only-multiline']}, - - // ArrowFunctionExpression - {code: 'f = (a) => {}', options: ['always-multiline']}, - {code: 'f = (a) => {}', options: ['never']}, - {code: 'f = (a) => {}', options: ['only-multiline']}, - {code: 'f = (a,) => {}', options: ['always']}, - {code: 'f = (a,\n) => {}', options: ['always']}, - {code: 'f = (a,\n) => {}', options: ['always-multiline']}, - {code: 'f = (a,\n) => {}', options: ['only-multiline']}, - {code: 'f = (a\n) => {}', options: ['never']}, - {code: 'f = (a\n) => {}', options: ['only-multiline']}, - - {code: 'f = a => {}', options: ['always-multiline']}, - {code: 'f = a => {}', options: ['never']}, - {code: 'f = a => {}', options: ['only-multiline']}, - {code: 'f = a => {}', options: ['always']}, - - {code: 'f = (a=1) => {}', options: ['always-multiline']}, - {code: 'f = (a=1) => {}', options: ['never']}, - {code: 'f = (a=1) => {}', options: ['only-multiline']}, - {code: 'f = (a=1,) => {}', options: ['always']}, - {code: 'f = (a=1,\n) => {}', options: ['always']}, - {code: 'f = (a=1,\n) => {}', options: ['always-multiline']}, - {code: 'f = (a=1,\n) => {}', options: ['only-multiline']}, - {code: 'f = (a=1\n) => {}', options: ['never']}, - {code: 'f = (a=1\n) => {}', options: ['only-multiline']}, - - {code: 'f = (a:T) => {}', options: ['always-multiline']}, - {code: 'f = (a:T) => {}', options: ['never']}, - {code: 'f = (a:T) => {}', options: ['only-multiline']}, - // Arrow functions with flow types aren't getting the correct loc. - // {code: 'f = (a:T,) => {}', options: ['always']}, - // {code: 'f = (a:T,\n) => {}', options: ['always']}, - {code: 'f = (a:T,\n) => {}', options: ['always-multiline']}, - {code: 'f = (a:T,\n) => {}', options: ['only-multiline']}, - {code: 'f = (a:T\n) => {}', options: ['never']}, - {code: 'f = (a:T\n) => {}', options: ['only-multiline']}, - - // CallExpression - {code: 'f(a)', options: ['always-multiline']}, - {code: 'f(a)', options: ['never']}, - {code: 'f(a)', options: ['only-multiline']}, - {code: 'f(a,)', options: ['always']}, - {code: 'f(a,\n)', options: ['always']}, - {code: 'f(a,\n)', options: ['always-multiline']}, - {code: 'f(a,\n)', options: ['only-multiline']}, - {code: 'f(a\n)', options: ['never']}, - {code: 'f(a\n)', options: ['only-multiline']}, - {code: 'f(...a)', options: ['always-multiline']}, - {code: 'f(...a)', options: ['never']}, - {code: 'f(...a)', options: ['only-multiline']}, - {code: 'f(...a,)', options: ['always']}, - {code: 'f(...a,\n)', options: ['always']}, - {code: 'f(...a,\n)', options: ['always-multiline']}, - {code: 'f(...a,\n)', options: ['only-multiline']}, - {code: 'f(...a\n)', options: ['never']}, - {code: 'f(...a\n)', options: ['only-multiline']}, - - // NewExpression - {code: 'new F(a)', options: ['always-multiline']}, - {code: 'new F(a)', options: ['never']}, - {code: 'new F(a)', options: ['only-multiline']}, - {code: 'new F(a,)', options: ['always']}, - {code: 'new F(a,\n)', options: ['always']}, - {code: 'new F(a,\n)', options: ['always-multiline']}, - {code: 'new F(a,\n)', options: ['only-multiline']}, - {code: 'new F(a\n)', options: ['never']}, - {code: 'new F(a\n)', options: ['only-multiline']}, - {code: 'new F(...a)', options: ['always-multiline']}, - {code: 'new F(...a)', options: ['never']}, - {code: 'new F(...a)', options: ['only-multiline']}, - {code: 'new F(...a,)', options: ['always']}, - {code: 'new F(...a,\n)', options: ['always']}, - {code: 'new F(...a,\n)', options: ['always-multiline']}, - {code: 'new F(...a,\n)', options: ['only-multiline']}, - {code: 'new F(...a\n)', options: ['never']}, - {code: 'new F(...a\n)', options: ['only-multiline']}, - ], - invalid: [ - // FunctionDeclaration - {code: 'function f(a) {}', output: 'function f(a,) {}', options: ['always'], errors: MISSING_I}, - {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'function f(a,) {}', output: 'function f(a) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'function f(a,\n) {}', output: 'function f(a\n) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'function f(a\n) {}', output: 'function f(a,\n) {}', options: ['always'], errors: MISSING_I}, - {code: 'function f(a\n) {}', output: 'function f(a,\n) {}', options: ['always-multiline'], errors: MISSING_I}, - - {code: 'function f(a=1) {}', output: 'function f(a=1,) {}', options: ['always'], errors: MISSING_AP}, - {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, - {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, - {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, - {code: 'function f(a=1,) {}', output: 'function f(a=1) {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'function f(a=1,\n) {}', output: 'function f(a=1\n) {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'function f(a=1\n) {}', output: 'function f(a=1,\n) {}', options: ['always'], errors: MISSING_AP}, - {code: 'function f(a=1\n) {}', output: 'function f(a=1,\n) {}', options: ['always-multiline'], errors: MISSING_AP}, - - {code: 'function f(a:T) {}', output: 'function f(a:T,) {}', options: ['always'], errors: MISSING_I}, - {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'function f(a:T,) {}', output: 'function f(a:T) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'function f(a:T,\n) {}', output: 'function f(a:T\n) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'function f(a:T\n) {}', output: 'function f(a:T,\n) {}', options: ['always'], errors: MISSING_I}, - {code: 'function f(a:T\n) {}', output: 'function f(a:T,\n) {}', options: ['always-multiline'], errors: MISSING_I}, - - // FunctionExpression - {code: 'f = function f(a) {}', output: 'f = function f(a,) {}', options: ['always'], errors: MISSING_I}, - {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'f = function f(a,) {}', output: 'f = function f(a) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = function f(a,\n) {}', output: 'f = function f(a\n) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = function f(a\n) {}', output: 'f = function f(a,\n) {}', options: ['always'], errors: MISSING_I}, - {code: 'f = function f(a\n) {}', output: 'f = function f(a,\n) {}', options: ['always-multiline'], errors: MISSING_I}, - - {code: 'f = function f(a=1) {}', output: 'f = function f(a=1,) {}', options: ['always'], errors: MISSING_AP}, - {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, - {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, - {code: 'f = function f(a=1,) {}', output: 'f = function f(a=1) {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'f = function f(a=1,\n) {}', output: 'f = function f(a=1\n) {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'f = function f(a=1\n) {}', output: 'f = function f(a=1,\n) {}', options: ['always'], errors: MISSING_AP}, - {code: 'f = function f(a=1\n) {}', output: 'f = function f(a=1,\n) {}', options: ['always-multiline'], errors: MISSING_AP}, - - {code: 'f = function f(a:T) {}', output: 'f = function f(a:T,) {}', options: ['always'], errors: MISSING_I}, - {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'f = function f(a:T,) {}', output: 'f = function f(a:T) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = function f(a:T,\n) {}', output: 'f = function f(a:T\n) {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = function f(a:T\n) {}', output: 'f = function f(a:T,\n) {}', options: ['always'], errors: MISSING_I}, - {code: 'f = function f(a:T\n) {}', output: 'f = function f(a:T,\n) {}', options: ['always-multiline'], errors: MISSING_I}, - - // ArrowFunctionExpression - {code: 'f = (a) => {}', output: 'f = (a,) => {}', options: ['always'], errors: MISSING_I}, - {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'f = (a,) => {}', output: 'f = (a) => {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = (a,\n) => {}', output: 'f = (a\n) => {}', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f = (a\n) => {}', output: 'f = (a,\n) => {}', options: ['always'], errors: MISSING_I}, - {code: 'f = (a\n) => {}', output: 'f = (a,\n) => {}', options: ['always-multiline'], errors: MISSING_I}, - - {code: 'f = (a=1) => {}', output: 'f = (a=1,) => {}', options: ['always'], errors: MISSING_AP}, - {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['always-multiline'], errors: UNEXPECTED_AP}, - {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['only-multiline'], errors: UNEXPECTED_AP}, - {code: 'f = (a=1,) => {}', output: 'f = (a=1) => {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'f = (a=1,\n) => {}', output: 'f = (a=1\n) => {}', options: ['never'], errors: UNEXPECTED_AP}, - {code: 'f = (a=1\n) => {}', output: 'f = (a=1,\n) => {}', options: ['always'], errors: MISSING_AP}, - {code: 'f = (a=1\n) => {}', output: 'f = (a=1,\n) => {}', options: ['always-multiline'], errors: MISSING_AP}, - - // Arrow functions with flow types aren't getting the correct loc. - // {code: 'f = (a:T) => {}', output: 'f = (a:T,) => {}', options: ['always'], errors: MISSING_I}, - // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['always-multiline'], errors: UNEXPECTED_I}, - // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['only-multiline'], errors: UNEXPECTED_I}, - // {code: 'f = (a:T,) => {}', output: 'f = (a:T) => {}', options: ['never'], errors: UNEXPECTED_I}, - // {code: 'f = (a:T,\n) => {}', output: 'f = (a:T\n) => {}', options: ['never'], errors: UNEXPECTED_I}, - // {code: 'f = (a:T\n) => {}', output: 'f = (a:T,\n) => {}', options: ['always'], errors: MISSING_I}, - // {code: 'f = (a:T\n) => {}', output: 'f = (a:T,\n) => {}', options: ['always-multiline'], errors: MISSING_I}, - - // CallExpression - {code: 'f(a)', output: 'f(a,)', options: ['always'], errors: MISSING_I}, - {code: 'f(a,)', output: 'f(a)', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'f(a,)', output: 'f(a)', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'f(a,)', output: 'f(a)', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f(a,\n)', output: 'f(a\n)', options: ['never'], errors: UNEXPECTED_I}, - {code: 'f(a\n)', output: 'f(a,\n)', options: ['always'], errors: MISSING_I}, - {code: 'f(a\n)', output: 'f(a,\n)', options: ['always-multiline'], errors: MISSING_I}, - - {code: 'f(...a)', output: 'f(...a,)', options: ['always'], errors: MISSING_SE}, - {code: 'f(...a,)', output: 'f(...a)', options: ['always-multiline'], errors: UNEXPECTED_SE}, - {code: 'f(...a,)', output: 'f(...a)', options: ['only-multiline'], errors: UNEXPECTED_SE}, - {code: 'f(...a,)', output: 'f(...a)', options: ['never'], errors: UNEXPECTED_SE}, - {code: 'f(...a,\n)', output: 'f(...a\n)', options: ['never'], errors: UNEXPECTED_SE}, - {code: 'f(...a\n)', output: 'f(...a,\n)', options: ['always'], errors: MISSING_SE}, - {code: 'f(...a\n)', output: 'f(...a,\n)', options: ['always-multiline'], errors: MISSING_SE}, - - // NewExpression - {code: 'new F(a)', output: 'new F(a,)', options: ['always'], errors: MISSING_I}, - {code: 'new F(a,)', output: 'new F(a)', options: ['always-multiline'], errors: UNEXPECTED_I}, - {code: 'new F(a,)', output: 'new F(a)', options: ['only-multiline'], errors: UNEXPECTED_I}, - {code: 'new F(a,)', output: 'new F(a)', options: ['never'], errors: UNEXPECTED_I}, - {code: 'new F(a,\n)', output: 'new F(a\n)', options: ['never'], errors: UNEXPECTED_I}, - {code: 'new F(a\n)', output: 'new F(a,\n)', options: ['always'], errors: MISSING_I}, - {code: 'new F(a\n)', output: 'new F(a,\n)', options: ['always-multiline'], errors: MISSING_I}, - - {code: 'new F(...a)', output: 'new F(...a,)', options: ['always'], errors: MISSING_SE}, - {code: 'new F(...a,)', output: 'new F(...a)', options: ['always-multiline'], errors: UNEXPECTED_SE}, - {code: 'new F(...a,)', output: 'new F(...a)', options: ['only-multiline'], errors: UNEXPECTED_SE}, - {code: 'new F(...a,)', output: 'new F(...a)', options: ['never'], errors: UNEXPECTED_SE}, - {code: 'new F(...a,\n)', output: 'new F(...a\n)', options: ['never'], errors: UNEXPECTED_SE}, - {code: 'new F(...a\n)', output: 'new F(...a,\n)', options: ['always'], errors: MISSING_SE}, - {code: 'new F(...a\n)', output: 'new F(...a,\n)', options: ['always-multiline'], errors: MISSING_SE}, - ], -}); diff --git a/eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js deleted file mode 100644 index 86438a940c7f..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/generator-star-spacing.js +++ /dev/null @@ -1,1176 +0,0 @@ -/* eslint-disable */ -var rule = require('../../rules/generator-star-spacing'), - RuleTester = require('../RuleTester'); - -var features = { - generators: true -}; - -function ok(code, args){ - return { code: code, options: args, parser: 'babel-eslint', ecmaFeatures: features } -} - -function err(code, errors, args){ - var e = ok(code, args) - e.errors = errors - return e -} - -var ruleTester = new RuleTester(); -ruleTester.run('babel/generator-star-spacing', rule, { - valid: [ - // Default ("before") - { - code: "function foo(){}" - }, - { - code: "function *foo(){}", - ecmaFeatures: { generators: true } - }, - { - code: "function *foo(arg1, arg2){}", - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *foo(){};", - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *(){};", - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * (){};", - ecmaFeatures: { generators: true } - }, - { - code: "var foo = { *foo(){} };", - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = {*foo(){} };", - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo { *foo(){} }", - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo {*foo(){} }", - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static *foo(){} }", - ecmaFeatures: { classes: true, generators: true } - }, - - // "before" - { - code: "function foo(){}", - options: ["before"] - }, - { - code: "function *foo(){}", - options: ["before"], - ecmaFeatures: { generators: true } - }, - { - code: "function *foo(arg1, arg2){}", - options: ["before"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *foo(){};", - options: ["before"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *(){};", - options: ["before"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * (){};", - options: ["before"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = { *foo(){} };", - options: ["before"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = {*foo(){} };", - options: ["before"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo { *foo(){} }", - options: ["before"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo {*foo(){} }", - options: ["before"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static *foo(){} }", - options: ["before"], - ecmaFeatures: { classes: true, generators: true } - }, - - // "after" - { - code: "function foo(){}", - options: ["after"] - }, - { - code: "function* foo(){}", - options: ["after"], - ecmaFeatures: { generators: true } - }, - { - code: "function* foo(arg1, arg2){}", - options: ["after"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* foo(){};", - options: ["after"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* (){};", - options: ["after"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*(){};", - options: ["after"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = {* foo(){} };", - options: ["after"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = { * foo(){} };", - options: ["after"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo {* foo(){} }", - options: ["after"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { * foo(){} }", - options: ["after"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static* foo(){} }", - options: ["after"], - ecmaFeatures: { classes: true, generators: true } - }, - - // "both" - { - code: "function foo(){}", - options: ["both"] - }, - { - code: "function * foo(){}", - options: ["both"], - ecmaFeatures: { generators: true } - }, - { - code: "function * foo(arg1, arg2){}", - options: ["both"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * foo(){};", - options: ["both"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * (){};", - options: ["both"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *(){};", - options: ["both"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = { * foo(){} };", - options: ["both"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = {* foo(){} };", - options: ["both"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo { * foo(){} }", - options: ["both"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo {* foo(){} }", - options: ["both"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static * foo(){} }", - options: ["both"], - ecmaFeatures: { classes: true, generators: true } - }, - - // "neither" - { - code: "function foo(){}", - options: ["neither"] - }, - { - code: "function*foo(){}", - options: ["neither"], - ecmaFeatures: { generators: true } - }, - { - code: "function*foo(arg1, arg2){}", - options: ["neither"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*foo(){};", - options: ["neither"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*(){};", - options: ["neither"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* (){};", - options: ["neither"], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = {*foo(){} };", - options: ["neither"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = { *foo(){} };", - options: ["neither"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo {*foo(){} }", - options: ["neither"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { *foo(){} }", - options: ["neither"], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static*foo(){} }", - options: ["neither"], - ecmaFeatures: { classes: true, generators: true } - }, - - // {"before": true, "after": false} - { - code: "function foo(){}", - options: [{"before": true, "after": false}] - }, - { - code: "function *foo(){}", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "function *foo(arg1, arg2){}", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *foo(){};", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *(){};", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * (){};", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = { *foo(){} };", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = {*foo(){} };", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo { *foo(){} }", - options: [{"before": true, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo {*foo(){} }", - options: [{"before": true, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static *foo(){} }", - options: [{"before": true, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - - // {"before": false, "after": true} - { - code: "function foo(){}", - options: [{"before": false, "after": true}] - }, - { - code: "function* foo(){}", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "function* foo(arg1, arg2){}", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* foo(){};", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* (){};", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*(){};", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = {* foo(){} };", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = { * foo(){} };", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo {* foo(){} }", - options: [{"before": false, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { * foo(){} }", - options: [{"before": false, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static* foo(){} }", - options: [{"before": false, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - - // {"before": true, "after": true} - { - code: "function foo(){}", - options: [{"before": true, "after": true}] - }, - { - code: "function * foo(){}", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "function * foo(arg1, arg2){}", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * foo(){};", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function * (){};", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function *(){};", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = { * foo(){} };", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = {* foo(){} };", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo { * foo(){} }", - options: [{"before": true, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo {* foo(){} }", - options: [{"before": true, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static * foo(){} }", - options: [{"before": true, "after": true}], - ecmaFeatures: { classes: true, generators: true } - }, - - // {"before": false, "after": false} - { - code: "function foo(){}", - options: [{"before": false, "after": false}] - }, - { - code: "function*foo(){}", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "function*foo(arg1, arg2){}", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*foo(){};", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function*(){};", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = function* (){};", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true } - }, - { - code: "var foo = {*foo(){} };", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "var foo = { *foo(){} };", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true } - }, - { - code: "class Foo {*foo(){} }", - options: [{"before": false, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { *foo(){} }", - options: [{"before": false, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - { - code: "class Foo { static*foo(){} }", - options: [{"before": false, "after": false}], - ecmaFeatures: { classes: true, generators: true } - }, - - ok('var test = async function(){}'), - ok('async function test(){}'), - ok('var test = async function *(){}'), - ok('async function *test(){}', ["before"]) , - ok('async function* test(){}', ["after"]), - ok('async function * test(){}', ["both"]), - ok('async function*test(){}', ["neither"]), - ], - - invalid: [ - // Default ("before") - { - code: "function*foo(){}", - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "function* foo(arg1, arg2){}", - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*foo(){};", - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function* (){};", - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = {* foo(){} };", - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo {* foo(){} }", - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static* foo(){} }", - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - - // "before" - { - code: "function*foo(){}", - options: ["before"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "function* foo(arg1, arg2){}", - options: ["before"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*foo(){};", - options: ["before"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function* (){};", - options: ["before"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = {* foo(){} };", - options: ["before"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo {* foo(){} }", - options: ["before"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - - // "after" - { - code: "function*foo(){}", - options: ["after"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "function *foo(arg1, arg2){}", - options: ["after"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function *foo(){};", - options: ["after"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function *(){};", - options: ["after"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = { *foo(){} };", - options: ["after"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { *foo(){} }", - options: ["after"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static *foo(){} }", - options: ["after"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - - // "both" - { - code: "function*foo(){}", - options: ["both"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "function*foo(arg1, arg2){}", - options: ["both"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*foo(){};", - options: ["both"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*(){};", - options: ["both"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = {*foo(){} };", - options: ["both"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo {*foo(){} }", - options: ["both"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static*foo(){} }", - options: ["both"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - - // "neither" - { - code: "function * foo(){}", - options: ["neither"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "function * foo(arg1, arg2){}", - options: ["neither"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function * foo(){};", - options: ["neither"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function * (){};", - options: ["neither"], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = { * foo(){} };", - options: ["neither"], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { * foo(){} }", - options: ["neither"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static * foo(){} }", - options: ["neither"], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - - // {"before": true, "after": false} - { - code: "function*foo(){}", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "function* foo(arg1, arg2){}", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*foo(){};", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function* (){};", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = {* foo(){} };", - options: [{"before": true, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo {* foo(){} }", - options: [{"before": true, "after": false}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - - // {"before": false, "after": true} - { - code: "function*foo(){}", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "function *foo(arg1, arg2){}", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function *foo(){};", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function *(){};", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = { *foo(){} };", - options: [{"before": false, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { *foo(){} }", - options: [{"before": false, "after": true}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static *foo(){} }", - options: [{"before": false, "after": true}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - - // {"before": true, "after": true} - { - code: "function*foo(){}", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "function*foo(arg1, arg2){}", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*foo(){};", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function*(){};", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = {*foo(){} };", - options: [{"before": true, "after": true}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo {*foo(){} }", - options: [{"before": true, "after": true}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static*foo(){} }", - options: [{"before": true, "after": true}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Missing space after *.", - type: "Punctuator" - }] - }, - - // {"before": false, "after": false} - { - code: "function * foo(){}", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "function * foo(arg1, arg2){}", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function * foo(){};", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "var foo = function * (){};", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }] - }, - { - code: "var foo = { * foo(){} };", - options: [{"before": false, "after": false}], - ecmaFeatures: { generators: true, objectLiteralShorthandMethods: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { * foo(){} }", - options: [{"before": false, "after": false}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - { - code: "class Foo { static * foo(){} }", - options: [{"before": false, "after": false}], - ecmaFeatures: { classes: true, generators: true }, - errors: [{ - message: "Unexpected space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - }] - }, - err('async function*test(){}', [ - { message: 'Missing space before *.' }, - ]), - err('async function* test(){}', [ - { - message: "Missing space before *.", - type: "Punctuator" - }, { - message: "Unexpected space after *.", - type: "Punctuator" - } - ]), - - ] -}); diff --git a/eslint/babel-eslint-plugin/tests/rules/object-shorthand.js b/eslint/babel-eslint-plugin/tests/rules/object-shorthand.js deleted file mode 100644 index c35c086b51a1..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/object-shorthand.js +++ /dev/null @@ -1,108 +0,0 @@ -/* eslint-disable */ -var rule = require('../../rules/object-shorthand'), - RuleTester = require('../RuleTester'); - -var features = { - objectLiteralShorthandMethods: true, - objectLiteralComputedProperties: true, - objectLiteralShorthandProperties: true, - arrowFunctions: true, - destructuring: true, - generators: true -}; - -function ok(code, args){ - return { code: code, parser: 'babel-eslint', ecmaFeatures: features} -} - - -var ruleTester = new RuleTester(); -ruleTester.run('babel/object-shorthand', rule, { - valid: [ - //original test cases - { code: "var x = {y() {}}", ecmaFeatures: features }, - { code: "var x = {y}", ecmaFeatures: features }, - { code: "var x = {a: b}", ecmaFeatures: features }, - { code: "var x = {a: 'a'}", ecmaFeatures: features }, - { code: "var x = {'a': 'a'}", ecmaFeatures: features }, - { code: "var x = {'a': b}", ecmaFeatures: features }, - { code: "var x = {y(x) {}}", ecmaFeatures: features }, - { code: "var {x,y,z} = x", ecmaFeatures: features }, - { code: "var {x: {y}} = z", ecmaFeatures: features }, - { code: "var x = {*x() {}}", ecmaFeatures: features }, - { code: "var x = {x: y}", ecmaFeatures: features }, - { code: "var x = {x: y, y: z}", ecmaFeatures: features}, - { code: "var x = {x: y, y: z, z: 'z'}", ecmaFeatures: features}, - { code: "var x = {x() {}, y: z, l(){}}", ecmaFeatures: features}, - { code: "var x = {x: y, y: z, a: b}", ecmaFeatures: features}, - { code: "var x = {x: y, y: z, 'a': b}", ecmaFeatures: features}, - { code: "var x = {x: y, y() {}, z: a}", ecmaFeatures: features}, - { code: "doSomething({x: y})", ecmaFeatures: features}, - { code: "doSomething({'x': y})", ecmaFeatures: features}, - { code: "doSomething({x: 'x'})", ecmaFeatures: features}, - { code: "doSomething({'x': 'x'})", ecmaFeatures: features}, - { code: "doSomething({y() {}})", ecmaFeatures: features}, - { code: "doSomething({x: y, y() {}})", ecmaFeatures: features}, - { code: "doSomething({y() {}, z: a})", ecmaFeatures: features}, - { code: "!{ a: function a(){} };", ecmaFeatures: features }, - - // arrows functions are still alright - { code: "var x = {y: (x)=>x}", ecmaFeatures: features }, - { code: "doSomething({y: (x)=>x})", ecmaFeatures: features }, - { code: "var x = {y: (x)=>x, y: a}", ecmaFeatures: features }, - { code: "doSomething({x, y: (x)=>x})", ecmaFeatures: features }, - - // getters and setters are ok - { code: "var x = {get y() {}}", ecmaFeatures: features }, - { code: "var x = {set y(z) {}}", ecmaFeatures: features }, - { code: "var x = {get y() {}, set y(z) {}}", ecmaFeatures: features }, - { code: "doSomething({get y() {}})", ecmaFeatures: features }, - { code: "doSomething({set y(z) {}})", ecmaFeatures: features }, - { code: "doSomething({get y() {}, set y(z) {}})", ecmaFeatures: features }, - - // object literal computed properties - { code: "var x = {[y]: y}", ecmaFeatures: features, options: ["properties"] }, - { code: "var x = {['y']: 'y'}", ecmaFeatures: features, options: ["properties"] }, - { code: "var x = {['y']: y}", ecmaFeatures: features, options: ["properties"] }, - - // options - { code: "var x = {y() {}}", ecmaFeatures: features, options: ["methods"] }, - { code: "var x = {x, y() {}, a:b}", ecmaFeatures: features, options: ["methods"] }, - { code: "var x = {y}", ecmaFeatures: features, options: ["properties"] }, - { code: "var x = {y: {b}}", ecmaFeatures: features, options: ["properties"] }, - { code: "var x = {a: n, c: d, f: g}", ecmaFeatures: features, options: ["never"] }, - { code: "var x = {a: function(){}, b: {c: d}}", ecmaFeatures: features, options: ["never"] }, - - // Babel test cases. - ok('let { ...spread } = obj'), - ok('let { ...spread } = obj', [2, 'never']), - ], - - invalid: [ - { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "var x = {'x': x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "var x = {y: y, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }, { message: "Expected property shorthand.", type: "Property" }] }, - { code: "var x = {y: z, x: x, a: b}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, - { code: "var x = {y: function*() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, - { code: "var x = {x: y, y: z, a: a}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "var x = {x: y, y: z, a: function(){}, b() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, - { code: "var x = {x: x, y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }, { message: "Expected method shorthand.", type: "Property" }]}, - { code: "doSomething({x: x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "doSomething({'x': x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "doSomething({a: 'a', 'x': x})", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }] }, - { code: "doSomething({y: function() {}})", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }] }, - - // options - { code: "var x = {y: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], options: ["methods"] }, - { code: "var x = {x, y() {}, z: function() {}}", ecmaFeatures: features, errors: [{ message: "Expected method shorthand.", type: "Property" }], options: ["methods"] }, - { code: "var x = {x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], options: ["properties"] }, - { code: "var x = {a, b, c(){}, x: x}", ecmaFeatures: features, errors: [{ message: "Expected property shorthand.", type: "Property" }], options: ["properties"] }, - { code: "var x = {y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], options: ["never"] }, - { code: "var x = {*y() {}}", ecmaFeatures: features, errors: [{ message: "Expected longform method syntax.", type: "Property" }], options: ["never"] }, - { code: "var x = {y}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], options: ["never"]}, - { code: "var x = {y, a: b, *x(){}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }, { message: "Expected longform method syntax.", type: "Property" }], options: ["never"]}, - { code: "var x = {y: {x}}", ecmaFeatures: features, errors: [{ message: "Expected longform property syntax.", type: "Property" }], options: ["never"]} - - ] -}); From 9c9bff745ced370e84bf949f4d0fb3bd754199e9 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 16:45:47 -0500 Subject: [PATCH 736/965] readme: drop node < 4 [skip ci] --- eslint/babel-eslint-plugin/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 5a84afbabe8f..157bd2d79ce7 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -4,6 +4,8 @@ An `eslint` plugin companion to `babel-eslint`. `babel-eslint` does a great job for use with Babel, but it can't change the built in rules to support experimental features. `eslint-plugin-babel` re-implements problematic rules so they do not give false positives or negatives. +> Requires Node 4 or greater + ### Install ```sh From 3855f28ebb4f59b9c7e1f60120a5f9b3b23083c7 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Thu, 17 Nov 2016 16:46:29 -0500 Subject: [PATCH 737/965] 4.0.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index f372bd09cf1c..61dca492c1c9 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "3.3.0", + "version": "4.0.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 7f94d5f75fd60ed81650d798c2d52ed4741216c2 Mon Sep 17 00:00:00 2001 From: Matthew Wagerfield Date: Wed, 18 Jan 2017 23:01:31 +0000 Subject: [PATCH 738/965] Updated rules to new format, added deprecated flag (babel/eslint-plugin-babel#119) --- .../rules/array-bracket-spacing.js | 68 ++++++++++--------- .../babel-eslint-plugin/rules/arrow-parens.js | 40 ++++++----- .../rules/flow-object-type.js | 42 ++++++------ .../rules/func-params-comma-dangle.js | 40 ++++++----- .../rules/generator-star-spacing.js | 62 +++++++++-------- .../rules/object-shorthand.js | 40 ++++++----- 6 files changed, 158 insertions(+), 134 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js index a7da50b78573..0a9ba375216b 100644 --- a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js @@ -1,39 +1,43 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "never"] + }, + { + "type": "object", + "properties": { + "singleValue": { + "type": "boolean" + }, + "objectsInArrays": { + "type": "boolean" + }, + "arraysInArrays": { + "type": "boolean" + } + }, + "additionalProperties": false } - - /* eslint-disable no-console */ - console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + - 'use the built in array-bracket-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] + ] }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + + 'use the built in array-bracket-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; } - }, - "additionalProperties": false + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index 03f50dcfd07c..13d9c8ffe01b 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -1,24 +1,28 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "as-needed"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/arrow-parens rule is deprecated. Please ' + - 'use the built in arrow-parens rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "enum": ["always", "as-needed"] + /* eslint-disable no-console */ + console.log('The babel/arrow-parens rule is deprecated. Please ' + + 'use the built in arrow-parens rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/rules/flow-object-type.js index 530efb8d653d..73cd3ed17a47 100644 --- a/eslint/babel-eslint-plugin/rules/flow-object-type.js +++ b/eslint/babel-eslint-plugin/rules/flow-object-type.js @@ -1,25 +1,29 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["semicolon", "comma"], } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/flow-object-type rule is deprecated. Please ' + - 'use the flowtype/object-type-delimiter rule instead.\n' + - 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/flow-object-type rule is deprecated. Please ' + + 'use the flowtype/object-type-delimiter rule instead.\n' + + 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - 'enum': ['semicolon', 'comma'], - } -]; diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js index bf5c1eee5c3d..0290d81323d4 100644 --- a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js @@ -1,24 +1,28 @@ 'use strict'; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "always-multiline", "only-multiline", "never"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + - 'use the built in comma-dangle rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + + 'use the built in comma-dangle rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - enum: ['always', 'always-multiline', 'only-multiline', 'never'] - } -]; diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js index 38d586c6e365..64186ffe680f 100644 --- a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -1,36 +1,40 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } - - /* eslint-disable no-console */ - console.log('The babel/generator-star-spacing rule is deprecated. Please ' + - 'use the built in generator-star-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; -}; - -module.exports.schema = [ - { - "oneOf": [ +module.exports = { + meta: { + deprecated: true, + schema: [ { - "enum": ["before", "after", "both", "neither"] - }, - { - "type": "object", - "properties": { - "before": {"type": "boolean"}, - "after": {"type": "boolean"} - }, - "additionalProperties": false + "oneOf": [ + { + "enum": ["before", "after", "both", "neither"] + }, + { + "type": "object", + "properties": { + "before": {"type": "boolean"}, + "after": {"type": "boolean"} + }, + "additionalProperties": false + } + ] } ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } + + /* eslint-disable no-console */ + console.log('The babel/generator-star-spacing rule is deprecated. Please ' + + 'use the built in generator-star-spacing rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; } -]; +}; diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js index eaf24a1803ed..73ce1365ba40 100644 --- a/eslint/babel-eslint-plugin/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -1,24 +1,28 @@ "use strict"; var isWarnedForDeprecation = false; -module.exports = function() { - return { - Program() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; +module.exports = { + meta: { + deprecated: true, + schema: [ + { + "enum": ["always", "methods", "properties", "never"] } + ] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/object-shorthand rule is deprecated. Please ' + - 'use the built in object-shorthand rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; + /* eslint-disable no-console */ + console.log('The babel/object-shorthand rule is deprecated. Please ' + + 'use the built in object-shorthand rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports.schema = [ - { - 'enum': ['always', 'methods', 'properties', 'never'] - } -]; From 4b52a4c70711206c7e6023a3e3964c064436e992 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Wed, 18 Jan 2017 18:03:24 -0500 Subject: [PATCH 739/965] 4.0.1 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 61dca492c1c9..f5c621e31361 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "4.0.0", + "version": "4.0.1", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 71202609b57a1a51f317cee9eba5da55b78872e7 Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Mon, 27 Feb 2017 11:58:50 -0800 Subject: [PATCH 740/965] Add babel semi (babel/eslint-plugin-babel#121) * Add semi from eslint * Add ClassProperty support to semi rule Fixes babel/eslint-plugin-babel#43 --- eslint/babel-eslint-plugin/README.md | 4 +- eslint/babel-eslint-plugin/index.js | 2 + eslint/babel-eslint-plugin/rules/semi.js | 225 ++++++++++++++++++ .../babel-eslint-plugin/tests/rules/semi.js | 191 +++++++++++++++ 4 files changed, 421 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/rules/semi.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/semi.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 157bd2d79ce7..9444f93f9ced 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -32,7 +32,8 @@ original ones as well!). "babel/object-curly-spacing": 1, "babel/no-await-in-loop": 1, "babel/flow-object-type": 1, - "babel/no-invalid-this": 1 + "babel/no-invalid-this": 1, + "babel/semi": 1 } } ``` @@ -45,6 +46,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠 ) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) +- `babel/semi`: Includes class properties (🛠 ) The following rules are not in `eslint`, but are relevant only to syntax that is not specified by the current JavaScript standard or supported by `eslint`. diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index efba7b74eb37..ffc2cf994a93 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -12,6 +12,7 @@ module.exports = { 'flow-object-type': require('./rules/flow-object-type'), 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), 'no-invalid-this': require('./rules/no-invalid-this'), + 'semi': require('./rules/semi'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -24,5 +25,6 @@ module.exports = { 'flow-object-type': 0, 'func-params-comma-dangle': 0, 'no-invalid-this': 0, + 'semi': 0, } }; diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/rules/semi.js new file mode 100644 index 000000000000..48bbb7e49673 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/semi.js @@ -0,0 +1,225 @@ +/** + * @fileoverview Rule to flag missing semicolons. + * @author Nicholas C. Zakas + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + docs: { + description: "require or disallow semicolons instead of ASI", + category: "Stylistic Issues", + recommended: false + }, + + fixable: "code", + + schema: { + anyOf: [ + { + type: "array", + items: [ + { + enum: ["never"] + } + ], + minItems: 0, + maxItems: 1 + }, + { + type: "array", + items: [ + { + enum: ["always"] + }, + { + type: "object", + properties: { + omitLastInOneLineBlock: { type: "boolean" } + }, + additionalProperties: false + } + ], + minItems: 0, + maxItems: 2 + } + ] + } + }, + + create(context) { + + const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` + const options = context.options[1]; + const never = context.options[0] === "never", + exceptOneLine = options && options.omitLastInOneLineBlock === true, + sourceCode = context.getSourceCode(); + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + /** + * Reports a semicolon error with appropriate location and message. + * @param {ASTNode} node The node with an extra or missing semicolon. + * @param {boolean} missing True if the semicolon is missing. + * @returns {void} + */ + function report(node, missing) { + const lastToken = sourceCode.getLastToken(node); + let message, + fix, + loc = lastToken.loc; + + if (!missing) { + message = "Missing semicolon."; + loc = loc.end; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + message = "Extra semicolon."; + loc = loc.start; + fix = function(fixer) { + return fixer.remove(lastToken); + }; + } + + context.report({ + node, + loc, + message, + fix + }); + + } + + /** + * Checks whether a token is a semicolon punctuator. + * @param {Token} token The token. + * @returns {boolean} True if token is a semicolon punctuator. + */ + function isSemicolon(token) { + return (token.type === "Punctuator" && token.value === ";"); + } + + /** + * Check if a semicolon is unnecessary, only true if: + * - next token is on a new line and is not one of the opt-out tokens + * - next token is a valid statement divider + * @param {Token} lastToken last token of current node. + * @returns {boolean} whether the semicolon is unnecessary. + */ + function isUnnecessarySemicolon(lastToken) { + if (!isSemicolon(lastToken)) { + return false; + } + + const nextToken = sourceCode.getTokenAfter(lastToken); + + if (!nextToken) { + return true; + } + + const lastTokenLine = lastToken.loc.end.line; + const nextTokenLine = nextToken.loc.start.line; + const isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value) && nextToken.value !== "++" && nextToken.value !== "--"; + const isDivider = (nextToken.value === "}" || nextToken.value === ";"); + + return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; + } + + /** + * Checks a node to see if it's in a one-liner block statement. + * @param {ASTNode} node The node to check. + * @returns {boolean} whether the node is in a one-liner block statement. + */ + function isOneLinerBlock(node) { + const nextToken = sourceCode.getTokenAfter(node); + + if (!nextToken || nextToken.value !== "}") { + return false; + } + + const parent = node.parent; + + return parent && parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line; + } + + /** + * Checks a node to see if it's followed by a semicolon. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolon(node) { + const lastToken = sourceCode.getLastToken(node); + + if (never) { + if (isUnnecessarySemicolon(lastToken)) { + report(node, true); + } + } else { + if (!isSemicolon(lastToken)) { + if (!exceptOneLine || !isOneLinerBlock(node)) { + report(node); + } + } else { + if (exceptOneLine && isOneLinerBlock(node)) { + report(node, true); + } + } + } + } + + /** + * Checks to see if there's a semicolon after a variable declaration. + * @param {ASTNode} node The node to check. + * @returns {void} + */ + function checkForSemicolonForVariableDeclaration(node) { + const ancestors = context.getAncestors(), + parentIndex = ancestors.length - 1, + parent = ancestors[parentIndex]; + + if ((parent.type !== "ForStatement" || parent.init !== node) && + (!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node) + ) { + checkForSemicolon(node); + } + } + + //-------------------------------------------------------------------------- + // Public API + //-------------------------------------------------------------------------- + + return { + VariableDeclaration: checkForSemicolonForVariableDeclaration, + ExpressionStatement: checkForSemicolon, + ReturnStatement: checkForSemicolon, + ThrowStatement: checkForSemicolon, + DoWhileStatement: checkForSemicolon, + DebuggerStatement: checkForSemicolon, + BreakStatement: checkForSemicolon, + ContinueStatement: checkForSemicolon, + ImportDeclaration: checkForSemicolon, + ExportAllDeclaration: checkForSemicolon, + ClassProperty: checkForSemicolon, + ExportNamedDeclaration(node) { + if (!node.declaration) { + checkForSemicolon(node); + } + }, + ExportDefaultDeclaration(node) { + if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) { + checkForSemicolon(node); + } + } + }; + + } +}; diff --git a/eslint/babel-eslint-plugin/tests/rules/semi.js b/eslint/babel-eslint-plugin/tests/rules/semi.js new file mode 100644 index 000000000000..3d146a1b8d04 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/semi.js @@ -0,0 +1,191 @@ +/* eslnit-disable */ +/** + * @fileoverview Tests for semi rule. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const rule = require("../../rules/semi"), + RuleTester = require("../RuleTester"); + +const ruleTester = new RuleTester(); + +ruleTester.run("semi", rule, { + valid: [ + "var x = 5;", + "var x =5, y;", + "foo();", + "x = foo();", + "setTimeout(function() {foo = \"bar\"; });", + "setTimeout(function() {foo = \"bar\";});", + "for (var a in b){}", + "for (var i;;){}", + "if (true) {}\n;[global, extended].forEach(function(){});", + "throw new Error('foo');", + { code: "throw new Error('foo')", options: ["never"] }, + { code: "var x = 5", options: ["never"] }, + { code: "var x =5, y", options: ["never"] }, + { code: "foo()", options: ["never"] }, + { code: "debugger", options: ["never"] }, + { code: "for (var a in b){}", options: ["never"] }, + { code: "for (var i;;){}", options: ["never"] }, + { code: "x = foo()", options: ["never"] }, + { code: "if (true) {}\n;[global, extended].forEach(function(){})", options: ["never"] }, + { code: "(function bar() {})\n;(function foo(){})", options: ["never"] }, + { code: ";/foo/.test('bar')", options: ["never"] }, + { code: ";+5", options: ["never"] }, + { code: ";-foo()", options: ["never"] }, + { code: "a++\nb++", options: ["never"] }, + { code: "a++; b++", options: ["never"] }, + { code: "for (let thing of {}) {\n console.log(thing);\n}", parserOptions: { ecmaVersion: 6 } }, + { code: "do{}while(true)", options: ["never"] }, + { code: "do{}while(true);", options: ["always"] }, + + { code: "if (foo) { bar() }", options: ["always", { omitLastInOneLineBlock: true }] }, + { code: "if (foo) { bar(); baz() }", options: ["always", { omitLastInOneLineBlock: true }] }, + + + // method definitions don't have a semicolon. + { code: "class A { a() {} b() {} }", parserOptions: { ecmaVersion: 6 } }, + { code: "var A = class { a() {} b() {} };", parserOptions: { ecmaVersion: 6 } }, + + { code: "import theDefault, { named1, named2 } from 'src/mylib';", parserOptions: { sourceType: "module" } }, + { code: "import theDefault, { named1, named2 } from 'src/mylib'", options: ["never"], parserOptions: { sourceType: "module" } }, + + // exports, "always" + { code: "export * from 'foo';", parserOptions: { sourceType: "module" } }, + { code: "export { foo } from 'foo';", parserOptions: { sourceType: "module" } }, + { code: "export { foo };", parserOptions: { sourceType: "module" } }, + { code: "export var foo;", parserOptions: { sourceType: "module" } }, + { code: "export function foo () { }", parserOptions: { sourceType: "module" } }, + { code: "export function* foo () { }", parserOptions: { sourceType: "module" } }, + { code: "export class Foo { }", parserOptions: { sourceType: "module" } }, + { code: "export let foo;", parserOptions: { sourceType: "module" } }, + { code: "export const FOO = 42;", parserOptions: { sourceType: "module" } }, + { code: "export default function() { }", parserOptions: { sourceType: "module" } }, + { code: "export default function* () { }", parserOptions: { sourceType: "module" } }, + { code: "export default class { }", parserOptions: { sourceType: "module" } }, + { code: "export default foo || bar;", parserOptions: { sourceType: "module" } }, + { code: "export default (foo) => foo.bar();", parserOptions: { sourceType: "module" } }, + { code: "export default foo = 42;", parserOptions: { sourceType: "module" } }, + { code: "export default foo += 42;", parserOptions: { sourceType: "module" } }, + + // exports, "never" + { code: "export * from 'foo'", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export { foo } from 'foo'", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export { foo }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export var foo", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export function foo () { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export function* foo () { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export class Foo { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export let foo", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export const FOO = 42", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default function() { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default function* () { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default class { }", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default foo || bar", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default (foo) => foo.bar()", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default foo = 42", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "export default foo += 42", options: ["never"], parserOptions: { sourceType: "module" } }, + { code: "++\nfoo;", options: ["always"] }, + { code: "var a = b;\n+ c", options: ["never"] }, + + // https://github.com/eslint/eslint/issues/7782 + { code: "var a = b;\n/foo/.test(c)", options: ["never"] }, + { code: "var a = b;\n`foo`", options: ["never"], parserOptions: { ecmaVersion: 6 } }, + + // babel + "class Foo { bar = 'example'; }", + "class Foo { static bar = 'example'; }", + + // babel, "never" + { code: "class Foo { bar = 'example' }", options: ["never"] }, + { code: "class Foo { static bar = 'example' }", options: ["never"] } + ], + invalid: [ + { code: "import * as utils from './utils'", output: "import * as utils from './utils';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration", column: 33 }] }, + { code: "import { square, diag } from 'lib'", output: "import { square, diag } from 'lib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, + { code: "import { default as foo } from 'lib'", output: "import { default as foo } from 'lib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, + { code: "import 'src/mylib'", output: "import 'src/mylib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, + { code: "import theDefault, { named1, named2 } from 'src/mylib'", output: "import theDefault, { named1, named2 } from 'src/mylib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, + { code: "function foo() { return [] }", output: "function foo() { return []; }", errors: [{ message: "Missing semicolon.", type: "ReturnStatement" }] }, + { code: "while(true) { break }", output: "while(true) { break; }", errors: [{ message: "Missing semicolon.", type: "BreakStatement" }] }, + { code: "while(true) { continue }", output: "while(true) { continue; }", errors: [{ message: "Missing semicolon.", type: "ContinueStatement" }] }, + { code: "let x = 5", output: "let x = 5;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "var x = 5", output: "var x = 5;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "var x = 5, y", output: "var x = 5, y;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "debugger", output: "debugger;", errors: [{ message: "Missing semicolon.", type: "DebuggerStatement" }] }, + { code: "foo()", output: "foo();", errors: [{ message: "Missing semicolon.", type: "ExpressionStatement" }] }, + { code: "var x = 5, y", output: "var x = 5, y;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "for (var a in b) var i ", output: "for (var a in b) var i; ", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "for (;;){var i}", output: "for (;;){var i;}", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "for (;;) var i ", output: "for (;;) var i; ", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "for (var j;;) {var i}", output: "for (var j;;) {var i;}", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "var foo = {\n bar: baz\n}", output: "var foo = {\n bar: baz\n};", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration", line: 3 }] }, + { code: "var foo\nvar bar;", output: "var foo;\nvar bar;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration", line: 1 }] }, + { code: "throw new Error('foo')", output: "throw new Error('foo');", errors: [{ message: "Missing semicolon.", type: "ThrowStatement", line: 1 }] }, + { code: "do{}while(true)", output: "do{}while(true);", errors: [{ message: "Missing semicolon.", type: "DoWhileStatement", line: 1 }] }, + + { code: "throw new Error('foo');", output: "throw new Error('foo')", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ThrowStatement", column: 23 }] }, + { code: "function foo() { return []; }", output: "function foo() { return [] }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ReturnStatement" }] }, + { code: "while(true) { break; }", output: "while(true) { break }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "BreakStatement" }] }, + { code: "while(true) { continue; }", output: "while(true) { continue }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ContinueStatement" }] }, + { code: "let x = 5;", output: "let x = 5", parserOptions: { ecmaVersion: 6 }, options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "var x = 5;", output: "var x = 5", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "var x = 5, y;", output: "var x = 5, y", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "debugger;", output: "debugger", options: ["never"], errors: [{ message: "Extra semicolon.", type: "DebuggerStatement" }] }, + { code: "foo();", output: "foo()", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ExpressionStatement" }] }, + { code: "var x = 5, y;", output: "var x = 5, y", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "for (var a in b) var i; ", output: "for (var a in b) var i ", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "for (;;){var i;}", output: "for (;;){var i}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "for (;;) var i; ", output: "for (;;) var i ", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "for (var j;;) {var i;}", output: "for (var j;;) {var i}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "var foo = {\n bar: baz\n};", output: "var foo = {\n bar: baz\n}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration", line: 3 }] }, + { code: "import theDefault, { named1, named2 } from 'src/mylib';", output: "import theDefault, { named1, named2 } from 'src/mylib'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ImportDeclaration" }] }, + { code: "do{}while(true);", output: "do{}while(true)", options: ["never"], errors: [{ message: "Extra semicolon.", type: "DoWhileStatement", line: 1 }] }, + + { code: "if (foo) { bar()\n }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, + { code: "if (foo) {\n bar() }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, + { code: "if (foo) {\n bar(); baz() }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, + { code: "if (foo) { bar(); }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Extra semicolon." }] }, + + + // exports, "always" + { code: "export * from 'foo'", output: "export * from 'foo';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportAllDeclaration" }] }, + { code: "export { foo } from 'foo'", output: "export { foo } from 'foo';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportNamedDeclaration" }] }, + { code: "export { foo }", output: "export { foo };", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportNamedDeclaration" }] }, + { code: "export var foo", output: "export var foo;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "export let foo", output: "export let foo;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "export const FOO = 42", output: "export const FOO = 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, + { code: "export default foo || bar", output: "export default foo || bar;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default (foo) => foo.bar()", output: "export default (foo) => foo.bar();", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default foo = 42", output: "export default foo = 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default foo += 42", output: "export default foo += 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, + + // exports, "never" + { code: "export * from 'foo';", output: "export * from 'foo'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportAllDeclaration" }] }, + { code: "export { foo } from 'foo';", output: "export { foo } from 'foo'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }] }, + { code: "export { foo };", output: "export { foo }", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }] }, + { code: "export var foo;", output: "export var foo", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "export let foo;", output: "export let foo", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "export const FOO = 42;", output: "export const FOO = 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, + { code: "export default foo || bar;", output: "export default foo || bar", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default (foo) => foo.bar();", output: "export default (foo) => foo.bar()", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default foo = 42;", output: "export default foo = 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "export default foo += 42;", output: "export default foo += 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, + { code: "a;\n++b", output: "a\n++b", options: ["never"], errors: [{ message: "Extra semicolon." }] }, + + // babel + { code: "class Foo { bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, + { code: "class Foo { static bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, + + // babel, "never" + { code: "class Foo { bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] }, + { code: "class Foo { static bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] } + ] +}); From c548da9d36eae721fa231e4423850befdb7d8336 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 27 Feb 2017 15:00:01 -0500 Subject: [PATCH 741/965] 4.1.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index f5c621e31361..36db612b2492 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "4.0.1", + "version": "4.1.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 399c182ab52d2772d30ddc5c4ea0b9b3103a60ce Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Sat, 4 Mar 2017 09:35:33 -0500 Subject: [PATCH 742/965] Merge pull request babel/eslint-plugin-babel#123 from daltones/master Deprecate rule `no-await-in-loop` --- eslint/babel-eslint-plugin/README.md | 14 +-- .../rules/no-await-in-loop.js | 84 ++++---------- .../tests/rules/no-await-in-loop.js | 106 ------------------ 3 files changed, 24 insertions(+), 180 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 9444f93f9ced..82a80d5d42d4 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -30,8 +30,6 @@ original ones as well!). "rules": { "babel/new-cap": 1, "babel/object-curly-spacing": 1, - "babel/no-await-in-loop": 1, - "babel/flow-object-type": 1, "babel/no-invalid-this": 1, "babel/semi": 1 } @@ -41,17 +39,12 @@ original ones as well!). Each rule corresponds to a core `eslint` rule, and has the same options. -🛠 : means it's autofixable with `--fix`. +🛠: means it's autofixable with `--fix`. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠 ) +- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) -- `babel/semi`: Includes class properties (🛠 ) - -The following rules are not in `eslint`, but are relevant only to syntax that is not specified by -the current JavaScript standard or supported by `eslint`. - -- `babel/no-await-in-loop`: guard against awaiting async functions inside of a loop +- `babel/semi`: Includes class properties (🛠) #### Deprecated @@ -61,3 +54,4 @@ the current JavaScript standard or supported by `eslint`. - `babel/func-params-comma-dangle`: Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle). - `babel/array-bracket-spacing`: Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing). - `babel/flow-object-type`: Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter). +- `babel/no-await-in-loop`: Use [`no-await-in-loop`](http://eslint.org/docs/rules/no-await-in-loop). diff --git a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js index 037f29be74c9..8ef295f36fd3 100644 --- a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js @@ -1,68 +1,24 @@ -/** - * @fileoverview Rule to disallow uses of await inside of loops. - * @author Nat Mote - */ "use strict"; -// Node types which are considered loops. -var loopTypes = { - 'ForStatement': true, - 'ForOfStatement': true, - 'ForInStatement': true, - 'WhileStatement': true, - 'DoWhileStatement': true, -}; +var isWarnedForDeprecation = false; +module.exports = { + meta: { + deprecated: true, + schema: [] + }, + create: function() { + return { + Program: function() { + if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { + return; + } -// Node types at which we should stop looking for loops. For example, it is fine to declare an async -// function within a loop, and use await inside of that. -var boundaryTypes = { - 'FunctionDeclaration': true, - 'FunctionExpression': true, - 'ArrowFunctionExpression': true, + /* eslint-disable no-console */ + console.log('The babel/no-await-in-loop rule is deprecated. Please ' + + 'use the built in no-await-in-loop rule instead.'); + /* eslint-enable no-console */ + isWarnedForDeprecation = true; + } + }; + } }; - -module.exports = function(context) { - return { - AwaitExpression(node) { - var ancestors = context.getAncestors(); - // Reverse so that we can traverse from the deepest node upwards. - ancestors.reverse(); - // Create a set of all the ancestors plus this node so that we can check - // if this use of await appears in the body of the loop as opposed to - // the right-hand side of a for...of, for example. - // - // Implement the set with an Array since there are likely to be very few - // elements. An Object would not be appropriate since the elements are - // not strings. - var ancestorSet = [].concat(ancestors, [node]); - var ancestorSetHas = function(element) { - return ancestorSet.indexOf(element) !== -1; - } - for (var i = 0; i < ancestors.length; i++) { - var ancestor = ancestors[i]; - if (boundaryTypes.hasOwnProperty(ancestor.type)) { - // Short-circuit out if we encounter a boundary type. Loops above - // this do not matter. - return; - } - if (loopTypes.hasOwnProperty(ancestor.type)) { - // Only report if we are actually in the body or another part that gets executed on - // every iteration. - if ( - ancestorSetHas(ancestor.body) || - ancestorSetHas(ancestor.test) || - ancestorSetHas(ancestor.update) - ) { - context.report( - node, - 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + - 'you are sure you want to do this, add `// eslint-disable-line ' + - context.id + '` at the end of this line.' - ); - return; - } - } - } - }, - }; -} diff --git a/eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js deleted file mode 100644 index 97de50fdd940..000000000000 --- a/eslint/babel-eslint-plugin/tests/rules/no-await-in-loop.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * @fileoverview Tests for no-await-in-loop. - * @author Nat Mote - */ - -"use strict"; - -var rule = require("../../rules/no-await-in-loop"), - RuleTester = require('../RuleTester'); - -var features = { -}; - -function test(code, errors){ - var result = { - code: code, - parser: 'babel-eslint', - ecmaFeatures: features, - }; - if (errors != null) { - result.errors = errors; - } - return result; -} - -var ruleName = 'babel/no-await-in-loop'; - -var message = 'Avoid using await inside a loop. Consider refactoring to use Promise.all. If ' + - 'you are sure you want to do this, add `// eslint-disable-line ' + - ruleName + '` at the end of this line.' - -function ok(code) { - return test(code); -} - -function err(code) { - return test(code, [message]); -} - -// Construct an async function with the given body -function fun(body) { - return "async function foo() { " + body + " }"; -} - -// Construct a loop -function loop(kind, condition, body) { - return kind + " (" + condition + ") { " + body + " }"; -} - -// Construct a class with the given body -function cls(body) { - return "class Foo { " + body + " }"; -} - -var cases = [ - ok(fun("await bar;")), - - // While loops - ok(fun(loop("while", "true", fun("await bar;")))), // Blocked by a function declaration - err(fun(loop("while", "baz", "await bar;"))), - err(fun(loop("while", "await foo()", ""))), - - // For of loops - err(fun(loop("for", "var bar of baz", "await bar;"))), - - // For in loops - err(fun(loop("for", "var bar in baz", "await bar;"))), - - // For loops - ok(fun(loop("for", "var i = await bar; i < n; i++", ""))), - err(fun(loop("for", "var i; i < n; i++", "await bar;"))), - err(fun(loop("for", "var i; await foo(i); i++", ""))), - err(fun(loop("for", "var i; i < n; i = await bar", ""))), - - // Do while loops - ok(fun("do { } while (bar);")), - err(fun("do { await bar; } while (baz);")), - err(fun("do { } while (await bar);")), - - // Blocked by a function expression - ok(fun(loop("while", "true", "var y = async function() { await bar; }"))), - // Blocked by an arrow function - ok(fun(loop("while", "true", "var y = async () => await foo;"))), - ok(fun(loop("while", "true", "var y = async () => { await foo; }"))), - // Blocked by a class method, - ok(fun(loop("while", "true", cls("async foo() { await bar; }")))), - - // Deep in a loop body - err(fun(loop("while", "true", "if (bar) { foo(await bar); }"))), - // Deep in a loop condition - err(fun(loop("while", "xyz || 5 > await x", ""))), -]; - -function hasError(testCase) { - return testCase.errors != null && testCase.errors.length > 0; -} - -function hasNoError(testCase) { - return !hasError(testCase); -} - -var ruleTester = new RuleTester(); -ruleTester.run(ruleName, rule, { - valid: cases.filter(hasNoError), - invalid: cases.filter(hasError), -}); From dc0109ad3d17eaa3a3055e8f9ed59657d79d78ef Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Mon, 6 Mar 2017 10:48:48 -0500 Subject: [PATCH 743/965] 4.1.1 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 36db612b2492..7d7d3f2e481b 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "4.1.0", + "version": "4.1.1", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From da75b8484fdc6ee46ced305f34715a69eb56d295 Mon Sep 17 00:00:00 2001 From: Brandon Kobel Date: Wed, 10 May 2017 12:09:23 -0400 Subject: [PATCH 744/965] Modifying semi rule to support for await (babel/eslint-plugin-babel#126) --- eslint/babel-eslint-plugin/README.md | 2 +- eslint/babel-eslint-plugin/rules/semi.js | 2 +- eslint/babel-eslint-plugin/tests/rules/semi.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 82a80d5d42d4..a9da5486713d 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -44,7 +44,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) -- `babel/semi`: Includes class properties (🛠) +- `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) #### Deprecated diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/rules/semi.js index 48bbb7e49673..0f9ef74f4ec0 100644 --- a/eslint/babel-eslint-plugin/rules/semi.js +++ b/eslint/babel-eslint-plugin/rules/semi.js @@ -187,7 +187,7 @@ module.exports = { parent = ancestors[parentIndex]; if ((parent.type !== "ForStatement" || parent.init !== node) && - (!/^For(?:In|Of)Statement/.test(parent.type) || parent.left !== node) + (!/^For(?:In|Of|Await)Statement/.test(parent.type) || parent.left !== node) ) { checkForSemicolon(node); } diff --git a/eslint/babel-eslint-plugin/tests/rules/semi.js b/eslint/babel-eslint-plugin/tests/rules/semi.js index 3d146a1b8d04..b3f4620df919 100644 --- a/eslint/babel-eslint-plugin/tests/rules/semi.js +++ b/eslint/babel-eslint-plugin/tests/rules/semi.js @@ -102,6 +102,7 @@ ruleTester.run("semi", rule, { // babel "class Foo { bar = 'example'; }", "class Foo { static bar = 'example'; }", + { code: "async function foo() { for await (let thing of {}) { console.log(thing); } }", parserOptions: { ecmaVersion: 6 } }, // babel, "never" { code: "class Foo { bar = 'example' }", options: ["never"] }, From 15c5245d55708048b5e7e50a991e3e55da5d3658 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Tue, 25 Jul 2017 16:42:26 -0400 Subject: [PATCH 745/965] 4.1.2 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 7d7d3f2e481b..ca2cec258ce8 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "4.1.1", + "version": "4.1.2", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From b41b3af8797d9d0c562838feed3beee291f50435 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 30 Mar 2018 08:34:43 -0500 Subject: [PATCH 746/965] Merge pull request babel/eslint-plugin-babel#138 from babel/composer Refactor rules to use eslint-rule-composer --- eslint/babel-eslint-plugin/ast-utils.js | 727 ------------ eslint/babel-eslint-plugin/package.json | 7 +- eslint/babel-eslint-plugin/rules/new-cap.js | 240 +--- .../rules/no-invalid-this.js | 151 +-- .../rules/object-curly-spacing.js | 303 +---- eslint/babel-eslint-plugin/rules/semi.js | 276 ++--- .../tests/rules/no-invalid-this.js | 3 + .../tests/rules/object-curly-spacing.js | 152 +-- eslint/babel-eslint-plugin/yarn.lock | 1023 +++++++++++++++++ 9 files changed, 1234 insertions(+), 1648 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/ast-utils.js create mode 100644 eslint/babel-eslint-plugin/yarn.lock diff --git a/eslint/babel-eslint-plugin/ast-utils.js b/eslint/babel-eslint-plugin/ast-utils.js deleted file mode 100644 index 9f0d91f7edbb..000000000000 --- a/eslint/babel-eslint-plugin/ast-utils.js +++ /dev/null @@ -1,727 +0,0 @@ -/** - * @fileoverview Common utils for AST. - * @author Gyandeep Singh - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const anyFunctionPattern = /^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/; -const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/; -const arrayOrTypedArrayPattern = /Array$/; -const arrayMethodPattern = /^(?:every|filter|find|findIndex|forEach|map|some)$/; -const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/; -const breakableTypePattern = /^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/; -const thisTagPattern = /^[\s\*]*@this/m; - -/** - * Checks reference if is non initializer and writable. - * @param {Reference} reference - A reference to check. - * @param {int} index - The index of the reference in the references. - * @param {Reference[]} references - The array that the reference belongs to. - * @returns {boolean} Success/Failure - * @private - */ -function isModifyingReference(reference, index, references) { - const identifier = reference.identifier; - - /* - * Destructuring assignments can have multiple default value, so - * possibly there are multiple writeable references for the same - * identifier. - */ - const modifyingDifferentIdentifier = index === 0 || - references[index - 1].identifier !== identifier; - - return (identifier && - reference.init === false && - reference.isWrite() && - modifyingDifferentIdentifier - ); -} - -/** - * Checks whether the given string starts with uppercase or not. - * - * @param {string} s - The string to check. - * @returns {boolean} `true` if the string starts with uppercase. - */ -function startsWithUpperCase(s) { - return s[0] !== s[0].toLocaleLowerCase(); -} - -/** - * Checks whether or not a node is a constructor. - * @param {ASTNode} node - A function node to check. - * @returns {boolean} Wehether or not a node is a constructor. - */ -function isES5Constructor(node) { - return (node.id && startsWithUpperCase(node.id.name)); -} - -/** - * Finds a function node from ancestors of a node. - * @param {ASTNode} node - A start node to find. - * @returns {Node|null} A found function node. - */ -function getUpperFunction(node) { - while (node) { - if (anyFunctionPattern.test(node.type)) { - return node; - } - node = node.parent; - } - return null; -} - -/** - * Checks whether or not a node is `null` or `undefined`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `null` or `undefined`. - * @public - */ -function isNullOrUndefined(node) { - return ( - (node.type === "Literal" && node.value === null) || - (node.type === "Identifier" && node.name === "undefined") || - (node.type === "UnaryExpression" && node.operator === "void") - ); -} - -/** - * Checks whether or not a node is callee. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is callee. - */ -function isCallee(node) { - return node.parent.type === "CallExpression" && node.parent.callee === node; -} - -/** - * Checks whether or not a node is `Reclect.apply`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `Reclect.apply`. - */ -function isReflectApply(node) { - return ( - node.type === "MemberExpression" && - node.object.type === "Identifier" && - node.object.name === "Reflect" && - node.property.type === "Identifier" && - node.property.name === "apply" && - node.computed === false - ); -} - -/** - * Checks whether or not a node is `Array.from`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a `Array.from`. - */ -function isArrayFromMethod(node) { - return ( - node.type === "MemberExpression" && - node.object.type === "Identifier" && - arrayOrTypedArrayPattern.test(node.object.name) && - node.property.type === "Identifier" && - node.property.name === "from" && - node.computed === false - ); -} - -/** - * Checks whether or not a node is a method which has `thisArg`. - * @param {ASTNode} node - A node to check. - * @returns {boolean} Whether or not the node is a method which has `thisArg`. - */ -function isMethodWhichHasThisArg(node) { - while (node) { - if (node.type === "Identifier") { - return arrayMethodPattern.test(node.name); - } - if (node.type === "MemberExpression" && !node.computed) { - node = node.property; - continue; - } - - break; - } - - return false; -} - -/** - * Checks whether or not a node has a `@this` tag in its comments. - * @param {ASTNode} node - A node to check. - * @param {SourceCode} sourceCode - A SourceCode instance to get comments. - * @returns {boolean} Whether or not the node has a `@this` tag in its comments. - */ -function hasJSDocThisTag(node, sourceCode) { - const jsdocComment = sourceCode.getJSDocComment(node); - - if (jsdocComment && thisTagPattern.test(jsdocComment.value)) { - return true; - } - - // Checks `@this` in its leading comments for callbacks, - // because callbacks don't have its JSDoc comment. - // e.g. - // sinon.test(/* @this sinon.Sandbox */function() { this.spy(); }); - return sourceCode.getComments(node).leading.some(function(comment) { - return thisTagPattern.test(comment.value); - }); -} - -/** - * Determines if a node is surrounded by parentheses. - * @param {SourceCode} sourceCode The ESLint source code object - * @param {ASTNode} node The node to be checked. - * @returns {boolean} True if the node is parenthesised. - * @private - */ -function isParenthesised(sourceCode, node) { - const previousToken = sourceCode.getTokenBefore(node), - nextToken = sourceCode.getTokenAfter(node); - - return Boolean(previousToken && nextToken) && - previousToken.value === "(" && previousToken.range[1] <= node.range[0] && - nextToken.value === ")" && nextToken.range[0] >= node.range[1]; -} - -//------------------------------------------------------------------------------ -// Public Interface -//------------------------------------------------------------------------------ - -module.exports = { - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - * @public - */ - isTokenOnSameLine(left, right) { - return left.loc.end.line === right.loc.start.line; - }, - - isNullOrUndefined, - isCallee, - isES5Constructor, - getUpperFunction, - isArrayFromMethod, - isParenthesised, - - /** - * Checks whether or not a given node is a string literal. - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is a string literal. - */ - isStringLiteral(node) { - return ( - (node.type === "Literal" && typeof node.value === "string") || - node.type === "TemplateLiteral" - ); - }, - - /** - * Checks whether a given node is a breakable statement or not. - * The node is breakable if the node is one of the following type: - * - * - DoWhileStatement - * - ForInStatement - * - ForOfStatement - * - ForStatement - * - SwitchStatement - * - WhileStatement - * - * @param {ASTNode} node - A node to check. - * @returns {boolean} `true` if the node is breakable. - */ - isBreakableStatement(node) { - return breakableTypePattern.test(node.type); - }, - - /** - * Gets the label if the parent node of a given node is a LabeledStatement. - * - * @param {ASTNode} node - A node to get. - * @returns {string|null} The label or `null`. - */ - getLabel(node) { - if (node.parent.type === "LabeledStatement") { - return node.parent.label.name; - } - return null; - }, - - /** - * Gets references which are non initializer and writable. - * @param {Reference[]} references - An array of references. - * @returns {Reference[]} An array of only references which are non initializer and writable. - * @public - */ - getModifyingReferences(references) { - return references.filter(isModifyingReference); - }, - - /** - * Validate that a string passed in is surrounded by the specified character - * @param {string} val The text to check. - * @param {string} character The character to see if it's surrounded by. - * @returns {boolean} True if the text is surrounded by the character, false if not. - * @private - */ - isSurroundedBy(val, character) { - return val[0] === character && val[val.length - 1] === character; - }, - - /** - * Returns whether the provided node is an ESLint directive comment or not - * @param {LineComment|BlockComment} node The node to be checked - * @returns {boolean} `true` if the node is an ESLint directive comment - */ - isDirectiveComment(node) { - const comment = node.value.trim(); - - return ( - node.type === "Line" && comment.indexOf("eslint-") === 0 || - node.type === "Block" && ( - comment.indexOf("global ") === 0 || - comment.indexOf("eslint ") === 0 || - comment.indexOf("eslint-") === 0 - ) - ); - }, - - /** - * Finds the variable by a given name in a given scope and its upper scopes. - * - * @param {escope.Scope} initScope - A scope to start find. - * @param {string} name - A variable name to find. - * @returns {escope.Variable|null} A found variable or `null`. - */ - getVariableByName(initScope, name) { - let scope = initScope; - - while (scope) { - const variable = scope.set.get(name); - - if (variable) { - return variable; - } - - scope = scope.upper; - } - - return null; - }, - - /** - * Checks whether or not a given function node is the default `this` binding. - * - * First, this checks the node: - * - * - The function name does not start with uppercase (it's a constructor). - * - The function does not have a JSDoc comment that has a @this tag. - * - * Next, this checks the location of the node. - * If the location is below, this judges `this` is valid. - * - * - The location is not on an object literal. - * - The location is not assigned to a variable which starts with an uppercase letter. - * - The location is not on an ES2015 class. - * - Its `bind`/`call`/`apply` method is not called directly. - * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given. - * - * @param {ASTNode} node - A function node to check. - * @param {SourceCode} sourceCode - A SourceCode instance to get comments. - * @returns {boolean} The function node is the default `this` binding. - */ - isDefaultThisBinding(node, sourceCode) { - if (isES5Constructor(node) || hasJSDocThisTag(node, sourceCode)) { - return false; - } - const isAnonymous = node.id === null; - - while (node) { - const parent = node.parent; - - switch (parent.type) { - - /* - * Looks up the destination. - * e.g., obj.foo = nativeFoo || function foo() { ... }; - */ - case "LogicalExpression": - case "ConditionalExpression": - node = parent; - break; - - // If the upper function is IIFE, checks the destination of the return value. - // e.g. - // obj.foo = (function() { - // // setup... - // return function foo() { ... }; - // })(); - case "ReturnStatement": { - const func = getUpperFunction(parent); - - if (func === null || !isCallee(func)) { - return true; - } - node = func.parent; - break; - } - - // e.g. - // var obj = { foo() { ... } }; - // var obj = { foo: function() { ... } }; - // class A { constructor() { ... } } - // class A { foo() { ... } } - // class A { get foo() { ... } } - // class A { set foo() { ... } } - // class A { static foo() { ... } } - case "Property": - case "MethodDefinition": - return parent.value !== node; - - // e.g. - // obj.foo = function foo() { ... }; - // Foo = function() { ... }; - // [obj.foo = function foo() { ... }] = a; - // [Foo = function() { ... }] = a; - case "AssignmentExpression": - case "AssignmentPattern": - if (parent.right === node) { - if (parent.left.type === "MemberExpression") { - return false; - } - if (isAnonymous && - parent.left.type === "Identifier" && - startsWithUpperCase(parent.left.name) - ) { - return false; - } - } - return true; - - // e.g. - // var Foo = function() { ... }; - case "VariableDeclarator": - return !( - isAnonymous && - parent.init === node && - parent.id.type === "Identifier" && - startsWithUpperCase(parent.id.name) - ); - - // e.g. - // var foo = function foo() { ... }.bind(obj); - // (function foo() { ... }).call(obj); - // (function foo() { ... }).apply(obj, []); - case "MemberExpression": - return ( - parent.object !== node || - parent.property.type !== "Identifier" || - !bindOrCallOrApplyPattern.test(parent.property.name) || - !isCallee(parent) || - parent.parent.arguments.length === 0 || - isNullOrUndefined(parent.parent.arguments[0]) - ); - - // e.g. - // Reflect.apply(function() {}, obj, []); - // Array.from([], function() {}, obj); - // list.forEach(function() {}, obj); - case "CallExpression": - if (isReflectApply(parent.callee)) { - return ( - parent.arguments.length !== 3 || - parent.arguments[0] !== node || - isNullOrUndefined(parent.arguments[1]) - ); - } - if (isArrayFromMethod(parent.callee)) { - return ( - parent.arguments.length !== 3 || - parent.arguments[1] !== node || - isNullOrUndefined(parent.arguments[2]) - ); - } - if (isMethodWhichHasThisArg(parent.callee)) { - return ( - parent.arguments.length !== 2 || - parent.arguments[0] !== node || - isNullOrUndefined(parent.arguments[1]) - ); - } - return true; - - // Otherwise `this` is default. - default: - return true; - } - } - - /* istanbul ignore next */ - return true; - }, - - /** - * Get the precedence level based on the node type - * @param {ASTNode} node node to evaluate - * @returns {int} precedence level - * @private - */ - getPrecedence(node) { - switch (node.type) { - case "SequenceExpression": - return 0; - - case "AssignmentExpression": - case "ArrowFunctionExpression": - case "YieldExpression": - return 1; - - case "ConditionalExpression": - return 3; - - case "LogicalExpression": - switch (node.operator) { - case "||": - return 4; - case "&&": - return 5; - - // no default - } - - /* falls through */ - - case "BinaryExpression": - - switch (node.operator) { - case "|": - return 6; - case "^": - return 7; - case "&": - return 8; - case "==": - case "!=": - case "===": - case "!==": - return 9; - case "<": - case "<=": - case ">": - case ">=": - case "in": - case "instanceof": - return 10; - case "<<": - case ">>": - case ">>>": - return 11; - case "+": - case "-": - return 12; - case "*": - case "/": - case "%": - return 13; - - // no default - } - - /* falls through */ - - case "UnaryExpression": - case "AwaitExpression": - return 14; - - case "UpdateExpression": - return 15; - - case "CallExpression": - - // IIFE is allowed to have parens in any position (#655) - if (node.callee.type === "FunctionExpression") { - return -1; - } - return 16; - - case "NewExpression": - return 17; - - // no default - } - return 18; - }, - - /** - * Checks whether a given node is a loop node or not. - * The following types are loop nodes: - * - * - DoWhileStatement - * - ForInStatement - * - ForOfStatement - * - ForStatement - * - WhileStatement - * - * @param {ASTNode|null} node - A node to check. - * @returns {boolean} `true` if the node is a loop node. - */ - isLoop(node) { - return Boolean(node && anyLoopPattern.test(node.type)); - }, - - /** - * Checks whether a given node is a function node or not. - * The following types are function nodes: - * - * - ArrowFunctionExpression - * - FunctionDeclaration - * - FunctionExpression - * - * @param {ASTNode|null} node - A node to check. - * @returns {boolean} `true` if the node is a function node. - */ - isFunction(node) { - return Boolean(node && anyFunctionPattern.test(node.type)); - }, - - /** - * Gets the property name of a given node. - * The node can be a MemberExpression, a Property, or a MethodDefinition. - * - * If the name is dynamic, this returns `null`. - * - * For examples: - * - * a.b // => "b" - * a["b"] // => "b" - * a['b'] // => "b" - * a[`b`] // => "b" - * a[100] // => "100" - * a[b] // => null - * a["a" + "b"] // => null - * a[tag`b`] // => null - * a[`${b}`] // => null - * - * let a = {b: 1} // => "b" - * let a = {["b"]: 1} // => "b" - * let a = {['b']: 1} // => "b" - * let a = {[`b`]: 1} // => "b" - * let a = {[100]: 1} // => "100" - * let a = {[b]: 1} // => null - * let a = {["a" + "b"]: 1} // => null - * let a = {[tag`b`]: 1} // => null - * let a = {[`${b}`]: 1} // => null - * - * @param {ASTNode} node - The node to get. - * @returns {string|null} The property name if static. Otherwise, null. - */ - getStaticPropertyName(node) { - let prop; - - switch (node && node.type) { - case "Property": - case "MethodDefinition": - prop = node.key; - break; - - case "MemberExpression": - prop = node.property; - break; - - // no default - } - - switch (prop && prop.type) { - case "Literal": - return String(prop.value); - - case "TemplateLiteral": - if (prop.expressions.length === 0 && prop.quasis.length === 1) { - return prop.quasis[0].value.cooked; - } - break; - - case "Identifier": - if (!node.computed) { - return prop.name; - } - break; - - // no default - } - - return null; - }, - - /** - * Get directives from directive prologue of a Program or Function node. - * @param {ASTNode} node - The node to check. - * @returns {ASTNode[]} The directives found in the directive prologue. - */ - getDirectivePrologue(node) { - const directives = []; - - // Directive prologues only occur at the top of files or functions. - if ( - node.type === "Program" || - node.type === "FunctionDeclaration" || - node.type === "FunctionExpression" || - - // Do not check arrow functions with implicit return. - // `() => "use strict";` returns the string `"use strict"`. - (node.type === "ArrowFunctionExpression" && node.body.type === "BlockStatement") - ) { - const statements = node.type === "Program" ? node.body : node.body.body; - - for (const statement of statements) { - if ( - statement.type === "ExpressionStatement" && - statement.expression.type === "Literal" - ) { - directives.push(statement); - } else { - break; - } - } - } - - return directives; - }, - - - /** - * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added - after the node will be parsed as a decimal point, rather than a property-access dot. - * @param {ASTNode} node - The node to check. - * @returns {boolean} `true` if this node is a decimal integer. - * @example - * - * 5 // true - * 5. // false - * 5.0 // false - * 05 // false - * 0x5 // false - * 0b101 // false - * 0o5 // false - * 5e0 // false - * '5' // false - */ - isDecimalInteger(node) { - return node.type === "Literal" && typeof node.value === "number" && /^(0|[1-9]\d*)$/.test(node.raw); - } -}; diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index ca2cec258ce8..8c0b36b7e1b7 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -27,11 +27,14 @@ }, "homepage": "https://github.com/babel/eslint-plugin-babel#readme", "peerDependencies": { - "eslint": ">=3.0.0" + "eslint": ">=4.0.0" + }, + "dependencies": { + "eslint-rule-composer": "^0.1.1" }, "devDependencies": { "babel-eslint": "^7.1.0", - "eslint": "^3.0.0", + "eslint": "^4.19.1", "lodash.clonedeep": "^4.5.0", "mocha": "^3.0.0" } diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js index 0e17a9baae58..37ee633bf2d9 100644 --- a/eslint/babel-eslint-plugin/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -1,235 +1,19 @@ -/** - * @fileoverview Rule to flag use of constructors without capital letters - * @author Nicholas C. Zakas - * @copyright 2014 Jordan Harband. All rights reserved. - * @copyright 2013-2014 Nicholas C. Zakas. All rights reserved. - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - */ - "use strict"; -var CAPS_ALLOWED = [ - "Array", - "Boolean", - "Date", - "Error", - "Function", - "Number", - "Object", - "RegExp", - "String", - "Symbol" -]; - -/** - * Ensure that if the key is provided, it must be an array. - * @param {Object} obj Object to check with `key`. - * @param {string} key Object key to check on `obj`. - * @param {*} fallback If obj[key] is not present, this will be returned. - * @returns {string[]} Returns obj[key] if it's an Array, otherwise `fallback` - */ -function checkArray(obj, key, fallback) { - /* istanbul ignore if */ - if (Object.prototype.hasOwnProperty.call(obj, key) && !Array.isArray(obj[key])) { - throw new TypeError(key + ", if provided, must be an Array"); - } - return obj[key] || fallback; -} +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const newCapRule = new eslint.Linter().getRules().get('new-cap'); /** - * A reducer function to invert an array to an Object mapping the string form of the key, to `true`. - * @param {Object} map Accumulator object for the reduce. - * @param {string} key Object key to set to `true`. - * @returns {Object} Returns the updated Object for further reduction. + * Returns whether a node is under a decorator or not. + * @param {ASTNode} node CallExpression node + * @returns {Boolean} Returns true if the node is under a decorator. */ -function invert(map, key) { - map[key] = true; - return map; +function isDecorator(node) { + return node.parent.type === "Decorator"; } -/** - * Creates an object with the cap is new exceptions as its keys and true as their values. - * @param {Object} config Rule configuration - * @returns {Object} Object with cap is new exceptions. - */ -function calculateCapIsNewExceptions(config) { - var capIsNewExceptions = checkArray(config, "capIsNewExceptions", CAPS_ALLOWED); - - if (capIsNewExceptions !== CAPS_ALLOWED) { - capIsNewExceptions = capIsNewExceptions.concat(CAPS_ALLOWED); - } - - return capIsNewExceptions.reduce(invert, {}); -} - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = function(context) { - - var config = context.options[0] || {}; - var NEW_IS_CAP = config.newIsCap !== false; - var CAP_IS_NEW = config.capIsNew !== false; - - var newIsCapExceptions = checkArray(config, "newIsCapExceptions", []).reduce(invert, {}); - - var capIsNewExceptions = calculateCapIsNewExceptions(config); - - var listeners = {}; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Get exact callee name from expression - * @param {ASTNode} node CallExpression or NewExpression node - * @returns {string} name - */ - function extractNameFromExpression(node) { - - var name = "", - property; - - if (node.callee.type === "MemberExpression") { - property = node.callee.property; - - if (property.type === "Literal" && (typeof property.value === "string")) { - name = property.value; - } else if (property.type === "Identifier" && !node.callee.computed) { - name = property.name; - } - } else { - name = node.callee.name; - } - return name; - } - - /** - * Returns the capitalization state of the string - - * Whether the first character is uppercase, lowercase, or non-alphabetic - * @param {string} str String - * @returns {string} capitalization state: "non-alpha", "lower", or "upper" - */ - function getCap(str) { - var firstChar = str.charAt(0); - - var firstCharLower = firstChar.toLowerCase(); - var firstCharUpper = firstChar.toUpperCase(); - - if (firstCharLower === firstCharUpper) { - // char has no uppercase variant, so it's non-alphabetic - return "non-alpha"; - } else if (firstChar === firstCharLower) { - return "lower"; - } else { - return "upper"; - } - } - - /** - * Returns whether a node is under a decorator or not. - * @param {ASTNode} node CallExpression node - * @returns {Boolean} Returns true if the node is under a decorator. - */ - function isDecorator(node) { - return node.parent.type === "Decorator"; - } - - /** - * Check if capitalization is allowed for a CallExpression - * @param {Object} allowedMap Object mapping calleeName to a Boolean - * @param {ASTNode} node CallExpression node - * @param {string} calleeName Capitalized callee name from a CallExpression - * @returns {Boolean} Returns true if the callee may be capitalized - */ - function isCapAllowed(allowedMap, node, calleeName) { - if (allowedMap[calleeName] || allowedMap[context.getSource(node.callee)]) { - return true; - } - if (calleeName === "UTC" && node.callee.type === "MemberExpression") { - // allow if callee is Date.UTC - return node.callee.object.type === "Identifier" && - node.callee.object.name === "Date"; - } - return false; - } - - /** - * Reports the given message for the given node. The location will be the start of the property or the callee. - * @param {ASTNode} node CallExpression or NewExpression node. - * @param {string} message The message to report. - * @returns {void} - */ - function report(node, message) { - var callee = node.callee; - - if (callee.type === "MemberExpression") { - callee = callee.property; - } - - context.report(node, callee.loc.start, message); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - if (NEW_IS_CAP) { - listeners.NewExpression = function(node) { - - var constructorName = extractNameFromExpression(node); - if (constructorName) { - var capitalization = getCap(constructorName); - var isAllowed = capitalization !== "lower" || isCapAllowed(newIsCapExceptions, node, constructorName); - if (!isAllowed) { - report(node, "A constructor name should not start with a lowercase letter."); - } - } - }; - } - - if (CAP_IS_NEW) { - listeners.CallExpression = function(node) { - - var calleeName = extractNameFromExpression(node); - if (calleeName) { - var capitalization = getCap(calleeName); - var isAllowed = capitalization !== "upper" || isDecorator(node) || isCapAllowed(capIsNewExceptions, node, calleeName); - if (!isAllowed) { - report(node, "A function with a name starting with an uppercase letter should only be used as a constructor."); - } - } - }; - } - - return listeners; -}; - -module.exports.schema = [ - { - "type": "object", - "properties": { - "newIsCap": { - "type": "boolean" - }, - "capIsNew": { - "type": "boolean" - }, - "newIsCapExceptions": { - "type": "array", - "items": { - "type": "string" - } - }, - "capIsNewExceptions": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "additionalProperties": false - } -]; +module.exports = ruleComposer.filterReports( + newCapRule, + (problem, metadata) => !isDecorator(problem.node) +); diff --git a/eslint/babel-eslint-plugin/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/rules/no-invalid-this.js index a8478a852f5b..ab12ca5320a3 100644 --- a/eslint/babel-eslint-plugin/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/rules/no-invalid-this.js @@ -1,143 +1,24 @@ -/** - * @fileoverview A rule to disallow `this` keywords outside of classes or class-like objects. - * @author Toru Nagashima - */ - "use strict"; -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -const astUtils = require("../ast-utils"); - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -module.exports = { - meta: { - docs: { - description: "disallow `this` keywords outside of classes or class-like objects", - category: "Best Practices", - recommended: false - }, - - schema: [] - }, - - create(context) { - const stack = [], - sourceCode = context.getSourceCode(); +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const noInvalidThisRule = new eslint.Linter().getRules().get('no-invalid-this'); - let insideClassProperty = false; +module.exports = ruleComposer.filterReports( + noInvalidThisRule, + (problem, metadata) => { + let inClassProperty = false; + let node = problem.node; - /** - * Gets the current checking context. - * - * The return value has a flag that whether or not `this` keyword is valid. - * The flag is initialized when got at the first time. - * - * @returns {{valid: boolean}} - * an object which has a flag that whether or not `this` keyword is valid. - */ - stack.getCurrent = function() { - const current = this[this.length - 1]; - - if (!current.init) { - current.init = true; - current.valid = !astUtils.isDefaultThisBinding( - current.node, - sourceCode); + while (node) { + if (node.type === "ClassProperty") { + inClassProperty = true; + return; } - return current; - }; - - /** - * `this` should be fair game anywhere inside a class property. - * - * @returns {void} - */ - function enterClassProperty() { - insideClassProperty = true; - } - - /** - * Back to the normal check. - * @returns {void} - */ - function exitClassProperty() { - insideClassProperty = false; - } - - /** - * Pushs new checking context into the stack. - * - * The checking context is not initialized yet. - * Because most functions don't have `this` keyword. - * When `this` keyword was found, the checking context is initialized. - * - * @param {ASTNode} node - A function node that was entered. - * @returns {void} - */ - function enterFunction(node) { - - // `this` can be invalid only under strict mode. - stack.push({ - init: !context.getScope().isStrict, - node, - valid: true - }); - } - - /** - * Pops the current checking context from the stack. - * @returns {void} - */ - function exitFunction() { - stack.pop(); + + node = node.parent; } - return { - - /* - * `this` is invalid only under strict mode. - * Modules is always strict mode. - */ - Program(node) { - const scope = context.getScope(), - features = context.parserOptions.ecmaFeatures || {}; - - stack.push({ - init: true, - node, - valid: !( - scope.isStrict || - node.sourceType === "module" || - (features.globalReturn && scope.childScopes[0].isStrict) - ) - }); - }, - - "Program:exit"() { - stack.pop(); - }, - - ClassProperty: enterClassProperty, - "ClassProperty:exit": exitClassProperty, - FunctionDeclaration: enterFunction, - "FunctionDeclaration:exit": exitFunction, - FunctionExpression: enterFunction, - "FunctionExpression:exit": exitFunction, - - // Reports if `this` of the current context is invalid. - ThisExpression(node) { - const current = stack.getCurrent(); - - if (!insideClassProperty && current && !current.valid) { - context.report(node, "Unexpected 'this'."); - } - } - }; + return !inClassProperty; } -}; +); diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js index 54d8becae9a7..19953bf04ffe 100644 --- a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -1,296 +1,25 @@ -/** - * @fileoverview Disallows or enforces spaces inside of object literals. - * @author Jamund Ferguson - * @copyright 2014 Brandyn Bennett. All rights reserved. - * @copyright 2014 Michael Ficarra. No rights reserved. - * @copyright 2014 Vignesh Anand. All rights reserved. - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - * @copyright 2015 Toru Nagashima. All rights reserved. - * See LICENSE file in root directory for full license. - */ "use strict"; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const objectCurlySpacingRule = new eslint.Linter().getRules().get('object-curly-spacing'); -module.exports = function(context) { - var spaced = context.options[0] === "always", - sourceCode = context.getSourceCode(); - - /** - * Determines whether an option is set, relative to the spacing option. - * If spaced is "always", then check whether option is set to false. - * If spaced is "never", then check whether option is set to true. - * @param {Object} option - The option to exclude. - * @returns {boolean} Whether or not the property is excluded. - */ - function isOptionSet(option) { - return context.options[1] != null ? context.options[1][option] === !spaced : false; - } - - var options = { - spaced: spaced, - arraysInObjectsException: isOptionSet("arraysInObjects"), - objectsInObjectsException: isOptionSet("objectsInObjects") - }; - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Determines whether two adjacent tokens are have whitespace between them. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not there is space between the tokens. - */ - function isSpaced(left, right) { - return sourceCode.isSpaceBetweenTokens(left, right); - } - - /** - * Determines whether two adjacent tokens are on the same line. - * @param {Object} left - The left token object. - * @param {Object} right - The right token object. - * @returns {boolean} Whether or not the tokens are on the same line. - */ - function isSameLine(left, right) { - return left.loc.start.line === right.loc.start.line; - } - - /** - * Reports that there shouldn't be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.end, - message: "There should be no space after '" + token.value + "'", - fix: function(fixer) { - var nextToken = sourceCode.getTokenAfter(token); - return fixer.removeRange([token.range[1], nextToken.range[0]]); - } - }); - } - - /** - * Reports that there shouldn't be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportNoEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "There should be no space before '" + token.value + "'", - fix: function(fixer) { - var previousToken = sourceCode.getTokenBefore(token); - return fixer.removeRange([previousToken.range[1], token.range[0]]); - } - }); - } - - /** - * Reports that there should be a space after the first token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredBeginningSpace(node, token) { - context.report({ - node: node, - loc: token.loc.end, - message: "A space is required after '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextAfter(token, " "); - } - }); - } - - /** - * Reports that there should be a space before the last token - * @param {ASTNode} node - The node to report in the event of an error. - * @param {Token} token - The token to use for the report. - * @returns {void} - */ - function reportRequiredEndingSpace(node, token) { - context.report({ - node: node, - loc: token.loc.start, - message: "A space is required before '" + token.value + "'", - fix: function(fixer) { - return fixer.insertTextBefore(token, " "); - } - }); - } - - /** - * Determines if spacing in curly braces is valid. - * @param {ASTNode} node The AST node to check. - * @param {Token} first The first token to check (should be the opening brace) - * @param {Token} second The second token to check (should be first after the opening brace) - * @param {Token} penultimate The penultimate token to check (should be last before closing brace) - * @param {Token} last The last token to check (should be closing brace) - * @returns {void} - */ - function validateBraceSpacing(node, first, second, penultimate, last) { - var closingCurlyBraceMustBeSpaced = - options.arraysInObjectsException && penultimate.value === "]" || - options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced; - - if (isSameLine(first, second)) { - if (options.spaced && !isSpaced(first, second)) { - reportRequiredBeginningSpace(node, first); - } - if (!options.spaced && isSpaced(first, second)) { - reportNoBeginningSpace(node, first); - } - } - - if (isSameLine(penultimate, last)) { - if (closingCurlyBraceMustBeSpaced && !isSpaced(penultimate, last)) { - reportRequiredEndingSpace(node, last); - } - if (!closingCurlyBraceMustBeSpaced && isSpaced(penultimate, last)) { - reportNoEndingSpace(node, last); - } - } - } - - /** - * Reports a given object node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ObjectExpression or ObjectPattern node to check. - * @returns {void} - */ - function checkForObject(node) { - if (node.properties.length === 0) { - return; - } - - var firstSpecifier = node.properties[0], - lastSpecifier = node.properties[node.properties.length - 1]; - - var first = sourceCode.getTokenBefore(firstSpecifier), - last = sourceCode.getTokenAfter(lastSpecifier); - - // support trailing commas - if (last.value === ",") { - last = sourceCode.getTokenAfter(last); - } - - var second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - /** - * Reports a given import node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ImportDeclaration node to check. - * @returns {void} - */ - function checkForImport(node) { - if (node.specifiers.length === 0) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1]; - - if (lastSpecifier.type !== "ImportSpecifier") { - return; - } - if (firstSpecifier.type !== "ImportSpecifier") { - firstSpecifier = node.specifiers[1]; - } - - var first = sourceCode.getTokenBefore(firstSpecifier), - last = sourceCode.getTokenAfter(lastSpecifier); - - // to support a trailing comma. - if (last.value === ",") { - last = sourceCode.getTokenAfter(last); - } - - var second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - /** - * Reports a given export node if spacing in curly braces is invalid. - * @param {ASTNode} node - An ExportNamedDeclaration node to check. - * @returns {void} - */ - function checkForExport(node) { - if (node.specifiers.length === 0) { - return; - } - - var firstSpecifier = node.specifiers[0], - lastSpecifier = node.specifiers[node.specifiers.length - 1], - first = sourceCode.getTokenBefore(firstSpecifier), - last = sourceCode.getTokenAfter(lastSpecifier); +module.exports = ruleComposer.filterReports( + objectCurlySpacingRule, + (problem, metadata) => { + const node = problem.node; + // Allow `exportNamespaceFrom` and `exportDefaultFrom` syntax: // export * as x from '...'; // export x from '...'; - if (first.value === "export") { - return; + if ( + node.type === 'ExportNamedDeclaration' && + node.specifiers.length > 0 && + metadata.sourceCode.getTokenBefore(node.specifiers[0]).value === "export" + ) { + return false; } - // to support a trailing comma. - if (last.value === ",") { - last = sourceCode.getTokenAfter(last); - } - - var second = sourceCode.getTokenAfter(first), - penultimate = sourceCode.getTokenBefore(last); - - validateBraceSpacing(node, first, second, penultimate, last); - } - - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- - - return { - // var {x} = y; - ObjectPattern: checkForObject, - - // var y = {x: 'y'} - ObjectExpression: checkForObject, - - // import {y} from 'x'; - ImportDeclaration: checkForImport, - - // export {name} from 'yo'; - ExportNamedDeclaration: checkForExport - }; - -}; - -module.exports.schema = [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "arraysInObjects": { - "type": "boolean" - }, - "objectsInObjects": { - "type": "boolean" - } - }, - "additionalProperties": false + return true; } -]; +); diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/rules/semi.js index 0f9ef74f4ec0..95a2467bfc52 100644 --- a/eslint/babel-eslint-plugin/rules/semi.js +++ b/eslint/babel-eslint-plugin/rules/semi.js @@ -1,225 +1,115 @@ -/** - * @fileoverview Rule to flag missing semicolons. - * @author Nicholas C. Zakas - */ "use strict"; -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const semiRule = new eslint.Linter().getRules().get('semi'); -module.exports = { - meta: { - docs: { - description: "require or disallow semicolons instead of ASI", - category: "Stylistic Issues", - recommended: false - }, +const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` - fixable: "code", - - schema: { - anyOf: [ - { - type: "array", - items: [ - { - enum: ["never"] - } - ], - minItems: 0, - maxItems: 1 - }, - { - type: "array", - items: [ - { - enum: ["always"] - }, - { - type: "object", - properties: { - omitLastInOneLineBlock: { type: "boolean" } - }, - additionalProperties: false - } - ], - minItems: 0, - maxItems: 2 - } - ] - } - }, - - create(context) { - - const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` - const options = context.options[1]; - const never = context.options[0] === "never", - exceptOneLine = options && options.omitLastInOneLineBlock === true, - sourceCode = context.getSourceCode(); - - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - /** - * Reports a semicolon error with appropriate location and message. - * @param {ASTNode} node The node with an extra or missing semicolon. - * @param {boolean} missing True if the semicolon is missing. - * @returns {void} - */ - function report(node, missing) { - const lastToken = sourceCode.getLastToken(node); - let message, - fix, - loc = lastToken.loc; - - if (!missing) { - message = "Missing semicolon."; - loc = loc.end; - fix = function(fixer) { - return fixer.insertTextAfter(lastToken, ";"); - }; - } else { - message = "Extra semicolon."; - loc = loc.start; - fix = function(fixer) { - return fixer.remove(lastToken); - }; - } +const isSemicolon = token => token.type === "Punctuator" && token.value === ";"; - context.report({ - node, - loc, - message, - fix - }); +const isUnnecessarySemicolon = (context, lastToken) => { + if (!isSemicolon(lastToken)) { + return false; + } - } + const nextToken = context.getSourceCode().getTokenAfter(lastToken); - /** - * Checks whether a token is a semicolon punctuator. - * @param {Token} token The token. - * @returns {boolean} True if token is a semicolon punctuator. - */ - function isSemicolon(token) { - return (token.type === "Punctuator" && token.value === ";"); - } + if (!nextToken) { + return true; + } - /** - * Check if a semicolon is unnecessary, only true if: - * - next token is on a new line and is not one of the opt-out tokens - * - next token is a valid statement divider - * @param {Token} lastToken last token of current node. - * @returns {boolean} whether the semicolon is unnecessary. - */ - function isUnnecessarySemicolon(lastToken) { - if (!isSemicolon(lastToken)) { - return false; - } + const lastTokenLine = lastToken.loc.end.line; + const nextTokenLine = nextToken.loc.start.line; + const isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value) && nextToken.value !== "++" && nextToken.value !== "--"; + const isDivider = (nextToken.value === "}" || nextToken.value === ";"); - const nextToken = sourceCode.getTokenAfter(lastToken); + return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; +} - if (!nextToken) { - return true; - } +const isOneLinerBlock = (context, node) => { + const nextToken = context.getSourceCode().getTokenAfter(node); - const lastTokenLine = lastToken.loc.end.line; - const nextTokenLine = nextToken.loc.start.line; - const isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value) && nextToken.value !== "++" && nextToken.value !== "--"; - const isDivider = (nextToken.value === "}" || nextToken.value === ";"); + if (!nextToken || nextToken.value !== "}") { + return false; + } - return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; - } + const parent = node.parent; - /** - * Checks a node to see if it's in a one-liner block statement. - * @param {ASTNode} node The node to check. - * @returns {boolean} whether the node is in a one-liner block statement. - */ - function isOneLinerBlock(node) { - const nextToken = sourceCode.getTokenAfter(node); + return parent && parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line; +}; - if (!nextToken || nextToken.value !== "}") { - return false; - } +const report = (context, node, missing) => { + const lastToken = context.getSourceCode().getLastToken(node); - const parent = node.parent; + let message, fix, loc = lastToken.loc; - return parent && parent.type === "BlockStatement" && - parent.loc.start.line === parent.loc.end.line; - } + if (!missing) { + message = "Missing semicolon."; + loc = loc.end; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + message = "Extra semicolon."; + loc = loc.start; + fix = function(fixer) { + return fixer.remove(lastToken); + }; + } + + context.report({ + node, + loc, + message, + fix + }); +}; + +const semiRuleWithClassProperty = ruleComposer.joinReports([ + semiRule, + context => ({ + ClassProperty(node) { + const options = context.options[1]; + const exceptOneLine = options && options.omitLastInOneLineBlock === true; - /** - * Checks a node to see if it's followed by a semicolon. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkForSemicolon(node) { + const sourceCode = context.getSourceCode(); const lastToken = sourceCode.getLastToken(node); - if (never) { - if (isUnnecessarySemicolon(lastToken)) { - report(node, true); + if (context.options[0] === "never") { + if (isUnnecessarySemicolon(context, lastToken)) { + report(context, node, true); } } else { if (!isSemicolon(lastToken)) { if (!exceptOneLine || !isOneLinerBlock(node)) { - report(node); + report(context, node); } } else { if (exceptOneLine && isOneLinerBlock(node)) { - report(node, true); + report(context, node, true); } } } + }, + }), +]); + +module.exports = ruleComposer.filterReports( + semiRuleWithClassProperty, + (problem, metadata) => { + const node = problem.node; + + // Handle async iterator: + // for await (let something of {}) + if ( + node.type === "VariableDeclaration" && + node.parent.type === "ForAwaitStatement" + ) { + return false; } - /** - * Checks to see if there's a semicolon after a variable declaration. - * @param {ASTNode} node The node to check. - * @returns {void} - */ - function checkForSemicolonForVariableDeclaration(node) { - const ancestors = context.getAncestors(), - parentIndex = ancestors.length - 1, - parent = ancestors[parentIndex]; - - if ((parent.type !== "ForStatement" || parent.init !== node) && - (!/^For(?:In|Of|Await)Statement/.test(parent.type) || parent.left !== node) - ) { - checkForSemicolon(node); - } - } - - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - - return { - VariableDeclaration: checkForSemicolonForVariableDeclaration, - ExpressionStatement: checkForSemicolon, - ReturnStatement: checkForSemicolon, - ThrowStatement: checkForSemicolon, - DoWhileStatement: checkForSemicolon, - DebuggerStatement: checkForSemicolon, - BreakStatement: checkForSemicolon, - ContinueStatement: checkForSemicolon, - ImportDeclaration: checkForSemicolon, - ExportAllDeclaration: checkForSemicolon, - ClassProperty: checkForSemicolon, - ExportNamedDeclaration(node) { - if (!node.declaration) { - checkForSemicolon(node); - } - }, - ExportDefaultDeclaration(node) { - if (!/(?:Class|Function)Declaration/.test(node.declaration.type)) { - checkForSemicolon(node); - } - } - }; - + return true; } -}; +); diff --git a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js index 5e1c67c8b8ae..3ab5da59c95f 100644 --- a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js @@ -78,6 +78,9 @@ function extractPatterns(patterns, type) { thisPattern.code += " /* should error */"; } + delete thisPattern.invalid; + delete thisPattern.valid; + return thisPattern; }); }); diff --git a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js index 44c188fdd0a3..8771785ff51e 100644 --- a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js @@ -161,13 +161,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ImportDeclaration", line: 1, - column: 9 + column: 8 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 12 @@ -183,7 +183,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 18 @@ -199,13 +199,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ImportDeclaration", line: 1, - column: 9 + column: 8 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 17 @@ -221,7 +221,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 13 @@ -237,7 +237,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 16 @@ -254,7 +254,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 21 @@ -271,13 +271,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ImportDeclaration", line: 1, - column: 12 + column: 11 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 15 @@ -294,13 +294,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ImportDeclaration", line: 1, - column: 12 + column: 11 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 20 @@ -316,13 +316,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ImportDeclaration", line: 1, - column: 9 + column: 8 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ImportDeclaration", line: 1, column: 13 @@ -339,13 +339,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ImportDeclaration", line: 1, - column: 9 + column: 8 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ImportDeclaration", line: 1, column: 15 @@ -361,13 +361,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ExportNamedDeclaration", line: 1, - column: 9 + column: 8 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ExportNamedDeclaration", line: 1, column: 12 @@ -382,7 +382,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always", {"arraysInObjects": false}], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression" } ] @@ -393,7 +393,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always", {"arraysInObjects": false}], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression" } ] @@ -406,7 +406,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always", {"objectsInObjects": false}], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 43 @@ -419,7 +419,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always", {"objectsInObjects": false}], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 61 @@ -435,7 +435,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { ecmaFeatures: { destructuring: true }, errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectPattern", line: 1, column: 9 @@ -449,7 +449,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { ecmaFeatures: { destructuring: true }, errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 9 @@ -463,7 +463,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { ecmaFeatures: { destructuring: true }, errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 10 @@ -477,13 +477,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { ecmaFeatures: { destructuring: true }, errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectPattern", line: 1, - column: 6 + column: 5 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 11 @@ -498,7 +498,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never", {"objectsInObjects": true}], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression", line: 1, column: 39 @@ -511,7 +511,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never", {"objectsInObjects": true}], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression", line: 1, column: 55 @@ -526,13 +526,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectExpression", line: 1, - column: 12 + column: 11 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression", line: 1, column: 30 @@ -545,10 +545,10 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectExpression", line: 1, - column: 12 + column: 11 } ] }, @@ -558,7 +558,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression", line: 1, column: 31 @@ -571,13 +571,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectExpression", line: 1, - column: 12 + column: 11 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 32 @@ -590,7 +590,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 31 @@ -603,10 +603,10 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectExpression", line: 1, - column: 12 + column: 11 } ] }, @@ -616,16 +616,16 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectExpression", line: 1, - column: 12 + column: 11 }, { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectExpression", line: 1, - column: 19 + column: 18 } ] }, @@ -635,13 +635,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 28 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectExpression", line: 1, column: 40 @@ -658,10 +658,10 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectExpression", line: 1, - column: 23 + column: 22 } ] }, @@ -674,13 +674,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectPattern", line: 1, - column: 6 + column: 5 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectPattern", line: 1, column: 10 @@ -694,7 +694,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectPattern", line: 1, column: 11 @@ -708,13 +708,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectPattern", line: 1, - column: 6 + column: 5 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 12 @@ -728,7 +728,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never"], errors: [ { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 11 @@ -742,7 +742,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectPattern", line: 1, column: 11 @@ -756,10 +756,10 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["always"], errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectPattern", line: 1, - column: 6 + column: 5 } ] }, @@ -771,7 +771,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never", {"arraysInObjects": true}], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression" } ] @@ -782,7 +782,7 @@ ruleTester.run('babel/object-curly-spacing', rule, { options: ["never", {"arraysInObjects": true}], errors: [ { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectExpression" } ] @@ -801,13 +801,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "A space is required after '{'", + message: "A space is required after '{'.", type: "ObjectPattern", line: 1, - column: 14 + column: 13 }, { - message: "A space is required before '}'", + message: "A space is required before '}'.", type: "ObjectPattern", line: 1, column: 17 @@ -826,13 +826,13 @@ ruleTester.run('babel/object-curly-spacing', rule, { }, errors: [ { - message: "There should be no space after '{'", + message: "There should be no space after '{'.", type: "ObjectPattern", line: 1, - column: 14 + column: 13 }, { - message: "There should be no space before '}'", + message: "There should be no space before '}'.", type: "ObjectPattern", line: 1, column: 19 diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock new file mode 100644 index 000000000000..b7e874dfa9d9 --- /dev/null +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -0,0 +1,1023 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +acorn@^5.5.0: + version "5.5.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" + +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + +ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + dependencies: + color-convert "^1.9.0" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +babel-code-frame@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" + dependencies: + chalk "^1.1.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +babel-eslint@^7.1.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" + dependencies: + babel-code-frame "^6.22.0" + babel-traverse "^6.23.1" + babel-types "^6.23.0" + babylon "^6.17.0" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + dependencies: + babel-runtime "^6.22.0" + +babel-runtime@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-traverse@^6.23.1: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" + dependencies: + babel-code-frame "^6.22.0" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-types "^6.25.0" + babylon "^6.17.2" + debug "^2.2.0" + globals "^9.0.0" + invariant "^2.2.0" + lodash "^4.2.0" + +babel-types@^6.23.0, babel-types@^6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" + dependencies: + babel-runtime "^6.22.0" + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^1.0.1" + +babylon@^6.17.0, babylon@^6.17.2: + version "6.17.4" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browser-stdout@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" + +buffer-from@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + +chalk@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + +circular-json@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + +color-convert@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" + dependencies: + color-name "^1.1.1" + +color-name@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + +commander@2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +core-js@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" + dependencies: + ms "0.7.2" + +debug@^2.2.0: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + +del@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" + dependencies: + globby "^5.0.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + rimraf "^2.2.8" + +diff@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + dependencies: + esutils "^2.0.2" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +eslint-rule-composer@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.1.1.tgz#479dfd4e93d7f2777499a35ce9be76403c8e982a" + +eslint-scope@^3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + +eslint@^4.19.1: + version "4.19.1" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.4" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^1.0.1" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "4.0.2" + text-table "~0.2.0" + +espree@^3.5.4: + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + +esprima@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + +esquery@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" + dependencies: + estraverse "^4.1.0" + object-assign "^4.0.1" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + +external-editor@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" + dependencies: + circular-json "^0.3.1" + del "^2.0.2" + graceful-fs "^4.1.2" + write "^0.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + +glob@7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.0.1: + version "11.4.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" + +globals@^9.0.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + +globby@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" + dependencies: + array-union "^1.0.1" + arrify "^1.0.0" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +growl@1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + +iconv-lite@^0.4.17: + version "0.4.19" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" + +ignore@^3.3.3: + version "3.3.7" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +invariant@^2.2.0: + version "2.2.2" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" + dependencies: + loose-envify "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" + dependencies: + path-is-inside "^1.0.1" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + +is-resolvable@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" + dependencies: + tryit "^1.0.1" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + +js-tokens@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" + +js-yaml@^3.9.1: + version "3.11.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + +json3@3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash._baseassign@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" + dependencies: + lodash._basecopy "^3.0.0" + lodash.keys "^3.0.0" + +lodash._basecopy@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" + +lodash._basecreate@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" + +lodash._getnative@^3.0.0: + version "3.9.1" + resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" + +lodash._isiterateecall@^3.0.0: + version "3.0.9" + resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" + +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + +lodash.create@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" + dependencies: + lodash._baseassign "^3.0.0" + lodash._basecreate "^3.0.0" + lodash._isiterateecall "^3.0.0" + +lodash.isarguments@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" + +lodash.isarray@^3.0.0: + version "3.0.4" + resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" + +lodash.keys@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" + dependencies: + lodash._getnative "^3.0.0" + lodash.isarguments "^3.0.0" + lodash.isarray "^3.0.0" + +lodash@^4.17.4: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" + +lodash@^4.2.0, lodash@^4.3.0: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +loose-envify@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +lru-cache@^4.0.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + +minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +mkdirp@0.5.1, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + +mocha@^3.0.0: + version "3.4.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" + dependencies: + browser-stdout "1.3.0" + commander "2.9.0" + debug "2.6.0" + diff "3.2.0" + escape-string-regexp "1.0.5" + glob "7.1.1" + growl "1.9.2" + json3 "3.3.2" + lodash.create "3.1.1" + mkdirp "0.5.1" + supports-color "3.1.2" + +ms@0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-is-inside@^1.0.1, path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + +readable-stream@^2.2.2: + version "2.3.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.0.tgz#640f5dcda88c91a8dc60787145629170813a1ed2" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.0" + string_decoder "~1.0.0" + util-deprecate "~1.0.1" + +regenerator-runtime@^0.10.0: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + +regexpp@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@^2.2.8: + version "2.6.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" + dependencies: + glob "^7.0.5" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + dependencies: + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + +safe-buffer@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" + +safe-buffer@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223" + +semver@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.2.tgz#b29e1f4e1125fa97a10382b8a533737b7491e179" + dependencies: + safe-buffer "~5.0.1" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + dependencies: + ansi-regex "^3.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + +supports-color@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" + dependencies: + has-flag "^1.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" + dependencies: + has-flag "^3.0.0" + +table@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + +to-fast-properties@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + +tryit@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + dependencies: + prelude-ls "~1.1.2" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +which@^1.2.9: + version "1.3.0" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" + dependencies: + isexe "^2.0.0" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + dependencies: + mkdirp "^0.5.1" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" From 2624190887fd6d1f8bf754aaa53a6c14cc98d10d Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 30 Mar 2018 09:09:23 -0500 Subject: [PATCH 747/965] Update deprecation table with versions --- eslint/babel-eslint-plugin/README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index a9da5486713d..d2965cef58e5 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -48,10 +48,12 @@ Each rule corresponds to a core `eslint` rule, and has the same options. #### Deprecated -- `babel/generator-star-spacing`: Use [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing). -- `babel/object-shorthand`: Use [`object-shorthand`](http://eslint.org/docs/rules/object-shorthand). -- `babel/arrow-parens`: Use [`arrow-parens`](http://eslint.org/docs/rules/arrow-parens). -- `babel/func-params-comma-dangle`: Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle). -- `babel/array-bracket-spacing`: Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing). -- `babel/flow-object-type`: Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter). -- `babel/no-await-in-loop`: Use [`no-await-in-loop`](http://eslint.org/docs/rules/no-await-in-loop). +| Rule | Notes | +|:---------------------------------|:-----------------------------------| +| `babel/generator-star-spacing` | Use [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing) since eslint@3.6.0 | +| `babel/object-shorthand` | Use [`object-shorthand`](http://eslint.org/docs/rules/object-shorthand) since eslint@0.20.0 | +| `babel/arrow-parens` | Use [`arrow-parens`](http://eslint.org/docs/rules/arrow-parens) since eslint@3.10.0 | +| `babel/func-params-comma-dangle` | Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle) since eslint@3.8.0 | +| `babel/array-bracket-spacing` | Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing) since eslint@3.9.0 | +| `babel/flow-object-type` | Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter) since eslint-plugin-flowtype@2.23.0 | +| `babel/no-await-in-loop` | Use [`no-await-in-loop`](http://eslint.org/docs/rules/no-await-in-loop) since eslint@3.12.0 | From 550dcfc96a66e6ae824e78cda4c6309129d66ee1 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 30 Mar 2018 09:11:10 -0500 Subject: [PATCH 748/965] Merge pull request babel/eslint-plugin-babel#139 from babel/quotes-jsxfragment Add babel/quotes rule for JSXFragment workaround --- eslint/babel-eslint-plugin/README.md | 6 +- eslint/babel-eslint-plugin/package.json | 2 +- eslint/babel-eslint-plugin/rules/quotes.js | 18 + .../babel-eslint-plugin/tests/rules/quotes.js | 320 ++++++++++++++++++ eslint/babel-eslint-plugin/yarn.lock | 174 ++++++---- 5 files changed, 448 insertions(+), 72 deletions(-) create mode 100644 eslint/babel-eslint-plugin/rules/quotes.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/quotes.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index d2965cef58e5..3571f1923c6f 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -29,8 +29,9 @@ original ones as well!). { "rules": { "babel/new-cap": 1, - "babel/object-curly-spacing": 1, "babel/no-invalid-this": 1, + "babel/object-curly-spacing": 1, + "babel/quotes": 1, "babel/semi": 1 } } @@ -42,8 +43,9 @@ Each rule corresponds to a core `eslint` rule, and has the same options. 🛠: means it's autofixable with `--fix`. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) +- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) +- `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) - `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) #### Deprecated diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 8c0b36b7e1b7..bbdfa7bd9ed9 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -33,7 +33,7 @@ "eslint-rule-composer": "^0.1.1" }, "devDependencies": { - "babel-eslint": "^7.1.0", + "babel-eslint": "^8.2.2", "eslint": "^4.19.1", "lodash.clonedeep": "^4.5.0", "mocha": "^3.0.0" diff --git a/eslint/babel-eslint-plugin/rules/quotes.js b/eslint/babel-eslint-plugin/rules/quotes.js new file mode 100644 index 000000000000..41cd7da5a325 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/quotes.js @@ -0,0 +1,18 @@ +'use strict'; + +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const quotesRule = new eslint.Linter().getRules().get('quotes'); + +module.exports = ruleComposer.filterReports( + quotesRule, + (problem, metadata) => { + // Workaround for JSX fragment syntax until + // https://github.com/eslint/eslint/issues/9662 + if (problem.node.parent.type === "JSXFragment") { + return false; + } + + return true; + } +); diff --git a/eslint/babel-eslint-plugin/tests/rules/quotes.js b/eslint/babel-eslint-plugin/tests/rules/quotes.js new file mode 100644 index 000000000000..96b93e674a57 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/quotes.js @@ -0,0 +1,320 @@ +var rule = require('../../rules/quotes'), + RuleTester = require('../RuleTester'); + +var ruleTester = new RuleTester(); +ruleTester.run('babel/quotes', rule, { + valid: [ + "var foo = \"bar\";", + { code: "var foo = 'bar';", options: ["single"] }, + { code: "var foo = \"bar\";", options: ["double"] }, + { code: "var foo = 1;", options: ["single"] }, + { code: "var foo = 1;", options: ["double"] }, + { code: "var foo = \"'\";", options: ["single", { avoidEscape: true }] }, + { code: "var foo = '\"';", options: ["double", { avoidEscape: true }] }, + { code: "var foo =
Hello world
;", options: ["single"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + { code: "var foo =
;", options: ["single"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + { code: "var foo =
Hello world
;", options: ["double"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + { code: "var foo =
Hello world
;", options: ["double", { avoidEscape: true }], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + { code: "var foo = `bar`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `bar 'baz'`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `bar \"baz\"`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = 1;", options: ["backtick"] }, + { code: "var foo = \"a string containing `backtick` quotes\";", options: ["backtick", { avoidEscape: true }] }, + { code: "var foo =
;", options: ["backtick"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + { code: "var foo =
Hello world
;", options: ["backtick"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, + + // Backticks are only okay if they have substitutions, contain a line break, or are tagged + { code: "var foo = `back\ntick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `back\rtick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `back\u2028tick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `back\u2029tick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { + code: "var foo = `back\\\\\ntick`;", // 2 backslashes followed by a newline + options: ["single"], + parserOptions: { ecmaVersion: 6 } + }, + { code: "var foo = `back\\\\\\\\\ntick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `\n`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `back${x}tick`;", options: ["double"], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = tag`backtick`;", options: ["double"], parserOptions: { ecmaVersion: 6 } }, + + // Backticks are also okay if allowTemplateLiterals + { code: "var foo = `bar 'foo' baz` + 'bar';", options: ["single", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `bar 'foo' baz` + \"bar\";", options: ["double", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, + { code: "var foo = `bar 'foo' baz` + `bar`;", options: ["backtick", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, + + // `backtick` should not warn the directive prologues. + { code: "\"use strict\"; var foo = `backtick`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "\"use strict\"; 'use strong'; \"use asm\"; var foo = `backtick`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "function foo() { \"use strict\"; \"use strong\"; \"use asm\"; var foo = `backtick`; }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "(function() { 'use strict'; 'use strong'; 'use asm'; var foo = `backtick`; })();", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "(() => { \"use strict\"; \"use strong\"; \"use asm\"; var foo = `backtick`; })();", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + + // `backtick` should not warn import/export sources. + { code: "import \"a\"; import 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, + { code: "import a from \"a\"; import b from 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, + { code: "export * from \"a\"; export * from 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, + + // `backtick` should not warn property/method names (not computed). + { code: "var obj = {\"key0\": 0, 'key1': 1};", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "class Foo { 'bar'(){} }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + { code: "class Foo { static ''(){} }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + + // Babel + '<>foo;', + { code: '<>foo;', options: ['single'] }, + { code: '<>foo;', options: ['double'] }, + '<>
;', + { code: '<>
;', options: ['single'] }, + { code: '<>
;', options: ['double'] }, + ], + invalid: [ + { + code: "var foo = 'bar';", + output: "var foo = \"bar\";", + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var foo = \"bar\";", + output: "var foo = 'bar';", + options: ["single"], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }] + }, + { + code: "var foo = `bar`;", + output: "var foo = 'bar';", + options: ["single"], + parserOptions: { + ecmaVersion: 6 + }, + errors: [{ message: "Strings must use singlequote.", type: "TemplateLiteral" }] + }, + { + code: "var foo = 'don\\'t';", + output: "var foo = \"don't\";", + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var msg = \"Plugin '\" + name + \"' not found\"", + output: "var msg = 'Plugin \\'' + name + '\\' not found'", + options: ["single"], + errors: [ + { message: "Strings must use singlequote.", type: "Literal", column: 11 }, + { message: "Strings must use singlequote.", type: "Literal", column: 31 } + ] + }, + { + code: "var foo = 'bar';", + output: "var foo = \"bar\";", + options: ["double"], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var foo = `bar`;", + output: "var foo = \"bar\";", + options: ["double"], + parserOptions: { + ecmaVersion: 6 + }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "var foo = \"bar\";", + output: "var foo = 'bar';", + options: ["single", { avoidEscape: true }], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }] + }, + { + code: "var foo = 'bar';", + output: "var foo = \"bar\";", + options: ["double", { avoidEscape: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var foo = '\\\\';", + output: "var foo = \"\\\\\";", + options: ["double", { avoidEscape: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var foo = \"bar\";", + output: "var foo = 'bar';", + options: ["single", { allowTemplateLiterals: true }], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }] + }, + { + code: "var foo = 'bar';", + output: "var foo = \"bar\";", + options: ["double", { allowTemplateLiterals: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }] + }, + { + code: "var foo = 'bar';", + output: "var foo = `bar`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "var foo = 'b${x}a$r';", + output: "var foo = `b\\${x}a$r`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "var foo = \"bar\";", + output: "var foo = `bar`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "var foo = \"bar\";", + output: "var foo = `bar`;", + options: ["backtick", { avoidEscape: true }], + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "var foo = 'bar';", + output: "var foo = `bar`;", + options: ["backtick", { avoidEscape: true }], + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + + // "use strict" is *not* a directive prologue in these statements so is subject to the rule + { + code: "var foo = `backtick`; \"use strict\";", + output: "var foo = `backtick`; `use strict`;", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "{ \"use strict\"; var foo = `backtick`; }", + output: "{ `use strict`; var foo = `backtick`; }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + { + code: "if (1) { \"use strict\"; var foo = `backtick`; }", + output: "if (1) { `use strict`; var foo = `backtick`; }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }] + }, + + // `backtick` should warn computed property names. + { + code: "var obj = {[\"key0\"]: 0, ['key1']: 1};", + output: "var obj = {[`key0`]: 0, [`key1`]: 1};", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use backtick.", type: "Literal" }, + { message: "Strings must use backtick.", type: "Literal" } + ] + }, + { + code: "class Foo { ['a'](){} static ['b'](){} }", + output: "class Foo { [`a`](){} static [`b`](){} }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use backtick.", type: "Literal" }, + { message: "Strings must use backtick.", type: "Literal" } + ] + }, + + // https://github.com/eslint/eslint/issues/7084 + { + code: "
", + output: "
", + options: ["single"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [ + { message: "Strings must use singlequote.", type: "Literal" } + ] + }, + { + code: "
", + output: "
", + options: ["double"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [ + { message: "Strings must use doublequote.", type: "Literal" } + ] + }, + { + code: "
", + output: "
", + options: ["backtick"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [ + { message: "Strings must use backtick.", type: "Literal" } + ] + }, + + // https://github.com/eslint/eslint/issues/7610 + { + code: "`use strict`;", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "function foo() { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "foo = function() { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "() => { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "() => { foo(); `use strict`; }", + output: "() => { foo(); \"use strict\"; }", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "foo(); `use strict`;", + output: "foo(); \"use strict\";", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + + // https://github.com/eslint/eslint/issues/7646 + { + code: "var foo = `foo\\nbar`;", + output: "var foo = \"foo\\nbar\";", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "var foo = `foo\\\nbar`;", // 1 backslash followed by a newline + output: "var foo = \"foo\\\nbar\";", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "var foo = `foo\\\\\\\nbar`;", // 3 backslashes followed by a newline + output: "var foo = \"foo\\\\\\\nbar\";", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] + }, + { + code: "````", + output: "\"\"``", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral", line: 1, column: 1 }] + } + ], +}); diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock index b7e874dfa9d9..dab1b2ffb796 100644 --- a/eslint/babel-eslint-plugin/yarn.lock +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -2,6 +2,82 @@ # yarn lockfile v1 +"@babel/code-frame@7.0.0-beta.42", "@babel/code-frame@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz#a9c83233fa7cd06b39dc77adbb908616ff4f1962" + dependencies: + "@babel/highlight" "7.0.0-beta.42" + +"@babel/generator@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.42.tgz#777bb50f39c94a7e57f73202d833141f8159af33" + dependencies: + "@babel/types" "7.0.0-beta.42" + jsesc "^2.5.1" + lodash "^4.2.0" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-function-name@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.42.tgz#b38b8f4f85168d1812c543dd700b5d549b0c4658" + dependencies: + "@babel/helper-get-function-arity" "7.0.0-beta.42" + "@babel/template" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + +"@babel/helper-get-function-arity@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.42.tgz#ad072e32f912c033053fc80478169aeadc22191e" + dependencies: + "@babel/types" "7.0.0-beta.42" + +"@babel/helper-split-export-declaration@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.42.tgz#0d0d5254220a9cc4e7e226240306b939dc210ee7" + dependencies: + "@babel/types" "7.0.0-beta.42" + +"@babel/highlight@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.42.tgz#a502a1c0d6f99b2b0e81d468a1b0c0e81e3f3623" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/template@7.0.0-beta.42": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.42.tgz#7186d4e70d44cdec975049ba0a73bdaf5cdee052" + dependencies: + "@babel/code-frame" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + babylon "7.0.0-beta.42" + lodash "^4.2.0" + +"@babel/traverse@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.42.tgz#f4bf4d1e33d41baf45205e2d0463591d57326285" + dependencies: + "@babel/code-frame" "7.0.0-beta.42" + "@babel/generator" "7.0.0-beta.42" + "@babel/helper-function-name" "7.0.0-beta.42" + "@babel/helper-split-export-declaration" "7.0.0-beta.42" + "@babel/types" "7.0.0-beta.42" + babylon "7.0.0-beta.42" + debug "^3.1.0" + globals "^11.1.0" + invariant "^2.2.0" + lodash "^4.2.0" + +"@babel/types@7.0.0-beta.42", "@babel/types@^7.0.0-beta.40": + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.42.tgz#1e2118767684880f6963801b272fd2b3348efacc" + dependencies: + esutils "^2.0.2" + lodash "^4.2.0" + to-fast-properties "^2.0.0" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -79,54 +155,20 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-eslint@^7.1.0: - version "7.2.3" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-7.2.3.tgz#b2fe2d80126470f5c19442dc757253a897710827" +babel-eslint@^8.2.2: + version "8.2.2" + resolved "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b" dependencies: - babel-code-frame "^6.22.0" - babel-traverse "^6.23.1" - babel-types "^6.23.0" - babylon "^6.17.0" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - dependencies: - babel-runtime "^6.22.0" - -babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-traverse@^6.23.1: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" - dependencies: - babel-code-frame "^6.22.0" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" - babylon "^6.17.2" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-types@^6.23.0, babel-types@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" - dependencies: - babel-runtime "^6.22.0" - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" + "@babel/code-frame" "^7.0.0-beta.40" + "@babel/traverse" "^7.0.0-beta.40" + "@babel/types" "^7.0.0-beta.40" + babylon "^7.0.0-beta.40" + eslint-scope "~3.7.1" + eslint-visitor-keys "^1.0.0" -babylon@^6.17.0, babylon@^6.17.2: - version "6.17.4" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.4.tgz#3e8b7402b88d22c3423e137a1577883b15ff869a" +babylon@7.0.0-beta.42, babylon@^7.0.0-beta.40: + version "7.0.0-beta.42" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.42.tgz#67cfabcd4f3ec82999d29031ccdea89d0ba99657" balanced-match@^1.0.0: version "1.0.0" @@ -226,10 +268,6 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" -core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" - core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -248,12 +286,6 @@ debug@2.6.0: dependencies: ms "0.7.2" -debug@^2.2.0: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" @@ -294,7 +326,7 @@ eslint-rule-composer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.1.1.tgz#479dfd4e93d7f2777499a35ce9be76403c8e982a" -eslint-scope@^3.7.1: +eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" dependencies: @@ -452,14 +484,10 @@ glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.0.1: +globals@^11.0.1, globals@^11.1.0: version "11.4.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" -globals@^9.0.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -594,6 +622,10 @@ js-yaml@^3.9.1: argparse "^1.0.7" esprima "^4.0.0" +jsesc@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" + json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" @@ -822,10 +854,6 @@ readable-stream@^2.2.2: string_decoder "~1.0.0" util-deprecate "~1.0.1" -regenerator-runtime@^0.10.0: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - regexpp@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" @@ -902,6 +930,10 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" +source-map@^0.5.0: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" @@ -976,9 +1008,13 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -to-fast-properties@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" tryit@^1.0.1: version "1.0.3" From 8e49bbbb091b53c31b82a72a8d68cc33cd92ac34 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 30 Mar 2018 09:28:48 -0500 Subject: [PATCH 749/965] Add quotes rule to index --- eslint/babel-eslint-plugin/index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index ffc2cf994a93..98fcdc137627 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -2,16 +2,17 @@ module.exports = { rules: { - 'generator-star-spacing': require('./rules/generator-star-spacing'), - 'new-cap': require('./rules/new-cap'), - 'object-curly-spacing': require('./rules/object-curly-spacing'), 'array-bracket-spacing': require('./rules/array-bracket-spacing'), - 'object-shorthand': require('./rules/object-shorthand'), 'arrow-parens': require('./rules/arrow-parens'), - 'no-await-in-loop': require('./rules/no-await-in-loop'), 'flow-object-type': require('./rules/flow-object-type'), 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), + 'generator-star-spacing': require('./rules/generator-star-spacing'), + 'new-cap': require('./rules/new-cap'), + 'no-await-in-loop': require('./rules/no-await-in-loop'), 'no-invalid-this': require('./rules/no-invalid-this'), + 'object-curly-spacing': require('./rules/object-curly-spacing'), + 'object-shorthand': require('./rules/object-shorthand'), + 'quotes': require('./rules/quotes'), 'semi': require('./rules/semi'), }, rulesConfig: { @@ -25,6 +26,7 @@ module.exports = { 'flow-object-type': 0, 'func-params-comma-dangle': 0, 'no-invalid-this': 0, + 'quotes': 0, 'semi': 0, } }; From 1037e37418b28b68e2f5a27d978ddac357cd0573 Mon Sep 17 00:00:00 2001 From: Henry Zhu Date: Sat, 31 Mar 2018 08:42:29 -0400 Subject: [PATCH 750/965] 5.0.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index bbdfa7bd9ed9..4c5b50cbe43a 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "4.1.2", + "version": "5.0.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From bc15f0627d0f5a2e6a37f74b70f6f43934d0997a Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 18 Apr 2018 20:25:42 -0500 Subject: [PATCH 751/965] Merge pull request babel/eslint-plugin-babel#131 from lyleunderwood/do-expressions add no-unused-expressions with do expressions support --- eslint/babel-eslint-plugin/README.md | 4 +- eslint/babel-eslint-plugin/index.js | 2 + .../rules/no-unused-expressions.js | 49 ++++++ .../tests/rules/no-unused-expressions.js | 143 ++++++++++++++++++ 4 files changed, 197 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/rules/no-unused-expressions.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 3571f1923c6f..70f6f833a505 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -32,7 +32,8 @@ original ones as well!). "babel/no-invalid-this": 1, "babel/object-curly-spacing": 1, "babel/quotes": 1, - "babel/semi": 1 + "babel/semi": 1, + "babel/no-unused-expressions": 1 } } ``` @@ -47,6 +48,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) - `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) +- `babel/no-unused-expressions`: doesn't fail when using `do` expressions #### Deprecated diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 98fcdc137627..39962b9f75e3 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -14,6 +14,7 @@ module.exports = { 'object-shorthand': require('./rules/object-shorthand'), 'quotes': require('./rules/quotes'), 'semi': require('./rules/semi'), + 'no-unused-expressions': require('./rules/no-unused-expressions'), }, rulesConfig: { 'generator-star-spacing': 0, @@ -28,5 +29,6 @@ module.exports = { 'no-invalid-this': 0, 'quotes': 0, 'semi': 0, + 'no-unused-expressions': 0, } }; diff --git a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js new file mode 100644 index 000000000000..94628cb32a34 --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js @@ -0,0 +1,49 @@ +"use strict"; + +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const rule = new eslint.Linter().getRules().get('no-unused-expressions'); + +/** + * @param {ASTNode} node - any node + * @returns {boolean} whether the given node is either an IfStatement or an + * ExpressionStatement and is the last node in the body of a BlockStatement + */ +function isFinalStatementInBlockStatement(node) { + const parent = node.parent; + return /^(?:If|Expression)Statement$/.test(node.type) && + parent.type === 'BlockStatement' && + parent.body[parent.body.length - 1] === node; +} + +/** + * @param {ASTNode} node - any node + * @returns {boolean} whether the given node represents an unbroken chain of + * tail ExpressionStatements and IfStatements within a DoExpression + */ +function isInDoStatement(node) { + if (!node) return false; + + if (node.type === 'DoExpression') return true; + + // this is an `else if` + if ( + node.type === 'IfStatement' && + node.parent && + node.parent.type === 'IfStatement' + ) { + return isInDoStatement(node.parent); + } + + if (isFinalStatementInBlockStatement(node)) { + return isInDoStatement(node.parent.parent); + } + + return false; +} + +module.exports = ruleComposer.filterReports( + rule, + (problem, metadata) => !isInDoStatement(problem.node) +); + diff --git a/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js new file mode 100644 index 000000000000..a8156ec174f7 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js @@ -0,0 +1,143 @@ +/** + * @fileoverview Tests for no-unused-expressions rule. + * @author Michael Ficarra + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const rule = require("../../rules/no-unused-expressions"), + RuleTester = require("../RuleTester"); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const ruleTester = new RuleTester(); + +ruleTester.run("no-unused-expressions", rule, { + valid: [ + // Original test cases. + "function f(){}", + "a = b", + "new a", + "{}", + "f(); g()", + "i++", + "a()", + { code: "a && a()", options: [{ allowShortCircuit: true }] }, + { code: "a() || (b = c)", options: [{ allowShortCircuit: true }] }, + { code: "a ? b() : c()", options: [{ allowTernary: true }] }, + { code: "a ? b() || (c = d) : e()", options: [{ allowShortCircuit: true, allowTernary: true }] }, + "delete foo.bar", + "void new C", + "\"use strict\";", + "\"directive one\"; \"directive two\"; f();", + "function foo() {\"use strict\"; return true; }", + { code: "var foo = () => {\"use strict\"; return true; }", parserOptions: { ecmaVersion: 6 } }, + "function foo() {\"directive one\"; \"directive two\"; f(); }", + "function foo() { var foo = \"use strict\"; return true; }", + { + code: "function* foo(){ yield 0; }", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "async function foo() { await 5; }", + parserOptions: { ecmaVersion: 8 } + }, + { + code: "async function foo() { await foo.bar; }", + parserOptions: { ecmaVersion: 8 } + }, + { + code: "async function foo() { bar && await baz; }", + options: [{ allowShortCircuit: true }], + parserOptions: { ecmaVersion: 8 } + }, + { + code: "async function foo() { foo ? await bar : await baz; }", + options: [{ allowTernary: true }], + parserOptions: { ecmaVersion: 8 } + }, + { + code: "tag`tagged template literal`", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 } + }, + { + code: "shouldNotBeAffectedByAllowTemplateTagsOption()", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 } + }, + + // Babel-specific test cases. + "let a = do { if (foo) { foo.bar } }", + "let a = do { foo }", + "let a = do { let b = 2; foo; }", + "let a = do { (foo + 1) }", + "let a = do { if (foo) { if (foo.bar) { foo.bar } } }", + "let a = do { if (foo) { if (foo.bar) { foo.bar } else if (foo.baz) { foo.baz } } }", + + ], + invalid: [ + { code: "0", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "f(), 0", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "{0}", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "[]", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a && b();", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a() || false", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a || (b = c)", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a ? b() || (c = d) : e", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { + code: "`untagged template literal`", + parserOptions: { ecmaVersion: 6 }, + errors: ["Expected an assignment or function call and instead saw an expression."] + }, + { + code: "tag`tagged template literal`", + parserOptions: { ecmaVersion: 6 }, + errors: ["Expected an assignment or function call and instead saw an expression."] + }, + { code: "a && b()", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a ? b() : c()", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a || b", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a() && b", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a ? b : 0", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "a ? b : c()", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "foo.bar;", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "!a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "+a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "\"directive one\"; f(); \"directive two\";", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "function foo() {\"directive one\"; f(); \"directive two\"; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "if (0) { \"not a directive\"; f(); }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "function foo() { var foo = true; \"use strict\"; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "var foo = () => { var foo = true; \"use strict\"; }", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { + code: "`untagged template literal`", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 }, + errors: ["Expected an assignment or function call and instead saw an expression."] + }, + { + code: "`untagged template literal`", + options: [{ allowTaggedTemplates: false }], + parserOptions: { ecmaVersion: 6 }, + errors: ["Expected an assignment or function call and instead saw an expression."] + }, + { + code: "tag`tagged template literal`", + options: [{ allowTaggedTemplates: false }], + parserOptions: { ecmaVersion: 6 }, + errors: ["Expected an assignment or function call and instead saw an expression."] + }, + + // Babel-specific test cases. + { code: "let a = do { foo; let b = 2; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "let a = do { if (foo) { foo.bar } else { a; bar.foo } }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + + ] +}); From 5b5d9a5decac4cb5c30d8435f576e9eafd9520d1 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 18 Apr 2018 20:29:53 -0500 Subject: [PATCH 752/965] eslint-rule-composer@0.3.0 --- eslint/babel-eslint-plugin/package.json | 2 +- eslint/babel-eslint-plugin/yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 4c5b50cbe43a..796d7a629c74 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -30,7 +30,7 @@ "eslint": ">=4.0.0" }, "dependencies": { - "eslint-rule-composer": "^0.1.1" + "eslint-rule-composer": "^0.3.0" }, "devDependencies": { "babel-eslint": "^8.2.2", diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock index dab1b2ffb796..038c6659b6b9 100644 --- a/eslint/babel-eslint-plugin/yarn.lock +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -322,9 +322,9 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -eslint-rule-composer@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.1.1.tgz#479dfd4e93d7f2777499a35ce9be76403c8e982a" +eslint-rule-composer@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" eslint-scope@^3.7.1, eslint-scope@~3.7.1: version "3.7.1" From ae68b5bf24772c1747afb73ee8baa1d90b762ef1 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 18 Apr 2018 20:33:36 -0500 Subject: [PATCH 753/965] Refresh new-cap tests --- .../tests/rules/new-cap.js | 56 +++++++++++++------ 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/eslint/babel-eslint-plugin/tests/rules/new-cap.js b/eslint/babel-eslint-plugin/tests/rules/new-cap.js index 5fe53cbe3996..d03adde0713a 100644 --- a/eslint/babel-eslint-plugin/tests/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/tests/rules/new-cap.js @@ -37,36 +37,46 @@ ruleTester.run('babel/new-cap', rule, { "var x = Symbol('symbol')", "var x = _();", "var x = $();", - { code: "var x = Foo(42)", options: [{"capIsNew": false}] }, - { code: "var x = bar.Foo(42)", options: [{"capIsNew": false}] }, + { code: "var x = Foo(42)", options: [{ capIsNew: false }] }, + { code: "var x = bar.Foo(42)", options: [{ capIsNew: false }] }, + { code: "var x = Foo.bar(42)", options: [{ capIsNew: false }] }, "var x = bar[Foo](42)", - {code: "var x = bar['Foo'](42)", options: [{"capIsNew": false}] }, + { code: "var x = bar['Foo'](42)", options: [{ capIsNew: false }] }, "var x = Foo.bar(42)", - { code: "var x = new foo(42)", options: [{"newIsCap": false}] }, + { code: "var x = new foo(42)", options: [{ newIsCap: false }] }, "var o = { 1: function() {} }; o[1]();", "var o = { 1: function() {} }; new o[1]();", { code: "var x = Foo(42);", options: [{ capIsNew: true, capIsNewExceptions: ["Foo"] }] }, + { code: "var x = Foo(42);", options: [{ capIsNewExceptionPattern: "^Foo" }] }, { code: "var x = new foo(42);", options: [{ newIsCap: true, newIsCapExceptions: ["foo"] }] }, + { code: "var x = new foo(42);", options: [{ newIsCapExceptionPattern: "^foo" }] }, { code: "var x = Object(42);", options: [{ capIsNewExceptions: ["Foo"] }] }, { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Bar"] }] }, { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Foo.Bar"] }] }, + + { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptionPattern: "^Foo\\.." }] }, { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["bar"] }] }, { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["foo.bar"] }] }, + { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptionPattern: "^foo\\.." }] }, + { code: "var x = new foo.bar(42);", options: [{ properties: false }] }, + { code: "var x = Foo.bar(42);", options: [{ properties: false }] }, + { code: "var x = foo.Bar(42);", options: [{ capIsNew: false, properties: false }] }, + // Babel-specific test cases. { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, ], invalid: [ - { code: "var x = new c();", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, - { code: "var x = new φ;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, - { code: "var x = new a.b.c;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, - { code: "var x = new a.b['c'];", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression"}] }, - { code: "var b = Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, - { code: "var b = a.Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, - { code: "var b = a['Foo']();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, - { code: "var b = a.Date.UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, - { code: "var b = UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression"}] }, + { code: "var x = new c();", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, + { code: "var x = new φ;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, + { code: "var x = new a.b.c;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, + { code: "var x = new a.b['c'];", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, + { code: "var b = Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, + { code: "var b = a.Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, + { code: "var b = a['Foo']();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, + { code: "var b = a.Date.UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, + { code: "var b = UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, { code: "var a = B.C();", errors: [ @@ -125,13 +135,25 @@ ruleTester.run('babel/new-cap', rule, { { code: "var x = Foo.Bar(42);", - options: [{capIsNewExceptions: ["Foo"]}], - errors: [{type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor."}] + options: [{ capIsNewExceptions: ["Foo"] }], + errors: [{ type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor." }] + }, + { + code: "var x = Bar.Foo(42);", + + options: [{ capIsNewExceptionPattern: "^Foo\\.." }], + errors: [{ type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor." }] }, { code: "var x = new foo.bar(42);", - options: [{newIsCapExceptions: ["foo"]}], - errors: [{type: "NewExpression", message: "A constructor name should not start with a lowercase letter."}] + options: [{ newIsCapExceptions: ["foo"] }], + errors: [{ type: "NewExpression", message: "A constructor name should not start with a lowercase letter." }] + }, + { + code: "var x = new bar.foo(42);", + + options: [{ newIsCapExceptionPattern: "^foo\\.." }], + errors: [{ type: "NewExpression", message: "A constructor name should not start with a lowercase letter." }] } ] }); From 562deb8f09e1ccc4a24e6354d3377e42e1e08d25 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 19 Apr 2018 23:30:41 -0500 Subject: [PATCH 754/965] Merge pull request babel/eslint-plugin-babel#144 from babel/issue142 Fix bug with semi rule with class properties and omitLastInOneLineBlock option --- eslint/babel-eslint-plugin/rules/semi.js | 4 ++-- eslint/babel-eslint-plugin/tests/rules/semi.js | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/rules/semi.js index 95a2467bfc52..2d2fcc4ed292 100644 --- a/eslint/babel-eslint-plugin/rules/semi.js +++ b/eslint/babel-eslint-plugin/rules/semi.js @@ -83,11 +83,11 @@ const semiRuleWithClassProperty = ruleComposer.joinReports([ } } else { if (!isSemicolon(lastToken)) { - if (!exceptOneLine || !isOneLinerBlock(node)) { + if (!exceptOneLine || !isOneLinerBlock(context, node)) { report(context, node); } } else { - if (exceptOneLine && isOneLinerBlock(node)) { + if (exceptOneLine && isOneLinerBlock(context, node)) { report(context, node, true); } } diff --git a/eslint/babel-eslint-plugin/tests/rules/semi.js b/eslint/babel-eslint-plugin/tests/rules/semi.js index b3f4620df919..15ebea037ff6 100644 --- a/eslint/babel-eslint-plugin/tests/rules/semi.js +++ b/eslint/babel-eslint-plugin/tests/rules/semi.js @@ -103,10 +103,12 @@ ruleTester.run("semi", rule, { "class Foo { bar = 'example'; }", "class Foo { static bar = 'example'; }", { code: "async function foo() { for await (let thing of {}) { console.log(thing); } }", parserOptions: { ecmaVersion: 6 } }, + { code: "class Foo { bar = () => {}; }", options: ["always", { omitLastInOneLineBlock: true }] }, // babel, "never" { code: "class Foo { bar = 'example' }", options: ["never"] }, - { code: "class Foo { static bar = 'example' }", options: ["never"] } + { code: "class Foo { static bar = 'example' }", options: ["never"] }, + { code: "class Foo { bar = () => {} }", options: ["never"] }, ], invalid: [ { code: "import * as utils from './utils'", output: "import * as utils from './utils';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration", column: 33 }] }, @@ -184,9 +186,19 @@ ruleTester.run("semi", rule, { // babel { code: "class Foo { bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, { code: "class Foo { static bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, + { + code: "class Foo { bar = () => {} }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Missing semicolon." }] + }, // babel, "never" { code: "class Foo { bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] }, - { code: "class Foo { static bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] } + { code: "class Foo { static bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] }, + { + code: "class Foo { bar = () => {}; }", + options: ["never"], + errors: [{ message: "Extra semicolon." }] + }, ] }); From 3e7fe7b25e81c6458cfe8804d6ee12ecc5b24e7d Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Fri, 20 Apr 2018 08:49:02 -0500 Subject: [PATCH 755/965] 5.1.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 796d7a629c74..49662a943c94 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "5.0.0", + "version": "5.1.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 2ea80c845e68ab16eb00855f0877b657cfa4d79f Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Tue, 4 Sep 2018 10:34:28 -0500 Subject: [PATCH 756/965] Merge pull request babel/eslint-plugin-babel#157 from amilajack/patch-1 Test against modern node versions --- eslint/babel-eslint-plugin/.travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml index 6dbd2e233605..068a0122c856 100644 --- a/eslint/babel-eslint-plugin/.travis.yml +++ b/eslint/babel-eslint-plugin/.travis.yml @@ -4,6 +4,6 @@ git: sudo: false language: node_js node_js: - - '4' - - '6' - - '7' + - 6 + - 8 + - 10 From b3ce66b1ff3e65dd26ff077d1905704e7c6c3f0d Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 5 Sep 2018 09:20:31 -0500 Subject: [PATCH 757/965] Merge pull request babel/eslint-plugin-babel#158 from lehni/fix/optional-call-expression-in-no-unused-expressions --- .../rules/no-unused-expressions.js | 16 +++++++++++++++- .../tests/rules/no-unused-expressions.js | 15 ++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js index 94628cb32a34..eb1955ab0bb8 100644 --- a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js @@ -42,8 +42,22 @@ function isInDoStatement(node) { return false; } +/** + * @param {ASTNode} node - any node + * @returns {boolean} whether the given node is an optional call expression, + * see https://github.com/tc39/proposal-optional-chaining + */ +function isOptionalCallExpression(node) { + return ( + !!node && + node.type === 'ExpressionStatement' && + node.expression.type === 'OptionalCallExpression' + ); +} + module.exports = ruleComposer.filterReports( rule, - (problem, metadata) => !isInDoStatement(problem.node) + (problem, metadata) => + !isInDoStatement(problem.node) && !isOptionalCallExpression(problem.node) ); diff --git a/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js index a8156ec174f7..8ecbf68f2622 100644 --- a/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js @@ -74,12 +74,13 @@ ruleTester.run("no-unused-expressions", rule, { }, // Babel-specific test cases. - "let a = do { if (foo) { foo.bar } }", - "let a = do { foo }", - "let a = do { let b = 2; foo; }", - "let a = do { (foo + 1) }", - "let a = do { if (foo) { if (foo.bar) { foo.bar } } }", - "let a = do { if (foo) { if (foo.bar) { foo.bar } else if (foo.baz) { foo.baz } } }", + "let a = do { if (foo) { foo.bar; } }", + "let a = do { foo; }", + "let a = do { let b = 2; foo; }", + "let a = do { (foo + 1); }", + "let a = do { if (foo) { if (foo.bar) { foo.bar; } } }", + "let a = do { if (foo) { if (foo.bar) { foo.bar; } else if (foo.baz) { foo.baz; } } }", + "foo.bar?.();", ], invalid: [ @@ -136,7 +137,7 @@ ruleTester.run("no-unused-expressions", rule, { }, // Babel-specific test cases. - { code: "let a = do { foo; let b = 2; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, + { code: "let a = do { foo; let b = 2; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, { code: "let a = do { if (foo) { foo.bar } else { a; bar.foo } }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, ] From d03a00c1a4a217d3956cfb73c1baa26d26d07b50 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 5 Sep 2018 09:26:43 -0500 Subject: [PATCH 758/965] mocha@5.2.0 (babel/eslint-plugin-babel#159) --- eslint/babel-eslint-plugin/package.json | 2 +- eslint/babel-eslint-plugin/yarn.lock | 148 ++++++------------------ 2 files changed, 36 insertions(+), 114 deletions(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 49662a943c94..95f805c72cf9 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -36,6 +36,6 @@ "babel-eslint": "^8.2.2", "eslint": "^4.19.1", "lodash.clonedeep": "^4.5.0", - "mocha": "^3.0.0" + "mocha": "^5.2.0" } } diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock index 038c6659b6b9..1b01166993d9 100644 --- a/eslint/babel-eslint-plugin/yarn.lock +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -181,9 +181,9 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" buffer-from@^1.0.0: version "1.0.0" @@ -249,11 +249,9 @@ color-name@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" concat-map@0.0.1: version "0.0.1" @@ -280,13 +278,7 @@ cross-spawn@^5.1.0: shebang-command "^1.2.0" which "^1.2.9" -debug@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" - dependencies: - ms "0.7.2" - -debug@^3.1.0: +debug@3.1.0, debug@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" dependencies: @@ -308,9 +300,9 @@ del@^2.0.2: pinkie-promise "^2.0.0" rimraf "^2.2.8" -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" doctrine@^2.1.0: version "2.1.0" @@ -462,18 +454,7 @@ functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: +glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -503,13 +484,9 @@ graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" has-ansi@^2.0.0: version "2.0.0" @@ -517,14 +494,14 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + iconv-lite@^0.4.17: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -634,10 +611,6 @@ json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -645,57 +618,10 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash@^4.17.4: version "4.17.5" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" @@ -721,7 +647,7 @@ mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" -minimatch@^3.0.2, minimatch@^3.0.4: +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -737,25 +663,21 @@ mkdirp@0.5.1, mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mocha@^3.0.0: - version "3.4.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.0" - diff "3.2.0" + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - json3 "3.3.2" - lodash.create "3.1.1" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" mkdirp "0.5.1" - supports-color "3.1.2" - -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" + supports-color "5.4.0" ms@2.0.0: version "2.0.0" @@ -967,11 +889,11 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -supports-color@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" dependencies: - has-flag "^1.0.0" + has-flag "^3.0.0" supports-color@^2.0.0: version "2.0.0" From f70f68e44a61a6a0e832158d3020d9918e622ae2 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 5 Sep 2018 09:41:55 -0500 Subject: [PATCH 759/965] Update readme for opt call support in no-unused-expressions [skip ci] (babel/eslint-plugin-babel#160) --- eslint/babel-eslint-plugin/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 70f6f833a505..da1dfe220890 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -48,7 +48,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) - `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) -- `babel/no-unused-expressions`: doesn't fail when using `do` expressions +- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). #### Deprecated From d86c6dd4492b6912471565714947cb6e91ea1912 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 6 Sep 2018 10:39:48 -0500 Subject: [PATCH 760/965] Add valid-typeof rule with support for BigInt (babel/eslint-plugin-babel#161) --- eslint/babel-eslint-plugin/README.md | 4 +- .../babel-eslint-plugin/rules/valid-typeof.js | 12 ++ .../tests/rules/valid-typeof.js | 193 ++++++++++++++++++ 3 files changed, 208 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/rules/valid-typeof.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/valid-typeof.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index da1dfe220890..7d1aebcbbdb2 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -33,7 +33,8 @@ original ones as well!). "babel/object-curly-spacing": 1, "babel/quotes": 1, "babel/semi": 1, - "babel/no-unused-expressions": 1 + "babel/no-unused-expressions": 1, + "babel/valid-typeof": 1 } } ``` @@ -49,6 +50,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. - `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) - `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) - `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). +- `babel/valid-typeof`: doesn't complain when used with [BigInt](https://github.com/tc39/proposal-bigint) (`typeof BigInt(9007199254740991) === 'bigint'`). #### Deprecated diff --git a/eslint/babel-eslint-plugin/rules/valid-typeof.js b/eslint/babel-eslint-plugin/rules/valid-typeof.js new file mode 100644 index 000000000000..df5110be052a --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/valid-typeof.js @@ -0,0 +1,12 @@ +"use strict"; + +const ruleComposer = require('eslint-rule-composer'); +const eslint = require('eslint'); +const validTypeOf = new eslint.Linter().getRules().get('valid-typeof'); + +module.exports = ruleComposer.filterReports( + validTypeOf, + (problem, metadata) => { + return problem.node.value !== 'bigint'; + } +) diff --git a/eslint/babel-eslint-plugin/tests/rules/valid-typeof.js b/eslint/babel-eslint-plugin/tests/rules/valid-typeof.js new file mode 100644 index 000000000000..8e474f6bb123 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/valid-typeof.js @@ -0,0 +1,193 @@ +/** + * @fileoverview Ensures that the results of typeof are compared against a valid string + * @author Ian Christian Myers + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const rule = require("../../rules/valid-typeof"), + RuleTester = require("../RuleTester"); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const ruleTester = new RuleTester(); + +ruleTester.run("valid-typeof", rule, { + valid: [ + // Original test cases. + "typeof foo === 'string'", + "typeof foo === 'object'", + "typeof foo === 'function'", + "typeof foo === 'undefined'", + "typeof foo === 'boolean'", + "typeof foo === 'number'", + "'string' === typeof foo", + "'object' === typeof foo", + "'function' === typeof foo", + "'undefined' === typeof foo", + "'boolean' === typeof foo", + "'number' === typeof foo", + "typeof foo === typeof bar", + "typeof foo === baz", + "typeof foo !== someType", + "typeof bar != someType", + "someType === typeof bar", + "someType == typeof bar", + "typeof foo == 'string'", + "typeof(foo) === 'string'", + "typeof(foo) !== 'string'", + "typeof(foo) == 'string'", + "typeof(foo) != 'string'", + "var oddUse = typeof foo + 'thing'", + { + code: "typeof foo === 'number'", + options: [{ requireStringLiterals: true }] + }, + { + code: "typeof foo === \"number\"", + options: [{ requireStringLiterals: true }] + }, + { + code: "var baz = typeof foo + 'thing'", + options: [{ requireStringLiterals: true }] + }, + { + code: "typeof foo === typeof bar", + options: [{ requireStringLiterals: true }] + }, + { + code: "typeof foo === `string`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 } + }, + { + code: "`object` === typeof foo", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 } + }, + { + code: "typeof foo === `str${somethingElse}`", + parserOptions: { ecmaVersion: 6 } + }, + + // Babel-specific test cases. + { + code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'" + }, + { + code: "'bigint' === typeof BigInt(Number.MAX_SAFE_INTEGER)" + }, + { + code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", + options: [{ requireStringLiterals: true }] + }, + ], + invalid: [ + { + code: "typeof foo === 'strnig'", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "'strnig' === typeof foo", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "if (typeof bar === 'umdefined') {}", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "typeof foo !== 'strnig'", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "'strnig' !== typeof foo", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "if (typeof bar !== 'umdefined') {}", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "typeof foo != 'strnig'", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "'strnig' != typeof foo", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "if (typeof bar != 'umdefined') {}", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "typeof foo == 'strnig'", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "'strnig' == typeof foo", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "if (typeof bar == 'umdefined') {}", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "if (typeof bar === `umdefined`) {}", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Invalid typeof comparison value.", type: "TemplateLiteral" }] + }, + { + code: "typeof foo == 'invalid string'", + options: [{ requireStringLiterals: true }], + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "typeof foo == Object", + options: [{ requireStringLiterals: true }], + errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] + }, + { + code: "typeof foo === undefined", + options: [{ requireStringLiterals: true }], + errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] + }, + { + code: "undefined === typeof foo", + options: [{ requireStringLiterals: true }], + errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] + }, + { + code: "undefined == typeof foo", + options: [{ requireStringLiterals: true }], + errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] + }, + { + code: "typeof foo === `undefined${foo}`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Typeof comparisons should be to string literals.", type: "TemplateLiteral" }] + }, + { + code: "typeof foo === `${string}`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Typeof comparisons should be to string literals.", type: "TemplateLiteral" }] + }, + + // Babel-specific test cases. + { + code: "typeof foo === 'bgiint'", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + { + code: "'bignit' === typeof foo", + errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] + }, + ] +}); From 7c97b5587ad5cd48fc87f2b30e39dc8587408eb5 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 6 Sep 2018 10:45:30 -0500 Subject: [PATCH 761/965] 5.2.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 95f805c72cf9..911b3c9bb802 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "5.1.0", + "version": "5.2.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From e8c0f529a0ac2d5427137ffad9b44df53a2b4771 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 27 Sep 2018 08:20:52 -0500 Subject: [PATCH 762/965] Fix missing valid-typeof export (babel/eslint-plugin-babel#165) --- eslint/babel-eslint-plugin/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 39962b9f75e3..5ef9660ce452 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -10,25 +10,27 @@ module.exports = { 'new-cap': require('./rules/new-cap'), 'no-await-in-loop': require('./rules/no-await-in-loop'), 'no-invalid-this': require('./rules/no-invalid-this'), + 'no-unused-expressions': require('./rules/no-unused-expressions'), 'object-curly-spacing': require('./rules/object-curly-spacing'), 'object-shorthand': require('./rules/object-shorthand'), 'quotes': require('./rules/quotes'), 'semi': require('./rules/semi'), - 'no-unused-expressions': require('./rules/no-unused-expressions'), + 'valid-typeof': require('./rules/valid-typeof'), }, rulesConfig: { - 'generator-star-spacing': 0, - 'new-cap': 0, - 'object-curly-spacing': 0, 'array-bracket-spacing': 0, - 'object-shorthand': 0, 'arrow-parens': 0, - 'no-await-in-loop': 0, 'flow-object-type': 0, 'func-params-comma-dangle': 0, + 'generator-star-spacing': 0, + 'new-cap': 0, + 'no-await-in-loop': 0, 'no-invalid-this': 0, + 'no-unused-expressions': 0, + 'object-curly-spacing': 0, + 'object-shorthand': 0, 'quotes': 0, 'semi': 0, - 'no-unused-expressions': 0, - } + 'valid-typeof': 0, + }, }; From 2358ed1bf920f9f60e13cf5fcc19eca07e80a0dd Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 27 Sep 2018 09:09:40 -0500 Subject: [PATCH 763/965] 5.2.1 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 911b3c9bb802..0f41d9156f43 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "5.2.0", + "version": "5.2.1", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From eccbdab734c8ccd42790e9838595ef0ff7e48236 Mon Sep 17 00:00:00 2001 From: Ville Saukkonen Date: Thu, 8 Nov 2018 17:47:03 +0200 Subject: [PATCH 764/965] Camelcase - support for optional chaining (babel/eslint-plugin-babel#163) --- eslint/babel-eslint-plugin/README.md | 2 + eslint/babel-eslint-plugin/index.js | 4 +- eslint/babel-eslint-plugin/rules/camelcase.js | 194 ++++++ .../tests/rules/camelcase.js | 568 ++++++++++++++++++ 4 files changed, 767 insertions(+), 1 deletion(-) create mode 100644 eslint/babel-eslint-plugin/rules/camelcase.js create mode 100644 eslint/babel-eslint-plugin/tests/rules/camelcase.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 7d1aebcbbdb2..fba35aa4dc3f 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -29,6 +29,7 @@ original ones as well!). { "rules": { "babel/new-cap": 1, + "babel/camelcase": 1, "babel/no-invalid-this": 1, "babel/object-curly-spacing": 1, "babel/quotes": 1, @@ -45,6 +46,7 @@ Each rule corresponds to a core `eslint` rule, and has the same options. 🛠: means it's autofixable with `--fix`. - `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) +- `babel/camelcase: doesn't complain about optional chaining (`var foo = bar?.a_b;`) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) - `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 5ef9660ce452..6cd30daefb0b 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -8,6 +8,7 @@ module.exports = { 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), 'generator-star-spacing': require('./rules/generator-star-spacing'), 'new-cap': require('./rules/new-cap'), + 'camelcase': require('./rules/camelcase'), 'no-await-in-loop': require('./rules/no-await-in-loop'), 'no-invalid-this': require('./rules/no-invalid-this'), 'no-unused-expressions': require('./rules/no-unused-expressions'), @@ -20,6 +21,7 @@ module.exports = { rulesConfig: { 'array-bracket-spacing': 0, 'arrow-parens': 0, + 'camelcase': 0, 'flow-object-type': 0, 'func-params-comma-dangle': 0, 'generator-star-spacing': 0, @@ -28,7 +30,7 @@ module.exports = { 'no-invalid-this': 0, 'no-unused-expressions': 0, 'object-curly-spacing': 0, - 'object-shorthand': 0, + 'object-shorthand': 0, 'quotes': 0, 'semi': 0, 'valid-typeof': 0, diff --git a/eslint/babel-eslint-plugin/rules/camelcase.js b/eslint/babel-eslint-plugin/rules/camelcase.js new file mode 100644 index 000000000000..65e8164cd77b --- /dev/null +++ b/eslint/babel-eslint-plugin/rules/camelcase.js @@ -0,0 +1,194 @@ +/** + * @fileoverview Rule to flag non-camelcased identifiers + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = { + meta: { + docs: { + description: "enforce camelcase naming convention", + category: "Stylistic Issues", + recommended: false, + url: "https://eslint.org/docs/rules/camelcase" + }, + + schema: [ + { + type: "object", + properties: { + ignoreDestructuring: { + type: "boolean" + }, + properties: { + enum: ["always", "never"] + } + }, + additionalProperties: false + } + ], + + messages: { + notCamelCase: "Identifier '{{name}}' is not in camel case." + } + }, + + create(context) { + + //-------------------------------------------------------------------------- + // Helpers + //-------------------------------------------------------------------------- + + // contains reported nodes to avoid reporting twice on destructuring with shorthand notation + const reported = []; + const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); + const MEMBER_EXPRESSIONS = ["MemberExpression", "OptionalMemberExpression"]; + + /** + * Checks if expression is supported member expression. + * + * @param {string} expression - An expression to check. + * @returns {boolean} `true` if the expression type is supported + */ + function isMemberExpression(expression) { + return MEMBER_EXPRESSIONS.indexOf(expression) >= 0; + } + + /** + * Checks if a string contains an underscore and isn't all upper-case + * @param {string} name The string to check. + * @returns {boolean} if the string is underscored + * @private + */ + function isUnderscored(name) { + + // if there's an underscore, it might be A_CONSTANT, which is okay + return name.indexOf("_") > -1 && name !== name.toUpperCase(); + } + + /** + * Checks if a parent of a node is an ObjectPattern. + * @param {ASTNode} node The node to check. + * @returns {boolean} if the node is inside an ObjectPattern + * @private + */ + function isInsideObjectPattern(node) { + let { parent } = node; + + while (parent) { + if (parent.type === "ObjectPattern") { + return true; + } + + parent = parent.parent; + } + + return false; + } + + /** + * Reports an AST node as a rule violation. + * @param {ASTNode} node The node to report. + * @returns {void} + * @private + */ + function report(node) { + if (reported.indexOf(node.parent) < 0) { + reported.push(node.parent); + context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + } + } + + const options = context.options[0] || {}; + let properties = options.properties || ""; + const ignoreDestructuring = options.ignoreDestructuring || false; + + if (properties !== "always" && properties !== "never") { + properties = "always"; + } + + return { + + Identifier(node) { + + /* + * Leading and trailing underscores are commonly used to flag + * private/protected identifiers, strip them + */ + const name = node.name.replace(/^_+|_+$/g, ""), + effectiveParent = isMemberExpression(node.parent.type) ? node.parent.parent : node.parent; + + // MemberExpressions get special rules + if (isMemberExpression(node.parent.type)) { + + // "never" check properties + if (properties === "never") { + return; + } + + // Always report underscored object names + if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && isUnderscored(name)) { + report(node); + + // Report AssignmentExpressions only if they are the left side of the assignment + } else if (effectiveParent.type === "AssignmentExpression" && isUnderscored(name) && (!isMemberExpression(effectiveParent.right.type) || isMemberExpression(effectiveParent.left.type) && effectiveParent.left.property.name === node.name)) { + report(node); + } + + /* + * Properties have their own rules, and + * AssignmentPattern nodes can be treated like Properties: + * e.g.: const { no_camelcased = false } = bar; + */ + } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { + + if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { + + const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; + + // prevent checking righthand side of destructured object + if (node.parent.key === node && node.parent.value !== node) { + return; + } + + const valueIsUnderscored = node.parent.value.name && isUnderscored(name); + + // ignore destructuring if the option is set, unless a new identifier is created + if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + report(node); + } + } + + // "never" check properties or always ignore destructuring + if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { + return; + } + + // don't check right hand side of AssignmentExpression to prevent duplicate warnings + if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + report(node); + } + + // Check if it's an import specifier + } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].indexOf(node.parent.type) >= 0) { + + // Report only if the local imported identifier is underscored + if (node.parent.local && node.parent.local.name === node.name && isUnderscored(name)) { + report(node); + } + + // Report anything that is underscored that isn't a CallExpression + } else if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + report(node); + } + } + + }; + + } +}; diff --git a/eslint/babel-eslint-plugin/tests/rules/camelcase.js b/eslint/babel-eslint-plugin/tests/rules/camelcase.js new file mode 100644 index 000000000000..0344018515b8 --- /dev/null +++ b/eslint/babel-eslint-plugin/tests/rules/camelcase.js @@ -0,0 +1,568 @@ +/** + * @fileoverview Tests for camelcase rule. + * @author Nicholas C. Zakas + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const rule = require("../../rules/camelcase"), + RuleTester = require("../RuleTester"); + +//------------------------------------------------------------------------------ +// Tests +//------------------------------------------------------------------------------ + +const ruleTester = new RuleTester(); + +ruleTester.run("camelcase", rule, { + valid: [ + // Original test cases. + "firstName = \"Nicholas\"", + "FIRST_NAME = \"Nicholas\"", + "__myPrivateVariable = \"Patrick\"", + "myPrivateVariable_ = \"Patrick\"", + "function doSomething(){}", + "do_something()", + "new do_something", + "new do_something()", + "foo.do_something()", + "var foo = bar.baz_boom;", + "var foo = bar.baz_boom.something;", + "foo.boom_pow.qux = bar.baz_boom.something;", + "if (bar.baz_boom) {}", + "var obj = { key: foo.bar_baz };", + "var arr = [foo.bar_baz];", + "[foo.bar_baz]", + "var arr = [foo.bar_baz.qux];", + "[foo.bar_baz.nesting]", + "if (foo.bar_baz === boom.bam_pow) { [foo.baz_boom] }", + { + code: "var o = {key: 1}", + options: [{ properties: "always" }] + }, + { + code: "var o = {_leading: 1}", + options: [{ properties: "always" }] + }, + { + code: "var o = {trailing_: 1}", + options: [{ properties: "always" }] + }, + { + code: "var o = {bar_baz: 1}", + options: [{ properties: "never" }] + }, + { + code: "var o = {_leading: 1}", + options: [{ properties: "never" }] + }, + { + code: "var o = {trailing_: 1}", + options: [{ properties: "never" }] + }, + { + code: "obj.a_b = 2;", + options: [{ properties: "never" }] + }, + { + code: "obj._a = 2;", + options: [{ properties: "always" }] + }, + { + code: "obj.a_ = 2;", + options: [{ properties: "always" }] + }, + { + code: "obj._a = 2;", + options: [{ properties: "never" }] + }, + { + code: "obj.a_ = 2;", + options: [{ properties: "never" }] + }, + { + code: "var obj = {\n a_a: 1 \n};\n obj.a_b = 2;", + options: [{ properties: "never" }] + }, + { + code: "obj.foo_bar = function(){};", + options: [{ properties: "never" }] + }, + { + code: "var { category_id } = query;", + options: [{ ignoreDestructuring: true }], + parserOptions: { ecmaVersion: 6 } + }, + { + code: "var { category_id: category_id } = query;", + options: [{ ignoreDestructuring: true }], + parserOptions: { ecmaVersion: 6 } + }, + { + code: "var { category_id = 1 } = query;", + options: [{ ignoreDestructuring: true }], + parserOptions: { ecmaVersion: 6 }, + + }, + { + code: "var { category_id: category } = query;", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "var { _leading } = query;", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "var { trailing_ } = query;", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "import { camelCased } from \"external module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { _leading } from \"external module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { trailing_ } from \"external module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { no_camelcased as camelCased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { no_camelcased as _leading } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { no_camelcased as trailing_ } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "import { no_camelcased as camelCased, anoterCamelCased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" } + }, + { + code: "function foo({ no_camelcased: camelCased }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ no_camelcased: _leading }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ no_camelcased: trailing_ }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ camelCased = 'default value' }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ _leading = 'default value' }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ trailing_ = 'default value' }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ camelCased }) {};", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ _leading }) {}", + parserOptions: { ecmaVersion: 6 } + }, + { + code: "function foo({ trailing_ }) {}", + parserOptions: { ecmaVersion: 6 } + }, + + // Babel-specific test cases + { + code: "var foo = bar?.a_b;", + options: [{ properties: "never" }] + }, + ], + invalid: [ + { + code: "first_name = \"Nicholas\"", + errors: [ + { + messageId: "notCamelCase", + data: { name: "first_name" }, + type: "Identifier" + } + ] + }, + { + code: "__private_first_name = \"Patrick\"", + errors: [ + { + messageId: "notCamelCase", + data: { name: "__private_first_name" }, + type: "Identifier" + } + ] + }, + { + code: "function foo_bar(){}", + errors: [ + { + messageId: "notCamelCase", + data: { name: "foo_bar" }, + type: "Identifier" + } + ] + }, + { + code: "obj.foo_bar = function(){};", + errors: [ + { + messageId: "notCamelCase", + data: { name: "foo_bar" }, + type: "Identifier" + } + ] + }, + { + code: "bar_baz.foo = function(){};", + errors: [ + { + messageId: "notCamelCase", + data: { name: "bar_baz" }, + type: "Identifier" + } + ] + }, + { + code: "[foo_bar.baz]", + errors: [ + { + messageId: "notCamelCase", + data: { name: "foo_bar" }, + type: "Identifier" + } + ] + }, + { + code: "if (foo.bar_baz === boom.bam_pow) { [foo_bar.baz] }", + errors: [ + { + messageId: "notCamelCase", + data: { name: "foo_bar" }, + type: "Identifier" + } + ] + }, + { + code: "foo.bar_baz = boom.bam_pow", + errors: [ + { + messageId: "notCamelCase", + data: { name: "bar_baz" }, + type: "Identifier" + } + ] + }, + { + code: "var foo = { bar_baz: boom.bam_pow }", + errors: [ + { + messageId: "notCamelCase", + data: { name: "bar_baz" }, + type: "Identifier" + } + ] + }, + { + code: "foo.qux.boom_pow = { bar: boom.bam_pow }", + errors: [ + { + messageId: "notCamelCase", + data: { name: "boom_pow" }, + type: "Identifier" + } + ] + }, + { + code: "var o = {bar_baz: 1}", + options: [{ properties: "always" }], + errors: [ + { + messageId: "notCamelCase", + data: { name: "bar_baz" }, + type: "Identifier" + } + ] + }, + { + code: "obj.a_b = 2;", + options: [{ properties: "always" }], + errors: [ + { + messageId: "notCamelCase", + data: { name: "a_b" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id: category_alias } = query;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "category_alias" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id: category_alias } = query;", + options: [{ ignoreDestructuring: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "category_alias" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id: categoryId, ...other_props } = query;", + options: [{ ignoreDestructuring: true }], + parserOptions: { ecmaVersion: 2018 }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "other_props" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id } = query;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "category_id" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id: category_id } = query;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "category_id" }, + type: "Identifier" + } + ] + }, + { + code: "var { category_id = 1 } = query;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'category_id' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "import no_camelcased from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import * as no_camelcased from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import { no_camelcased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import { no_camelcased as no_camel_cased } from \"external module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camel_cased" }, + type: "Identifier" + } + ] + }, + { + code: "import { camelCased as no_camel_cased } from \"external module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camel_cased" }, + type: "Identifier" + } + ] + }, + { + code: "import { camelCased, no_camelcased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import { no_camelcased as camelCased, another_no_camelcased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "another_no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import camelCased, { no_camelcased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "import no_camelcased, { another_no_camelcased as camelCased } from \"external-module\";", + parserOptions: { ecmaVersion: 6, sourceType: "module" }, + errors: [ + { + messageId: "notCamelCase", + data: { name: "no_camelcased" }, + type: "Identifier" + } + ] + }, + { + code: "function foo({ no_camelcased }) {};", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "function foo({ no_camelcased = 'default value' }) {};", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "const no_camelcased = 0; function foo({ camelcased_value = no_camelcased}) {}", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + }, + { + message: "Identifier 'camelcased_value' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "const { bar: no_camelcased } = foo;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "function foo({ value_1: my_default }) {}", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'my_default' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "function foo({ isCamelcased: no_camelcased }) {};", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "var { foo: bar_baz = 1 } = quz;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'bar_baz' is not in camel case.", + type: "Identifier" + } + ] + }, + { + code: "const { no_camelcased = false } = bar;", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Identifier 'no_camelcased' is not in camel case.", + type: "Identifier" + } + ] + } + ] +}); From ebe197f12ecb3a8c0b3e63bc82f6f6189fc46065 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Thu, 15 Nov 2018 09:13:03 -0600 Subject: [PATCH 765/965] 5.3.0 --- eslint/babel-eslint-plugin/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 0f41d9156f43..1d07201d0473 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-babel", - "version": "5.2.1", + "version": "5.3.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", "scripts": { From 7061d966ab8ebcb13cf18ee65a520164e33ef8f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 20:20:59 -0500 Subject: [PATCH 766/965] Bump lodash from 4.17.4 to 4.17.14 (babel/eslint-plugin-babel#181) Bumps [lodash](https://github.com/lodash/lodash) from 4.17.4 to 4.17.14. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.4...4.17.14) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-plugin/yarn.lock | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock index 1b01166993d9..b057a7f7d565 100644 --- a/eslint/babel-eslint-plugin/yarn.lock +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -622,13 +622,9 @@ lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" -lodash@^4.17.4: - version "4.17.5" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" - -lodash@^4.2.0, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: + version "4.17.14" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" loose-envify@^1.0.0: version "1.3.1" From 693fa1aa0da42596366a61979c55eacfef2d4344 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 18:52:01 +0200 Subject: [PATCH 767/965] Bump js-yaml from 3.11.0 to 3.13.1 (babel/eslint-plugin-babel#177) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.11.0 to 3.13.1. - [Release notes](https://github.com/nodeca/js-yaml/releases) - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.11.0...3.13.1) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-plugin/yarn.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock index b057a7f7d565..7845d4d1c04c 100644 --- a/eslint/babel-eslint-plugin/yarn.lock +++ b/eslint/babel-eslint-plugin/yarn.lock @@ -128,8 +128,8 @@ ansi-styles@^3.2.1: color-convert "^1.9.0" argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" dependencies: sprintf-js "~1.0.2" @@ -380,8 +380,8 @@ espree@^3.5.4: acorn-jsx "^3.0.0" esprima@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" esquery@^1.0.0: version "1.0.0" @@ -593,8 +593,8 @@ js-tokens@^3.0.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" js-yaml@^3.9.1: - version "3.11.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.11.0.tgz#597c1a8bd57152f26d622ce4117851a51f5ebaef" + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" dependencies: argparse "^1.0.7" esprima "^4.0.0" From f3e2752df3f9815c494cbbc38b04d99b626d8ab9 Mon Sep 17 00:00:00 2001 From: fergald Date: Sat, 24 Aug 2019 17:12:15 +0900 Subject: [PATCH 768/965] Support private properties in no-invalid-this (babel/eslint-plugin-babel#183) * add failing test * support ClassPrivateProperty --- .../babel-eslint-plugin/rules/no-invalid-this.js | 7 ++++--- .../tests/rules/no-invalid-this.js | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-plugin/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/rules/no-invalid-this.js index ab12ca5320a3..994499eaadaa 100644 --- a/eslint/babel-eslint-plugin/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/rules/no-invalid-this.js @@ -5,17 +5,18 @@ const eslint = require('eslint'); const noInvalidThisRule = new eslint.Linter().getRules().get('no-invalid-this'); module.exports = ruleComposer.filterReports( - noInvalidThisRule, + noInvalidThisRule, (problem, metadata) => { let inClassProperty = false; let node = problem.node; while (node) { - if (node.type === "ClassProperty") { + if (node.type === "ClassProperty" || + node.type === "ClassPrivateProperty") { inClassProperty = true; return; } - + node = node.parent; } diff --git a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js index 3ab5da59c95f..e28c77aa5e07 100644 --- a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js @@ -602,6 +602,21 @@ const patterns = [ valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], invalid: [] }, + + // Class Private Instance Properties. + { + code: "class A {#a = this.b;};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, + + { + code: "class A {#a = () => {return this.b;};};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [] + }, ]; const ruleTester = new RuleTester(); From 3243af3e07a4661674027821377cfaf184807817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 18 Nov 2018 23:57:36 +0100 Subject: [PATCH 769/965] First commit --- .../.eslintrc.json | 20 + .../.gitignore | 1 + .../.prettierrc | 11 + .../babel-eslint-plugin-development/README.md | 29 + .../package.json | 30 + .../src/index.js | 5 + .../babel-eslint-plugin-development/yarn.lock | 857 ++++++++++++++++++ 7 files changed, 953 insertions(+) create mode 100644 eslint/babel-eslint-plugin-development/.eslintrc.json create mode 100644 eslint/babel-eslint-plugin-development/.gitignore create mode 100644 eslint/babel-eslint-plugin-development/.prettierrc create mode 100644 eslint/babel-eslint-plugin-development/README.md create mode 100644 eslint/babel-eslint-plugin-development/package.json create mode 100644 eslint/babel-eslint-plugin-development/src/index.js create mode 100644 eslint/babel-eslint-plugin-development/yarn.lock diff --git a/eslint/babel-eslint-plugin-development/.eslintrc.json b/eslint/babel-eslint-plugin-development/.eslintrc.json new file mode 100644 index 000000000000..0b09e73c3d1f --- /dev/null +++ b/eslint/babel-eslint-plugin-development/.eslintrc.json @@ -0,0 +1,20 @@ +{ + "root": true, + "extends": "eslint:recommended", + "plugins": ["prettier"], + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "script" + }, + "env": { + "node": true + }, + "rules": { + "prettier/prettier": "error", + + "curly": ["error", "multi-line"], + "linebreak-style": ["error", "unix"], + "no-var": "error", + "prefer-const": "error" + } +} diff --git a/eslint/babel-eslint-plugin-development/.gitignore b/eslint/babel-eslint-plugin-development/.gitignore new file mode 100644 index 000000000000..b512c09d4766 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/eslint/babel-eslint-plugin-development/.prettierrc b/eslint/babel-eslint-plugin-development/.prettierrc new file mode 100644 index 000000000000..bf2972ae07a3 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/.prettierrc @@ -0,0 +1,11 @@ +{ + "arrowParens": "avoid", + "trailingComma": "all", + "useTabs": false, + "semi": true, + "singleQuote": false, + "bracketSpacing": true, + "jsxBracketSameLine": false, + "tabWidth": 2, + "printWidth": 80 +} diff --git a/eslint/babel-eslint-plugin-development/README.md b/eslint/babel-eslint-plugin-development/README.md new file mode 100644 index 000000000000..c18f4801d90b --- /dev/null +++ b/eslint/babel-eslint-plugin-development/README.md @@ -0,0 +1,29 @@ +# eslint-plugin-babel-plugin + +A set of eslint rules to enforce best practices in the development of Babel plugins. + +## Installation + +You'll first need to install [ESLint](http://eslint.org): + +``` +$ npm install --save-dev eslint +``` + +Next, install `eslint-plugin-babel-plugin`: + +``` +$ npm install --save-dev eslint-plugin-babel-plugin +``` + +Then, load the plugin in your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: + +```json +{ + "plugins": ["babel-plugin"] +} +``` + +## Supported Rules + +* Fill in provided rules here diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json new file mode 100644 index 000000000000..ce7a934753c3 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/package.json @@ -0,0 +1,30 @@ +{ + "name": "eslint-plugin-babel-plugin", + "version": "0.0.0", + "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", + "keywords": [ + "eslint", + "eslintplugin", + "eslint-plugin" + ], + "author": { + "name": "Nicolò Ribaudo", + "email": "nicolo.ribaudo@gmail.com", + "url": "https://github.com/nicolo-ribaudo" + }, + "main": "index.js", + "scripts": { + "test": "mocha tests --recursive", + "lint": "eslint src" + }, + "devDependencies": { + "eslint": "^5.9.0", + "eslint-plugin-prettier": "^3.0.0", + "mocha": "^5.2.0", + "prettier": "^1.15.2" + }, + "engines": { + "node": ">=8.0.0" + }, + "license": "MIT" +} diff --git a/eslint/babel-eslint-plugin-development/src/index.js b/eslint/babel-eslint-plugin-development/src/index.js new file mode 100644 index 000000000000..84d69fb8226d --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/index.js @@ -0,0 +1,5 @@ +"use strict"; + +module.exports = { + rules: {}, +}; diff --git a/eslint/babel-eslint-plugin-development/yarn.lock b/eslint/babel-eslint-plugin-development/yarn.lock new file mode 100644 index 000000000000..7532a9eae183 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/yarn.lock @@ -0,0 +1,857 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +acorn-jsx@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.0.tgz#958584ddb60990c02c97c1bd9d521fce433bb101" + integrity sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg== + +acorn@^6.0.2: + version "6.0.4" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" + integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== + +ajv@^6.5.3: + version "6.5.5" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1" + integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" + integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= + +chalk@^2.0.0, chalk@^2.1.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" + integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" + integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== + dependencies: + ms "^2.1.1" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-plugin-prettier@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz#f6b823e065f8c36529918cdb766d7a0e975ec30c" + integrity sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw== + dependencies: + prettier-linter-helpers "^1.0.0" + +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^5.9.0: + version "5.9.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.9.0.tgz#b234b6d15ef84b5849c6de2af43195a2d59d408e" + integrity sha512-g4KWpPdqN0nth+goDNICNXGfJF7nNnepthp46CAlJoJtC5K/cLu3NgCM3AHu1CkJ5Hzt9V0Y0PBAO6Ay/gGb+w== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^4.0.0" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + imurmurhash "^0.1.4" + inquirer "^6.1.0" + is-resolvable "^1.1.0" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^2.0.1" + require-uncached "^1.0.3" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.0.2" + text-table "^0.2.0" + +espree@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.1.0.tgz#728d5451e0fd156c04384a7ad89ed51ff54eb25f" + integrity sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +external-editor@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +flat-cache@^1.2.1: + version "1.3.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" + integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== + dependencies: + circular-json "^0.3.1" + graceful-fs "^4.1.2" + rimraf "~2.6.2" + write "^0.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.0.5, glob@^7.1.2: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.7.0: + version "11.9.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" + integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== + +graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +inquirer@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" + integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.0" + figures "^2.0.0" + lodash "^4.17.10" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.1.0" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-resolvable@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.12.0: + version "3.12.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" + integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash@^4.17.10, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@3.0.4, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +mkdirp@0.5.1, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + +prettier@^1.15.2: + version "1.15.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.2.tgz#d31abe22afa4351efa14c7f8b94b58bb7452205e" + integrity sha512-YgPLFFA0CdKL4Eg2IHtUSjzj/BWgszDHiNQAe0VAIBse34148whfdzLagRL+QiKS+YfK5ftB6X4v/MBw8yCoug== + +progress@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.1.tgz#c9242169342b1c29d275889c95734621b1952e31" + integrity sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@~2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" + integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== + dependencies: + glob "^7.0.5" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.1.0: + version "6.3.3" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" + integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== + dependencies: + tslib "^1.9.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.5.0, semver@^5.5.1: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== + dependencies: + is-fullwidth-code-point "^2.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-json-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@^5.0.2: + version "5.1.0" + resolved "https://registry.yarnpkg.com/table/-/table-5.1.0.tgz#69a54644f6f01ad1628f8178715b408dc6bf11f7" + integrity sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg== + dependencies: + ajv "^6.5.3" + lodash "^4.17.10" + slice-ansi "1.0.0" + string-width "^2.1.1" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tslib@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" + integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= + dependencies: + mkdirp "^0.5.1" From 6285cb9b64032bbcb13be4cfe891589299e0f99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 19 Nov 2018 00:53:17 +0100 Subject: [PATCH 770/965] Add no-deprecated-clone rule --- .../package.json | 2 +- .../src/index.js | 4 +- .../src/rules/no-deprecated-clone.js | 91 +++++++++++ .../src/utils/get-export-name.js | 24 +++ .../src/utils/get-reference-origin.js | 142 ++++++++++++++++++ .../tests/rules/no-deprecated-clone.js | 138 +++++++++++++++++ 6 files changed, 399 insertions(+), 2 deletions(-) create mode 100644 eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js create mode 100644 eslint/babel-eslint-plugin-development/src/utils/get-export-name.js create mode 100644 eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js create mode 100644 eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index ce7a934753c3..428b9bbe0adf 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -15,7 +15,7 @@ "main": "index.js", "scripts": { "test": "mocha tests --recursive", - "lint": "eslint src" + "lint": "eslint src tests" }, "devDependencies": { "eslint": "^5.9.0", diff --git a/eslint/babel-eslint-plugin-development/src/index.js b/eslint/babel-eslint-plugin-development/src/index.js index 84d69fb8226d..3c401bd1b695 100644 --- a/eslint/babel-eslint-plugin-development/src/index.js +++ b/eslint/babel-eslint-plugin-development/src/index.js @@ -1,5 +1,7 @@ "use strict"; module.exports = { - rules: {}, + rules: { + "no-deprecated-clone": require("./rules/no-deprecated-clone"), + }, }; diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js new file mode 100644 index 000000000000..0d7cda0bc5e6 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js @@ -0,0 +1,91 @@ +// @flow + +"use strict"; + +const getReferenceOrigin = require("../utils/get-reference-origin"); +const getExportName = require("../utils/get-export-name"); + +function reportError(context, node, name) { + const isMemberExpression = node.type === "MemberExpression"; + const id = isMemberExpression ? node.property : node; + context.report({ + node: id, + message: `t.${name}() is deprecated. Use t.cloneNode() instead.`, + fix(fixer) { + if (isMemberExpression) { + return fixer.replaceText(id, "cloneNode"); + } + }, + }); +} + +module.exports = { + meta: { + schema: [], + fixable: "code", + }, + create(context) { + return { + CallExpression(node) { + const scope = context.getScope(); + const origin = getReferenceOrigin(node.callee, scope); + + const report = () => reportError(context, node.callee, origin.name); + + if (!origin) return; + + if ( + origin.kind === "import" && + (origin.name === "clone" || origin.name === "cloneDeep") && + origin.source === "@babel/types" + ) { + // imported from @babel/types + return report(); + } + + if ( + origin.kind === "property" && + (origin.path === "clone" || origin.path === "cloneDeep") && + origin.base.kind === "import" && + origin.base.name === "types" && + origin.base.source === "@babel/core" + ) { + // imported from @babel/core + return report(); + } + + if ( + origin.kind === "property" && + (origin.path === "types.clone" || + origin.path === "types.cloneDeep") && + origin.base.kind === "param" && + origin.base.index === 0 + ) { + const { functionNode } = origin.base; + const { parent } = functionNode; + + if (parent.type === "CallExpression") { + const calleeOrigin = getReferenceOrigin(parent.callee, scope); + if ( + calleeOrigin && + calleeOrigin.kind === "import" && + calleeOrigin.name === "declare" && + calleeOrigin.source === "@babel/helper-plugin-utils" + ) { + // Using "declare" from "@babel/helper-plugin-utils" + return report(); + } + } else { + const exportName = getExportName(functionNode); + + if (exportName === "default" || exportName === "module.exports") { + // export default function ({ types: t }) {} + // module.exports = function ({ types: t }) {} + return report(); + } + } + } + }, + }; + }, +}; diff --git a/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js b/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js new file mode 100644 index 000000000000..8c6e2c5e4086 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js @@ -0,0 +1,24 @@ +"use strict"; + +module.exports = function getExportName(node) { + const { parent } = node; + + if (parent.type === "ExportDefaultDeclaration") { + return "default"; + } + + if (parent.type === "ExportNamedDeclaration") { + return node.id.name; + } + + if ( + parent.type === "AssignmentExpression" && + parent.left.type === "MemberExpression" && + parent.left.object.type === "Identifier" && + parent.left.object.name === "module" && + parent.left.property.type === "Identifier" && + parent.left.property.name === "exports" + ) { + return "module.exports"; + } +}; diff --git a/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js b/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js new file mode 100644 index 000000000000..44cebc4edc0b --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js @@ -0,0 +1,142 @@ +"use strict"; + +module.exports = getReferenceOrigin; + +/*:: +type ReferenceOriginImport = { kind: "import", source: string, name: string }; +type ReferenceOriginParam = { + kind: "param", + index: number, + functionNode: Node, +}; + +type ReferenceOrigin = + | ReferenceOriginImport + | ReferenceOriginParam + | { kind: "import *", source: string } + | { + kind: "property", + base: ReferenceOriginImport | ReferenceOriginParam, + path: string, + name: string, + }; +*/ + +// Given a node and a context, returns a description of where its value comes +// from. +// It resolves imports, parameters of exported functions and property accesses. +// See the ReferenceOrigin type for more informations. +function getReferenceOrigin(node, scope) /*: ?ReferenceOrigin */ { + if (node.type === "Identifier") { + const variable = getVariableDefinition(node.name, scope); + if (!variable) return null; + + const definition = variable.definition; + const defNode = definition.node; + + if (definition.type === "ImportBinding") { + if (defNode.type === "ImportSpecifier") { + return { + kind: "import", + source: definition.parent.source.value, + name: defNode.imported.name, + }; + } + if (defNode.type === "ImportNamespaceSpecifier") { + return { + kind: "import *", + source: definition.parent.source.value, + }; + } + } + + if (definition.type === "Variable" && defNode.init) { + const origin = getReferenceOrigin(defNode.init, variable.scope); + return origin && patternToProperty(definition.name, origin); + } + + if (definition.type === "Parameter") { + return patternToProperty(definition.name, { + kind: "param", + index: definition.index, + functionNode: definition.node, + }); + } + } + + if (node.type === "MemberExpression" && !node.computed) { + const origin = getReferenceOrigin(node.object, scope); + return origin && addProperty(origin, node.property.name); + } + + return null; +} + +function getVariableDefinition(name, scope) { + let currentScope = scope; + do { + const variable = currentScope.set.get(name); + if (variable && variable.defs[0]) { + return { scope: currentScope, definition: variable.defs[0] }; + } + } while ((currentScope = currentScope.upper)); +} + +function patternToProperty(id, base) { + const path = getPatternPath(id); + return path && path.reduce(addProperty, base); +} + +// Adds a property to a given origin. If it was a namespace import it becomes +// a named import, so that `import * as x from "foo"; x.bar` and +// `import { bar } from "foo"` have the same origin. +function addProperty(origin, name) { + if (origin.kind === "import *") { + return { + kind: "import", + source: origin.source, + name, + }; + } + if (origin.kind === "property") { + return { + kind: "property", + base: origin.base, + path: origin.path + "." + name, + name, + }; + } + return { + kind: "property", + base: origin, + path: name, + name, + }; +} + +// if "node" is c of { a: { b: c } }, the result is ["a","b"] +function getPatternPath(node) { + let current = node; + const path = []; + + // Unshift keys to path while going up + do { + const property = current.parent; + if ( + property.type === "ArrayPattern" || + property.type === "AssignmentPattern" || + property.computed + ) { + // These nodes are not supported. + return null; + } + if (property.type === "Property") { + path.unshift(property.key.name); + } else { + // The destructuring pattern is finished + break; + } + } while ((current = current.parent.parent)); + + return path; +} diff --git a/eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js new file mode 100644 index 000000000000..473a3a32b21a --- /dev/null +++ b/eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js @@ -0,0 +1,138 @@ +"use strict"; + +const rule = require("../../src/rules/no-deprecated-clone"); +const { RuleTester } = require("eslint"); + +const cloneError = "t.clone() is deprecated. Use t.cloneNode() instead."; +const cloneDeepError = + "t.cloneDeep() is deprecated. Use t.cloneNode() instead."; + +const ruleTester = new RuleTester({ + parserOptions: { sourceType: "module" }, +}); + +ruleTester.run("no-deprecated-clone", rule, { + valid: [ + `_.clone(obj)`, + `_.cloneDeep(obj)`, + `import * as t from "lib"; t.clone();`, + `import * as t from "lib"; t.cloneDeep();`, + `function f(_) { _.types.clone(); }`, + `function f(_) { _.types.cloneDeep(); }`, + `import * as t from "@babel/types"; t.cloneNode();`, + ], + invalid: [ + { + code: `import { clone } from "@babel/types"; clone();`, + errors: [cloneError], + }, + { + code: `import { cloneDeep } from "@babel/types"; cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `import { clone } from "@babel/types"; var clone2 = clone; clone2();`, + errors: [cloneError], + }, + { + code: `import { cloneDeep } from "@babel/types"; var cloneDeep2 = cloneDeep; cloneDeep2();`, + errors: [cloneDeepError], + }, + { + code: `import * as t from "@babel/types"; t.clone();`, + errors: [cloneError], + }, + { + code: `import * as t from "@babel/types"; t.cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `import * as t from "@babel/types"; var { clone } = t; clone();`, + errors: [cloneError], + }, + { + code: `import * as t from "@babel/types"; var { cloneDeep } = t; cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `import { clone as c } from "@babel/types"; c();`, + errors: [cloneError], + }, + { + code: `import { cloneDeep as cD } from "@babel/types"; cD();`, + errors: [cloneDeepError], + }, + { + code: `import * as babel from "@babel/core"; babel.types.clone();`, + errors: [cloneError], + }, + { + code: `import * as babel from "@babel/core"; babel.types.cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `import { types } from "@babel/core"; types.clone();`, + errors: [cloneError], + }, + { + code: `import { types } from "@babel/core"; types.cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `import { types as t } from "@babel/core"; t.clone();`, + errors: [cloneError], + }, + { + code: `import { types as t } from "@babel/core"; t.cloneDeep();`, + errors: [cloneDeepError], + }, + { + code: `export default function plugin(babel) { babel.types.clone() }`, + errors: [cloneError], + }, + { + code: `export default function plugin(babel) { babel.types.cloneDeep() }`, + errors: [cloneDeepError], + }, + { + code: `export default function plugin({ types }) { types.clone() }`, + errors: [cloneError], + }, + { + code: `export default function plugin({ types }) { types.cloneDeep() }`, + errors: [cloneDeepError], + }, + { + code: `export default function plugin({ types: t }) { t.clone() }`, + errors: [cloneError], + }, + { + code: `export default function plugin({ types: t }) { t.cloneDeep() }`, + errors: [cloneDeepError], + }, + { + code: `export default ({ types }) => { types.clone() }`, + errors: [cloneError], + }, + { + code: `export default ({ types }) => { types.cloneDeep() }`, + errors: [cloneDeepError], + }, + { + code: `module.exports = function plugin({ types }) { types.clone() }`, + errors: [cloneError], + }, + { + code: `module.exports = function plugin({ types }) { types.cloneDeep() }`, + errors: [cloneDeepError], + }, + { + code: `import { declare } from "@babel/helper-plugin-utils"; declare(({ types }) => { types.clone() });`, + errors: [cloneError], + }, + { + code: `import { declare } from "@babel/helper-plugin-utils"; declare(({ types }) => { types.cloneDeep() });`, + errors: [cloneDeepError], + }, + ], +}); From 1f7197ec164ade83f4d0a7b1d7b64ffb4959bd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 18:02:40 +0100 Subject: [PATCH 771/965] Extract isFromBabelTypes helper --- .../src/rules/no-deprecated-clone.js | 84 ++++--------------- .../src/utils/is-from-babel-types.js | 56 +++++++++++++ 2 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js index 0d7cda0bc5e6..08bfef8c9be5 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js @@ -3,21 +3,7 @@ "use strict"; const getReferenceOrigin = require("../utils/get-reference-origin"); -const getExportName = require("../utils/get-export-name"); - -function reportError(context, node, name) { - const isMemberExpression = node.type === "MemberExpression"; - const id = isMemberExpression ? node.property : node; - context.report({ - node: id, - message: `t.${name}() is deprecated. Use t.cloneNode() instead.`, - fix(fixer) { - if (isMemberExpression) { - return fixer.replaceText(id, "cloneNode"); - } - }, - }); -} +const isFromBabelTypes = require("../utils/is-from-babel-types"); module.exports = { meta: { @@ -27,63 +13,29 @@ module.exports = { create(context) { return { CallExpression(node) { + const { callee } = node; const scope = context.getScope(); - const origin = getReferenceOrigin(node.callee, scope); - - const report = () => reportError(context, node.callee, origin.name); + const origin = getReferenceOrigin(callee, scope); if (!origin) return; + const { name } = origin; if ( - origin.kind === "import" && - (origin.name === "clone" || origin.name === "cloneDeep") && - origin.source === "@babel/types" - ) { - // imported from @babel/types - return report(); - } - - if ( - origin.kind === "property" && - (origin.path === "clone" || origin.path === "cloneDeep") && - origin.base.kind === "import" && - origin.base.name === "types" && - origin.base.source === "@babel/core" + (name === "clone" || name === "cloneDeep") && + isFromBabelTypes(origin, scope) ) { - // imported from @babel/core - return report(); - } - - if ( - origin.kind === "property" && - (origin.path === "types.clone" || - origin.path === "types.cloneDeep") && - origin.base.kind === "param" && - origin.base.index === 0 - ) { - const { functionNode } = origin.base; - const { parent } = functionNode; - - if (parent.type === "CallExpression") { - const calleeOrigin = getReferenceOrigin(parent.callee, scope); - if ( - calleeOrigin && - calleeOrigin.kind === "import" && - calleeOrigin.name === "declare" && - calleeOrigin.source === "@babel/helper-plugin-utils" - ) { - // Using "declare" from "@babel/helper-plugin-utils" - return report(); - } - } else { - const exportName = getExportName(functionNode); - - if (exportName === "default" || exportName === "module.exports") { - // export default function ({ types: t }) {} - // module.exports = function ({ types: t }) {} - return report(); - } - } + const isMemberExpression = callee.type === "MemberExpression"; + const id = isMemberExpression ? callee.property : callee; + + context.report({ + node: id, + message: `t.${name}() is deprecated. Use t.cloneNode() instead.`, + fix(fixer) { + if (isMemberExpression) { + return fixer.replaceText(id, "cloneNode"); + } + }, + }); } }, }; diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js new file mode 100644 index 000000000000..097fb4582cf7 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js @@ -0,0 +1,56 @@ +"use strict"; + +const getReferenceOrigin = require("./get-reference-origin"); +const getExportName = require("./get-export-name"); + +// Check if a ReferenceOrigin (returned by ./get-reference-origin.js) +// is a reference to a @babel/types export. +module.exports = function isFromBabelTypes( + origin /*: ReferenceOrigin */, + scope /*: Scope */, +) { + if (origin.kind === "import" && origin.source === "@babel/types") { + // imported from @babel/types + return true; + } + + if ( + origin.kind === "property" && + origin.base.kind === "import" && + origin.base.name === "types" && + origin.base.source === "@babel/core" + ) { + // imported from @babel/core + return true; + } + + if ( + origin.kind !== "property" || + origin.base.kind !== "param" || + origin.base.index !== 0 + ) { + // Not a parameter of the plugin factory function + return false; + } + + const { functionNode } = origin.base; + const { parent } = functionNode; + + if (parent.type === "CallExpression") { + const calleeOrigin = getReferenceOrigin(parent.callee, scope); + + // Using "declare" from "@babel/helper-plugin-utils" + return !!( + calleeOrigin && + calleeOrigin.kind === "import" && + calleeOrigin.name === "declare" && + calleeOrigin.source === "@babel/helper-plugin-utils" + ); + } + + const exportName = getExportName(functionNode); + + // export default function ({ types: t }) {} + // module.exports = function ({ types: t }) {} + return exportName === "default" || exportName === "module.exports"; +}; From 2be54111c09c555500559f91c0b373fcde4bcb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 18:13:37 +0100 Subject: [PATCH 772/965] Add no-undefined-identifier rule --- .../src/rules/no-undefined-identifier.js | 41 ++++++++++ .../tests/rules/no-undefined-identifier.js | 80 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js create mode 100644 eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js new file mode 100644 index 000000000000..c1b4b8a99382 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js @@ -0,0 +1,41 @@ +"use strict"; + +const getReferenceOrigin = require("../utils/get-reference-origin"); +const isFromBabelTypes = require("../utils/is-from-babel-types"); + +function firstArgumentIsUndefinedString(argumentsArray) { + return ( + argumentsArray.length > 0 && + argumentsArray[0].type === "Literal" && + argumentsArray[0].value === "undefined" + ); +} + +module.exports = { + meta: { + schema: [], + }, + create(context) { + return { + CallExpression(node) { + const { callee } = node; + const scope = context.getScope(); + + const origin = getReferenceOrigin(callee, scope); + if (!origin) return; + + const { name } = origin; + if ( + (name === "identifier" || name === "Identifier") && + firstArgumentIsUndefinedString(node.arguments) && + isFromBabelTypes(origin, scope) + ) { + context.report( + node, + "Use path.scope.buildUndefinedNode() to create an undefined identifier directly.", + ); + } + }, + }; + }, +}; diff --git a/eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js new file mode 100644 index 000000000000..c77516b177a4 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js @@ -0,0 +1,80 @@ +"use strict"; + +const rule = require("../../src/rules/no-undefined-identifier"); +const { RuleTester } = require("eslint"); + +const error = + "Use path.scope.buildUndefinedNode() to create an undefined identifier directly."; + +const ruleTester = new RuleTester({ + parserOptions: { sourceType: "module" }, +}); + +ruleTester.run("no-undefined-identifier", rule, { + valid: [ + `_.identifier("undefined")`, + `_.Identifier("undefined")`, + `import * as t from "lib"; t.identifier("undefined");`, + `function f(_) { _.types.identifier("undefined"); }`, + `import * as t from "@babel/types"; t.identifier("not_undefined");`, + `path.scope.buildUndefinedNode();`, + ], + invalid: [ + { + code: `import { identifier } from "@babel/types"; identifier("undefined");`, + errors: [error], + }, + { + code: `import { Identifier } from "@babel/types"; Identifier("undefined");`, + errors: [error], + }, + { + code: `import * as t from "@babel/types"; t.identifier("undefined");`, + errors: [error], + }, + { + code: `import * as t from "@babel/types"; var { identifier } = t; identifier("undefined");`, + errors: [error], + }, + { + code: `import { identifier as id } from "@babel/types"; id("undefined");`, + errors: [error], + }, + { + code: `import * as babel from "@babel/core"; babel.types.identifier("undefined");`, + errors: [error], + }, + { + code: `import { types } from "@babel/core"; types.identifier("undefined");`, + errors: [error], + }, + { + code: `import { types as t } from "@babel/core"; t.identifier("undefined");`, + errors: [error], + }, + { + code: `export default function plugin(babel) { babel.types.identifier("undefined") }`, + errors: [error], + }, + { + code: `export default function plugin({ types }) { types.identifier("undefined") }`, + errors: [error], + }, + { + code: `export default function plugin({ types: t }) { t.identifier("undefined") }`, + errors: [error], + }, + { + code: `export default ({ types }) => { types.identifier("undefined") }`, + errors: [error], + }, + { + code: `module.exports = function plugin({ types }) { types.identifier("undefined") }`, + errors: [error], + }, + { + code: `import { declare } from "@babel/helper-plugin-utils"; declare(({ types }) => { types.identifier("undefined") });`, + errors: [error], + }, + ], +}); From c59db5295497363531837ebb6d7ce4f282bbb99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 20:30:02 +0100 Subject: [PATCH 773/965] Extract isBabelPluginFactory helper --- .../src/utils/is-babel-plugin-factory.js | 26 +++++++++++++++ .../src/utils/is-from-babel-types.js | 33 ++++--------------- 2 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js b/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js new file mode 100644 index 000000000000..287124e22809 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js @@ -0,0 +1,26 @@ +"use strict"; + +const getReferenceOrigin = require("./get-reference-origin"); +const getExportName = require("./get-export-name"); + +module.exports = function isBabelPluginFactory(node, scope) { + const { parent } = node; + + if (parent.type === "CallExpression") { + const calleeOrigin = getReferenceOrigin(parent.callee, scope); + + // Using "declare" from "@babel/helper-plugin-utils" + return !!( + calleeOrigin && + calleeOrigin.kind === "import" && + calleeOrigin.name === "declare" && + calleeOrigin.source === "@babel/helper-plugin-utils" + ); + } + + const exportName = getExportName(node); + + // export default function ({ types: t }) {} + // module.exports = function ({ types: t }) {} + return exportName === "default" || exportName === "module.exports"; +}; diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js index 097fb4582cf7..36ab618817d6 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js +++ b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js @@ -1,7 +1,6 @@ "use strict"; -const getReferenceOrigin = require("./get-reference-origin"); -const getExportName = require("./get-export-name"); +const isBabelPluginFactory = require("./is-babel-plugin-factory"); // Check if a ReferenceOrigin (returned by ./get-reference-origin.js) // is a reference to a @babel/types export. @@ -25,32 +24,12 @@ module.exports = function isFromBabelTypes( } if ( - origin.kind !== "property" || - origin.base.kind !== "param" || - origin.base.index !== 0 + origin.kind === "property" && + origin.base.kind === "param" && + origin.base.index === 0 ) { - // Not a parameter of the plugin factory function - return false; - } - - const { functionNode } = origin.base; - const { parent } = functionNode; - - if (parent.type === "CallExpression") { - const calleeOrigin = getReferenceOrigin(parent.callee, scope); - - // Using "declare" from "@babel/helper-plugin-utils" - return !!( - calleeOrigin && - calleeOrigin.kind === "import" && - calleeOrigin.name === "declare" && - calleeOrigin.source === "@babel/helper-plugin-utils" - ); + return isBabelPluginFactory(origin.base.functionNode, scope); } - const exportName = getExportName(functionNode); - - // export default function ({ types: t }) {} - // module.exports = function ({ types: t }) {} - return exportName === "default" || exportName === "module.exports"; + return false; }; From 110191d81eaf326749a2436adfec7d6e4a678fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 20:30:08 +0100 Subject: [PATCH 774/965] Add plugin-name rule --- .../src/rules/plugin-name.js | 52 ++++++++++++++++++ .../tests/rules/plugin-name.js | 54 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 eslint/babel-eslint-plugin-development/src/rules/plugin-name.js create mode 100644 eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js diff --git a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js new file mode 100644 index 000000000000..58a4bc9f6337 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js @@ -0,0 +1,52 @@ +"use strict"; + +const isBabelPluginFactory = require("../utils/is-babel-plugin-factory"); + +function getReturnValue(node) { + const { body } = node; + + if (body.type === "BlockStatement") { + const returnNode = body.body.find(n => n.type === "ReturnStatement"); + return returnNode && returnNode.argument; + } + + // Arrow functions with implicit return + return body; +} + +module.exports = { + meta: { + schema: [], + }, + create(context /*: Context */) { + let pluginFound = false; + + return { + FunctionDeclaration: functionVisitor, + FunctionExpression: functionVisitor, + ArrowFunctionExpression: functionVisitor, + + "Program:exit"(node) { + if (!pluginFound) { + context.report(node, "This file does not export a Babel plugin."); + } + }, + }; + + function functionVisitor(node) { + if (!isBabelPluginFactory(node, context.getScope())) return; + + const returnValue = getReturnValue(node); + if (!returnValue || returnValue.type !== "ObjectExpression") return; + + pluginFound = true; + + if (!returnValue.properties.some(p => p.key.name === "name")) { + context.report( + returnValue, + "This Babel plugin doesn't have a 'name' property.", + ); + } + } + }, +}; diff --git a/eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js new file mode 100644 index 000000000000..670ced512279 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js @@ -0,0 +1,54 @@ +"use strict"; + +const rule = require("../../src/rules/plugin-name"); +const { RuleTester } = require("eslint"); + +const missingPluginError = "This file does not export a Babel plugin."; +const missingNameError = "This Babel plugin doesn't have a 'name' property."; + +const ruleTester = new RuleTester({ + parserOptions: { sourceType: "module" }, +}); + +ruleTester.run("plugin-name", rule, { + valid: [ + `export default function () { return { name: "test-plugin" } }`, + `import { declare } from "@babel/helper-plugin-utils"; declare(() => { return { name: "test-plugin" } })`, + `import { declare } from "@babel/helper-plugin-utils"; declare(() => ({ name: "test-plugin" }))`, + `module.exports = function () { return { name: "foo" }; }`, + ], + invalid: [ + { + code: `function fn() { return { name: "foo" } }`, + errors: [missingPluginError], + }, + { + code: `export function fn() { return { name: "foo" } }`, + errors: [missingPluginError], + }, + { + code: `(function fn() { return { name: "foo" } })`, + errors: [missingPluginError], + }, + { + code: `() => { return { name: "foo" } }`, + errors: [missingPluginError], + }, + { + code: `export default function fn() {}`, + errors: [missingPluginError], + }, + { + code: `export default function fn() { return {} }`, + errors: [missingNameError], + }, + { + code: `import { declare } from "@babel/helper-plugin-utils"; declare(() => ({}))`, + errors: [missingNameError], + }, + { + code: `module.exports = function () { return {} }`, + errors: [missingNameError], + }, + ], +}); From 69cc2c30c5a504cd2276e8225bacb958eba9a8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 21:11:47 +0100 Subject: [PATCH 775/965] Docs --- eslint/babel-eslint-plugin-development/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/README.md b/eslint/babel-eslint-plugin-development/README.md index c18f4801d90b..524706c592d2 100644 --- a/eslint/babel-eslint-plugin-development/README.md +++ b/eslint/babel-eslint-plugin-development/README.md @@ -26,4 +26,13 @@ Then, load the plugin in your `.eslintrc` configuration file. You can omit the ` ## Supported Rules -* Fill in provided rules here +> Note: Rules marked with :wrench: are autofixable. + +* `babel-plugin/no-deprecated-clone` (:wrench:): Disallows using the deprecated + `t.clone(node)` and `t.cloneDeep(node)` methods from `@babel/types`. Those + calls are replaced with `t.cloneNode(node)` when using `eslint --fix`. +* `babel-plugin/no-undefined-identifier`: Disallows using + `t.identifier("undefined")` to create a node which represents an `undefined` + value, since it might cause problem if `undefined` is redeclared. +* `babel-plugin/plugin-name`: Requires plugins to have a `name` property, which + can be useful for debugging purposes. From b615efba8787ce1f3e8f447917eb62cfe6e8545c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 20 Nov 2018 21:20:58 +0100 Subject: [PATCH 776/965] Export rules --- eslint/babel-eslint-plugin-development/src/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eslint/babel-eslint-plugin-development/src/index.js b/eslint/babel-eslint-plugin-development/src/index.js index 3c401bd1b695..3965315c844b 100644 --- a/eslint/babel-eslint-plugin-development/src/index.js +++ b/eslint/babel-eslint-plugin-development/src/index.js @@ -3,5 +3,7 @@ module.exports = { rules: { "no-deprecated-clone": require("./rules/no-deprecated-clone"), + "no-undefined-identifier": require("./rules/no-undefined-identifier"), + "plugin-name": require("./rules/plugin-name"), }, }; From ed1cee365f8c66e9b8b32fefe87c72f78ae695a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 17 Dec 2018 20:13:53 +0100 Subject: [PATCH 777/965] Update package.json#main --- eslint/babel-eslint-plugin-development/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 428b9bbe0adf..c023b59fb813 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -12,7 +12,7 @@ "email": "nicolo.ribaudo@gmail.com", "url": "https://github.com/nicolo-ribaudo" }, - "main": "index.js", + "main": "src/index.js", "scripts": { "test": "mocha tests --recursive", "lint": "eslint src tests" From e146ae748ec9f9a284367fe836fb69e6b568b99e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 17 Dec 2018 21:15:50 +0100 Subject: [PATCH 778/965] Create Test workflow --- .../.github/main.workflow | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 eslint/babel-eslint-plugin-development/.github/main.workflow diff --git a/eslint/babel-eslint-plugin-development/.github/main.workflow b/eslint/babel-eslint-plugin-development/.github/main.workflow new file mode 100644 index 000000000000..6bad3e10057e --- /dev/null +++ b/eslint/babel-eslint-plugin-development/.github/main.workflow @@ -0,0 +1,23 @@ +workflow "Build, Lint and Test" { + resolves = ["Test", "Lint"] + on = "push" +} + +action "Build" { + uses = "docker://node:10" + runs = "yarn" +} + +action "Test" { + needs = "Build" + uses = "docker://node:10" + runs = "yarn" + args = "test" +} + +action "Lint" { + needs = "Build" + uses = "docker://node:10" + runs = "yarn" + args = "lint" +} From ef29bf53ff64e64816ff0a7f8bf8e575b12c6b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 19:59:26 +0100 Subject: [PATCH 779/965] Rename to @babel/eslint-plugin-developement. Fixes babel/eslint-plugin-babel-plugin#1 --- eslint/babel-eslint-plugin-development/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index c023b59fb813..92ce30128715 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -1,5 +1,5 @@ { - "name": "eslint-plugin-babel-plugin", + "name": "@babel/eslint-plugin-developement", "version": "0.0.0", "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", "keywords": [ From 76ece4576ecf629a793f06272f5f59381e86dcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 21:04:36 +0100 Subject: [PATCH 780/965] Add publishConfig to package.json --- eslint/babel-eslint-plugin-development/package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 92ce30128715..654a883b5323 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -26,5 +26,8 @@ "engines": { "node": ">=8.0.0" }, + "publishConfig": { + "access": "public" + }, "license": "MIT" } From cc2d73834309c6bbae73e2d3b242b38b02e37520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 21:23:50 +0100 Subject: [PATCH 781/965] Update readme with the new package name --- eslint/babel-eslint-plugin-development/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eslint/babel-eslint-plugin-development/README.md b/eslint/babel-eslint-plugin-development/README.md index 524706c592d2..a5c3d82712e9 100644 --- a/eslint/babel-eslint-plugin-development/README.md +++ b/eslint/babel-eslint-plugin-development/README.md @@ -1,4 +1,4 @@ -# eslint-plugin-babel-plugin +# @babel/eslint-plugin-developement A set of eslint rules to enforce best practices in the development of Babel plugins. @@ -10,17 +10,17 @@ You'll first need to install [ESLint](http://eslint.org): $ npm install --save-dev eslint ``` -Next, install `eslint-plugin-babel-plugin`: +Next, install `@babel/eslint-plugin-developement`: ``` -$ npm install --save-dev eslint-plugin-babel-plugin +$ npm install --save-dev @babel/eslint-plugin-developement ``` Then, load the plugin in your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: ```json { - "plugins": ["babel-plugin"] + "plugins": ["@babel/developement"] } ``` @@ -28,11 +28,11 @@ Then, load the plugin in your `.eslintrc` configuration file. You can omit the ` > Note: Rules marked with :wrench: are autofixable. -* `babel-plugin/no-deprecated-clone` (:wrench:): Disallows using the deprecated +* `@babel/developement/no-deprecated-clone` (:wrench:): Disallows using the deprecated `t.clone(node)` and `t.cloneDeep(node)` methods from `@babel/types`. Those calls are replaced with `t.cloneNode(node)` when using `eslint --fix`. -* `babel-plugin/no-undefined-identifier`: Disallows using +* `@babel/developement/no-undefined-identifier`: Disallows using `t.identifier("undefined")` to create a node which represents an `undefined` value, since it might cause problem if `undefined` is redeclared. -* `babel-plugin/plugin-name`: Requires plugins to have a `name` property, which +* `@babel/developement/plugin-name`: Requires plugins to have a `name` property, which can be useful for debugging purposes. From 1bd82dd6c1fca1b0d16ef265ffa5a1626233dc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 21:24:54 +0100 Subject: [PATCH 782/965] 1.0.0 --- eslint/babel-eslint-plugin-development/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 654a883b5323..226dc5cd9234 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -1,6 +1,6 @@ { "name": "@babel/eslint-plugin-developement", - "version": "0.0.0", + "version": "1.0.0", "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", "keywords": [ "eslint", From cc78743ac82d3bff9912cefafded1c8b835cb754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 22:09:51 +0100 Subject: [PATCH 783/965] Add .npmignore --- eslint/babel-eslint-plugin-development/.npmignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 eslint/babel-eslint-plugin-development/.npmignore diff --git a/eslint/babel-eslint-plugin-development/.npmignore b/eslint/babel-eslint-plugin-development/.npmignore new file mode 100644 index 000000000000..5e0f958edde7 --- /dev/null +++ b/eslint/babel-eslint-plugin-development/.npmignore @@ -0,0 +1,3 @@ +tests/ +.github/ +.* \ No newline at end of file From 31c3de6bfadc863a2944d41e23349da41a8b9c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 22:33:27 +0100 Subject: [PATCH 784/965] Typo :facepalm: --- eslint/babel-eslint-plugin-development/README.md | 14 +++++++------- .../babel-eslint-plugin-development/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eslint/babel-eslint-plugin-development/README.md b/eslint/babel-eslint-plugin-development/README.md index a5c3d82712e9..12cc354b7470 100644 --- a/eslint/babel-eslint-plugin-development/README.md +++ b/eslint/babel-eslint-plugin-development/README.md @@ -1,4 +1,4 @@ -# @babel/eslint-plugin-developement +# @babel/eslint-plugin-development A set of eslint rules to enforce best practices in the development of Babel plugins. @@ -10,17 +10,17 @@ You'll first need to install [ESLint](http://eslint.org): $ npm install --save-dev eslint ``` -Next, install `@babel/eslint-plugin-developement`: +Next, install `@babel/eslint-plugin-development`: ``` -$ npm install --save-dev @babel/eslint-plugin-developement +$ npm install --save-dev @babel/eslint-plugin-development ``` Then, load the plugin in your `.eslintrc` configuration file. You can omit the `eslint-plugin-` prefix: ```json { - "plugins": ["@babel/developement"] + "plugins": ["@babel/development"] } ``` @@ -28,11 +28,11 @@ Then, load the plugin in your `.eslintrc` configuration file. You can omit the ` > Note: Rules marked with :wrench: are autofixable. -* `@babel/developement/no-deprecated-clone` (:wrench:): Disallows using the deprecated +* `@babel/development/no-deprecated-clone` (:wrench:): Disallows using the deprecated `t.clone(node)` and `t.cloneDeep(node)` methods from `@babel/types`. Those calls are replaced with `t.cloneNode(node)` when using `eslint --fix`. -* `@babel/developement/no-undefined-identifier`: Disallows using +* `@babel/development/no-undefined-identifier`: Disallows using `t.identifier("undefined")` to create a node which represents an `undefined` value, since it might cause problem if `undefined` is redeclared. -* `@babel/developement/plugin-name`: Requires plugins to have a `name` property, which +* `@babel/development/plugin-name`: Requires plugins to have a `name` property, which can be useful for debugging purposes. diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 226dc5cd9234..5021f8d7ba7b 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -1,5 +1,5 @@ { - "name": "@babel/eslint-plugin-developement", + "name": "@babel/eslint-plugin-development", "version": "1.0.0", "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", "keywords": [ From f5e482d3f65a7570c6b68d96e4c591af25c3d4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 22:35:25 +0100 Subject: [PATCH 785/965] Add repo url --- eslint/babel-eslint-plugin-development/package.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 5021f8d7ba7b..a459c582cfb3 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -29,5 +29,9 @@ "publishConfig": { "access": "public" }, - "license": "MIT" + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/babel/eslint-plugin-babel-plugin.git" + } } From f7c3d0717a8b17f296e173a6ccc4c78d44aea904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 18 Dec 2018 22:35:38 +0100 Subject: [PATCH 786/965] 1.0.1 --- eslint/babel-eslint-plugin-development/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index a459c582cfb3..9a8810acea83 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -1,6 +1,6 @@ { "name": "@babel/eslint-plugin-development", - "version": "1.0.0", + "version": "1.0.1", "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", "keywords": [ "eslint", From ec18c30ce79562999a37cabd07652543dfb0033c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2019 21:05:37 +0200 Subject: [PATCH 787/965] Bump js-yaml from 3.12.0 to 3.13.1 (babel/eslint-plugin-babel-plugin#2) Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1. - [Release notes](https://github.com/nodeca/js-yaml/releases) - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](https://github.com/nodeca/js-yaml/compare/3.12.0...3.13.1) Signed-off-by: dependabot[bot] --- eslint/babel-eslint-plugin-development/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eslint/babel-eslint-plugin-development/yarn.lock b/eslint/babel-eslint-plugin-development/yarn.lock index 7532a9eae183..1124540b3f7b 100644 --- a/eslint/babel-eslint-plugin-development/yarn.lock +++ b/eslint/babel-eslint-plugin-development/yarn.lock @@ -487,9 +487,9 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.12.0: - version "3.12.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" - integrity sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A== + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== dependencies: argparse "^1.0.7" esprima "^4.0.0" From 927b89bec845136420e1640b584c4f9c8edd92c8 Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Thu, 14 Nov 2019 21:46:40 +0100 Subject: [PATCH 788/965] removed yarn lock from eslint packages (#10711) --- eslint/babel-eslint-parser/yarn.lock | 3711 ----------------- .../babel-eslint-plugin-development/yarn.lock | 857 ---- eslint/babel-eslint-plugin/yarn.lock | 977 ----- 3 files changed, 5545 deletions(-) delete mode 100644 eslint/babel-eslint-parser/yarn.lock delete mode 100644 eslint/babel-eslint-plugin-development/yarn.lock delete mode 100644 eslint/babel-eslint-plugin/yarn.lock diff --git a/eslint/babel-eslint-parser/yarn.lock b/eslint/babel-eslint-parser/yarn.lock deleted file mode 100644 index aab080f5cb3f..000000000000 --- a/eslint/babel-eslint-parser/yarn.lock +++ /dev/null @@ -1,3711 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/core@^7.2.0": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.5.4.tgz#4c32df7ad5a58e9ea27ad025c11276324e0b4ddd" - integrity sha512-+DaeBEpYq6b2+ZmHx3tHspC+ZRflrvLqwfv8E3hNr5LVQoyBnL8RPKSBCg+rK2W2My9PWlujBiqd0ZPsR9Q6zQ== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" - "@babel/helpers" "^7.5.4" - "@babel/parser" "^7.5.0" - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" - convert-source-map "^1.1.0" - debug "^4.1.0" - json5 "^2.1.0" - lodash "^4.17.11" - resolve "^1.3.2" - semver "^5.4.1" - source-map "^0.5.0" - -"@babel/generator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.5.0.tgz#f20e4b7a91750ee8b63656073d843d2a736dca4a" - integrity sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA== - dependencies: - "@babel/types" "^7.5.0" - jsesc "^2.5.1" - lodash "^4.17.11" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/helper-annotate-as-pure@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" - integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" - integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== - dependencies: - "@babel/helper-explode-assignable-expression" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-builder-react-jsx@^7.3.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz#a1ac95a5d2b3e88ae5e54846bf462eeb81b318a4" - integrity sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw== - dependencies: - "@babel/types" "^7.3.0" - esutils "^2.0.0" - -"@babel/helper-call-delegate@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" - integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== - dependencies: - "@babel/helper-hoist-variables" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/helper-create-class-features-plugin@^7.4.4", "@babel/helper-create-class-features-plugin@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz#02edb97f512d44ba23b3227f1bf2ed43454edac5" - integrity sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" - "@babel/helper-split-export-declaration" "^7.4.4" - -"@babel/helper-define-map@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz#6969d1f570b46bdc900d1eba8e5d59c48ba2c12a" - integrity sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/types" "^7.4.4" - lodash "^4.17.11" - -"@babel/helper-explode-assignable-expression@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" - integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== - dependencies: - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-function-name@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" - integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== - dependencies: - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-get-function-arity@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" - integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-hoist-variables@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz#0298b5f25c8c09c53102d52ac4a98f773eb2850a" - integrity sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w== - dependencies: - "@babel/types" "^7.4.4" - -"@babel/helper-member-expression-to-functions@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" - integrity sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-imports@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d" - integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz#96115ea42a2f139e619e98ed46df6019b94414b8" - integrity sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/template" "^7.4.4" - "@babel/types" "^7.4.4" - lodash "^4.17.11" - -"@babel/helper-optimise-call-expression@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz#a2920c5702b073c15de51106200aa8cad20497d5" - integrity sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g== - dependencies: - "@babel/types" "^7.0.0" - -"@babel/helper-plugin-utils@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" - integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== - -"@babel/helper-regex@^7.0.0", "@babel/helper-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.4.4.tgz#a47e02bc91fb259d2e6727c2a30013e3ac13c4a2" - integrity sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q== - dependencies: - lodash "^4.17.11" - -"@babel/helper-remap-async-to-generator@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" - integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-wrap-function" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-replace-supers@^7.1.0", "@babel/helper-replace-supers@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz#aee41783ebe4f2d3ab3ae775e1cc6f1a90cefa27" - integrity sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.0.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/helper-simple-access@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz#65eeb954c8c245beaa4e859da6188f39d71e585c" - integrity sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w== - dependencies: - "@babel/template" "^7.1.0" - "@babel/types" "^7.0.0" - -"@babel/helper-split-export-declaration@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" - integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== - dependencies: - "@babel/types" "^7.4.4" - -"@babel/helper-wrap-function@^7.1.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" - integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/template" "^7.1.0" - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.2.0" - -"@babel/helpers@^7.5.4": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.5.4.tgz#2f00608aa10d460bde0ccf665d6dcf8477357cf0" - integrity sha512-6LJ6xwUEJP51w0sIgKyfvFMJvIb9mWAfohJp0+m6eHJigkFdcH8duZ1sfhn0ltJRzwUIT/yqqhdSfRpCpL7oow== - dependencies: - "@babel/template" "^7.4.4" - "@babel/traverse" "^7.5.0" - "@babel/types" "^7.5.0" - -"@babel/highlight@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" - integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -"@babel/parser@^7.0.0", "@babel/parser@^7.4.4", "@babel/parser@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.5.0.tgz#3e0713dff89ad6ae37faec3b29dcfc5c979770b7" - integrity sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA== - -"@babel/plugin-proposal-async-generator-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" - integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - -"@babel/plugin-proposal-class-properties@^7.1.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.5.0.tgz#5bc6a0537d286fcb4fd4e89975adbca334987007" - integrity sha512-9L/JfPCT+kShiiTTzcnBJ8cOwdKVmlC1RcCf9F0F9tERVrM4iWtWnXtjWCRqNm2la2BxO1MPArWNsU9zsSJWSQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.5.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-proposal-decorators@^7.1.2": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.4.4.tgz#de9b2a1a8ab0196f378e2a82f10b6e2a36f21cc0" - integrity sha512-z7MpQz3XC/iQJWXH9y+MaWcLPNSMY9RQSthrLzak8R8hCj0fuyNk+Dzi9kfNe/JxxlWQ2g7wkABbgWjW36MTcw== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-decorators" "^7.2.0" - -"@babel/plugin-proposal-dynamic-import@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz#e532202db4838723691b10a67b8ce509e397c506" - integrity sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" - -"@babel/plugin-proposal-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" - -"@babel/plugin-proposal-nullish-coalescing-operator@^7.0.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz#41c360d59481d88e0ce3a3f837df10121a769b39" - integrity sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0" - -"@babel/plugin-proposal-object-rest-spread@^7.5.4": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.5.4.tgz#250de35d867ce8260a31b1fdac6c4fc1baa99331" - integrity sha512-KCx0z3y7y8ipZUMAEEJOyNi11lMb/FOPUjjB113tfowgw0c16EGYos7worCKBcUAh2oG+OBnoUhsnTSoLpV9uA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" - -"@babel/plugin-proposal-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" - -"@babel/plugin-proposal-optional-chaining@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz#ae454f4c21c6c2ce8cb2397dc332ae8b420c5441" - integrity sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-chaining" "^7.2.0" - -"@babel/plugin-proposal-pipeline-operator@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.5.0.tgz#4100ec55ef4f6a4c2490b5f5a4f2a22dfa272c06" - integrity sha512-HFYuu/yGnkn69ligXxU0ohOVvQDsMNOUJs/c4PYLUVS6ntCYOyGmRQQaSYJARJ9rvc7/ulZKIzxd4wk91hN63A== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-pipeline-operator" "^7.5.0" - -"@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz#501ffd9826c0b91da22690720722ac7cb1ca9c78" - integrity sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/plugin-syntax-async-generators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-decorators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz#c50b1b957dcc69e4b1127b65e1c33eef61570c1b" - integrity sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-dynamic-import@^7.0.0", "@babel/plugin-syntax-dynamic-import@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-export-default-from@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.2.0.tgz#edd83b7adc2e0d059e2467ca96c650ab6d2f3820" - integrity sha512-c7nqUnNST97BWPtoe+Ssi+fJukc9P9/JMZ71IOMNQWza2E+Psrd46N6AEvtw6pqK+gt7ChjXyrw4SPDO79f3Lw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-export-namespace-from@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" - integrity sha512-1zGA3UNch6A+A11nIzBVEaE3DDJbjfB+eLIcf0GGOh/BJr/8NxL3546MGhV/r0RhH4xADFIEso39TKCfEMlsGA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-flow@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" - integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-import-meta@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.2.0.tgz#2333ef4b875553a3bcd1e93f8ebc09f5b9213a40" - integrity sha512-Hq6kFSZD7+PHkmBN8bCpHR6J8QEoCuEV/B38AIQscYjgMZkGlXB7cHNFzP5jR4RCh5545yP1ujHdmO7hAgKtBA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-jsx@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz#0b85a3b4bc7cdf4cc4b8bf236335b907ca22e7c7" - integrity sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz#f75083dfd5ade73e783db729bbd87e7b9efb7624" - integrity sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-numeric-separator@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.2.0.tgz#7470fe070c2944469a756752a69a6963135018be" - integrity sha512-DroeVNkO/BnGpL2R7+ZNZqW+E24aR/4YWxP3Qb15d6lPU8KDzF8HlIUIRCOJRn4X77/oyW4mJY+7FHfY82NLtQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-optional-chaining@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" - integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-syntax-pipeline-operator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.5.0.tgz#8ea7c2c22847c797748bf07752722a317079dc1e" - integrity sha512-5FVxPiMTMXWk4R7Kq9pt272nDu8VImJdaIzvXFSTcXFbgKWWaOdbic12TvUvl6cK+AE5EgnhwvxuWik4ZYYdzg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-arrow-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-async-to-generator@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz#89a3848a0166623b5bc481164b5936ab947e887e" - integrity sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.1.0" - -"@babel/plugin-transform-block-scoped-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-block-scoping@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz#c13279fabf6b916661531841a23c4b7dae29646d" - integrity sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - lodash "^4.17.11" - -"@babel/plugin-transform-classes@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.4.4.tgz#0ce4094cdafd709721076d3b9c38ad31ca715eb6" - integrity sha512-/e44eFLImEGIpL9qPxSRat13I5QNRgBLu2hOQJCF7VLy/otSM/sypV1+XaIw5+502RX/+6YaSAPmldk+nhHDPw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-define-map" "^7.4.4" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-optimise-call-expression" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.4.4" - "@babel/helper-split-export-declaration" "^7.4.4" - globals "^11.1.0" - -"@babel/plugin-transform-computed-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-destructuring@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.5.0.tgz#f6c09fdfe3f94516ff074fe877db7bc9ef05855a" - integrity sha512-YbYgbd3TryYYLGyC7ZR+Tq8H/+bCmwoaxHfJHupom5ECstzbRLTch6gOQbhEY9Z4hiCNHEURgq06ykFv9JZ/QQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz#361a148bc951444312c69446d76ed1ea8e4450c3" - integrity sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/plugin-transform-duplicate-keys@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" - integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-exponentiation-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== - dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.4.tgz#d267a081f49a8705fc9146de0768c6b58dccd8f7" - integrity sha512-WyVedfeEIILYEaWGAUWzVNyqG4sfsNooMhXWsu/YzOvVGcsnPb5PguysjJqI3t3qiaYj0BR8T2f5njdjTGe44Q== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.2.0" - -"@babel/plugin-transform-for-of@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" - integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-function-name@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz#e1436116abb0610c2259094848754ac5230922ad" - integrity sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA== - dependencies: - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-member-expression-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" - integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-modules-amd@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" - integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== - dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - babel-plugin-dynamic-import-node "^2.3.0" - -"@babel/plugin-transform-modules-commonjs@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz#425127e6045231360858eeaa47a71d75eded7a74" - integrity sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ== - dependencies: - "@babel/helper-module-transforms" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.1.0" - babel-plugin-dynamic-import-node "^2.3.0" - -"@babel/plugin-transform-modules-systemjs@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz#e75266a13ef94202db2a0620977756f51d52d249" - integrity sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg== - dependencies: - "@babel/helper-hoist-variables" "^7.4.4" - "@babel/helper-plugin-utils" "^7.0.0" - babel-plugin-dynamic-import-node "^2.3.0" - -"@babel/plugin-transform-modules-umd@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz#7678ce75169f0877b8eb2235538c074268dd01ae" - integrity sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw== - dependencies: - "@babel/helper-module-transforms" "^7.1.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-named-capturing-groups-regex@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz#9d269fd28a370258199b4294736813a60bbdd106" - integrity sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg== - dependencies: - regexp-tree "^0.1.6" - -"@babel/plugin-transform-new-target@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" - integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-object-super@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" - integrity sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.1.0" - -"@babel/plugin-transform-parameters@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" - integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== - dependencies: - "@babel/helper-call-delegate" "^7.4.4" - "@babel/helper-get-function-arity" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-property-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" - integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-react-display-name@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz#ebfaed87834ce8dc4279609a4f0c324c156e3eb0" - integrity sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-react-jsx-self@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz#461e21ad9478f1031dd5e276108d027f1b5240ba" - integrity sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-react-jsx-source@^7.0.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.5.0.tgz#583b10c49cf057e237085bcbd8cc960bd83bd96b" - integrity sha512-58Q+Jsy4IDCZx7kqEZuSDdam/1oW8OdDX8f+Loo6xyxdfg1yF0GE2XNJQSTZCaMol93+FBzpWiPEwtbMloAcPg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-react-jsx@^7.0.0": - version "7.3.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz#f2cab99026631c767e2745a5368b331cfe8f5290" - integrity sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg== - dependencies: - "@babel/helper-builder-react-jsx" "^7.3.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-jsx" "^7.2.0" - -"@babel/plugin-transform-regenerator@^7.4.5": - version "7.4.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz#629dc82512c55cee01341fb27bdfcb210354680f" - integrity sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA== - dependencies: - regenerator-transform "^0.14.0" - -"@babel/plugin-transform-reserved-words@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" - integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-shorthand-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-spread@^7.2.0": - version "7.2.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz#3103a9abe22f742b6d406ecd3cd49b774919b406" - integrity sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-sticky-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.0.0" - -"@babel/plugin-transform-template-literals@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" - integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== - dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-typeof-symbol@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - -"@babel/plugin-transform-unicode-regex@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f" - integrity sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-regex" "^7.4.4" - regexpu-core "^4.5.4" - -"@babel/preset-env@^7.1.5": - version "7.5.4" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.5.4.tgz#64bc15041a3cbb0798930319917e70fcca57713d" - integrity sha512-hFnFnouyRNiH1rL8YkX1ANCNAUVC8Djwdqfev8i1415tnAG+7hlA5zhZ0Q/3Q5gkop4HioIPbCEWAalqcbxRoQ== - dependencies: - "@babel/helper-module-imports" "^7.0.0" - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.2.0" - "@babel/plugin-proposal-dynamic-import" "^7.5.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.5.4" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" - "@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-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.5.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.4.4" - "@babel/plugin-transform-classes" "^7.4.4" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.5.0" - "@babel/plugin-transform-dotall-regex" "^7.4.4" - "@babel/plugin-transform-duplicate-keys" "^7.5.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.4" - "@babel/plugin-transform-function-name" "^7.4.4" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.5.0" - "@babel/plugin-transform-modules-commonjs" "^7.5.0" - "@babel/plugin-transform-modules-systemjs" "^7.5.0" - "@babel/plugin-transform-modules-umd" "^7.2.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.4.5" - "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.2.0" - "@babel/plugin-transform-parameters" "^7.4.4" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.4.5" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.2.0" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.4.4" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.4.4" - "@babel/types" "^7.5.0" - browserslist "^4.6.0" - core-js-compat "^3.1.1" - invariant "^2.2.2" - js-levenshtein "^1.1.3" - semver "^5.5.0" - -"@babel/preset-flow@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0.tgz#afd764835d9535ec63d8c7d4caf1c06457263da2" - integrity sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-flow-strip-types" "^7.0.0" - -"@babel/preset-react@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.0.0.tgz#e86b4b3d99433c7b3e9e91747e2653958bc6b3c0" - integrity sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-react-display-name" "^7.0.0" - "@babel/plugin-transform-react-jsx" "^7.0.0" - "@babel/plugin-transform-react-jsx-self" "^7.0.0" - "@babel/plugin-transform-react-jsx-source" "^7.0.0" - -"@babel/template@^7.1.0", "@babel/template@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" - integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.4.4" - "@babel/types" "^7.4.4" - -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.4", "@babel/traverse@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.5.0.tgz#4216d6586854ef5c3c4592dab56ec7eb78485485" - integrity sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.5.0" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.4.4" - "@babel/parser" "^7.5.0" - "@babel/types" "^7.5.0" - debug "^4.1.0" - globals "^11.1.0" - lodash "^4.17.11" - -"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.4", "@babel/types@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.5.0.tgz#e47d43840c2e7f9105bc4d3a2c371b4d0c7832ab" - integrity sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ== - dependencies: - esutils "^2.0.2" - lodash "^4.17.11" - to-fast-properties "^2.0.0" - -"@samverschueren/stream-to-observable@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" - integrity sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg== - dependencies: - any-observable "^0.3.0" - -acorn-jsx@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" - integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== - -acorn@^6.0.7: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" - integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== - -ajv@^6.10.0, ajv@^6.9.1: - version "6.10.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" - integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-colors@3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" - integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== - -ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-regex@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" - integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -any-observable@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" - integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -arr-diff@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" - integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= - -arr-flatten@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" - integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== - -arr-union@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" - integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= - -array-includes@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" - integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - -array-unique@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" - integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= - -assign-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" - integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= - -astral-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" - integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== - -atob@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" - integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== - -babel-eslint@^10.0.2: - version "10.0.2" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.2.tgz#182d5ac204579ff0881684b040560fdcc1558456" - integrity sha512-UdsurWPtgiPgpJ06ryUnuaSXC2s0WoSZnQmEpbAH65XZSdwowgN5MvyP7e88nW07FYXv72erVtpBkxyDVKhH1Q== - dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" - -babel-plugin-dynamic-import-node@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" - integrity sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ== - dependencies: - object.assign "^4.1.0" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -base@^0.11.1: - version "0.11.2" - resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" - integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== - dependencies: - cache-base "^1.0.1" - class-utils "^0.3.5" - component-emitter "^1.2.1" - define-property "^1.0.0" - isobject "^3.0.1" - mixin-deep "^1.2.0" - pascalcase "^0.1.1" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -braces@^2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" - integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== - dependencies: - arr-flatten "^1.1.0" - array-unique "^0.3.2" - extend-shallow "^2.0.1" - fill-range "^4.0.0" - isobject "^3.0.1" - repeat-element "^1.1.2" - snapdragon "^0.8.1" - snapdragon-node "^2.0.1" - split-string "^3.0.2" - to-regex "^3.0.1" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -browserslist@^4.6.0, browserslist@^4.6.2: - version "4.6.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.6.6.tgz#6e4bf467cde520bc9dbdf3747dafa03531cec453" - integrity sha512-D2Nk3W9JL9Fp/gIcWei8LrERCS+eXu9AM5cfXA8WEZ84lFks+ARnZ0q/R69m2SV3Wjma83QDDPxsNKXUwdIsyA== - dependencies: - caniuse-lite "^1.0.30000984" - electron-to-chromium "^1.3.191" - node-releases "^1.1.25" - -cache-base@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" - integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== - dependencies: - collection-visit "^1.0.0" - component-emitter "^1.2.1" - get-value "^2.0.6" - has-value "^1.0.0" - isobject "^3.0.1" - set-value "^2.0.0" - to-object-path "^0.3.0" - union-value "^1.0.0" - unset-value "^1.0.0" - -caller-callsite@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" - integrity sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ= - dependencies: - callsites "^2.0.0" - -caller-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" - integrity sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ= - dependencies: - caller-callsite "^2.0.0" - -callsites@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" - integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.0.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -caniuse-lite@^1.0.30000984: - version "1.0.30000984" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000984.tgz#dc96c3c469e9bcfc6ad5bdd24c77ec918ea76fe0" - integrity sha512-n5tKOjMaZ1fksIpQbjERuqCyfgec/m9pferkFQbLmWtqLUdmt12hNhjSwsmPdqeiG2NkITOQhr1VYIwWSAceiA== - -chalk@^1.0.0, chalk@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== - -class-utils@^0.3.5: - version "0.3.6" - resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" - integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== - dependencies: - arr-union "^3.1.0" - define-property "^0.2.5" - isobject "^3.0.0" - static-extend "^0.1.1" - -cli-cursor@^2.0.0, cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-truncate@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" - integrity sha1-nxXPuwcFAFNpIWxiasfQWrkN1XQ= - dependencies: - slice-ansi "0.0.4" - string-width "^1.0.1" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= - -collection-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" - integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= - dependencies: - map-visit "^1.0.0" - object-visit "^1.0.0" - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -commander@^2.14.1, commander@^2.9.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== - -component-emitter@^1.2.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" - integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -contains-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" - integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= - -convert-source-map@^1.1.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" - integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== - dependencies: - safe-buffer "~5.1.1" - -copy-descriptor@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" - integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= - -core-js-compat@^3.1.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.1.4.tgz#e4d0c40fbd01e65b1d457980fe4112d4358a7408" - integrity sha512-Z5zbO9f1d0YrJdoaQhphVAnKPimX92D6z8lCGphH89MNRxlL1prI9ExJPqVwP0/kgkQCv8c4GJGT8X16yUncOg== - dependencies: - browserslist "^4.6.2" - core-js-pure "3.1.4" - semver "^6.1.1" - -core-js-pure@3.1.4: - version "3.1.4" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.1.4.tgz#5fa17dc77002a169a3566cc48dc774d2e13e3769" - integrity sha512-uJ4Z7iPNwiu1foygbcZYJsJs1jiXrTTCvxfLDXNhI/I+NHbSIEyr548y4fcsCEyWY0XgfAG/qqaunJ1SThHenA== - -cosmiconfig@^5.0.2, cosmiconfig@^5.0.7: - version "5.2.1" - resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a" - integrity sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA== - dependencies: - import-fresh "^2.0.0" - is-directory "^0.3.1" - js-yaml "^3.13.1" - parse-json "^4.0.0" - -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^6.0.0, cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -date-fns@^1.27.2: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== - -debug@3.2.6, debug@^3.1.0: - version "3.2.6" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" - integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== - dependencies: - ms "^2.1.1" - -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.0.1, debug@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" - integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== - dependencies: - ms "^2.1.1" - -decamelize@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= - -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -define-properties@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" - integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== - dependencies: - object-keys "^1.0.12" - -define-property@^0.2.5: - version "0.2.5" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" - integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= - dependencies: - is-descriptor "^0.1.0" - -define-property@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" - integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= - dependencies: - is-descriptor "^1.0.0" - -define-property@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" - integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== - dependencies: - is-descriptor "^1.0.2" - isobject "^3.0.1" - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -doctrine@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" - integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= - dependencies: - esutils "^2.0.2" - isarray "^1.0.0" - -doctrine@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" - integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== - dependencies: - esutils "^2.0.2" - -electron-to-chromium@^1.3.191: - version "1.3.191" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.191.tgz#c451b422cd8b2eab84dedabab5abcae1eaefb6f0" - integrity sha512-jasjtY5RUy/TOyiUYM2fb4BDaPZfm6CXRFeJDMfFsXYADGxUN49RBqtgB7EL2RmJXeIRUk9lM1U6A5yk2YJMPQ== - -elegant-spinner@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" - integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= - -emoji-regex@^7.0.1: - version "7.0.3" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" - integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== - -end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - -error-ex@^1.2.0, error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -es-abstract@^1.5.1, es-abstract@^1.7.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" - integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== - dependencies: - es-to-primitive "^1.2.0" - function-bind "^1.1.1" - has "^1.0.3" - is-callable "^1.1.4" - is-regex "^1.0.4" - object-keys "^1.0.12" - -es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eslint-config-babel@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-9.0.0.tgz#bcfb9e9a1892aff29b8773cb9d2c76639de83c07" - integrity sha512-J7l2KdDKi2y9QifMqXdSIkghrVXr6fcpxegj+803C+4xBfpp0h2LcY9X5N+ivJMBoX6G2PJ/TBTM1Kro0MELBA== - -eslint-import-resolver-node@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" - integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q== - dependencies: - debug "^2.6.9" - resolve "^1.5.0" - -eslint-module-utils@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" - integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== - dependencies: - debug "^2.6.8" - pkg-dir "^2.0.0" - -eslint-plugin-flowtype@^3.11.1: - version "3.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.11.1.tgz#1aae15a10dbcd5aecc89897f810f2e9fcc18a5e3" - integrity sha512-4NiaaGZuz9iEGRTK8j4lkA/scibOXSYaYoHbsTtgLOxxqQCkbWV3xt8ETqILKg7DAYDqB69z1H5U71UmtdF9hw== - dependencies: - lodash "^4.17.11" - -eslint-plugin-import@^2.14.0: - version "2.18.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" - integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== - dependencies: - array-includes "^3.0.3" - contains-path "^0.1.0" - debug "^2.6.9" - doctrine "1.5.0" - eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.0" - has "^1.0.3" - lodash "^4.17.11" - minimatch "^3.0.4" - read-pkg-up "^2.0.0" - resolve "^1.11.0" - -eslint-plugin-prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" - integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.3.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" - integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== - dependencies: - eslint-visitor-keys "^1.0.0" - -eslint-visitor-keys@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" - integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== - -eslint@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" - integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.10.0" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^6.0.0" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^5.0.1" - functional-red-black-tree "^1.0.1" - glob-parent "^3.1.0" - globals "^11.7.0" - ignore "^4.0.6" - import-fresh "^3.0.0" - imurmurhash "^0.1.4" - inquirer "^6.2.2" - is-glob "^4.0.0" - js-yaml "^3.13.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.11" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - progress "^2.0.0" - regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.2.3" - text-table "^0.2.0" - -espree@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" - integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== - dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= - -esutils@^2.0.0, esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - -execa@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01" - integrity sha512-BbUMBiX4hqiHZUA5+JujIjNb6TyAlp2D5KLheMjMluwOuzcnylDL4AxZYLLn1n2AGB49eSWwyKvvEQoRpnAtmA== - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -execa@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" - integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== - dependencies: - cross-spawn "^6.0.0" - get-stream "^4.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -expand-brackets@^2.1.4: - version "2.1.4" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" - integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= - dependencies: - debug "^2.3.3" - define-property "^0.2.5" - extend-shallow "^2.0.1" - posix-character-classes "^0.1.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -extend-shallow@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" - integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= - dependencies: - is-extendable "^0.1.0" - -extend-shallow@^3.0.0, extend-shallow@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" - integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= - dependencies: - assign-symbols "^1.0.0" - is-extendable "^1.0.1" - -external-editor@^3.0.3: - version "3.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" - integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -extglob@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" - integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== - dependencies: - array-unique "^0.3.2" - define-property "^1.0.0" - expand-brackets "^2.1.4" - extend-shallow "^2.0.1" - fragment-cache "^0.2.1" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -figures@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" - integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== - dependencies: - flat-cache "^2.0.1" - -fill-range@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" - integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= - dependencies: - extend-shallow "^2.0.1" - is-number "^3.0.0" - repeat-string "^1.6.1" - to-regex-range "^2.1.0" - -find-parent-dir@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" - integrity sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ= - -find-up@3.0.0, find-up@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" - integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== - dependencies: - locate-path "^3.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - integrity sha1-RdG35QbHF93UgndaK3eSCjwMV6c= - dependencies: - locate-path "^2.0.0" - -flat-cache@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" - integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== - dependencies: - flatted "^2.0.0" - rimraf "2.6.3" - write "1.0.3" - -flat@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/flat/-/flat-4.1.0.tgz#090bec8b05e39cba309747f1d588f04dbaf98db2" - integrity sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw== - dependencies: - is-buffer "~2.0.3" - -flatted@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" - integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== - -for-in@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= - -fragment-cache@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" - integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= - dependencies: - map-cache "^0.2.2" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -get-caller-file@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" - integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== - -get-caller-file@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-own-enumerable-property-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" - integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== - -get-stdin@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" - integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== - -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - -get-stream@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" - integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== - dependencies: - pump "^3.0.0" - -get-value@^2.0.3, get-value@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" - integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= - -glob-parent@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae" - integrity sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4= - dependencies: - is-glob "^3.1.0" - path-dirname "^1.0.0" - -glob@7.1.3: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0, globals@^11.7.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -graceful-fs@^4.1.2: - version "4.2.0" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" - integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= - -has-value@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" - integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= - dependencies: - get-value "^2.0.3" - has-values "^0.1.4" - isobject "^2.0.0" - -has-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" - integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= - dependencies: - get-value "^2.0.6" - has-values "^1.0.0" - isobject "^3.0.0" - -has-values@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" - integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= - -has-values@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" - integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -has@^1.0.1, has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -he@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - -hosted-git-info@^2.1.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" - integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== - -husky@^1.0.0-rc.13: - version "1.3.1" - resolved "https://registry.yarnpkg.com/husky/-/husky-1.3.1.tgz#26823e399300388ca2afff11cfa8a86b0033fae0" - integrity sha512-86U6sVVVf4b5NYSZ0yvv88dRgBSSXXmHaiq5pP4KDj5JVzdwKgBjEtUPOm8hcoytezFwbU+7gotXNhpHdystlg== - dependencies: - cosmiconfig "^5.0.7" - execa "^1.0.0" - find-up "^3.0.0" - get-stdin "^6.0.0" - is-ci "^2.0.0" - pkg-dir "^3.0.0" - please-upgrade-node "^3.1.1" - read-pkg "^4.0.1" - run-node "^1.0.0" - slash "^2.0.0" - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -import-fresh@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" - integrity sha1-2BNVwVYS04bGH53dOSLUMEgipUY= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - -import-fresh@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" - integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -indent-string@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" - integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -inquirer@^6.2.2: - version "6.5.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.0.tgz#2303317efc9a4ea7ec2e2df6f86569b734accf42" - integrity sha512-scfHejeG/lVZSpvCXpsB4j/wQNPM5JC8kiElOI0OUTwmc1RTpXr4H32/HOlQHcZiYl2z2VElwuCVDRG8vFmbnA== - dependencies: - ansi-escapes "^3.2.0" - chalk "^2.4.2" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.4.0" - string-width "^2.1.0" - strip-ansi "^5.1.0" - through "^2.3.6" - -invariant@^2.2.2: - version "2.2.4" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" - integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== - dependencies: - loose-envify "^1.0.0" - -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - -is-accessor-descriptor@^0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" - integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= - dependencies: - kind-of "^3.0.2" - -is-accessor-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" - integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== - dependencies: - kind-of "^6.0.0" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-buffer@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - -is-buffer@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725" - integrity sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw== - -is-callable@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" - integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== - -is-ci@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== - dependencies: - ci-info "^2.0.0" - -is-data-descriptor@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" - integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= - dependencies: - kind-of "^3.0.2" - -is-data-descriptor@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" - integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== - dependencies: - kind-of "^6.0.0" - -is-date-object@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" - integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= - -is-descriptor@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" - integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== - dependencies: - is-accessor-descriptor "^0.1.6" - is-data-descriptor "^0.1.4" - kind-of "^5.0.0" - -is-descriptor@^1.0.0, is-descriptor@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" - integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== - dependencies: - is-accessor-descriptor "^1.0.0" - is-data-descriptor "^1.0.0" - kind-of "^6.0.2" - -is-directory@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/is-directory/-/is-directory-0.3.1.tgz#61339b6f2475fc772fd9c9d83f5c8575dc154ae1" - integrity sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE= - -is-extendable@^0.1.0, is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= - -is-extendable@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" - integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== - dependencies: - is-plain-object "^2.0.4" - -is-extglob@^2.1.0, is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-glob@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" - integrity sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo= - dependencies: - is-extglob "^2.1.0" - -is-glob@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" - integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== - dependencies: - is-extglob "^2.1.1" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= - dependencies: - kind-of "^3.0.2" - -is-obj@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" - integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= - -is-observable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" - integrity sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA== - dependencies: - symbol-observable "^1.1.0" - -is-plain-object@^2.0.3, is-plain-object@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" - integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== - dependencies: - isobject "^3.0.1" - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - -is-regex@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" - integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= - dependencies: - has "^1.0.1" - -is-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" - integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= - -is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== - dependencies: - has-symbols "^1.0.0" - -is-windows@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" - integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== - -isarray@1.0.0, isarray@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= - dependencies: - isarray "1.0.0" - -isobject@^3.0.0, isobject@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" - integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= - -jest-get-type@^22.1.0: - version "22.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.4.3.tgz#e3a8504d8479342dd4420236b322869f18900ce4" - integrity sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w== - -jest-validate@^23.5.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-23.6.0.tgz#36761f99d1ed33fcd425b4e4c5595d62b6597474" - integrity sha512-OFKapYxe72yz7agrDAWi8v2WL8GIfVqcbKRCLbRG9PAxtzF9b1SEDdTpytNDN12z2fJynoBwpMpvj2R39plI2A== - dependencies: - chalk "^2.0.1" - jest-get-type "^22.1.0" - leven "^2.1.0" - pretty-format "^23.6.0" - -js-levenshtein@^1.1.3: - version "1.1.6" - resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d" - integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g== - -"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@3.13.1, js-yaml@^3.13.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -jsesc@~0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" - integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= - -json-parse-better-errors@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" - integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -json5@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" - integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== - dependencies: - minimist "^1.2.0" - -kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= - dependencies: - is-buffer "^1.1.5" - -kind-of@^5.0.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" - integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== - -kind-of@^6.0.0, kind-of@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" - integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== - -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - -leven@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" - integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lint-staged@^7.2.2: - version "7.3.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-7.3.0.tgz#90ff33e5ca61ed3dbac35b6f6502dbefdc0db58d" - integrity sha512-AXk40M9DAiPi7f4tdJggwuKIViUplYtVj1os1MVEteW7qOkU50EOehayCfO9TsoGK24o/EsWb41yrEgfJDDjCw== - dependencies: - chalk "^2.3.1" - commander "^2.14.1" - cosmiconfig "^5.0.2" - debug "^3.1.0" - dedent "^0.7.0" - execa "^0.9.0" - find-parent-dir "^0.3.0" - is-glob "^4.0.0" - is-windows "^1.0.2" - jest-validate "^23.5.0" - listr "^0.14.1" - lodash "^4.17.5" - log-symbols "^2.2.0" - micromatch "^3.1.8" - npm-which "^3.0.1" - p-map "^1.1.1" - path-is-inside "^1.0.2" - pify "^3.0.0" - please-upgrade-node "^3.0.2" - staged-git-files "1.1.1" - string-argv "^0.0.2" - stringify-object "^3.2.2" - -listr-silent-renderer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e" - integrity sha1-kktaN1cVN3C/Go4/v3S4u/P5JC4= - -listr-update-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-update-renderer/-/listr-update-renderer-0.5.0.tgz#4ea8368548a7b8aecb7e06d8c95cb45ae2ede6a2" - integrity sha512-tKRsZpKz8GSGqoI/+caPmfrypiaq+OQCbd+CovEC24uk1h952lVj5sC7SqyFUm+OaJ5HN/a1YLt5cit2FMNsFA== - dependencies: - chalk "^1.1.3" - cli-truncate "^0.2.1" - elegant-spinner "^1.0.1" - figures "^1.7.0" - indent-string "^3.0.0" - log-symbols "^1.0.2" - log-update "^2.3.0" - strip-ansi "^3.0.1" - -listr-verbose-renderer@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/listr-verbose-renderer/-/listr-verbose-renderer-0.5.0.tgz#f1132167535ea4c1261102b9f28dac7cba1e03db" - integrity sha512-04PDPqSlsqIOaaaGZ+41vq5FejI9auqTInicFRndCBgE3bXG8D6W1I+mWhk+1nqbHmyhla/6BUrd5OSiHwKRXw== - dependencies: - chalk "^2.4.1" - cli-cursor "^2.1.0" - date-fns "^1.27.2" - figures "^2.0.0" - -listr@^0.14.1: - version "0.14.3" - resolved "https://registry.yarnpkg.com/listr/-/listr-0.14.3.tgz#2fea909604e434be464c50bddba0d496928fa586" - integrity sha512-RmAl7su35BFd/xoMamRjpIE4j3v+L28o8CT5YhAXQJm1fD+1l9ngXY8JAQRJ+tFK2i5njvi0iRUKV09vPwA0iA== - dependencies: - "@samverschueren/stream-to-observable" "^0.3.0" - is-observable "^1.1.0" - is-promise "^2.1.0" - is-stream "^1.1.0" - listr-silent-renderer "^1.1.1" - listr-update-renderer "^0.5.0" - listr-verbose-renderer "^0.5.0" - p-map "^2.0.0" - rxjs "^6.3.3" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg= - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - integrity sha1-K1aLJl7slExtnA3pw9u7ygNUzY4= - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -locate-path@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" - integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== - dependencies: - p-locate "^3.0.0" - path-exists "^3.0.0" - -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.5: - version "4.17.14" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" - integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== - -log-symbols@2.2.0, log-symbols@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" - integrity sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg== - dependencies: - chalk "^2.0.1" - -log-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-1.0.2.tgz#376ff7b58ea3086a0f09facc74617eca501e1a18" - integrity sha1-N2/3tY6jCGoPCfrMdGF+ylAeGhg= - dependencies: - chalk "^1.0.0" - -log-update@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/log-update/-/log-update-2.3.0.tgz#88328fd7d1ce7938b29283746f0b1bc126b24708" - integrity sha1-iDKP19HOeTiykoN0bwsbwSayRwg= - dependencies: - ansi-escapes "^3.0.0" - cli-cursor "^2.0.0" - wrap-ansi "^3.0.1" - -loose-envify@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" - integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== - dependencies: - js-tokens "^3.0.0 || ^4.0.0" - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - -map-cache@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" - integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= - -map-visit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" - integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= - dependencies: - object-visit "^1.0.0" - -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - -micromatch@^3.1.8: - version "3.1.10" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" - integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - braces "^2.3.1" - define-property "^2.0.2" - extend-shallow "^3.0.2" - extglob "^2.0.4" - fragment-cache "^0.2.1" - kind-of "^6.0.2" - nanomatch "^1.2.9" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.2" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -mimic-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= - -mixin-deep@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" - integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== - dependencies: - for-in "^1.0.2" - is-extendable "^1.0.1" - -mkdirp@0.5.1, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mocha@^6.1.4: - version "6.1.4" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-6.1.4.tgz#e35fada242d5434a7e163d555c705f6875951640" - integrity sha512-PN8CIy4RXsIoxoFJzS4QNnCH4psUCPWc4/rPrst/ecSJJbLBkubMiyGCP2Kj/9YnWbotFqAoeXyXMucj7gwCFg== - dependencies: - ansi-colors "3.2.3" - browser-stdout "1.3.1" - debug "3.2.6" - diff "3.5.0" - escape-string-regexp "1.0.5" - find-up "3.0.0" - glob "7.1.3" - growl "1.10.5" - he "1.2.0" - js-yaml "3.13.1" - log-symbols "2.2.0" - minimatch "3.0.4" - mkdirp "0.5.1" - ms "2.1.1" - node-environment-flags "1.0.5" - object.assign "4.1.0" - strip-json-comments "2.0.1" - supports-color "6.0.0" - which "1.3.1" - wide-align "1.1.3" - yargs "13.2.2" - yargs-parser "13.0.0" - yargs-unparser "1.5.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -ms@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -nanomatch@^1.2.9: - version "1.2.13" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" - integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== - dependencies: - arr-diff "^4.0.0" - array-unique "^0.3.2" - define-property "^2.0.2" - extend-shallow "^3.0.2" - fragment-cache "^0.2.1" - is-windows "^1.0.2" - kind-of "^6.0.2" - object.pick "^1.3.0" - regex-not "^1.0.0" - snapdragon "^0.8.1" - to-regex "^3.0.1" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -node-environment-flags@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/node-environment-flags/-/node-environment-flags-1.0.5.tgz#fa930275f5bf5dae188d6192b24b4c8bbac3d76a" - integrity sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ== - dependencies: - object.getownpropertydescriptors "^2.0.3" - semver "^5.7.0" - -node-releases@^1.1.25: - version "1.1.25" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.25.tgz#0c2d7dbc7fed30fbe02a9ee3007b8c90bf0133d3" - integrity sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ== - dependencies: - semver "^5.3.0" - -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -npm-path@^2.0.2: - version "2.0.4" - resolved "https://registry.yarnpkg.com/npm-path/-/npm-path-2.0.4.tgz#c641347a5ff9d6a09e4d9bce5580c4f505278e64" - integrity sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw== - dependencies: - which "^1.2.10" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= - dependencies: - path-key "^2.0.0" - -npm-which@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/npm-which/-/npm-which-3.0.1.tgz#9225f26ec3a285c209cae67c3b11a6b4ab7140aa" - integrity sha1-kiXybsOihcIJyuZ8OxGmtKtxQKo= - dependencies: - commander "^2.9.0" - npm-path "^2.0.2" - which "^1.2.10" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= - -object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -object-copy@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" - integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= - dependencies: - copy-descriptor "^0.1.0" - define-property "^0.2.5" - kind-of "^3.0.3" - -object-keys@^1.0.11, object-keys@^1.0.12: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - -object-visit@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" - integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= - dependencies: - isobject "^3.0.0" - -object.assign@4.1.0, object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - -object.getownpropertydescriptors@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" - integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= - dependencies: - define-properties "^1.1.2" - es-abstract "^1.5.1" - -object.pick@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" - integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= - dependencies: - isobject "^3.0.1" - -once@^1.3.0, once@^1.3.1, once@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-locale@^3.0.0, os-locale@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= - -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - -p-limit@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" - integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== - dependencies: - p-try "^1.0.0" - -p-limit@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" - integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== - dependencies: - p-try "^2.0.0" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - integrity sha1-IKAQOyIqcMj9OcwuWAaA893l7EM= - dependencies: - p-limit "^1.1.0" - -p-locate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" - integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== - dependencies: - p-limit "^2.0.0" - -p-map@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" - integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== - -p-map@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" - integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== - -p-try@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" - integrity sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M= - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - integrity sha1-9ID0BDTvgHQfhGkJn43qGPVaTck= - dependencies: - error-ex "^1.2.0" - -parse-json@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" - integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= - dependencies: - error-ex "^1.3.1" - json-parse-better-errors "^1.0.1" - -pascalcase@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" - integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= - -path-dirname@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" - integrity sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA= - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.0, path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -path-parse@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" - integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM= - dependencies: - pify "^2.0.0" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= - -pify@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" - integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= - -pkg-dir@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" - integrity sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s= - dependencies: - find-up "^2.1.0" - -pkg-dir@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" - integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== - dependencies: - find-up "^3.0.0" - -please-upgrade-node@^3.0.2, please-upgrade-node@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" - integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== - dependencies: - semver-compare "^1.0.0" - -posix-character-classes@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" - integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^1.4.4: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== - -pretty-format@^23.6.0: - version "23.6.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-23.6.0.tgz#5eaac8eeb6b33b987b7fe6097ea6a8a146ab5760" - integrity sha512-zf9NV1NSlDLDjycnwm6hpFATCGl/K1lt0R/GdkAK2O5LN/rwJoB+Mh93gGJjut4YbmecbfgLWVGSTCr0Ewvvbw== - dependencies: - ansi-regex "^3.0.0" - ansi-styles "^3.2.0" - -private@^0.1.6: - version "0.1.8" - resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" - integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== - -progress@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" - integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4= - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg= - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - -read-pkg@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-4.0.1.tgz#963625378f3e1c4d48c85872b5a6ec7d5d093237" - integrity sha1-ljYlN48+HE1IyFhytabsfV0JMjc= - dependencies: - normalize-package-data "^2.3.2" - parse-json "^4.0.0" - pify "^3.0.0" - -regenerate-unicode-properties@^8.0.2: - version "8.1.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e" - integrity sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA== - dependencies: - regenerate "^1.4.0" - -regenerate@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" - integrity sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg== - -regenerator-transform@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.14.0.tgz#2ca9aaf7a2c239dd32e4761218425b8c7a86ecaf" - integrity sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w== - dependencies: - private "^0.1.6" - -regex-not@^1.0.0, regex-not@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" - integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== - dependencies: - extend-shallow "^3.0.2" - safe-regex "^1.1.0" - -regexp-tree@^0.1.6: - version "0.1.11" - resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.11.tgz#c9c7f00fcf722e0a56c7390983a7a63dd6c272f3" - integrity sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg== - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -regexpu-core@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.5.4.tgz#080d9d02289aa87fe1667a4f5136bc98a6aebaae" - integrity sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ== - dependencies: - regenerate "^1.4.0" - regenerate-unicode-properties "^8.0.2" - regjsgen "^0.5.0" - regjsparser "^0.6.0" - unicode-match-property-ecmascript "^1.0.4" - unicode-match-property-value-ecmascript "^1.1.0" - -regjsgen@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" - integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== - -regjsparser@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.6.0.tgz#f1e6ae8b7da2bae96c99399b868cd6c933a2ba9c" - integrity sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ== - dependencies: - jsesc "~0.5.0" - -repeat-element@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" - integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== - -repeat-string@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= - -require-main-filename@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" - integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== - -resolve-from@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" - integrity sha1-six699nWiBvItuZTM17rywoYh0g= - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -resolve-url@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" - integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= - -resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.5.0: - version "1.11.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" - integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== - dependencies: - path-parse "^1.0.6" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -ret@~0.1.10: - version "0.1.15" - resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" - integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== - -rimraf@2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= - dependencies: - is-promise "^2.1.0" - -run-node@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" - integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== - -rxjs@^6.3.3, rxjs@^6.4.0: - version "6.5.2" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" - integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== - dependencies: - tslib "^1.9.0" - -safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-regex@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" - integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= - dependencies: - ret "~0.1.10" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver-compare@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc" - integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w= - -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.7.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" - integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== - -semver@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.2.0.tgz#4d813d9590aaf8a9192693d6c85b9344de5901db" - integrity sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A== - -semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= - -set-value@^2.0.0, set-value@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" - integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== - dependencies: - extend-shallow "^2.0.1" - is-extendable "^0.1.1" - is-plain-object "^2.0.3" - split-string "^3.0.1" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -signal-exit@^3.0.0, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -slash@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" - integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== - -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" - integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= - -slice-ansi@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" - integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== - dependencies: - ansi-styles "^3.2.0" - astral-regex "^1.0.0" - is-fullwidth-code-point "^2.0.0" - -snapdragon-node@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" - integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== - dependencies: - define-property "^1.0.0" - isobject "^3.0.0" - snapdragon-util "^3.0.1" - -snapdragon-util@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" - integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== - dependencies: - kind-of "^3.2.0" - -snapdragon@^0.8.1: - version "0.8.2" - resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" - integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== - dependencies: - base "^0.11.1" - debug "^2.2.0" - define-property "^0.2.5" - extend-shallow "^2.0.1" - map-cache "^0.2.2" - source-map "^0.5.6" - source-map-resolve "^0.5.0" - use "^3.1.0" - -source-map-resolve@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" - integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== - dependencies: - atob "^2.1.1" - decode-uri-component "^0.2.0" - resolve-url "^0.2.1" - source-map-url "^0.4.0" - urix "^0.1.0" - -source-map-url@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" - integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= - -source-map@^0.5.0, source-map@^0.5.6: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -spdx-correct@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" - integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== - dependencies: - spdx-expression-parse "^3.0.0" - spdx-license-ids "^3.0.0" - -spdx-exceptions@^2.1.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" - integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== - -spdx-expression-parse@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" - integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== - dependencies: - spdx-exceptions "^2.1.0" - spdx-license-ids "^3.0.0" - -spdx-license-ids@^3.0.0: - version "3.0.5" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz#3694b5804567a458d3c8045842a6358632f62654" - integrity sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q== - -split-string@^3.0.1, split-string@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" - integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== - dependencies: - extend-shallow "^3.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -staged-git-files@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.1.1.tgz#37c2218ef0d6d26178b1310719309a16a59f8f7b" - integrity sha512-H89UNKr1rQJvI1c/PIR3kiAMBV23yvR7LItZiV74HWZwzt7f3YHuujJ9nJZlt58WlFox7XQsOahexwk7nTe69A== - -static-extend@^0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" - integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= - dependencies: - define-property "^0.2.5" - object-copy "^0.1.0" - -string-argv@^0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" - integrity sha1-2sMECGkMIfPDYwo/86BYd73L1zY= - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string-width@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" - integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== - dependencies: - emoji-regex "^7.0.1" - is-fullwidth-code-point "^2.0.0" - strip-ansi "^5.1.0" - -stringify-object@^3.2.2: - version "3.3.0" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" - integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== - dependencies: - get-own-enumerable-property-symbols "^3.0.0" - is-obj "^1.0.1" - is-regexp "^1.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-ansi@^5.1.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" - integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== - dependencies: - ansi-regex "^4.1.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= - -strip-json-comments@2.0.1, strip-json-comments@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.0.0.tgz#76cfe742cf1f41bb9b1c29ad03068c05b4c0e40a" - integrity sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg== - dependencies: - has-flag "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -symbol-observable@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" - integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== - -table@^5.2.3: - version "5.4.1" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.1.tgz#0691ae2ebe8259858efb63e550b6d5f9300171e8" - integrity sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w== - dependencies: - ajv "^6.9.1" - lodash "^4.17.11" - slice-ansi "^2.1.0" - string-width "^3.0.0" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-object-path@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" - integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= - dependencies: - kind-of "^3.0.2" - -to-regex-range@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" - integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= - dependencies: - is-number "^3.0.0" - repeat-string "^1.6.1" - -to-regex@^3.0.1, to-regex@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" - integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== - dependencies: - define-property "^2.0.2" - extend-shallow "^3.0.2" - regex-not "^1.0.2" - safe-regex "^1.1.0" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= - -tslib@^1.9.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" - integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -unicode-canonical-property-names-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" - integrity sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ== - -unicode-match-property-ecmascript@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz#8ed2a32569961bce9227d09cd3ffbb8fed5f020c" - integrity sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg== - dependencies: - unicode-canonical-property-names-ecmascript "^1.0.4" - unicode-property-aliases-ecmascript "^1.0.4" - -unicode-match-property-value-ecmascript@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz#5b4b426e08d13a80365e0d657ac7a6c1ec46a277" - integrity sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g== - -unicode-property-aliases-ecmascript@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz#a9cc6cc7ce63a0a3023fc99e341b94431d405a57" - integrity sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw== - -union-value@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" - integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== - dependencies: - arr-union "^3.1.0" - get-value "^2.0.6" - is-extendable "^0.1.1" - set-value "^2.0.1" - -unset-value@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" - integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= - dependencies: - has-value "^0.3.1" - isobject "^3.0.0" - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -urix@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" - integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= - -use@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" - integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== - -validate-npm-package-license@^3.0.1: - version "3.0.4" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" - integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== - dependencies: - spdx-correct "^3.0.0" - spdx-expression-parse "^3.0.0" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= - -which@1.3.1, which@^1.2.10, which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wide-align@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" - integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== - dependencies: - string-width "^1.0.2 || 2" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrap-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba" - integrity sha1-KIoE2H7aXChuBg3+jxNc6NAH+Lo= - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" - integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== - dependencies: - mkdirp "^0.5.1" - -"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - -yargs-parser@13.0.0: - version "13.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.0.0.tgz#3fc44f3e76a8bdb1cc3602e860108602e5ccde8b" - integrity sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" - integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-parser@^13.0.0: - version "13.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0" - integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ== - dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" - -yargs-unparser@1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.5.0.tgz#f2bb2a7e83cbc87bb95c8e572828a06c9add6e0d" - integrity sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw== - dependencies: - flat "^4.1.0" - lodash "^4.17.11" - yargs "^12.0.5" - -yargs@13.2.2: - version "13.2.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993" - integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA== - dependencies: - cliui "^4.0.0" - find-up "^3.0.0" - get-caller-file "^2.0.1" - os-locale "^3.1.0" - require-directory "^2.1.1" - require-main-filename "^2.0.0" - set-blocking "^2.0.0" - string-width "^3.0.0" - which-module "^2.0.0" - y18n "^4.0.0" - yargs-parser "^13.0.0" - -yargs@^12.0.5: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== - dependencies: - cliui "^4.0.0" - decamelize "^1.2.0" - find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^11.1.1" diff --git a/eslint/babel-eslint-plugin-development/yarn.lock b/eslint/babel-eslint-plugin-development/yarn.lock deleted file mode 100644 index 1124540b3f7b..000000000000 --- a/eslint/babel-eslint-plugin-development/yarn.lock +++ /dev/null @@ -1,857 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" - integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== - dependencies: - "@babel/highlight" "^7.0.0" - -"@babel/highlight@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" - integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^4.0.0" - -acorn-jsx@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.0.tgz#958584ddb60990c02c97c1bd9d521fce433bb101" - integrity sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg== - -acorn@^6.0.2: - version "6.0.4" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754" - integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg== - -ajv@^6.5.3: - version "6.5.5" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.5.tgz#cf97cdade71c6399a92c6d6c4177381291b781a1" - integrity sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-escapes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - -chalk@^2.0.0, chalk@^2.1.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" - integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chardet@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" - integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== - -circular-json@^0.3.1: - version "0.3.3" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" - integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" - integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -commander@2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -debug@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== - dependencies: - ms "2.0.0" - -debug@^4.0.1: - version "4.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.0.tgz#373687bffa678b38b1cd91f861b63850035ddc87" - integrity sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg== - dependencies: - ms "^2.1.1" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== - dependencies: - esutils "^2.0.2" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -eslint-plugin-prettier@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.0.0.tgz#f6b823e065f8c36529918cdb766d7a0e975ec30c" - integrity sha512-4g11opzhqq/8+AMmo5Vc2Gn7z9alZ4JqrbZ+D4i8KlSyxeQhZHlmIrY8U9Akf514MoEhogPa87Jgkq87aZ2Ohw== - dependencies: - prettier-linter-helpers "^1.0.0" - -eslint-scope@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" - integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-utils@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" - integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== - -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== - -eslint@^5.9.0: - version "5.9.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.9.0.tgz#b234b6d15ef84b5849c6de2af43195a2d59d408e" - integrity sha512-g4KWpPdqN0nth+goDNICNXGfJF7nNnepthp46CAlJoJtC5K/cLu3NgCM3AHu1CkJ5Hzt9V0Y0PBAO6Ay/gGb+w== - dependencies: - "@babel/code-frame" "^7.0.0" - ajv "^6.5.3" - chalk "^2.1.0" - cross-spawn "^6.0.5" - debug "^4.0.1" - doctrine "^2.1.0" - eslint-scope "^4.0.0" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^4.0.0" - esquery "^1.0.1" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.7.0" - ignore "^4.0.6" - imurmurhash "^0.1.4" - inquirer "^6.1.0" - is-resolvable "^1.1.0" - js-yaml "^3.12.0" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.5" - minimatch "^3.0.4" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^2.0.1" - require-uncached "^1.0.3" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" - table "^5.0.2" - text-table "^0.2.0" - -espree@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-4.1.0.tgz#728d5451e0fd156c04384a7ad89ed51ff54eb25f" - integrity sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w== - dependencies: - acorn "^6.0.2" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -esquery@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" - integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.1" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" - integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== - dependencies: - estraverse "^4.1.0" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= - -external-editor@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" - integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== - dependencies: - chardet "^0.7.0" - iconv-lite "^0.4.24" - tmp "^0.0.33" - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-diff@^1.1.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" - integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -flat-cache@^1.2.1: - version "1.3.4" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" - integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== - dependencies: - circular-json "^0.3.1" - graceful-fs "^4.1.2" - rimraf "~2.6.2" - write "^0.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= - -glob@7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.5, glob@^7.1.2: - version "7.1.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" - integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.7.0: - version "11.9.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.9.0.tgz#bde236808e987f290768a93d065060d78e6ab249" - integrity sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg== - -graceful-fs@^4.1.2: - version "4.1.15" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" - integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= - -iconv-lite@^0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" - integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -inquirer@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.0.tgz#51adcd776f661369dc1e894859c2560a224abdd8" - integrity sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg== - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^3.0.0" - figures "^2.0.0" - lodash "^4.17.10" - mute-stream "0.0.7" - run-async "^2.2.0" - rxjs "^6.1.0" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= - -is-resolvable@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" - integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.12.0: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lodash@^4.17.10, lodash@^4.17.5: - version "4.17.11" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" - integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== - -minimatch@3.0.4, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= - -mkdirp@0.5.1, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= - dependencies: - minimist "0.0.8" - -mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= - dependencies: - mimic-fn "^1.0.0" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= - -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= - -prettier-linter-helpers@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" - integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== - dependencies: - fast-diff "^1.1.2" - -prettier@^1.15.2: - version "1.15.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.2.tgz#d31abe22afa4351efa14c7f8b94b58bb7452205e" - integrity sha512-YgPLFFA0CdKL4Eg2IHtUSjzj/BWgszDHiNQAe0VAIBse34148whfdzLagRL+QiKS+YfK5ftB6X4v/MBw8yCoug== - -progress@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.1.tgz#c9242169342b1c29d275889c95734621b1952e31" - integrity sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg== - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -regexpp@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" - integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -rimraf@~2.6.2: - version "2.6.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" - integrity sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w== - dependencies: - glob "^7.0.5" - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= - dependencies: - is-promise "^2.1.0" - -rxjs@^6.1.0: - version "6.3.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.3.3.tgz#3c6a7fa420e844a81390fb1158a9ec614f4bad55" - integrity sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw== - dependencies: - tslib "^1.9.0" - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@^5.5.0, semver@^5.5.1: - version "5.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" - integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= - -signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= - -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== - dependencies: - is-fullwidth-code-point "^2.0.0" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - -strip-json-comments@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= - -supports-color@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== - dependencies: - has-flag "^3.0.0" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -table@^5.0.2: - version "5.1.0" - resolved "https://registry.yarnpkg.com/table/-/table-5.1.0.tgz#69a54644f6f01ad1628f8178715b408dc6bf11f7" - integrity sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg== - dependencies: - ajv "^6.5.3" - lodash "^4.17.10" - slice-ansi "1.0.0" - string-width "^2.1.1" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== - dependencies: - os-tmpdir "~1.0.2" - -tslib@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286" - integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ== - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= - dependencies: - prelude-ls "~1.1.2" - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= - dependencies: - mkdirp "^0.5.1" diff --git a/eslint/babel-eslint-plugin/yarn.lock b/eslint/babel-eslint-plugin/yarn.lock deleted file mode 100644 index 7845d4d1c04c..000000000000 --- a/eslint/babel-eslint-plugin/yarn.lock +++ /dev/null @@ -1,977 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@babel/code-frame@7.0.0-beta.42", "@babel/code-frame@^7.0.0-beta.40": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.42.tgz#a9c83233fa7cd06b39dc77adbb908616ff4f1962" - dependencies: - "@babel/highlight" "7.0.0-beta.42" - -"@babel/generator@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.42.tgz#777bb50f39c94a7e57f73202d833141f8159af33" - dependencies: - "@babel/types" "7.0.0-beta.42" - jsesc "^2.5.1" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" - -"@babel/helper-function-name@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.42.tgz#b38b8f4f85168d1812c543dd700b5d549b0c4658" - dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.42" - "@babel/template" "7.0.0-beta.42" - "@babel/types" "7.0.0-beta.42" - -"@babel/helper-get-function-arity@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.42.tgz#ad072e32f912c033053fc80478169aeadc22191e" - dependencies: - "@babel/types" "7.0.0-beta.42" - -"@babel/helper-split-export-declaration@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.42.tgz#0d0d5254220a9cc4e7e226240306b939dc210ee7" - dependencies: - "@babel/types" "7.0.0-beta.42" - -"@babel/highlight@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.42.tgz#a502a1c0d6f99b2b0e81d468a1b0c0e81e3f3623" - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -"@babel/template@7.0.0-beta.42": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.42.tgz#7186d4e70d44cdec975049ba0a73bdaf5cdee052" - dependencies: - "@babel/code-frame" "7.0.0-beta.42" - "@babel/types" "7.0.0-beta.42" - babylon "7.0.0-beta.42" - lodash "^4.2.0" - -"@babel/traverse@^7.0.0-beta.40": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.42.tgz#f4bf4d1e33d41baf45205e2d0463591d57326285" - dependencies: - "@babel/code-frame" "7.0.0-beta.42" - "@babel/generator" "7.0.0-beta.42" - "@babel/helper-function-name" "7.0.0-beta.42" - "@babel/helper-split-export-declaration" "7.0.0-beta.42" - "@babel/types" "7.0.0-beta.42" - babylon "7.0.0-beta.42" - debug "^3.1.0" - globals "^11.1.0" - invariant "^2.2.0" - lodash "^4.2.0" - -"@babel/types@7.0.0-beta.42", "@babel/types@^7.0.0-beta.40": - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.42.tgz#1e2118767684880f6963801b272fd2b3348efacc" - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" - -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" - dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" - -acorn@^5.5.0: - version "5.5.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.3.tgz#f473dd47e0277a08e28e9bec5aeeb04751f0b8c9" - -ajv-keywords@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" - -ajv@^5.2.3, ajv@^5.3.0: - version "5.5.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" - dependencies: - co "^4.6.0" - fast-deep-equal "^1.0.0" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.3.0" - -ansi-escapes@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - dependencies: - color-convert "^1.9.0" - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - dependencies: - sprintf-js "~1.0.2" - -array-union@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" - dependencies: - array-uniq "^1.0.1" - -array-uniq@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" - -arrify@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-eslint@^8.2.2: - version "8.2.2" - resolved "http://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b" - dependencies: - "@babel/code-frame" "^7.0.0-beta.40" - "@babel/traverse" "^7.0.0-beta.40" - "@babel/types" "^7.0.0-beta.40" - babylon "^7.0.0-beta.40" - eslint-scope "~3.7.1" - eslint-visitor-keys "^1.0.0" - -babylon@7.0.0-beta.42, babylon@^7.0.0-beta.40: - version "7.0.0-beta.42" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.42.tgz#67cfabcd4f3ec82999d29031ccdea89d0ba99657" - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - -brace-expansion@^1.1.7: - version "1.1.8" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -browser-stdout@1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" - -buffer-from@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.0.0.tgz#4cb8832d23612589b0406e9e2956c17f06fdf531" - -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - dependencies: - callsites "^0.2.0" - -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - -chalk@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.1.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chardet@^0.4.0: - version "0.4.2" - resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" - -circular-json@^0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" - -cli-cursor@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" - dependencies: - restore-cursor "^2.0.0" - -cli-width@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - -color-convert@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" - dependencies: - color-name "^1.1.1" - -color-name@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - -commander@2.15.1: - version "2.15.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -concat-stream@^1.6.0: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -core-util-is@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - -cross-spawn@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - -debug@3.1.0, debug@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" - dependencies: - ms "2.0.0" - -deep-is@~0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" - -del@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" - dependencies: - globby "^5.0.0" - is-path-cwd "^1.0.0" - is-path-in-cwd "^1.0.0" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - rimraf "^2.2.8" - -diff@3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" - -doctrine@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" - dependencies: - esutils "^2.0.2" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -eslint-rule-composer@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" - -eslint-scope@^3.7.1, eslint-scope@~3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-visitor-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" - -eslint@^4.19.1: - version "4.19.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300" - dependencies: - ajv "^5.3.0" - babel-code-frame "^6.22.0" - chalk "^2.1.0" - concat-stream "^1.6.0" - cross-spawn "^5.1.0" - debug "^3.1.0" - doctrine "^2.1.0" - eslint-scope "^3.7.1" - eslint-visitor-keys "^1.0.0" - espree "^3.5.4" - esquery "^1.0.0" - esutils "^2.0.2" - file-entry-cache "^2.0.0" - functional-red-black-tree "^1.0.1" - glob "^7.1.2" - globals "^11.0.1" - ignore "^3.3.3" - imurmurhash "^0.1.4" - inquirer "^3.0.6" - is-resolvable "^1.0.0" - js-yaml "^3.9.1" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.3.0" - lodash "^4.17.4" - minimatch "^3.0.2" - mkdirp "^0.5.1" - natural-compare "^1.4.0" - optionator "^0.8.2" - path-is-inside "^1.0.2" - pluralize "^7.0.0" - progress "^2.0.0" - regexpp "^1.0.1" - require-uncached "^1.0.3" - semver "^5.3.0" - strip-ansi "^4.0.0" - strip-json-comments "~2.0.1" - table "4.0.2" - text-table "~0.2.0" - -espree@^3.5.4: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" - dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - -esquery@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.0.tgz#cfba8b57d7fba93f17298a8a006a04cda13d80fa" - dependencies: - estraverse "^4.0.0" - -esrecurse@^4.1.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" - dependencies: - estraverse "^4.1.0" - object-assign "^4.0.1" - -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -external-editor@^2.0.4: - version "2.1.0" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.1.0.tgz#3d026a21b7f95b5726387d4200ac160d372c3b48" - dependencies: - chardet "^0.4.0" - iconv-lite "^0.4.17" - tmp "^0.0.33" - -fast-deep-equal@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - -fast-levenshtein@~2.0.4: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - -figures@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" - dependencies: - escape-string-regexp "^1.0.5" - -file-entry-cache@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" - dependencies: - flat-cache "^1.2.1" - object-assign "^4.0.1" - -flat-cache@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.2.2.tgz#fa86714e72c21db88601761ecf2f555d1abc6b96" - dependencies: - circular-json "^0.3.1" - del "^2.0.2" - graceful-fs "^4.1.2" - write "^0.2.1" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -functional-red-black-tree@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" - -glob@7.1.2, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.0.1, globals@^11.1.0: - version "11.4.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.4.0.tgz#b85c793349561c16076a3c13549238a27945f1bc" - -globby@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" - dependencies: - array-union "^1.0.1" - arrify "^1.0.0" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -growl@1.10.5: - version "1.10.5" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - -he@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" - -iconv-lite@^0.4.17: - version "0.4.19" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" - -ignore@^3.3.3: - version "3.3.7" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -inquirer@^3.0.6: - version "3.3.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" - dependencies: - ansi-escapes "^3.0.0" - chalk "^2.0.0" - cli-cursor "^2.1.0" - cli-width "^2.0.0" - external-editor "^2.0.4" - figures "^2.0.0" - lodash "^4.3.0" - mute-stream "0.0.7" - run-async "^2.2.0" - rx-lite "^4.0.8" - rx-lite-aggregates "^4.0.8" - string-width "^2.1.0" - strip-ansi "^4.0.0" - through "^2.3.6" - -invariant@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" - dependencies: - loose-envify "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-path-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" - -is-path-in-cwd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz#6477582b8214d602346094567003be8a9eac04dc" - dependencies: - is-path-inside "^1.0.0" - -is-path-inside@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.0.tgz#fc06e5a1683fbda13de667aff717bbc10a48f37f" - dependencies: - path-is-inside "^1.0.1" - -is-promise@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" - -is-resolvable@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62" - dependencies: - tryit "^1.0.1" - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" - -js-yaml@^3.9.1: - version "3.13.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe" - -json-schema-traverse@^0.3.0: - version "0.3.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - -levn@^0.3.0, levn@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" - dependencies: - prelude-ls "~1.1.2" - type-check "~0.3.2" - -lodash.clonedeep@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" - -lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0: - version "4.17.14" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" - -loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" - dependencies: - js-tokens "^3.0.0" - -lru-cache@^4.0.1: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.2.tgz#45234b2e6e2f2b33da125624c4664929a0224c3f" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -mimic-fn@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" - -minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -mkdirp@0.5.1, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -mocha@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" - dependencies: - browser-stdout "1.3.1" - commander "2.15.1" - debug "3.1.0" - diff "3.5.0" - escape-string-regexp "1.0.5" - glob "7.1.2" - growl "1.10.5" - he "1.1.1" - minimatch "3.0.4" - mkdirp "0.5.1" - supports-color "5.4.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - -object-assign@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -onetime@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" - dependencies: - mimic-fn "^1.0.0" - -optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - dependencies: - deep-is "~0.1.3" - fast-levenshtein "~2.0.4" - levn "~0.3.0" - prelude-ls "~1.1.2" - type-check "~0.3.2" - wordwrap "~1.0.0" - -os-tmpdir@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-is-inside@^1.0.1, path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pluralize@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" - -prelude-ls@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" - -process-nextick-args@~1.0.6: - version "1.0.7" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" - -progress@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -readable-stream@^2.2.2: - version "2.3.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.0.tgz#640f5dcda88c91a8dc60787145629170813a1ed2" - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~1.0.6" - safe-buffer "~5.1.0" - string_decoder "~1.0.0" - util-deprecate "~1.0.1" - -regexpp@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.0.1.tgz#d857c3a741dce075c2848dcb019a0a975b190d43" - -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - -restore-cursor@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" - dependencies: - onetime "^2.0.0" - signal-exit "^3.0.2" - -rimraf@^2.2.8: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" - dependencies: - glob "^7.0.5" - -run-async@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" - dependencies: - is-promise "^2.1.0" - -rx-lite-aggregates@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" - dependencies: - rx-lite "*" - -rx-lite@*, rx-lite@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" - -safe-buffer@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" - -safe-buffer@~5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223" - -semver@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" - -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - dependencies: - shebang-regex "^1.0.0" - -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - -signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -slice-ansi@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" - dependencies: - is-fullwidth-code-point "^2.0.0" - -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - -string-width@^2.1.0, string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - -string_decoder@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.2.tgz#b29e1f4e1125fa97a10382b8a533737b7491e179" - dependencies: - safe-buffer "~5.0.1" - -strip-ansi@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - dependencies: - ansi-regex "^3.0.0" - -strip-json-comments@~2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -supports-color@5.4.0: - version "5.4.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" - dependencies: - has-flag "^3.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -supports-color@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.3.0.tgz#5b24ac15db80fa927cf5227a4a33fd3c4c7676c0" - dependencies: - has-flag "^3.0.0" - -table@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" - dependencies: - ajv "^5.2.3" - ajv-keywords "^2.1.0" - chalk "^2.1.0" - lodash "^4.17.4" - slice-ansi "1.0.0" - string-width "^2.1.1" - -text-table@~0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - -through@^2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - -tmp@^0.0.33: - version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" - dependencies: - os-tmpdir "~1.0.2" - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - -tryit@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/tryit/-/tryit-1.0.3.tgz#393be730a9446fd1ead6da59a014308f36c289cb" - -type-check@~0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" - dependencies: - prelude-ls "~1.1.2" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - -which@^1.2.9: - version "1.3.0" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" - dependencies: - isexe "^2.0.0" - -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" - dependencies: - mkdirp "^0.5.1" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" From 17dfdab7d20e4f222d91237efcb1a60c031a7018 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 14 Nov 2019 16:00:46 -0500 Subject: [PATCH 789/965] chore: ignore engines for eslint packages (#10713) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index cfef047f6140..b552967d9f0a 100644 --- a/Makefile +++ b/Makefile @@ -225,7 +225,8 @@ yarn-install: clean-all yarn --ignore-engines lerna-bootstrap: yarn-install - yarn lerna bootstrap +# todo: remove `-- -- --ignore-engines` in Babel 8 + yarn lerna bootstrap -- -- --ignore-engines bootstrap: bootstrap-only $(MAKE) build From b4c42601d1943256ecfc20ab6a6306ee786e2e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 14 Nov 2019 22:05:26 +0100 Subject: [PATCH 790/965] Fix linting in ESLint packages (#10712) * Lint eslint/* * Run "make fix-js" * Fix remaining problems * Remove linting from subpackages * Remove husky * Add back eslint dep --- .eslintignore | 4 + Makefile | 2 +- eslint/babel-eslint-config-internal/index.js | 14 +- eslint/babel-eslint-parser/.prettierignore | 1 - eslint/babel-eslint-parser/.prettierrc | 3 - eslint/babel-eslint-parser/package.json | 22 +-- .../.eslintrc.json | 20 -- .../.prettierrc | 11 -- .../package.json | 7 +- .../src/rules/no-deprecated-clone.js | 2 - .../src/rules/no-undefined-identifier.js | 2 +- .../src/rules/plugin-name.js | 2 +- .../src/utils/is-from-babel-types.js | 2 +- eslint/babel-eslint-plugin/index.js | 62 +++--- .../rules/array-bracket-spacing.js | 79 ++++---- .../babel-eslint-plugin/rules/arrow-parens.js | 49 ++--- eslint/babel-eslint-plugin/rules/camelcase.js | 105 ++++++---- .../rules/flow-object-type.js | 53 ++--- .../rules/func-params-comma-dangle.js | 51 ++--- .../rules/generator-star-spacing.js | 73 +++---- eslint/babel-eslint-plugin/rules/new-cap.js | 12 +- .../rules/no-await-in-loop.js | 41 ++-- .../rules/no-invalid-this.js | 34 ++-- .../rules/no-unused-expressions.js | 27 +-- .../rules/object-curly-spacing.js | 38 ++-- .../rules/object-shorthand.js | 49 ++--- eslint/babel-eslint-plugin/rules/quotes.js | 27 ++- eslint/babel-eslint-plugin/rules/semi.js | 182 +++++++++--------- .../babel-eslint-plugin/rules/valid-typeof.js | 15 +- .../tests/rules/new-cap.js | 2 - .../tests/rules/object-curly-spacing.js | 2 - 31 files changed, 498 insertions(+), 495 deletions(-) delete mode 100644 eslint/babel-eslint-parser/.prettierignore delete mode 100644 eslint/babel-eslint-parser/.prettierrc delete mode 100644 eslint/babel-eslint-plugin-development/.eslintrc.json delete mode 100644 eslint/babel-eslint-plugin-development/.prettierrc diff --git a/.eslintignore b/.eslintignore index 092fbbb802cd..ab694692690c 100644 --- a/.eslintignore +++ b/.eslintignore @@ -24,3 +24,7 @@ packages/babel-preset-env-standalone/babel-preset-env.min.js packages/babel-standalone/babel.js packages/babel-standalone/babel.min.js packages/babel-parser/test/expressions + +eslint/*/node_modules +eslint/*/test +eslint/*/tests diff --git a/Makefile b/Makefile index b552967d9f0a..b2b2d3c4e7b9 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@b # Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967 export FORCE_COLOR = true -SOURCES = packages codemods +SOURCES = packages codemods eslint .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 82d4013ef665..4d8e8da89bff 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -4,12 +4,12 @@ module.exports = { plugins: ["flowtype"], parserOptions: { ecmaVersion: 2017, - sourceType: "module" + sourceType: "module", }, rules: { - "camelcase": "off", + camelcase: "off", "consistent-return": "off", - "curly": ["error", "multi-line"], + curly: ["error", "multi-line"], "linebreak-style": ["error", "unix"], "max-len": ["error", 110, 2], "new-cap": "off", @@ -31,18 +31,18 @@ module.exports = { "no-use-before-define": "off", "no-var": "error", "prefer-const": "error", - "strict": "off", + strict: "off", "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", }, globals: { // Flow Iterator: true, - $Keys: true + $Keys: true, }, env: { node: true, es6: true, - browser: true - } + browser: true, + }, }; diff --git a/eslint/babel-eslint-parser/.prettierignore b/eslint/babel-eslint-parser/.prettierignore deleted file mode 100644 index a6c57f5fb2ff..000000000000 --- a/eslint/babel-eslint-parser/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -*.json diff --git a/eslint/babel-eslint-parser/.prettierrc b/eslint/babel-eslint-parser/.prettierrc deleted file mode 100644 index 88a0e9a2990e..000000000000 --- a/eslint/babel-eslint-parser/.prettierrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "trailingComma": "es5" - } \ No newline at end of file diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 3a5d1d282b74..a92949e7e0a6 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -13,11 +13,7 @@ }, "homepage": "https://github.com/babel/babel-eslint", "scripts": { - "test": "npm run lint && npm run test-only", - "test-only": "cd test && mocha specs && cd -", - "lint": "eslint .", - "lint-fix": "npm run lint -- --fix", - "precommit": "lint-staged", + "test": "cd test && mocha specs && cd -", "preversion": "npm test", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, @@ -52,23 +48,9 @@ "@babel/preset-env": "^7.1.5", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", - "babel-eslint": "^10.0.2", "dedent": "^0.7.0", "eslint": "^6.0.1", - "eslint-config-babel": "^9.0.0", - "eslint-plugin-flowtype": "^3.11.1", - "eslint-plugin-import": "^2.14.0", - "eslint-plugin-prettier": "^3.1.0", "espree": "^6.0.0", - "husky": "^1.0.0-rc.13", - "lint-staged": "^7.2.2", - "mocha": "^6.1.4", - "prettier": "^1.4.4" - }, - "lint-staged": { - "*.js": [ - "eslint --format=codeframe --fix", - "git add" - ] + "mocha": "^6.1.4" } } diff --git a/eslint/babel-eslint-plugin-development/.eslintrc.json b/eslint/babel-eslint-plugin-development/.eslintrc.json deleted file mode 100644 index 0b09e73c3d1f..000000000000 --- a/eslint/babel-eslint-plugin-development/.eslintrc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "root": true, - "extends": "eslint:recommended", - "plugins": ["prettier"], - "parserOptions": { - "ecmaVersion": 2018, - "sourceType": "script" - }, - "env": { - "node": true - }, - "rules": { - "prettier/prettier": "error", - - "curly": ["error", "multi-line"], - "linebreak-style": ["error", "unix"], - "no-var": "error", - "prefer-const": "error" - } -} diff --git a/eslint/babel-eslint-plugin-development/.prettierrc b/eslint/babel-eslint-plugin-development/.prettierrc deleted file mode 100644 index bf2972ae07a3..000000000000 --- a/eslint/babel-eslint-plugin-development/.prettierrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "arrowParens": "avoid", - "trailingComma": "all", - "useTabs": false, - "semi": true, - "singleQuote": false, - "bracketSpacing": true, - "jsxBracketSameLine": false, - "tabWidth": 2, - "printWidth": 80 -} diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 9a8810acea83..9a65d7b6cf8a 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -14,14 +14,11 @@ }, "main": "src/index.js", "scripts": { - "test": "mocha tests --recursive", - "lint": "eslint src tests" + "test": "mocha tests --recursive" }, "devDependencies": { "eslint": "^5.9.0", - "eslint-plugin-prettier": "^3.0.0", - "mocha": "^5.2.0", - "prettier": "^1.15.2" + "mocha": "^5.2.0" }, "engines": { "node": ">=8.0.0" diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js index 08bfef8c9be5..e6e72f1b9b06 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js @@ -1,5 +1,3 @@ -// @flow - "use strict"; const getReferenceOrigin = require("../utils/get-reference-origin"); diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js index c1b4b8a99382..7a433b160c75 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js @@ -32,7 +32,7 @@ module.exports = { ) { context.report( node, - "Use path.scope.buildUndefinedNode() to create an undefined identifier directly.", + "Use path.scope.buildUndefinedNode() to create an undefined identifier directly." ); } }, diff --git a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js index 58a4bc9f6337..11dd02808a31 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js +++ b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js @@ -44,7 +44,7 @@ module.exports = { if (!returnValue.properties.some(p => p.key.name === "name")) { context.report( returnValue, - "This Babel plugin doesn't have a 'name' property.", + "This Babel plugin doesn't have a 'name' property." ); } } diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js index 36ab618817d6..304561621732 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js +++ b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js @@ -6,7 +6,7 @@ const isBabelPluginFactory = require("./is-babel-plugin-factory"); // is a reference to a @babel/types export. module.exports = function isFromBabelTypes( origin /*: ReferenceOrigin */, - scope /*: Scope */, + scope /*: Scope */ ) { if (origin.kind === "import" && origin.source === "@babel/types") { // imported from @babel/types diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/index.js index 6cd30daefb0b..eda05b28c808 100644 --- a/eslint/babel-eslint-plugin/index.js +++ b/eslint/babel-eslint-plugin/index.js @@ -1,38 +1,38 @@ -'use strict'; +"use strict"; module.exports = { rules: { - 'array-bracket-spacing': require('./rules/array-bracket-spacing'), - 'arrow-parens': require('./rules/arrow-parens'), - 'flow-object-type': require('./rules/flow-object-type'), - 'func-params-comma-dangle': require('./rules/func-params-comma-dangle'), - 'generator-star-spacing': require('./rules/generator-star-spacing'), - 'new-cap': require('./rules/new-cap'), - 'camelcase': require('./rules/camelcase'), - 'no-await-in-loop': require('./rules/no-await-in-loop'), - 'no-invalid-this': require('./rules/no-invalid-this'), - 'no-unused-expressions': require('./rules/no-unused-expressions'), - 'object-curly-spacing': require('./rules/object-curly-spacing'), - 'object-shorthand': require('./rules/object-shorthand'), - 'quotes': require('./rules/quotes'), - 'semi': require('./rules/semi'), - 'valid-typeof': require('./rules/valid-typeof'), + "array-bracket-spacing": require("./rules/array-bracket-spacing"), + "arrow-parens": require("./rules/arrow-parens"), + "flow-object-type": require("./rules/flow-object-type"), + "func-params-comma-dangle": require("./rules/func-params-comma-dangle"), + "generator-star-spacing": require("./rules/generator-star-spacing"), + "new-cap": require("./rules/new-cap"), + camelcase: require("./rules/camelcase"), + "no-await-in-loop": require("./rules/no-await-in-loop"), + "no-invalid-this": require("./rules/no-invalid-this"), + "no-unused-expressions": require("./rules/no-unused-expressions"), + "object-curly-spacing": require("./rules/object-curly-spacing"), + "object-shorthand": require("./rules/object-shorthand"), + quotes: require("./rules/quotes"), + semi: require("./rules/semi"), + "valid-typeof": require("./rules/valid-typeof"), }, rulesConfig: { - 'array-bracket-spacing': 0, - 'arrow-parens': 0, - 'camelcase': 0, - 'flow-object-type': 0, - 'func-params-comma-dangle': 0, - 'generator-star-spacing': 0, - 'new-cap': 0, - 'no-await-in-loop': 0, - 'no-invalid-this': 0, - 'no-unused-expressions': 0, - 'object-curly-spacing': 0, - 'object-shorthand': 0, - 'quotes': 0, - 'semi': 0, - 'valid-typeof': 0, + "array-bracket-spacing": 0, + "arrow-parens": 0, + camelcase: 0, + "flow-object-type": 0, + "func-params-comma-dangle": 0, + "generator-star-spacing": 0, + "new-cap": 0, + "no-await-in-loop": 0, + "no-invalid-this": 0, + "no-unused-expressions": 0, + "object-curly-spacing": 0, + "object-shorthand": 0, + quotes: 0, + semi: 0, + "valid-typeof": 0, }, }; diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js index 0a9ba375216b..e7eafff0d265 100644 --- a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js @@ -1,43 +1,46 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "enum": ["always", "never"] - }, - { - "type": "object", - "properties": { - "singleValue": { - "type": "boolean" - }, - "objectsInArrays": { - "type": "boolean" - }, - "arraysInArrays": { - "type": "boolean" - } - }, - "additionalProperties": false - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + enum: ["always", "never"], + }, + { + type: "object", + properties: { + singleValue: { + type: "boolean", + }, + objectsInArrays: { + type: "boolean", + }, + arraysInArrays: { + type: "boolean", + }, + }, + additionalProperties: false, + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/array-bracket-spacing rule is deprecated. Please ' + - 'use the built in array-bracket-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/array-bracket-spacing rule is deprecated. Please " + + "use the built in array-bracket-spacing rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/rules/arrow-parens.js index 13d9c8ffe01b..848045ff7bcb 100644 --- a/eslint/babel-eslint-plugin/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/rules/arrow-parens.js @@ -1,28 +1,31 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "enum": ["always", "as-needed"] - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + enum: ["always", "as-needed"], + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/arrow-parens rule is deprecated. Please ' + - 'use the built in arrow-parens rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/arrow-parens rule is deprecated. Please " + + "use the built in arrow-parens rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/camelcase.js b/eslint/babel-eslint-plugin/rules/camelcase.js index 65e8164cd77b..6528b4a7f423 100644 --- a/eslint/babel-eslint-plugin/rules/camelcase.js +++ b/eslint/babel-eslint-plugin/rules/camelcase.js @@ -15,7 +15,7 @@ module.exports = { description: "enforce camelcase naming convention", category: "Stylistic Issues", recommended: false, - url: "https://eslint.org/docs/rules/camelcase" + url: "https://eslint.org/docs/rules/camelcase", }, schema: [ @@ -23,23 +23,22 @@ module.exports = { type: "object", properties: { ignoreDestructuring: { - type: "boolean" + type: "boolean", }, properties: { - enum: ["always", "never"] - } + enum: ["always", "never"], + }, }, - additionalProperties: false - } + additionalProperties: false, + }, ], messages: { - notCamelCase: "Identifier '{{name}}' is not in camel case." - } + notCamelCase: "Identifier '{{name}}' is not in camel case.", + }, }, create(context) { - //-------------------------------------------------------------------------- // Helpers //-------------------------------------------------------------------------- @@ -66,7 +65,6 @@ module.exports = { * @private */ function isUnderscored(name) { - // if there's an underscore, it might be A_CONSTANT, which is okay return name.indexOf("_") > -1 && name !== name.toUpperCase(); } @@ -100,7 +98,11 @@ module.exports = { function report(node) { if (reported.indexOf(node.parent) < 0) { reported.push(node.parent); - context.report({ node, messageId: "notCamelCase", data: { name: node.name } }); + context.report({ + node, + messageId: "notCamelCase", + data: { name: node.name }, + }); } } @@ -113,30 +115,39 @@ module.exports = { } return { - Identifier(node) { - /* * Leading and trailing underscores are commonly used to flag * private/protected identifiers, strip them */ const name = node.name.replace(/^_+|_+$/g, ""), - effectiveParent = isMemberExpression(node.parent.type) ? node.parent.parent : node.parent; + effectiveParent = isMemberExpression(node.parent.type) + ? node.parent.parent + : node.parent; // MemberExpressions get special rules if (isMemberExpression(node.parent.type)) { - // "never" check properties if (properties === "never") { return; } // Always report underscored object names - if (node.parent.object.type === "Identifier" && node.parent.object.name === node.name && isUnderscored(name)) { + if ( + node.parent.object.type === "Identifier" && + node.parent.object.name === node.name && + isUnderscored(name) + ) { report(node); // Report AssignmentExpressions only if they are the left side of the assignment - } else if (effectiveParent.type === "AssignmentExpression" && isUnderscored(name) && (!isMemberExpression(effectiveParent.right.type) || isMemberExpression(effectiveParent.left.type) && effectiveParent.left.property.name === node.name)) { + } else if ( + effectiveParent.type === "AssignmentExpression" && + isUnderscored(name) && + (!isMemberExpression(effectiveParent.right.type) || + (isMemberExpression(effectiveParent.left.type) && + effectiveParent.left.property.name === node.name)) + ) { report(node); } @@ -145,50 +156,76 @@ module.exports = { * AssignmentPattern nodes can be treated like Properties: * e.g.: const { no_camelcased = false } = bar; */ - } else if (node.parent.type === "Property" || node.parent.type === "AssignmentPattern") { - - if (node.parent.parent && node.parent.parent.type === "ObjectPattern") { - - const assignmentKeyEqualsValue = node.parent.key.name === node.parent.value.name; + } else if ( + node.parent.type === "Property" || + node.parent.type === "AssignmentPattern" + ) { + if ( + node.parent.parent && + node.parent.parent.type === "ObjectPattern" + ) { + const assignmentKeyEqualsValue = + node.parent.key.name === node.parent.value.name; // prevent checking righthand side of destructured object if (node.parent.key === node && node.parent.value !== node) { return; } - const valueIsUnderscored = node.parent.value.name && isUnderscored(name); + const valueIsUnderscored = + node.parent.value.name && isUnderscored(name); // ignore destructuring if the option is set, unless a new identifier is created - if (valueIsUnderscored && !(assignmentKeyEqualsValue && ignoreDestructuring)) { + if ( + valueIsUnderscored && + !(assignmentKeyEqualsValue && ignoreDestructuring) + ) { report(node); } } // "never" check properties or always ignore destructuring - if (properties === "never" || (ignoreDestructuring && isInsideObjectPattern(node))) { + if ( + properties === "never" || + (ignoreDestructuring && isInsideObjectPattern(node)) + ) { return; } // don't check right hand side of AssignmentExpression to prevent duplicate warnings - if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && !(node.parent.right === node)) { + if ( + isUnderscored(name) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && + !(node.parent.right === node) + ) { report(node); } // Check if it's an import specifier - } else if (["ImportSpecifier", "ImportNamespaceSpecifier", "ImportDefaultSpecifier"].indexOf(node.parent.type) >= 0) { - + } else if ( + [ + "ImportSpecifier", + "ImportNamespaceSpecifier", + "ImportDefaultSpecifier", + ].indexOf(node.parent.type) >= 0 + ) { // Report only if the local imported identifier is underscored - if (node.parent.local && node.parent.local.name === node.name && isUnderscored(name)) { + if ( + node.parent.local && + node.parent.local.name === node.name && + isUnderscored(name) + ) { report(node); } // Report anything that is underscored that isn't a CallExpression - } else if (isUnderscored(name) && !ALLOWED_PARENT_TYPES.has(effectiveParent.type)) { + } else if ( + isUnderscored(name) && + !ALLOWED_PARENT_TYPES.has(effectiveParent.type) + ) { report(node); } - } - + }, }; - - } + }, }; diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/rules/flow-object-type.js index 73cd3ed17a47..4e45f8328b03 100644 --- a/eslint/babel-eslint-plugin/rules/flow-object-type.js +++ b/eslint/babel-eslint-plugin/rules/flow-object-type.js @@ -1,29 +1,34 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "enum": ["semicolon", "comma"], - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + enum: ["semicolon", "comma"], + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/flow-object-type rule is deprecated. Please ' + - 'use the flowtype/object-type-delimiter rule instead.\n' + - 'Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/flow-object-type rule is deprecated. Please " + + "use the flowtype/object-type-delimiter rule instead.\n" + + // eslint-disable-next-line + "Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter" + ); + + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js index 0290d81323d4..40bd08b3bbd3 100644 --- a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js @@ -1,28 +1,31 @@ -'use strict'; +"use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "enum": ["always", "always-multiline", "only-multiline", "never"] - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + enum: ["always", "always-multiline", "only-multiline", "never"], + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/func-params-comma-dangle rule is deprecated. Please ' + - 'use the built in comma-dangle rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/func-params-comma-dangle rule is deprecated. Please " + + "use the built in comma-dangle rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js index 64186ffe680f..6befc25d04ea 100644 --- a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/rules/generator-star-spacing.js @@ -1,40 +1,43 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "oneOf": [ - { - "enum": ["before", "after", "both", "neither"] - }, - { - "type": "object", - "properties": { - "before": {"type": "boolean"}, - "after": {"type": "boolean"} - }, - "additionalProperties": false - } - ] - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + oneOf: [ + { + enum: ["before", "after", "both", "neither"], + }, + { + type: "object", + properties: { + before: { type: "boolean" }, + after: { type: "boolean" }, + }, + additionalProperties: false, + }, + ], + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/generator-star-spacing rule is deprecated. Please ' + - 'use the built in generator-star-spacing rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/generator-star-spacing rule is deprecated. Please " + + "use the built in generator-star-spacing rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/rules/new-cap.js index 37ee633bf2d9..3e09bb25df4b 100644 --- a/eslint/babel-eslint-plugin/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/rules/new-cap.js @@ -1,8 +1,8 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const newCapRule = new eslint.Linter().getRules().get('new-cap'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const newCapRule = new eslint.Linter().getRules().get("new-cap"); /** * Returns whether a node is under a decorator or not. @@ -10,10 +10,10 @@ const newCapRule = new eslint.Linter().getRules().get('new-cap'); * @returns {Boolean} Returns true if the node is under a decorator. */ function isDecorator(node) { - return node.parent.type === "Decorator"; + return node.parent.type === "Decorator"; } module.exports = ruleComposer.filterReports( - newCapRule, - (problem, metadata) => !isDecorator(problem.node) + newCapRule, + problem => !isDecorator(problem.node) ); diff --git a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js index 8ef295f36fd3..a46a19da8876 100644 --- a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/rules/no-await-in-loop.js @@ -1,24 +1,27 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/no-await-in-loop rule is deprecated. Please ' + - 'use the built in no-await-in-loop rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/no-await-in-loop rule is deprecated. Please " + + "use the built in no-await-in-loop rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/rules/no-invalid-this.js index 994499eaadaa..101ec655a6d8 100644 --- a/eslint/babel-eslint-plugin/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/rules/no-invalid-this.js @@ -1,25 +1,21 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const noInvalidThisRule = new eslint.Linter().getRules().get('no-invalid-this'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const noInvalidThisRule = new eslint.Linter().getRules().get("no-invalid-this"); -module.exports = ruleComposer.filterReports( - noInvalidThisRule, - (problem, metadata) => { - let inClassProperty = false; - let node = problem.node; +module.exports = ruleComposer.filterReports(noInvalidThisRule, problem => { + let inClassProperty = false; + let node = problem.node; - while (node) { - if (node.type === "ClassProperty" || - node.type === "ClassPrivateProperty") { - inClassProperty = true; - return; - } + while (node) { + if (node.type === "ClassProperty" || node.type === "ClassPrivateProperty") { + inClassProperty = true; + return; + } - node = node.parent; - } + node = node.parent; + } - return !inClassProperty; - } -); + return !inClassProperty; +}); diff --git a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js index eb1955ab0bb8..81c779d3c78e 100644 --- a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/rules/no-unused-expressions.js @@ -1,8 +1,8 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const rule = new eslint.Linter().getRules().get('no-unused-expressions'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const rule = new eslint.Linter().getRules().get("no-unused-expressions"); /** * @param {ASTNode} node - any node @@ -11,9 +11,11 @@ const rule = new eslint.Linter().getRules().get('no-unused-expressions'); */ function isFinalStatementInBlockStatement(node) { const parent = node.parent; - return /^(?:If|Expression)Statement$/.test(node.type) && - parent.type === 'BlockStatement' && - parent.body[parent.body.length - 1] === node; + return ( + /^(?:If|Expression)Statement$/.test(node.type) && + parent.type === "BlockStatement" && + parent.body[parent.body.length - 1] === node + ); } /** @@ -24,13 +26,13 @@ function isFinalStatementInBlockStatement(node) { function isInDoStatement(node) { if (!node) return false; - if (node.type === 'DoExpression') return true; + if (node.type === "DoExpression") return true; // this is an `else if` if ( - node.type === 'IfStatement' && + node.type === "IfStatement" && node.parent && - node.parent.type === 'IfStatement' + node.parent.type === "IfStatement" ) { return isInDoStatement(node.parent); } @@ -50,14 +52,13 @@ function isInDoStatement(node) { function isOptionalCallExpression(node) { return ( !!node && - node.type === 'ExpressionStatement' && - node.expression.type === 'OptionalCallExpression' + node.type === "ExpressionStatement" && + node.expression.type === "OptionalCallExpression" ); } module.exports = ruleComposer.filterReports( rule, - (problem, metadata) => + problem => !isInDoStatement(problem.node) && !isOptionalCallExpression(problem.node) ); - diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js index 19953bf04ffe..d3ec19620158 100644 --- a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/rules/object-curly-spacing.js @@ -1,25 +1,27 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const objectCurlySpacingRule = new eslint.Linter().getRules().get('object-curly-spacing'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const objectCurlySpacingRule = new eslint.Linter() + .getRules() + .get("object-curly-spacing"); module.exports = ruleComposer.filterReports( - objectCurlySpacingRule, - (problem, metadata) => { - const node = problem.node; + objectCurlySpacingRule, + (problem, metadata) => { + const node = problem.node; - // Allow `exportNamespaceFrom` and `exportDefaultFrom` syntax: - // export * as x from '...'; - // export x from '...'; - if ( - node.type === 'ExportNamedDeclaration' && - node.specifiers.length > 0 && - metadata.sourceCode.getTokenBefore(node.specifiers[0]).value === "export" - ) { - return false; - } - - return true; + // Allow `exportNamespaceFrom` and `exportDefaultFrom` syntax: + // export * as x from '...'; + // export x from '...'; + if ( + node.type === "ExportNamedDeclaration" && + node.specifiers.length > 0 && + metadata.sourceCode.getTokenBefore(node.specifiers[0]).value === "export" + ) { + return false; } + + return true; + } ); diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/rules/object-shorthand.js index 73ce1365ba40..21f41e639e79 100644 --- a/eslint/babel-eslint-plugin/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/rules/object-shorthand.js @@ -1,28 +1,31 @@ "use strict"; -var isWarnedForDeprecation = false; +let isWarnedForDeprecation = false; module.exports = { - meta: { - deprecated: true, - schema: [ - { - "enum": ["always", "methods", "properties", "never"] - } - ] - }, - create: function() { - return { - Program: function() { - if (isWarnedForDeprecation || /\=-(f|-format)=/.test(process.argv.join('='))) { - return; - } + meta: { + deprecated: true, + schema: [ + { + enum: ["always", "methods", "properties", "never"], + }, + ], + }, + create: function() { + return { + Program: function() { + if ( + isWarnedForDeprecation || + /=-(f|-format)=/.test(process.argv.join("=")) + ) { + return; + } - /* eslint-disable no-console */ - console.log('The babel/object-shorthand rule is deprecated. Please ' + - 'use the built in object-shorthand rule instead.'); - /* eslint-enable no-console */ - isWarnedForDeprecation = true; - } - }; - } + console.log( + "The babel/object-shorthand rule is deprecated. Please " + + "use the built in object-shorthand rule instead." + ); + isWarnedForDeprecation = true; + }, + }; + }, }; diff --git a/eslint/babel-eslint-plugin/rules/quotes.js b/eslint/babel-eslint-plugin/rules/quotes.js index 41cd7da5a325..a4bb46df453f 100644 --- a/eslint/babel-eslint-plugin/rules/quotes.js +++ b/eslint/babel-eslint-plugin/rules/quotes.js @@ -1,18 +1,15 @@ -'use strict'; +"use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const quotesRule = new eslint.Linter().getRules().get('quotes'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const quotesRule = new eslint.Linter().getRules().get("quotes"); -module.exports = ruleComposer.filterReports( - quotesRule, - (problem, metadata) => { - // Workaround for JSX fragment syntax until - // https://github.com/eslint/eslint/issues/9662 - if (problem.node.parent.type === "JSXFragment") { - return false; - } - - return true; +module.exports = ruleComposer.filterReports(quotesRule, problem => { + // Workaround for JSX fragment syntax until + // https://github.com/eslint/eslint/issues/9662 + if (problem.node.parent.type === "JSXFragment") { + return false; } -); + + return true; +}); diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/rules/semi.js index 2d2fcc4ed292..8888bf4cacc8 100644 --- a/eslint/babel-eslint-plugin/rules/semi.js +++ b/eslint/babel-eslint-plugin/rules/semi.js @@ -1,115 +1,123 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const semiRule = new eslint.Linter().getRules().get('semi'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const semiRule = new eslint.Linter().getRules().get("semi"); const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` const isSemicolon = token => token.type === "Punctuator" && token.value === ";"; const isUnnecessarySemicolon = (context, lastToken) => { - if (!isSemicolon(lastToken)) { - return false; - } + if (!isSemicolon(lastToken)) { + return false; + } - const nextToken = context.getSourceCode().getTokenAfter(lastToken); + const nextToken = context.getSourceCode().getTokenAfter(lastToken); - if (!nextToken) { - return true; - } + if (!nextToken) { + return true; + } - const lastTokenLine = lastToken.loc.end.line; - const nextTokenLine = nextToken.loc.start.line; - const isOptOutToken = OPT_OUT_PATTERN.test(nextToken.value) && nextToken.value !== "++" && nextToken.value !== "--"; - const isDivider = (nextToken.value === "}" || nextToken.value === ";"); + const lastTokenLine = lastToken.loc.end.line; + const nextTokenLine = nextToken.loc.start.line; + const isOptOutToken = + OPT_OUT_PATTERN.test(nextToken.value) && + nextToken.value !== "++" && + nextToken.value !== "--"; + const isDivider = nextToken.value === "}" || nextToken.value === ";"; - return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; -} + return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; +}; const isOneLinerBlock = (context, node) => { - const nextToken = context.getSourceCode().getTokenAfter(node); + const nextToken = context.getSourceCode().getTokenAfter(node); - if (!nextToken || nextToken.value !== "}") { - return false; - } + if (!nextToken || nextToken.value !== "}") { + return false; + } - const parent = node.parent; + const parent = node.parent; - return parent && parent.type === "BlockStatement" && - parent.loc.start.line === parent.loc.end.line; + return ( + parent && + parent.type === "BlockStatement" && + parent.loc.start.line === parent.loc.end.line + ); }; const report = (context, node, missing) => { - const lastToken = context.getSourceCode().getLastToken(node); - - let message, fix, loc = lastToken.loc; - - if (!missing) { - message = "Missing semicolon."; - loc = loc.end; - fix = function(fixer) { - return fixer.insertTextAfter(lastToken, ";"); - }; - } else { - message = "Extra semicolon."; - loc = loc.start; - fix = function(fixer) { - return fixer.remove(lastToken); - }; - } - - context.report({ - node, - loc, - message, - fix - }); + const lastToken = context.getSourceCode().getLastToken(node); + + let message, + fix, + loc = lastToken.loc; + + if (!missing) { + message = "Missing semicolon."; + loc = loc.end; + fix = function(fixer) { + return fixer.insertTextAfter(lastToken, ";"); + }; + } else { + message = "Extra semicolon."; + loc = loc.start; + fix = function(fixer) { + return fixer.remove(lastToken); + }; + } + + context.report({ + node, + loc, + message, + fix, + }); }; const semiRuleWithClassProperty = ruleComposer.joinReports([ - semiRule, - context => ({ - ClassProperty(node) { - const options = context.options[1]; - const exceptOneLine = options && options.omitLastInOneLineBlock === true; - - const sourceCode = context.getSourceCode(); - const lastToken = sourceCode.getLastToken(node); - - if (context.options[0] === "never") { - if (isUnnecessarySemicolon(context, lastToken)) { - report(context, node, true); - } - } else { - if (!isSemicolon(lastToken)) { - if (!exceptOneLine || !isOneLinerBlock(context, node)) { - report(context, node); - } - } else { - if (exceptOneLine && isOneLinerBlock(context, node)) { - report(context, node, true); - } - } - } - }, - }), + semiRule, + context => ({ + ClassProperty(node) { + const options = context.options[1]; + const exceptOneLine = options && options.omitLastInOneLineBlock === true; + + const sourceCode = context.getSourceCode(); + const lastToken = sourceCode.getLastToken(node); + + if (context.options[0] === "never") { + if (isUnnecessarySemicolon(context, lastToken)) { + report(context, node, true); + } + } else { + if (!isSemicolon(lastToken)) { + if (!exceptOneLine || !isOneLinerBlock(context, node)) { + report(context, node); + } + } else { + if (exceptOneLine && isOneLinerBlock(context, node)) { + report(context, node, true); + } + } + } + }, + }), ]); module.exports = ruleComposer.filterReports( - semiRuleWithClassProperty, - (problem, metadata) => { - const node = problem.node; - - // Handle async iterator: - // for await (let something of {}) - if ( - node.type === "VariableDeclaration" && - node.parent.type === "ForAwaitStatement" - ) { - return false; - } - - return true; + semiRuleWithClassProperty, + problem => { + const node = problem.node; + + // Handle async iterator: + // for await (let something of {}) + if ( + node.type === "VariableDeclaration" && + node.parent.type === "ForAwaitStatement" + ) { + return false; } + + return true; + } ); diff --git a/eslint/babel-eslint-plugin/rules/valid-typeof.js b/eslint/babel-eslint-plugin/rules/valid-typeof.js index df5110be052a..aa8321ec98f9 100644 --- a/eslint/babel-eslint-plugin/rules/valid-typeof.js +++ b/eslint/babel-eslint-plugin/rules/valid-typeof.js @@ -1,12 +1,9 @@ "use strict"; -const ruleComposer = require('eslint-rule-composer'); -const eslint = require('eslint'); -const validTypeOf = new eslint.Linter().getRules().get('valid-typeof'); +const ruleComposer = require("eslint-rule-composer"); +const eslint = require("eslint"); +const validTypeOf = new eslint.Linter().getRules().get("valid-typeof"); -module.exports = ruleComposer.filterReports( - validTypeOf, - (problem, metadata) => { - return problem.node.value !== 'bigint'; - } -) +module.exports = ruleComposer.filterReports(validTypeOf, problem => { + return problem.node.value !== "bigint"; +}); diff --git a/eslint/babel-eslint-plugin/tests/rules/new-cap.js b/eslint/babel-eslint-plugin/tests/rules/new-cap.js index d03adde0713a..c37f2e9f06a9 100644 --- a/eslint/babel-eslint-plugin/tests/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/tests/rules/new-cap.js @@ -1,5 +1,3 @@ -/* eslint-disable */ - /** * @fileoverview Tests for new-cap rule. * @author Nicholas C. Zakas diff --git a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js index 8771785ff51e..a982ba5d3954 100644 --- a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js @@ -1,5 +1,3 @@ -/* eslint-disable */ - /** * @fileoverview Disallows or enforces spaces inside of object literals. * @author Jamund Ferguson From 5bb4ee73da59fd9be7c94ef9337ab3917f12dce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 15 Nov 2019 11:48:37 -0500 Subject: [PATCH 791/965] chore: use loose mode of transform (#10718) --- babel.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/babel.config.js b/babel.config.js index c7f53eaff39a..34a382f130ab 100644 --- a/babel.config.js +++ b/babel.config.js @@ -77,8 +77,8 @@ module.exports = function(api) { "@babel/proposal-object-rest-spread", { useBuiltIns: true, loose: true }, ], - "@babel/plugin-proposal-optional-chaining", - "@babel/plugin-proposal-nullish-coalescing-operator", + ["@babel/plugin-proposal-optional-chaining", { loose: true }], + ["@babel/plugin-proposal-nullish-coalescing-operator", { loose: true }], convertESM ? "@babel/transform-modules-commonjs" : null, ].filter(Boolean), From 72eca8f0c2e1c14e2ef86f554ce500c71512e682 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 15 Nov 2019 20:54:04 +0100 Subject: [PATCH 792/965] Fix publishing broken by eslint packages (#10721) --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b2b2d3c4e7b9..ba557b3a2a36 100644 --- a/Makefile +++ b/Makefile @@ -232,8 +232,10 @@ bootstrap: bootstrap-only $(MAKE) build clean-lib: + # TODO: Don't delete eslint/*/lib when they use src $(foreach source, $(SOURCES), \ - $(call clean-source-lib, $(source))) + $(if $(filter-out $(source), eslint), \ + $(call clean-source-lib, $(source)))) clean-runtime-helpers: rm -rf packages/babel-runtime/helpers @@ -262,7 +264,8 @@ define clean-source-test endef define clean-source-all - rm -rf $(1)/*/lib + # TODO: Don't delete eslint/*/lib when they use src + $(if $(filter-out $1, eslint), $(call clean-source-lib, $1)) rm -rf $(1)/*/node_modules rm -rf $(1)/*/package-lock.json From d56911b88d88ffdccc963f0697ffdf872e7304ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 16 Nov 2019 01:10:26 +0100 Subject: [PATCH 793/965] Reorganize meta files for ESLint packages (#10714) * Move COC and CONTRIBUTING * Add changelog links * Reorganize gitignore and licenses --- .github/ISSUE_TEMPLATE/Bug_report.md | 9 +++++++- .gitignore | 4 ++++ CHANGELOG.md | 4 +++- .../babel-eslint-config-internal/.gitignore | 1 - eslint/babel-eslint-parser/CODE_OF_CONDUCT.md | 3 --- eslint/babel-eslint-parser/CONTRIBUTING.md | 11 --------- eslint/babel-eslint-parser/LICENSE | 22 ------------------ .../.github/main.workflow | 23 ------------------- .../.gitignore | 1 - .../.npmignore | 1 - eslint/babel-eslint-plugin/.gitignore | 1 - scripts/clone-license.sh | 1 + 12 files changed, 16 insertions(+), 65 deletions(-) delete mode 100644 eslint/babel-eslint-config-internal/.gitignore delete mode 100644 eslint/babel-eslint-parser/CODE_OF_CONDUCT.md delete mode 100644 eslint/babel-eslint-parser/CONTRIBUTING.md delete mode 100644 eslint/babel-eslint-parser/LICENSE delete mode 100644 eslint/babel-eslint-plugin-development/.github/main.workflow delete mode 100644 eslint/babel-eslint-plugin-development/.gitignore delete mode 100644 eslint/babel-eslint-plugin/.gitignore diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 344922e4702c..90c373003e82 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -9,6 +9,11 @@ assignees: '' ## Bug Report + + **Current Behavior** A clear and concise description of the behavior. @@ -22,7 +27,9 @@ var your => (code) => here; **Expected behavior/code** A clear and concise description of what you expected to happen (or code). -**Babel Configuration (.babelrc, package.json, cli command)** +**Babel Configuration (.babelrc, package.json, cli command, .eslintrc)** + +- Filename: `babel.config.js` ```js { diff --git a/.gitignore b/.gitignore index 2f99b017304b..250b2e9a6175 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,7 @@ packages/babel-preset-env-standalone/babel-preset-env.min.js /packages/babel-parser/build .idea/ /.changelog + +/eslint/*/node_modules +/eslint/*/LICENSE +!/packages/babel-eslint-plugin/LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md index ef3a4efcb9a6..ecf1ad543c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ See [CHANGELOG - v4](/.github/CHANGELOG-v4.md), [CHANGELOG - v5](/.github/CHANGELOG-v5.md), and [CHANGELOG - v6](/.github/CHANGELOG-v6.md) for v4.x-v6.x changes. See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog. -See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog. +See [Babylon's CHANGELOG](packages/babel-parser/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog. +See [`babel-eslint`'s releases](https://github.com/babel/babel-eslint/releases) for the changelog before `@babel/eslint-parser` 7.8.0. +See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-babel/releases) for the changelog before `@babel/eslint-plugin` 7.8.0. diff --git a/eslint/babel-eslint-config-internal/.gitignore b/eslint/babel-eslint-config-internal/.gitignore deleted file mode 100644 index 3c3629e647f5..000000000000 --- a/eslint/babel-eslint-config-internal/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md b/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md deleted file mode 100644 index 1219f9578c90..000000000000 --- a/eslint/babel-eslint-parser/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -This project shares the same code of conduct as [Babel](https://github.com/babel/babel), which can be found [here](https://github.com/babel/babel/blob/master/CODE_OF_CONDUCT.md). diff --git a/eslint/babel-eslint-parser/CONTRIBUTING.md b/eslint/babel-eslint-parser/CONTRIBUTING.md deleted file mode 100644 index c03d5e74e105..000000000000 --- a/eslint/babel-eslint-parser/CONTRIBUTING.md +++ /dev/null @@ -1,11 +0,0 @@ -# Contributing - -Thanks for contributing! - -If you're about to report an issue - please first check if it's already been reported in the [issues page](https://github.com/babel/babel-eslint/issues). - -Also check to see if the latest versions of eslint/babel-eslint still produce the issue. - -Also check out the [Known Issues](https://github.com/babel/babel-eslint#known-issues) section of the README. - -If you are having issues with JSX you might want to check out eslint-plugin-react. If there's an issue with new experimental syntax you might need to report that in eslint-plugin-babel instead. diff --git a/eslint/babel-eslint-parser/LICENSE b/eslint/babel-eslint-parser/LICENSE deleted file mode 100644 index 80194a854b94..000000000000 --- a/eslint/babel-eslint-parser/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2014-2016 Sebastian McKenzie - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/eslint/babel-eslint-plugin-development/.github/main.workflow b/eslint/babel-eslint-plugin-development/.github/main.workflow deleted file mode 100644 index 6bad3e10057e..000000000000 --- a/eslint/babel-eslint-plugin-development/.github/main.workflow +++ /dev/null @@ -1,23 +0,0 @@ -workflow "Build, Lint and Test" { - resolves = ["Test", "Lint"] - on = "push" -} - -action "Build" { - uses = "docker://node:10" - runs = "yarn" -} - -action "Test" { - needs = "Build" - uses = "docker://node:10" - runs = "yarn" - args = "test" -} - -action "Lint" { - needs = "Build" - uses = "docker://node:10" - runs = "yarn" - args = "lint" -} diff --git a/eslint/babel-eslint-plugin-development/.gitignore b/eslint/babel-eslint-plugin-development/.gitignore deleted file mode 100644 index b512c09d4766..000000000000 --- a/eslint/babel-eslint-plugin-development/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules \ No newline at end of file diff --git a/eslint/babel-eslint-plugin-development/.npmignore b/eslint/babel-eslint-plugin-development/.npmignore index 5e0f958edde7..7810671790a7 100644 --- a/eslint/babel-eslint-plugin-development/.npmignore +++ b/eslint/babel-eslint-plugin-development/.npmignore @@ -1,3 +1,2 @@ tests/ -.github/ .* \ No newline at end of file diff --git a/eslint/babel-eslint-plugin/.gitignore b/eslint/babel-eslint-plugin/.gitignore deleted file mode 100644 index 3c3629e647f5..000000000000 --- a/eslint/babel-eslint-plugin/.gitignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/scripts/clone-license.sh b/scripts/clone-license.sh index e901ca00ba01..8c025097cbcb 100755 --- a/scripts/clone-license.sh +++ b/scripts/clone-license.sh @@ -1,3 +1,4 @@ echo "Cloning LICENSE to babel packages" cat LICENSE ls -db ./packages/*/ | egrep -v '.*packages\/(babel-parser|babel-plugin-transform-object-assign)\/?$' | xargs -n 1 cp LICENSE +ls -db ./eslint/*/ | egrep -v '.*eslint\/(babel-eslint-plugin)\/?$' | xargs -n 1 cp LICENSE From 6c7f8291d4feee144d62a469e5ec19f04d90a219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 15 Nov 2019 19:11:03 -0500 Subject: [PATCH 794/965] polish: skip creating extra reference for safely re-used node (#10720) * polish: skip creating extra reference for safely re-used node * reimplement using scope.maybeGenerateMemoised --- .../src/index.js | 17 +++++++++-------- .../transform-in-default/input.js | 2 +- .../transform-in-default/output.js | 4 ++-- .../transform-static-refs-in-default/input.js | 1 + .../options.json | 3 +++ .../transform-static-refs-in-default/output.js | 1 + .../transform-static-refs-in-function/input.js | 3 +++ .../options.json | 3 +++ .../transform-static-refs-in-function/output.js | 3 +++ 9 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/input.js create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/options.json create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/output.js create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/input.js create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/options.json create mode 100644 packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/output.js diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js index 5b3c2a3a4dc3..848a6c3ee3cd 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js @@ -16,14 +16,15 @@ export default declare((api, { loose = false }) => { return; } - const ref = scope.generateUidIdentifierBasedOnNode(node.left); - scope.push({ id: ref }); - - const assignment = t.assignmentExpression( - "=", - t.cloneNode(ref), - node.left, - ); + let ref = scope.maybeGenerateMemoised(node.left); + let assignment; + // skip creating extra reference when `left` is static + if (ref === null) { + ref = node.left; + assignment = t.cloneNode(node.left); + } else { + assignment = t.assignmentExpression("=", ref, node.left); + } path.replaceWith( t.conditionalExpression( diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/input.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/input.js index 7c7dcae88cf4..0c13164800af 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/input.js +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/input.js @@ -1 +1 @@ -function foo(foo, bar = foo ?? "bar") {} +function foo(foo, qux = foo.bar ?? "qux") {} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/output.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/output.js index 303ed2159928..2b2f2314b366 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/output.js +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-in-default/output.js @@ -1,3 +1,3 @@ -function foo(foo, bar = (_foo = foo) !== null && _foo !== void 0 ? _foo : "bar") { - var _foo; +function foo(foo, qux = (_foo$bar = foo.bar) !== null && _foo$bar !== void 0 ? _foo$bar : "qux") { + var _foo$bar; } diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/input.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/input.js new file mode 100644 index 000000000000..7c7dcae88cf4 --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/input.js @@ -0,0 +1 @@ +function foo(foo, bar = foo ?? "bar") {} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/options.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/options.json new file mode 100644 index 000000000000..47e490d2afcf --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["proposal-nullish-coalescing-operator"] +} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/output.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/output.js new file mode 100644 index 000000000000..8434439d0782 --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-default/output.js @@ -0,0 +1 @@ +function foo(foo, bar = foo !== null && foo !== void 0 ? foo : "bar") {} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/input.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/input.js new file mode 100644 index 000000000000..8e488a306361 --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/input.js @@ -0,0 +1,3 @@ +function foo() { + var foo = this ?? {}; +} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/options.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/options.json new file mode 100644 index 000000000000..47e490d2afcf --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["proposal-nullish-coalescing-operator"] +} diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/output.js b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/output.js new file mode 100644 index 000000000000..a13ea3508a20 --- /dev/null +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/test/fixtures/nullish-coalescing/transform-static-refs-in-function/output.js @@ -0,0 +1,3 @@ +function foo() { + var foo = this !== null && this !== void 0 ? this : {}; +} From 3846d2a7fa0adad0d3e601dab13bfd25cb7a029a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 15 Nov 2019 21:56:32 -0500 Subject: [PATCH 795/965] chore: fix typo (#10725) --- README.md | 2 +- packages/babel-plugin-transform-literals/README.md | 2 +- packages/babel-preset-env-standalone/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 190b93622139..0b17712e2e75 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Some resources: - Our [CONTRIBUTING.md](CONTRIBUTING.md) to get started with setting up the repo. - Our discussions/notes/roadmap: [babel/notes](https://github.com/babel/notes) - Our progress on TC39 proposals: [babel/proposals](https://github.com/babel/proposals) -- Our blog which contains release posts and explainations: [/blog](https://babeljs.io/blog) +- Our blog which contains release posts and explanations: [/blog](https://babeljs.io/blog) - Our videos page with talks about open source and Babel: [/videos](https://babeljs.io/videos) - Our [podcast](https://podcast.babeljs.io) diff --git a/packages/babel-plugin-transform-literals/README.md b/packages/babel-plugin-transform-literals/README.md index a226d23421d3..0f9723063c63 100644 --- a/packages/babel-plugin-transform-literals/README.md +++ b/packages/babel-plugin-transform-literals/README.md @@ -1,6 +1,6 @@ # @babel/plugin-transform-literals -> Compile ES2015 unicode string and number literals to ES5 +> Compile ES2015 Unicode string and number literals to ES5 See our website [@babel/plugin-transform-literals](https://babeljs.io/docs/en/next/babel-plugin-transform-literals.html) for more information. diff --git a/packages/babel-preset-env-standalone/README.md b/packages/babel-preset-env-standalone/README.md index 61352bcac5a3..e4de61fa68de 100644 --- a/packages/babel-preset-env-standalone/README.md +++ b/packages/babel-preset-env-standalone/README.md @@ -1,6 +1,6 @@ # @babel/preset-env-standalone -> Standalone build of babel-prest-env for use in non-Node.js environments. +> Standalone build of babel-preset-env for use in non-Node.js environments. See our website [@babel/preset-env-standalone](https://babeljs.io/docs/en/next/babel-preset-env-standalone.html) for more information. From 1b75fe3cbaed6d2d51c529dd2f088ea09f388f7b Mon Sep 17 00:00:00 2001 From: Arun Kumar Mohan Date: Fri, 15 Nov 2019 23:56:59 -0500 Subject: [PATCH 796/965] chore: fix typo: prest -> preset (#10726) [ci-skip] --- packages/babel-preset-env-standalone/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index c749a6caae8f..b7830b73c939 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,7 +1,7 @@ { "name": "@babel/preset-env-standalone", "version": "7.7.3", - "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", + "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ "babel-preset-env.js", From a6d134804aeb25a65c73ac7419c87df20c418b28 Mon Sep 17 00:00:00 2001 From: Kai Cataldo <7041728+kaicataldo@users.noreply.github.com> Date: Sat, 16 Nov 2019 04:15:15 -0500 Subject: [PATCH 797/965] Unify build step for ESLint packages (#10723) --- .gitignore | 1 + Gulpfile.js | 2 +- Makefile | 8 +++++- babel.config.js | 2 ++ .../options.json | 4 +-- .../{lib => src}/analyze-scope.js | 0 .../babylon-to-espree/convertAST.js | 0 .../babylon-to-espree/convertComments.js | 0 .../babylon-to-espree/convertProgramNode.js | 0 .../babylon-to-espree/convertTemplateType.js | 0 .../babylon-to-espree/convertToken.js | 0 .../babylon-to-espree/convertTokens.js | 0 .../{lib => src}/babylon-to-espree/index.js | 0 .../babel-eslint-parser/{lib => src}/index.js | 0 .../{lib => src}/parse-with-scope.js | 0 .../babel-eslint-parser/{lib => src}/parse.js | 0 .../{lib => src}/visitor-keys.js | 0 .../non-octal-float-strict-mode/options.json | 2 +- .../dupl-bind-func-module-sloppy/options.json | 2 +- .../scope/dupl-bind-func-module/options.json | 2 +- .../undecl-export-as-default/options.json | 2 +- .../core/scope/undecl-export-as/options.json | 2 +- .../scope/undecl-export-block/options.json | 2 +- .../undecl-export-builtin-as/options.json | 2 +- .../scope/undecl-export-builtin/options.json | 2 +- .../core/scope/undecl-export-if/options.json | 2 +- .../core/scope/undecl-export/options.json | 2 +- .../core/uncategorised/347/options.json | 2 +- .../core/uncategorised/453/options.json | 2 +- .../core/uncategorised/545/options.json | 2 +- .../core/uncategorised/548/options.json | 2 +- .../core/uncategorised/556/options.json | 2 +- .../core/uncategorised/558/options.json | 2 +- .../comma-after-rest-param/options.json | 2 +- .../invalid-escape-seq-export/options.json | 2 +- .../invalid-escape-seq-import/options.json | 2 +- .../options.json | 2 +- .../duplicate-export-default/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../duplicate-named-export/options.json | 2 +- .../import-invalid-keyword-flow/options.json | 6 ++--- .../options.json | 6 ++--- .../options.json | 2 +- .../import-invalid-keyword/options.json | 2 +- .../es2015/uncategorised/216/options.json | 2 +- .../es2015/uncategorised/334/options.json | 2 +- .../es2015/uncategorised/357/options.json | 2 +- .../es2015/uncategorised/359/options.json | 2 +- .../es2015/uncategorised/361/options.json | 2 +- .../es2015/uncategorised/363/options.json | 2 +- .../es2015/uncategorised/365/options.json | 2 +- .../es2015/uncategorised/367/options.json | 2 +- .../es2015/uncategorised/368/options.json | 2 +- .../es2015/uncategorised/369/options.json | 2 +- .../es2015/uncategorised/370/options.json | 2 +- .../es2015/uncategorised/371/options.json | 2 +- .../es2015/uncategorised/372/options.json | 2 +- .../es2015/uncategorised/373/options.json | 2 +- .../es2015/uncategorised/374/options.json | 2 +- .../es2015/uncategorised/375/options.json | 2 +- .../es2015/uncategorised/376/options.json | 2 +- .../es2015/uncategorised/377/options.json | 2 +- .../es2015/uncategorised/378/options.json | 2 +- .../es2015/uncategorised/379/options.json | 2 +- .../es2015/uncategorised/395/options.json | 2 +- .../yield/in-class-heritage/options.json | 2 +- .../yield/in-iterator-stmt/options.json | 2 +- .../exponentiation-operator/15/options.json | 2 +- .../exponentiation-operator/16/options.json | 2 +- .../invalid-escape-await/options.json | 2 +- .../es2018/object-rest-spread/11/options.json | 2 +- .../es2018/object-rest-spread/12/options.json | 2 +- .../es2018/object-rest-spread/13/options.json | 2 +- .../es2018/object-rest-spread/14/options.json | 2 +- .../es2018/object-rest-spread/15/options.json | 2 +- .../comma-after-spread-for-in/options.json | 2 +- .../comma-after-spread-nested/options.json | 2 +- .../invalid-export-named-default/options.json | 2 +- .../options.json | 2 +- .../invalid-syntax/migrated_0002/options.json | 2 +- .../invalid-syntax/migrated_0048/options.json | 2 +- .../invalid-syntax/migrated_0075/options.json | 6 ++--- .../options.json | 6 ++--- .../failure-name-constructor/options.json | 6 ++--- .../options.json | 6 ++--- .../failure-name-constructor/options.json | 6 ++--- .../super-call/options.json | 6 ++--- .../super-private-member-access/options.json | 6 ++--- .../arguments-in-arrow-function/options.json | 6 ++--- .../class-properties/arguments/options.json | 6 ++--- .../new-target-invalid/options.json | 6 ++--- .../class-properties/no-ctor-2/options.json | 4 +-- .../class-properties/no-ctor/options.json | 4 +-- .../no-static-prototype-2/options.json | 6 ++--- .../no-static-prototype/options.json | 6 ++--- .../options.json | 6 ++--- .../class-properties/super-call/options.json | 6 ++--- .../super-inside-function/options.json | 6 ++--- .../options.json | 2 +- .../no-object-methods/options.json | 2 +- .../direct-calls-only/options.json | 6 ++--- .../invalid-arguments-spread/options.json | 6 ++--- .../dynamic-import/invalid-new/options.json | 6 ++--- .../invalid-trailing-comma/options.json | 4 +-- .../dynamic-import/multiple-args/options.json | 6 ++--- .../dynamic-import/no-args/options.json | 6 ++--- .../import-meta/error-in-script/options.json | 7 ++--- .../no-other-prop-names/options.json | 7 ++--- .../import-meta/not-assignable/options.json | 7 ++--- .../no-paren-and-nullish/options.json | 7 ++--- .../no-paren-nullish-and/options.json | 6 ++--- .../no-paren-nullish-or/options.json | 6 ++--- .../no-paren-or-nullish/options.json | 7 ++--- .../invalid-hex/options.json | 7 ++--- .../invalid-leading-zero/options.json | 7 ++--- .../invalid-legacy-octal-literal/options.json | 7 ++--- .../options.json | 7 ++--- .../invalid-unicode-2/options.json | 7 ++--- .../invalid-unicode/options.json | 7 ++--- .../class-contructor-call/options.json | 6 ++--- .../optional-constructor/options.json | 6 ++--- .../options.json | 6 ++--- .../in-SuperCall/options.json | 6 ++--- .../partial-application/in-new/options.json | 6 ++--- .../options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../export-default/options.json | 2 +- .../options.json | 8 ++---- .../options.json | 3 +-- .../options.json | 2 +- .../multiple-declarations/class/options.json | 7 ++--- .../interface/options.json | 7 ++--- .../multiple-declarations/type/options.json | 7 ++--- .../options.json | 7 ++--- .../options.json | 7 ++--- .../dupl-decl-const-interface/options.json | 7 ++--- .../options.json | 7 ++--- .../dupl-decl-declare-func-func/options.json | 5 +--- .../options.json | 7 ++--- .../dupl-decl-declare-var-let/options.json | 7 ++--- .../options.json | 7 ++--- .../dupl-decl-let-declare-class/options.json | 7 ++--- .../options.json | 7 ++--- .../dupl-decl-let-interface/options.json | 7 ++--- .../dupl-decl-type-interface/options.json | 7 ++--- .../options.json | 7 ++--- .../dupl-decl-var-interface/options.json | 7 ++--- .../invalid-import-type-as/options.json | 7 ++--- .../options.json | 7 ++--- .../jsx/errors/adjacent-tags/options.json | 2 +- .../asserts-this-with-predicate/options.json | 4 +-- .../class/optional-async-error/options.json | 2 +- .../_errors/in-bind-expression/options.json | 4 +-- .../_errors/in-member-expression/options.json | 4 +-- .../optional-call-expression/options.json | 5 +--- .../yield-star/issue-9905/options.json | 2 +- .../test/fixtures/yield-star/options.json | 2 +- .../options.json | 2 +- .../options.json | 2 +- .../yield-star/return-method/options.json | 2 +- .../fixtures/regression/8354/options.json | 2 +- .../fixtures/general/issue-10339/options.json | 5 +++- .../transform-properties-declare/options.json | 2 +- .../corejs-without-usebuiltins/options.json | 11 +++++--- .../debug/entry-corejs2-android/options.json | 19 +++++++------ .../debug/entry-corejs2-electron/options.json | 19 +++++++------ .../options.json | 23 +++++++++------- .../entry-corejs2-no-import/options.json | 19 +++++++------ .../options.json | 19 +++++++------ .../entry-corejs2-proposals/options.json | 13 +++++---- .../options.json | 21 ++++++++------- .../options.json | 15 ++++++----- .../options.json | 19 +++++++------ .../options.json | 23 +++++++++------- .../options.json | 21 ++++++++------- .../fixtures/debug/entry-corejs2/options.json | 21 ++++++++------- .../entry-corejs3-all-chrome-71/options.json | 21 ++++++++------- .../debug/entry-corejs3-all/options.json | 15 ++++++----- .../debug/entry-corejs3-android/options.json | 19 +++++++------ .../entry-corejs3-babel-polyfill/options.json | 15 ++++++----- .../debug/entry-corejs3-electron/options.json | 19 +++++++------ .../entry-corejs3-es-chrome-71/options.json | 21 ++++++++------- .../options.json | 21 ++++++++------- .../entry-corejs3-es-proposals/options.json | 15 ++++++----- .../debug/entry-corejs3-es/options.json | 15 ++++++----- .../options.json | 23 +++++++++------- .../entry-corejs3-no-import/options.json | 19 +++++++------ .../options.json | 19 +++++++------ .../entry-corejs3-proposals/options.json | 13 +++++---- .../options.json | 21 ++++++++------- .../entry-corejs3-runtime-only/options.json | 21 ++++++++------- .../options.json | 21 ++++++++------- .../options.json | 15 ++++++----- .../options.json | 19 +++++++------ .../options.json | 21 ++++++++------- .../options.json | 21 ++++++++------- .../debug/entry-corejs3-stable/options.json | 15 ++++++----- .../options.json | 21 ++++++++------- .../debug/entry-corejs3-stage/options.json | 15 ++++++----- .../options.json | 23 +++++++++------- .../options.json | 21 ++++++++------- .../options.json | 21 ++++++++------- .../options.json | 21 ++++++++------- .../entry-corejs3-web-chrome-71/options.json | 21 ++++++++------- .../debug/entry-corejs3-web/options.json | 15 ++++++----- .../fixtures/debug/entry-corejs3/options.json | 21 ++++++++------- .../entry-no-corejs-no-import/options.json | 17 +++++++----- .../options.json | 13 +++++---- .../debug/entry-no-corejs-uglify/options.json | 21 ++++++++------- .../debug/entry-no-corejs/options.json | 19 +++++++------ .../fixtures/debug/plugins-only/options.json | 27 ++++++++++--------- .../debug/usage-corejs2-1/options.json | 23 +++++++++------- .../debug/usage-corejs2-2/options.json | 23 +++++++++------- .../usage-corejs2-chrome-71-1/options.json | 19 +++++++------ .../usage-corejs2-chrome-71-2/options.json | 19 +++++++------ .../debug/usage-corejs2-none-1/options.json | 23 +++++++++------- .../debug/usage-corejs2-none-2/options.json | 23 +++++++++------- .../usage-corejs2-proposals-1/options.json | 23 +++++++++------- .../usage-corejs2-proposals-2/options.json | 23 +++++++++------- .../options.json | 19 +++++++------ .../options.json | 19 +++++++------ .../options.json | 25 +++++++++-------- .../options.json | 25 +++++++++-------- .../usage-corejs2-with-import/options.json | 19 +++++++------ .../debug/usage-corejs3-1/options.json | 23 +++++++++------- .../debug/usage-corejs3-2/options.json | 23 +++++++++------- .../usage-corejs3-chrome-71-1/options.json | 19 +++++++------ .../usage-corejs3-chrome-71-2/options.json | 19 +++++++------ .../debug/usage-corejs3-none-1/options.json | 23 +++++++++------- .../debug/usage-corejs3-none-2/options.json | 23 +++++++++------- .../usage-corejs3-proposals-1/options.json | 23 +++++++++------- .../usage-corejs3-proposals-2/options.json | 23 +++++++++------- .../options.json | 19 +++++++------ .../options.json | 19 +++++++------ .../options.json | 25 +++++++++-------- .../options.json | 25 +++++++++-------- .../options.json | 23 +++++++++------- .../options.json | 23 +++++++++------- .../options.json | 23 +++++++++------- .../options.json | 23 +++++++++------- .../usage-corejs3-with-import/options.json | 19 +++++++------ .../debug/usage-no-corejs-1/options.json | 21 ++++++++------- .../debug/usage-no-corejs-2/options.json | 21 ++++++++------- .../debug/usage-no-corejs-none-1/options.json | 21 ++++++++------- .../debug/usage-no-corejs-none-2/options.json | 21 ++++++++------- .../issue-10662/options.json | 5 +--- 250 files changed, 1174 insertions(+), 1087 deletions(-) rename eslint/babel-eslint-parser/{lib => src}/analyze-scope.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertAST.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertComments.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertProgramNode.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertTemplateType.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertToken.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/convertTokens.js (100%) rename eslint/babel-eslint-parser/{lib => src}/babylon-to-espree/index.js (100%) rename eslint/babel-eslint-parser/{lib => src}/index.js (100%) rename eslint/babel-eslint-parser/{lib => src}/parse-with-scope.js (100%) rename eslint/babel-eslint-parser/{lib => src}/parse.js (100%) rename eslint/babel-eslint-parser/{lib => src}/visitor-keys.js (100%) diff --git a/.gitignore b/.gitignore index 250b2e9a6175..0c202a1dbd18 100644 --- a/.gitignore +++ b/.gitignore @@ -61,6 +61,7 @@ packages/babel-preset-env-standalone/babel-preset-env.min.js .idea/ /.changelog +/eslint/*/lib /eslint/*/node_modules /eslint/*/LICENSE !/packages/babel-eslint-plugin/LICENSE diff --git a/Gulpfile.js b/Gulpfile.js index c8a60079bff8..8e1b9b530a9a 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -17,7 +17,7 @@ const rollupNodeResolve = require("rollup-plugin-node-resolve"); const rollupReplace = require("rollup-plugin-replace"); const { registerStandalonePackageTask } = require("./scripts/gulp-tasks"); -const defaultSourcesGlob = "./@(codemods|packages)/*/src/**/*.js"; +const defaultSourcesGlob = "./@(codemods|packages|eslint)/*/src/**/*.js"; function swapSrcWithLib(srcPath) { const parts = srcPath.split(path.sep); diff --git a/Makefile b/Makefile index ba557b3a2a36..1197785d34fb 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,12 @@ export FORCE_COLOR = true SOURCES = packages codemods eslint +COMMA := , +EMPTY := +SPACE := $(EMPTY) $(EMPTY) +COMMA_SEPARATED_SOURCES = $(subst $(SPACE),$(COMMA),$(SOURCES)) + + .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap build: build-bundle @@ -113,7 +119,7 @@ fix-js: yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix fix-json: - yarn prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn + yarn prettier "{$(COMMA_SEPARATED_SOURCES)}/*/test/fixtures/**/options.json" --write --loglevel warn clean: test-clean rm -f .npmrc diff --git a/babel.config.js b/babel.config.js index 34a382f130ab..5793ce40334b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -112,6 +112,8 @@ module.exports = function(api) { "packages/*/test", "codemods/*/src", "codemods/*/test", + "eslint/*/src", + "eslint/*/test", ], sourceType: "unambiguous", }, diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-finally-used-binding/options.json b/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-finally-used-binding/options.json index 0587911559c4..cbe0e9893752 100644 --- a/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-finally-used-binding/options.json +++ b/codemods/babel-plugin-codemod-optional-catch-binding/test/fixtures/codemod-optional-catch-binding/try-catch-finally-used-binding/options.json @@ -1,3 +1,3 @@ { - "plugins": ["../../../../lib"] - } + "plugins": ["../../../../lib"] +} diff --git a/eslint/babel-eslint-parser/lib/analyze-scope.js b/eslint/babel-eslint-parser/src/analyze-scope.js similarity index 100% rename from eslint/babel-eslint-parser/lib/analyze-scope.js rename to eslint/babel-eslint-parser/src/analyze-scope.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertAST.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertComments.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertProgramNode.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertTemplateType.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertToken.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/convertTokens.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/convertTokens.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js diff --git a/eslint/babel-eslint-parser/lib/babylon-to-espree/index.js b/eslint/babel-eslint-parser/src/babylon-to-espree/index.js similarity index 100% rename from eslint/babel-eslint-parser/lib/babylon-to-espree/index.js rename to eslint/babel-eslint-parser/src/babylon-to-espree/index.js diff --git a/eslint/babel-eslint-parser/lib/index.js b/eslint/babel-eslint-parser/src/index.js similarity index 100% rename from eslint/babel-eslint-parser/lib/index.js rename to eslint/babel-eslint-parser/src/index.js diff --git a/eslint/babel-eslint-parser/lib/parse-with-scope.js b/eslint/babel-eslint-parser/src/parse-with-scope.js similarity index 100% rename from eslint/babel-eslint-parser/lib/parse-with-scope.js rename to eslint/babel-eslint-parser/src/parse-with-scope.js diff --git a/eslint/babel-eslint-parser/lib/parse.js b/eslint/babel-eslint-parser/src/parse.js similarity index 100% rename from eslint/babel-eslint-parser/lib/parse.js rename to eslint/babel-eslint-parser/src/parse.js diff --git a/eslint/babel-eslint-parser/lib/visitor-keys.js b/eslint/babel-eslint-parser/src/visitor-keys.js similarity index 100% rename from eslint/babel-eslint-parser/lib/visitor-keys.js rename to eslint/babel-eslint-parser/src/visitor-keys.js 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 aa61ff56c2b3..ee18527964e7 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": "Identifier directly after number (1:2)" -} \ 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 a760565b1bd2..d732a1630991 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": "Unterminated string constant (1:0)" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 6d24025b8674..0861962d889d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/options.json @@ -1,3 +1,3 @@ { "createParenthesizedExpressions": true -} \ 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 6d24025b8674..0861962d889d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/options.json @@ -1,3 +1,3 @@ { "createParenthesizedExpressions": true -} \ 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 5ed0b104c003..31d4d73d6c85 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 token, expected \")\" (1:8)" -} \ No newline at end of file +} 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ No newline at end of file +} 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 54925950e059..2104ca43283f 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 @@ { "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/options.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/options.json index 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 3c8ee8805e34..8e6ec258aec2 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,6 +1,4 @@ { "sourceType": "module", - "plugins": [ - "flow" - ] -} \ No newline at end of file + "plugins": ["flow"] +} 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 3c8ee8805e34..8e6ec258aec2 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,6 +1,4 @@ { "sourceType": "module", - "plugins": [ - "flow" - ] -} \ No newline at end of file + "plugins": ["flow"] +} 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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 @@ { "sourceType": "module" -} \ 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 8dfd231d943b..0cefc1094055 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": "Invalid code point 1114112" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 53135cabff8f..b412ffe6712f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/options.json @@ -1,3 +1,3 @@ { "sourceType": "script" -} \ 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 54925950e059..2104ca43283f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/options.json @@ -1,3 +1,3 @@ { "sourceType": "module" -} \ 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 6d24025b8674..0861962d889d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/options.json @@ -1,3 +1,3 @@ { "createParenthesizedExpressions": true -} \ 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 23c503c046ad..7fc68d96502e 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 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 589316ba5b14..0ab4d8e9bc1c 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": "Unexpected token, expected \")\" (2:21)" -} \ 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 6d24025b8674..0861962d889d 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,3 +1,3 @@ { "createParenthesizedExpressions": true -} \ 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 6d24025b8674..0861962d889d 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,3 +1,3 @@ { "createParenthesizedExpressions": true -} \ 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 1780992b49c5..1cd92c2a1ffd 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": "Unexpected token, expected \";\" (1:31)" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json index f14967a76c6c..b86f80dc4a72 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-for-in/options.json @@ -1,3 +1,3 @@ { "throws": "Rest element must be last element (1:10)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json index 9336eba62a3e..935d087d7ee5 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread-nested/options.json @@ -1,3 +1,3 @@ { "throws": "Rest element must be last element (1:6)" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 54925950e059..2104ca43283f 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,3 +1,3 @@ { "sourceType": "module" -} \ 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 aa61ff56c2b3..ee18527964e7 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": "Identifier directly after number (1:2)" -} \ No newline at end of file +} 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 8dfd231d943b..0cefc1094055 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": "Invalid code point 1114112" -} \ 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 5a02a61446d2..070d941a7562 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,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} 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 8078d8f00dad..f6a5fb21f1c3 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,5 +1,3 @@ { - "plugins": [ - "bigInt" - ] -} \ No newline at end of file + "plugins": ["bigInt"] +} 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 a6ccef275874..8d265ec66c23 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,5 +1,3 @@ { - "plugins": [ - "classPrivateMethods" - ] -} \ No newline at end of file + "plugins": ["classPrivateMethods"] +} 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 1ca5069a3a2f..f26e916957c8 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,5 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file + "plugins": ["classPrivateProperties"] +} 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 1ca5069a3a2f..f26e916957c8 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,5 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file + "plugins": ["classPrivateProperties"] +} 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 1ca5069a3a2f..f26e916957c8 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,5 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file + "plugins": ["classPrivateProperties"] +} 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 1ca5069a3a2f..f26e916957c8 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,5 +1,3 @@ { - "plugins": [ - "classPrivateProperties" - ] -} \ No newline at end of file + "plugins": ["classPrivateProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7c697d760098..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] + "plugins": ["classProperties"] } 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 7c697d760098..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] + "plugins": ["classProperties"] } 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 7f9944b56296..9c27576d4ad0 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,5 +1,3 @@ { - "plugins": [ - "classProperties" - ] -} \ No newline at end of file + "plugins": ["classProperties"] +} 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 70c2c7a17676..0845f9c79e6c 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 @@ -8,4 +8,4 @@ ] ], "sourceType": "module" -} \ 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 69639859c25e..cab2cc563643 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 @@ -7,4 +7,4 @@ } ] ] -} \ 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 fae0a8fe39ac..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] -} \ No newline at end of file + "plugins": ["dynamicImport"] +} 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 fae0a8fe39ac..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] -} \ No newline at end of file + "plugins": ["dynamicImport"] +} 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 fae0a8fe39ac..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] -} \ No newline at end of file + "plugins": ["dynamicImport"] +} 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 329bfdd92330..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] + "plugins": ["dynamicImport"] } 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 fae0a8fe39ac..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] -} \ No newline at end of file + "plugins": ["dynamicImport"] +} 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 fae0a8fe39ac..1629df1f3678 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,5 +1,3 @@ { - "plugins": [ - "dynamicImport" - ] -} \ No newline at end of file + "plugins": ["dynamicImport"] +} 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 cdbf46968b69..566380d4fdeb 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,7 +1,4 @@ { - "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/no-other-prop-names/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/options.json index e05ac2744632..be1070ffed9d 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "dynamicImport", - "importMeta" - ] -} \ No newline at end of file + "plugins": ["dynamicImport", "importMeta"] +} 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 e05ac2744632..be1070ffed9d 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "dynamicImport", - "importMeta" - ] -} \ No newline at end of file + "plugins": ["dynamicImport", "importMeta"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json index b79520d826a2..7fe297276880 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json @@ -1,7 +1,4 @@ { - "plugins": [ - "nullishCoalescingOperator", - "estree" - ], + "plugins": ["nullishCoalescingOperator", "estree"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json index e95e6eb0b428..f66091fd9574 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json @@ -1,6 +1,4 @@ { - "plugins": [ - "nullishCoalescingOperator" - ], + "plugins": ["nullishCoalescingOperator"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:5)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json index dc240a52b3ad..d386ce1edb21 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json @@ -1,6 +1,4 @@ { - "plugins": [ - "nullishCoalescingOperator" - ], + "plugins": ["nullishCoalescingOperator"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:10)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json index b79520d826a2..7fe297276880 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json +++ b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json @@ -1,7 +1,4 @@ { - "plugins": [ - "nullishCoalescingOperator", - "estree" - ], + "plugins": ["nullishCoalescingOperator", "estree"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" -} \ 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 45b66a114bf9..d6659f4863e6 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,6 +1,3 @@ { - "plugins": [ - "bigInt", - "numericSeparator" - ] -} \ No newline at end of file + "plugins": ["bigInt", "numericSeparator"] +} 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 0011d898807d..fd201c1bdb02 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,5 +1,3 @@ { - "plugins": [ - "optionalChaining" - ] -} \ No newline at end of file + "plugins": ["optionalChaining"] +} 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 0011d898807d..fd201c1bdb02 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,5 +1,3 @@ { - "plugins": [ - "optionalChaining" - ] -} \ No newline at end of file + "plugins": ["optionalChaining"] +} 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 0011d898807d..fd201c1bdb02 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,5 +1,3 @@ { - "plugins": [ - "optionalChaining" - ] -} \ No newline at end of file + "plugins": ["optionalChaining"] +} 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 982b7cd1dab5..87414aef43de 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,5 +1,3 @@ { - "plugins": [ - "partialApplication" - ] -} \ No newline at end of file + "plugins": ["partialApplication"] +} 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 982b7cd1dab5..87414aef43de 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,5 +1,3 @@ { - "plugins": [ - "partialApplication" - ] -} \ No newline at end of file + "plugins": ["partialApplication"] +} 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 abf908b86e3e..279df0af85ba 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 @@ -7,4 +7,4 @@ } ] ] -} \ 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 abf908b86e3e..279df0af85ba 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 @@ -7,4 +7,4 @@ } ] ] -} \ 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 abf908b86e3e..279df0af85ba 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 @@ -7,4 +7,4 @@ } ] ] -} \ 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 index 4d7a9975be5a..aadc3411ae9b 100644 --- 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 @@ -1,4 +1,4 @@ { "plugins": ["topLevelAwait"], "sourceType": "module" -} \ No newline at end of file +} 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 493880101c16..192d7042e2c8 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,8 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow", - "classProperties" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow", "classProperties"] +} 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 30df8c2ef701..53fd48c051cb 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,3 @@ { "plugins": [["flow", { "enums": true }]] - -} \ 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 db9720997638..282f44e03ab4 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/multiple-declarations/class/options.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/options.json index 3962be507d38..d822c40fbba2 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 @@ -1,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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 @@ -1,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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 @@ -1,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json index 7c91792f0e9c..d822c40fbba2 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/options.json @@ -1,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] + "plugins": ["jsx", "flow"] } 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 3962be507d38..d822c40fbba2 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ] -} \ No newline at end of file + "plugins": ["jsx", "flow"] +} 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 a282a109bf16..24ca50ff8791 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,7 +1,4 @@ { "sourceType": "module", - "plugins": [ - "flow", - "jsx" - ] -} \ No newline at end of file + "plugins": ["flow", "jsx"] +} 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 index 9835a882e99c..182a3a9016d8 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json @@ -1,3 +1,3 @@ { "throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...? (1:22)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json index efb11900ba6e..fb92dc3bde16 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this-with-predicate/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "typescript", "classProperties" - ] + "plugins": ["typescript", "classProperties"] } 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 index 8dde42aa3f55..03a7d3704a5b 100644 --- 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 @@ -1,3 +1,3 @@ { "throws": "Unexpected token (3:9)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json index 8df61c77cf09..f388c1ba2b25 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-bind-expression/options.json @@ -1,6 +1,4 @@ { - "plugins": [ - "v8intrinsic" - ], + "plugins": ["v8intrinsic"], "throws": "Unexpected token (1:0)" } diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json index 2339aca027fa..df3e3517c050 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/in-member-expression/options.json @@ -1,6 +1,4 @@ { - "plugins": [ - "v8intrinsic" - ], + "plugins": ["v8intrinsic"], "throws": "Unexpected token (1:2)" } diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json index 5a3c25f8b9cc..cd2dad552c15 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json @@ -1,7 +1,4 @@ { - "plugins": [ - "optionalChaining", - "v8intrinsic" - ], + "plugins": ["optionalChaining", "v8intrinsic"], "throws": "Unexpected token (1:0)" } 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 index 7edb6d2fc815..2454c2169cf8 100644 --- 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 @@ -1,3 +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 index b0483f766a07..5459f727f878 100644 --- 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 @@ -7,4 +7,4 @@ "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/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-parallel/options.json index 7edb6d2fc815..2454c2169cf8 100644 --- 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 @@ -1,3 +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/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method-with-finally-multiple-serial/options.json index 7edb6d2fc815..2454c2169cf8 100644 --- 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 @@ -1,3 +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/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/yield-star/return-method/options.json index 7edb6d2fc815..2454c2169cf8 100644 --- 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 @@ -1,3 +1,3 @@ { "minNodeVersion": "8.0.0" -} \ No newline at end of file +} diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json index 8d2ec02da0e8..a172da6589bf 100644 --- a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/regression/8354/options.json @@ -1,3 +1,3 @@ { "plugins": ["proposal-optional-chaining", "transform-template-literals"] -} \ No newline at end of file +} diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json index d829970edd1b..c71915a51cc7 100644 --- a/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json +++ b/packages/babel-plugin-transform-block-scoping/test/fixtures/general/issue-10339/options.json @@ -1,3 +1,6 @@ { - "plugins": ["transform-block-scoping", ["proposal-object-rest-spread", { "loose": true }]] + "plugins": [ + "transform-block-scoping", + ["proposal-object-rest-spread", { "loose": true }] + ] } 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 index 18a1de9a1531..832ece64097b 100644 --- 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 @@ -3,4 +3,4 @@ ["transform-typescript", { "allowDeclareFields": true }], "proposal-class-properties" ] -} \ No newline at end of file +} diff --git a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json index 4b48078b39fe..bb7efd202301 100644 --- a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/options.json @@ -2,9 +2,12 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json index 4c0f7ba53228..7c23631533a1 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-android/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": [ "Android >= 4" ] - }, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": ["Android >= 4"] + }, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json index 6e94b50ef9cd..87ebef4f6836 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-electron/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "electron": 0.36 - }, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "electron": 0.36 + }, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json index 85173e88bc5a..63316b736f5c 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-force-all-transforms/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "modules": false, - "targets": { - "chrome": 55 - }, - "useBuiltIns": "entry", - "corejs": 2, - "forceAllTransforms": true - }] + [ + "env", + { + "debug": true, + "modules": false, + "targets": { + "chrome": 55 + }, + "useBuiltIns": "entry", + "corejs": 2, + "forceAllTransforms": true + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json index f25fe559174a..c1bb48f690fe 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "node": 6 - }, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "node": 6 + }, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json index 7b1a34227227..c40fbcce5f07 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "useBuiltIns": "entry", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "useBuiltIns": "entry", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json index 6f3ed59a0688..b7911d7ee093 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals/options.json @@ -2,10 +2,13 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "useBuiltIns": "entry", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "useBuiltIns": "entry", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json index 396589b5f1f9..eca9a1a6033d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json index 7510b6b4ec8b..7cc745ffc6f5 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json index f36ee4c5d356..2c036f8e4d1d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-specific-targets/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" - }, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" + }, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json index 633a32f89827..637bfdfe8456 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-decimals/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": 2, - "debug": true, - "targets": { - "chrome": 54, - "electron": 0.36, - "node": 6.10, - "ie": 10 + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 2, + "debug": true, + "targets": { + "chrome": 54, + "electron": 0.36, + "node": 6.1, + "ie": 10 + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json index 031acab85bc0..7fcba34b836c 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-versions-strings/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": 2, - "debug": true, - "targets": { - "chrome": "54", - "node": "6.10", - "ie": "10" + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 2, + "debug": true, + "targets": { + "chrome": "54", + "node": "6.10", + "ie": "10" + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json index 5ef6d39cc2a1..e8cc67c9ac8e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome >= 54, ie 10", - "node": 6 - }, - "useBuiltIns": "entry", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome >= 54, ie 10", + "node": 6 + }, + "useBuiltIns": "entry", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json index b6c566915214..ca76bce5c006 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-android/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": ["Android >= 4"] - }, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": ["Android >= 4"] + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-babel-polyfill/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json index 1f0ca6f76f10..294459fe21ec 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-electron/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "electron": 0.36 - }, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "electron": 0.36 + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json index 6fb693e23b6a..7a7ff504fed3 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-force-all-transforms/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "modules": false, - "targets": { - "chrome": 55 - }, - "useBuiltIns": "entry", - "corejs": 3, - "forceAllTransforms": true - }] + [ + "env", + { + "debug": true, + "modules": false, + "targets": { + "chrome": 55 + }, + "useBuiltIns": "entry", + "corejs": 3, + "forceAllTransforms": true + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json index d4bddcf3bd17..06c8e01e63ad 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "node": 6 - }, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "node": 6 + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json index 22bbaecaf5bc..c33ddf46d323 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "useBuiltIns": "entry", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "useBuiltIns": "entry", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json index e7b977b6a6fd..be2441059196 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals/options.json @@ -2,10 +2,13 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "useBuiltIns": "entry", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "useBuiltIns": "entry", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json index 8fc9e8f3d651..29b3f9326ffb 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-targets/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" - }, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "ie 10, ios 9, safari 7, edge 13, chrome 54, firefox 49" + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json index b135943fb521..016c09c862a2 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "samsung 8.2" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "samsung 8.2" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json index b692cabae5fb..7b937537dd8c 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-decimals/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": 3, - "debug": true, - "targets": { - "chrome": 54, - "electron": 0.36, - "node": 6.1, - "ie": 10 + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 3, + "debug": true, + "targets": { + "chrome": 54, + "electron": 0.36, + "node": 6.1, + "ie": 10 + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json index 24e7ea83fdde..e3f89d06a7a3 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.0/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": "3.0", - "debug": true, - "targets": { - "chrome": "54", - "node": "6.10", - "ie": "10" + [ + "env", + { + "useBuiltIns": "entry", + "corejs": "3.0", + "debug": true, + "targets": { + "chrome": "54", + "node": "6.10", + "ie": "10" + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json index d00724a723e3..69bc8e9d06c3 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings-minor-3.1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": "3.1", - "debug": true, - "targets": { - "chrome": "54", - "node": "6.10", - "ie": "10" + [ + "env", + { + "useBuiltIns": "entry", + "corejs": "3.1", + "debug": true, + "targets": { + "chrome": "54", + "node": "6.10", + "ie": "10" + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json index 8372211f221f..2f72dab2dc93 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-versions-strings/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "useBuiltIns": "entry", - "corejs": 3, - "debug": true, - "targets": { - "chrome": "54", - "node": "6.10", - "ie": "10" + [ + "env", + { + "useBuiltIns": "entry", + "corejs": 3, + "debug": true, + "targets": { + "chrome": "54", + "node": "6.10", + "ie": "10" + } } - }] + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json index 6782704424da..6e8f4a357b28 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome 71" - }, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome 71" + }, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json index 5f13bdc6b92f..edf42df8057e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web/options.json @@ -2,11 +2,14 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json index 6f5c3415a1d6..9dcd68d59ce9 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome >= 54, ie 10", - "node": 6 - }, - "useBuiltIns": "entry", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome >= 54, ie 10", + "node": 6 + }, + "useBuiltIns": "entry", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json index 41fb4e367afd..fd9dfe7fbea6 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/options.json @@ -2,12 +2,15 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "node": 6 - }, - "useBuiltIns": "entry" - }] + [ + "env", + { + "debug": true, + "targets": { + "node": 6 + }, + "useBuiltIns": "entry" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json index 16d3f47c9797..736ae7777264 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/options.json @@ -2,10 +2,13 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "shippedProposals": true, - "useBuiltIns": "entry" - }] + [ + "env", + { + "debug": true, + "shippedProposals": true, + "useBuiltIns": "entry" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json index 0d88dc7094a9..5e37354bd855 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 55, - "uglify": true - }, - "useBuiltIns": "entry", - "modules": false - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 55, + "uglify": true + }, + "useBuiltIns": "entry", + "modules": false + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json index d7687f587a7f..850e0357fd0d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "browsers": "chrome >= 54, ie 10", - "node": 6 - }, - "useBuiltIns": "entry" - }] + [ + "env", + { + "debug": true, + "targets": { + "browsers": "chrome >= 54, ie 10", + "node": 6 + }, + "useBuiltIns": "entry" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json b/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json index 801639d976b0..fb4eeeaf5e71 100644 --- a/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/plugins-only/options.json @@ -2,18 +2,21 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "exclude": [ - "transform-async-to-generator", - "transform-regenerator", - "transform-parameters" + [ + "env", + { + "debug": true, + "exclude": [ + "transform-async-to-generator", + "transform-regenerator", + "transform-parameters" ], - "targets": { - "firefox": 52, - "node": 7.4 - }, - "useBuiltIns": false - }] + "targets": { + "firefox": 52, + "node": 7.4 + }, + "useBuiltIns": false + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json index 2c35aeec223c..bc84c3a017cd 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json index 2c35aeec223c..bc84c3a017cd 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json index f4aa63a4cca2..d028d3be910f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json index f4aa63a4cca2..d028d3be910f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json index 2c35aeec223c..bc84c3a017cd 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json index 2c35aeec223c..bc84c3a017cd 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-none-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json index 6c606d27d701..17e594c8c6f1 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json index 6c606d27d701..17e594c8c6f1 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json index 7b5c421a7a0d..7239e5721426 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json index 7b5c421a7a0d..7239e5721426 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": { "version": 2, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 2, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json index fe52508cd3b7..9069c3b78807 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-1/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "shippedProposals": true, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json index fe52508cd3b7..9069c3b78807 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-shippedProposals-2/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "shippedProposals": true, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json index 4c4d8b0fcd4c..c1118296ce3a 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 55 - }, - "useBuiltIns": "usage", - "corejs": 2 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 55 + }, + "useBuiltIns": "usage", + "corejs": 2 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json index 45070b4e0e3f..64cd6071b99d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json index 45070b4e0e3f..64cd6071b99d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json index 6500390af0ba..affda23d0ad5 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json index 6500390af0ba..affda23d0ad5 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json index 45070b4e0e3f..64cd6071b99d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json index 45070b4e0e3f..64cd6071b99d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-none-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json index 5068dd30cfe3..06974bf0dca0 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json index 5068dd30cfe3..06974bf0dca0 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json index fd394abdc7c6..18332716ece1 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json index fd394abdc7c6..18332716ece1 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 71 - }, - "useBuiltIns": "usage", - "corejs": { "version": 3, "proposals": true } - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 71 + }, + "useBuiltIns": "usage", + "corejs": { "version": 3, "proposals": true } + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json index b73965bf5e2f..5bd93bb47155 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-1/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "shippedProposals": true, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json index b73965bf5e2f..5bd93bb47155 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-shippedProposals-2/options.json @@ -2,16 +2,19 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "shippedProposals": true, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "shippedProposals": true, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json index fc2f3d3fd375..14e2af08bf42 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": "3.0" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.0" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json index fc2f3d3fd375..14e2af08bf42 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.0-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": "3.0" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.0" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json index 9da4542cd86a..de96a9fb2a2f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-1/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": "3.1" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.1" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json index 9da4542cd86a..de96a9fb2a2f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-versions-strings-minor-3.1-2/options.json @@ -2,15 +2,18 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage", - "corejs": "3.1" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage", + "corejs": "3.1" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json index 0b979140c068..a1d0ee8004f5 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/options.json @@ -2,13 +2,16 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 55 - }, - "useBuiltIns": "usage", - "corejs": 3 - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 55 + }, + "useBuiltIns": "usage", + "corejs": 3 + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json index 9f7218d01009..e811528ee105 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json index 9f7218d01009..e811528ee105 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json index d590e4deffa5..e811528ee105 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json index d590e4deffa5..e811528ee105 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/options.json @@ -2,14 +2,17 @@ "validateLogs": true, "ignoreOutput": true, "presets": [ - ["env", { - "debug": true, - "targets": { - "chrome": 52, - "firefox": 50, - "ie": 11 - }, - "useBuiltIns": "usage" - }] + [ + "env", + { + "debug": true, + "targets": { + "chrome": 52, + "firefox": 50, + "ie": 11 + }, + "useBuiltIns": "usage" + } + ] ] } diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json index 00fdf1fb5d98..8d2b3b33f359 100644 --- a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-10662/options.json @@ -4,10 +4,7 @@ "env", { "modules": "umd", - "targets": [ - "Safari 8", - "IE 11" - ] + "targets": ["Safari 8", "IE 11"] } ] ] From 5ca8acdb38bc7a9a4669ad3249c219531f8f6579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 16 Nov 2019 11:09:18 +0100 Subject: [PATCH 798/965] Do not automatically publish eslint packages (#10722) * Do not automatically publish eslint packages * Fix * Fix * Fix * Fix * Fix --- Makefile | 12 ++++++++++++ eslint/babel-eslint-config-internal/package.json | 1 + eslint/babel-eslint-parser/package.json | 2 +- eslint/babel-eslint-plugin-development/package.json | 1 + eslint/babel-eslint-plugin/package.json | 1 + lerna.json | 4 +++- scripts/integration-tests/publish-local.sh | 12 ++++++++++++ 7 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1197785d34fb..2528fc328956 100644 --- a/Makefile +++ b/Makefile @@ -225,6 +225,11 @@ endif yarn lerna publish from-git --registry http://localhost:4873 --yes --tag-version-prefix="version-e2e-test-" $(MAKE) clean +publish-eslint: + $(call set-json-field, ./eslint/$(PKG)/package.json, private, false) + cd eslint/$(PKG); yarn publish + $(call set-json-field, ./eslint/$(PKG)/package.json, private, true) + bootstrap-only: lerna-bootstrap yarn-install: clean-all @@ -276,3 +281,10 @@ define clean-source-all rm -rf $(1)/*/package-lock.json endef + +define set-json-field + node -e "\ + require('fs').writeFileSync('$1'.trim(), \ + JSON.stringify({ ...require('$1'.trim()), $2: $3 }, null, 2) + '\\n' \ + )" +endef diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index a46867e3c69f..e7431a11a518 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "private": true, "repository": { "type": "git", "url": "https://github.com/babel/eslint-config-babel" diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index a92949e7e0a6..7192d29cdf33 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -4,6 +4,7 @@ "description": "Custom parser for ESLint", "author": "Sebastian McKenzie ", "license": "MIT", + "private": true, "repository": { "type": "git", "url": "https://github.com/babel/babel-eslint.git" @@ -14,7 +15,6 @@ "homepage": "https://github.com/babel/babel-eslint", "scripts": { "test": "cd test && mocha specs && cd -", - "preversion": "npm test", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, "engines": { diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 9a65d7b6cf8a..96199d9cbd21 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -2,6 +2,7 @@ "name": "@babel/eslint-plugin-development", "version": "1.0.1", "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", + "private": true, "keywords": [ "eslint", "eslintplugin", diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 1d07201d0473..32b7d09e1caf 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -19,6 +19,7 @@ ], "author": "Jason Quense @monasticpanic", "license": "MIT", + "private": true, "engines": { "node": ">=4" }, diff --git a/lerna.json b/lerna.json index d51103fbc211..326ffefc80ce 100644 --- a/lerna.json +++ b/lerna.json @@ -22,7 +22,9 @@ "test/**", "codemods/**", "# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.", - "@(!(built-in-modules|built-ins|plugins|package)).json" + "@(!(built-in-modules|built-ins|plugins|package)).json", + "# Until the ESLint packages version are aligned with Babel's, we ignore them", + "eslint/**" ] } }, diff --git a/scripts/integration-tests/publish-local.sh b/scripts/integration-tests/publish-local.sh index d16f123512a5..8a77d31cb543 100755 --- a/scripts/integration-tests/publish-local.sh +++ b/scripts/integration-tests/publish-local.sh @@ -11,6 +11,13 @@ source utils/local-registry.sh source utils/git.sh source utils/cleanup.sh +function publishESLintPkg { + cd eslint/$1 + yarn version --patch --no-git-tag-version + cd ../.. + make publish-eslint PKG=$1 +} + # Echo every command being executed set -x @@ -30,4 +37,9 @@ loginLocalRegistry I_AM_USING_VERDACCIO=I_AM_SURE make publish-test +publishESLintPkg babel-eslint-config-internal +publishESLintPkg babel-eslint-parser +publishESLintPkg babel-eslint-plugin +publishESLintPkg babel-eslint-plugin-development + cleanup From bcd181f051888bcb7d933cc069f9b421a51edcf5 Mon Sep 17 00:00:00 2001 From: Kai Cataldo <7041728+kaicataldo@users.noreply.github.com> Date: Sat, 16 Nov 2019 05:10:33 -0500 Subject: [PATCH 799/965] ESLint: disable max-len (#10727) * ESLint: disable max-len * Rename .eslintrc.json -> .eslintrc.js * Fix up .eslintrc.js --- .eslintrc.js | 43 ++++++++++++++++++++ .eslintrc.json | 41 ------------------- eslint/babel-eslint-config-internal/index.js | 1 - 3 files changed, 43 insertions(+), 42 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000000..df340d2700c0 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,43 @@ +module.exports = { + root: true, + plugins: ["prettier", "@babel/development", "import"], + extends: "babel", + rules: { + "prettier/prettier": "error", + // TODO: remove after babel-eslint-config-internal is fully integrated into this repository. + "max-len": "off", + }, + env: { + node: true, + }, + overrides: [ + { + files: ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"], + rules: { + "@babel/development/no-undefined-identifier": "error", + "@babel/development/no-deprecated-clone": "error", + "import/no-extraneous-dependencies": "error", + "guard-for-in": "error", + }, + }, + { + files: [ + "packages/*/test/**/*.js", + "codemods/*/test/**/*.js", + "packages/babel-helper-transform-fixture-test-runner/src/helpers.js", + "test/**/*.js", + ], + env: { + jest: true, + }, + }, + { + files: ["packages/babel-plugin-*/src/index.js"], + excludedFiles: ["packages/babel-plugin-transform-regenerator/**/*.js"], + rules: { + "@babel/development/plugin-name": "error", + eqeqeq: ["error", "always", { null: "ignore" }], + }, + }, + ], +}; diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index a59dc0d9e2dd..000000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "root": true, - "plugins": ["prettier", "@babel/development", "import"], - "extends": "babel", - "rules": { - "prettier/prettier": "error" - }, - "env": { - "node": true - }, - "overrides": [ - { - "files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"], - "rules": { - "@babel/development/no-undefined-identifier": "error", - "@babel/development/no-deprecated-clone": "error", - "import/no-extraneous-dependencies": "error", - "guard-for-in": "error" - } - }, - { - "files": [ - "packages/*/test/**/*.js", - "codemods/*/test/**/*.js", - "packages/babel-helper-transform-fixture-test-runner/src/helpers.js", - "test/**/*.js" - ], - "env": { - "jest": true - } - }, - { - "files": ["packages/babel-plugin-*/src/index.js"], - "excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"], - "rules": { - "@babel/development/plugin-name": "error", - "eqeqeq": ["error", "always", { "null": "ignore" }] - } - } - ] -} diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 4d8e8da89bff..4010ed3eed34 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -11,7 +11,6 @@ module.exports = { "consistent-return": "off", curly: ["error", "multi-line"], "linebreak-style": ["error", "unix"], - "max-len": ["error", 110, 2], "new-cap": "off", "no-case-declarations": "error", "no-cond-assign": "off", From f087cf842fc1011ab6047a40900e93fa0c2cbabe Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Sat, 16 Nov 2019 12:32:19 +0100 Subject: [PATCH 800/965] Mocha to jest migration for eslint packages (#10716) * migrated mocha to jest * migrated mocha to jest - 2 * migrated mocha to jest - removed preversion hook from script * migrated mocha to jest - 3 * migrated mocha to jest - 4 * cleanup * review * review --- eslint/babel-eslint-parser/package.json | 4 +- .../test/{specs => }/babel-eslint.js | 29 +++++++++----- .../{ => fixtures/config}/babel.config.js | 0 .../test/{specs => }/integration.js | 38 +++++++++---------- .../test/{specs => }/non-regression.js | 12 ++++-- .../package.json | 6 +-- .../rules/no-deprecated-clone.js | 0 .../rules/no-undefined-identifier.js | 0 .../{tests => test}/rules/plugin-name.js | 0 eslint/babel-eslint-plugin/package.json | 6 +-- .../{tests => test/helpers}/RuleTester.js | 0 .../{tests => test}/rules/camelcase.js | 2 +- .../{tests => test}/rules/new-cap.js | 2 +- .../{tests => test}/rules/no-invalid-this.js | 4 +- .../rules/no-unused-expressions.js | 2 +- .../rules/object-curly-spacing.js | 2 +- .../{tests => test}/rules/quotes.js | 2 +- .../{tests => test}/rules/semi.js | 2 +- .../{tests => test}/rules/valid-typeof.js | 2 +- package.json | 6 ++- scripts/test.sh | 2 +- 21 files changed, 63 insertions(+), 58 deletions(-) rename eslint/babel-eslint-parser/test/{specs => }/babel-eslint.js (96%) rename eslint/babel-eslint-parser/test/{ => fixtures/config}/babel.config.js (100%) rename eslint/babel-eslint-parser/test/{specs => }/integration.js (85%) rename eslint/babel-eslint-parser/test/{specs => }/non-regression.js (99%) rename eslint/babel-eslint-plugin-development/{tests => test}/rules/no-deprecated-clone.js (100%) rename eslint/babel-eslint-plugin-development/{tests => test}/rules/no-undefined-identifier.js (100%) rename eslint/babel-eslint-plugin-development/{tests => test}/rules/plugin-name.js (100%) rename eslint/babel-eslint-plugin/{tests => test/helpers}/RuleTester.js (100%) rename eslint/babel-eslint-plugin/{tests => test}/rules/camelcase.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/new-cap.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/no-invalid-this.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/no-unused-expressions.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/object-curly-spacing.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/quotes.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/semi.js (99%) rename eslint/babel-eslint-plugin/{tests => test}/rules/valid-typeof.js (99%) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 7192d29cdf33..6cb74e76f24c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -14,7 +14,6 @@ }, "homepage": "https://github.com/babel/babel-eslint", "scripts": { - "test": "cd test && mocha specs && cd -", "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" }, "engines": { @@ -50,7 +49,6 @@ "@babel/preset-react": "^7.0.0", "dedent": "^0.7.0", "eslint": "^6.0.1", - "espree": "^6.0.0", - "mocha": "^6.1.4" + "espree": "^6.0.0" } } diff --git a/eslint/babel-eslint-parser/test/specs/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint.js similarity index 96% rename from eslint/babel-eslint-parser/test/specs/babel-eslint.js rename to eslint/babel-eslint-parser/test/babel-eslint.js index 7dedf3819243..6d812e4c5499 100644 --- a/eslint/babel-eslint-parser/test/specs/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint.js @@ -1,11 +1,19 @@ "use strict"; const assert = require("assert"); -const babelEslint = require("../.."); +const path = require("path"); +const babelEslint = require("../"); const espree = require("espree"); const escope = require("eslint-scope"); const unpad = require("dedent"); -const assertImplementsAST = require("../helpers/assert-implements-ast"); +const assertImplementsAST = require("./helpers/assert-implements-ast"); + +const babelOptions = { + configFile: path.resolve( + __dirname, + "./fixtures/config/babel.config.js" + ), +} function parseAndAssertSame(code) { code = unpad(code); @@ -30,6 +38,7 @@ function parseAndAssertSame(code) { const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, + babelOptions, }).ast; assertImplementsAST(esAST, babylonAST); } @@ -40,15 +49,11 @@ describe("babylon-to-espree", () => { const esAST = babelEslint.parseForESLint("`test`", { eslintScopeManager: true, eslintVisitorKeys: true, + babelOptions, }).ast; - - assert.doesNotThrow( - () => { - escope.analyze(esAST); - }, - TypeError, - "Should allow no options argument." - ); + expect(() => { + escope.analyze(esAST) + }).not.toThrow(new TypeError('Should allow no options argument.')); }); }); @@ -243,6 +248,7 @@ describe("babylon-to-espree", () => { const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, + babelOptions, }).ast; assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); }); @@ -253,6 +259,7 @@ describe("babylon-to-espree", () => { const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, + babelOptions, }).ast; assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); }); @@ -263,6 +270,7 @@ describe("babylon-to-espree", () => { const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, + babelOptions, }).ast; assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); }); @@ -273,6 +281,7 @@ describe("babylon-to-espree", () => { const babylonAST = babelEslint.parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, + babelOptions, }).ast; assert.strictEqual(babylonAST.tokens[3].type, "Punctuator"); assert.strictEqual(babylonAST.tokens[3].value, "#"); diff --git a/eslint/babel-eslint-parser/test/babel.config.js b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js similarity index 100% rename from eslint/babel-eslint-parser/test/babel.config.js rename to eslint/babel-eslint-parser/test/fixtures/config/babel.config.js diff --git a/eslint/babel-eslint-parser/test/specs/integration.js b/eslint/babel-eslint-parser/test/integration.js similarity index 85% rename from eslint/babel-eslint-parser/test/specs/integration.js rename to eslint/babel-eslint-parser/test/integration.js index d13a5aa3ff97..8503bd582607 100644 --- a/eslint/babel-eslint-parser/test/specs/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -1,16 +1,15 @@ "use strict"; -const assert = require("assert"); const eslint = require("eslint"); const fs = require("fs"); const path = require("path"); -const parser = require("../.."); +const parser = require("../"); eslint.linter.defineParser("current-babel-eslint", parser); const paths = { - fixtures: path.join(__dirname, "..", "fixtures", "rules"), + fixtures: path.join(__dirname, "fixtures", "rules"), }; const encoding = "utf8"; @@ -71,7 +70,7 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(report[0].ruleId === ruleId); + expect(report[0].ruleId).toBe(ruleId); done(); } ); @@ -95,7 +94,7 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(!report.length); + expect(report.length).toBe(0); done(); } ); @@ -111,7 +110,7 @@ function strictSuite() { (err, report) => { if (err) return done(err); [0, 1].forEach(i => { - assert(report[i].ruleId === ruleId); + expect(report[0].ruleId).toBe(ruleId); }); done(); } @@ -127,13 +126,12 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(report[0].ruleId === ruleId); - + expect(report[0].ruleId).toBe(ruleId); // This is to make sure the test fails prior to adapting Babel AST // directive representation to ESLint format. Otherwise it reports an // error for missing global directive that masquerades as the expected // result of the previous assertion. - assert(report[0].nodeType !== "Program"); + expect(report[0].nodeType).not.toBe("Program"); done(); } ); @@ -148,7 +146,7 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(report[0].ruleId === ruleId); + expect(report[0].ruleId).toBe(ruleId); done(); } ); @@ -171,7 +169,7 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(!report.length); + expect(report.length).toBe(0); done(); } ); @@ -187,7 +185,7 @@ function strictSuite() { (err, report) => { if (err) return done(err); [0, 1].forEach(i => { - assert(report[i].ruleId === ruleId); + expect(report[i].ruleId).toBe(ruleId); }); done(); } @@ -203,7 +201,7 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(report[0].ruleId === ruleId); + expect(report[0].ruleId).toBe(ruleId); done(); } ); @@ -218,8 +216,8 @@ function strictSuite() { }, (err, report) => { if (err) return done(err); - assert(report[0].ruleId === ruleId); - assert(report[0].nodeType.indexOf("Function") === -1); + expect(report[0].ruleId).toBe(ruleId); + expect(report[0].nodeType.indexOf("Function")).toBe(-1); done(); } ); @@ -231,10 +229,10 @@ function strictSuite() { describe("https://github.com/babel/babel-eslint/issues/558", () => { it("doesn't crash with eslint-plugin-import", () => { const engine = new eslint.CLIEngine({ ignore: false }); - engine.executeOnFiles([ - "fixtures/eslint-plugin-import/a.js", - "fixtures/eslint-plugin-import/b.js", - "fixtures/eslint-plugin-import/c.js", - ]); + const files = ['a.js', 'b.js', 'c.js']; + let fileWithPath = files.map(file => + path.resolve(__dirname, `./fixtures/eslint-plugin-import/${file}`)); + engine.executeOnFiles(fileWithPath); }); }); + diff --git a/eslint/babel-eslint-parser/test/specs/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js similarity index 99% rename from eslint/babel-eslint-parser/test/specs/non-regression.js rename to eslint/babel-eslint-parser/test/non-regression.js index 58d7056c42c5..c4add4ab08dd 100644 --- a/eslint/babel-eslint-parser/test/specs/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -4,7 +4,7 @@ const eslint = require("eslint"); const path = require("path"); const unpad = require("dedent"); -const parser = require("../.."); +const parser = require("../"); function verifyAndAssertMessagesWithSpecificESLint( code, @@ -26,7 +26,13 @@ function verifyAndAssertMessagesWithSpecificESLint( ecmaFeatures: { globalReturn: true, }, - }, + babelOptions: { + configFile: path.resolve( + __dirname, + "./fixtures/config/babel.config.js" + ), + }, + } }; if (overrideConfig) { @@ -1162,7 +1168,7 @@ describe("verify", () => { babelOptions: { configFile: path.resolve( __dirname, - "../fixtures/config/babel.config.decorators-legacy.js" + "./fixtures/config/babel.config.decorators-legacy.js" ), }, }, diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 96199d9cbd21..1cb2805898cf 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -14,12 +14,8 @@ "url": "https://github.com/nicolo-ribaudo" }, "main": "src/index.js", - "scripts": { - "test": "mocha tests --recursive" - }, "devDependencies": { - "eslint": "^5.9.0", - "mocha": "^5.2.0" + "eslint": "^5.9.0" }, "engines": { "node": ">=8.0.0" diff --git a/eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js similarity index 100% rename from eslint/babel-eslint-plugin-development/tests/rules/no-deprecated-clone.js rename to eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js diff --git a/eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js similarity index 100% rename from eslint/babel-eslint-plugin-development/tests/rules/no-undefined-identifier.js rename to eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js diff --git a/eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/test/rules/plugin-name.js similarity index 100% rename from eslint/babel-eslint-plugin-development/tests/rules/plugin-name.js rename to eslint/babel-eslint-plugin-development/test/rules/plugin-name.js diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 32b7d09e1caf..b4780d73d619 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -3,9 +3,6 @@ "version": "5.3.0", "description": "an eslint rule plugin companion to babel-eslint", "main": "index.js", - "scripts": { - "test": "mocha ./tests/rules/*.js" - }, "repository": { "type": "git", "url": "git+https://github.com/babel/eslint-plugin-babel.git" @@ -36,7 +33,6 @@ "devDependencies": { "babel-eslint": "^8.2.2", "eslint": "^4.19.1", - "lodash.clonedeep": "^4.5.0", - "mocha": "^5.2.0" + "lodash.clonedeep": "^4.5.0" } } diff --git a/eslint/babel-eslint-plugin/tests/RuleTester.js b/eslint/babel-eslint-plugin/test/helpers/RuleTester.js similarity index 100% rename from eslint/babel-eslint-plugin/tests/RuleTester.js rename to eslint/babel-eslint-plugin/test/helpers/RuleTester.js diff --git a/eslint/babel-eslint-plugin/tests/rules/camelcase.js b/eslint/babel-eslint-plugin/test/rules/camelcase.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/camelcase.js rename to eslint/babel-eslint-plugin/test/rules/camelcase.js index 0344018515b8..af399b413377 100644 --- a/eslint/babel-eslint-plugin/tests/rules/camelcase.js +++ b/eslint/babel-eslint-plugin/test/rules/camelcase.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const rule = require("../../rules/camelcase"), - RuleTester = require("../RuleTester"); + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Tests diff --git a/eslint/babel-eslint-plugin/tests/rules/new-cap.js b/eslint/babel-eslint-plugin/test/rules/new-cap.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/new-cap.js rename to eslint/babel-eslint-plugin/test/rules/new-cap.js index c37f2e9f06a9..225867e597a1 100644 --- a/eslint/babel-eslint-plugin/tests/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/test/rules/new-cap.js @@ -4,7 +4,7 @@ */ var rule = require('../../rules/new-cap'), - RuleTester = require('../RuleTester'); + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); ruleTester.run('babel/new-cap', rule, { diff --git a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js rename to eslint/babel-eslint-plugin/test/rules/no-invalid-this.js index e28c77aa5e07..b4c385b466d7 100644 --- a/eslint/babel-eslint-plugin/tests/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js @@ -10,8 +10,8 @@ //------------------------------------------------------------------------------ const cloneDeep = require("lodash.clonedeep"); -const rule = require("../../rules/no-invalid-this"); -const RuleTester = require("../RuleTester"); +const rule = require("../../rules/no-invalid-this"), + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Helpers diff --git a/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js rename to eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js index 8ecbf68f2622..b7d4ca6e7bf7 100644 --- a/eslint/babel-eslint-plugin/tests/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const rule = require("../../rules/no-unused-expressions"), - RuleTester = require("../RuleTester"); + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Tests diff --git a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js rename to eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js index a982ba5d3954..cf5315102d25 100644 --- a/eslint/babel-eslint-plugin/tests/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js @@ -7,7 +7,7 @@ */ var rule = require('../../rules/object-curly-spacing'), - RuleTester = require('../RuleTester'); + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); ruleTester.run('babel/object-curly-spacing', rule, { diff --git a/eslint/babel-eslint-plugin/tests/rules/quotes.js b/eslint/babel-eslint-plugin/test/rules/quotes.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/quotes.js rename to eslint/babel-eslint-plugin/test/rules/quotes.js index 96b93e674a57..17fde24b6cd3 100644 --- a/eslint/babel-eslint-plugin/tests/rules/quotes.js +++ b/eslint/babel-eslint-plugin/test/rules/quotes.js @@ -1,5 +1,5 @@ var rule = require('../../rules/quotes'), - RuleTester = require('../RuleTester'); + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); ruleTester.run('babel/quotes', rule, { diff --git a/eslint/babel-eslint-plugin/tests/rules/semi.js b/eslint/babel-eslint-plugin/test/rules/semi.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/semi.js rename to eslint/babel-eslint-plugin/test/rules/semi.js index 15ebea037ff6..b76ef6e2e031 100644 --- a/eslint/babel-eslint-plugin/tests/rules/semi.js +++ b/eslint/babel-eslint-plugin/test/rules/semi.js @@ -11,7 +11,7 @@ //------------------------------------------------------------------------------ const rule = require("../../rules/semi"), - RuleTester = require("../RuleTester"); + RuleTester = require("../helpers/RuleTester"); const ruleTester = new RuleTester(); diff --git a/eslint/babel-eslint-plugin/tests/rules/valid-typeof.js b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js similarity index 99% rename from eslint/babel-eslint-plugin/tests/rules/valid-typeof.js rename to eslint/babel-eslint-plugin/test/rules/valid-typeof.js index 8e474f6bb123..6b8bc7c54c82 100644 --- a/eslint/babel-eslint-plugin/tests/rules/valid-typeof.js +++ b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js @@ -10,7 +10,7 @@ //------------------------------------------------------------------------------ const rule = require("../../rules/valid-typeof"), - RuleTester = require("../RuleTester"); + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Tests diff --git a/package.json b/package.json index a601cabc9e8c..7157e3d57f25 100644 --- a/package.json +++ b/package.json @@ -95,9 +95,11 @@ "packages/*/src/**/*.mjs", "packages/*/src/**/*.js", "codemods/*/src/**/*.mjs", - "codemods/*/src/**/*.js" + "codemods/*/src/**/*.js", + "eslint/*/src/**/*.mjs", + "eslint/*/src/**/*.js" ], - "testRegex": "./(packages|codemods)/[^/]+/test/.+\\.m?js$", + "testRegex": "./(packages|codemods|eslint)/[^/]+/test/.+\\.m?js$", "testPathIgnorePatterns": [ "/node_modules/", "/test/fixtures/", diff --git a/scripts/test.sh b/scripts/test.sh index f9c9e384e2e1..b14189e28a70 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -20,7 +20,7 @@ if [ -n "$TEST_GREP" ]; then fi if [ -n "$TEST_ONLY" ]; then - jestArgs+=("(packages|codemods)/.*$TEST_ONLY.*/test") + jestArgs+=("(packages|codemods|eslint)/.*$TEST_ONLY.*/test") fi $node node_modules/jest/bin/jest.js "${jestArgs[@]}" From c37361ba2ed916346a4104d30dd4b611e720791a Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Sat, 16 Nov 2019 09:05:40 -0600 Subject: [PATCH 801/965] Bump prettier@1.19.1 (#10728) --- package.json | 2 +- packages/babel-core/src/index.js | 4 +- packages/babel-core/test/option-manager.js | 25 ++++++-- .../babel-generator/src/generators/types.js | 6 +- packages/babel-generator/src/index.js | 3 +- .../src/index.js | 3 +- packages/babel-node/src/babel-node.js | 5 +- .../src/rest.js | 42 +++++++------ .../src/index.js | 3 +- packages/babel-types/src/index.js | 62 +++++-------------- yarn.lock | 8 +-- 11 files changed, 77 insertions(+), 86 deletions(-) diff --git a/package.json b/package.json index 7157e3d57f25..15ad863a8f59 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "lint-staged": "^9.2.0", "lodash": "^4.17.13", "output-file-sync": "^2.0.0", - "prettier": "^1.17.1", + "prettier": "^1.19.1", "pump": "^3.0.0", "rimraf": "^2.6.3", "rollup": "^1.12.0", diff --git a/packages/babel-core/src/index.js b/packages/babel-core/src/index.js index e7ae7c0edfc6..888a8096d5cc 100644 --- a/packages/babel-core/src/index.js +++ b/packages/babel-core/src/index.js @@ -1,9 +1,7 @@ // @flow export { default as File } from "./transformation/file/file"; -export { - default as buildExternalHelpers, -} from "./tools/build-external-helpers"; +export { default as buildExternalHelpers } from "./tools/build-external-helpers"; export { resolvePlugin, resolvePreset } from "./config/files"; export { version } from "../package.json"; diff --git a/packages/babel-core/test/option-manager.js b/packages/babel-core/test/option-manager.js index 8839f1178c3a..5533d54c46d1 100644 --- a/packages/babel-core/test/option-manager.js +++ b/packages/babel-core/test/option-manager.js @@ -59,7 +59,10 @@ describe("option-manager", () => { const { calls: calls2, plugin: plugin2 } = makePlugin(); loadOptions({ - plugins: [[plugin1, { arg: 1 }], [plugin2, { arg: 2 }, "some-name"]], + plugins: [ + [plugin1, { arg: 1 }], + [plugin2, { arg: 2 }, "some-name"], + ], }); expect(calls1).toEqual([{ arg: 1 }]); expect(calls2).toEqual([{ arg: 2 }]); @@ -74,7 +77,10 @@ describe("option-manager", () => { plugins: [[plugin1, { arg: 1 }]], env: { test: { - plugins: [[plugin1, { arg: 3 }], [plugin2, { arg: 2 }]], + plugins: [ + [plugin1, { arg: 3 }], + [plugin2, { arg: 2 }], + ], }, }, }); @@ -98,7 +104,10 @@ describe("option-manager", () => { const { calls: calls2, plugin: preset2 } = makePlugin(); loadOptions({ - presets: [[preset1, { arg: 1 }], [preset2, { arg: 2 }, "some-name"]], + presets: [ + [preset1, { arg: 1 }], + [preset2, { arg: 2 }, "some-name"], + ], }); expect(calls1).toEqual([{ arg: 1 }]); expect(calls2).toEqual([{ arg: 2 }]); @@ -112,7 +121,10 @@ describe("option-manager", () => { presets: [[preset1, { arg: 1 }]], env: { test: { - presets: [[preset1, { arg: 3 }], [preset2, { arg: 2 }]], + presets: [ + [preset1, { arg: 3 }], + [preset2, { arg: 2 }], + ], }, }, }); @@ -130,7 +142,10 @@ describe("option-manager", () => { presets: [[preset1, { arg: 1 }]], env: { test: { - presets: [[preset1, { arg: 3 }], [preset2, { arg: 2 }]], + presets: [ + [preset1, { arg: 3 }], + [preset2, { arg: 2 }], + ], }, }, }); diff --git a/packages/babel-generator/src/generators/types.js b/packages/babel-generator/src/generators/types.js index fdd090dd4113..fbad28e03b30 100644 --- a/packages/babel-generator/src/generators/types.js +++ b/packages/babel-generator/src/generators/types.js @@ -65,9 +65,9 @@ export function ObjectProperty(node: Object) { // shorthand! if ( node.shorthand && - (t.isIdentifier(node.key) && - t.isIdentifier(node.value) && - node.key.name === node.value.name) + t.isIdentifier(node.key) && + t.isIdentifier(node.value) && + node.key.name === node.value.name ) { return; } diff --git a/packages/babel-generator/src/index.js b/packages/babel-generator/src/index.js index 4e7399d4bb47..9d288fb0f3cf 100644 --- a/packages/babel-generator/src/index.js +++ b/packages/babel-generator/src/index.js @@ -70,7 +70,8 @@ function normalizeOptions(code, opts): Format { format.shouldPrintComment || (value => format.comments || - (value.indexOf("@license") >= 0 || value.indexOf("@preserve") >= 0)); + value.indexOf("@license") >= 0 || + value.indexOf("@preserve") >= 0); } if (format.compact === "auto") { diff --git a/packages/babel-helper-create-class-features-plugin/src/index.js b/packages/babel-helper-create-class-features-plugin/src/index.js index 1ed61a1839c0..57add480d286 100644 --- a/packages/babel-helper-create-class-features-plugin/src/index.js +++ b/packages/babel-helper-create-class-features-plugin/src/index.js @@ -97,7 +97,8 @@ export function createClassFeaturePlugin({ } else { if ( (privateNames.has(name) && - (!privateNames.has(getName) && !privateNames.has(setName))) || + !privateNames.has(getName) && + !privateNames.has(setName)) || (privateNames.has(name) && (privateNames.has(getName) || privateNames.has(setName))) ) { diff --git a/packages/babel-node/src/babel-node.js b/packages/babel-node/src/babel-node.js index 6d6001f96c7e..4f0a7be101a8 100755 --- a/packages/babel-node/src/babel-node.js +++ b/packages/babel-node/src/babel-node.js @@ -40,7 +40,10 @@ function getNormalizedV8Flag(arg) { } // These are aliases for node options defined by babel-node. -const aliases = new Map([["-d", "--debug"], ["-gc", "--expose-gc"]]); +const aliases = new Map([ + ["-d", "--debug"], + ["-gc", "--expose-gc"], +]); getV8Flags(function(err, v8Flags) { for (let i = 0; i < babelArgs.length; i++) { diff --git a/packages/babel-plugin-transform-parameters/src/rest.js b/packages/babel-plugin-transform-parameters/src/rest.js index da85c7e5ad95..eccd548aec4c 100644 --- a/packages/babel-plugin-transform-parameters/src/rest.js +++ b/packages/babel-plugin-transform-parameters/src/rest.js @@ -87,26 +87,28 @@ const memberExpressionOptimisationVisitor = { const argsOptEligible = !state.deopted && - !// ex: `args[0] = "whatever"` - ( - (grandparentPath.isAssignmentExpression() && - parentPath.node === grandparentPath.node.left) || - // ex: `[args[0]] = ["whatever"]` - grandparentPath.isLVal() || - // ex: `for (rest[0] in this)` - // ex: `for (rest[0] of this)` - grandparentPath.isForXStatement() || - // ex: `++args[0]` - // ex: `args[0]--` - grandparentPath.isUpdateExpression() || - // ex: `delete args[0]` - grandparentPath.isUnaryExpression({ operator: "delete" }) || - // ex: `args[0]()` - // ex: `new args[0]()` - // ex: `new args[0]` - ((grandparentPath.isCallExpression() || - grandparentPath.isNewExpression()) && - parentPath.node === grandparentPath.node.callee) + !( + // ex: `args[0] = "whatever"` + ( + (grandparentPath.isAssignmentExpression() && + parentPath.node === grandparentPath.node.left) || + // ex: `[args[0]] = ["whatever"]` + grandparentPath.isLVal() || + // ex: `for (rest[0] in this)` + // ex: `for (rest[0] of this)` + grandparentPath.isForXStatement() || + // ex: `++args[0]` + // ex: `args[0]--` + grandparentPath.isUpdateExpression() || + // ex: `delete args[0]` + grandparentPath.isUnaryExpression({ operator: "delete" }) || + // ex: `args[0]()` + // ex: `new args[0]()` + // ex: `new args[0]` + ((grandparentPath.isCallExpression() || + grandparentPath.isNewExpression()) && + parentPath.node === grandparentPath.node.callee) + ) ); if (argsOptEligible) { diff --git a/packages/babel-plugin-transform-react-constant-elements/src/index.js b/packages/babel-plugin-transform-react-constant-elements/src/index.js index 15589bd808f0..48d5e2bbc708 100644 --- a/packages/babel-plugin-transform-react-constant-elements/src/index.js +++ b/packages/babel-plugin-transform-react-constant-elements/src/index.js @@ -59,7 +59,8 @@ export default declare((api, options) => { const { value } = expressionResult; const isMutable = (!state.mutablePropsAllowed && - (value && typeof value === "object")) || + value && + typeof value === "object") || typeof value === "function"; if (!isMutable) { // It evaluated to an immutable value, so we can hoist it. diff --git a/packages/babel-types/src/index.js b/packages/babel-types/src/index.js index d3311dfc9f2f..51fd0b9846ff 100644 --- a/packages/babel-types/src/index.js +++ b/packages/babel-types/src/index.js @@ -7,13 +7,9 @@ import buildChildren from "./builders/react/buildChildren"; export { default as assertNode } from "./asserts/assertNode"; export * from "./asserts/generated"; -//builders -export { - default as createTypeAnnotationBasedOnTypeof, -} from "./builders/flow/createTypeAnnotationBasedOnTypeof"; -export { - default as createUnionTypeAnnotation, -} from "./builders/flow/createUnionTypeAnnotation"; +// builders +export { default as createTypeAnnotationBasedOnTypeof } from "./builders/flow/createTypeAnnotationBasedOnTypeof"; +export { default as createUnionTypeAnnotation } from "./builders/flow/createUnionTypeAnnotation"; export * from "./builders/generated"; // clone @@ -25,16 +21,10 @@ export { default as cloneWithoutLoc } from "./clone/cloneWithoutLoc"; // comments export { default as addComment } from "./comments/addComment"; export { default as addComments } from "./comments/addComments"; -export { - default as inheritInnerComments, -} from "./comments/inheritInnerComments"; -export { - default as inheritLeadingComments, -} from "./comments/inheritLeadingComments"; +export { default as inheritInnerComments } from "./comments/inheritInnerComments"; +export { default as inheritLeadingComments } from "./comments/inheritLeadingComments"; export { default as inheritsComments } from "./comments/inheritsComments"; -export { - default as inheritTrailingComments, -} from "./comments/inheritTrailingComments"; +export { default as inheritTrailingComments } from "./comments/inheritTrailingComments"; export { default as removeComments } from "./comments/removeComments"; // constants @@ -43,17 +33,13 @@ export * from "./constants"; // converters export { default as ensureBlock } from "./converters/ensureBlock"; -export { - default as toBindingIdentifierName, -} from "./converters/toBindingIdentifierName"; +export { default as toBindingIdentifierName } from "./converters/toBindingIdentifierName"; export { default as toBlock } from "./converters/toBlock"; export { default as toComputedKey } from "./converters/toComputedKey"; export { default as toExpression } from "./converters/toExpression"; export { default as toIdentifier } from "./converters/toIdentifier"; export { default as toKeyAlias } from "./converters/toKeyAlias"; -export { - default as toSequenceExpression, -} from "./converters/toSequenceExpression"; +export { default as toSequenceExpression } from "./converters/toSequenceExpression"; export { default as toStatement } from "./converters/toStatement"; export { default as valueToNode } from "./converters/valueToNode"; @@ -61,28 +47,16 @@ export { default as valueToNode } from "./converters/valueToNode"; export * from "./definitions"; // modifications -export { - default as appendToMemberExpression, -} from "./modifications/appendToMemberExpression"; +export { default as appendToMemberExpression } from "./modifications/appendToMemberExpression"; export { default as inherits } from "./modifications/inherits"; -export { - default as prependToMemberExpression, -} from "./modifications/prependToMemberExpression"; +export { default as prependToMemberExpression } from "./modifications/prependToMemberExpression"; export { default as removeProperties } from "./modifications/removeProperties"; -export { - default as removePropertiesDeep, -} from "./modifications/removePropertiesDeep"; -export { - default as removeTypeDuplicates, -} from "./modifications/flow/removeTypeDuplicates"; +export { default as removePropertiesDeep } from "./modifications/removePropertiesDeep"; +export { default as removeTypeDuplicates } from "./modifications/flow/removeTypeDuplicates"; // retrievers -export { - default as getBindingIdentifiers, -} from "./retrievers/getBindingIdentifiers"; -export { - default as getOuterBindingIdentifiers, -} from "./retrievers/getOuterBindingIdentifiers"; +export { default as getBindingIdentifiers } from "./retrievers/getBindingIdentifiers"; +export { default as getOuterBindingIdentifiers } from "./retrievers/getOuterBindingIdentifiers"; // traverse export { default as traverse } from "./traverse/traverse"; @@ -105,16 +79,12 @@ export { default as isReferenced } from "./validators/isReferenced"; export { default as isScope } from "./validators/isScope"; export { default as isSpecifierDefault } from "./validators/isSpecifierDefault"; export { default as isType } from "./validators/isType"; -export { - default as isValidES3Identifier, -} from "./validators/isValidES3Identifier"; +export { default as isValidES3Identifier } from "./validators/isValidES3Identifier"; export { default as isValidIdentifier } from "./validators/isValidIdentifier"; export { default as isVar } from "./validators/isVar"; export { default as matchesPattern } from "./validators/matchesPattern"; export { default as validate } from "./validators/validate"; -export { - default as buildMatchMemberExpression, -} from "./validators/buildMatchMemberExpression"; +export { default as buildMatchMemberExpression } from "./validators/buildMatchMemberExpression"; export * from "./validators/generated"; // react diff --git a/yarn.lock b/yarn.lock index 95eb973a33d3..4f3e1d56040f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8724,10 +8724,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^1.17.1: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== +prettier@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== pretty-format@^24.9.0: version "24.9.0" From 401c9bbe83292a139a91f99eff3ac5ebb0c71bbc Mon Sep 17 00:00:00 2001 From: Kai Cataldo <7041728+kaicataldo@users.noreply.github.com> Date: Sat, 16 Nov 2019 17:28:02 -0500 Subject: [PATCH 802/965] Update ESLint/Prettier config for eslint/* packages (#10724) --- .eslintignore | 1 + .eslintrc.js | 7 ++++- .prettierrc | 6 +++-- eslint/babel-eslint-parser/.eslintignore | 2 -- eslint/babel-eslint-parser/.eslintrc.js | 26 ------------------- .../babel-eslint-parser/src/analyze-scope.js | 6 ++--- eslint/babel-eslint-parser/src/index.js | 4 +-- eslint/babel-eslint-parser/src/parse.js | 2 +- .../babel-eslint-parser/src/visitor-keys.js | 4 +-- .../src/rules/no-undefined-identifier.js | 2 +- .../src/rules/plugin-name.js | 2 +- .../src/utils/is-from-babel-types.js | 2 +- 12 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 eslint/babel-eslint-parser/.eslintignore delete mode 100644 eslint/babel-eslint-parser/.eslintrc.js diff --git a/.eslintignore b/.eslintignore index ab694692690c..4f633742561e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -25,6 +25,7 @@ packages/babel-standalone/babel.js packages/babel-standalone/babel.min.js packages/babel-parser/test/expressions +eslint/*/lib eslint/*/node_modules eslint/*/test eslint/*/tests diff --git a/.eslintrc.js b/.eslintrc.js index df340d2700c0..b1ca90ef1f7d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,11 @@ module.exports = { }, overrides: [ { - files: ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"], + files: [ + "packages/*/src/**/*.js", + "codemods/*/src/**/*.js", + "eslint/*/src/**/*.js", + ], rules: { "@babel/development/no-undefined-identifier": "error", "@babel/development/no-deprecated-clone": "error", @@ -24,6 +28,7 @@ module.exports = { files: [ "packages/*/test/**/*.js", "codemods/*/test/**/*.js", + "eslint/*/test/**/*.js", "packages/babel-helper-transform-fixture-test-runner/src/helpers.js", "test/**/*.js", ], diff --git a/.prettierrc b/.prettierrc index 5c53b22f8ab7..bfe4721c3432 100644 --- a/.prettierrc +++ b/.prettierrc @@ -13,10 +13,12 @@ "**/codemods/*/src/**/*.js", "**/codemods/*/test/**/*.js", "**/packages/*/src/**/*.js", - "**/packages/*/test/**/*.js" + "**/packages/*/test/**/*.js", + "**/eslint/*/src/**/*.js", + "**/eslint/*/test/**/*.js" ], - "parser": "babylon", "options": { + "parser": "babel", "trailingComma": "all" } }] diff --git a/eslint/babel-eslint-parser/.eslintignore b/eslint/babel-eslint-parser/.eslintignore deleted file mode 100644 index b18b9022cf17..000000000000 --- a/eslint/babel-eslint-parser/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -!.*.js -test/fixtures diff --git a/eslint/babel-eslint-parser/.eslintrc.js b/eslint/babel-eslint-parser/.eslintrc.js deleted file mode 100644 index a8781be62911..000000000000 --- a/eslint/babel-eslint-parser/.eslintrc.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -module.exports = { - root: true, - extends: "babel", - plugins: ["prettier"], - rules: { - "max-len": "off", - strict: "error", - "prettier/prettier": "error", - }, - env: { - node: true, - }, - parserOptions: { - sourceType: "script", - }, - overrides: [ - { - files: ["test/**/*"], - env: { - mocha: true, - }, - }, - ], -}; diff --git a/eslint/babel-eslint-parser/src/analyze-scope.js b/eslint/babel-eslint-parser/src/analyze-scope.js index 38561521d3f8..a388a45366fa 100644 --- a/eslint/babel-eslint-parser/src/analyze-scope.js +++ b/eslint/babel-eslint-parser/src/analyze-scope.js @@ -94,7 +94,7 @@ class Referencer extends OriginalReferencer { // Flow super types. this._visitTypeAnnotation(node.implements); this._visitTypeAnnotation( - node.superTypeParameters && node.superTypeParameters.params + node.superTypeParameters && node.superTypeParameters.params, ); // Basic. @@ -205,7 +205,7 @@ class Referencer extends OriginalReferencer { _createScopeVariable(node, name) { this.currentScope().variableScope.__define( name, - new Definition("Variable", name, node, null, null, null) + new Definition("Variable", name, node, null, null, null), ); } @@ -220,7 +220,7 @@ class Referencer extends OriginalReferencer { "type-parameters", parentScope, node, - false + false, ); this.scopeManager.__nestScope(scope); diff --git a/eslint/babel-eslint-parser/src/index.js b/eslint/babel-eslint-parser/src/index.js index 2769d4a0c09a..c5c597017eb7 100644 --- a/eslint/babel-eslint-parser/src/index.js +++ b/eslint/babel-eslint-parser/src/index.js @@ -9,7 +9,7 @@ const SUPPORTED_BABEL_VERSION_RANGE = packageJson.peerDependencies["@babel/core"]; const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies( CURRENT_BABEL_VERSION, - SUPPORTED_BABEL_VERSION_RANGE + SUPPORTED_BABEL_VERSION_RANGE, ); exports.parse = function(code, options) { @@ -19,7 +19,7 @@ exports.parse = function(code, options) { exports.parseForESLint = function(code, options = {}) { if (!IS_RUNNING_SUPPORTED_VERSION) { throw new Error( - `babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}` + `babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}`, ); } diff --git a/eslint/babel-eslint-parser/src/parse.js b/eslint/babel-eslint-parser/src/parse.js index 3930bb04057d..5ae4db7e30ec 100644 --- a/eslint/babel-eslint-parser/src/parse.js +++ b/eslint/babel-eslint-parser/src/parse.js @@ -46,7 +46,7 @@ module.exports = function(code, options) { if (config !== null) { if (!config.hasFilesystemConfig()) { throw new Error( - `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.` + `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`, ); } diff --git a/eslint/babel-eslint-parser/src/visitor-keys.js b/eslint/babel-eslint-parser/src/visitor-keys.js index 2ac01887f14c..236cf0a782e9 100644 --- a/eslint/babel-eslint-parser/src/visitor-keys.js +++ b/eslint/babel-eslint-parser/src/visitor-keys.js @@ -7,9 +7,9 @@ module.exports = Object.assign( { Literal: ESLINT_VISITOR_KEYS.Literal, MethodDefinition: ["decorators"].concat( - ESLINT_VISITOR_KEYS.MethodDefinition + ESLINT_VISITOR_KEYS.MethodDefinition, ), Property: ["decorators"].concat(ESLINT_VISITOR_KEYS.Property), }, - BABEL_VISITOR_KEYS + BABEL_VISITOR_KEYS, ); diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js index 7a433b160c75..c1b4b8a99382 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js @@ -32,7 +32,7 @@ module.exports = { ) { context.report( node, - "Use path.scope.buildUndefinedNode() to create an undefined identifier directly." + "Use path.scope.buildUndefinedNode() to create an undefined identifier directly.", ); } }, diff --git a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js index 11dd02808a31..58a4bc9f6337 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js +++ b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js @@ -44,7 +44,7 @@ module.exports = { if (!returnValue.properties.some(p => p.key.name === "name")) { context.report( returnValue, - "This Babel plugin doesn't have a 'name' property." + "This Babel plugin doesn't have a 'name' property.", ); } } diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js index 304561621732..36ab618817d6 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js +++ b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js @@ -6,7 +6,7 @@ const isBabelPluginFactory = require("./is-babel-plugin-factory"); // is a reference to a @babel/types export. module.exports = function isFromBabelTypes( origin /*: ReferenceOrigin */, - scope /*: Scope */ + scope /*: Scope */, ) { if (origin.kind === "import" && origin.source === "@babel/types") { // imported from @babel/types From 53a3dac011dbc20808cafcd17bab5076dacf3628 Mon Sep 17 00:00:00 2001 From: Kai Cataldo <7041728+kaicataldo@users.noreply.github.com> Date: Sun, 17 Nov 2019 05:01:10 -0500 Subject: [PATCH 803/965] Clean up eslint/* directories (#10729) --- .../babel-eslint-config-internal/.npmignore | 4 + eslint/babel-eslint-parser/.gitignore | 2 - eslint/babel-eslint-parser/.npmignore | 4 + eslint/babel-eslint-parser/.npmrc | 1 - eslint/babel-eslint-parser/.travis.yml | 16 - eslint/babel-eslint-parser/Makefile | 7 - eslint/babel-eslint-parser/package.json | 3 - .../.npmignore | 6 +- .../package.json | 2 +- eslint/babel-eslint-plugin/.npmignore | 4 + eslint/babel-eslint-plugin/.travis.yml | 9 - eslint/babel-eslint-plugin/package.json | 2 +- eslint/babel-eslint-plugin/{ => src}/index.js | 0 .../{ => src}/rules/array-bracket-spacing.js | 0 .../{ => src}/rules/arrow-parens.js | 0 .../{ => src}/rules/camelcase.js | 0 .../{ => src}/rules/flow-object-type.js | 0 .../rules/func-params-comma-dangle.js | 0 .../{ => src}/rules/generator-star-spacing.js | 0 .../{ => src}/rules/new-cap.js | 0 .../{ => src}/rules/no-await-in-loop.js | 0 .../{ => src}/rules/no-invalid-this.js | 0 .../{ => src}/rules/no-unused-expressions.js | 0 .../{ => src}/rules/object-curly-spacing.js | 0 .../{ => src}/rules/object-shorthand.js | 0 .../{ => src}/rules/quotes.js | 0 .../{ => src}/rules/semi.js | 0 .../{ => src}/rules/valid-typeof.js | 0 .../test/rules/camelcase.js | 340 +-- .../babel-eslint-plugin/test/rules/new-cap.js | 413 ++-- .../test/rules/no-invalid-this.js | 1155 +++++----- .../test/rules/no-unused-expressions.js | 462 +++- .../test/rules/object-curly-spacing.js | 1883 ++++++++++------- .../babel-eslint-plugin/test/rules/quotes.js | 773 ++++--- eslint/babel-eslint-plugin/test/rules/semi.js | 859 ++++++-- .../test/rules/valid-typeof.js | 407 ++-- 36 files changed, 3898 insertions(+), 2454 deletions(-) create mode 100644 eslint/babel-eslint-config-internal/.npmignore delete mode 100644 eslint/babel-eslint-parser/.gitignore create mode 100644 eslint/babel-eslint-parser/.npmignore delete mode 100644 eslint/babel-eslint-parser/.npmrc delete mode 100644 eslint/babel-eslint-parser/.travis.yml delete mode 100644 eslint/babel-eslint-parser/Makefile create mode 100644 eslint/babel-eslint-plugin/.npmignore delete mode 100644 eslint/babel-eslint-plugin/.travis.yml rename eslint/babel-eslint-plugin/{ => src}/index.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/array-bracket-spacing.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/arrow-parens.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/camelcase.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/flow-object-type.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/func-params-comma-dangle.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/generator-star-spacing.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/new-cap.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/no-await-in-loop.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/no-invalid-this.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/no-unused-expressions.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/object-curly-spacing.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/object-shorthand.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/quotes.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/semi.js (100%) rename eslint/babel-eslint-plugin/{ => src}/rules/valid-typeof.js (100%) diff --git a/eslint/babel-eslint-config-internal/.npmignore b/eslint/babel-eslint-config-internal/.npmignore new file mode 100644 index 000000000000..ad69326ce8c2 --- /dev/null +++ b/eslint/babel-eslint-config-internal/.npmignore @@ -0,0 +1,4 @@ +src +test +.* +*.log diff --git a/eslint/babel-eslint-parser/.gitignore b/eslint/babel-eslint-parser/.gitignore deleted file mode 100644 index 93f136199161..000000000000 --- a/eslint/babel-eslint-parser/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -npm-debug.log diff --git a/eslint/babel-eslint-parser/.npmignore b/eslint/babel-eslint-parser/.npmignore new file mode 100644 index 000000000000..c3aafe7a7721 --- /dev/null +++ b/eslint/babel-eslint-parser/.npmignore @@ -0,0 +1,4 @@ +src +test +.* +*.log \ No newline at end of file diff --git a/eslint/babel-eslint-parser/.npmrc b/eslint/babel-eslint-parser/.npmrc deleted file mode 100644 index c1ca392feaa4..000000000000 --- a/eslint/babel-eslint-parser/.npmrc +++ /dev/null @@ -1 +0,0 @@ -package-lock = false diff --git a/eslint/babel-eslint-parser/.travis.yml b/eslint/babel-eslint-parser/.travis.yml deleted file mode 100644 index 8ece2fc21261..000000000000 --- a/eslint/babel-eslint-parser/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -sudo: false -language: node_js -node_js: - - "12" - - "10" - - "8" - -matrix: - fast_finish: true - include: - - node_js: "node" - env: LINT=true - -script: - - 'if [ -n "${LINT-}" ]; then npm run lint ; fi' - - 'if [ -z "${LINT-}" ]; then npm test ; fi' diff --git a/eslint/babel-eslint-parser/Makefile b/eslint/babel-eslint-parser/Makefile deleted file mode 100644 index d35bcfa016e2..000000000000 --- a/eslint/babel-eslint-parser/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -.PHONY: publish-patch - -publish-patch: - ./node_modules/.bin/mocha - npm version patch - npm publish - git push --follow-tags diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 6cb74e76f24c..ebbcbdb79d26 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -20,9 +20,6 @@ "node": ">=6" }, "main": "lib/index.js", - "files": [ - "lib" - ], "peerDependencies": { "@babel/core": ">=7.2.0", "eslint": ">= 4.12.1" diff --git a/eslint/babel-eslint-plugin-development/.npmignore b/eslint/babel-eslint-plugin-development/.npmignore index 7810671790a7..c3aafe7a7721 100644 --- a/eslint/babel-eslint-plugin-development/.npmignore +++ b/eslint/babel-eslint-plugin-development/.npmignore @@ -1,2 +1,4 @@ -tests/ -.* \ No newline at end of file +src +test +.* +*.log \ No newline at end of file diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 1cb2805898cf..68d877ba3c71 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -13,7 +13,7 @@ "email": "nicolo.ribaudo@gmail.com", "url": "https://github.com/nicolo-ribaudo" }, - "main": "src/index.js", + "main": "lib/index.js", "devDependencies": { "eslint": "^5.9.0" }, diff --git a/eslint/babel-eslint-plugin/.npmignore b/eslint/babel-eslint-plugin/.npmignore new file mode 100644 index 000000000000..ad69326ce8c2 --- /dev/null +++ b/eslint/babel-eslint-plugin/.npmignore @@ -0,0 +1,4 @@ +src +test +.* +*.log diff --git a/eslint/babel-eslint-plugin/.travis.yml b/eslint/babel-eslint-plugin/.travis.yml deleted file mode 100644 index 068a0122c856..000000000000 --- a/eslint/babel-eslint-plugin/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -git: - depth: 1 -sudo: false -language: node_js -node_js: - - 6 - - 8 - - 10 diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index b4780d73d619..653ebcaf4387 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -2,7 +2,7 @@ "name": "eslint-plugin-babel", "version": "5.3.0", "description": "an eslint rule plugin companion to babel-eslint", - "main": "index.js", + "main": "lib/index.js", "repository": { "type": "git", "url": "git+https://github.com/babel/eslint-plugin-babel.git" diff --git a/eslint/babel-eslint-plugin/index.js b/eslint/babel-eslint-plugin/src/index.js similarity index 100% rename from eslint/babel-eslint-plugin/index.js rename to eslint/babel-eslint-plugin/src/index.js diff --git a/eslint/babel-eslint-plugin/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/array-bracket-spacing.js rename to eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js diff --git a/eslint/babel-eslint-plugin/rules/arrow-parens.js b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/arrow-parens.js rename to eslint/babel-eslint-plugin/src/rules/arrow-parens.js diff --git a/eslint/babel-eslint-plugin/rules/camelcase.js b/eslint/babel-eslint-plugin/src/rules/camelcase.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/camelcase.js rename to eslint/babel-eslint-plugin/src/rules/camelcase.js diff --git a/eslint/babel-eslint-plugin/rules/flow-object-type.js b/eslint/babel-eslint-plugin/src/rules/flow-object-type.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/flow-object-type.js rename to eslint/babel-eslint-plugin/src/rules/flow-object-type.js diff --git a/eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/func-params-comma-dangle.js rename to eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js diff --git a/eslint/babel-eslint-plugin/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/generator-star-spacing.js rename to eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js diff --git a/eslint/babel-eslint-plugin/rules/new-cap.js b/eslint/babel-eslint-plugin/src/rules/new-cap.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/new-cap.js rename to eslint/babel-eslint-plugin/src/rules/new-cap.js diff --git a/eslint/babel-eslint-plugin/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/no-await-in-loop.js rename to eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js diff --git a/eslint/babel-eslint-plugin/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/src/rules/no-invalid-this.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/no-invalid-this.js rename to eslint/babel-eslint-plugin/src/rules/no-invalid-this.js diff --git a/eslint/babel-eslint-plugin/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/no-unused-expressions.js rename to eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js diff --git a/eslint/babel-eslint-plugin/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/object-curly-spacing.js rename to eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js diff --git a/eslint/babel-eslint-plugin/rules/object-shorthand.js b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/object-shorthand.js rename to eslint/babel-eslint-plugin/src/rules/object-shorthand.js diff --git a/eslint/babel-eslint-plugin/rules/quotes.js b/eslint/babel-eslint-plugin/src/rules/quotes.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/quotes.js rename to eslint/babel-eslint-plugin/src/rules/quotes.js diff --git a/eslint/babel-eslint-plugin/rules/semi.js b/eslint/babel-eslint-plugin/src/rules/semi.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/semi.js rename to eslint/babel-eslint-plugin/src/rules/semi.js diff --git a/eslint/babel-eslint-plugin/rules/valid-typeof.js b/eslint/babel-eslint-plugin/src/rules/valid-typeof.js similarity index 100% rename from eslint/babel-eslint-plugin/rules/valid-typeof.js rename to eslint/babel-eslint-plugin/src/rules/valid-typeof.js diff --git a/eslint/babel-eslint-plugin/test/rules/camelcase.js b/eslint/babel-eslint-plugin/test/rules/camelcase.js index af399b413377..f6d1d9249be9 100644 --- a/eslint/babel-eslint-plugin/test/rules/camelcase.js +++ b/eslint/babel-eslint-plugin/test/rules/camelcase.js @@ -9,7 +9,7 @@ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../rules/camelcase"), +const rule = require("../../src/rules/camelcase"), RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ @@ -21,10 +21,10 @@ const ruleTester = new RuleTester(); ruleTester.run("camelcase", rule, { valid: [ // Original test cases. - "firstName = \"Nicholas\"", - "FIRST_NAME = \"Nicholas\"", - "__myPrivateVariable = \"Patrick\"", - "myPrivateVariable_ = \"Patrick\"", + 'firstName = "Nicholas"', + 'FIRST_NAME = "Nicholas"', + '__myPrivateVariable = "Patrick"', + 'myPrivateVariable_ = "Patrick"', "function doSomething(){}", "do_something()", "new do_something", @@ -42,175 +42,175 @@ ruleTester.run("camelcase", rule, { "if (foo.bar_baz === boom.bam_pow) { [foo.baz_boom] }", { code: "var o = {key: 1}", - options: [{ properties: "always" }] + options: [{ properties: "always" }], }, { code: "var o = {_leading: 1}", - options: [{ properties: "always" }] + options: [{ properties: "always" }], }, { code: "var o = {trailing_: 1}", - options: [{ properties: "always" }] + options: [{ properties: "always" }], }, { code: "var o = {bar_baz: 1}", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "var o = {_leading: 1}", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "var o = {trailing_: 1}", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "obj.a_b = 2;", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "obj._a = 2;", - options: [{ properties: "always" }] + options: [{ properties: "always" }], }, { code: "obj.a_ = 2;", - options: [{ properties: "always" }] + options: [{ properties: "always" }], }, { code: "obj._a = 2;", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "obj.a_ = 2;", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "var obj = {\n a_a: 1 \n};\n obj.a_b = 2;", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "obj.foo_bar = function(){};", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, { code: "var { category_id } = query;", options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "var { category_id: category_id } = query;", options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "var { category_id = 1 } = query;", options: [{ ignoreDestructuring: true }], parserOptions: { ecmaVersion: 6 }, - }, { code: "var { category_id: category } = query;", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "var { _leading } = query;", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "var { trailing_ } = query;", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { - code: "import { camelCased } from \"external module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { camelCased } from "external module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { _leading } from \"external module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { _leading } from "external module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { trailing_ } from \"external module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { trailing_ } from "external module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { no_camelcased as camelCased } from \"external-module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { no_camelcased as camelCased } from "external-module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { no_camelcased as _leading } from \"external-module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { no_camelcased as _leading } from "external-module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { no_camelcased as trailing_ } from \"external-module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: 'import { no_camelcased as trailing_ } from "external-module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { - code: "import { no_camelcased as camelCased, anoterCamelCased } from \"external-module\";", - parserOptions: { ecmaVersion: 6, sourceType: "module" } + code: + 'import { no_camelcased as camelCased, anoterCamelCased } from "external-module";', + parserOptions: { ecmaVersion: 6, sourceType: "module" }, }, { code: "function foo({ no_camelcased: camelCased }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ no_camelcased: _leading }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ no_camelcased: trailing_ }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ camelCased = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ _leading = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ trailing_ = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ camelCased }) {};", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ _leading }) {}", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, { code: "function foo({ trailing_ }) {}", - parserOptions: { ecmaVersion: 6 } + parserOptions: { ecmaVersion: 6 }, }, // Babel-specific test cases { code: "var foo = bar?.a_b;", - options: [{ properties: "never" }] + options: [{ properties: "never" }], }, ], invalid: [ { - code: "first_name = \"Nicholas\"", + code: 'first_name = "Nicholas"', errors: [ { messageId: "notCamelCase", data: { name: "first_name" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "__private_first_name = \"Patrick\"", + code: '__private_first_name = "Patrick"', errors: [ { messageId: "notCamelCase", data: { name: "__private_first_name" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "function foo_bar(){}", @@ -218,9 +218,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "foo_bar" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "obj.foo_bar = function(){};", @@ -228,9 +228,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "foo_bar" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "bar_baz.foo = function(){};", @@ -238,9 +238,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "bar_baz" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "[foo_bar.baz]", @@ -248,9 +248,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "foo_bar" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "if (foo.bar_baz === boom.bam_pow) { [foo_bar.baz] }", @@ -258,9 +258,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "foo_bar" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "foo.bar_baz = boom.bam_pow", @@ -268,9 +268,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "bar_baz" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var foo = { bar_baz: boom.bam_pow }", @@ -278,9 +278,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "bar_baz" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "foo.qux.boom_pow = { bar: boom.bam_pow }", @@ -288,9 +288,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "boom_pow" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var o = {bar_baz: 1}", @@ -299,9 +299,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "bar_baz" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "obj.a_b = 2;", @@ -310,9 +310,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "a_b" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id: category_alias } = query;", @@ -321,9 +321,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "category_alias" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id: category_alias } = query;", @@ -333,9 +333,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "category_alias" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id: categoryId, ...other_props } = query;", @@ -345,9 +345,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "other_props" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id } = query;", @@ -356,9 +356,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "category_id" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id: category_id } = query;", @@ -367,9 +367,9 @@ ruleTester.run("camelcase", rule, { { messageId: "notCamelCase", data: { name: "category_id" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { category_id = 1 } = query;", @@ -377,108 +377,111 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'category_id' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import no_camelcased from \"external-module\";", + code: 'import no_camelcased from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import * as no_camelcased from \"external-module\";", + code: 'import * as no_camelcased from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import { no_camelcased } from \"external-module\";", + code: 'import { no_camelcased } from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import { no_camelcased as no_camel_cased } from \"external module\";", + code: + 'import { no_camelcased as no_camel_cased } from "external module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camel_cased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import { camelCased as no_camel_cased } from \"external module\";", + code: 'import { camelCased as no_camel_cased } from "external module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camel_cased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import { camelCased, no_camelcased } from \"external-module\";", + code: 'import { camelCased, no_camelcased } from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import { no_camelcased as camelCased, another_no_camelcased } from \"external-module\";", + code: + 'import { no_camelcased as camelCased, another_no_camelcased } from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "another_no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import camelCased, { no_camelcased } from \"external-module\";", + code: 'import camelCased, { no_camelcased } from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "import no_camelcased, { another_no_camelcased as camelCased } from \"external-module\";", + code: + 'import no_camelcased, { another_no_camelcased as camelCased } from "external-module";', parserOptions: { ecmaVersion: 6, sourceType: "module" }, errors: [ { messageId: "notCamelCase", data: { name: "no_camelcased" }, - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "function foo({ no_camelcased }) {};", @@ -486,9 +489,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "function foo({ no_camelcased = 'default value' }) {};", @@ -496,23 +499,24 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { - code: "const no_camelcased = 0; function foo({ camelcased_value = no_camelcased}) {}", + code: + "const no_camelcased = 0; function foo({ camelcased_value = no_camelcased}) {}", parserOptions: { ecmaVersion: 6 }, errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" + type: "Identifier", }, { message: "Identifier 'camelcased_value' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "const { bar: no_camelcased } = foo;", @@ -520,9 +524,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "function foo({ value_1: my_default }) {}", @@ -530,9 +534,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'my_default' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "function foo({ isCamelcased: no_camelcased }) {};", @@ -540,9 +544,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "var { foo: bar_baz = 1 } = quz;", @@ -550,9 +554,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'bar_baz' is not in camel case.", - type: "Identifier" - } - ] + type: "Identifier", + }, + ], }, { code: "const { no_camelcased = false } = bar;", @@ -560,9 +564,9 @@ ruleTester.run("camelcase", rule, { errors: [ { message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier" - } - ] - } - ] + type: "Identifier", + }, + ], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/new-cap.js b/eslint/babel-eslint-plugin/test/rules/new-cap.js index 225867e597a1..1dc8d3069a97 100644 --- a/eslint/babel-eslint-plugin/test/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/test/rules/new-cap.js @@ -3,155 +3,298 @@ * @author Nicholas C. Zakas */ -var rule = require('../../rules/new-cap'), - RuleTester = require("../helpers/RuleTester"); +var rule = require("../../src/rules/new-cap"), + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); -ruleTester.run('babel/new-cap', rule, { - valid: [ - // Original test cases. - "var x = new Constructor();", - "var x = new a.b.Constructor();", - "var x = new a.b['Constructor']();", - "var x = new a.b[Constructor]();", - "var x = new a.b[constructor]();", - "var x = new function(){};", - "var x = new _;", - "var x = new $;", - "var x = new Σ;", - "var x = new _x;", - "var x = new $x;", - "var x = new this;", - "var x = Array(42)", - "var x = Boolean(42)", - "var x = Date(42)", - "var x = Date.UTC(2000, 0)", - "var x = Error('error')", - "var x = Function('return 0')", - "var x = Number(42)", - "var x = Object(null)", - "var x = RegExp(42)", - "var x = String(42)", - "var x = Symbol('symbol')", - "var x = _();", - "var x = $();", - { code: "var x = Foo(42)", options: [{ capIsNew: false }] }, - { code: "var x = bar.Foo(42)", options: [{ capIsNew: false }] }, - { code: "var x = Foo.bar(42)", options: [{ capIsNew: false }] }, - "var x = bar[Foo](42)", - { code: "var x = bar['Foo'](42)", options: [{ capIsNew: false }] }, - "var x = Foo.bar(42)", - { code: "var x = new foo(42)", options: [{ newIsCap: false }] }, - "var o = { 1: function() {} }; o[1]();", - "var o = { 1: function() {} }; new o[1]();", - { code: "var x = Foo(42);", options: [{ capIsNew: true, capIsNewExceptions: ["Foo"] }] }, - { code: "var x = Foo(42);", options: [{ capIsNewExceptionPattern: "^Foo" }] }, - { code: "var x = new foo(42);", options: [{ newIsCap: true, newIsCapExceptions: ["foo"] }] }, - { code: "var x = new foo(42);", options: [{ newIsCapExceptionPattern: "^foo" }] }, - { code: "var x = Object(42);", options: [{ capIsNewExceptions: ["Foo"] }] }, +ruleTester.run("babel/new-cap", rule, { + valid: [ + // Original test cases. + "var x = new Constructor();", + "var x = new a.b.Constructor();", + "var x = new a.b['Constructor']();", + "var x = new a.b[Constructor]();", + "var x = new a.b[constructor]();", + "var x = new function(){};", + "var x = new _;", + "var x = new $;", + "var x = new Σ;", + "var x = new _x;", + "var x = new $x;", + "var x = new this;", + "var x = Array(42)", + "var x = Boolean(42)", + "var x = Date(42)", + "var x = Date.UTC(2000, 0)", + "var x = Error('error')", + "var x = Function('return 0')", + "var x = Number(42)", + "var x = Object(null)", + "var x = RegExp(42)", + "var x = String(42)", + "var x = Symbol('symbol')", + "var x = _();", + "var x = $();", + { code: "var x = Foo(42)", options: [{ capIsNew: false }] }, + { code: "var x = bar.Foo(42)", options: [{ capIsNew: false }] }, + { code: "var x = Foo.bar(42)", options: [{ capIsNew: false }] }, + "var x = bar[Foo](42)", + { code: "var x = bar['Foo'](42)", options: [{ capIsNew: false }] }, + "var x = Foo.bar(42)", + { code: "var x = new foo(42)", options: [{ newIsCap: false }] }, + "var o = { 1: function() {} }; o[1]();", + "var o = { 1: function() {} }; new o[1]();", + { + code: "var x = Foo(42);", + options: [{ capIsNew: true, capIsNewExceptions: ["Foo"] }], + }, + { + code: "var x = Foo(42);", + options: [{ capIsNewExceptionPattern: "^Foo" }], + }, + { + code: "var x = new foo(42);", + options: [{ newIsCap: true, newIsCapExceptions: ["foo"] }], + }, + { + code: "var x = new foo(42);", + options: [{ newIsCapExceptionPattern: "^foo" }], + }, + { code: "var x = Object(42);", options: [{ capIsNewExceptions: ["Foo"] }] }, - { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Bar"] }] }, - { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptions: ["Foo.Bar"] }] }, + { + code: "var x = Foo.Bar(42);", + options: [{ capIsNewExceptions: ["Bar"] }], + }, + { + code: "var x = Foo.Bar(42);", + options: [{ capIsNewExceptions: ["Foo.Bar"] }], + }, - { code: "var x = Foo.Bar(42);", options: [{ capIsNewExceptionPattern: "^Foo\\.." }] }, - { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["bar"] }] }, - { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptions: ["foo.bar"] }] }, + { + code: "var x = Foo.Bar(42);", + options: [{ capIsNewExceptionPattern: "^Foo\\.." }], + }, + { + code: "var x = new foo.bar(42);", + options: [{ newIsCapExceptions: ["bar"] }], + }, + { + code: "var x = new foo.bar(42);", + options: [{ newIsCapExceptions: ["foo.bar"] }], + }, - { code: "var x = new foo.bar(42);", options: [{ newIsCapExceptionPattern: "^foo\\.." }] }, - { code: "var x = new foo.bar(42);", options: [{ properties: false }] }, - { code: "var x = Foo.bar(42);", options: [{ properties: false }] }, - { code: "var x = foo.Bar(42);", options: [{ capIsNew: false, properties: false }] }, + { + code: "var x = new foo.bar(42);", + options: [{ newIsCapExceptionPattern: "^foo\\.." }], + }, + { code: "var x = new foo.bar(42);", options: [{ properties: false }] }, + { code: "var x = Foo.bar(42);", options: [{ properties: false }] }, + { + code: "var x = foo.Bar(42);", + options: [{ capIsNew: false, properties: false }], + }, - // Babel-specific test cases. - { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, - ], - invalid: [ - { code: "var x = new c();", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, - { code: "var x = new φ;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, - { code: "var x = new a.b.c;", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, - { code: "var x = new a.b['c'];", errors: [{ message: "A constructor name should not start with a lowercase letter.", type: "NewExpression" }] }, - { code: "var b = Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, - { code: "var b = a.Foo();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, - { code: "var b = a['Foo']();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, - { code: "var b = a.Date.UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, - { code: "var b = UTC();", errors: [{ message: "A function with a name starting with an uppercase letter should only be used as a constructor.", type: "CallExpression" }] }, - { - code: "var a = B.C();", - errors: [ - { - message: "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var a = B\n.C();", - errors: [ - { - message: "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - line: 2, - column: 2 - } - ] - }, - { - code: "var a = new B.c();", - errors: [ - { - message: "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 1, - column: 15 - } - ] - }, - { - code: "var a = new B.\nc();", - errors: [ - { - message: "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 2, - column: 1 - } - ] - }, - { - code: "var a = new c();", - errors: [ - { - message: "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 1, - column: 13 - } - ] + // Babel-specific test cases. + { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, + ], + invalid: [ + { + code: "var x = new c();", + errors: [ + { + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", }, - + ], + }, + { + code: "var x = new φ;", + errors: [ + { + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + }, + ], + }, + { + code: "var x = new a.b.c;", + errors: [ + { + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + }, + ], + }, + { + code: "var x = new a.b['c'];", + errors: [ + { + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + }, + ], + }, + { + code: "var b = Foo();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + }, + ], + }, + { + code: "var b = a.Foo();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + }, + ], + }, + { + code: "var b = a['Foo']();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + }, + ], + }, + { + code: "var b = a.Date.UTC();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + }, + ], + }, + { + code: "var b = UTC();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + }, + ], + }, + { + code: "var a = B.C();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + line: 1, + column: 11, + }, + ], + }, + { + code: "var a = B\n.C();", + errors: [ + { + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", + type: "CallExpression", + line: 2, + column: 2, + }, + ], + }, + { + code: "var a = new B.c();", + errors: [ { - code: "var x = Foo.Bar(42);", - options: [{ capIsNewExceptions: ["Foo"] }], - errors: [{ type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor." }] + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 1, + column: 15, }, + ], + }, + { + code: "var a = new B.\nc();", + errors: [ { - code: "var x = Bar.Foo(42);", + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 2, + column: 1, + }, + ], + }, + { + code: "var a = new c();", + errors: [ + { + message: + "A constructor name should not start with a lowercase letter.", + type: "NewExpression", + line: 1, + column: 13, + }, + ], + }, - options: [{ capIsNewExceptionPattern: "^Foo\\.." }], - errors: [{ type: "CallExpression", message: "A function with a name starting with an uppercase letter should only be used as a constructor." }] + { + code: "var x = Foo.Bar(42);", + options: [{ capIsNewExceptions: ["Foo"] }], + errors: [ + { + type: "CallExpression", + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", }, + ], + }, + { + code: "var x = Bar.Foo(42);", + + options: [{ capIsNewExceptionPattern: "^Foo\\.." }], + errors: [ { - code: "var x = new foo.bar(42);", - options: [{ newIsCapExceptions: ["foo"] }], - errors: [{ type: "NewExpression", message: "A constructor name should not start with a lowercase letter." }] + type: "CallExpression", + message: + "A function with a name starting with an uppercase letter should only be used as a constructor.", }, + ], + }, + { + code: "var x = new foo.bar(42);", + options: [{ newIsCapExceptions: ["foo"] }], + errors: [ { - code: "var x = new bar.foo(42);", + type: "NewExpression", + message: + "A constructor name should not start with a lowercase letter.", + }, + ], + }, + { + code: "var x = new bar.foo(42);", - options: [{ newIsCapExceptionPattern: "^foo\\.." }], - errors: [{ type: "NewExpression", message: "A constructor name should not start with a lowercase letter." }] - } - ] + options: [{ newIsCapExceptionPattern: "^foo\\.." }], + errors: [ + { + type: "NewExpression", + message: + "A constructor name should not start with a lowercase letter.", + }, + ], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js index b4c385b466d7..7264a030f026 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js @@ -10,8 +10,8 @@ //------------------------------------------------------------------------------ const cloneDeep = require("lodash.clonedeep"); -const rule = require("../../rules/no-invalid-this"), - RuleTester = require("../helpers/RuleTester"); +const rule = require("../../src/rules/no-invalid-this"), + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Helpers @@ -22,7 +22,7 @@ const rule = require("../../rules/no-invalid-this"), * @returns {void} */ function NORMAL(pattern) { - pattern.parserOptions.sourceType = "script"; + pattern.parserOptions.sourceType = "script"; } /** @@ -32,7 +32,7 @@ function NORMAL(pattern) { * @returns {void} */ function USE_STRICT(pattern) { - pattern.code = "\"use strict\"; " + pattern.code; + pattern.code = '"use strict"; ' + pattern.code; } /** @@ -42,9 +42,9 @@ function USE_STRICT(pattern) { * @returns {void} */ function IMPLIED_STRICT(pattern) { - pattern.code = "/* implied strict mode */ " + pattern.code; - pattern.parserOptions.ecmaFeatures = pattern.parserOptions.ecmaFeatures || {}; - pattern.parserOptions.ecmaFeatures.impliedStrict = true; + pattern.code = "/* implied strict mode */ " + pattern.code; + pattern.parserOptions.ecmaFeatures = pattern.parserOptions.ecmaFeatures || {}; + pattern.parserOptions.ecmaFeatures.impliedStrict = true; } /** @@ -54,7 +54,7 @@ function IMPLIED_STRICT(pattern) { * @returns {void} */ function MODULES(pattern) { - pattern.code = "/* modules */ " + pattern.code; + pattern.code = "/* modules */ " + pattern.code; } /** @@ -64,564 +64,625 @@ function MODULES(pattern) { * @returns {Object[]} Test patterns. */ function extractPatterns(patterns, type) { + // Clone and apply the pattern environment. + const patternsList = patterns.map(function(pattern) { + return pattern[type].map(function(applyCondition) { + const thisPattern = cloneDeep(pattern); - // Clone and apply the pattern environment. - const patternsList = patterns.map(function(pattern) { - return pattern[type].map(function(applyCondition) { - const thisPattern = cloneDeep(pattern); + applyCondition(thisPattern); - applyCondition(thisPattern); + if (type === "valid") { + thisPattern.errors = []; + } else { + thisPattern.code += " /* should error */"; + } - if (type === "valid") { - thisPattern.errors = []; - } else { - thisPattern.code += " /* should error */"; - } + delete thisPattern.invalid; + delete thisPattern.valid; - delete thisPattern.invalid; - delete thisPattern.valid; - - return thisPattern; - }); + return thisPattern; }); + }); - // Flatten. - return Array.prototype.concat.apply([], patternsList); + // Flatten. + return Array.prototype.concat.apply([], patternsList); } - //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ const errors = [ - {message: "Unexpected 'this'.", type: "ThisExpression"}, - {message: "Unexpected 'this'.", type: "ThisExpression"} + { message: "Unexpected 'this'.", type: "ThisExpression" }, + { message: "Unexpected 'this'.", type: "ThisExpression" }, ]; const patterns = [ - - // Global. - { - code: "console.log(this); z(x => console.log(x, this));", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "console.log(this); z(x => console.log(x, this));", - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: {globalReturn: true} - }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // IIFE. - { - code: "(function() { console.log(this); z(x => console.log(x, this)); })();", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // Just functions. - { - code: "function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "function foo() { \"use strict\"; console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "return function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: {globalReturn: true} - }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT] // modules cannot return on global. - }, - { - code: "var foo = (function() { console.log(this); z(x => console.log(x, this)); }).bar(obj);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // Functions in methods. - { - code: "var obj = {foo: function() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "var obj = {foo() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "var obj = {foo: function() { return function() { console.log(this); z(x => console.log(x, this)); }; }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "var obj = {foo: function() { \"use strict\"; return function() { console.log(this); z(x => console.log(x, this)); }; }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "obj.foo = function() { return function() { console.log(this); z(x => console.log(x, this)); }; };", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "obj.foo = function() { \"use strict\"; return function() { console.log(this); z(x => console.log(x, this)); }; };", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "class A { foo() { return function() { console.log(this); z(x => console.log(x, this)); }; } }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // Class Static methods. - { - code: "class A {static foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Constructors. - { - code: "function Foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var Foo = function Foo() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "class A {constructor() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // On a property. - { - code: "var obj = {foo: function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var obj = {foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var obj = {foo: foo || function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var obj = {foo: hasNative ? foo : function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var obj = {foo: (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })()};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "Object.defineProperty(obj, \"foo\", {value: function() { console.log(this); z(x => console.log(x, this)); }})", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "Object.defineProperties(obj, {foo: {value: function() { console.log(this); z(x => console.log(x, this)); }}})", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Assigns to a property. - { - code: "obj.foo = function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "obj.foo = foo || function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "obj.foo = foo ? bar : function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "obj.foo = (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })();", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Class Instance Methods. - { - code: "class A {foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Bind/Call/Apply - { - code: "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(null);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "(function() { console.log(this); z(x => console.log(x, this)); }).call(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "(function() { console.log(this); z(x => console.log(x, this)); }).call(undefined);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "(function() { console.log(this); z(x => console.log(x, this)); }).apply(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "(function() { console.log(this); z(x => console.log(x, this)); }).apply(void 0);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "Reflect.apply(function() { console.log(this); z(x => console.log(x, this)); }, obj, []);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Array methods. - { - code: "Array.from([], function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.every(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.filter(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.find(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.map(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo.some(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "Array.from([], function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.every(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.filter(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.find(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.map(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.some(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, null);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // @this tag. - { - code: "/** @this Obj */ function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "/**\n * @returns {void}\n * @this Obj\n */\nfunction foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "/** @returns {void} */ function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "/** @this Obj */ foo(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "foo(/* @this Obj */ function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // https://github.com/eslint/eslint/issues/3254 - { - code: "function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // https://github.com/eslint/eslint/issues/3287 - { - code: "function foo() { /** @this Obj*/ return function bar() { console.log(this); z(x => console.log(x, this)); }; }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // https://github.com/eslint/eslint/issues/6824 - { - code: "var Ctor = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "var func = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "Ctor = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "func = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "function foo(Ctor = function() { console.log(this); z(x => console.log(x, this)); }) {}", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "function foo(func = function() { console.log(this); z(x => console.log(x, this)); }) {}", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - { - code: "[obj.method = function() { console.log(this); z(x => console.log(x, this)); }] = a", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - { - code: "[func = function() { console.log(this); z(x => console.log(x, this)); }] = a", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES] - }, - - // babel/no-invalid-this - - // Class Instance Properties. - { - code: "class A {a = this.b;};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - { - code: "class A {a = () => {return this.b;};};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - // Class Private Instance Properties. - { - code: "class A {#a = this.b;};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, - - { - code: "class A {#a = () => {return this.b;};};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [] - }, + // Global. + { + code: "console.log(this); z(x => console.log(x, this));", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: "console.log(this); z(x => console.log(x, this));", + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { globalReturn: true }, + }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // IIFE. + { + code: + "(function() { console.log(this); z(x => console.log(x, this)); })();", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // Just functions. + { + code: "function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + 'function foo() { "use strict"; console.log(this); z(x => console.log(x, this)); }', + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "return function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { + ecmaVersion: 6, + ecmaFeatures: { globalReturn: true }, + }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT], // modules cannot return on global. + }, + { + code: + "var foo = (function() { console.log(this); z(x => console.log(x, this)); }).bar(obj);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // Functions in methods. + { + code: + "var obj = {foo: function() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "var obj = {foo() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "var obj = {foo: function() { return function() { console.log(this); z(x => console.log(x, this)); }; }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + 'var obj = {foo: function() { "use strict"; return function() { console.log(this); z(x => console.log(x, this)); }; }};', + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "obj.foo = function() { return function() { console.log(this); z(x => console.log(x, this)); }; };", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + 'obj.foo = function() { "use strict"; return function() { console.log(this); z(x => console.log(x, this)); }; };', + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "class A { foo() { return function() { console.log(this); z(x => console.log(x, this)); }; } }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [], + invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // Class Static methods. + { + code: + "class A {static foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Constructors. + { + code: "function Foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var Foo = function Foo() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "class A {constructor() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // On a property. + { + code: + "var obj = {foo: function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var obj = {foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var obj = {foo: foo || function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var obj = {foo: hasNative ? foo : function() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var obj = {foo: (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })()};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + 'Object.defineProperty(obj, "foo", {value: function() { console.log(this); z(x => console.log(x, this)); }})', + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "Object.defineProperties(obj, {foo: {value: function() { console.log(this); z(x => console.log(x, this)); }}})", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Assigns to a property. + { + code: + "obj.foo = function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "obj.foo = foo || function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "obj.foo = foo ? bar : function() { console.log(this); z(x => console.log(x, this)); };", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "obj.foo = (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })();", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Class Instance Methods. + { + code: + "class A {foo() { console.log(this); z(x => console.log(x, this)); }};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Bind/Call/Apply + { + code: + "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(null);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "(function() { console.log(this); z(x => console.log(x, this)); }).call(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "(function() { console.log(this); z(x => console.log(x, this)); }).call(undefined);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "(function() { console.log(this); z(x => console.log(x, this)); }).apply(obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "(function() { console.log(this); z(x => console.log(x, this)); }).apply(void 0);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "Reflect.apply(function() { console.log(this); z(x => console.log(x, this)); }, obj, []);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Array methods. + { + code: + "Array.from([], function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.every(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.filter(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.find(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.map(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo.some(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "Array.from([], function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.every(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.filter(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.find(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.map(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.some(function() { console.log(this); z(x => console.log(x, this)); }, obj);", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, null);", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // @this tag. + { + code: + "/** @this Obj */ function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "/**\n * @returns {void}\n * @this Obj\n */\nfunction foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "/** @returns {void} */ function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "/** @this Obj */ foo(function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "foo(/* @this Obj */ function() { console.log(this); z(x => console.log(x, this)); });", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // https://github.com/eslint/eslint/issues/3254 + { + code: "function foo() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // https://github.com/eslint/eslint/issues/3287 + { + code: + "function foo() { /** @this Obj*/ return function bar() { console.log(this); z(x => console.log(x, this)); }; }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // https://github.com/eslint/eslint/issues/6824 + { + code: + "var Ctor = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "var func = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "Ctor = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "func = function() { console.log(this); z(x => console.log(x, this)); }", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "function foo(Ctor = function() { console.log(this); z(x => console.log(x, this)); }) {}", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "function foo(func = function() { console.log(this); z(x => console.log(x, this)); }) {}", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + { + code: + "[obj.method = function() { console.log(this); z(x => console.log(x, this)); }] = a", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + { + code: + "[func = function() { console.log(this); z(x => console.log(x, this)); }] = a", + parserOptions: { ecmaVersion: 6 }, + errors, + valid: [NORMAL], + invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], + }, + + // babel/no-invalid-this + + // Class Instance Properties. + { + code: "class A {a = this.b;};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + { + code: "class A {a = () => {return this.b;};};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + // Class Private Instance Properties. + { + code: "class A {#a = this.b;};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, + + { + code: "class A {#a = () => {return this.b;};};", + parserOptions: { ecmaVersion: 6 }, + valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], + invalid: [], + }, ]; const ruleTester = new RuleTester(); ruleTester.run("no-invalid-this", rule, { - valid: extractPatterns(patterns, "valid"), - invalid: extractPatterns(patterns, "invalid") + valid: extractPatterns(patterns, "valid"), + invalid: extractPatterns(patterns, "invalid"), }); diff --git a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js index b7d4ca6e7bf7..fc07ad73d572 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js @@ -9,8 +9,8 @@ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../rules/no-unused-expressions"), - RuleTester = require("../helpers/RuleTester"); +const rule = require("../../src/rules/no-unused-expressions"), + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Tests @@ -19,126 +19,372 @@ const rule = require("../../rules/no-unused-expressions"), const ruleTester = new RuleTester(); ruleTester.run("no-unused-expressions", rule, { - valid: [ - // Original test cases. - "function f(){}", - "a = b", - "new a", - "{}", - "f(); g()", - "i++", - "a()", - { code: "a && a()", options: [{ allowShortCircuit: true }] }, - { code: "a() || (b = c)", options: [{ allowShortCircuit: true }] }, - { code: "a ? b() : c()", options: [{ allowTernary: true }] }, - { code: "a ? b() || (c = d) : e()", options: [{ allowShortCircuit: true, allowTernary: true }] }, - "delete foo.bar", - "void new C", - "\"use strict\";", - "\"directive one\"; \"directive two\"; f();", - "function foo() {\"use strict\"; return true; }", - { code: "var foo = () => {\"use strict\"; return true; }", parserOptions: { ecmaVersion: 6 } }, - "function foo() {\"directive one\"; \"directive two\"; f(); }", - "function foo() { var foo = \"use strict\"; return true; }", + valid: [ + // Original test cases. + "function f(){}", + "a = b", + "new a", + "{}", + "f(); g()", + "i++", + "a()", + { code: "a && a()", options: [{ allowShortCircuit: true }] }, + { code: "a() || (b = c)", options: [{ allowShortCircuit: true }] }, + { code: "a ? b() : c()", options: [{ allowTernary: true }] }, + { + code: "a ? b() || (c = d) : e()", + options: [{ allowShortCircuit: true, allowTernary: true }], + }, + "delete foo.bar", + "void new C", + '"use strict";', + '"directive one"; "directive two"; f();', + 'function foo() {"use strict"; return true; }', + { + code: 'var foo = () => {"use strict"; return true; }', + parserOptions: { ecmaVersion: 6 }, + }, + 'function foo() {"directive one"; "directive two"; f(); }', + 'function foo() { var foo = "use strict"; return true; }', + { + code: "function* foo(){ yield 0; }", + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "async function foo() { await 5; }", + parserOptions: { ecmaVersion: 8 }, + }, + { + code: "async function foo() { await foo.bar; }", + parserOptions: { ecmaVersion: 8 }, + }, + { + code: "async function foo() { bar && await baz; }", + options: [{ allowShortCircuit: true }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: "async function foo() { foo ? await bar : await baz; }", + options: [{ allowTernary: true }], + parserOptions: { ecmaVersion: 8 }, + }, + { + code: "tag`tagged template literal`", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "shouldNotBeAffectedByAllowTemplateTagsOption()", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 }, + }, + + // Babel-specific test cases. + "let a = do { if (foo) { foo.bar; } }", + "let a = do { foo; }", + "let a = do { let b = 2; foo; }", + "let a = do { (foo + 1); }", + "let a = do { if (foo) { if (foo.bar) { foo.bar; } } }", + "let a = do { if (foo) { if (foo.bar) { foo.bar; } else if (foo.baz) { foo.baz; } } }", + "foo.bar?.();", + ], + invalid: [ + { + code: "0", + errors: [ { - code: "function* foo(){ yield 0; }", - parserOptions: { ecmaVersion: 6 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "a", + errors: [ { - code: "async function foo() { await 5; }", - parserOptions: { ecmaVersion: 8 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "f(), 0", + errors: [ { - code: "async function foo() { await foo.bar; }", - parserOptions: { ecmaVersion: 8 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "{0}", + errors: [ { - code: "async function foo() { bar && await baz; }", - options: [{ allowShortCircuit: true }], - parserOptions: { ecmaVersion: 8 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "[]", + errors: [ { - code: "async function foo() { foo ? await bar : await baz; }", - options: [{ allowTernary: true }], - parserOptions: { ecmaVersion: 8 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "a && b();", + errors: [ { - code: "tag`tagged template literal`", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "a() || false", + errors: [ { - code: "shouldNotBeAffectedByAllowTemplateTagsOption()", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 } + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, - - // Babel-specific test cases. - "let a = do { if (foo) { foo.bar; } }", - "let a = do { foo; }", - "let a = do { let b = 2; foo; }", - "let a = do { (foo + 1); }", - "let a = do { if (foo) { if (foo.bar) { foo.bar; } } }", - "let a = do { if (foo) { if (foo.bar) { foo.bar; } else if (foo.baz) { foo.baz; } } }", - "foo.bar?.();", - - ], - invalid: [ - { code: "0", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "f(), 0", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "{0}", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "[]", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a && b();", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a() || false", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a || (b = c)", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a ? b() || (c = d) : e", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { - code: "`untagged template literal`", - parserOptions: { ecmaVersion: 6 }, - errors: ["Expected an assignment or function call and instead saw an expression."] - }, - { - code: "tag`tagged template literal`", - parserOptions: { ecmaVersion: 6 }, - errors: ["Expected an assignment or function call and instead saw an expression."] - }, - { code: "a && b()", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a ? b() : c()", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a || b", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a() && b", options: [{ allowShortCircuit: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a ? b : 0", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "a ? b : c()", options: [{ allowTernary: true }], errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "foo.bar;", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "!a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "+a", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "\"directive one\"; f(); \"directive two\";", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "function foo() {\"directive one\"; f(); \"directive two\"; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "if (0) { \"not a directive\"; f(); }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "function foo() { var foo = true; \"use strict\"; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "var foo = () => { var foo = true; \"use strict\"; }", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { - code: "`untagged template literal`", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 }, - errors: ["Expected an assignment or function call and instead saw an expression."] - }, - { - code: "`untagged template literal`", - options: [{ allowTaggedTemplates: false }], - parserOptions: { ecmaVersion: 6 }, - errors: ["Expected an assignment or function call and instead saw an expression."] - }, - { - code: "tag`tagged template literal`", - options: [{ allowTaggedTemplates: false }], - parserOptions: { ecmaVersion: 6 }, - errors: ["Expected an assignment or function call and instead saw an expression."] + ], + }, + { + code: "a || (b = c)", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", }, + ], + }, + { + code: "a ? b() || (c = d) : e", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "`untagged template literal`", + parserOptions: { ecmaVersion: 6 }, + errors: [ + "Expected an assignment or function call and instead saw an expression.", + ], + }, + { + code: "tag`tagged template literal`", + parserOptions: { ecmaVersion: 6 }, + errors: [ + "Expected an assignment or function call and instead saw an expression.", + ], + }, + { + code: "a && b()", + options: [{ allowTernary: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "a ? b() : c()", + options: [{ allowShortCircuit: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "a || b", + options: [{ allowShortCircuit: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "a() && b", + options: [{ allowShortCircuit: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "a ? b : 0", + options: [{ allowTernary: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "a ? b : c()", + options: [{ allowTernary: true }], + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "foo.bar;", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "!a", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "+a", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: '"directive one"; f(); "directive two";', + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: 'function foo() {"directive one"; f(); "directive two"; }', + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: 'if (0) { "not a directive"; f(); }', + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: 'function foo() { var foo = true; "use strict"; }', + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: 'var foo = () => { var foo = true; "use strict"; }', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "`untagged template literal`", + options: [{ allowTaggedTemplates: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + "Expected an assignment or function call and instead saw an expression.", + ], + }, + { + code: "`untagged template literal`", + options: [{ allowTaggedTemplates: false }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + "Expected an assignment or function call and instead saw an expression.", + ], + }, + { + code: "tag`tagged template literal`", + options: [{ allowTaggedTemplates: false }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + "Expected an assignment or function call and instead saw an expression.", + ], + }, - // Babel-specific test cases. - { code: "let a = do { foo; let b = 2; }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - { code: "let a = do { if (foo) { foo.bar } else { a; bar.foo } }", errors: [{ message: "Expected an assignment or function call and instead saw an expression.", type: "ExpressionStatement" }] }, - - ] + // Babel-specific test cases. + { + code: "let a = do { foo; let b = 2; }", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + { + code: "let a = do { if (foo) { foo.bar } else { a; bar.foo } }", + errors: [ + { + message: + "Expected an assignment or function call and instead saw an expression.", + type: "ExpressionStatement", + }, + ], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js index cf5315102d25..ff51d248baec 100644 --- a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js @@ -6,836 +6,1133 @@ * @copyright 2015 Mathieu M-Gosselin. All rights reserved. */ -var rule = require('../../rules/object-curly-spacing'), - RuleTester = require("../helpers/RuleTester"); +var rule = require("../../src/rules/object-curly-spacing"), + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); -ruleTester.run('babel/object-curly-spacing', rule, { +ruleTester.run("babel/object-curly-spacing", rule, { + valid: [ + // always - object literals + { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, + { + code: "var obj = { foo: { bar: quxx }, baz: qux };", + options: ["always"], + }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, - valid: [ + // always - destructuring + { + code: "var { x } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { x, y } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { x,y } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\nx,y } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\nx,y\n} = z", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { x = 10, y } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { x: { z }, y } = y", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\ny,\n} = x", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { y, } = x", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var { y: x } = x", + options: ["always"], + ecmaFeatures: { destructuring: true }, + }, - // always - object literals - { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, - { code: "var obj = { foo: { bar: quxx }, baz: qux };", options: ["always"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, + // always - import / export + { + code: "import door from 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import * as door from 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import { door } from 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\ndoor } from 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export { door } from 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import { house, mouse } from 'caravan'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nhouse,\nmouse\n} from 'caravan'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nhouse,\nmouse,\n} from 'caravan'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import house, { mouse } from 'caravan'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import door, { house, mouse } from 'caravan'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export { door }", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\ndoor,\nhouse\n}", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\ndoor,\nhouse,\n}", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import 'room'", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import { bar as x } from 'foo';", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import { x, } from 'foo';", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nx,\n} from 'foo';", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export { x, } from 'foo';", + options: ["always"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\nx,\n} from 'foo';", + options: ["always"], + ecmaFeatures: { modules: true }, + }, - // always - destructuring - { code: "var { x } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { x, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { x,y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var {\nx,y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var {\nx,y\n} = z", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { x = 10, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { x: { z }, y } = y", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var {\ny,\n} = x", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { y, } = x", options: ["always"], ecmaFeatures: { destructuring: true } }, - { code: "var { y: x } = x", options: ["always"], ecmaFeatures: { destructuring: true } }, + // always - empty object + { code: "var foo = {};", options: ["always"] }, - // always - import / export - { code: "import door from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import * as door from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import {\ndoor } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export { door } from 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import {\nhouse,\nmouse\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import {\nhouse,\nmouse,\n} from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import house, { mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import door, { house, mouse } from 'caravan'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export { door }", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export {\ndoor,\nhouse\n}", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export {\ndoor,\nhouse,\n}", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import 'room'", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import { bar as x } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import { x, } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "import {\nx,\n} from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export { x, } from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, - { code: "export {\nx,\n} from 'foo';", options: ["always"], ecmaFeatures: { modules: true } }, + // always - objectsInObjects + { + code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", + options: ["always", { objectsInObjects: false }], + }, - // always - empty object - { code: "var foo = {};", options: ["always"] }, + // always - arraysInObjects + { + code: "var obj = { 'foo': [ 1, 2 ]};", + options: ["always", { arraysInObjects: false }], + }, - // always - objectsInObjects - { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"objectsInObjects": false}] }, + // always - arraysInObjects, objectsInObjects + { + code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", + options: ["always", { arraysInObjects: false, objectsInObjects: false }], + }, - // always - arraysInObjects - { code: "var obj = { 'foo': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false}] }, + // always - arraysInObjects, objectsInObjects (reverse) + { + code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", + options: ["always", { arraysInObjects: false, objectsInObjects: false }], + }, - // always - arraysInObjects, objectsInObjects - { code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + // never + { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, - // always - arraysInObjects, objectsInObjects (reverse) - { code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", options: ["always", {"arraysInObjects": false, "objectsInObjects": false}] }, + // never - object literals + { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, + { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, + { code: "var obj = {foo: {\nbar: quxx}, baz: qux\n};", options: ["never"] }, + { code: "var obj = {foo: {\nbar: quxx\n}, baz: qux};", options: ["never"] }, + { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, - // never - { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, + // never - destructuring + { + code: "var {x} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {x, y} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {x,y} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\nx,y\n} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {x = 10} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {x = 10, y} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {x: {z}, y} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\nx: {z\n}, y} = y", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {\ny,\n} = x", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {y,} = x", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {y:x} = x", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, - // never - object literals - { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, - { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, - { code: "var obj = {foo: {\nbar: quxx}, baz: qux\n};", options: ["never"] }, - { code: "var obj = {foo: {\nbar: quxx\n}, baz: qux};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, + // never - import / export + { + code: "import door from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import * as door from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {door} from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {door} from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\ndoor} from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\ndoor\n} from 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {house,mouse} from 'caravan'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {house, mouse} from 'caravan'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nhouse,\nmouse} from 'caravan'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nhouse,\nmouse,\n} from 'caravan'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {door}", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\ndoor,\nmouse\n}", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\ndoor,\nmouse,\n}", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import 'room'", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import x, {bar} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import x, {bar, baz} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {bar as y} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {x,} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "import {\nx,\n} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {x,} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {\nx,\n} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, - // never - destructuring - { code: "var {x} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {x, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {x,y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {\nx,y\n} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {x = 10} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {x = 10, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {x: {z}, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {\nx: {z\n}, y} = y", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {\ny,\n} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {y,} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, - { code: "var {y:x} = x", options: ["never"], ecmaFeatures: { destructuring: true } }, + // never - empty object + { code: "var foo = {};", options: ["never"] }, - // never - import / export - { code: "import door from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import * as door from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {door} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {\ndoor} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {\ndoor\n} from 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {house,mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {house, mouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {\nhouse,\nmouse} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {\nhouse,\nmouse,\n} from 'caravan'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {door}", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {\ndoor,\nmouse\n}", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {\ndoor,\nmouse,\n}", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import 'room'", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import x, {bar} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import x, {bar, baz} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {bar as y} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {x,} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "import {\nx,\n} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {x,} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, - { code: "export {\nx,\n} from 'foo';", options: ["never"], ecmaFeatures: { modules: true } }, + // never - objectsInObjects + { + code: "var obj = {'foo': {'bar': 1, 'baz': 2} };", + options: ["never", { objectsInObjects: true }], + }, + // https://github.com/eslint/eslint/issues/3658 + // Empty cases. + { code: "var {} = foo;", ecmaFeatures: { destructuring: true } }, + { code: "var [] = foo;", ecmaFeatures: { destructuring: true } }, + { code: "var {a: {}} = foo;", ecmaFeatures: { destructuring: true } }, + { code: "var {a: []} = foo;", ecmaFeatures: { destructuring: true } }, + { code: "import {} from 'foo';", ecmaFeatures: { modules: true } }, + { code: "export {} from 'foo';", ecmaFeatures: { modules: true } }, + { code: "export {};", ecmaFeatures: { modules: true } }, + { + code: "var {} = foo;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var [] = foo;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {a: {}} = foo;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "var {a: []} = foo;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + }, + { + code: "import {} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { + code: "export {} from 'foo';", + options: ["never"], + ecmaFeatures: { modules: true }, + }, + { code: "export {};", options: ["never"], ecmaFeatures: { modules: true } }, - // never - empty object - { code: "var foo = {};", options: ["never"] }, + // Babel test cases. + { + code: 'export * as x from "mod";', + parser: "babel-eslint", + ecmaFeatures: { modules: true }, + }, + { + code: 'export x from "mod";', + parser: "babel-eslint", + ecmaFeatures: { modules: true }, + }, - // never - objectsInObjects - { code: "var obj = {'foo': {'bar': 1, 'baz': 2} };", options: ["never", {"objectsInObjects": true}]}, + // always - destructuring typed object param + { + code: "function fn({ a,b }:Object){}", + options: ["always"], + parser: "babel-eslint", + ecmaFeatures: { destructuring: true }, + }, - // https://github.com/eslint/eslint/issues/3658 - // Empty cases. - { code: "var {} = foo;", ecmaFeatures: { destructuring: true }}, - { code: "var [] = foo;", ecmaFeatures: { destructuring: true }}, - { code: "var {a: {}} = foo;", ecmaFeatures: { destructuring: true }}, - { code: "var {a: []} = foo;", ecmaFeatures: { destructuring: true }}, - { code: "import {} from 'foo';", ecmaFeatures: { modules: true }}, - { code: "export {} from 'foo';", ecmaFeatures: { modules: true }}, - { code: "export {};", ecmaFeatures: { modules: true }}, - { code: "var {} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, - { code: "var [] = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, - { code: "var {a: {}} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, - { code: "var {a: []} = foo;", options: ["never"], ecmaFeatures: { destructuring: true }}, - { code: "import {} from 'foo';", options: ["never"], ecmaFeatures: { modules: true }}, - { code: "export {} from 'foo';", options: ["never"], ecmaFeatures: { modules: true }}, - { code: "export {};", options: ["never"], ecmaFeatures: { modules: true }}, + // never - destructuring typed object param + { + code: "function fn({a,b}: Object){}", + options: ["never"], + parser: "babel-eslint", + ecmaFeatures: { destructuring: true }, + }, + ], - // Babel test cases. - { code: "export * as x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, - { code: "export x from \"mod\";", parser: "babel-eslint", ecmaFeatures: { modules: true } }, - - // always - destructuring typed object param - { code: "function fn({ a,b }:Object){}", options: ["always"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, - - // never - destructuring typed object param - { code: "function fn({a,b}: Object){}", options: ["never"], parser: "babel-eslint", ecmaFeatures: { destructuring: true } }, - ], - - invalid: [ - { - code: "import {bar} from 'foo.js';", - output: "import { bar } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8 - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 12 - } - ] - }, - { - code: "import { bar as y} from 'foo.js';", - output: "import { bar as y } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 18 - } - ] - }, - { - code: "import {bar as y} from 'foo.js';", - output: "import { bar as y } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8 - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 17 - } - ] - }, - { - code: "import { bar} from 'foo.js';", - output: "import { bar } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 13 - } - ] - }, - { - code: "import x, { bar} from 'foo';", - output: "import x, { bar } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 16 - } - - ] - }, - { - code: "import x, { bar, baz} from 'foo';", - output: "import x, { bar, baz } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 21 - } - - ] - }, - { - code: "import x, {bar} from 'foo';", - output: "import x, { bar } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 11 - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 15 - } - - ] - }, - { - code: "import x, {bar, baz} from 'foo';", - output: "import x, { bar, baz } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 11 - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 20 - } - ] - }, - { - code: "import {bar,} from 'foo';", - output: "import { bar, } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8 - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 13 - } - - ] - }, - { - code: "import { bar, } from 'foo';", - output: "import {bar,} from 'foo';", - options: ["never"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8 - }, - { - message: "There should be no space before '}'.", - type: "ImportDeclaration", - line: 1, - column: 15 - } - ] - }, - { - code: "export {bar};", - output: "export { bar };", - options: ["always"], - ecmaFeatures: { - modules: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ExportNamedDeclaration", - line: 1, - column: 8 - }, - { - message: "A space is required before '}'.", - type: "ExportNamedDeclaration", - line: 1, - column: 12 - } - ] + invalid: [ + { + code: "import {bar} from 'foo.js';", + output: "import { bar } from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ImportDeclaration", + line: 1, + column: 8, + }, + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 12, + }, + ], + }, + { + code: "import { bar as y} from 'foo.js';", + output: "import { bar as y } from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 18, + }, + ], + }, + { + code: "import {bar as y} from 'foo.js';", + output: "import { bar as y } from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ImportDeclaration", + line: 1, + column: 8, + }, + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 17, + }, + ], + }, + { + code: "import { bar} from 'foo.js';", + output: "import { bar } from 'foo.js';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 13, + }, + ], + }, + { + code: "import x, { bar} from 'foo';", + output: "import x, { bar } from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 16, + }, + ], + }, + { + code: "import x, { bar, baz} from 'foo';", + output: "import x, { bar, baz } from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 21, + }, + ], + }, + { + code: "import x, {bar} from 'foo';", + output: "import x, { bar } from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ImportDeclaration", + line: 1, + column: 11, + }, + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 15, + }, + ], + }, + { + code: "import x, {bar, baz} from 'foo';", + output: "import x, { bar, baz } from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ImportDeclaration", + line: 1, + column: 11, }, + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 20, + }, + ], + }, + { + code: "import {bar,} from 'foo';", + output: "import { bar, } from 'foo';", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ImportDeclaration", + line: 1, + column: 8, + }, + { + message: "A space is required before '}'.", + type: "ImportDeclaration", + line: 1, + column: 13, + }, + ], + }, + { + code: "import { bar, } from 'foo';", + output: "import {bar,} from 'foo';", + options: ["never"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "There should be no space after '{'.", + type: "ImportDeclaration", + line: 1, + column: 8, + }, + { + message: "There should be no space before '}'.", + type: "ImportDeclaration", + line: 1, + column: 15, + }, + ], + }, + { + code: "export {bar};", + output: "export { bar };", + options: ["always"], + ecmaFeatures: { + modules: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ExportNamedDeclaration", + line: 1, + column: 8, + }, + { + message: "A space is required before '}'.", + type: "ExportNamedDeclaration", + line: 1, + column: 12, + }, + ], + }, - // always - arraysInObjects - { - code: "var obj = { 'foo': [ 1, 2 ] };", - output: "var obj = { 'foo': [ 1, 2 ]};", - options: ["always", {"arraysInObjects": false}], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", - output: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ]};", - options: ["always", {"arraysInObjects": false}], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression" - } - ] + // always - arraysInObjects + { + code: "var obj = { 'foo': [ 1, 2 ] };", + output: "var obj = { 'foo': [ 1, 2 ]};", + options: ["always", { arraysInObjects: false }], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + }, + ], + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", + output: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ]};", + options: ["always", { arraysInObjects: false }], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", }, + ], + }, - // always-objectsInObjects - { - code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", - output: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", - options: ["always", {"objectsInObjects": false}], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 43 - } - ] - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", - output: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 }};", - options: ["always", {"objectsInObjects": false}], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 61 - } - ] + // always-objectsInObjects + { + code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", + output: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", + options: ["always", { objectsInObjects: false }], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 43, }, + ], + }, + { + code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", + output: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 }};", + options: ["always", { objectsInObjects: false }], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 61, + }, + ], + }, - // always-destructuring trailing comma - { - code: "var { a,} = x;", - output: "var { a, } = x;", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 9 - } - ] - }, - { - code: "var {a, } = x;", - output: "var {a,} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 9 - } - ] - }, - { - code: "var {a:b } = x;", - output: "var {a:b} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 10 - } - ] - }, - { - code: "var { a:b } = x;", - output: "var {a:b} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 5 - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 11 - } - ] + // always-destructuring trailing comma + { + code: "var { a,} = x;", + output: "var { a, } = x;", + options: ["always"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectPattern", + line: 1, + column: 9, + }, + ], + }, + { + code: "var {a, } = x;", + output: "var {a,} = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 9, + }, + ], + }, + { + code: "var {a:b } = x;", + output: "var {a:b} = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 10, + }, + ], + }, + { + code: "var { a:b } = x;", + output: "var {a:b} = x;", + options: ["never"], + ecmaFeatures: { destructuring: true }, + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectPattern", + line: 1, + column: 5, }, + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 11, + }, + ], + }, - // never-objectsInObjects - { - code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", - output: "var obj = {'foo': {'bar': 1, 'baz': 2} };", - options: ["never", {"objectsInObjects": true}], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 39 - } - ] - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", - output: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2} };", - options: ["never", {"objectsInObjects": true}], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 55 - } - ] + // never-objectsInObjects + { + code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", + output: "var obj = {'foo': {'bar': 1, 'baz': 2} };", + options: ["never", { objectsInObjects: true }], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectExpression", + line: 1, + column: 39, }, + ], + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", + output: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2} };", + options: ["never", { objectsInObjects: true }], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectExpression", + line: 1, + column: 55, + }, + ], + }, - // always & never - { - code: "var obj = {foo: bar, baz: qux};", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 11 - }, - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 30 - } - ] - }, - { - code: "var obj = {foo: bar, baz: qux };", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux};", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 31 - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux };", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 32 - } - ] - }, - { - code: "var obj = {foo: bar, baz: qux };", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 31 - } - ] - }, - { - code: "var obj = { foo: bar, baz: qux};", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11 - } - ] - }, - { - code: "var obj = { foo: { bar: quxx}, baz: qux};", - output: "var obj = {foo: {bar: quxx}, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11 - }, - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 18 - } - ] - }, - { - code: "var obj = {foo: {bar: quxx }, baz: qux };", - output: "var obj = {foo: {bar: quxx}, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 28 - }, - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 40 - } - ] - }, - { - code: "export const thing = {value: 1 };", - output: "export const thing = { value: 1 };", - ecmaFeatures: { - modules: true, - blockBindings: true - }, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 22 - } - ] + // always & never + { + code: "var obj = {foo: bar, baz: qux};", + output: "var obj = { foo: bar, baz: qux };", + options: ["always"], + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectExpression", + line: 1, + column: 11, + }, + { + message: "A space is required before '}'.", + type: "ObjectExpression", + line: 1, + column: 30, + }, + ], + }, + { + code: "var obj = {foo: bar, baz: qux };", + output: "var obj = { foo: bar, baz: qux };", + options: ["always"], + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectExpression", + line: 1, + column: 11, + }, + ], + }, + { + code: "var obj = { foo: bar, baz: qux};", + output: "var obj = { foo: bar, baz: qux };", + options: ["always"], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectExpression", + line: 1, + column: 31, + }, + ], + }, + { + code: "var obj = { foo: bar, baz: qux };", + output: "var obj = {foo: bar, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectExpression", + line: 1, + column: 11, + }, + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 32, + }, + ], + }, + { + code: "var obj = {foo: bar, baz: qux };", + output: "var obj = {foo: bar, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 31, + }, + ], + }, + { + code: "var obj = { foo: bar, baz: qux};", + output: "var obj = {foo: bar, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectExpression", + line: 1, + column: 11, + }, + ], + }, + { + code: "var obj = { foo: { bar: quxx}, baz: qux};", + output: "var obj = {foo: {bar: quxx}, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectExpression", + line: 1, + column: 11, + }, + { + message: "There should be no space after '{'.", + type: "ObjectExpression", + line: 1, + column: 18, + }, + ], + }, + { + code: "var obj = {foo: {bar: quxx }, baz: qux };", + output: "var obj = {foo: {bar: quxx}, baz: qux};", + options: ["never"], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 28, + }, + { + message: "There should be no space before '}'.", + type: "ObjectExpression", + line: 1, + column: 40, }, + ], + }, + { + code: "export const thing = {value: 1 };", + output: "export const thing = { value: 1 };", + ecmaFeatures: { + modules: true, + blockBindings: true, + }, + options: ["always"], + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectExpression", + line: 1, + column: 22, + }, + ], + }, - // destructuring - { - code: "var {x, y} = y", - output: "var { x, y } = y", - ecmaFeatures: {destructuring: true}, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 5 - }, - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 10 - } - ] - }, - { - code: "var { x, y} = y", - output: "var { x, y } = y", - ecmaFeatures: {destructuring: true}, - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 11 - } - ] - }, - { - code: "var { x, y } = y", - output: "var {x, y} = y", - ecmaFeatures: {destructuring: true}, - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 5 - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 12 - } - ] - }, - { - code: "var {x, y } = y", - output: "var {x, y} = y", - ecmaFeatures: {destructuring: true}, - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 11 - } - ] - }, - { - code: "var { x=10} = y", - output: "var { x=10 } = y", - ecmaFeatures: {destructuring: true}, - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 11 - } - ] - }, - { - code: "var {x=10 } = y", - output: "var { x=10 } = y", - ecmaFeatures: {destructuring: true}, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 5 - } - ] + // destructuring + { + code: "var {x, y} = y", + output: "var { x, y } = y", + ecmaFeatures: { destructuring: true }, + options: ["always"], + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectPattern", + line: 1, + column: 5, + }, + { + message: "A space is required before '}'.", + type: "ObjectPattern", + line: 1, + column: 10, + }, + ], + }, + { + code: "var { x, y} = y", + output: "var { x, y } = y", + ecmaFeatures: { destructuring: true }, + options: ["always"], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectPattern", + line: 1, + column: 11, }, + ], + }, + { + code: "var { x, y } = y", + output: "var {x, y} = y", + ecmaFeatures: { destructuring: true }, + options: ["never"], + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectPattern", + line: 1, + column: 5, + }, + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 12, + }, + ], + }, + { + code: "var {x, y } = y", + output: "var {x, y} = y", + ecmaFeatures: { destructuring: true }, + options: ["never"], + errors: [ + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 11, + }, + ], + }, + { + code: "var { x=10} = y", + output: "var { x=10 } = y", + ecmaFeatures: { destructuring: true }, + options: ["always"], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectPattern", + line: 1, + column: 11, + }, + ], + }, + { + code: "var {x=10 } = y", + output: "var { x=10 } = y", + ecmaFeatures: { destructuring: true }, + options: ["always"], + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectPattern", + line: 1, + column: 5, + }, + ], + }, - // never - arraysInObjects - { - code: "var obj = {'foo': [1, 2]};", - output: "var obj = {'foo': [1, 2] };", - options: ["never", {"arraysInObjects": true}], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression" - } - ] - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", - output: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux'] };", - options: ["never", {"arraysInObjects": true}], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression" - } - ] + // never - arraysInObjects + { + code: "var obj = {'foo': [1, 2]};", + output: "var obj = {'foo': [1, 2] };", + options: ["never", { arraysInObjects: true }], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectExpression", }, + ], + }, + { + code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", + output: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux'] };", + options: ["never", { arraysInObjects: true }], + errors: [ + { + message: "A space is required before '}'.", + type: "ObjectExpression", + }, + ], + }, - // Babel test cases. + // Babel test cases. - // always - destructuring typed object param - { - code: "function fn({a,b}: Object){}", - output: "function fn({ a,b }: Object){}", - options: ["always"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 13 - }, - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 17 - } - ] + // always - destructuring typed object param + { + code: "function fn({a,b}: Object){}", + output: "function fn({ a,b }: Object){}", + options: ["always"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true, + }, + errors: [ + { + message: "A space is required after '{'.", + type: "ObjectPattern", + line: 1, + column: 13, }, + { + message: "A space is required before '}'.", + type: "ObjectPattern", + line: 1, + column: 17, + }, + ], + }, - // never - destructuring typed object param - { - code: "function fn({ a,b }: Object){}", - output: "function fn({a,b}: Object){}", - options: ["never"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true - }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 13 - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 19 - } - ] - } - ] + // never - destructuring typed object param + { + code: "function fn({ a,b }: Object){}", + output: "function fn({a,b}: Object){}", + options: ["never"], + parser: "babel-eslint", + ecmaFeatures: { + destructuring: true, + }, + errors: [ + { + message: "There should be no space after '{'.", + type: "ObjectPattern", + line: 1, + column: 13, + }, + { + message: "There should be no space before '}'.", + type: "ObjectPattern", + line: 1, + column: 19, + }, + ], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/quotes.js b/eslint/babel-eslint-plugin/test/rules/quotes.js index 17fde24b6cd3..938da649d21e 100644 --- a/eslint/babel-eslint-plugin/test/rules/quotes.js +++ b/eslint/babel-eslint-plugin/test/rules/quotes.js @@ -1,320 +1,481 @@ -var rule = require('../../rules/quotes'), - RuleTester = require("../helpers/RuleTester"); +var rule = require("../../src/rules/quotes"), + RuleTester = require("../helpers/RuleTester"); var ruleTester = new RuleTester(); -ruleTester.run('babel/quotes', rule, { - valid: [ - "var foo = \"bar\";", - { code: "var foo = 'bar';", options: ["single"] }, - { code: "var foo = \"bar\";", options: ["double"] }, - { code: "var foo = 1;", options: ["single"] }, - { code: "var foo = 1;", options: ["double"] }, - { code: "var foo = \"'\";", options: ["single", { avoidEscape: true }] }, - { code: "var foo = '\"';", options: ["double", { avoidEscape: true }] }, - { code: "var foo =
Hello world
;", options: ["single"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, - { code: "var foo =
;", options: ["single"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, - { code: "var foo =
Hello world
;", options: ["double"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, - { code: "var foo =
Hello world
;", options: ["double", { avoidEscape: true }], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, - { code: "var foo = `bar`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `bar 'baz'`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `bar \"baz\"`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = 1;", options: ["backtick"] }, - { code: "var foo = \"a string containing `backtick` quotes\";", options: ["backtick", { avoidEscape: true }] }, - { code: "var foo =
;", options: ["backtick"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, - { code: "var foo =
Hello world
;", options: ["backtick"], parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } } }, +ruleTester.run("babel/quotes", rule, { + valid: [ + 'var foo = "bar";', + { code: "var foo = 'bar';", options: ["single"] }, + { code: 'var foo = "bar";', options: ["double"] }, + { code: "var foo = 1;", options: ["single"] }, + { code: "var foo = 1;", options: ["double"] }, + { code: 'var foo = "\'";', options: ["single", { avoidEscape: true }] }, + { code: "var foo = '\"';", options: ["double", { avoidEscape: true }] }, + { + code: "var foo =
Hello world
;", + options: ["single"], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, + { + code: 'var foo =
;', + options: ["single"], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, + { + code: "var foo =
Hello world
;", + options: ["double"], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, + { + code: "var foo =
Hello world
;", + options: ["double", { avoidEscape: true }], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, + { + code: "var foo = `bar`;", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `bar 'baz'`;", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: 'var foo = `bar "baz"`;', + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { code: "var foo = 1;", options: ["backtick"] }, + { + code: 'var foo = "a string containing `backtick` quotes";', + options: ["backtick", { avoidEscape: true }], + }, + { + code: 'var foo =
;', + options: ["backtick"], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, + { + code: "var foo =
Hello world
;", + options: ["backtick"], + parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, + }, - // Backticks are only okay if they have substitutions, contain a line break, or are tagged - { code: "var foo = `back\ntick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `back\rtick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `back\u2028tick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `back\u2029tick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { - code: "var foo = `back\\\\\ntick`;", // 2 backslashes followed by a newline - options: ["single"], - parserOptions: { ecmaVersion: 6 } - }, - { code: "var foo = `back\\\\\\\\\ntick`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `\n`;", options: ["single"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `back${x}tick`;", options: ["double"], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = tag`backtick`;", options: ["double"], parserOptions: { ecmaVersion: 6 } }, + // Backticks are only okay if they have substitutions, contain a line break, or are tagged + { + code: "var foo = `back\ntick`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back\rtick`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back\u2028tick`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back\u2029tick`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back\\\\\ntick`;", // 2 backslashes followed by a newline + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back\\\\\\\\\ntick`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `\n`;", + options: ["single"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `back${x}tick`;", + options: ["double"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = tag`backtick`;", + options: ["double"], + parserOptions: { ecmaVersion: 6 }, + }, - // Backticks are also okay if allowTemplateLiterals - { code: "var foo = `bar 'foo' baz` + 'bar';", options: ["single", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `bar 'foo' baz` + \"bar\";", options: ["double", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, - { code: "var foo = `bar 'foo' baz` + `bar`;", options: ["backtick", { allowTemplateLiterals: true }], parserOptions: { ecmaVersion: 6 } }, + // Backticks are also okay if allowTemplateLiterals + { + code: "var foo = `bar 'foo' baz` + 'bar';", + options: ["single", { allowTemplateLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `bar 'foo' baz` + \"bar\";", + options: ["double", { allowTemplateLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "var foo = `bar 'foo' baz` + `bar`;", + options: ["backtick", { allowTemplateLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + }, - // `backtick` should not warn the directive prologues. - { code: "\"use strict\"; var foo = `backtick`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "\"use strict\"; 'use strong'; \"use asm\"; var foo = `backtick`;", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "function foo() { \"use strict\"; \"use strong\"; \"use asm\"; var foo = `backtick`; }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "(function() { 'use strict'; 'use strong'; 'use asm'; var foo = `backtick`; })();", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "(() => { \"use strict\"; \"use strong\"; \"use asm\"; var foo = `backtick`; })();", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + // `backtick` should not warn the directive prologues. + { + code: '"use strict"; var foo = `backtick`;', + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: '"use strict"; \'use strong\'; "use asm"; var foo = `backtick`;', + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: + 'function foo() { "use strict"; "use strong"; "use asm"; var foo = `backtick`; }', + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: + "(function() { 'use strict'; 'use strong'; 'use asm'; var foo = `backtick`; })();", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: + '(() => { "use strict"; "use strong"; "use asm"; var foo = `backtick`; })();', + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, - // `backtick` should not warn import/export sources. - { code: "import \"a\"; import 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, - { code: "import a from \"a\"; import b from 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, - { code: "export * from \"a\"; export * from 'b';", options: ["backtick"], parserOptions: { sourceType: "module" } }, + // `backtick` should not warn import/export sources. + { + code: "import \"a\"; import 'b';", + options: ["backtick"], + parserOptions: { sourceType: "module" }, + }, + { + code: "import a from \"a\"; import b from 'b';", + options: ["backtick"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export * from \"a\"; export * from 'b';", + options: ["backtick"], + parserOptions: { sourceType: "module" }, + }, - // `backtick` should not warn property/method names (not computed). - { code: "var obj = {\"key0\": 0, 'key1': 1};", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "class Foo { 'bar'(){} }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, - { code: "class Foo { static ''(){} }", options: ["backtick"], parserOptions: { ecmaVersion: 6 } }, + // `backtick` should not warn property/method names (not computed). + { + code: "var obj = {\"key0\": 0, 'key1': 1};", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "class Foo { 'bar'(){} }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "class Foo { static ''(){} }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + }, - // Babel - '<>foo;', - { code: '<>foo;', options: ['single'] }, - { code: '<>foo;', options: ['double'] }, - '<>
;', - { code: '<>
;', options: ['single'] }, - { code: '<>
;', options: ['double'] }, - ], - invalid: [ - { - code: "var foo = 'bar';", - output: "var foo = \"bar\";", - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var foo = \"bar\";", - output: "var foo = 'bar';", - options: ["single"], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }] - }, - { - code: "var foo = `bar`;", - output: "var foo = 'bar';", - options: ["single"], - parserOptions: { - ecmaVersion: 6 - }, - errors: [{ message: "Strings must use singlequote.", type: "TemplateLiteral" }] - }, - { - code: "var foo = 'don\\'t';", - output: "var foo = \"don't\";", - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var msg = \"Plugin '\" + name + \"' not found\"", - output: "var msg = 'Plugin \\'' + name + '\\' not found'", - options: ["single"], - errors: [ - { message: "Strings must use singlequote.", type: "Literal", column: 11 }, - { message: "Strings must use singlequote.", type: "Literal", column: 31 } - ] - }, - { - code: "var foo = 'bar';", - output: "var foo = \"bar\";", - options: ["double"], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var foo = `bar`;", - output: "var foo = \"bar\";", - options: ["double"], - parserOptions: { - ecmaVersion: 6 - }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "var foo = \"bar\";", - output: "var foo = 'bar';", - options: ["single", { avoidEscape: true }], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }] - }, - { - code: "var foo = 'bar';", - output: "var foo = \"bar\";", - options: ["double", { avoidEscape: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var foo = '\\\\';", - output: "var foo = \"\\\\\";", - options: ["double", { avoidEscape: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var foo = \"bar\";", - output: "var foo = 'bar';", - options: ["single", { allowTemplateLiterals: true }], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }] - }, - { - code: "var foo = 'bar';", - output: "var foo = \"bar\";", - options: ["double", { allowTemplateLiterals: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }] - }, - { - code: "var foo = 'bar';", - output: "var foo = `bar`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "var foo = 'b${x}a$r';", - output: "var foo = `b\\${x}a$r`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "var foo = \"bar\";", - output: "var foo = `bar`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "var foo = \"bar\";", - output: "var foo = `bar`;", - options: ["backtick", { avoidEscape: true }], - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "var foo = 'bar';", - output: "var foo = `bar`;", - options: ["backtick", { avoidEscape: true }], - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, + // Babel + "<>foo;", + { code: "<>foo;", options: ["single"] }, + { code: "<>foo;", options: ["double"] }, + "<>
;", + { code: "<>
;", options: ["single"] }, + { code: "<>
;", options: ["double"] }, + ], + invalid: [ + { + code: "var foo = 'bar';", + output: 'var foo = "bar";', + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: 'var foo = "bar";', + output: "var foo = 'bar';", + options: ["single"], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }], + }, + { + code: "var foo = `bar`;", + output: "var foo = 'bar';", + options: ["single"], + parserOptions: { + ecmaVersion: 6, + }, + errors: [ + { message: "Strings must use singlequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "var foo = 'don\\'t';", + output: 'var foo = "don\'t";', + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: 'var msg = "Plugin \'" + name + "\' not found"', + output: "var msg = 'Plugin \\'' + name + '\\' not found'", + options: ["single"], + errors: [ + { + message: "Strings must use singlequote.", + type: "Literal", + column: 11, + }, + { + message: "Strings must use singlequote.", + type: "Literal", + column: 31, + }, + ], + }, + { + code: "var foo = 'bar';", + output: 'var foo = "bar";', + options: ["double"], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: "var foo = `bar`;", + output: 'var foo = "bar";', + options: ["double"], + parserOptions: { + ecmaVersion: 6, + }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: 'var foo = "bar";', + output: "var foo = 'bar';", + options: ["single", { avoidEscape: true }], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }], + }, + { + code: "var foo = 'bar';", + output: 'var foo = "bar";', + options: ["double", { avoidEscape: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: "var foo = '\\\\';", + output: 'var foo = "\\\\";', + options: ["double", { avoidEscape: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: 'var foo = "bar";', + output: "var foo = 'bar';", + options: ["single", { allowTemplateLiterals: true }], + errors: [{ message: "Strings must use singlequote.", type: "Literal" }], + }, + { + code: "var foo = 'bar';", + output: 'var foo = "bar";', + options: ["double", { allowTemplateLiterals: true }], + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: "var foo = 'bar';", + output: "var foo = `bar`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: "var foo = 'b${x}a$r';", + output: "var foo = `b\\${x}a$r`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: 'var foo = "bar";', + output: "var foo = `bar`;", + options: ["backtick"], + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: 'var foo = "bar";', + output: "var foo = `bar`;", + options: ["backtick", { avoidEscape: true }], + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: "var foo = 'bar';", + output: "var foo = `bar`;", + options: ["backtick", { avoidEscape: true }], + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, - // "use strict" is *not* a directive prologue in these statements so is subject to the rule - { - code: "var foo = `backtick`; \"use strict\";", - output: "var foo = `backtick`; `use strict`;", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "{ \"use strict\"; var foo = `backtick`; }", - output: "{ `use strict`; var foo = `backtick`; }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, - { - code: "if (1) { \"use strict\"; var foo = `backtick`; }", - output: "if (1) { `use strict`; var foo = `backtick`; }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }] - }, + // "use strict" is *not* a directive prologue in these statements so is subject to the rule + { + code: 'var foo = `backtick`; "use strict";', + output: "var foo = `backtick`; `use strict`;", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: '{ "use strict"; var foo = `backtick`; }', + output: "{ `use strict`; var foo = `backtick`; }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, + { + code: 'if (1) { "use strict"; var foo = `backtick`; }', + output: "if (1) { `use strict`; var foo = `backtick`; }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, - // `backtick` should warn computed property names. - { - code: "var obj = {[\"key0\"]: 0, ['key1']: 1};", - output: "var obj = {[`key0`]: 0, [`key1`]: 1};", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use backtick.", type: "Literal" }, - { message: "Strings must use backtick.", type: "Literal" } - ] - }, - { - code: "class Foo { ['a'](){} static ['b'](){} }", - output: "class Foo { [`a`](){} static [`b`](){} }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use backtick.", type: "Literal" }, - { message: "Strings must use backtick.", type: "Literal" } - ] - }, + // `backtick` should warn computed property names. + { + code: "var obj = {[\"key0\"]: 0, ['key1']: 1};", + output: "var obj = {[`key0`]: 0, [`key1`]: 1};", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use backtick.", type: "Literal" }, + { message: "Strings must use backtick.", type: "Literal" }, + ], + }, + { + code: "class Foo { ['a'](){} static ['b'](){} }", + output: "class Foo { [`a`](){} static [`b`](){} }", + options: ["backtick"], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use backtick.", type: "Literal" }, + { message: "Strings must use backtick.", type: "Literal" }, + ], + }, - // https://github.com/eslint/eslint/issues/7084 - { - code: "
", - output: "
", - options: ["single"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [ - { message: "Strings must use singlequote.", type: "Literal" } - ] - }, - { - code: "
", - output: "
", - options: ["double"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [ - { message: "Strings must use doublequote.", type: "Literal" } - ] - }, - { - code: "
", - output: "
", - options: ["backtick"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [ - { message: "Strings must use backtick.", type: "Literal" } - ] - }, + // https://github.com/eslint/eslint/issues/7084 + { + code: '
', + output: "
", + options: ["single"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [{ message: "Strings must use singlequote.", type: "Literal" }], + }, + { + code: "
", + output: '
', + options: ["double"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [{ message: "Strings must use doublequote.", type: "Literal" }], + }, + { + code: "
", + output: "
", + options: ["backtick"], + parserOptions: { ecmaFeatures: { jsx: true } }, + errors: [{ message: "Strings must use backtick.", type: "Literal" }], + }, - // https://github.com/eslint/eslint/issues/7610 - { - code: "`use strict`;", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "function foo() { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "foo = function() { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "() => { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "() => { foo(); `use strict`; }", - output: "() => { foo(); \"use strict\"; }", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "foo(); `use strict`;", - output: "foo(); \"use strict\";", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, + // https://github.com/eslint/eslint/issues/7610 + { + code: "`use strict`;", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "function foo() { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "foo = function() { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "() => { `use strict`; foo(); }", + output: null, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "() => { foo(); `use strict`; }", + output: '() => { foo(); "use strict"; }', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "foo(); `use strict`;", + output: 'foo(); "use strict";', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, - // https://github.com/eslint/eslint/issues/7646 - { - code: "var foo = `foo\\nbar`;", - output: "var foo = \"foo\\nbar\";", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "var foo = `foo\\\nbar`;", // 1 backslash followed by a newline - output: "var foo = \"foo\\\nbar\";", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "var foo = `foo\\\\\\\nbar`;", // 3 backslashes followed by a newline - output: "var foo = \"foo\\\\\\\nbar\";", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral" }] - }, - { - code: "````", - output: "\"\"``", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use doublequote.", type: "TemplateLiteral", line: 1, column: 1 }] - } - ], + // https://github.com/eslint/eslint/issues/7646 + { + code: "var foo = `foo\\nbar`;", + output: 'var foo = "foo\\nbar";', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "var foo = `foo\\\nbar`;", // 1 backslash followed by a newline + output: 'var foo = "foo\\\nbar";', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "var foo = `foo\\\\\\\nbar`;", // 3 backslashes followed by a newline + output: 'var foo = "foo\\\\\\\nbar";', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { message: "Strings must use doublequote.", type: "TemplateLiteral" }, + ], + }, + { + code: "````", + output: '""``', + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Strings must use doublequote.", + type: "TemplateLiteral", + line: 1, + column: 1, + }, + ], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/semi.js b/eslint/babel-eslint-plugin/test/rules/semi.js index b76ef6e2e031..ac95f38482db 100644 --- a/eslint/babel-eslint-plugin/test/rules/semi.js +++ b/eslint/babel-eslint-plugin/test/rules/semi.js @@ -10,195 +10,686 @@ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../rules/semi"), - RuleTester = require("../helpers/RuleTester"); +const rule = require("../../src/rules/semi"), + RuleTester = require("../helpers/RuleTester"); const ruleTester = new RuleTester(); ruleTester.run("semi", rule, { - valid: [ - "var x = 5;", - "var x =5, y;", - "foo();", - "x = foo();", - "setTimeout(function() {foo = \"bar\"; });", - "setTimeout(function() {foo = \"bar\";});", - "for (var a in b){}", - "for (var i;;){}", - "if (true) {}\n;[global, extended].forEach(function(){});", - "throw new Error('foo');", - { code: "throw new Error('foo')", options: ["never"] }, - { code: "var x = 5", options: ["never"] }, - { code: "var x =5, y", options: ["never"] }, - { code: "foo()", options: ["never"] }, - { code: "debugger", options: ["never"] }, - { code: "for (var a in b){}", options: ["never"] }, - { code: "for (var i;;){}", options: ["never"] }, - { code: "x = foo()", options: ["never"] }, - { code: "if (true) {}\n;[global, extended].forEach(function(){})", options: ["never"] }, - { code: "(function bar() {})\n;(function foo(){})", options: ["never"] }, - { code: ";/foo/.test('bar')", options: ["never"] }, - { code: ";+5", options: ["never"] }, - { code: ";-foo()", options: ["never"] }, - { code: "a++\nb++", options: ["never"] }, - { code: "a++; b++", options: ["never"] }, - { code: "for (let thing of {}) {\n console.log(thing);\n}", parserOptions: { ecmaVersion: 6 } }, - { code: "do{}while(true)", options: ["never"] }, - { code: "do{}while(true);", options: ["always"] }, - - { code: "if (foo) { bar() }", options: ["always", { omitLastInOneLineBlock: true }] }, - { code: "if (foo) { bar(); baz() }", options: ["always", { omitLastInOneLineBlock: true }] }, - - - // method definitions don't have a semicolon. - { code: "class A { a() {} b() {} }", parserOptions: { ecmaVersion: 6 } }, - { code: "var A = class { a() {} b() {} };", parserOptions: { ecmaVersion: 6 } }, - - { code: "import theDefault, { named1, named2 } from 'src/mylib';", parserOptions: { sourceType: "module" } }, - { code: "import theDefault, { named1, named2 } from 'src/mylib'", options: ["never"], parserOptions: { sourceType: "module" } }, - - // exports, "always" - { code: "export * from 'foo';", parserOptions: { sourceType: "module" } }, - { code: "export { foo } from 'foo';", parserOptions: { sourceType: "module" } }, - { code: "export { foo };", parserOptions: { sourceType: "module" } }, - { code: "export var foo;", parserOptions: { sourceType: "module" } }, - { code: "export function foo () { }", parserOptions: { sourceType: "module" } }, - { code: "export function* foo () { }", parserOptions: { sourceType: "module" } }, - { code: "export class Foo { }", parserOptions: { sourceType: "module" } }, - { code: "export let foo;", parserOptions: { sourceType: "module" } }, - { code: "export const FOO = 42;", parserOptions: { sourceType: "module" } }, - { code: "export default function() { }", parserOptions: { sourceType: "module" } }, - { code: "export default function* () { }", parserOptions: { sourceType: "module" } }, - { code: "export default class { }", parserOptions: { sourceType: "module" } }, - { code: "export default foo || bar;", parserOptions: { sourceType: "module" } }, - { code: "export default (foo) => foo.bar();", parserOptions: { sourceType: "module" } }, - { code: "export default foo = 42;", parserOptions: { sourceType: "module" } }, - { code: "export default foo += 42;", parserOptions: { sourceType: "module" } }, - - // exports, "never" - { code: "export * from 'foo'", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export { foo } from 'foo'", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export { foo }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export var foo", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export function foo () { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export function* foo () { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export class Foo { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export let foo", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export const FOO = 42", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default function() { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default function* () { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default class { }", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default foo || bar", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default (foo) => foo.bar()", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default foo = 42", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "export default foo += 42", options: ["never"], parserOptions: { sourceType: "module" } }, - { code: "++\nfoo;", options: ["always"] }, - { code: "var a = b;\n+ c", options: ["never"] }, - - // https://github.com/eslint/eslint/issues/7782 - { code: "var a = b;\n/foo/.test(c)", options: ["never"] }, - { code: "var a = b;\n`foo`", options: ["never"], parserOptions: { ecmaVersion: 6 } }, - - // babel - "class Foo { bar = 'example'; }", - "class Foo { static bar = 'example'; }", - { code: "async function foo() { for await (let thing of {}) { console.log(thing); } }", parserOptions: { ecmaVersion: 6 } }, - { code: "class Foo { bar = () => {}; }", options: ["always", { omitLastInOneLineBlock: true }] }, - - // babel, "never" - { code: "class Foo { bar = 'example' }", options: ["never"] }, - { code: "class Foo { static bar = 'example' }", options: ["never"] }, - { code: "class Foo { bar = () => {} }", options: ["never"] }, - ], - invalid: [ - { code: "import * as utils from './utils'", output: "import * as utils from './utils';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration", column: 33 }] }, - { code: "import { square, diag } from 'lib'", output: "import { square, diag } from 'lib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, - { code: "import { default as foo } from 'lib'", output: "import { default as foo } from 'lib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, - { code: "import 'src/mylib'", output: "import 'src/mylib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, - { code: "import theDefault, { named1, named2 } from 'src/mylib'", output: "import theDefault, { named1, named2 } from 'src/mylib';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }] }, - { code: "function foo() { return [] }", output: "function foo() { return []; }", errors: [{ message: "Missing semicolon.", type: "ReturnStatement" }] }, - { code: "while(true) { break }", output: "while(true) { break; }", errors: [{ message: "Missing semicolon.", type: "BreakStatement" }] }, - { code: "while(true) { continue }", output: "while(true) { continue; }", errors: [{ message: "Missing semicolon.", type: "ContinueStatement" }] }, - { code: "let x = 5", output: "let x = 5;", parserOptions: { ecmaVersion: 6 }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "var x = 5", output: "var x = 5;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "var x = 5, y", output: "var x = 5, y;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "debugger", output: "debugger;", errors: [{ message: "Missing semicolon.", type: "DebuggerStatement" }] }, - { code: "foo()", output: "foo();", errors: [{ message: "Missing semicolon.", type: "ExpressionStatement" }] }, - { code: "var x = 5, y", output: "var x = 5, y;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "for (var a in b) var i ", output: "for (var a in b) var i; ", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "for (;;){var i}", output: "for (;;){var i;}", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "for (;;) var i ", output: "for (;;) var i; ", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "for (var j;;) {var i}", output: "for (var j;;) {var i;}", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "var foo = {\n bar: baz\n}", output: "var foo = {\n bar: baz\n};", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration", line: 3 }] }, - { code: "var foo\nvar bar;", output: "var foo;\nvar bar;", errors: [{ message: "Missing semicolon.", type: "VariableDeclaration", line: 1 }] }, - { code: "throw new Error('foo')", output: "throw new Error('foo');", errors: [{ message: "Missing semicolon.", type: "ThrowStatement", line: 1 }] }, - { code: "do{}while(true)", output: "do{}while(true);", errors: [{ message: "Missing semicolon.", type: "DoWhileStatement", line: 1 }] }, - - { code: "throw new Error('foo');", output: "throw new Error('foo')", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ThrowStatement", column: 23 }] }, - { code: "function foo() { return []; }", output: "function foo() { return [] }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ReturnStatement" }] }, - { code: "while(true) { break; }", output: "while(true) { break }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "BreakStatement" }] }, - { code: "while(true) { continue; }", output: "while(true) { continue }", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ContinueStatement" }] }, - { code: "let x = 5;", output: "let x = 5", parserOptions: { ecmaVersion: 6 }, options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "var x = 5;", output: "var x = 5", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "var x = 5, y;", output: "var x = 5, y", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "debugger;", output: "debugger", options: ["never"], errors: [{ message: "Extra semicolon.", type: "DebuggerStatement" }] }, - { code: "foo();", output: "foo()", options: ["never"], errors: [{ message: "Extra semicolon.", type: "ExpressionStatement" }] }, - { code: "var x = 5, y;", output: "var x = 5, y", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "for (var a in b) var i; ", output: "for (var a in b) var i ", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "for (;;){var i;}", output: "for (;;){var i}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "for (;;) var i; ", output: "for (;;) var i ", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "for (var j;;) {var i;}", output: "for (var j;;) {var i}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "var foo = {\n bar: baz\n};", output: "var foo = {\n bar: baz\n}", options: ["never"], errors: [{ message: "Extra semicolon.", type: "VariableDeclaration", line: 3 }] }, - { code: "import theDefault, { named1, named2 } from 'src/mylib';", output: "import theDefault, { named1, named2 } from 'src/mylib'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ImportDeclaration" }] }, - { code: "do{}while(true);", output: "do{}while(true)", options: ["never"], errors: [{ message: "Extra semicolon.", type: "DoWhileStatement", line: 1 }] }, - - { code: "if (foo) { bar()\n }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, - { code: "if (foo) {\n bar() }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, - { code: "if (foo) {\n bar(); baz() }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Missing semicolon." }] }, - { code: "if (foo) { bar(); }", options: ["always", { omitLastInOneLineBlock: true }], errors: [{ message: "Extra semicolon." }] }, - - - // exports, "always" - { code: "export * from 'foo'", output: "export * from 'foo';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportAllDeclaration" }] }, - { code: "export { foo } from 'foo'", output: "export { foo } from 'foo';", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportNamedDeclaration" }] }, - { code: "export { foo }", output: "export { foo };", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportNamedDeclaration" }] }, - { code: "export var foo", output: "export var foo;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "export let foo", output: "export let foo;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "export const FOO = 42", output: "export const FOO = 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }] }, - { code: "export default foo || bar", output: "export default foo || bar;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default (foo) => foo.bar()", output: "export default (foo) => foo.bar();", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default foo = 42", output: "export default foo = 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default foo += 42", output: "export default foo += 42;", parserOptions: { sourceType: "module" }, errors: [{ message: "Missing semicolon.", type: "ExportDefaultDeclaration" }] }, - - // exports, "never" - { code: "export * from 'foo';", output: "export * from 'foo'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportAllDeclaration" }] }, - { code: "export { foo } from 'foo';", output: "export { foo } from 'foo'", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }] }, - { code: "export { foo };", output: "export { foo }", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }] }, - { code: "export var foo;", output: "export var foo", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "export let foo;", output: "export let foo", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "export const FOO = 42;", output: "export const FOO = 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }] }, - { code: "export default foo || bar;", output: "export default foo || bar", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default (foo) => foo.bar();", output: "export default (foo) => foo.bar()", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default foo = 42;", output: "export default foo = 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "export default foo += 42;", output: "export default foo += 42", options: ["never"], parserOptions: { sourceType: "module" }, errors: [{ message: "Extra semicolon.", type: "ExportDefaultDeclaration" }] }, - { code: "a;\n++b", output: "a\n++b", options: ["never"], errors: [{ message: "Extra semicolon." }] }, - - // babel - { code: "class Foo { bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, - { code: "class Foo { static bar = 'example' }", errors: [{ message: "Missing semicolon." }] }, - { - code: "class Foo { bar = () => {} }", - options: ["always", { omitLastInOneLineBlock: true }], - errors: [{ message: "Missing semicolon." }] - }, + valid: [ + "var x = 5;", + "var x =5, y;", + "foo();", + "x = foo();", + 'setTimeout(function() {foo = "bar"; });', + 'setTimeout(function() {foo = "bar";});', + "for (var a in b){}", + "for (var i;;){}", + "if (true) {}\n;[global, extended].forEach(function(){});", + "throw new Error('foo');", + { code: "throw new Error('foo')", options: ["never"] }, + { code: "var x = 5", options: ["never"] }, + { code: "var x =5, y", options: ["never"] }, + { code: "foo()", options: ["never"] }, + { code: "debugger", options: ["never"] }, + { code: "for (var a in b){}", options: ["never"] }, + { code: "for (var i;;){}", options: ["never"] }, + { code: "x = foo()", options: ["never"] }, + { + code: "if (true) {}\n;[global, extended].forEach(function(){})", + options: ["never"], + }, + { code: "(function bar() {})\n;(function foo(){})", options: ["never"] }, + { code: ";/foo/.test('bar')", options: ["never"] }, + { code: ";+5", options: ["never"] }, + { code: ";-foo()", options: ["never"] }, + { code: "a++\nb++", options: ["never"] }, + { code: "a++; b++", options: ["never"] }, + { + code: "for (let thing of {}) {\n console.log(thing);\n}", + parserOptions: { ecmaVersion: 6 }, + }, + { code: "do{}while(true)", options: ["never"] }, + { code: "do{}while(true);", options: ["always"] }, + + { + code: "if (foo) { bar() }", + options: ["always", { omitLastInOneLineBlock: true }], + }, + { + code: "if (foo) { bar(); baz() }", + options: ["always", { omitLastInOneLineBlock: true }], + }, + + // method definitions don't have a semicolon. + { code: "class A { a() {} b() {} }", parserOptions: { ecmaVersion: 6 } }, + { + code: "var A = class { a() {} b() {} };", + parserOptions: { ecmaVersion: 6 }, + }, + + { + code: "import theDefault, { named1, named2 } from 'src/mylib';", + parserOptions: { sourceType: "module" }, + }, + { + code: "import theDefault, { named1, named2 } from 'src/mylib'", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + + // exports, "always" + { code: "export * from 'foo';", parserOptions: { sourceType: "module" } }, + { + code: "export { foo } from 'foo';", + parserOptions: { sourceType: "module" }, + }, + { code: "export { foo };", parserOptions: { sourceType: "module" } }, + { code: "export var foo;", parserOptions: { sourceType: "module" } }, + { + code: "export function foo () { }", + parserOptions: { sourceType: "module" }, + }, + { + code: "export function* foo () { }", + parserOptions: { sourceType: "module" }, + }, + { code: "export class Foo { }", parserOptions: { sourceType: "module" } }, + { code: "export let foo;", parserOptions: { sourceType: "module" } }, + { code: "export const FOO = 42;", parserOptions: { sourceType: "module" } }, + { + code: "export default function() { }", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default function* () { }", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default class { }", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo || bar;", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default (foo) => foo.bar();", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo = 42;", + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo += 42;", + parserOptions: { sourceType: "module" }, + }, + + // exports, "never" + { + code: "export * from 'foo'", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export { foo } from 'foo'", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export { foo }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export var foo", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export function foo () { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export function* foo () { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export class Foo { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export let foo", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export const FOO = 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default function() { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default function* () { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default class { }", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo || bar", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default (foo) => foo.bar()", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo = 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { + code: "export default foo += 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + }, + { code: "++\nfoo;", options: ["always"] }, + { code: "var a = b;\n+ c", options: ["never"] }, + + // https://github.com/eslint/eslint/issues/7782 + { code: "var a = b;\n/foo/.test(c)", options: ["never"] }, + { + code: "var a = b;\n`foo`", + options: ["never"], + parserOptions: { ecmaVersion: 6 }, + }, - // babel, "never" - { code: "class Foo { bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] }, - { code: "class Foo { static bar = 'example'; }", options: ["never"], errors: [{ message: "Extra semicolon." }] }, + // babel + "class Foo { bar = 'example'; }", + "class Foo { static bar = 'example'; }", + { + code: + "async function foo() { for await (let thing of {}) { console.log(thing); } }", + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "class Foo { bar = () => {}; }", + options: ["always", { omitLastInOneLineBlock: true }], + }, + + // babel, "never" + { code: "class Foo { bar = 'example' }", options: ["never"] }, + { code: "class Foo { static bar = 'example' }", options: ["never"] }, + { code: "class Foo { bar = () => {} }", options: ["never"] }, + ], + invalid: [ + { + code: "import * as utils from './utils'", + output: "import * as utils from './utils';", + parserOptions: { sourceType: "module" }, + errors: [ { - code: "class Foo { bar = () => {}; }", - options: ["never"], - errors: [{ message: "Extra semicolon." }] + message: "Missing semicolon.", + type: "ImportDeclaration", + column: 33, }, - ] + ], + }, + { + code: "import { square, diag } from 'lib'", + output: "import { square, diag } from 'lib';", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], + }, + { + code: "import { default as foo } from 'lib'", + output: "import { default as foo } from 'lib';", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], + }, + { + code: "import 'src/mylib'", + output: "import 'src/mylib';", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], + }, + { + code: "import theDefault, { named1, named2 } from 'src/mylib'", + output: "import theDefault, { named1, named2 } from 'src/mylib';", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], + }, + { + code: "function foo() { return [] }", + output: "function foo() { return []; }", + errors: [{ message: "Missing semicolon.", type: "ReturnStatement" }], + }, + { + code: "while(true) { break }", + output: "while(true) { break; }", + errors: [{ message: "Missing semicolon.", type: "BreakStatement" }], + }, + { + code: "while(true) { continue }", + output: "while(true) { continue; }", + errors: [{ message: "Missing semicolon.", type: "ContinueStatement" }], + }, + { + code: "let x = 5", + output: "let x = 5;", + parserOptions: { ecmaVersion: 6 }, + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var x = 5", + output: "var x = 5;", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var x = 5, y", + output: "var x = 5, y;", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "debugger", + output: "debugger;", + errors: [{ message: "Missing semicolon.", type: "DebuggerStatement" }], + }, + { + code: "foo()", + output: "foo();", + errors: [{ message: "Missing semicolon.", type: "ExpressionStatement" }], + }, + { + code: "var x = 5, y", + output: "var x = 5, y;", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (var a in b) var i ", + output: "for (var a in b) var i; ", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (;;){var i}", + output: "for (;;){var i;}", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (;;) var i ", + output: "for (;;) var i; ", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (var j;;) {var i}", + output: "for (var j;;) {var i;}", + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var foo = {\n bar: baz\n}", + output: "var foo = {\n bar: baz\n};", + errors: [ + { message: "Missing semicolon.", type: "VariableDeclaration", line: 3 }, + ], + }, + { + code: "var foo\nvar bar;", + output: "var foo;\nvar bar;", + errors: [ + { message: "Missing semicolon.", type: "VariableDeclaration", line: 1 }, + ], + }, + { + code: "throw new Error('foo')", + output: "throw new Error('foo');", + errors: [ + { message: "Missing semicolon.", type: "ThrowStatement", line: 1 }, + ], + }, + { + code: "do{}while(true)", + output: "do{}while(true);", + errors: [ + { message: "Missing semicolon.", type: "DoWhileStatement", line: 1 }, + ], + }, + + { + code: "throw new Error('foo');", + output: "throw new Error('foo')", + options: ["never"], + errors: [ + { message: "Extra semicolon.", type: "ThrowStatement", column: 23 }, + ], + }, + { + code: "function foo() { return []; }", + output: "function foo() { return [] }", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "ReturnStatement" }], + }, + { + code: "while(true) { break; }", + output: "while(true) { break }", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "BreakStatement" }], + }, + { + code: "while(true) { continue; }", + output: "while(true) { continue }", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "ContinueStatement" }], + }, + { + code: "let x = 5;", + output: "let x = 5", + parserOptions: { ecmaVersion: 6 }, + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var x = 5;", + output: "var x = 5", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var x = 5, y;", + output: "var x = 5, y", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "debugger;", + output: "debugger", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "DebuggerStatement" }], + }, + { + code: "foo();", + output: "foo()", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "ExpressionStatement" }], + }, + { + code: "var x = 5, y;", + output: "var x = 5, y", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (var a in b) var i; ", + output: "for (var a in b) var i ", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (;;){var i;}", + output: "for (;;){var i}", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (;;) var i; ", + output: "for (;;) var i ", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "for (var j;;) {var i;}", + output: "for (var j;;) {var i}", + options: ["never"], + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "var foo = {\n bar: baz\n};", + output: "var foo = {\n bar: baz\n}", + options: ["never"], + errors: [ + { message: "Extra semicolon.", type: "VariableDeclaration", line: 3 }, + ], + }, + { + code: "import theDefault, { named1, named2 } from 'src/mylib';", + output: "import theDefault, { named1, named2 } from 'src/mylib'", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "ImportDeclaration" }], + }, + { + code: "do{}while(true);", + output: "do{}while(true)", + options: ["never"], + errors: [ + { message: "Extra semicolon.", type: "DoWhileStatement", line: 1 }, + ], + }, + + { + code: "if (foo) { bar()\n }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Missing semicolon." }], + }, + { + code: "if (foo) {\n bar() }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Missing semicolon." }], + }, + { + code: "if (foo) {\n bar(); baz() }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Missing semicolon." }], + }, + { + code: "if (foo) { bar(); }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Extra semicolon." }], + }, + + // exports, "always" + { + code: "export * from 'foo'", + output: "export * from 'foo';", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "ExportAllDeclaration" }], + }, + { + code: "export { foo } from 'foo'", + output: "export { foo } from 'foo';", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportNamedDeclaration" }, + ], + }, + { + code: "export { foo }", + output: "export { foo };", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportNamedDeclaration" }, + ], + }, + { + code: "export var foo", + output: "export var foo;", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export let foo", + output: "export let foo;", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export const FOO = 42", + output: "export const FOO = 42;", + parserOptions: { sourceType: "module" }, + errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export default foo || bar", + output: "export default foo || bar;", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default (foo) => foo.bar()", + output: "export default (foo) => foo.bar();", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default foo = 42", + output: "export default foo = 42;", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default foo += 42", + output: "export default foo += 42;", + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + + // exports, "never" + { + code: "export * from 'foo';", + output: "export * from 'foo'", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "ExportAllDeclaration" }], + }, + { + code: "export { foo } from 'foo';", + output: "export { foo } from 'foo'", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }], + }, + { + code: "export { foo };", + output: "export { foo }", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }], + }, + { + code: "export var foo;", + output: "export var foo", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export let foo;", + output: "export let foo", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export const FOO = 42;", + output: "export const FOO = 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], + }, + { + code: "export default foo || bar;", + output: "export default foo || bar", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default (foo) => foo.bar();", + output: "export default (foo) => foo.bar()", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default foo = 42;", + output: "export default foo = 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "export default foo += 42;", + output: "export default foo += 42", + options: ["never"], + parserOptions: { sourceType: "module" }, + errors: [ + { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, + ], + }, + { + code: "a;\n++b", + output: "a\n++b", + options: ["never"], + errors: [{ message: "Extra semicolon." }], + }, + + // babel + { + code: "class Foo { bar = 'example' }", + errors: [{ message: "Missing semicolon." }], + }, + { + code: "class Foo { static bar = 'example' }", + errors: [{ message: "Missing semicolon." }], + }, + { + code: "class Foo { bar = () => {} }", + options: ["always", { omitLastInOneLineBlock: true }], + errors: [{ message: "Missing semicolon." }], + }, + + // babel, "never" + { + code: "class Foo { bar = 'example'; }", + options: ["never"], + errors: [{ message: "Extra semicolon." }], + }, + { + code: "class Foo { static bar = 'example'; }", + options: ["never"], + errors: [{ message: "Extra semicolon." }], + }, + { + code: "class Foo { bar = () => {}; }", + options: ["never"], + errors: [{ message: "Extra semicolon." }], + }, + ], }); diff --git a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js index 6b8bc7c54c82..c6092a72f688 100644 --- a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js +++ b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js @@ -9,8 +9,8 @@ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../rules/valid-typeof"), - RuleTester = require("../helpers/RuleTester"); +const rule = require("../../src/rules/valid-typeof"), + RuleTester = require("../helpers/RuleTester"); //------------------------------------------------------------------------------ // Tests @@ -19,175 +19,240 @@ const rule = require("../../rules/valid-typeof"), const ruleTester = new RuleTester(); ruleTester.run("valid-typeof", rule, { - valid: [ - // Original test cases. - "typeof foo === 'string'", - "typeof foo === 'object'", - "typeof foo === 'function'", - "typeof foo === 'undefined'", - "typeof foo === 'boolean'", - "typeof foo === 'number'", - "'string' === typeof foo", - "'object' === typeof foo", - "'function' === typeof foo", - "'undefined' === typeof foo", - "'boolean' === typeof foo", - "'number' === typeof foo", - "typeof foo === typeof bar", - "typeof foo === baz", - "typeof foo !== someType", - "typeof bar != someType", - "someType === typeof bar", - "someType == typeof bar", - "typeof foo == 'string'", - "typeof(foo) === 'string'", - "typeof(foo) !== 'string'", - "typeof(foo) == 'string'", - "typeof(foo) != 'string'", - "var oddUse = typeof foo + 'thing'", - { - code: "typeof foo === 'number'", - options: [{ requireStringLiterals: true }] - }, - { - code: "typeof foo === \"number\"", - options: [{ requireStringLiterals: true }] - }, - { - code: "var baz = typeof foo + 'thing'", - options: [{ requireStringLiterals: true }] - }, - { - code: "typeof foo === typeof bar", - options: [{ requireStringLiterals: true }] - }, - { - code: "typeof foo === `string`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 } - }, - { - code: "`object` === typeof foo", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 } - }, - { - code: "typeof foo === `str${somethingElse}`", - parserOptions: { ecmaVersion: 6 } - }, + valid: [ + // Original test cases. + "typeof foo === 'string'", + "typeof foo === 'object'", + "typeof foo === 'function'", + "typeof foo === 'undefined'", + "typeof foo === 'boolean'", + "typeof foo === 'number'", + "'string' === typeof foo", + "'object' === typeof foo", + "'function' === typeof foo", + "'undefined' === typeof foo", + "'boolean' === typeof foo", + "'number' === typeof foo", + "typeof foo === typeof bar", + "typeof foo === baz", + "typeof foo !== someType", + "typeof bar != someType", + "someType === typeof bar", + "someType == typeof bar", + "typeof foo == 'string'", + "typeof(foo) === 'string'", + "typeof(foo) !== 'string'", + "typeof(foo) == 'string'", + "typeof(foo) != 'string'", + "var oddUse = typeof foo + 'thing'", + { + code: "typeof foo === 'number'", + options: [{ requireStringLiterals: true }], + }, + { + code: 'typeof foo === "number"', + options: [{ requireStringLiterals: true }], + }, + { + code: "var baz = typeof foo + 'thing'", + options: [{ requireStringLiterals: true }], + }, + { + code: "typeof foo === typeof bar", + options: [{ requireStringLiterals: true }], + }, + { + code: "typeof foo === `string`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "`object` === typeof foo", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + }, + { + code: "typeof foo === `str${somethingElse}`", + parserOptions: { ecmaVersion: 6 }, + }, - // Babel-specific test cases. - { - code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'" - }, - { - code: "'bigint' === typeof BigInt(Number.MAX_SAFE_INTEGER)" - }, - { - code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", - options: [{ requireStringLiterals: true }] - }, - ], - invalid: [ - { - code: "typeof foo === 'strnig'", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "'strnig' === typeof foo", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "if (typeof bar === 'umdefined') {}", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "typeof foo !== 'strnig'", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "'strnig' !== typeof foo", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "if (typeof bar !== 'umdefined') {}", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "typeof foo != 'strnig'", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "'strnig' != typeof foo", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "if (typeof bar != 'umdefined') {}", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "typeof foo == 'strnig'", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "'strnig' == typeof foo", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "if (typeof bar == 'umdefined') {}", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "if (typeof bar === `umdefined`) {}", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Invalid typeof comparison value.", type: "TemplateLiteral" }] - }, - { - code: "typeof foo == 'invalid string'", - options: [{ requireStringLiterals: true }], - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "typeof foo == Object", - options: [{ requireStringLiterals: true }], - errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] - }, - { - code: "typeof foo === undefined", - options: [{ requireStringLiterals: true }], - errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] - }, - { - code: "undefined === typeof foo", - options: [{ requireStringLiterals: true }], - errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] - }, - { - code: "undefined == typeof foo", - options: [{ requireStringLiterals: true }], - errors: [{ message: "Typeof comparisons should be to string literals.", type: "Identifier" }] - }, - { - code: "typeof foo === `undefined${foo}`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Typeof comparisons should be to string literals.", type: "TemplateLiteral" }] - }, - { - code: "typeof foo === `${string}`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Typeof comparisons should be to string literals.", type: "TemplateLiteral" }] - }, + // Babel-specific test cases. + { + code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", + }, + { + code: "'bigint' === typeof BigInt(Number.MAX_SAFE_INTEGER)", + }, + { + code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", + options: [{ requireStringLiterals: true }], + }, + ], + invalid: [ + { + code: "typeof foo === 'strnig'", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "'strnig' === typeof foo", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "if (typeof bar === 'umdefined') {}", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "typeof foo !== 'strnig'", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "'strnig' !== typeof foo", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "if (typeof bar !== 'umdefined') {}", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "typeof foo != 'strnig'", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "'strnig' != typeof foo", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "if (typeof bar != 'umdefined') {}", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "typeof foo == 'strnig'", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "'strnig' == typeof foo", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "if (typeof bar == 'umdefined') {}", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "if (typeof bar === `umdefined`) {}", + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Invalid typeof comparison value.", + type: "TemplateLiteral", + }, + ], + }, + { + code: "typeof foo == 'invalid string'", + options: [{ requireStringLiterals: true }], + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "typeof foo == Object", + options: [{ requireStringLiterals: true }], + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "Identifier", + }, + ], + }, + { + code: "typeof foo === undefined", + options: [{ requireStringLiterals: true }], + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "Identifier", + }, + ], + }, + { + code: "undefined === typeof foo", + options: [{ requireStringLiterals: true }], + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "Identifier", + }, + ], + }, + { + code: "undefined == typeof foo", + options: [{ requireStringLiterals: true }], + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "Identifier", + }, + ], + }, + { + code: "typeof foo === `undefined${foo}`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "TemplateLiteral", + }, + ], + }, + { + code: "typeof foo === `${string}`", + options: [{ requireStringLiterals: true }], + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + message: "Typeof comparisons should be to string literals.", + type: "TemplateLiteral", + }, + ], + }, - // Babel-specific test cases. - { - code: "typeof foo === 'bgiint'", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - { - code: "'bignit' === typeof foo", - errors: [{ message: "Invalid typeof comparison value.", type: "Literal" }] - }, - ] + // Babel-specific test cases. + { + code: "typeof foo === 'bgiint'", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + { + code: "'bignit' === typeof foo", + errors: [ + { message: "Invalid typeof comparison value.", type: "Literal" }, + ], + }, + ], }); From e9e6918df6eeefc56f0deab9f7710de67f7c97d3 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sat, 16 Nov 2019 19:21:00 -0500 Subject: [PATCH 804/965] Do not run eslint/* tests in Node v6 --- jest.config.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 49 ------------------------------------------------- 2 files changed, 50 insertions(+), 49 deletions(-) create mode 100644 jest.config.js diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 000000000000..1a96c9632608 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,50 @@ +module.exports = { + collectCoverageFrom: [ + "packages/*/src/**/*.mjs", + "packages/*/src/**/*.js", + "codemods/*/src/**/*.mjs", + "codemods/*/src/**/*.js", + "eslint/*/src/**/*.mjs", + "eslint/*/src/**/*.js", + ], + // The eslint/* packages use ESLint v6, which has dropped support for Node v6. + testRegex: `./(packages|codemods${ + /^v6./u.test(process.version) ? "" : "|eslint" + })/[^/]+/test/.+\\.m?js$`, + testPathIgnorePatterns: [ + "/node_modules/", + "/test/fixtures/", + "/test/debug-fixtures/", + "/babel-parser/test/expressions/", + "/test/tmp/", + "/test/__data__/", + "/test/helpers/", + "/test/warning\\.js", + "/build/", + "_browser\\.js", + ], + testEnvironment: "node", + setupFilesAfterEnv: ["/test/testSetupFile.js"], + transformIgnorePatterns: [ + "/node_modules/", + "/packages/babel-standalone/babel(\\.min)?\\.js", + "/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js", + "/test/(fixtures|tmp|__data__)/", + "/(packages|codemods|eslint)/[^/]+/lib/", + ], + coveragePathIgnorePatterns: [ + "/node_modules/", + "/packages/babel-standalone/babel(\\.min)?\\.js", + "/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js", + "/test/(fixtures|tmp|__data__)/", + ], + modulePathIgnorePatterns: [ + "/test/fixtures/", + "/test/tmp/", + "/test/__data__/", + "/build/", + ], + moduleNameMapper: { + "^@babel/([a-zA-Z0-9_-]+)$": "/packages/babel-$1/", + }, +}; diff --git a/package.json b/package.json index 15ad863a8f59..5da887e649af 100644 --- a/package.json +++ b/package.json @@ -89,54 +89,5 @@ "hooks": { "pre-commit": "lint-staged" } - }, - "jest": { - "collectCoverageFrom": [ - "packages/*/src/**/*.mjs", - "packages/*/src/**/*.js", - "codemods/*/src/**/*.mjs", - "codemods/*/src/**/*.js", - "eslint/*/src/**/*.mjs", - "eslint/*/src/**/*.js" - ], - "testRegex": "./(packages|codemods|eslint)/[^/]+/test/.+\\.m?js$", - "testPathIgnorePatterns": [ - "/node_modules/", - "/test/fixtures/", - "/test/debug-fixtures/", - "/babel-parser/test/expressions/", - "/test/tmp/", - "/test/__data__/", - "/test/helpers/", - "/test/warning\\.js", - "/build/", - "_browser\\.js" - ], - "testEnvironment": "node", - "setupFilesAfterEnv": [ - "/test/testSetupFile.js" - ], - "transformIgnorePatterns": [ - "/node_modules/", - "/packages/babel-standalone/babel(\\.min)?\\.js", - "/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js", - "/test/(fixtures|tmp|__data__)/", - "/(packages|codemods)/[^/]+/lib/" - ], - "coveragePathIgnorePatterns": [ - "/node_modules/", - "/packages/babel-standalone/babel(\\.min)?\\.js", - "/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js", - "/test/(fixtures|tmp|__data__)/" - ], - "modulePathIgnorePatterns": [ - "/test/fixtures/", - "/test/tmp/", - "/test/__data__/", - "/build/" - ], - "moduleNameMapper": { - "^@babel/([a-zA-Z0-9_-]+)$": "/packages/babel-$1/" - } } } From db2b6018864f308816205fef009f8793ec295fe5 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sun, 17 Nov 2019 18:34:47 -0500 Subject: [PATCH 805/965] Add TODO comment --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index 1a96c9632608..6145dd3f2f5a 100644 --- a/jest.config.js +++ b/jest.config.js @@ -8,6 +8,7 @@ module.exports = { "eslint/*/src/**/*.js", ], // The eslint/* packages use ESLint v6, which has dropped support for Node v6. + // TODO: Remove this process.version check in Babel 8. testRegex: `./(packages|codemods${ /^v6./u.test(process.version) ? "" : "|eslint" })/[^/]+/test/.+\\.m?js$`, From d18d0b6478feadf08a20c6608220bc6370ab0ecc Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sun, 17 Nov 2019 23:31:38 -0500 Subject: [PATCH 806/965] Run Prettier --- eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js | 2 +- eslint/babel-eslint-plugin/src/rules/arrow-parens.js | 2 +- .../babel-eslint-plugin/src/rules/func-params-comma-dangle.js | 2 +- eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js | 2 +- eslint/babel-eslint-plugin/src/rules/new-cap.js | 2 +- eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js | 2 +- eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js | 2 +- eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js | 2 +- eslint/babel-eslint-plugin/src/rules/object-shorthand.js | 2 +- eslint/babel-eslint-plugin/src/rules/semi.js | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js index e7eafff0d265..59228c20784d 100644 --- a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js @@ -37,7 +37,7 @@ module.exports = { console.log( "The babel/array-bracket-spacing rule is deprecated. Please " + - "use the built in array-bracket-spacing rule instead." + "use the built in array-bracket-spacing rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js index 848045ff7bcb..cdd25819311f 100644 --- a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js @@ -22,7 +22,7 @@ module.exports = { console.log( "The babel/arrow-parens rule is deprecated. Please " + - "use the built in arrow-parens rule instead." + "use the built in arrow-parens rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js index 40bd08b3bbd3..d50427103407 100644 --- a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js @@ -22,7 +22,7 @@ module.exports = { console.log( "The babel/func-params-comma-dangle rule is deprecated. Please " + - "use the built in comma-dangle rule instead." + "use the built in comma-dangle rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js index 6befc25d04ea..8d65262b5763 100644 --- a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js @@ -34,7 +34,7 @@ module.exports = { console.log( "The babel/generator-star-spacing rule is deprecated. Please " + - "use the built in generator-star-spacing rule instead." + "use the built in generator-star-spacing rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/new-cap.js b/eslint/babel-eslint-plugin/src/rules/new-cap.js index 3e09bb25df4b..17d40497550d 100644 --- a/eslint/babel-eslint-plugin/src/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/src/rules/new-cap.js @@ -15,5 +15,5 @@ function isDecorator(node) { module.exports = ruleComposer.filterReports( newCapRule, - problem => !isDecorator(problem.node) + problem => !isDecorator(problem.node), ); diff --git a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js index a46a19da8876..cf984f09b34e 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js @@ -18,7 +18,7 @@ module.exports = { console.log( "The babel/no-await-in-loop rule is deprecated. Please " + - "use the built in no-await-in-loop rule instead." + "use the built in no-await-in-loop rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js index 81c779d3c78e..6bc1db49d9ac 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js @@ -60,5 +60,5 @@ function isOptionalCallExpression(node) { module.exports = ruleComposer.filterReports( rule, problem => - !isInDoStatement(problem.node) && !isOptionalCallExpression(problem.node) + !isInDoStatement(problem.node) && !isOptionalCallExpression(problem.node), ); diff --git a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js index d3ec19620158..4b13d0bd3289 100644 --- a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js @@ -23,5 +23,5 @@ module.exports = ruleComposer.filterReports( } return true; - } + }, ); diff --git a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js index 21f41e639e79..92fb8949ef17 100644 --- a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js @@ -22,7 +22,7 @@ module.exports = { console.log( "The babel/object-shorthand rule is deprecated. Please " + - "use the built in object-shorthand rule instead." + "use the built in object-shorthand rule instead.", ); isWarnedForDeprecation = true; }, diff --git a/eslint/babel-eslint-plugin/src/rules/semi.js b/eslint/babel-eslint-plugin/src/rules/semi.js index 8888bf4cacc8..d732f42dcd0e 100644 --- a/eslint/babel-eslint-plugin/src/rules/semi.js +++ b/eslint/babel-eslint-plugin/src/rules/semi.js @@ -119,5 +119,5 @@ module.exports = ruleComposer.filterReports( } return true; - } + }, ); From faf149226b1fc1fc4ba058526ace31701a80dc8e Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Mon, 18 Nov 2019 09:27:53 +0100 Subject: [PATCH 807/965] minor config change (#10731) --- .../package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json index 747fa0fe68e7..f1807a9b4ce4 100644 --- a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json +++ b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json @@ -21,8 +21,5 @@ "devDependencies": { "@babel/core": "^7.0.0", "@babel/helper-plugin-test-runner": "^7.0.0" - }, - "publishConfig": { - "access": "public" } } From cfd26fdbf27a4c3eae2311ca145e36bc13dd2abc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 18 Nov 2019 13:04:34 -0500 Subject: [PATCH 808/965] register ImportEqualsSpecifier to scope (#10710) Co-authored-by: --- .../src/plugins/typescript/index.js | 7 + .../export-named-import-require/input.ts | 2 + .../export-named-import-require/output.json | 171 ++++++++++++++++++ 3 files changed, 180 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 4cf196b9a704..1ca9c6a71cce 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -21,6 +21,7 @@ import { BIND_TS_AMBIENT, BIND_TS_NAMESPACE, BIND_CLASS, + BIND_LEXICAL, } from "../../util/scopeflags"; import TypeScriptScopeHandler from "./scope"; import * as charCodes from "charcodes"; @@ -1292,6 +1293,12 @@ export default (superClass: Class): Class => ): N.TsImportEqualsDeclaration { node.isExport = isExport || false; node.id = this.parseIdentifier(); + this.checkLVal( + node.id, + BIND_LEXICAL, + undefined, + "import equals declaration", + ); this.expect(tt.eq); node.moduleReference = this.tsParseModuleReference(); this.semicolon(); diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/input.ts b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/input.ts new file mode 100644 index 000000000000..6823138bafd9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/input.ts @@ -0,0 +1,2 @@ +import a = require("a"); +export { a }; diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json new file mode 100644 index 000000000000..4c31f00de348 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json @@ -0,0 +1,171 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "TSImportEqualsDeclaration", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "isExport": false, + "id": { + "type": "Identifier", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "a" + }, + "name": "a" + }, + "moduleReference": { + "type": "TSExternalModuleReference", + "start": 11, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "StringLiteral", + "start": 19, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "extra": { + "rawValue": "a", + "raw": "\"a\"" + }, + "value": "a" + } + } + }, + { + "type": "ExportNamedDeclaration", + "start": 25, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + } + }, + "local": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + }, + "exported": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "a" + }, + "name": "a" + } + } + ], + "source": null, + "declaration": null + } + ], + "directives": [] + } +} \ No newline at end of file From 10213655bc8573e33a3422cdcc97bd2719f14bed Mon Sep 17 00:00:00 2001 From: gr <13141462+gonzarodriguezt@users.noreply.github.com> Date: Mon, 18 Nov 2019 15:18:36 -0300 Subject: [PATCH 809/965] [parser] Allow optional async methods (#10582) * Add parsePostMemberNameModifiers to aync method * Add test --- packages/babel-parser/src/parser/statement.js | 1 + .../class/async-optional-method/input.js | 3 + .../class/async-optional-method/output.json | 268 ++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/typescript/class/async-optional-method/input.js create mode 100644 packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 827cedfbd7d9..9c8d1afb482a 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1399,6 +1399,7 @@ export default class StatementParser extends ExpressionParser { method.kind = "method"; // The so-called parsed name would have been "async": get the real name. this.parseClassPropertyName(method); + this.parsePostMemberNameModifiers(publicMember); if (method.key.type === "PrivateName") { // private async method diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/input.js b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/input.js new file mode 100644 index 000000000000..8081fad6e8f2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/input.js @@ -0,0 +1,3 @@ +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/async-optional-method/output.json b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json new file mode 100644 index 000000000000..b2a7262f0397 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json @@ -0,0 +1,268 @@ +{ + "type": "File", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 66, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 66, + "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": { + "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": 66, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "TSDeclareMethod", + "start": 22, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 44 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 28, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 14 + }, + "identifierName": "method" + }, + "name": "method" + }, + "computed": false, + "kind": "method", + "optional": true, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "val" + }, + "name": "val", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 39, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 41, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 27 + } + } + } + } + } + ], + "returnType": { + "type": "TSTypeAnnotation", + "start": 48, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 43 + } + }, + "typeAnnotation": { + "type": "TSTypeReference", + "start": 50, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 43 + } + }, + "typeName": { + "type": "Identifier", + "start": 50, + "end": 57, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 37 + }, + "identifierName": "Promise" + }, + "name": "Promise" + }, + "typeParameters": { + "type": "TSTypeParameterInstantiation", + "start": 57, + "end": 63, + "loc": { + "start": { + "line": 2, + "column": 37 + }, + "end": { + "line": 2, + "column": 43 + } + }, + "params": [ + { + "type": "TSVoidKeyword", + "start": 58, + "end": 62, + "loc": { + "start": { + "line": 2, + "column": 38 + }, + "end": { + "line": 2, + "column": 42 + } + } + } + ] + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file From a502d88043c66b3bceddc98716daa2b8ae15ce84 Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Mon, 18 Nov 2019 12:22:27 -0600 Subject: [PATCH 810/965] Fix some incorrect typeof parsing in flow (#10657) --- packages/babel-parser/src/plugins/flow.js | 56 +- .../input.js | 2 + .../output.json | 197 ++ .../input.js | 2 + .../output.json | 229 +++ .../extends-reserved-invalid-1/input.js | 2 + .../extends-reserved-invalid-1/output.json | 164 ++ .../extends-reserved-invalid-2/input.js | 2 + .../extends-reserved-invalid-2/output.json | 196 ++ .../input.js | 1 + .../output.json | 155 ++ .../output.json | 2 +- .../flow/type-annotations/132/output.json | 2 +- .../flow/type-annotations/133/output.json | 2 +- .../typeof-reserved-invalid-1/input.js | 2 + .../typeof-reserved-invalid-1/options.json | 8 + .../typeof-reserved-invalid-2/input.js | 2 + .../typeof-reserved-invalid-2/output.json | 239 +++ .../typeof-reserved-invalid-3/input.js | 2 + .../typeof-reserved-invalid-3/output.json | 239 +++ .../typeof-reserved-invalid-4/input.js | 2 + .../typeof-reserved-invalid-4/output.json | 207 +++ .../typeof-reserved-invalid-5/input.js | 2 + .../typeof-reserved-invalid-5/options.json | 8 + .../typeof-reserved-invalid-6/input.js | 2 + .../typeof-reserved-invalid-6/output.json | 239 +++ .../typeof-reserved-valid/input.js | 15 + .../typeof-reserved-valid/output.json | 1620 +++++++++++++++++ .../options.json | 4 - .../output.json | 2 +- 30 files changed, 3581 insertions(+), 24 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json delete mode 100644 packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index ab5f646b6efb..eba2922b5bc3 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -22,12 +22,15 @@ import { SCOPE_OTHER, } from "../util/scopeflags"; -const reservedTypes = [ +const reservedTypes = new Set([ + "_", "any", "bool", "boolean", "empty", + "extends", "false", + "interface", "mixed", "null", "number", @@ -36,10 +39,7 @@ const reservedTypes = [ "true", "typeof", "void", - "interface", - "extends", - "_", -]; +]); function isEsModuleType(bodyElement: N.Node): boolean { return ( @@ -483,7 +483,10 @@ export default (superClass: Class): Class => node: N.FlowDeclare, isClass?: boolean = false, ): void { - node.id = this.flowParseRestrictedIdentifier(/*liberal*/ !isClass); + node.id = this.flowParseRestrictedIdentifier( + /* liberal */ !isClass, + /* declaration */ true, + ); this.scope.declareName( node.id.name, @@ -557,21 +560,32 @@ export default (superClass: Class): Class => } } - checkReservedType(word: string, startLoc: number) { - if (reservedTypes.indexOf(word) > -1) { + checkReservedType(word: string, startLoc: number, declaration?: boolean) { + if (!reservedTypes.has(word)) return; + + if (declaration) { this.raise(startLoc, `Cannot overwrite reserved type ${word}`); + return; } + + this.raise(startLoc, `Unexpected reserved type ${word}`); } - flowParseRestrictedIdentifier(liberal?: boolean): N.Identifier { - this.checkReservedType(this.state.value, this.state.start); + flowParseRestrictedIdentifier( + liberal?: boolean, + declaration?: boolean, + ): N.Identifier { + this.checkReservedType(this.state.value, this.state.start, declaration); return this.parseIdentifier(liberal); } // Type aliases flowParseTypeAlias(node: N.FlowTypeAlias): N.FlowTypeAlias { - node.id = this.flowParseRestrictedIdentifier(); + node.id = this.flowParseRestrictedIdentifier( + /* liberal */ false, + /* declaration */ true, + ); this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); if (this.isRelational("<")) { @@ -591,7 +605,10 @@ export default (superClass: Class): Class => declare: boolean, ): N.FlowOpaqueType { this.expectContextual("type"); - node.id = this.flowParseRestrictedIdentifier(/*liberal*/ true); + node.id = this.flowParseRestrictedIdentifier( + /* liberal */ true, + /* declaration */ true, + ); this.scope.declareName(node.id.name, BIND_LEXICAL, node.id.start); if (this.isRelational("<")) { @@ -1134,12 +1151,12 @@ export default (superClass: Class): Class => ): N.FlowQualifiedTypeIdentifier { startPos = startPos || this.state.start; startLoc = startLoc || this.state.startLoc; - let node = id || this.parseIdentifier(); + let node = id || this.flowParseRestrictedIdentifier(true); while (this.eat(tt.dot)) { const node2 = this.startNodeAt(startPos, startLoc); node2.qualification = node; - node2.id = this.parseIdentifier(); + node2.id = this.flowParseRestrictedIdentifier(true); node = this.finishNode(node2, "QualifiedTypeIdentifier"); } @@ -2353,7 +2370,10 @@ export default (superClass: Class): Class => contextDescription: string, ): void { specifier.local = hasTypeImportKind(node) - ? this.flowParseRestrictedIdentifier(true) + ? this.flowParseRestrictedIdentifier( + /* liberal */ true, + /* declaration */ true, + ) : this.parseIdentifier(); this.checkLVal( @@ -2459,7 +2479,11 @@ export default (superClass: Class): Class => } if (nodeIsTypeImport || specifierIsTypeImport) { - this.checkReservedType(specifier.local.name, specifier.local.start); + this.checkReservedType( + specifier.local.name, + specifier.local.start, + /* declaration */ true, + ); } if (isBinding && !nodeIsTypeImport && !specifierIsTypeImport) { diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/input.js b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/input.js new file mode 100644 index 000000000000..d37bc775f75f --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/input.js @@ -0,0 +1,2 @@ +// @flow +interface I extends X, bool {} diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json new file mode 100644 index 000000000000..70c296fe6e65 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-1/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type bool (2:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 9, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [ + { + "type": "InterfaceExtends", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + }, + "identifierName": "X" + }, + "name": "X" + }, + "typeParameters": null + }, + { + "type": "InterfaceExtends", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "bool" + }, + "name": "bool" + }, + "typeParameters": null + } + ], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/input.js b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/input.js new file mode 100644 index 000000000000..9aaf187a6099 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/input.js @@ -0,0 +1,2 @@ +// @flow +interface I extends X, bool.m {} diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json new file mode 100644 index 000000000000..40dc56861aa6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple-reserved-invalid-2/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type bool (2:23)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 9, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [ + { + "type": "InterfaceExtends", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 21 + }, + "identifierName": "X" + }, + "name": "X" + }, + "typeParameters": null + }, + { + "type": "InterfaceExtends", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 32, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "qualification": { + "type": "Identifier", + "start": 32, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 23 + }, + "end": { + "line": 2, + "column": 27 + }, + "identifierName": "bool" + }, + "name": "bool" + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 28 + }, + "end": { + "line": 2, + "column": 29 + }, + "identifierName": "m" + }, + "name": "m" + } + }, + "typeParameters": null + } + ], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 30 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/input.js b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/input.js new file mode 100644 index 000000000000..63a11d3bd272 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/input.js @@ -0,0 +1,2 @@ +// @flow +interface I extends bool {} diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json new file mode 100644 index 000000000000..4506002f7efb --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-1/output.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type bool (2:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 9, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [ + { + "type": "InterfaceExtends", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "bool" + }, + "name": "bool" + }, + "typeParameters": null + } + ], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/input.js b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/input.js new file mode 100644 index 000000000000..594e6b7b78b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/input.js @@ -0,0 +1,2 @@ +// @flow +interface I extends bool.m {} diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json new file mode 100644 index 000000000000..159c921ca347 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-reserved-invalid-2/output.json @@ -0,0 +1,196 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type bool (2:20)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "InterfaceDeclaration", + "start": 9, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "I" + }, + "name": "I" + }, + "typeParameters": null, + "extends": [ + { + "type": "InterfaceExtends", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 29, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 26 + } + }, + "qualification": { + "type": "Identifier", + "start": 29, + "end": 33, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 24 + }, + "identifierName": "bool" + }, + "name": "bool" + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 26 + }, + "identifierName": "m" + }, + "name": "m" + } + }, + "typeParameters": null + } + ], + "implements": [], + "mixins": [], + "body": { + "type": "ObjectTypeAnnotation", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 27 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "callProperties": [], + "properties": [], + "indexers": [], + "internalSlots": [], + "exact": false + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/input.js b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/input.js new file mode 100644 index 000000000000..9feacceb06ec --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/input.js @@ -0,0 +1 @@ +class Foo implements Bar, string {} diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json new file mode 100644 index 000000000000..7d3d5d229515 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json @@ -0,0 +1,155 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type string (1:26)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "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": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 21, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 24 + }, + "identifierName": "Bar" + }, + "name": "Bar" + }, + "typeParameters": null + }, + { + "type": "ClassImplements", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + } + }, + "id": { + "type": "Identifier", + "start": 26, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 26 + }, + "end": { + "line": 1, + "column": 32 + }, + "identifierName": "string" + }, + "name": "string" + }, + "typeParameters": null + } + ], + "body": { + "type": "ClassBody", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 33 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "body": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file 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 index 1765354398c7..c29716887979 100644 --- 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:21)" + "SyntaxError: Unexpected reserved type string (1:21)" ], "program": { "type": "Program", 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 index aa2b8b19ecb0..042dd3afd3b4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Cannot overwrite reserved type number (1:9)" + "SyntaxError: Unexpected reserved type number (1:9)" ], "program": { "type": "Program", 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 index bb722c84feec..08cb55525e09 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Cannot overwrite reserved type string (1:11)" + "SyntaxError: Unexpected reserved type string (1:11)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/input.js new file mode 100644 index 000000000000..57a78fa5a789 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof interface = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json new file mode 100644 index 000000000000..151f6c5a3cd5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "Unexpected token, expected \"{\" (2:26)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/input.js new file mode 100644 index 000000000000..292205253049 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof type.interface = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json new file mode 100644 index 000000000000..58a7471e980c --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-2/output.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type interface (2:21)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 9, + "end": 47, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 38 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 18, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 25, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "qualification": { + "type": "Identifier", + "start": 25, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 20 + }, + "identifierName": "type" + }, + "name": "type" + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 21 + }, + "end": { + "line": 2, + "column": 30 + }, + "identifierName": "interface" + }, + "name": "interface" + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 42, + "end": 46, + "loc": { + "start": { + "line": 2, + "column": 33 + }, + "end": { + "line": 2, + "column": 37 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/input.js new file mode 100644 index 000000000000..018cfae79c6b --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof stuff.number = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json new file mode 100644 index 000000000000..8b8eb4bb5a32 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-3/output.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type number (2:22)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 9, + "end": 45, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 36 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 28 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 18, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 25, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "qualification": { + "type": "Identifier", + "start": 25, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 21 + }, + "identifierName": "stuff" + }, + "name": "stuff" + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 22 + }, + "end": { + "line": 2, + "column": 28 + }, + "identifierName": "number" + }, + "name": "number" + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 40, + "end": 44, + "loc": { + "start": { + "line": 2, + "column": 31 + }, + "end": { + "line": 2, + "column": 35 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/input.js new file mode 100644 index 000000000000..01212f07ac93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof static = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json new file mode 100644 index 000000000000..9236c950f3be --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-4/output.json @@ -0,0 +1,207 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved word 'static' (2:16)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 9, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 18, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "typeParameters": null, + "id": { + "type": "Identifier", + "start": 25, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 22 + }, + "identifierName": "static" + }, + "name": "static" + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/input.js new file mode 100644 index 000000000000..8c14711e1d8e --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof typeof = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json new file mode 100644 index 000000000000..749dcb796d32 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "plugins": [ + "jsx", + "flow" + ], + "throws": "Unexpected token (2:23)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/input.js new file mode 100644 index 000000000000..1c47c611a6d7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/input.js @@ -0,0 +1,2 @@ +// @flow +const x: typeof d.i\u{6e}terface = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json new file mode 100644 index 000000000000..25467cae1b2d --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-6/output.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "errors": [ + "SyntaxError: Unexpected reserved type interface (2:18)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 9, + "end": 49, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 40 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 18, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 25, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 25, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 32 + } + }, + "qualification": { + "type": "Identifier", + "start": 25, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "d" + }, + "name": "d" + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 32 + }, + "identifierName": "interface" + }, + "name": "interface" + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 44, + "end": 48, + "loc": { + "start": { + "line": 2, + "column": 35 + }, + "end": { + "line": 2, + "column": 39 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/input.js b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/input.js new file mode 100644 index 000000000000..f96ff8f65234 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/input.js @@ -0,0 +1,15 @@ +// @flow +const a: typeof default = "hi"; +const b: typeof stuff.default = "hi"; + +const c: typeof any = "hi"; +const d: typeof bool = "hi"; +const e: typeof boolean = "hi"; +const f: typeof empty = "hi"; +const g: typeof false = "hi"; +const h: typeof mixed = "hi"; +const i: typeof null = "hi"; +const j: typeof number = "hi"; +const k: typeof string = "hi"; +const l: typeof true = "hi"; +const m: typeof void = "hi"; diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json new file mode 100644 index 000000000000..5ef43efe2bd1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json @@ -0,0 +1,1620 @@ +{ + "type": "File", + "start": 0, + "end": 407, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 407, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 9, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 15, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 15, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "a" + }, + "name": "a", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 16, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 18, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 23 + } + }, + "argument": { + "type": "Identifier", + "start": 25, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 23 + }, + "identifierName": "default" + }, + "name": "default" + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 30 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const", + "leadingComments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] + }, + { + "type": "VariableDeclaration", + "start": 41, + "end": 78, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 47, + "end": 77, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 36 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 29 + }, + "identifierName": "b" + }, + "name": "b", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 48, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 50, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "argument": { + "type": "GenericTypeAnnotation", + "start": 57, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "typeParameters": null, + "id": { + "type": "QualifiedTypeIdentifier", + "start": 57, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 29 + } + }, + "qualification": { + "type": "Identifier", + "start": 57, + "end": 62, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 21 + }, + "identifierName": "stuff" + }, + "name": "stuff" + }, + "id": { + "type": "Identifier", + "start": 63, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 3, + "column": 29 + }, + "identifierName": "default" + }, + "name": "default" + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 73, + "end": 77, + "loc": { + "start": { + "line": 3, + "column": 32 + }, + "end": { + "line": 3, + "column": 36 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 80, + "end": 107, + "loc": { + "start": { + "line": 5, + "column": 0 + }, + "end": { + "line": 5, + "column": 27 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 86, + "end": 106, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "id": { + "type": "Identifier", + "start": 86, + "end": 99, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 19 + }, + "identifierName": "c" + }, + "name": "c", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 87, + "end": 99, + "loc": { + "start": { + "line": 5, + "column": 7 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 89, + "end": 99, + "loc": { + "start": { + "line": 5, + "column": 9 + }, + "end": { + "line": 5, + "column": 19 + } + }, + "argument": { + "type": "AnyTypeAnnotation", + "start": 96, + "end": 99, + "loc": { + "start": { + "line": 5, + "column": 16 + }, + "end": { + "line": 5, + "column": 19 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 102, + "end": 106, + "loc": { + "start": { + "line": 5, + "column": 22 + }, + "end": { + "line": 5, + "column": 26 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 108, + "end": 136, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 6, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 114, + "end": 135, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 114, + "end": 128, + "loc": { + "start": { + "line": 6, + "column": 6 + }, + "end": { + "line": 6, + "column": 20 + }, + "identifierName": "d" + }, + "name": "d", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 115, + "end": 128, + "loc": { + "start": { + "line": 6, + "column": 7 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 117, + "end": 128, + "loc": { + "start": { + "line": 6, + "column": 9 + }, + "end": { + "line": 6, + "column": 20 + } + }, + "argument": { + "type": "BooleanTypeAnnotation", + "start": 124, + "end": 128, + "loc": { + "start": { + "line": 6, + "column": 16 + }, + "end": { + "line": 6, + "column": 20 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 131, + "end": 135, + "loc": { + "start": { + "line": 6, + "column": 23 + }, + "end": { + "line": 6, + "column": 27 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 137, + "end": 168, + "loc": { + "start": { + "line": 7, + "column": 0 + }, + "end": { + "line": 7, + "column": 31 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 143, + "end": 167, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 143, + "end": 160, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 23 + }, + "identifierName": "e" + }, + "name": "e", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 144, + "end": 160, + "loc": { + "start": { + "line": 7, + "column": 7 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 146, + "end": 160, + "loc": { + "start": { + "line": 7, + "column": 9 + }, + "end": { + "line": 7, + "column": 23 + } + }, + "argument": { + "type": "BooleanTypeAnnotation", + "start": 153, + "end": 160, + "loc": { + "start": { + "line": 7, + "column": 16 + }, + "end": { + "line": 7, + "column": 23 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 163, + "end": 167, + "loc": { + "start": { + "line": 7, + "column": 26 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 169, + "end": 198, + "loc": { + "start": { + "line": 8, + "column": 0 + }, + "end": { + "line": 8, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 175, + "end": 197, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 175, + "end": 190, + "loc": { + "start": { + "line": 8, + "column": 6 + }, + "end": { + "line": 8, + "column": 21 + }, + "identifierName": "f" + }, + "name": "f", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 176, + "end": 190, + "loc": { + "start": { + "line": 8, + "column": 7 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 178, + "end": 190, + "loc": { + "start": { + "line": 8, + "column": 9 + }, + "end": { + "line": 8, + "column": 21 + } + }, + "argument": { + "type": "EmptyTypeAnnotation", + "start": 185, + "end": 190, + "loc": { + "start": { + "line": 8, + "column": 16 + }, + "end": { + "line": 8, + "column": 21 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 193, + "end": 197, + "loc": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 28 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 199, + "end": 228, + "loc": { + "start": { + "line": 9, + "column": 0 + }, + "end": { + "line": 9, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 205, + "end": 227, + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 205, + "end": 220, + "loc": { + "start": { + "line": 9, + "column": 6 + }, + "end": { + "line": 9, + "column": 21 + }, + "identifierName": "g" + }, + "name": "g", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 206, + "end": 220, + "loc": { + "start": { + "line": 9, + "column": 7 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 208, + "end": 220, + "loc": { + "start": { + "line": 9, + "column": 9 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "argument": { + "type": "BooleanLiteralTypeAnnotation", + "start": 215, + "end": 220, + "loc": { + "start": { + "line": 9, + "column": 16 + }, + "end": { + "line": 9, + "column": 21 + } + }, + "value": false + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 223, + "end": 227, + "loc": { + "start": { + "line": 9, + "column": 24 + }, + "end": { + "line": 9, + "column": 28 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 229, + "end": 258, + "loc": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 235, + "end": 257, + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 28 + } + }, + "id": { + "type": "Identifier", + "start": 235, + "end": 250, + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 10, + "column": 21 + }, + "identifierName": "h" + }, + "name": "h", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 236, + "end": 250, + "loc": { + "start": { + "line": 10, + "column": 7 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 238, + "end": 250, + "loc": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 21 + } + }, + "argument": { + "type": "MixedTypeAnnotation", + "start": 245, + "end": 250, + "loc": { + "start": { + "line": 10, + "column": 16 + }, + "end": { + "line": 10, + "column": 21 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 253, + "end": 257, + "loc": { + "start": { + "line": 10, + "column": 24 + }, + "end": { + "line": 10, + "column": 28 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 259, + "end": 287, + "loc": { + "start": { + "line": 11, + "column": 0 + }, + "end": { + "line": 11, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 265, + "end": 286, + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 265, + "end": 279, + "loc": { + "start": { + "line": 11, + "column": 6 + }, + "end": { + "line": 11, + "column": 20 + }, + "identifierName": "i" + }, + "name": "i", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 266, + "end": 279, + "loc": { + "start": { + "line": 11, + "column": 7 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 268, + "end": 279, + "loc": { + "start": { + "line": 11, + "column": 9 + }, + "end": { + "line": 11, + "column": 20 + } + }, + "argument": { + "type": "NullLiteralTypeAnnotation", + "start": 275, + "end": 279, + "loc": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 20 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 282, + "end": 286, + "loc": { + "start": { + "line": 11, + "column": 23 + }, + "end": { + "line": 11, + "column": 27 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 288, + "end": 318, + "loc": { + "start": { + "line": 12, + "column": 0 + }, + "end": { + "line": 12, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 294, + "end": 317, + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 294, + "end": 310, + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 12, + "column": 22 + }, + "identifierName": "j" + }, + "name": "j", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 295, + "end": 310, + "loc": { + "start": { + "line": 12, + "column": 7 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 297, + "end": 310, + "loc": { + "start": { + "line": 12, + "column": 9 + }, + "end": { + "line": 12, + "column": 22 + } + }, + "argument": { + "type": "NumberTypeAnnotation", + "start": 304, + "end": 310, + "loc": { + "start": { + "line": 12, + "column": 16 + }, + "end": { + "line": 12, + "column": 22 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 313, + "end": 317, + "loc": { + "start": { + "line": 12, + "column": 25 + }, + "end": { + "line": 12, + "column": 29 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 319, + "end": 349, + "loc": { + "start": { + "line": 13, + "column": 0 + }, + "end": { + "line": 13, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 325, + "end": 348, + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 325, + "end": 341, + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 13, + "column": 22 + }, + "identifierName": "k" + }, + "name": "k", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 326, + "end": 341, + "loc": { + "start": { + "line": 13, + "column": 7 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 328, + "end": 341, + "loc": { + "start": { + "line": 13, + "column": 9 + }, + "end": { + "line": 13, + "column": 22 + } + }, + "argument": { + "type": "StringTypeAnnotation", + "start": 335, + "end": 341, + "loc": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 22 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 344, + "end": 348, + "loc": { + "start": { + "line": 13, + "column": 25 + }, + "end": { + "line": 13, + "column": 29 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 350, + "end": 378, + "loc": { + "start": { + "line": 14, + "column": 0 + }, + "end": { + "line": 14, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 356, + "end": 377, + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 356, + "end": 370, + "loc": { + "start": { + "line": 14, + "column": 6 + }, + "end": { + "line": 14, + "column": 20 + }, + "identifierName": "l" + }, + "name": "l", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 357, + "end": 370, + "loc": { + "start": { + "line": 14, + "column": 7 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 359, + "end": 370, + "loc": { + "start": { + "line": 14, + "column": 9 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "argument": { + "type": "BooleanLiteralTypeAnnotation", + "start": 366, + "end": 370, + "loc": { + "start": { + "line": 14, + "column": 16 + }, + "end": { + "line": 14, + "column": 20 + } + }, + "value": true + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 373, + "end": 377, + "loc": { + "start": { + "line": 14, + "column": 23 + }, + "end": { + "line": 14, + "column": 27 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + }, + { + "type": "VariableDeclaration", + "start": 379, + "end": 407, + "loc": { + "start": { + "line": 15, + "column": 0 + }, + "end": { + "line": 15, + "column": 28 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 385, + "end": 406, + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 385, + "end": 399, + "loc": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 20 + }, + "identifierName": "m" + }, + "name": "m", + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 386, + "end": 399, + "loc": { + "start": { + "line": 15, + "column": 7 + }, + "end": { + "line": 15, + "column": 20 + } + }, + "typeAnnotation": { + "type": "TypeofTypeAnnotation", + "start": 388, + "end": 399, + "loc": { + "start": { + "line": 15, + "column": 9 + }, + "end": { + "line": 15, + "column": 20 + } + }, + "argument": { + "type": "VoidTypeAnnotation", + "start": 395, + "end": 399, + "loc": { + "start": { + "line": 15, + "column": 16 + }, + "end": { + "line": 15, + "column": 20 + } + } + } + } + } + }, + "init": { + "type": "StringLiteral", + "start": 402, + "end": 406, + "loc": { + "start": { + "line": 15, + "column": 23 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "extra": { + "rawValue": "hi", + "raw": "\"hi\"" + }, + "value": "hi" + } + } + ], + "kind": "const" + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " @flow", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + } + } + ] +} \ 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 deleted file mode 100644 index d822c40fbba2..000000000000 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_illegal_type_name/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "sourceType": "module", - "plugins": ["jsx", "flow"] -} 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 index e89da7ec21b6..e087eecbd2bb 100644 --- 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: Cannot overwrite reserved type _ (2:13)", + "SyntaxError: Unexpected reserved type _ (2:13)", "SyntaxError: `_` is only allowed as a type argument to call or new (2:19)" ], "program": { From 6ba113197f34b6a7e6e24c339c2d8d72a1fd9435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 18 Nov 2019 14:29:18 -0500 Subject: [PATCH 811/965] fix: add missing available plugins to babel-preset-env-standalone (#10732) * fix: add missing available plugins to babel-preset-env-standalone * skip available-plugins test in CI coverage test --- .../babel-preset-env-standalone/package.json | 5 ++++- .../src/available-plugins.js | 2 ++ .../test/available-plugins.js | 19 +++++++++++++++++++ .../test/babel-preset-env.js | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 packages/babel-preset-env-standalone/test/available-plugins.js diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index b7830b73c939..d06d42d706e1 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -14,10 +14,13 @@ "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.7.0", "@babel/plugin-proposal-json-strings": "^7.0.0", + "@babel/plugin-syntax-json-strings": "^7.2.0", + "@babel/plugin-syntax-top-level-await": "^7.7.0", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", "@babel/plugin-transform-new-target": "^7.4.4", "@babel/preset-env": "^7.7.1", - "@babel/standalone": "^7.7.3" + "@babel/standalone": "^7.7.3", + "lodash": "^4.17.13" }, "keywords": [ "babel", diff --git a/packages/babel-preset-env-standalone/src/available-plugins.js b/packages/babel-preset-env-standalone/src/available-plugins.js index 9d9e68640234..7259b2ea378f 100644 --- a/packages/babel-preset-env-standalone/src/available-plugins.js +++ b/packages/babel-preset-env-standalone/src/available-plugins.js @@ -5,6 +5,8 @@ const notIncludedPlugins = { "transform-new-target": require("@babel/plugin-transform-new-target"), "proposal-json-strings": require("@babel/plugin-proposal-json-strings"), "proposal-dynamic-import": require("@babel/plugin-proposal-dynamic-import"), + "syntax-json-strings": require("@babel/plugin-syntax-json-strings"), + "syntax-top-level-await": require("@babel/plugin-syntax-top-level-await"), }; Object.keys(notIncludedPlugins).forEach(pluginName => { diff --git a/packages/babel-preset-env-standalone/test/available-plugins.js b/packages/babel-preset-env-standalone/test/available-plugins.js new file mode 100644 index 000000000000..bfaa76beac53 --- /dev/null +++ b/packages/babel-preset-env-standalone/test/available-plugins.js @@ -0,0 +1,19 @@ +import expectedAvailablePlugins from "@babel/preset-env/lib/available-plugins"; +import difference from "lodash/difference"; + +// build-babel-preset-env-standalone in CI coverage tests is skipped, so we skip this test as well +(process.env.TEST_TYPE === "cov" ? describe.skip : describe)( + "available-plugins", + () => { + const actualAvailablePlugins = require("../lib/available-plugins").default; + it("should be a superset of available-plugins in @babel/preset-env", () => { + const expectedPluginList = Object.keys(expectedAvailablePlugins); + expectedPluginList.sort(); + + const actualPluginList = Object.keys(actualAvailablePlugins); + actualPluginList.sort(); + // If this test is failed, add the missing plugins to ./src/available-plugins + expect(difference(expectedPluginList, actualPluginList)).toEqual([]); + }); + }, +); diff --git a/packages/babel-preset-env-standalone/test/babel-preset-env.js b/packages/babel-preset-env-standalone/test/babel-preset-env.js index 6ecd097b1404..d1d2600ca362 100644 --- a/packages/babel-preset-env-standalone/test/babel-preset-env.js +++ b/packages/babel-preset-env-standalone/test/babel-preset-env.js @@ -1,3 +1,4 @@ +// build-babel-standalone in CI coverage tests is skipped, so we skip this test as well (process.env.TEST_TYPE === "cov" ? describe.skip : describe)( "babel-preset-env-standalone", () => { From 01d6d6dd3bf80b1f1019b470bcc2d7907a0381bb Mon Sep 17 00:00:00 2001 From: George Zahariev Date: Tue, 19 Nov 2019 20:46:09 -0800 Subject: [PATCH 812/965] Flow enums: fix enum body location (#10737) --- packages/babel-parser/src/plugins/flow.js | 91 ++++++++++--------- .../boolean-explicit/output.json | 12 +-- .../boolean-implicit/output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../duplicate-member-name/output.json | 12 +-- .../flow/enum-declaration/empty/output.json | 8 +- .../enum-declaration/enum-name/output.json | 12 +-- .../flow/enum-declaration/export/output.json | 16 ++-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../invalid-member-name/output.json | 12 +-- .../no-trailing-comma/output.json | 12 +-- .../number-explicit/output.json | 12 +-- .../number-implicit/output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../reserved-word-enum-name/output.json | 12 +-- .../string-explicit-defaulted/output.json | 12 +-- .../string-explicit-initialized/output.json | 12 +-- .../string-implicit-defaulted/output.json | 12 +-- .../string-implicit-initialized/output.json | 12 +-- .../output.json | 12 +-- .../output.json | 12 +-- .../flow/enum-declaration/symbol/output.json | 12 +-- 32 files changed, 235 insertions(+), 228 deletions(-) diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index eba2922b5bc3..96a5feac5d37 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -3250,34 +3250,32 @@ export default (superClass: Class): Class => return members; } - flowEnumStringBody( - bodyNode: N.Node, + flowEnumStringMembers( initializedMembers: Array, defaultedMembers: Array, { enumName }: { enumName: string }, - ): N.Node { + ): Array { if (initializedMembers.length === 0) { - bodyNode.members = defaultedMembers; + return defaultedMembers; } else if (defaultedMembers.length === 0) { - bodyNode.members = initializedMembers; + return initializedMembers; } else if (defaultedMembers.length > initializedMembers.length) { - bodyNode.members = defaultedMembers; for (const member of initializedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized( member.start, { enumName }, ); } + return defaultedMembers; } else { - bodyNode.members = initializedMembers; for (const member of defaultedMembers) { this.flowEnumErrorStringMemberInconsistentlyInitailized( member.start, { enumName }, ); } + return initializedMembers; } - return this.finishNode(bodyNode, "EnumStringBody"); } flowEnumParseExplicitType({ @@ -3313,85 +3311,94 @@ export default (superClass: Class): Class => return null; } - flowParseEnumDeclaration(node: N.Node): N.Node { - const id = this.parseIdentifier(); - node.id = id; - const enumName = id.name; + flowEnumBody(node: N.Node, { enumName, nameLoc }): N.Node { 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; + node.explicitType = true; + node.members = members.booleanMembers; + this.expect(tt.braceR); + return this.finishNode(node, "EnumBooleanBody"); case "number": - bodyNode.explicitType = true; - bodyNode.members = members.numberMembers; - node.body = this.finishNode(bodyNode, "EnumNumberBody"); - break; + node.explicitType = true; + node.members = members.numberMembers; + this.expect(tt.braceR); + return this.finishNode(node, "EnumNumberBody"); case "string": - bodyNode.explicitType = true; - node.body = this.flowEnumStringBody( - bodyNode, + node.explicitType = true; + node.members = this.flowEnumStringMembers( members.stringMembers, members.defaultedMembers, { enumName }, ); - break; + this.expect(tt.braceR); + return this.finishNode(node, "EnumStringBody"); case "symbol": - bodyNode.members = members.defaultedMembers; - node.body = this.finishNode(bodyNode, "EnumSymbolBody"); - break; + node.members = members.defaultedMembers; + this.expect(tt.braceR); + return this.finishNode(node, "EnumSymbolBody"); default: { - // null + // `explicitType` is `null` const empty = () => { - bodyNode.members = []; - return this.finishNode(bodyNode, "EnumStringBody"); + node.members = []; + this.expect(tt.braceR); + return this.finishNode(node, "EnumStringBody"); }; - bodyNode.explicitType = false; + node.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(); + return empty(); } else if (!boolsLen && !numsLen) { - node.body = this.flowEnumStringBody( - bodyNode, + node.members = this.flowEnumStringMembers( members.stringMembers, members.defaultedMembers, { enumName }, ); + this.expect(tt.braceR); + return this.finishNode(node, "EnumStringBody"); } 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, }); } + node.members = members.booleanMembers; + this.expect(tt.braceR); + return this.finishNode(node, "EnumBooleanBody"); } 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, }); } + node.members = members.numberMembers; + this.expect(tt.braceR); + return this.finishNode(node, "EnumNumberBody"); } else { - node.body = empty(); - this.flowEnumErrorInconsistentMemberValues(id.start, { enumName }); + this.flowEnumErrorInconsistentMemberValues(nameLoc, { enumName }); + return empty(); } } } - this.expect(tt.braceR); + } + + flowParseEnumDeclaration(node: N.Node): N.Node { + const id = this.parseIdentifier(); + node.id = id; + node.body = this.flowEnumBody(this.startNode(), { + enumName: id.name, + nameLoc: id.start, + }); return this.finishNode(node, "EnumDeclaration"); } }; 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 index df48f24b108b..b3c3ca8679ba 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 22, - "end": 44, + "start": 7, + "end": 46, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 12 + "line": 4, + "column": 1 } }, "explicitType": true, 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 index d7d3bae2e7c4..13f9c5e69ba3 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 11, - "end": 33, + "start": 7, + "end": 35, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 12 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 8ca6221bd05f..20ba8ebd29c7 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 22, - "end": 24, + "start": 7, + "end": 26, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 4 + "line": 3, + "column": 1 } }, "explicitType": 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 index de57afc78eea..689d03caa301 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 11, - "end": 25, + "start": 7, + "end": 27, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 11 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 419248b77ef1..0d9e8720f89e 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 18, + "start": 7, + "end": 20, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 4 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 336475b12dd5..c01edfa2f344 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/empty/output.json @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 9, - "end": 8, + "start": 7, + "end": 10, "loc": { "start": { "line": 1, - "column": 9 + "column": 7 }, "end": { "line": 1, - "column": 8 + "column": 10 } }, "explicitType": false, 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 index 57bea3fab460..00a5c58dd9e0 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 12, - "end": 11, + "start": 10, + "end": 13, "loc": { "start": { - "line": 2, - "column": 0 + "line": 1, + "column": 10 }, "end": { - "line": 1, - "column": 11 + "line": 2, + "column": 1 } }, "explicitType": false, 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 index 5762ca30b575..a62f9a9beb46 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/export/output.json @@ -79,16 +79,16 @@ }, "body": { "type": "EnumStringBody", - "start": 15, - "end": 15, + "start": 14, + "end": 16, "loc": { "start": { "line": 1, - "column": 15 + "column": 14 }, "end": { "line": 1, - "column": 15 + "column": 16 } }, "explicitType": false, @@ -143,16 +143,16 @@ }, "body": { "type": "EnumStringBody", - "start": 41, - "end": 41, + "start": 40, + "end": 42, "loc": { "start": { "line": 3, - "column": 23 + "column": 22 }, "end": { "line": 3, - "column": 23 + "column": 24 } }, "explicitType": false, 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 index b9a7090addd4..e572b98f4ddf 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 27, + "start": 7, + "end": 29, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 4, - "column": 8 + "line": 5, + "column": 1 } }, "explicitType": false, 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 index a6954ed31095..fc89707351ee 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 29, + "start": 7, + "end": 31, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 11 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 7b6a1da0ed1f..c8665a0f248d 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 16, - "end": 15, + "start": 7, + "end": 17, "loc": { "start": { - "line": 2, - "column": 0 + "line": 1, + "column": 7 }, "end": { - "line": 1, - "column": 15 + "line": 2, + "column": 1 } }, "explicitType": false, 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 index a8f898034c39..8ee139f5c47c 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 30, + "start": 7, + "end": 32, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 11 + "line": 3, + "column": 1 } }, "explicitType": 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 index 4cf1122979e8..8c2e7e69ab33 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumSymbolBody", - "start": 21, - "end": 27, + "start": 7, + "end": 29, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 8 + "line": 3, + "column": 1 } }, "members": [] 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 index c737d1129440..ac17cf909b1c 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 22, - "end": 28, + "start": 7, + "end": 30, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 8 + "line": 3, + "column": 1 } }, "explicitType": 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 index 653573513644..5dbb2447870d 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 27, + "start": 7, + "end": 29, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 8 + "line": 3, + "column": 1 } }, "explicitType": 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 index 2f1b07d00c15..73b86a84e35a 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumBooleanBody", - "start": 22, - "end": 31, + "start": 7, + "end": 33, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 11 + "line": 3, + "column": 1 } }, "explicitType": 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 index 263ac8c203cb..15e121566e51 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumNumberBody", - "start": 21, - "end": 30, + "start": 7, + "end": 32, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 11 + "line": 3, + "column": 1 } }, "explicitType": 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 index f4f24a70b045..9c80943ab347 100644 --- 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 @@ -66,16 +66,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 22, + "start": 7, + "end": 24, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 6 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index ed614a856575..fd6f4450b1a6 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 12, + "start": 7, + "end": 14, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 3 + "line": 3, + "column": 1 } }, "explicitType": false, 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 index 4f5a6f26c614..e03f6e9712bd 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumNumberBody", - "start": 21, - "end": 36, + "start": 7, + "end": 38, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 8 + "line": 4, + "column": 1 } }, "explicitType": true, 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 index 862a8bc5691b..9a2f18345cd2 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumNumberBody", - "start": 11, - "end": 26, + "start": 7, + "end": 28, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 8 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 8408025e1256..399366269eef 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumNumberBody", - "start": 21, - "end": 23, + "start": 7, + "end": 25, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 2, - "column": 4 + "line": 3, + "column": 1 } }, "explicitType": 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 index 67dae3487d84..f2277d9ffcc8 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumNumberBody", - "start": 11, - "end": 22, + "start": 7, + "end": 24, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 8 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index f80ecb8f4d3d..57e3c5d82dcd 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 13, - "end": 12, + "start": 11, + "end": 14, "loc": { "start": { - "line": 2, - "column": 0 + "line": 1, + "column": 11 }, "end": { - "line": 1, - "column": 12 + "line": 2, + "column": 1 } }, "explicitType": false, 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 index 57cc928ec552..4efdf8e46049 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 28, + "start": 7, + "end": 30, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 4 + "line": 4, + "column": 1 } }, "explicitType": true, 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 index 1ab361d41977..2e9c91c109ff 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 40, + "start": 7, + "end": 42, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 10 + "line": 4, + "column": 1 } }, "explicitType": true, 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 index b14d096085c2..28842c5fd477 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 18, + "start": 7, + "end": 20, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 4 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index 8f3e4e6eb48a..1680f3f2cc51 100644 --- 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 @@ -62,16 +62,16 @@ }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 30, + "start": 7, + "end": 32, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 10 + "line": 4, + "column": 1 } }, "explicitType": false, 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 index f3a0304fb310..b5a5dc4951a9 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 39, + "start": 7, + "end": 41, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 4, - "column": 4 + "line": 5, + "column": 1 } }, "explicitType": 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 index 9a637136e9c2..19e00f8d51c7 100644 --- 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 @@ -65,16 +65,16 @@ }, "body": { "type": "EnumStringBody", - "start": 21, - "end": 45, + "start": 7, + "end": 47, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 4, - "column": 10 + "line": 5, + "column": 1 } }, "explicitType": true, 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 index 6f5ba3e152c1..b93b653940b8 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/symbol/output.json @@ -62,16 +62,16 @@ }, "body": { "type": "EnumSymbolBody", - "start": 21, - "end": 28, + "start": 7, + "end": 30, "loc": { "start": { - "line": 2, - "column": 2 + "line": 1, + "column": 7 }, "end": { - "line": 3, - "column": 4 + "line": 4, + "column": 1 } }, "members": [ From fee4d936a3443c4d8812cac208e567e0ba8edc9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 20 Nov 2019 15:49:34 -0500 Subject: [PATCH 813/965] chore: introduce envinfo into environment section [ci-skip] (#10565) This reverts commit d234ff6572e7593f36620780319b4e183aec7561. --- .github/ISSUE_TEMPLATE/Bug_report.md | 7 +++++-- .github/ISSUE_TEMPLATE/Regression-v7.md | 12 ++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 90c373003e82..f182520ff80a 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -27,8 +27,7 @@ var your => (code) => here; **Expected behavior/code** A clear and concise description of what you expected to happen (or code). -**Babel Configuration (.babelrc, package.json, cli command, .eslintrc)** - +**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)** - Filename: `babel.config.js` ```js @@ -38,6 +37,10 @@ A clear and concise description of what you expected to happen (or code). ``` **Environment** + +``` + +``` - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] diff --git a/.github/ISSUE_TEMPLATE/Regression-v7.md b/.github/ISSUE_TEMPLATE/Regression-v7.md index a700b90ba073..b001290cf317 100644 --- a/.github/ISSUE_TEMPLATE/Regression-v7.md +++ b/.github/ISSUE_TEMPLATE/Regression-v7.md @@ -26,7 +26,10 @@ A clear and concise description of what the regression is. var your => (code) => here; ``` -**Babel Configuration (.babelrc, package.json, cli command)** +**Expected behavior/code** +A clear and concise description of what you expected to happen (or code). + +**Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command)** ```js { @@ -34,10 +37,11 @@ var your => (code) => here; } ``` -**Expected behavior/code** -A clear and concise description of what you expected to happen (or code). - **Environment** + +``` + +``` - Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34] - Node/npm version: [e.g. Node 8/npm 5] - OS: [e.g. OSX 10.13.4, Windows 10] From 83fc3f26236a91bf21c6dcea93e56d9a351597ad Mon Sep 17 00:00:00 2001 From: Brian Ng Date: Wed, 20 Nov 2019 17:48:39 -0600 Subject: [PATCH 814/965] Update preset-env mappings (#10742) --- .../data/corejs2-built-in-features.js | 26 ++++++++++++++++++- .../data/corejs2-built-ins.json | 3 +++ packages/babel-preset-env/data/plugins.json | 6 +++++ packages/babel-preset-env/package.json | 2 +- 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset-env/data/corejs2-built-in-features.js b/packages/babel-preset-env/data/corejs2-built-in-features.js index f18244b4c9ad..df73164fb6a7 100644 --- a/packages/babel-preset-env/data/corejs2-built-in-features.js +++ b/packages/babel-preset-env/data/corejs2-built-in-features.js @@ -95,7 +95,31 @@ const es = { ], }, - "es6.map": "Map", + // This is explicit to prevent Map-related proposals (like + // Map.prototype.upsert) from being included + "es6.map": { + features: [ + "Map / basic functionality", + "Map / constructor arguments", + "Map / constructor requires new", + "Map / constructor accepts null", + "Map / constructor invokes set", + "Map / iterator closing", + "Map / Map.prototype.add returns this", + "Map / -0 key converts to +0", + "Map / Map.prototype.size", + "Map / Map.prototype.delete", + "Map / Map.prototype.clear", + "Map / Map.prototype.forEach", + "Map / Map.prototype.keys", + "Map / Map.prototype.values", + "Map / Map.prototype.entries", + "Map / Map.prototype[Symbol.iterator]", + "Map / Map.prototype isn't an instance", + "Map / Map iterator prototype chain", + "Map / Map[Symbol.species]", + ], + }, "es6.math.acosh": "Math methods / Math.acosh", "es6.math.asinh": "Math methods / Math.asinh", diff --git a/packages/babel-preset-env/data/corejs2-built-ins.json b/packages/babel-preset-env/data/corejs2-built-ins.json index 2079f1c3d74a..5c81e27f27f5 100644 --- a/packages/babel-preset-env/data/corejs2-built-ins.json +++ b/packages/babel-preset-env/data/corejs2-built-ins.json @@ -77,6 +77,7 @@ "safari": "12", "node": "11", "ios": "12", + "samsung": "10.2", "opera": "56", "electron": "4" }, @@ -1496,6 +1497,7 @@ "safari": "12", "node": "10", "ios": "12", + "samsung": "9.2", "opera": "53", "electron": "3.1" }, @@ -1505,6 +1507,7 @@ "safari": "12", "node": "10", "ios": "12", + "samsung": "9.2", "opera": "53", "electron": "3.1" }, diff --git a/packages/babel-preset-env/data/plugins.json b/packages/babel-preset-env/data/plugins.json index 382a51399431..f4a5771b01c3 100644 --- a/packages/babel-preset-env/data/plugins.json +++ b/packages/babel-preset-env/data/plugins.json @@ -3,7 +3,9 @@ "chrome": "41", "edge": "13", "firefox": "34", + "safari": "13", "node": "4", + "ios": "13", "samsung": "3.4", "opera": "28", "electron": "0.24" @@ -273,6 +275,7 @@ "safari": "11.1", "node": "10", "ios": "11.3", + "samsung": "9.2", "opera": "51", "electron": "3.1" }, @@ -282,6 +285,7 @@ "safari": "12", "node": "10", "ios": "12", + "samsung": "9.2", "opera": "53", "electron": "3.1" }, @@ -291,6 +295,7 @@ "safari": "11.1", "node": "10", "ios": "11.3", + "samsung": "9.2", "opera": "53", "electron": "3.1" }, @@ -299,6 +304,7 @@ "safari": "11.1", "node": "10", "ios": "11.3", + "samsung": "9.2", "opera": "51", "electron": "3.1" }, diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 7648965e88be..f8c13559c29b 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -76,7 +76,7 @@ "@babel/helper-plugin-test-runner": "^7.0.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", - "compat-table": "kangax/compat-table#071b478a44694cbf72a78db8ab39189c5ae31b2c", + "compat-table": "kangax/compat-table#4195aca631ad904cb0efeb62a9c2d8c8511706f8", "electron-to-chromium": "1.3.113" } } From cc51f2a1f2b1e86e0d0a476a60e82fb14e58d297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 21 Nov 2019 01:05:47 +0100 Subject: [PATCH 815/965] Update lerna (#10733) * Update lerna * yarn-deduplicate * Update lockfile --- package.json | 2 +- yarn.lock | 1068 +++++++++++++++++++++++++------------------------- 2 files changed, 529 insertions(+), 541 deletions(-) diff --git a/package.json b/package.json index 5da887e649af..92d3e45e4661 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "gulp-watch": "^5.0.1", "husky": "^3.0.0", "jest": "^24.9.0", - "lerna": "^3.16.0", + "lerna": "^3.19.0", "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", "lodash": "^4.17.13", diff --git a/yarn.lock b/yarn.lock index 4f3e1d56040f..76fa1ca435a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1032,15 +1032,15 @@ "@types/istanbul-reports" "^1.1.1" "@types/yargs" "^13.0.0" -"@lerna/add@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.16.2.tgz#90ecc1be7051cfcec75496ce122f656295bd6e94" - integrity sha512-RAAaF8aODPogj2Ge9Wj3uxPFIBGpog9M+HwSuq03ZnkkO831AmasCTJDqV+GEpl1U2DvnhZQEwHpWmTT0uUeEw== +"@lerna/add@3.19.0": + version "3.19.0" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.19.0.tgz#33b6251c669895f842c14f05961432d464166249" + integrity sha512-qzhxPyoczvvT1W0wwCK9I0iJ4B9WR+HzYsusmRuzM3mEhWjowhbuvKEl5BjGYuXc9AvEErM/S0Fm5K0RcuS39Q== dependencies: "@evocateur/pacote" "^9.6.3" - "@lerna/bootstrap" "3.16.2" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" + "@lerna/bootstrap" "3.18.5" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" @@ -1048,31 +1048,22 @@ p-map "^2.1.0" semver "^6.2.0" -"@lerna/batch-packages@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/batch-packages/-/batch-packages-3.16.0.tgz#1c16cb697e7d718177db744cbcbdac4e30253c8c" - integrity sha512-7AdMkANpubY/FKFI01im01tlx6ygOBJ/0JcixMUWoWP/7Ds3SWQF22ID6fbBr38jUWptYLDs2fagtTDL7YUPuA== +"@lerna/bootstrap@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.18.5.tgz#cc22a750d6b0402e136926e8b214148dfc2e1390" + integrity sha512-9vD/BfCz8YSF2Dx7sHaMVo6Cy33WjLEmoN1yrHgNkHjm7ykWbLHG5wru0f4Y4pvwa0s5Hf76rvT8aJWzGHk9IQ== dependencies: - "@lerna/package-graph" "3.16.0" - npmlog "^4.1.2" - -"@lerna/bootstrap@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-3.16.2.tgz#be268d940221d3c3270656b9b791b492559ad9d8" - integrity sha512-I+gs7eh6rv9Vyd+CwqL7sftRfOOsSzCle8cv/CGlMN7/p7EAVhxEdAw8SYoHIKHzipXszuqqy1Y3opyleD0qdA== - dependencies: - "@lerna/batch-packages" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/has-npm-version" "3.16.0" - "@lerna/npm-install" "3.16.0" - "@lerna/package-graph" "3.16.0" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" + "@lerna/has-npm-version" "3.16.5" + "@lerna/npm-install" "3.16.5" + "@lerna/package-graph" "3.18.5" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.14.2" + "@lerna/rimraf-dir" "3.16.5" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-parallel-batches" "3.16.0" - "@lerna/symlink-binary" "3.16.2" - "@lerna/symlink-dependencies" "3.16.2" + "@lerna/run-topologically" "3.18.5" + "@lerna/symlink-binary" "3.17.0" + "@lerna/symlink-dependencies" "3.17.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" get-port "^4.2.0" @@ -1086,70 +1077,80 @@ read-package-tree "^5.1.6" semver "^6.2.0" -"@lerna/changed@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.16.4.tgz#c3e727d01453513140eee32c94b695de577dc955" - integrity sha512-NCD7XkK744T23iW0wqKEgF4R9MYmReUbyHCZKopFnsNpQdqumc3SOIvQUAkKCP6hQJmYvxvOieoVgy/CVDpZ5g== +"@lerna/changed@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-3.18.5.tgz#ef2c460f5497b8b4cfac7e5165fe46d7181fcdf5" + integrity sha512-IXS7VZ5VDQUfCsgK56WYxd42luMBxL456cNUf1yBgQ1cy1U2FPVMitIdLN4AcP7bJizdPWeG8yDptf47jN/xVw== dependencies: - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/listable" "3.16.0" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.5" + "@lerna/listable" "3.18.5" "@lerna/output" "3.13.0" - "@lerna/version" "3.16.4" -"@lerna/check-working-tree@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.14.2.tgz#5ce007722180a69643a8456766ed8a91fc7e9ae1" - integrity sha512-7safqxM/MYoAoxZxulUDtIJIbnBIgo0PB/FHytueG+9VaX7GMnDte2Bt1EKa0dz2sAyQdmQ3Q8ZXpf/6JDjaeg== +"@lerna/check-working-tree@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-3.16.5.tgz#b4f8ae61bb4523561dfb9f8f8d874dd46bb44baa" + integrity sha512-xWjVBcuhvB8+UmCSb5tKVLB5OuzSpw96WEhS2uz6hkWVa/Euh1A0/HJwn2cemyK47wUrCQXtczBUiqnq9yX5VQ== dependencies: - "@lerna/collect-uncommitted" "3.14.2" - "@lerna/describe-ref" "3.14.2" + "@lerna/collect-uncommitted" "3.16.5" + "@lerna/describe-ref" "3.16.5" "@lerna/validation-error" "3.13.0" -"@lerna/child-process@3.14.2", "@lerna/child-process@^3.3.0": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.14.2.tgz#950240cba83f7dfe25247cfa6c9cebf30b7d94f6" - integrity sha512-xnq+W5yQb6RkwI0p16ZQnrn6HkloH/MWTw4lGE1nKsBLAUbmSU5oTE93W1nrG0X3IMF/xWc9UYvNdUGMWvZZ4w== +"@lerna/child-process@3.16.5", "@lerna/child-process@^3.3.0": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-3.16.5.tgz#38fa3c18064aa4ac0754ad80114776a7b36a69b2" + integrity sha512-vdcI7mzei9ERRV4oO8Y1LHBZ3A5+ampRKg1wq5nutLsUA4mEBN6H7JqjWOMY9xZemv6+kATm2ofjJ3lW5TszQg== dependencies: chalk "^2.3.1" execa "^1.0.0" strong-log-transformer "^2.0.0" -"@lerna/clean@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.16.0.tgz#1c134334cacea1b1dbeacdc580e8b9240db8efa1" - integrity sha512-5P9U5Y19WmYZr7UAMGXBpY7xCRdlR7zhHy8MAPDKVx70rFIBS6nWXn5n7Kntv74g7Lm1gJ2rsiH5tj1OPcRJgg== +"@lerna/clean@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-3.18.5.tgz#44b4a6db68ae369778f2921c85ec6961bdd86072" + integrity sha512-tHxOj9frTIhB/H2gtgMU3xpIc4IJEhXcUlReko6RJt8TTiDZGPDudCcgjg6i7n15v9jXMOc1y4F+y5/1089bfA== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/prompt" "3.13.0" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" + "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" - "@lerna/rimraf-dir" "3.14.2" + "@lerna/rimraf-dir" "3.16.5" p-map "^2.1.0" p-map-series "^1.0.0" p-waterfall "^1.0.0" -"@lerna/cli@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.13.0.tgz#3d7b357fdd7818423e9681a7b7f2abd106c8a266" - integrity sha512-HgFGlyCZbYaYrjOr3w/EsY18PdvtsTmDfpUQe8HwDjXlPeCCUgliZjXLOVBxSjiOvPeOSwvopwIHKWQmYbwywg== +"@lerna/cli@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-3.18.5.tgz#c90c461542fcd35b6d5b015a290fb0dbfb41d242" + integrity sha512-erkbxkj9jfc89vVs/jBLY/fM0I80oLmJkFUV3Q3wk9J3miYhP14zgVEBsPZY68IZlEjT6T3Xlq2xO1AVaatHsA== dependencies: "@lerna/global-options" "3.13.0" dedent "^0.7.0" npmlog "^4.1.2" - yargs "^12.0.1" + yargs "^14.2.2" -"@lerna/collect-uncommitted@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.14.2.tgz#b5ed00d800bea26bb0d18404432b051eee8d030e" - integrity sha512-4EkQu4jIOdNL2BMzy/N0ydHB8+Z6syu6xiiKXOoFl0WoWU9H1jEJCX4TH7CmVxXL1+jcs8FIS2pfQz4oew99Eg== +"@lerna/collect-uncommitted@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-3.16.5.tgz#a494d61aac31cdc7aec4bbe52c96550274132e63" + integrity sha512-ZgqnGwpDZiWyzIQVZtQaj9tRizsL4dUOhuOStWgTAw1EMe47cvAY2kL709DzxFhjr6JpJSjXV5rZEAeU3VE0Hg== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" chalk "^2.3.1" figgy-pudding "^3.5.1" npmlog "^4.1.2" -"@lerna/collect-updates@3.16.0", "@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": +"@lerna/collect-updates@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.18.0.tgz#6086c64df3244993cc0a7f8fc0ddd6a0103008a6" + integrity sha512-LJMKgWsE/var1RSvpKDIxS8eJ7POADEc0HM3FQiTpEczhP6aZfv9x3wlDjaHpZm9MxJyQilqxZcasRANmRcNgw== + dependencies: + "@lerna/child-process" "3.16.5" + "@lerna/describe-ref" "3.16.5" + minimatch "^3.0.4" + npmlog "^4.1.2" + slash "^2.0.0" + +"@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": version "3.16.0" resolved "https://github.com/babel/lerna.git#ae87fff020c5ad00366878c14b749e8ee0a34145" dependencies: @@ -1159,26 +1160,26 @@ npmlog "^4.1.2" slash "^2.0.0" -"@lerna/command@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.16.0.tgz#ba3dba49cb5ce4d11b48269cf95becd86e30773f" - integrity sha512-u7tE4GC4/gfbPA9eQg+0ulnoJ+PMoMqomx033r/IxqZrHtmJR9+pF/37S0fsxJ2hX/RMFPC7c9Q/i8NEufSpdQ== +"@lerna/command@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-3.18.5.tgz#14c6d2454adbfd365f8027201523e6c289cd3cd9" + integrity sha512-36EnqR59yaTU4HrR1C9XDFti2jRx0BgpIUBeWn129LZZB8kAB3ov1/dJNa1KcNRKp91DncoKHLY99FZ6zTNpMQ== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/package-graph" "3.16.0" - "@lerna/project" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/package-graph" "3.18.5" + "@lerna/project" "3.18.0" "@lerna/validation-error" "3.13.0" "@lerna/write-log-file" "3.13.0" + clone-deep "^4.0.1" dedent "^0.7.0" execa "^1.0.0" is-ci "^2.0.0" - lodash "^4.17.14" npmlog "^4.1.2" -"@lerna/conventional-commits@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.16.4.tgz#bf464f11b2f6534dad204db00430e1651b346a04" - integrity sha512-QSZJ0bC9n6FVaf+7KDIq5zMv8WnHXnwhyL5jG1Nyh3SgOg9q2uflqh7YsYB+G6FwaRfnPaKosh6obijpYg0llA== +"@lerna/conventional-commits@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-3.18.5.tgz#08efd2e5b45acfaf3f151a53a3ec7ecade58a7bc" + integrity sha512-qcvXIEJ3qSgalxXnQ7Yxp5H9Ta5TVyai6vEor6AAEHc20WiO7UIdbLDCxBtiiHMdGdpH85dTYlsoYUwsCJu3HQ== dependencies: "@lerna/validation-error" "3.13.0" conventional-changelog-angular "^5.0.3" @@ -1201,14 +1202,14 @@ fs-extra "^8.1.0" npmlog "^4.1.2" -"@lerna/create@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.16.0.tgz#4de841ec7d98b29bb19fb7d6ad982e65f7a150e8" - integrity sha512-OZApR1Iz7awutbmj4sAArwhqCyKgcrnw9rH0aWAUrkYWrD1w4TwkvAcYAsfx5GpQGbLQwoXhoyyPwPfZRRWz3Q== +"@lerna/create@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-3.18.5.tgz#11ac539f069248eaf7bc4c42e237784330f4fc47" + integrity sha512-cHpjocbpKmLopCuZFI7cKEM3E/QY8y+yC7VtZ4FQRSaLU8D8i2xXtXmYaP1GOlVNavji0iwoXjuNpnRMInIr2g== dependencies: "@evocateur/pacote" "^9.6.3" - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.5" "@lerna/npm-conf" "3.16.0" "@lerna/validation-error" "3.13.0" camelcase "^5.0.0" @@ -1225,49 +1226,51 @@ validate-npm-package-name "^3.0.0" whatwg-url "^7.0.0" -"@lerna/describe-ref@3.14.2", "@lerna/describe-ref@^3.6.0": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.14.2.tgz#edc3c973f5ca9728d23358c4f4d3b55a21f65be5" - integrity sha512-qa5pzDRK2oBQXNjyRmRnN7E8a78NMYfQjjlRFB0KNHMsT6mCiL9+8kIS39sSE2NqT8p7xVNo2r2KAS8R/m3CoQ== +"@lerna/describe-ref@3.16.5", "@lerna/describe-ref@^3.6.0": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-3.16.5.tgz#a338c25aaed837d3dc70b8a72c447c5c66346ac0" + integrity sha512-c01+4gUF0saOOtDBzbLMFOTJDHTKbDFNErEY6q6i9QaXuzy9LNN62z+Hw4acAAZuJQhrVWncVathcmkkjvSVGw== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" npmlog "^4.1.2" -"@lerna/diff@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.16.0.tgz#6d09a786f9f5b343a2fdc460eb0be08a05b420aa" - integrity sha512-QUpVs5TPl8vBIne10/vyjUxanQBQQp7Lk3iaB8MnCysKr0O+oy7trWeFVDPEkBTCD177By7yPGyW5Yey1nCBbA== +"@lerna/diff@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-3.18.5.tgz#e9e2cb882f84d5b84f0487c612137305f07accbc" + integrity sha512-u90lGs+B8DRA9Z/2xX4YaS3h9X6GbypmGV6ITzx9+1Ga12UWGTVlKaCXBgONMBjzJDzAQOK8qPTwLA57SeBLgA== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.5" "@lerna/validation-error" "3.13.0" npmlog "^4.1.2" -"@lerna/exec@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.16.0.tgz#2b6c033cee46181b6eede0eb12aad5c2c0181e89" - integrity sha512-mH3O5NXf/O88jBaBBTUf+d56CUkxpg782s3Jxy7HWbVuSUULt3iMRPTh+zEXO5/555etsIVVDDyUR76meklrJA== +"@lerna/exec@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-3.18.5.tgz#50f1bd6b8f88f2ec02c0768b8b1d9024feb1a96a" + integrity sha512-Q1nz95MeAxctS9bF+aG8FkjixzqEjRpg6ujtnDW84J42GgxedkPtNcJ2o/MBqLd/mxAlr+fW3UZ6CPC/zgoyCg== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/run-topologically" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" + "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" -"@lerna/filter-options@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.16.0.tgz#b1660b4480c02a5c6efa4d0cd98b9afde4ed0bba" - integrity sha512-InIi1fF8+PxpCwir9bIy+pGxrdE6hvN0enIs1eNGCVS1TTE8osNgiZXa838bMQ1yaEccdcnVX6Z03BNKd56kNg== +"@lerna/filter-options@3.18.4": + version "3.18.4" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-3.18.4.tgz#f5476a7ee2169abed27ad433222e92103f56f9f1" + integrity sha512-4giVQD6tauRwweO/322LP2gfVDOVrt/xN4khkXyfkJDfcsZziFXq+668otD9KSLL8Ps+To4Fah3XbK0MoNuEvA== dependencies: - "@lerna/collect-updates" "3.16.0" - "@lerna/filter-packages" "3.16.0" + "@lerna/collect-updates" "3.18.0" + "@lerna/filter-packages" "3.18.0" dedent "^0.7.0" + figgy-pudding "^3.5.1" + npmlog "^4.1.2" -"@lerna/filter-packages@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.16.0.tgz#7d34dc8530c71016263d6f67dc65308ecf11c9fc" - integrity sha512-eGFzQTx0ogkGDCnbTuXqssryR6ilp8+dcXt6B+aq1MaqL/vOJRZyqMm4TY3CUOUnzZCi9S2WWyMw3PnAJOF+kg== +"@lerna/filter-packages@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-3.18.0.tgz#6a7a376d285208db03a82958cfb8172e179b4e70" + integrity sha512-6/0pMM04bCHNATIOkouuYmPg6KH3VkPCIgTfQmdkPJTullERyEQfNUKikrefjxo1vHOoCACDpy65JYyKiAbdwQ== dependencies: "@lerna/validation-error" "3.13.0" multimatch "^3.0.0" @@ -1289,12 +1292,12 @@ ssri "^6.0.1" tar "^4.4.8" -"@lerna/github-client@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.16.0.tgz#619874e461641d4f59ab1b3f1a7ba22dba88125d" - integrity sha512-IVJjcKjkYaUEPJsDyAblHGEFFNKCRyMagbIDm14L7Ab94ccN6i4TKOqAFEJn2SJHYvKKBdp3Zj2zNlASOMe3DA== +"@lerna/github-client@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-3.16.5.tgz#2eb0235c3bf7a7e5d92d73e09b3761ab21f35c2e" + integrity sha512-rHQdn8Dv/CJrO3VouOP66zAcJzrHsm+wFuZ4uGAai2At2NkgKH+tpNhQy2H1PSC0Ezj9LxvdaHYrUzULqVK5Hw== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@octokit/plugin-enterprise-rest" "^3.6.1" "@octokit/rest" "^16.28.4" git-url-parse "^11.1.2" @@ -1314,66 +1317,66 @@ resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-3.13.0.tgz#217662290db06ad9cf2c49d8e3100ee28eaebae1" integrity sha512-SlZvh1gVRRzYLVluz9fryY1nJpZ0FHDGB66U9tFfvnnxmueckRQxLopn3tXj3NU1kc3QANT2I5BsQkOqZ4TEFQ== -"@lerna/has-npm-version@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.16.0.tgz#55764a4ce792f0c8553cf996a17f554b9e843288" - integrity sha512-TIY036dA9J8OyTrZq9J+it2DVKifL65k7hK8HhkUPpitJkw6jwbMObA/8D40LOGgWNPweJWqmlrTbRSwsR7DrQ== +"@lerna/has-npm-version@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-3.16.5.tgz#ab83956f211d8923ea6afe9b979b38cc73b15326" + integrity sha512-WL7LycR9bkftyqbYop5rEGJ9sRFIV55tSGmbN1HLrF9idwOCD7CLrT64t235t3t4O5gehDnwKI5h2U3oxTrF8Q== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" semver "^6.2.0" -"@lerna/import@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.16.0.tgz#b57cb453f4acfc60f6541fcbba10674055cb179d" - integrity sha512-trsOmGHzw0rL/f8BLNvd+9PjoTkXq2Dt4/V2UCha254hMQaYutbxcYu8iKPxz9x86jSPlH7FpbTkkHXDsoY7Yg== +"@lerna/import@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-3.18.5.tgz#a9c7d8601870729851293c10abd18b3707f7ba5e" + integrity sha512-PH0WVLEgp+ORyNKbGGwUcrueW89K3Iuk/DDCz8mFyG2IG09l/jOF0vzckEyGyz6PO5CMcz4TI1al/qnp3FrahQ== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" - "@lerna/prompt" "3.13.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.5" + "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/validation-error" "3.13.0" dedent "^0.7.0" fs-extra "^8.1.0" p-map-series "^1.0.0" -"@lerna/init@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.16.0.tgz#31e0d66bbededee603338b487a42674a072b7a7d" - integrity sha512-Ybol/x5xMtBgokx4j7/Y3u0ZmNh0NiSWzBFVaOs2NOJKvuqrWimF67DKVz7yYtTYEjtaMdug64ohFF4jcT/iag== +"@lerna/init@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-3.18.5.tgz#86dd0b2b3290755a96975069b5cb007f775df9f5" + integrity sha512-oCwipWrha98EcJAHm8AGd2YFFLNI7AW9AWi0/LbClj1+XY9ah+uifXIgYGfTk63LbgophDd8936ZEpHMxBsbAg== dependencies: - "@lerna/child-process" "3.14.2" - "@lerna/command" "3.16.0" + "@lerna/child-process" "3.16.5" + "@lerna/command" "3.18.5" fs-extra "^8.1.0" p-map "^2.1.0" write-json-file "^3.2.0" -"@lerna/link@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.16.2.tgz#6c3a5658f6448a64dddca93d9348ac756776f6f6" - integrity sha512-eCPg5Lo8HT525fIivNoYF3vWghO3UgEVFdbsiPmhzwI7IQyZro5HWYzLtywSAdEog5XZpd2Bbn0CsoHWBB3gww== +"@lerna/link@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-3.18.5.tgz#f24347e4f0b71d54575bd37cfa1794bc8ee91b18" + integrity sha512-xTN3vktJpkT7Nqc3QkZRtHO4bT5NvuLMtKNIBDkks0HpGxC9PRyyqwOoCoh1yOGbrWIuDezhfMg3Qow+6I69IQ== dependencies: - "@lerna/command" "3.16.0" - "@lerna/package-graph" "3.16.0" - "@lerna/symlink-dependencies" "3.16.2" + "@lerna/command" "3.18.5" + "@lerna/package-graph" "3.18.5" + "@lerna/symlink-dependencies" "3.17.0" p-map "^2.1.0" slash "^2.0.0" -"@lerna/list@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.16.0.tgz#883c00b2baf1e03c93e54391372f67a01b773c2f" - integrity sha512-TkvstoPsgKqqQ0KfRumpsdMXfRSEhdXqOLq519XyI5IRWYxhoqXqfi8gG37UoBPhBNoe64japn5OjphF3rOmQA== +"@lerna/list@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-3.18.5.tgz#58863f17c81e24e2c38018eb8619fc99d7cc5c82" + integrity sha512-qIeomm28C2OCM8TMjEe/chTnQf6XLN54wPVQ6kZy+axMYxANFNt/uhs6GZEmhem7GEVawzkyHSz5ZJPsfH3IFg== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/listable" "3.16.0" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" + "@lerna/listable" "3.18.5" "@lerna/output" "3.13.0" -"@lerna/listable@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.16.0.tgz#e6dc47a2d5a6295222663486f50e5cffc580f043" - integrity sha512-mtdAT2EEECqrJSDm/aXlOUFr1MRE4p6hppzY//Klp05CogQy6uGaKk+iKG5yyCLaOXFFZvG4HfO11CmoGSDWzw== +"@lerna/listable@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-3.18.5.tgz#e82798405b5ed8fc51843c8ef1e7a0e497388a1a" + integrity sha512-Sdr3pVyaEv5A7ZkGGYR7zN+tTl2iDcinryBPvtuv20VJrXBE8wYcOks1edBTcOWsPjCE/rMP4bo1pseyk3UTsg== dependencies: - "@lerna/query-graph" "3.16.0" + "@lerna/query-graph" "3.18.5" chalk "^2.3.1" columnify "^1.5.4" @@ -1395,23 +1398,23 @@ config-chain "^1.1.11" pify "^4.0.1" -"@lerna/npm-dist-tag@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.16.0.tgz#b2184cee5e1f291277396854820e1117a544b7ee" - integrity sha512-MQrBkqJJB9+eNphuj9w90QPMOs4NQXMuSRk9NqzeFunOmdDopPCV0Q7IThSxEuWnhJ2n3B7G0vWUP7tNMPdqIQ== +"@lerna/npm-dist-tag@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-3.18.5.tgz#9ef9abb7c104077b31f6fab22cc73b314d54ac55" + integrity sha512-xw0HDoIG6HreVsJND9/dGls1c+lf6vhu7yJoo56Sz5bvncTloYGLUppIfDHQr4ZvmPCK8rsh0euCVh2giPxzKQ== dependencies: "@evocateur/npm-registry-fetch" "^4.0.0" - "@lerna/otplease" "3.16.0" + "@lerna/otplease" "3.18.5" figgy-pudding "^3.5.1" npm-package-arg "^6.1.0" npmlog "^4.1.2" -"@lerna/npm-install@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.16.0.tgz#8ec76a7a13b183bde438fd46296bf7a0d6f86017" - integrity sha512-APUOIilZCzDzce92uLEwzt1r7AEMKT/hWA1ThGJL+PO9Rn8A95Km3o2XZAYG4W0hR+P4O2nSVuKbsjQtz8CjFQ== +"@lerna/npm-install@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-3.16.5.tgz#d6bfdc16f81285da66515ae47924d6e278d637d3" + integrity sha512-hfiKk8Eku6rB9uApqsalHHTHY+mOrrHeWEs+gtg7+meQZMTS3kzv4oVp5cBZigndQr3knTLjwthT/FX4KvseFg== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" fs-extra "^8.1.0" npm-package-arg "^6.1.0" @@ -1419,13 +1422,13 @@ signal-exit "^3.0.2" write-pkg "^3.1.0" -"@lerna/npm-publish@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.16.2.tgz#a850b54739446c4aa766a0ceabfa9283bb0be676" - integrity sha512-tGMb9vfTxP57vUV5svkBQxd5Tzc+imZbu9ZYf8Mtwe0+HYfDjNiiHLIQw7G95w4YRdc5KsCE8sQ0uSj+f2soIg== +"@lerna/npm-publish@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-3.18.5.tgz#240e4039959fd9816b49c5b07421e11b5cb000af" + integrity sha512-3etLT9+2L8JAx5F8uf7qp6iAtOLSMj+ZYWY6oUgozPi/uLqU0/gsMsEXh3F0+YVW33q0M61RpduBoAlOOZnaTg== dependencies: "@evocateur/libnpmpublish" "^1.2.2" - "@lerna/otplease" "3.16.0" + "@lerna/otplease" "3.18.5" "@lerna/run-lifecycle" "3.16.2" figgy-pudding "^3.5.1" fs-extra "^8.1.0" @@ -1434,21 +1437,21 @@ pify "^4.0.1" read-package-json "^2.0.13" -"@lerna/npm-run-script@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.14.2.tgz#8c518ea9d241a641273e77aad6f6fddc16779c3f" - integrity sha512-LbVFv+nvAoRTYLMrJlJ8RiakHXrLslL7Jp/m1R18vYrB8LYWA3ey+nz5Tel2OELzmjUiemAKZsD9h6i+Re5egg== +"@lerna/npm-run-script@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-3.16.5.tgz#9c2ec82453a26c0b46edc0bb7c15816c821f5c15" + integrity sha512-1asRi+LjmVn3pMjEdpqKJZFT/3ZNpb+VVeJMwrJaV/3DivdNg7XlPK9LTrORuKU4PSvhdEZvJmSlxCKyDpiXsQ== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" "@lerna/get-npm-exec-opts" "3.13.0" npmlog "^4.1.2" -"@lerna/otplease@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-3.16.0.tgz#de66aec4f3e835a465d7bea84b58a4ab6590a0fa" - integrity sha512-uqZ15wYOHC+/V0WnD2iTLXARjvx3vNrpiIeyIvVlDB7rWse9mL4egex/QSgZ+lDx1OID7l2kgvcUD9cFpbqB7Q== +"@lerna/otplease@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-3.18.5.tgz#b77b8e760b40abad9f7658d988f3ea77d4fd0231" + integrity sha512-S+SldXAbcXTEDhzdxYLU0ZBKuYyURP/ND2/dK6IpKgLxQYh/z4ScljPDMyKymmEvgiEJmBsPZAAPfmNPEzxjog== dependencies: - "@lerna/prompt" "3.13.0" + "@lerna/prompt" "3.18.5" figgy-pudding "^3.5.1" "@lerna/output@3.13.0": @@ -1472,10 +1475,10 @@ tar "^4.4.10" temp-write "^3.4.0" -"@lerna/package-graph@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.16.0.tgz#909c90fb41e02f2c19387342d2a5eefc36d56836" - integrity sha512-A2mum/gNbv7zCtAwJqoxzqv89As73OQNK2MgSX1SHWya46qoxO9a9Z2c5lOFQ8UFN5ZxqWMfFYXRCz7qzwmFXw== +"@lerna/package-graph@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-3.18.5.tgz#c740e2ea3578d059e551633e950690831b941f6b" + integrity sha512-8QDrR9T+dBegjeLr+n9WZTVxUYUhIUjUgZ0gvNxUBN8S1WB9r6H5Yk56/MVaB64tA3oGAN9IIxX6w0WvTfFudA== dependencies: "@lerna/prerelease-id-from-version" "3.16.0" "@lerna/validation-error" "3.13.0" @@ -1499,10 +1502,10 @@ dependencies: semver "^6.2.0" -"@lerna/project@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.16.0.tgz#2469a4e346e623fd922f38f5a12931dfb8f2a946" - integrity sha512-NrKcKK1EqXqhrGvslz6Q36+ZHuK3zlDhGdghRqnxDcHxMPT01NgLcmsnymmQ+gjMljuLRmvKYYCuHrknzX8VrA== +"@lerna/project@3.18.0": + version "3.18.0" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-3.18.0.tgz#56feee01daeb42c03cbdf0ed8a2a10cbce32f670" + integrity sha512-+LDwvdAp0BurOAWmeHE3uuticsq9hNxBI0+FMHiIai8jrygpJGahaQrBYWpwbshbQyVLeQgx3+YJdW2TbEdFWA== dependencies: "@lerna/package" "3.16.0" "@lerna/validation-error" "3.13.0" @@ -1517,41 +1520,41 @@ resolve-from "^4.0.0" write-json-file "^3.2.0" -"@lerna/prompt@3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-3.13.0.tgz#53571462bb3f5399cc1ca6d335a411fe093426a5" - integrity sha512-P+lWSFokdyvYpkwC3it9cE0IF2U5yy2mOUbGvvE4iDb9K7TyXGE+7lwtx2thtPvBAfIb7O13POMkv7df03HJeA== +"@lerna/prompt@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-3.18.5.tgz#628cd545f225887d060491ab95df899cfc5218a1" + integrity sha512-rkKj4nm1twSbBEb69+Em/2jAERK8htUuV8/xSjN0NPC+6UjzAwY52/x9n5cfmpa9lyKf/uItp7chCI7eDmNTKQ== dependencies: inquirer "^6.2.0" npmlog "^4.1.2" -"@lerna/publish@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.16.4.tgz#4cd55d8be9943d9a68e316e930a90cda8590500e" - integrity sha512-XZY+gRuF7/v6PDQwl7lvZaGWs8CnX6WIPIu+OCcyFPSL/rdWegdN7HieKBHskgX798qRQc2GrveaY7bNoTKXAw== +"@lerna/publish@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-3.18.5.tgz#8cc708d83a4cb7ab1c4cc020a02e7ebc4b6b0b0e" + integrity sha512-ifYqLX6mvw95T8vYRlhT68UC7Al0flQvnf5uF9lDgdrgR5Bs+BTwzk3D+0ctdqMtfooekrV6pqfW0R3gtwRffQ== dependencies: "@evocateur/libnpmaccess" "^3.1.2" "@evocateur/npm-registry-fetch" "^4.0.0" "@evocateur/pacote" "^9.6.3" - "@lerna/check-working-tree" "3.14.2" - "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/describe-ref" "3.14.2" + "@lerna/check-working-tree" "3.16.5" + "@lerna/child-process" "3.16.5" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.5" + "@lerna/describe-ref" "3.16.5" "@lerna/log-packed" "3.16.0" "@lerna/npm-conf" "3.16.0" - "@lerna/npm-dist-tag" "3.16.0" - "@lerna/npm-publish" "3.16.2" - "@lerna/otplease" "3.16.0" + "@lerna/npm-dist-tag" "3.18.5" + "@lerna/npm-publish" "3.18.5" + "@lerna/otplease" "3.18.5" "@lerna/output" "3.13.0" "@lerna/pack-directory" "3.16.4" "@lerna/prerelease-id-from-version" "3.16.0" - "@lerna/prompt" "3.13.0" + "@lerna/prompt" "3.18.5" "@lerna/pulse-till-done" "3.13.0" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" - "@lerna/version" "3.16.4" + "@lerna/version" "3.18.5" figgy-pudding "^3.5.1" fs-extra "^8.1.0" npm-package-arg "^6.1.0" @@ -1568,12 +1571,12 @@ dependencies: npmlog "^4.1.2" -"@lerna/query-graph@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.16.0.tgz#e6a46ebcd9d5b03f018a06eca2b471735353953c" - integrity sha512-p0RO+xmHDO95ChJdWkcy9TNLysLkoDARXeRHzY5U54VCwl3Ot/2q8fMCVlA5UeGXDutEyyByl3URqEpcQCWI7Q== +"@lerna/query-graph@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-3.18.5.tgz#df4830bb5155273003bf35e8dda1c32d0927bd86" + integrity sha512-50Lf4uuMpMWvJ306be3oQDHrWV42nai9gbIVByPBYJuVW8dT8O8pA3EzitNYBUdLL9/qEVbrR0ry1HD7EXwtRA== dependencies: - "@lerna/package-graph" "3.16.0" + "@lerna/package-graph" "3.18.5" figgy-pudding "^3.5.1" "@lerna/resolve-symlink@3.16.0": @@ -1585,12 +1588,12 @@ npmlog "^4.1.2" read-cmd-shim "^1.0.1" -"@lerna/rimraf-dir@3.14.2": - version "3.14.2" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.14.2.tgz#103a49882abd85d42285d05cc76869b89f21ffd2" - integrity sha512-eFNkZsy44Bu9v1Hrj5Zk6omzg8O9h/7W6QYK1TTUHeyrjTEwytaNQlqF0lrTLmEvq55sviV42NC/8P3M2cvq8Q== +"@lerna/rimraf-dir@3.16.5": + version "3.16.5" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-3.16.5.tgz#04316ab5ffd2909657aaf388ea502cb8c2f20a09" + integrity sha512-bQlKmO0pXUsXoF8lOLknhyQjOZsCc0bosQDoX4lujBXSWxHVTg1VxURtWf2lUjz/ACsJVDfvHZbDm8kyBk5okA== dependencies: - "@lerna/child-process" "3.14.2" + "@lerna/child-process" "3.16.5" npmlog "^4.1.2" path-exists "^3.0.0" rimraf "^2.6.2" @@ -1605,55 +1608,47 @@ npm-lifecycle "^3.1.2" npmlog "^4.1.2" -"@lerna/run-parallel-batches@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run-parallel-batches/-/run-parallel-batches-3.16.0.tgz#5ace7911a2dd31dfd1e53c61356034e27df0e1fb" - integrity sha512-2J/Nyv+MvogmQEfC7VcS21ifk7w0HVvzo2yOZRPvkCzGRu/rducxtB4RTcr58XCZ8h/Bt1aqQYKExu3c/3GXwg== - dependencies: - p-map "^2.1.0" - p-map-series "^1.0.0" - -"@lerna/run-topologically@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.16.0.tgz#39e29cfc628bbc8e736d8e0d0e984997ac01bbf5" - integrity sha512-4Hlpv4zDtKWa5Z0tPkeu0sK+bxZEKgkNESMGmWrUCNfj7xwvAJurcraK8+a2Y0TFYwf0qjSLY/MzX+ZbJA3Cgw== +"@lerna/run-topologically@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-3.18.5.tgz#3cd639da20e967d7672cb88db0f756b92f2fdfc3" + integrity sha512-6N1I+6wf4hLOnPW+XDZqwufyIQ6gqoPfHZFkfWlvTQ+Ue7CuF8qIVQ1Eddw5HKQMkxqN10thKOFfq/9NQZ4NUg== dependencies: - "@lerna/query-graph" "3.16.0" + "@lerna/query-graph" "3.18.5" figgy-pudding "^3.5.1" p-queue "^4.0.0" -"@lerna/run@3.16.0": - version "3.16.0" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.16.0.tgz#1ea568c6f303e47fa00b3403a457836d40738fd2" - integrity sha512-woTeLlB1OAAz4zzjdI6RyIxSGuxiUPHJZm89E1pDEPoWwtQV6HMdMgrsQd9ATsJ5Ez280HH4bF/LStAlqW8Ufg== +"@lerna/run@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-3.18.5.tgz#09ae809b16445d3621249c24596cf4ae8e250d5d" + integrity sha512-1S0dZccNJO8+gT5ztYE4rHTEnbXVwThHOfDnlVt2KDxl9cbnBALk3xprGLW7lSzJsxegS849hxrAPUh0UorMgw== dependencies: - "@lerna/command" "3.16.0" - "@lerna/filter-options" "3.16.0" - "@lerna/npm-run-script" "3.14.2" + "@lerna/command" "3.18.5" + "@lerna/filter-options" "3.18.4" + "@lerna/npm-run-script" "3.16.5" "@lerna/output" "3.13.0" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.5" "@lerna/timer" "3.13.0" "@lerna/validation-error" "3.13.0" p-map "^2.1.0" -"@lerna/symlink-binary@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.16.2.tgz#f98a3d9da9e56f1d302dc0d5c2efeb951483ee66" - integrity sha512-kz9XVoFOGSF83gg4gBqH+mG6uxfJfTp8Uy+Cam40CvMiuzfODrGkjuBEFoM/uO2QOAwZvbQDYOBpKUa9ZxHS1Q== +"@lerna/symlink-binary@3.17.0": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-3.17.0.tgz#8f8031b309863814883d3f009877f82e38aef45a" + integrity sha512-RLpy9UY6+3nT5J+5jkM5MZyMmjNHxZIZvXLV+Q3MXrf7Eaa1hNqyynyj4RO95fxbS+EZc4XVSk25DGFQbcRNSQ== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/package" "3.16.0" fs-extra "^8.1.0" p-map "^2.1.0" -"@lerna/symlink-dependencies@3.16.2": - version "3.16.2" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.16.2.tgz#91d9909d35897aebd76a03644a00cd03c4128240" - integrity sha512-wnZqGJQ+Jvr1I3inxrkffrFZfmQI7Ta8gySw/UWCy95QtZWF/f5yk8zVIocCAsjzD0wgb3jJE3CFJ9W5iwWk1A== +"@lerna/symlink-dependencies@3.17.0": + version "3.17.0" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-3.17.0.tgz#48d6360e985865a0e56cd8b51b308a526308784a" + integrity sha512-KmjU5YT1bpt6coOmdFueTJ7DFJL4H1w5eF8yAQ2zsGNTtZ+i5SGFBWpb9AQaw168dydc3s4eu0W0Sirda+F59Q== dependencies: "@lerna/create-symlink" "3.16.2" "@lerna/resolve-symlink" "3.16.0" - "@lerna/symlink-binary" "3.16.2" + "@lerna/symlink-binary" "3.17.0" fs-extra "^8.1.0" p-finally "^1.0.0" p-map "^2.1.0" @@ -1671,26 +1666,27 @@ dependencies: npmlog "^4.1.2" -"@lerna/version@3.16.4": - version "3.16.4" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.16.4.tgz#b5cc37f3ad98358d599c6196c30b6efc396d42bf" - integrity sha512-ikhbMeIn5ljCtWTlHDzO4YvTmpGTX1lWFFIZ79Vd1TNyOr+OUuKLo/+p06mCl2WEdZu0W2s5E9oxfAAQbyDxEg== - dependencies: - "@lerna/check-working-tree" "3.14.2" - "@lerna/child-process" "3.14.2" - "@lerna/collect-updates" "3.16.0" - "@lerna/command" "3.16.0" - "@lerna/conventional-commits" "3.16.4" - "@lerna/github-client" "3.16.0" +"@lerna/version@3.18.5": + version "3.18.5" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-3.18.5.tgz#0c4f0c2f8d23e9c95c2aa77ad9ce5c7ef025fac0" + integrity sha512-eSMxLIDuVxZIq0JZKNih50x1IZuMmViwF59uwOGMx0hHB84N3waE8HXOF9CJXDSjeP6sHB8tS+Y+X5fFpBop2Q== + dependencies: + "@lerna/check-working-tree" "3.16.5" + "@lerna/child-process" "3.16.5" + "@lerna/collect-updates" "3.18.0" + "@lerna/command" "3.18.5" + "@lerna/conventional-commits" "3.18.5" + "@lerna/github-client" "3.16.5" "@lerna/gitlab-client" "3.15.0" "@lerna/output" "3.13.0" "@lerna/prerelease-id-from-version" "3.16.0" - "@lerna/prompt" "3.13.0" + "@lerna/prompt" "3.18.5" "@lerna/run-lifecycle" "3.16.2" - "@lerna/run-topologically" "3.16.0" + "@lerna/run-topologically" "3.18.5" "@lerna/validation-error" "3.13.0" chalk "^2.3.1" dedent "^0.7.0" + load-json-file "^5.3.0" minimatch "^3.0.4" npmlog "^4.1.2" p-map "^2.1.0" @@ -1700,6 +1696,7 @@ semver "^6.2.0" slash "^2.0.0" temp-write "^3.4.0" + write-json-file "^3.2.0" "@lerna/write-log-file@3.13.0": version "3.13.0" @@ -1722,11 +1719,12 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== -"@octokit/endpoint@^5.1.0": - version "5.3.5" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.3.5.tgz#2822c3b01107806dbdce3863b6205e3eff4289ed" - integrity sha512-f8KqzIrnzPLiezDsZZPB+K8v8YSv6aKFl7eOu59O46lmlW4HagWl1U6NWl6LmT8d1w7NsKBI3paVtzcnRGO1gw== +"@octokit/endpoint@^5.5.0": + version "5.5.1" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.5.1.tgz#2eea81e110ca754ff2de11c79154ccab4ae16b3f" + integrity sha512-nBFhRUb5YzVTCX/iAK1MgQ4uWo89Gu0TH00qQHoYRCsE12dWcG1OiLd7v2EIo2+tpUKPMOQ62QFy9hy9Vg2ULg== dependencies: + "@octokit/types" "^2.0.0" is-plain-object "^3.0.0" universal-user-agent "^4.0.0" @@ -1736,20 +1734,22 @@ integrity sha512-3wF5eueS5OHQYuAEudkpN+xVeUsg8vYEMMenEzLphUZ7PRZ8OJtDcsreL3ad9zxXmBbaFWzLmFcdob5CLyZftA== "@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.0.4.tgz#15e1dc22123ba4a9a4391914d80ec1e5303a23be" - integrity sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig== + version "1.2.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-1.2.0.tgz#a64d2a9d7a13555570cd79722de4a4d76371baaa" + integrity sha512-DNBhROBYjjV/I9n7A8kVkmQNkqFAMem90dSxqvPq57e2hBr7mNTX98y3R2zDpqMQHVRpBDjsvsfIGgBzy+4PAg== dependencies: + "@octokit/types" "^2.0.0" deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.0.0": - version "5.1.0" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.1.0.tgz#5609dcc7b5323e529f29d535214383d9eaf0c05c" - integrity sha512-I15T9PwjFs4tbWyhtFU2Kq7WDPidYMvRB7spmxoQRZfxSmiqullG+Nz+KbSmpkfnlvHwTr1e31R5WReFRKMXjg== +"@octokit/request@^5.2.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.3.1.tgz#3a1ace45e6f88b1be4749c5da963b3a3b4a2f120" + integrity sha512-5/X0AL1ZgoU32fAepTfEoggFinO3rxsMLtzhlUX+RctLrusn/CApJuGFCd0v7GMFhF+8UiCsTTfsu7Fh1HnEJg== dependencies: - "@octokit/endpoint" "^5.1.0" + "@octokit/endpoint" "^5.5.0" "@octokit/request-error" "^1.0.1" + "@octokit/types" "^2.0.0" deprecation "^2.0.0" is-plain-object "^3.0.0" node-fetch "^2.3.0" @@ -1757,11 +1757,11 @@ universal-user-agent "^4.0.0" "@octokit/rest@^16.28.4": - version "16.28.9" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.28.9.tgz#ac8c5f3ff305e9e0a0989a5245e4286f057a95d7" - integrity sha512-IKGnX+Tvzt7XHhs8f4ajqxyJvYAMNX5nWfoJm4CQj8LZToMiaJgutf5KxxpxoC3y5w7JTJpW5rnWnF4TsIvCLA== + version "16.35.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-16.35.0.tgz#7ccc1f802f407d5b8eb21768c6deca44e7b4c0d8" + integrity sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w== dependencies: - "@octokit/request" "^5.0.0" + "@octokit/request" "^5.2.0" "@octokit/request-error" "^1.0.2" atob-lite "^2.0.0" before-after-hook "^2.0.0" @@ -1774,6 +1774,13 @@ once "^1.4.0" universal-user-agent "^4.0.0" +"@octokit/types@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-2.0.2.tgz#0888497f5a664e28b0449731d5e88e19b2a74f90" + integrity sha512-StASIL2lgT3TRjxv17z9pAqbnI7HGu9DrJlg3sEBFfCLaMEqp+O3IQPUF6EZtQ4xkAu2ml6kMBBCtGxjvmtmuQ== + dependencies: + "@types/node" ">= 8" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -1900,10 +1907,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@^12.6.2": - version "12.6.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.6.3.tgz#44d507c5634f85e7164707ca36bba21b5213d487" - integrity sha512-7TEYTQT1/6PP53NftXXabIZDaZfaoBdeBm8Md/i7zsWRoBe0YwOXguyK8vhHs8ehgB/w9U4K/6EWuTyp0W6nIA== +"@types/node@*", "@types/node@>= 8", "@types/node@^12.6.2": + version "12.12.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.11.tgz#bec2961975888d964196bf0016a2f984d793d3ce" + integrity sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ== "@types/node@^8.0.0": version "8.10.50" @@ -2629,9 +2636,9 @@ binary-extensions@^1.0.0: integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: - version "3.5.5" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.5.tgz#a8d0afd73251effbbd5fe384a77d73003c17a71f" - integrity sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w== + version "3.7.1" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" + integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" @@ -3142,9 +3149,9 @@ chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.1.8: fsevents "^1.2.7" chownr@^1.1.1, chownr@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6" - integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A== + version "1.1.3" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142" + integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw== ci-info@^2.0.0: version "2.0.0" @@ -3214,15 +3221,6 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" -cliui@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" - integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== - dependencies: - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi "^2.0.0" - cliui@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" @@ -3237,6 +3235,15 @@ clone-buffer@^1.0.0: resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" @@ -3350,10 +3357,10 @@ commander@2.17.x: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.20.0, commander@^2.8.1, commander@~2.20.0: - version "2.20.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" - integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== +commander@^2.20.0, commander@^2.8.1, commander@~2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== commander@~2.19.0: version "2.19.0" @@ -3434,9 +3441,9 @@ contains-path@^0.1.0: integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= conventional-changelog-angular@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.3.tgz#299fdd43df5a1f095283ac16aeedfb0a682ecab0" - integrity sha512-YD1xzH7r9yXQte/HF9JBuEDfvjxxwDGGwZU1+ndanbY0oFgA+Po1T9JDSpPLdP0pZT6MhCAsdvFKC4TJ4MTJTA== + version "5.0.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-5.0.6.tgz#269540c624553aded809c29a3508fdc2b544c059" + integrity sha512-QDEmLa+7qdhVIv8sFZfVxU1VSyVvnXPsxq8Vam49mKUcO1Z8VTLEJk9uI21uiJUsnmm0I4Hrsdc9TgkOQo9WSA== dependencies: compare-func "^1.3.1" q "^1.5.1" @@ -3461,22 +3468,22 @@ conventional-changelog-core@^3.1.6: through2 "^3.0.0" conventional-changelog-preset-loader@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz#571e2b3d7b53d65587bea9eedf6e37faa5db4fcc" - integrity sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ== + version "2.3.0" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.0.tgz#580fa8ab02cef22c24294d25e52d7ccd247a9a6a" + integrity sha512-/rHb32J2EJnEXeK4NpDgMaAVTFZS3o1ExmjKMtYVgIC4MQn0vkNSbYpdGRotkfGGRWiqk3Ri3FBkiZGbAfIfOQ== conventional-changelog-writer@^4.0.6: - version "4.0.7" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz#e4b7d9cbea902394ad671f67108a71fa90c7095f" - integrity sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw== + version "4.0.11" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.11.tgz#9f56d2122d20c96eb48baae0bf1deffaed1edba4" + integrity sha512-g81GQOR392I+57Cw3IyP1f+f42ME6aEkbR+L7v1FBBWolB0xkjKTeCWVguzRrp6UiT1O6gBpJbEy2eq7AnV1rw== dependencies: compare-func "^1.3.1" conventional-commits-filter "^2.0.2" dateformat "^3.0.0" - handlebars "^4.1.2" + handlebars "^4.4.0" json-stringify-safe "^5.0.1" - lodash "^4.2.1" - meow "^4.0.0" + lodash "^4.17.15" + meow "^5.0.0" semver "^6.0.0" split "^1.0.0" through2 "^3.0.0" @@ -3490,14 +3497,14 @@ conventional-commits-filter@^2.0.2: modify-values "^1.0.0" conventional-commits-parser@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d" - integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg== + version "3.0.8" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.8.tgz#23310a9bda6c93c874224375e72b09fb275fe710" + integrity sha512-YcBSGkZbYp7d+Cr3NWUeXbPDFUN6g3SaSIzOybi8bjHL5IJ5225OSCxJJ4LgziyEJ7AaJtE9L2/EU6H7Nt/DDQ== dependencies: JSONStream "^1.0.4" - is-text-path "^2.0.0" - lodash "^4.2.1" - meow "^4.0.0" + is-text-path "^1.0.1" + lodash "^4.17.15" + meow "^5.0.0" split2 "^2.0.0" through2 "^3.0.0" trim-off-newlines "^1.0.0" @@ -3819,7 +3826,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-properties@^1.1.2: +define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -4139,9 +4146,9 @@ encoding@^0.1.11: iconv-lite "~0.4.13" end-of-stream@^1.0.0, end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== dependencies: once "^1.4.0" @@ -4185,9 +4192,9 @@ error-ex@^1.2.0, error-ex@^1.3.1: is-arrayish "^0.2.1" es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.1.tgz#6e8d84b445ec9c610781e74a6d52cc31aac5b4ca" - integrity sha512-cp/Tb1oA/rh2X7vqeSOvM+TSo3UkJLX70eNihgVEvnzwAgikjkTFr/QVgRCaxjm0knCNQzNoxxxcw2zO2LJdZA== + version "1.16.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.0.tgz#d3a26dc9c3283ac9750dca569586e976d9dcc06d" + integrity sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg== dependencies: es-to-primitive "^1.2.0" function-bind "^1.1.1" @@ -4197,13 +4204,13 @@ es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: is-regex "^1.0.4" object-inspect "^1.6.0" object-keys "^1.1.1" - string.prototype.trimleft "^2.0.0" - string.prototype.trimright "^2.0.0" + string.prototype.trimleft "^2.1.0" + string.prototype.trimright "^2.1.0" es-to-primitive@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" - integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== dependencies: is-callable "^1.1.4" is-date-object "^1.0.1" @@ -4990,11 +4997,11 @@ fs-extra@^8.1.0: universalify "^0.1.0" fs-minipass@^1.2.5: - version "1.2.6" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" - integrity sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ== + version "1.2.7" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" + integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== dependencies: - minipass "^2.2.1" + minipass "^2.6.0" fs-mkdirp-stream@^1.0.0: version "1.0.0" @@ -5211,9 +5218,9 @@ glob-parent@^3.0.1, glob-parent@^3.1.0: path-dirname "^1.0.0" glob-parent@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" - integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + version "5.1.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" + integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== dependencies: is-glob "^4.0.1" @@ -5251,9 +5258,9 @@ glob-watcher@^5.0.3: object.defaults "^1.1.0" glob@^7.0.0, glob@^7.0.3, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== dependencies: fs.realpath "^1.0.0" inflight "^1.0.4" @@ -5320,9 +5327,9 @@ glogg@^1.0.0: sparkles "^1.0.0" graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: - version "4.2.2" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" - integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== growly@^1.3.0: version "1.3.0" @@ -5447,10 +5454,10 @@ gulplog@^1.0.0: dependencies: glogg "^1.0.0" -handlebars@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" - integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== +handlebars@^4.1.2, handlebars@^4.4.0: + version "4.5.3" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482" + integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -5496,9 +5503,9 @@ has-gulplog@^0.1.0: sparkles "^1.0.0" has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" + integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== has-unicode@^2.0.0, has-unicode@^2.0.1: version "2.0.1" @@ -5581,9 +5588,9 @@ homedir-polyfill@^1.0.1: parse-passwd "^1.0.0" hosted-git-info@^2.1.4, hosted-git-info@^2.7.1: - version "2.8.4" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.4.tgz#44119abaf4bc64692a16ace34700fed9c03e2546" - integrity sha512-pzXIvANXEFrc5oFFXRMkbLPQ2rXRoDERwDLyrcUxGhaZhgP54BBSl9Oheh7Vv0T090cszWBxPjkQQ5Sq1PbBRQ== + version "2.8.5" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.5.tgz#759cfcf2c4d156ade59b0b2dfabddc42a6b9c70c" + integrity sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg== html-encoding-sniffer@^1.0.2: version "1.0.2" @@ -5660,10 +5667,10 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz#271ea8e90f836ac9f119daccd39c19ff7dfb0793" - integrity sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg== +https-proxy-agent@^2.2.3: + version "2.2.4" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" + integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== dependencies: agent-base "^4.3.0" debug "^3.1.0" @@ -5709,9 +5716,9 @@ iferr@^0.1.5: integrity sha1-xg7taebY/bazEEofy8ocGS3FtQE= ignore-walk@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.2.tgz#99d83a246c196ea5c93ef9315ad7b0819c35069b" - integrity sha512-EXyErtpHbn75ZTsOADsfx6J/FPo6/5cjev46PXrcTpd8z3BoRkXgYu9/JVqrI7tusjmwCZutGeRJeU0Wo1e4Cw== + version "3.0.3" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.3.tgz#017e2447184bfeade7c238e4aefdd1e8f95b1e37" + integrity sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw== dependencies: minimatch "^3.0.4" @@ -5874,12 +5881,7 @@ invert-kv@^1.0.0: resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" integrity sha1-EEqOSqym09jNFXqO+L+rLXo//bY= -invert-kv@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" - integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== - -ip@^1.1.5: +ip@1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a" integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo= @@ -6203,12 +6205,12 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" -is-text-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-2.0.0.tgz#b2484e2b720a633feb2e85b67dc193ff72c75636" - integrity sha512-+oDTluR6WEjdXEJMnC2z6A4FRwFoYuvShVVEGsS7ewc0UTi2QtAKMDJuL4BDEVt+5T7MjFo12RP8ghOM75oKJw== +is-text-path@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-text-path/-/is-text-path-1.0.1.tgz#4e1aa0fb51bfbcb3e92688001397202c1775b66e" + integrity sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4= dependencies: - text-extensions "^2.0.0" + text-extensions "^1.0.0" is-typedarray@~1.0.0: version "1.0.0" @@ -6912,13 +6914,6 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" -lcid@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" - integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== - dependencies: - invert-kv "^2.0.0" - lead@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lead/-/lead-1.0.0.tgz#6f14f99a37be3a9dd784f5495690e5903466ee42" @@ -6944,26 +6939,26 @@ lerna-changelog@^0.5.0: string.prototype.padend "^3.0.0" yargs "^6.6.0" -lerna@^3.16.0: - version "3.16.4" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.16.4.tgz#158cb4f478b680f46f871d5891f531f3a2cb31ec" - integrity sha512-0HfwXIkqe72lBLZcNO9NMRfylh5Ng1l8tETgYQ260ZdHRbPuaLKE3Wqnd2YYRRkWfwPyEyZO8mZweBR+slVe1A== - dependencies: - "@lerna/add" "3.16.2" - "@lerna/bootstrap" "3.16.2" - "@lerna/changed" "3.16.4" - "@lerna/clean" "3.16.0" - "@lerna/cli" "3.13.0" - "@lerna/create" "3.16.0" - "@lerna/diff" "3.16.0" - "@lerna/exec" "3.16.0" - "@lerna/import" "3.16.0" - "@lerna/init" "3.16.0" - "@lerna/link" "3.16.2" - "@lerna/list" "3.16.0" - "@lerna/publish" "3.16.4" - "@lerna/run" "3.16.0" - "@lerna/version" "3.16.4" +lerna@^3.19.0: + version "3.19.0" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.19.0.tgz#6d53b613eca7da426ab1e97c01ce6fb39754da6c" + integrity sha512-YtMmwEqzWHQCh7Ynk7BvjrZri3EkSeVqTAcwZIqWlv9V/dCfvFPyRqp+2NIjPB5nj1FWXLRH6F05VT/qvzuuOA== + dependencies: + "@lerna/add" "3.19.0" + "@lerna/bootstrap" "3.18.5" + "@lerna/changed" "3.18.5" + "@lerna/clean" "3.18.5" + "@lerna/cli" "3.18.5" + "@lerna/create" "3.18.5" + "@lerna/diff" "3.18.5" + "@lerna/exec" "3.18.5" + "@lerna/import" "3.18.5" + "@lerna/init" "3.18.5" + "@lerna/link" "3.18.5" + "@lerna/list" "3.18.5" + "@lerna/publish" "3.18.5" + "@lerna/run" "3.18.5" + "@lerna/version" "3.18.5" import-local "^2.0.0" npmlog "^4.1.2" @@ -7206,7 +7201,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.4, lodash@^4.2.1: +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -7314,15 +7309,15 @@ make-error@^1.2.0: integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== make-fetch-happen@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.0.tgz#a8e3fe41d3415dd656fe7b8e8172e1fb4458b38d" - integrity sha512-nFr/vpL1Jc60etMVKeaLOqfGjMMb3tAHFVJWxHOFCFS04Zmd7kGlMxo0l1tzfhoQje0/UPnd0X8OeGUiXXnfPA== + version "5.0.2" + resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" + integrity sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag== dependencies: agentkeepalive "^3.4.1" cacache "^12.0.0" http-cache-semantics "^3.8.1" http-proxy-agent "^2.1.0" - https-proxy-agent "^2.2.1" + https-proxy-agent "^2.2.3" lru-cache "^5.1.1" mississippi "^3.0.0" node-fetch-npm "^2.0.2" @@ -7344,13 +7339,6 @@ makeerror@1.0.x: dependencies: tmpl "1.0.x" -map-age-cleaner@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" - integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== - dependencies: - p-defer "^1.0.0" - map-cache@^0.2.0, map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -7404,15 +7392,6 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" -mem@^4.0.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" - integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== - dependencies: - map-age-cleaner "^0.1.1" - mimic-fn "^2.0.0" - p-is-promise "^2.0.0" - memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" @@ -7452,15 +7431,30 @@ meow@^4.0.0: redent "^2.0.0" trim-newlines "^2.0.0" +meow@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-5.0.0.tgz#dfc73d63a9afc714a5e371760eb5c88b91078aa4" + integrity sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig== + dependencies: + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist-options "^3.0.1" + normalize-package-data "^2.3.4" + read-pkg-up "^3.0.0" + redent "^2.0.0" + trim-newlines "^2.0.0" + yargs-parser "^10.0.0" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== merge2@^1.2.3: - version "1.2.4" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.4.tgz#c9269589e6885a60cf80605d9522d4b67ca646e3" - integrity sha512-FYE8xI+6pjFOhokZu0We3S5NKCirLbCzSh2Usf3qEyr4X8U+0jNg9P8RZ4qz+V2UoECLVwSyzU3LxXBaLGtD3A== + version "1.3.0" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" + integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== micromatch@^2.1.5: version "2.3.11" @@ -7516,24 +7510,24 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@1.40.0: - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== +mime-db@1.42.0: + version "1.42.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.42.0.tgz#3e252907b4c7adb906597b4b65636272cf9e7bac" + integrity sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ== mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== + version "2.1.25" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.25.tgz#39772d46621f93e2a80a856c53b86a62156a6437" + integrity sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg== dependencies: - mime-db "1.40.0" + mime-db "1.42.0" mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== -mimic-fn@^2.0.0, mimic-fn@^2.1.0: +mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== @@ -7578,20 +7572,20 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= -minipass@^2.2.1, minipass@^2.3.5: - version "2.5.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.5.0.tgz#dddb1d001976978158a05badfcbef4a771612857" - integrity sha512-9FwMVYhn6ERvMR8XFdOavRz4QK/VJV8elU1x50vYexf9lslDcWe/f4HBRxCPd185ekRSjU6CfYyJCECa/CQy7Q== +minipass@^2.3.5, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" + integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== dependencies: safe-buffer "^5.1.2" yallist "^3.0.0" minizlib@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" - integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + version "1.3.3" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" + integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== dependencies: - minipass "^2.2.1" + minipass "^2.9.0" mississippi@^3.0.0: version "3.0.0" @@ -7804,9 +7798,9 @@ node-fetch@^2.3.0, node-fetch@^2.5.0: integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== node-gyp@^5.0.2: - version "5.0.3" - resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.0.3.tgz#80d64c23790244991b6d44532f0a351bedd3dd45" - integrity sha512-z/JdtkFGUm0QaQUusvloyYuGDub3nUbOo5de1Fz57cM++osBTvQatBUSTlF1k/w8vFHPxxXW6zxGvkxXSpaBkQ== + version "5.0.5" + resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-5.0.5.tgz#f6cf1da246eb8c42b097d7cd4d6c3ce23a4163af" + integrity sha512-WABl9s4/mqQdZneZHVWVG4TVr6QQJZUC6PAx47ITSk9lreZ1n+7Z9mMAIbA3vnO4J9W20P7LhCxtzfWsAD/KDw== dependencies: env-paths "^1.0.0" glob "^7.0.3" @@ -7817,7 +7811,7 @@ node-gyp@^5.0.2: request "^2.87.0" rimraf "2" semver "~5.3.0" - tar "^4.4.8" + tar "^4.4.12" which "1" node-int64@^0.4.0: @@ -7948,9 +7942,9 @@ npm-bundled@^1.0.1: integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== npm-lifecycle@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.3.tgz#09e9b0b6686e85fd53bab82364386222d97a3730" - integrity sha512-M0QmmqbEHBXxDrmc6X3+eKjW9+F7Edg1ENau92WkYw1sox6wojHzEZJIRm1ItljEiaigZlKL8mXni/4ylAy1Dg== + version "3.1.4" + resolved "https://registry.yarnpkg.com/npm-lifecycle/-/npm-lifecycle-3.1.4.tgz#de6975c7d8df65f5150db110b57cce498b0b604c" + integrity sha512-tgs1PaucZwkxECGKhC/stbEgFyc3TGh2TJcg2CDr6jbvQRdteHNhmMeljRzpe4wgFAXQADoy1cSqqi7mtiAa5A== dependencies: byline "^5.0.0" graceful-fs "^4.1.15" @@ -7972,9 +7966,9 @@ npm-lifecycle@^3.1.2: validate-npm-package-name "^3.0.0" npm-packlist@^1.1.6, npm-packlist@^1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.4.tgz#866224233850ac534b63d1a6e76050092b5d2f44" - integrity sha512-zTLo8UcVYtDU3gdeaFu2Xu0n0EvelfHDGuqtNIn5RO7yQj4H1TqNdBc/yZjxnWA0PVB8D3Woyp0i5B43JwQ6Vw== + version "1.4.6" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.6.tgz#53ba3ed11f8523079f1457376dd379ee4ea42ff4" + integrity sha512-u65uQdb+qwtGvEJh/DgQgW1Xg7sqeNbmxYyrvlNznaVTjV3E5P6F/EFjM+BVHXl7JJlsdG8A64M0XI8FI/IOlg== dependencies: ignore-walk "^3.0.1" npm-bundled "^1.0.1" @@ -8049,9 +8043,9 @@ object-copy@^0.1.0: kind-of "^3.0.3" object-inspect@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" - integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + version "1.7.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" + integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1: version "1.1.1" @@ -8208,15 +8202,6 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-locale@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" - integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== - dependencies: - execa "^1.0.0" - lcid "^2.0.0" - mem "^4.0.0" - os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" @@ -8247,11 +8232,6 @@ output-file-sync@^2.0.0: is-plain-obj "^1.1.0" mkdirp "^0.5.1" -p-defer@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" - integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= - p-each-series@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" @@ -8269,11 +8249,6 @@ p-finally@^2.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== -p-is-promise@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" - integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== - p-limit@^1.1.0: version "1.3.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" @@ -8825,9 +8800,9 @@ pseudomap@^1.0.2: integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= psl@^1.1.24, psl@^1.1.28: - version "1.3.1" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.3.1.tgz#d5aa3873a35ec450bc7db9012ad5a7246f6fc8bd" - integrity sha512-2KLd5fKOdAfShtY2d/8XDWVRnmp3zp40Qt6ge2zBPFARLXOGUf2fHD5eg+TV/5oxBtQKVhjUaKFsAaE4HnwfSA== + version "1.4.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" + integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== public-encrypt@^4.0.0: version "4.0.3" @@ -8946,9 +8921,9 @@ react-is@^16.8.4: integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== read-cmd-shim@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.4.tgz#b4a53d43376211b45243f0072b6e603a8e37640d" - integrity sha512-Pqpl3qJ/QdOIjRYA0q5DND/gLvGOfpIz/fYVDGYpOXfW/lFrIttmLsBnd6IkyK10+JHU9zhsaudfvrQTBB9YFQ== + version "1.0.5" + resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz#87e43eba50098ba5a32d0ceb583ab8e43b961c16" + integrity sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA== dependencies: graceful-fs "^4.1.2" @@ -9602,6 +9577,13 @@ sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: inherits "^2.0.1" safe-buffer "^5.0.1" +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + shasum@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" @@ -9686,10 +9668,10 @@ slide@^1.1.6: resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" integrity sha1-VusCfWW00tzmyy4tMsTUr8nh1wc= -smart-buffer@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.2.tgz#5207858c3815cc69110703c6b94e46c15634395d" - integrity sha512-JDhEpTKzXusOqXZ0BUIdH+CjFdO/CR3tLlf5CN34IypI+xMmXW1uB16OOY8z3cICbJlDAVJzNbwBhNO0wt9OAw== +smart-buffer@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.1.0.tgz#91605c25d91652f4661ea69ccf45f1b331ca21ba" + integrity sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw== snapdragon-node@^2.0.1: version "2.1.1" @@ -9730,12 +9712,12 @@ socks-proxy-agent@^4.0.0: socks "~2.3.2" socks@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.3.2.tgz#ade388e9e6d87fdb11649c15746c578922a5883e" - integrity sha512-pCpjxQgOByDHLlNqlnh/mNSAxIUkyBBuwwhTcV+enZGbDaClPvHdvm6uvOwZfFJkam7cGhBNbb4JxiP8UZkRvQ== + version "2.3.3" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.3.3.tgz#01129f0a5d534d2b897712ed8aceab7ee65d78e3" + integrity sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA== dependencies: - ip "^1.1.5" - smart-buffer "4.0.2" + ip "1.1.5" + smart-buffer "^4.1.0" sort-keys@^2.0.0: version "2.0.0" @@ -10014,21 +9996,21 @@ string.prototype.padend@^3.0.0: es-abstract "^1.4.3" function-bind "^1.0.2" -string.prototype.trimleft@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.0.0.tgz#68b6aa8e162c6a80e76e3a8a0c2e747186e271ff" - integrity sha1-aLaqjhYsaoDnbjqKDC50cYbicf8= +string.prototype.trimleft@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.0.tgz#6cc47f0d7eb8d62b0f3701611715a3954591d634" + integrity sha512-FJ6b7EgdKxxbDxc79cOlok6Afd++TTs5szo+zJTUyow3ycrRfJVE2pq3vcN53XexvKZu/DJMDfeI/qMiZTrjTw== dependencies: - define-properties "^1.1.2" - function-bind "^1.0.2" + define-properties "^1.1.3" + function-bind "^1.1.1" -string.prototype.trimright@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.0.0.tgz#ab4a56d802a01fbe7293e11e84f24dc8164661dd" - integrity sha1-q0pW2AKgH75yk+EehPJNyBZGYd0= +string.prototype.trimright@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.0.tgz#669d164be9df9b6f7559fa8e89945b168a5a6c58" + integrity sha512-fXZTSV55dNBwv16uw+hh5jkghxSnc5oHq+5K/gXgizHwAvMetdAJlHqqoFC1FSDVPYWLkAKl2cxpUT41sV7nSg== dependencies: - define-properties "^1.1.2" - function-bind "^1.0.2" + define-properties "^1.1.3" + function-bind "^1.1.1" string_decoder@^1.0.0, string_decoder@^1.1.1: version "1.3.0" @@ -10208,14 +10190,14 @@ tapable@^0.2.7: resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.9.tgz#af2d8bbc9b04f74ee17af2b4d9048f807acd18a8" integrity sha512-2wsvQ+4GwBvLPLWsNfLCDYGsW6xb7aeC6utq2Qh0PFwgEy7K7dsma9Jsmb2zSQj7GvYAyUGSntLtsv++GmgL1A== -tar@^4, tar@^4.4.10, tar@^4.4.8: - version "4.4.10" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.10.tgz#946b2810b9a5e0b26140cf78bea6b0b0d689eba1" - integrity sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA== +tar@^4, tar@^4.4.10, tar@^4.4.12, tar@^4.4.8: + version "4.4.13" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" + integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA== dependencies: chownr "^1.1.1" fs-minipass "^1.2.5" - minipass "^2.3.5" + minipass "^2.8.6" minizlib "^1.2.1" mkdirp "^0.5.0" safe-buffer "^5.1.2" @@ -10256,10 +10238,10 @@ test262-stream@^1.3.0: js-yaml "^3.2.1" klaw "^2.1.0" -text-extensions@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-2.0.0.tgz#43eabd1b495482fae4a2bf65e5f56c29f69220f6" - integrity sha512-F91ZqLgvi1E0PdvmxMgp+gcf6q8fMH7mhdwWfzXnl1k+GbpQDmi8l7DzLC5JTASKbwpY3TfxajAUzAXcv2NmsQ== +text-extensions@^1.0.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" + integrity sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ== text-table@^0.2.0: version "0.2.0" @@ -10525,11 +10507,11 @@ uglify-js@^2.8.29: uglify-to-browserify "~1.0.0" uglify-js@^3.0.5, uglify-js@^3.1.4: - version "3.6.0" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.0.tgz#704681345c53a8b2079fb6cec294b05ead242ff5" - integrity sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg== + version "3.6.9" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.9.tgz#85d353edb6ddfb62a9d798f36e91792249320611" + integrity sha512-pcnnhaoG6RtrvHJ1dFncAe8Od6Nuy30oaJ82ts6//sGSXOP5UjBMEthiProjXmMNHOfd93sqlkztifFMcb+4yw== dependencies: - commander "~2.20.0" + commander "~2.20.3" source-map "~0.6.1" uglify-to-browserify@~1.0.0: @@ -11008,9 +10990,9 @@ whatwg-url@^6.4.1: webidl-conversions "^4.0.2" whatwg-url@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" - integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + version "7.1.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" + integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== dependencies: lodash.sortby "^4.7.0" tr46 "^1.0.1" @@ -11176,7 +11158,7 @@ y18n@^3.2.1: resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" integrity sha1-bRX7qITAhnnA136I53WegR4H+kE= -"y18n@^3.2.1 || ^4.0.0", y18n@^4.0.0: +y18n@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== @@ -11187,17 +11169,16 @@ yallist@^2.1.2: integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" - integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@^11.1.1: - version "11.1.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" - integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== +yargs-parser@^10.0.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + integrity sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ== dependencies: - camelcase "^5.0.0" - decamelize "^1.2.0" + camelcase "^4.1.0" yargs-parser@^13.1.1: version "13.1.1" @@ -11207,6 +11188,14 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^15.0.0: + version "15.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-15.0.0.tgz#cdd7a97490ec836195f59f3f4dbe5ea9e8f75f08" + integrity sha512-xLTUnCMc4JhxrPEPUYD5IBR1mWCK/aT6+RJ/K29JY2y1vD+FhtgKK0AXRWvI262q3QSffAQuTouFIKUuHX89wQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" @@ -11228,30 +11217,29 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs@^12.0.1: - version "12.0.5" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" - integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== +yargs@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" + integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== dependencies: - cliui "^4.0.0" - decamelize "^1.2.0" + cliui "^5.0.0" find-up "^3.0.0" - get-caller-file "^1.0.1" - os-locale "^3.0.0" + get-caller-file "^2.0.1" require-directory "^2.1.1" - require-main-filename "^1.0.1" + require-main-filename "^2.0.0" set-blocking "^2.0.0" - string-width "^2.0.0" + string-width "^3.0.0" which-module "^2.0.0" - y18n "^3.2.1 || ^4.0.0" - yargs-parser "^11.1.1" + y18n "^4.0.0" + yargs-parser "^13.1.1" -yargs@^13.3.0: - version "13.3.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" - integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA== +yargs@^14.2.2: + version "14.2.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-14.2.2.tgz#2769564379009ff8597cdd38fba09da9b493c4b5" + integrity sha512-/4ld+4VV5RnrynMhPZJ/ZpOCGSCeghMykZ3BhdFBDa9Wy/RH6uEGNWDJog+aUlq+9OM1CFTgtYRW5Is1Po9NOA== dependencies: cliui "^5.0.0" + decamelize "^1.2.0" find-up "^3.0.0" get-caller-file "^2.0.1" require-directory "^2.1.1" @@ -11260,7 +11248,7 @@ yargs@^13.3.0: string-width "^3.0.0" which-module "^2.0.0" y18n "^4.0.0" - yargs-parser "^13.1.1" + yargs-parser "^15.0.0" yargs@^6.5.0, yargs@^6.6.0: version "6.6.0" From 683adcbb7060546975a7295118c804496e020cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 21 Nov 2019 08:31:38 -0500 Subject: [PATCH 816/965] Reduce standalone build size (#10668) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * infra: build standalone against src * infra: add absoluteRuntime # Conflicts: # babel.config.js * chore: remove `process.env` replace * add $ to signify exact match credits to Nicolò --- babel.config.js | 17 +++++++++++++---- packages/babel-core/package.json | 4 +++- scripts/gulp-tasks.js | 17 ++++++++++++++++- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/babel.config.js b/babel.config.js index 5793ce40334b..228e9802befb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -11,6 +11,7 @@ module.exports = function(api) { exclude: ["transform-typeof-symbol"], }; const envOpts = Object.assign({}, envOptsNoTargets); + let transformRuntimeOpts = null; let convertESM = true; let ignoreLib = true; @@ -50,6 +51,17 @@ module.exports = function(api) { break; } + if (includeRuntime) { + const babelRuntimePackageJSONPath = require.resolve( + "@babel/runtime/package.json" + ); + const path = require("path"); + transformRuntimeOpts = { + version: require(babelRuntimePackageJSONPath).version, + absoluteRuntime: path.dirname(babelRuntimePackageJSONPath), + }; + } + const config = { // Our dependencies are all standard CommonJS, along with all sorts of // other random files in Babel's codebase, so we use script as the default, @@ -125,10 +137,7 @@ module.exports = function(api) { ], plugins: [ includeRuntime - ? [ - "@babel/transform-runtime", - { version: require("@babel/runtime/package").version }, - ] + ? ["@babel/transform-runtime", transformRuntimeOpts] : null, ].filter(Boolean), }, diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 4da69a87d404..f22326d78eb3 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -34,7 +34,9 @@ }, "browser": { "./lib/config/files/index.js": "./lib/config/files/index-browser.js", - "./lib/transform-file.js": "./lib/transform-file-browser.js" + "./lib/transform-file.js": "./lib/transform-file-browser.js", + "./src/config/files/index.js": "./src/config/files/index-browser.js", + "./src/transform-file.js": "./src/transform-file-browser.js" }, "dependencies": { "@babel/code-frame": "^7.5.5", diff --git a/scripts/gulp-tasks.js b/scripts/gulp-tasks.js index 73c1f7db2e3f..8118932a8899 100644 --- a/scripts/gulp-tasks.js +++ b/scripts/gulp-tasks.js @@ -11,6 +11,7 @@ * to make standalone builds of other Babel plugins/presets (such as babel-minify) */ +const fs = require("fs"); const path = require("path"); const pump = require("pump"); const chalk = require("chalk"); @@ -24,6 +25,19 @@ const WarningsToErrorsPlugin = require("warnings-to-errors-webpack-plugin"); const webpackStream = require("webpack-stream"); const uglify = require("gulp-uglify"); +function generateResolveAlias() { + const alias = {}; + const packagePath = path.resolve(process.cwd(), "packages"); + fs.readdirSync(packagePath).forEach(folder => { + alias[folder.replace("babel-", "@babel/") + "$"] = path.resolve( + packagePath, + folder, + "src" + ); + }); + return alias; +} + function webpackBuild(opts) { const plugins = opts.plugins || []; let babelVersion = require("../packages/babel-core/package.json").version; @@ -71,7 +85,6 @@ function webpackBuild(opts) { }), new webpack.DefinePlugin({ "process.env.NODE_ENV": '"production"', - "process.env": JSON.stringify({ NODE_ENV: "production" }), BABEL_VERSION: JSON.stringify(babelVersion), VERSION: JSON.stringify(version), }), @@ -82,6 +95,8 @@ function webpackBuild(opts) { new webpack.optimize.ModuleConcatenationPlugin(), ].concat(plugins), resolve: { + //todo: remove resolve.alias when babel packages offer ESModule entry + alias: generateResolveAlias(), plugins: [ // Dedupe packages that are used across multiple plugins. // This replaces DedupePlugin from Webpack 1.x From 74fb914fe38e4d9d62d598aa747c488e9b94735c Mon Sep 17 00:00:00 2001 From: Jaideep Bhoosreddy Date: Fri, 22 Nov 2019 11:21:19 -0500 Subject: [PATCH 817/965] Use the local version of babel in test262 job (#10749) * Use the local version of babel * retrigger * correctly remove other changes * d'oh last one * remove link part --- .circleci/config.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f654bb91c696..9c953f6d67fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -89,15 +89,6 @@ jobs: - run: name: Build Babel command: BABEL_ENV=test make bootstrap - - run: - name: Link Babel - command: | - cd packages - for package in */; do - cd $package - yarn link - cd .. - done - run: name: Setup Test Runner command: | @@ -105,11 +96,6 @@ jobs: cd babel-test262-runner yarn yarn add tap-mocha-reporter --dev - curl -L https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 > jq - chmod +x ./jq - for package in ../packages/*/package.json; do - yarn link $(./jq -j ".name" $package) - done node lib/download-node - run: name: Download master branch Test262 artifact @@ -117,7 +103,7 @@ jobs: <<: *test262_workdir - run: name: Run Test262 - command: node lib/run-tests I_AM_SURE | tee ~/test262.tap + command: BABEL_PATH=.. node lib/run-tests I_AM_SURE | tee ~/test262.tap <<: *test262_workdir - store_artifacts: *artifact_test262_tap - run: From 25169901de920de00051826d8298e8f2e07aaa5d Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 20 Nov 2019 22:33:56 -0500 Subject: [PATCH 818/965] Rename babel-eslint-config-internal -> @babel/eslint-config-internal --- eslint/babel-eslint-config-internal/README.md | 2 +- eslint/babel-eslint-config-internal/index.js | 4 +++- eslint/babel-eslint-config-internal/package.json | 16 +++++----------- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/eslint/babel-eslint-config-internal/README.md b/eslint/babel-eslint-config-internal/README.md index 5f87298ead30..20d79ebc44bb 100644 --- a/eslint/babel-eslint-config-internal/README.md +++ b/eslint/babel-eslint-config-internal/README.md @@ -1,4 +1,4 @@ -## eslint-config-babel +## @babel/eslint-config-internal --- ESLint config for the Babel codebase (originally taken from `eslint-config-kittens`) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index 4010ed3eed34..a4223380466d 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -1,9 +1,11 @@ +"use strict"; + module.exports = { parser: "babel-eslint", extends: "eslint:recommended", plugins: ["flowtype"], parserOptions: { - ecmaVersion: 2017, + ecmaVersion: 2019, sourceType: "module", }, rules: { diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index e7431a11a518..5047da192a27 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,21 +1,15 @@ { - "name": "eslint-config-babel", - "version": "9.0.0", - "description": "ESLint config for babel", + "name": "@babel/eslint-config-internal", + "version": "7.7.0", + "description": "The Babel Team's ESLint configuration", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", "private": true, - "repository": { - "type": "git", - "url": "https://github.com/babel/eslint-config-babel" - }, - "main": "index.js", + "repository": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-config-internal", + "main": "lib/index.js", "peerDependencies": { "babel-eslint": "^10.0.0 || ^11.0.0-0", "eslint-plugin-flowtype": "^3.0.0" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" } } From 74e2c2cd78928c7948f36458ca5d90777a1eccd9 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 21 Nov 2019 21:13:52 -0500 Subject: [PATCH 819/965] Update eslint/babel-eslint-config-internal/package.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Nicolò Ribaudo --- eslint/babel-eslint-config-internal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 5047da192a27..c447441605c7 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,7 +1,7 @@ { "name": "@babel/eslint-config-internal", "version": "7.7.0", - "description": "The Babel Team's ESLint configuration", + "description": "The Babel Team's ESLint configuration. Since it's internal, it might not respect semver.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", From ca88cf106039cc76105e6acd52de0d7d30d482fc Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 21 Nov 2019 21:14:52 -0500 Subject: [PATCH 820/965] Incorporate feedback --- eslint/babel-eslint-config-internal/index.js | 22 +++++++++---------- .../babel-eslint-config-internal/package.json | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/eslint/babel-eslint-config-internal/index.js b/eslint/babel-eslint-config-internal/index.js index a4223380466d..752207e50245 100644 --- a/eslint/babel-eslint-config-internal/index.js +++ b/eslint/babel-eslint-config-internal/index.js @@ -5,9 +5,19 @@ module.exports = { extends: "eslint:recommended", plugins: ["flowtype"], parserOptions: { - ecmaVersion: 2019, + ecmaVersion: 2020, sourceType: "module", }, + globals: { + // Flow + Iterator: true, + $Keys: true, + }, + env: { + node: true, + es2020: true, + browser: true, + }, rules: { camelcase: "off", "consistent-return": "off", @@ -36,14 +46,4 @@ module.exports = { "flowtype/define-flow-type": "warn", "flowtype/use-flow-type": "warn", }, - globals: { - // Flow - Iterator: true, - $Keys: true, - }, - env: { - node: true, - es6: true, - browser: true, - }, }; diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index c447441605c7..37a02b8826ab 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -1,6 +1,6 @@ { "name": "@babel/eslint-config-internal", - "version": "7.7.0", + "version": "0.0.0", "description": "The Babel Team's ESLint configuration. Since it's internal, it might not respect semver.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", From 2c40b8c70656f734ffe5cda6aedba2a95a244747 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 22 Nov 2019 16:25:38 -0500 Subject: [PATCH 821/965] Fix failing tests --- .../test/non-regression.js | 294 +++++++++--------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index c4add4ab08dd..857c30d05dc7 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -12,7 +12,7 @@ function verifyAndAssertMessagesWithSpecificESLint( expectedMessages, sourceType, overrideConfig, - linter + linter, ) { const config = { parser: "current-babel-eslint", @@ -29,10 +29,10 @@ function verifyAndAssertMessagesWithSpecificESLint( babelOptions: { configFile: path.resolve( __dirname, - "./fixtures/config/babel.config.js" + "./fixtures/config/babel.config.js", ), }, - } + }, }; if (overrideConfig) { @@ -47,7 +47,7 @@ function verifyAndAssertMessagesWithSpecificESLint( throw new Error( `Expected ${expectedMessages.length} message(s), got ${ messages.length - }\n${JSON.stringify(messages, null, 2)}` + }\n${JSON.stringify(messages, null, 2)}`, ); } @@ -61,7 +61,7 @@ function verifyAndAssertMessagesWithSpecificESLint( Message ${i} does not match: Expected: ${expectedMessages[i]} Actual: ${formatedMessage} - ` + `, ); } }); @@ -72,7 +72,7 @@ function verifyAndAssertMessages( rules, expectedMessages, sourceType, - overrideConfig + overrideConfig, ) { const linter = new eslint.Linter(); linter.defineParser("current-babel-eslint", parser); @@ -83,7 +83,7 @@ function verifyAndAssertMessages( expectedMessages || [], sourceType, overrideConfig, - linter + linter, ); } @@ -96,7 +96,7 @@ describe("verify", () => { verifyAndAssertMessages( 'module.exports = "something";', { "eol-last": 1, semi: 1 }, - ["1:30 Newline required at end of file but not found. eol-last"] + ["1:30 Newline required at end of file but not found. eol-last"], ); }); @@ -113,7 +113,7 @@ describe("verify", () => { export default Foo; export const c = 'c'; export class Store {} - ` + `, ); }); @@ -138,7 +138,7 @@ describe("verify", () => { it("Rest parameter in destructuring assignment (issue #11)", () => { verifyAndAssertMessages( "const [a, ...rest] = ['1', '2', '3']; module.exports = rest;", - { "no-undef": 1 } + { "no-undef": 1 }, ); }); @@ -159,7 +159,7 @@ describe("verify", () => { '"use strict"; () => 1', { strict: [1, "global"] }, [], - "script" + "script", ); }); @@ -190,7 +190,7 @@ describe("verify", () => { let b = c } `, - { "padded-blocks": [1, "never"] } + { "padded-blocks": [1, "never"] }, ); }); @@ -198,7 +198,7 @@ describe("verify", () => { it("check regular function", () => { verifyAndAssertMessages( "function a(b, c) { b += 1; c += 1; return b + c; } a;", - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -221,7 +221,7 @@ describe("verify", () => { } log(1, 2); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -234,7 +234,7 @@ describe("verify", () => { }; `, { "no-unused-vars": 1, "no-undef": 1 }, - ["2:11 'Bar' is defined but never used. no-unused-vars"] + ["2:11 'Bar' is defined but never used. no-unused-vars"], ); }); @@ -249,7 +249,7 @@ describe("verify", () => { new Log(); `, { "no-unused-vars": 1, "no-undef": 1 }, - ["3:34 'T4' is defined but never used. no-unused-vars"] + ["3:34 'T4' is defined but never used. no-unused-vars"], ); }); @@ -266,7 +266,7 @@ describe("verify", () => { "1:1 'T' is not defined. no-undef", "2:11 'T' is defined but never used. no-unused-vars", "3:1 'T' is not defined. no-undef", - ] + ], ); }); @@ -282,7 +282,7 @@ describe("verify", () => { [ "2:11 'Log' is defined but never used. no-unused-vars", "2:38 'T4' is defined but never used. no-unused-vars", - ] + ], ); }); @@ -299,7 +299,7 @@ describe("verify", () => { "1:1 'T' is not defined. no-undef", "2:15 'T' is defined but never used. no-unused-vars", "3:1 'T' is not defined. no-undef", - ] + ], ); }); @@ -316,7 +316,7 @@ describe("verify", () => { [ "2:6 'Log' is defined but never used. no-unused-vars", "2:29 'T3' is defined but never used. no-unused-vars", - ] + ], ); }); @@ -333,7 +333,7 @@ describe("verify", () => { "1:1 'T' is not defined. no-undef", "2:10 'T' is defined but never used. no-unused-vars", "3:1 'T' is not defined. no-undef", - ] + ], ); }); @@ -346,7 +346,7 @@ describe("verify", () => { log(1, 2); `, { "no-unused-vars": 1, "no-undef": 1 }, - ["3:37 'T4' is defined but never used. no-unused-vars"] + ["3:37 'T4' is defined but never used. no-unused-vars"], ); }); @@ -363,7 +363,7 @@ describe("verify", () => { "1:1 'T' is not defined. no-undef", "2:14 'T' is defined but never used. no-unused-vars", "3:1 'T' is not defined. no-undef", - ] + ], ); }); @@ -376,7 +376,7 @@ describe("verify", () => { } foo(); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -387,7 +387,7 @@ describe("verify", () => { var x: Foo = 1; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -398,7 +398,7 @@ describe("verify", () => { var a: {numVal: Foo}; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -412,7 +412,7 @@ describe("verify", () => { }; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -429,7 +429,7 @@ describe("verify", () => { b; c; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -439,7 +439,7 @@ describe("verify", () => { import type Foo from 'foo'; var x: Foo[]; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -449,7 +449,7 @@ describe("verify", () => { import type Bar from 'foo'; export default class Foo implements Bar {} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -459,7 +459,7 @@ describe("verify", () => { type Foo = any; var x : Foo = 1; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -471,7 +471,7 @@ describe("verify", () => { type Foo = Bar var x : Foo = 1; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -481,14 +481,14 @@ describe("verify", () => { import type Foo2 from 'foo'; export type Foo = Foo2; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); it("polymorphic types #109", () => { verifyAndAssertMessages( "export default function groupByEveryN(array: Array, n: number): Array> { n; }", - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -499,7 +499,7 @@ describe("verify", () => { type Operation = () => Promise; x: Operation; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -512,7 +512,7 @@ describe("verify", () => { var box = new Box(); console.log(box.value); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -523,7 +523,7 @@ describe("verify", () => { var a: T = value; a; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -533,7 +533,7 @@ describe("verify", () => { import Bar from './Bar'; type Foo = Bar; var x: Foo = 1; console.log(x); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -547,7 +547,7 @@ describe("verify", () => { [ "1:21 'T' is defined but never used. no-unused-vars", "2:8 'T' is not defined. no-undef", - ] + ], ); }); @@ -558,7 +558,7 @@ describe("verify", () => { export class Foo extends Bar {} `, { "no-unused-vars": 1, "no-undef": 1 }, - ["2:30 'T' is not defined. no-undef"] + ["2:30 'T' is not defined. no-undef"], ); }); @@ -569,7 +569,7 @@ describe("verify", () => { f(); `, { "no-unused-vars": 1, "no-undef": 1 }, - ["2:3 'T' is not defined. no-undef"] + ["2:3 'T' is not defined. no-undef"], ); }); @@ -580,7 +580,7 @@ describe("verify", () => { function f(): T {} f(); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -593,7 +593,7 @@ describe("verify", () => { declare var bar A; B; foo(); bar; `, - { "no-undef": 1, "no-unused-vars": 1 } + { "no-undef": 1, "no-unused-vars": 1 }, ); }); @@ -607,7 +607,7 @@ describe("verify", () => { [ "2:6 'T' is defined but never used. no-unused-vars", "2:31 'V' is not defined. no-undef", - ] + ], ); }); @@ -618,7 +618,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default function(a: Foo, b: ?Foo2, c){ a; b; c; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -628,7 +628,7 @@ describe("verify", () => { import type Foo from 'foo'; export default function(a: () => Foo){ a; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -639,7 +639,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default function(a: (_:Foo) => Foo2){ a; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -651,7 +651,7 @@ describe("verify", () => { import type Foo3 from 'foo'; export default function(a: (_1:Foo, _2:Foo2) => Foo3){ a; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -662,7 +662,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default function(a: (_1:Foo, ...foo:Array) => number){ a; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -672,7 +672,7 @@ describe("verify", () => { import type Foo from 'foo'; export default function(): Foo {} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -682,7 +682,7 @@ describe("verify", () => { import type Foo from 'foo'; export default function():() => Foo {} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -693,21 +693,21 @@ describe("verify", () => { import type Foo2 from 'foo'; export default function():(_?:Foo) => Foo2{} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); it("9", () => { verifyAndAssertMessages( "export default function (a: T1, b: T2) { b; }", - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); it("10", () => { verifyAndAssertMessages( "var a=function(a: T1, b: T2) {return a + b;}; a;", - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -739,7 +739,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default class Bar {set fooProp(value:Foo):Foo2{ value; }} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -749,7 +749,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default class Foo {get fooProp(): Foo2{}} `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -759,7 +759,7 @@ describe("verify", () => { import type Foo from 'foo'; var numVal:Foo; numVal; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -769,7 +769,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: {numVal: Foo;}; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -781,7 +781,7 @@ describe("verify", () => { import type Foo3 from 'foo'; var a: ?{numVal: Foo; [indexer: Foo2]: Foo3}; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -792,7 +792,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var a: {numVal: Foo; subObj?: ?{strVal: Foo2}}; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -805,7 +805,7 @@ describe("verify", () => { import type Foo4 from 'foo'; var a: { [a: Foo]: Foo2; [b: Foo3]: Foo4; }; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -817,7 +817,7 @@ describe("verify", () => { import type Foo3 from 'foo'; var a: {add(x:Foo, ...y:Array): Foo3}; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -829,7 +829,7 @@ describe("verify", () => { import type Foo3 from 'foo'; var a: { id(x: Foo2): Foo3; }; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -839,7 +839,7 @@ describe("verify", () => { import type Foo from 'foo'; var a:Array = [1, 2, 3]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -849,14 +849,14 @@ describe("verify", () => { import type Baz from 'baz'; export default class Bar extends Baz { }; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); it("25", () => { verifyAndAssertMessages( "export default class Bar { bar(): T { return 42; }}", - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -867,7 +867,7 @@ describe("verify", () => { import type Foo2 from 'foo'; export default class Bar { static prop1:Foo; prop2:Foo2; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -878,7 +878,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var x : Foo | Foo2 = 4; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -889,7 +889,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var x : () => Foo | () => Foo2; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -900,7 +900,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var x: typeof Foo | number = Foo2; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -910,7 +910,7 @@ describe("verify", () => { import type Foo from 'foo'; var {x}: {x: Foo; } = { x: 'hello' }; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -920,7 +920,7 @@ describe("verify", () => { import type Foo from 'foo'; var [x]: Array = [ 'hello' ]; x; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -930,7 +930,7 @@ describe("verify", () => { import type Foo from 'foo'; export default function({x}: { x: Foo; }) { x; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -940,7 +940,7 @@ describe("verify", () => { import type Foo from 'foo'; function foo([x]: Array) { x; } foo(); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -951,7 +951,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var a: Map >; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -961,7 +961,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: ?Promise[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -972,7 +972,7 @@ describe("verify", () => { import type Foo2 from 'foo'; var a:(...rest:Array) => Foo2; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -985,7 +985,7 @@ describe("verify", () => { import type Foo4 from 'foo'; var a: (x: Foo2, ...y:Foo3[]) => Foo4; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -995,7 +995,7 @@ describe("verify", () => { import type {foo, bar} from 'baz'; foo; bar; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1005,7 +1005,7 @@ describe("verify", () => { import type {foo as bar} from 'baz'; bar; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1015,7 +1015,7 @@ describe("verify", () => { import type from 'foo'; type; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1025,7 +1025,7 @@ describe("verify", () => { import type, {foo} from 'bar'; type; foo; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1035,7 +1035,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: Foo[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1045,7 +1045,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: ?Foo[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1055,7 +1055,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: (?Foo)[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1065,7 +1065,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: () => Foo[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1075,7 +1075,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: (() => Foo)[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1085,7 +1085,7 @@ describe("verify", () => { import type Foo from 'foo'; var a: typeof Foo[]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1097,7 +1097,7 @@ describe("verify", () => { import type Foo3 from 'foo'; var a : [Foo, Foo2,] = [123, 'duck',]; a; `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); }); @@ -1117,7 +1117,7 @@ describe("verify", () => { }; } `, - { "no-undef": 1, "no-unused-vars": 1 } + { "no-undef": 1, "no-unused-vars": 1 }, ); }); @@ -1139,7 +1139,7 @@ describe("verify", () => { } }; `, - { "comma-spacing": 1 } + { "comma-spacing": 1 }, ); }); @@ -1151,7 +1151,7 @@ describe("verify", () => { }}\`; `, { indent: 1 }, - [] + [], ); }); @@ -1160,7 +1160,7 @@ describe("verify", () => { code, rules, expectedMessages, - sourceType + sourceType, ) { const overrideConfig = { parserOptions: { @@ -1168,7 +1168,7 @@ describe("verify", () => { babelOptions: { configFile: path.resolve( __dirname, - "./fixtures/config/babel.config.decorators-legacy.js" + "./fixtures/config/babel.config.decorators-legacy.js", ), }, }, @@ -1178,7 +1178,7 @@ describe("verify", () => { rules, expectedMessages, sourceType, - overrideConfig + overrideConfig, ); } @@ -1192,7 +1192,7 @@ describe("verify", () => { @classDeclaration export class TextareaAutosize {} `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1210,7 +1210,7 @@ describe("verify", () => { } } `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1230,7 +1230,7 @@ describe("verify", () => { set bar(val) { val; } } `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1249,7 +1249,7 @@ describe("verify", () => { }; obj; `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1270,7 +1270,7 @@ describe("verify", () => { }; obj; `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); }); @@ -1287,7 +1287,7 @@ describe("verify", () => { @classDeclaration class TextareaAutosize {} `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1305,7 +1305,7 @@ describe("verify", () => { } } `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1325,7 +1325,7 @@ describe("verify", () => { set bar(val) { val; } } `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); }); @@ -1342,35 +1342,35 @@ describe("verify", () => { it.skip("visits excluded properties left of spread #95", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); it.skip("visits excluded properties left of spread #210", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-undef": 1, "no-redeclare": 1 } + { "no-undef": 1, "no-redeclare": 1 }, ); }); it("does not mark spread variables false-positive", () => { verifyAndAssertMessages( "const props = { yo: 'yo' }; const { ...otherProps } = props;", - { "no-undef": 1, "no-redeclare": 1 } + { "no-undef": 1, "no-redeclare": 1 }, ); }); it("does not mark spread variables as use-before-define #249", () => { verifyAndAssertMessages( "var originalObject = {}; var {field1, field2, ...clone} = originalObject;", - { "no-use-before-define": 1 } + { "no-use-before-define": 1 }, ); }); @@ -1378,7 +1378,7 @@ describe("verify", () => { verifyAndAssertMessages( "const {Bacona} = require('baconjs')", { "no-undef": 1, "no-unused-vars": 1 }, - ["1:8 'Bacona' is assigned a value but never used. no-unused-vars"] + ["1:8 'Bacona' is assigned a value but never used. no-unused-vars"], ); }); @@ -1392,7 +1392,7 @@ describe("verify", () => { }; } `, - { "no-undef": 1, "no-unused-vars": 1 } + { "no-undef": 1, "no-unused-vars": 1 }, ); }); @@ -1404,7 +1404,7 @@ describe("verify", () => { 2, // a trailing comment makes this line fail comma-dangle (always-multiline) ]; `, - { "comma-dangle": [2, "always-multiline"] } + { "comma-dangle": [2, "always-multiline"] }, ); verifyAndAssertMessages( @@ -1415,7 +1415,7 @@ describe("verify", () => { console.log(a); } `, - { "brace-style": 2 } + { "brace-style": 2 }, ); }); @@ -1434,7 +1434,7 @@ describe("verify", () => { } }); `, - { "space-in-parens": 1 } + { "space-in-parens": 1 }, ); }); @@ -1451,7 +1451,7 @@ describe("verify", () => { } }); `, - { "space-in-parens": 1 } + { "space-in-parens": 1 }, ); }); @@ -1482,7 +1482,7 @@ describe("verify", () => { options; } `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); @@ -1493,7 +1493,7 @@ describe("verify", () => { var x = 1; `, { "no-use-before-define": 1 }, - ["1:13 'x' was used before it was defined. no-use-before-define"] + ["1:13 'x' was used before it was defined. no-use-before-define"], ); }); @@ -1512,7 +1512,7 @@ describe("verify", () => { "space-before-function-paren": 1, "keyword-spacing": [1, { before: true }], indent: 1, - } + }, ); }); @@ -1528,7 +1528,7 @@ describe("verify", () => { } }; `, - { "no-dupe-keys": 1 } + { "no-dupe-keys": 1 }, ); }); @@ -1541,7 +1541,7 @@ describe("verify", () => { bar({ foo }: Foo) { foo; } } `, - { "no-unused-vars": 1, "no-shadow": 1 } + { "no-unused-vars": 1, "no-shadow": 1 }, ); }); @@ -1553,7 +1553,7 @@ describe("verify", () => { `, { "no-redeclare": 1 }, ["2:5 'a' is already defined. no-redeclare"], - "script" + "script", ); }); @@ -1565,7 +1565,7 @@ describe("verify", () => { `, { "no-redeclare": 1 }, ["2:5 'a' is already defined. no-redeclare"], - "module" + "module", ); }); @@ -1574,13 +1574,13 @@ describe("verify", () => { "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, [ - "1:5 Implicit global variable, assign as global property instead. no-implicit-globals", + "1:5 Unexpected 'var' declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable. no-implicit-globals", ], "script", { env: {}, parserOptions: { ecmaVersion: 6, sourceType: "script" }, - } + }, ); }); @@ -1593,7 +1593,7 @@ describe("verify", () => { { env: {}, parserOptions: { ecmaVersion: 6, sourceType: "module" }, - } + }, ); }); @@ -1606,7 +1606,7 @@ describe("verify", () => { { env: {}, parserOptions: { ecmaVersion: 6 }, - } + }, ); }); @@ -1627,7 +1627,7 @@ describe("verify", () => { sourceType: "module", allowImportExportEverywhere: true, }, - } + }, ); }); @@ -1656,7 +1656,7 @@ describe("verify", () => { } `, { "no-undef": 1 }, - ["2:4 'test' is not defined. no-undef"] + ["2:4 'test' is not defined. no-undef"], ); }); @@ -1666,7 +1666,7 @@ describe("verify", () => { import { Map as $Map } from 'immutable'; function myFunction($state: $Map, { a, b, c } : { a: ?Object, b: ?Object, c: $Map }) {} `, - { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 } + { "no-dupe-args": 1, "no-redeclare": 1, "no-shadow": 1 }, ); }); @@ -1683,7 +1683,7 @@ describe("verify", () => { return hasGlobal; } `, - { "newline-before-return": 1 } + { "newline-before-return": 1 }, ); }); @@ -1693,7 +1693,7 @@ describe("verify", () => { #!/usr/bin/env babel-node import {spawn} from 'foobar'; `, - { "spaced-comment": 1 } + { "spaced-comment": 1 }, ); }); @@ -1708,7 +1708,7 @@ describe("verify", () => { static propTypes = {}; } `, - { "no-redeclare": 1 } + { "no-redeclare": 1 }, ); }); @@ -1720,7 +1720,7 @@ describe("verify", () => { static validate = validate; } `, - { "no-redeclare": 1 } + { "no-redeclare": 1 }, ); }); @@ -1736,7 +1736,7 @@ describe("verify", () => { new A `, { "no-undef": 1, "no-unused-vars": 1, "no-redeclare": 1 }, - ["5:11 'b' is not defined. no-undef"] + ["5:11 'b' is not defined. no-undef"], ); }); }); @@ -1747,7 +1747,7 @@ describe("verify", () => { it("regex with es6 unicodeCodePointEscapes", () => { verifyAndAssertMessages( - "string.replace(/[\u{0000A0}-\u{10FFFF}<>&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);" + "string.replace(/[\u{0000A0}-\u{10FFFF}<>&]/gmiu, (char) => `&#x${char.codePointAt(0).toString(16)};`);", ); }); @@ -1759,7 +1759,7 @@ describe("verify", () => { #d = 1; } `, - { "no-undef": 1 } + { "no-undef": 1 }, ); }); @@ -1770,7 +1770,7 @@ describe("verify", () => { #d = 1; } `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); }); @@ -1782,7 +1782,7 @@ describe("verify", () => { const foo = {}; foo?.bar; `, - { "no-undef": 1 } + { "no-undef": 1 }, ); }); }); @@ -1797,7 +1797,7 @@ describe("verify", () => { new NodeUtils(); `, - { "no-unused-vars": 1 } + { "no-unused-vars": 1 }, ); }); @@ -1805,7 +1805,7 @@ describe("verify", () => { verifyAndAssertMessages( ` import('a'); - ` + `, ); }); @@ -1813,7 +1813,7 @@ describe("verify", () => { verifyAndAssertMessages( ` 1_000 - ` + `, ); }); @@ -1821,7 +1821,7 @@ describe("verify", () => { verifyAndAssertMessages( ` a?.b - ` + `, ); }); @@ -1829,7 +1829,7 @@ describe("verify", () => { verifyAndAssertMessages( ` import.meta - ` + `, ); }); @@ -1837,7 +1837,7 @@ describe("verify", () => { verifyAndAssertMessages( ` class A { #a = 1; } - ` + `, ); }); @@ -1846,7 +1846,7 @@ describe("verify", () => { ` try {} catch {} try {} catch {} finally {} - ` + `, ); }); @@ -1854,7 +1854,7 @@ describe("verify", () => { verifyAndAssertMessages( ` export v from "mod" - ` + `, ); }); @@ -1862,7 +1862,7 @@ describe("verify", () => { verifyAndAssertMessages( ` export * as ns from "mod" - ` + `, ); }); @@ -1873,7 +1873,7 @@ describe("verify", () => { console.log(a); eval(''); `, - { "no-unused-vars": 1, "no-undef": 1 } + { "no-unused-vars": 1, "no-undef": 1 }, ); }); }); From 1b4cfc21d9a3b59e74f7d578d2c2c78c302f9fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 22 Nov 2019 23:59:30 +0100 Subject: [PATCH 822/965] Add support for native esm to @babel/runtime (#10748) * Add support for native esm to @babel/runtime * Test * Do not remove new package.json files * Remove git diff --- Makefile | 5 +++-- packages/babel-runtime-corejs2/helpers/esm/package.json | 3 +++ packages/babel-runtime-corejs3/helpers/esm/package.json | 3 +++ packages/babel-runtime/helpers/esm/package.json | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/babel-runtime-corejs2/helpers/esm/package.json create mode 100644 packages/babel-runtime-corejs3/helpers/esm/package.json create mode 100644 packages/babel-runtime/helpers/esm/package.json diff --git a/Makefile b/Makefile index 2528fc328956..bc69709bdd19 100644 --- a/Makefile +++ b/Makefile @@ -249,8 +249,9 @@ clean-lib: $(call clean-source-lib, $(source)))) clean-runtime-helpers: - rm -rf packages/babel-runtime/helpers - rm -rf packages/babel-runtime-corejs2/helpers + rm -f packages/babel-runtime/helpers/**/*.js + rm -f packages/babel-runtime-corejs2/helpers/**/*.js + rm -f packages/babel-runtime-corejs3/helpers/**/*.js rm -rf packages/babel-runtime-corejs2/core-js clean-all: diff --git a/packages/babel-runtime-corejs2/helpers/esm/package.json b/packages/babel-runtime-corejs2/helpers/esm/package.json new file mode 100644 index 000000000000..aead43de364c --- /dev/null +++ b/packages/babel-runtime-corejs2/helpers/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/packages/babel-runtime-corejs3/helpers/esm/package.json b/packages/babel-runtime-corejs3/helpers/esm/package.json new file mode 100644 index 000000000000..aead43de364c --- /dev/null +++ b/packages/babel-runtime-corejs3/helpers/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file diff --git a/packages/babel-runtime/helpers/esm/package.json b/packages/babel-runtime/helpers/esm/package.json new file mode 100644 index 000000000000..aead43de364c --- /dev/null +++ b/packages/babel-runtime/helpers/esm/package.json @@ -0,0 +1,3 @@ +{ + "type": "module" +} \ No newline at end of file From 75767d87cb147709b9bd9b99bf44daa6688874a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 23 Nov 2019 00:05:58 +0100 Subject: [PATCH 823/965] v7.7.4 --- .../package.json | 8 +- .../package.json | 8 +- lerna.json | 2 +- packages/babel-cli/package.json | 4 +- packages/babel-core/package.json | 16 +- packages/babel-generator/package.json | 6 +- .../package.json | 4 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 4 +- .../babel-helper-call-delegate/package.json | 8 +- .../package.json | 16 +- .../package.json | 6 +- packages/babel-helper-define-map/package.json | 6 +- .../package.json | 6 +- .../babel-helper-explode-class/package.json | 8 +- .../babel-helper-function-name/package.json | 8 +- .../package.json | 4 +- .../babel-helper-hoist-variables/package.json | 4 +- .../package.json | 4 +- .../babel-helper-module-imports/package.json | 6 +- .../package.json | 12 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 12 +- .../babel-helper-replace-supers/package.json | 10 +- .../babel-helper-simple-access/package.json | 6 +- .../package.json | 4 +- .../package.json | 4 +- .../babel-helper-wrap-function/package.json | 10 +- packages/babel-helpers/package.json | 10 +- packages/babel-node/package.json | 6 +- packages/babel-parser/package.json | 2 +- .../package.json | 6 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 12 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 4 +- .../babel-plugin-syntax-bigint/package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../babel-plugin-syntax-flow/package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- packages/babel-plugin-syntax-jsx/package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 4 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 18 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 16 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 6 +- .../package.json | 10 +- .../package.json | 8 +- .../babel-preset-env-standalone/package.json | 18 +- packages/babel-preset-env/package.json | 98 +++++----- packages/babel-preset-flow/package.json | 8 +- packages/babel-preset-react/package.json | 16 +- packages/babel-preset-typescript/package.json | 8 +- packages/babel-register/package.json | 4 +- packages/babel-runtime-corejs2/package.json | 4 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 4 +- packages/babel-standalone/package.json | 178 +++++++++--------- packages/babel-template/package.json | 6 +- packages/babel-traverse/package.json | 14 +- packages/babel-types/package.json | 6 +- 142 files changed, 630 insertions(+), 630 deletions(-) diff --git a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json index f1807a9b4ce4..e432a89a4486 100644 --- a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json +++ b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-codemod-object-assign-to-object-spread", - "version": "7.0.0", + "version": "7.7.4", "description": "Transforms Object.assign into object spread syntax", "repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread", "license": "MIT", @@ -13,13 +13,13 @@ "@babel/plugin" ], "dependencies": { - "@babel/plugin-syntax-object-rest-spread": "^7.0.0" + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/package.json b/codemods/babel-plugin-codemod-optional-catch-binding/package.json index 45913353021c..68196e27c1ba 100644 --- a/codemods/babel-plugin-codemod-optional-catch-binding/package.json +++ b/codemods/babel-plugin-codemod-optional-catch-binding/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-codemod-optional-catch-binding", - "version": "7.0.0", + "version": "7.7.4", "description": "Remove unused catch bindings", "repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding", "license": "MIT", @@ -13,13 +13,13 @@ "@babel/plugin" ], "dependencies": { - "@babel/plugin-syntax-optional-catch-binding": "^7.0.0" + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/lerna.json b/lerna.json index 326ffefc80ce..8c6c32dbf7a8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.3", + "version": "7.7.4", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index c5b1e90485d6..ee759a3e0c89 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -35,7 +35,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.4", "@babel/helper-fixtures": "^7.6.3" }, "bin": { diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index f22326d78eb3..657862ad476b 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.7.2", + "version": "7.7.4", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -40,12 +40,12 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helpers": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "json5": "^2.1.0", @@ -55,6 +55,6 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.6.4" + "@babel/helper-transform-fixture-test-runner": "^7.7.4" } } diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 9d4a96b51756..694dd730fef2 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.7.2", + "version": "7.7.4", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -14,13 +14,13 @@ "lib" ], "dependencies": { - "@babel/types": "^7.7.2", + "@babel/types": "^7.7.4", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.7.2" + "@babel/parser": "^7.7.4" } } diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index 49ad791e871f..e28c0bff8aa3 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-annotate-as-pure", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to annotate paths and nodes with #__PURE__ comment", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index 855c07d721a1..57b88972de02 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-bindify-decorators", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to bindify decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json index de2fdf665951..d1151c905101 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to build binary assignment operator visitors", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-explode-assignable-expression": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index d0d46f8fecb1..aadb3e870390 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-react-jsx", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to build react jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0", + "@babel/types": "^7.7.4", "esutils": "^2.0.0" } } diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index e978c18e56b5..7065592a71b8 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-call-delegate", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to call delegate", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-hoist-variables": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-create-class-features-plugin/package.json b/packages/babel-helper-create-class-features-plugin/package.json index 10a9d838580a..88e7cf113ce7 100644 --- a/packages/babel-helper-create-class-features-plugin/package.json +++ b/packages/babel-helper-create-class-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-class-features-plugin", - "version": "7.7.0", + "version": "7.7.4", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile class public and private fields, private methods and decorators to ES6", @@ -14,18 +14,18 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0" + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index c0e278155fce..7053e7805c03 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-regexp-features-plugin", - "version": "7.7.2", + "version": "7.7.4", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Compile ESNext Regular Expressions to ES5", @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.2", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index dd8f635f8fc2..954759ed9582 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-define-map", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to define a map", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", + "@babel/types": "^7.7.4", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index 3dd23b0405c3..092b7e2ed25a 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-assignable-expression", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to explode an assignable expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index a30a169acc57..f8458f7a63bd 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-class", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to explode class", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-bindify-decorators": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-bindify-decorators": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index c4a46b4c9279..17c14039a8a8 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-function-name", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to change the property 'name' of every function", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-get-function-arity": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index a9ab2ebebed2..2c6e46bb663e 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-get-function-arity", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to get function arity", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index 51acf5b0def5..3d5b44afdfb5 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-hoist-variables", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to hoist variables", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-member-expression-to-functions/package.json b/packages/babel-helper-member-expression-to-functions/package.json index ddf3f9e002ce..427ac1719aa5 100644 --- a/packages/babel-helper-member-expression-to-functions/package.json +++ b/packages/babel-helper-member-expression-to-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-member-expression-to-functions", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to replace certain member expressions with function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions", "license": "MIT", @@ -10,6 +10,6 @@ "main": "lib/index.js", "author": "Justin Ridgewell ", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index ee5f134217e3..4388b3afefa8 100644 --- a/packages/babel-helper-module-imports/package.json +++ b/packages/babel-helper-module-imports/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-imports", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel helper functions for inserting module loads", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,9 +11,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports", "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" }, "devDependencies": { - "@babel/core": "^7.7.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 7d1e61d78dfa..daf59cd11646 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-transforms", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel helper functions for implementing ES6 module transformations", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,11 +11,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-imports": "^7.7.0", - "@babel/helper-simple-access": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0", + "@babel/helper-module-imports": "^7.7.4", + "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index 374d7d4ba5f2..4d840e51cfdc 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-optimise-call-expression", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to optimise call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-plugin-test-runner/package.json b/packages/babel-helper-plugin-test-runner/package.json index 0a1dfe671fad..9b61aa4c327f 100644 --- a/packages/babel-helper-plugin-test-runner/package.json +++ b/packages/babel-helper-plugin-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-plugin-test-runner", - "version": "7.1.0", + "version": "7.7.4", "description": "Helper function to support test runner", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.1.0" + "@babel/helper-transform-fixture-test-runner": "^7.7.4" } } diff --git a/packages/babel-helper-remap-async-to-generator/package.json b/packages/babel-helper-remap-async-to-generator/package.json index 09149e3704de..d77739260844 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-remap-async-to-generator", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to remap async functions to generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", "license": "MIT", @@ -9,10 +9,10 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.0", - "@babel/helper-wrap-function": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-wrap-function": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index 1291e2a4a9a2..6be7468c0e26 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-replace-supers", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper function to replace supers", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-member-expression-to-functions": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index b904fc3e757f..a2f07b051591 100644 --- a/packages/babel-helper-simple-access/package.json +++ b/packages/babel-helper-simple-access/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-simple-access", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -11,7 +11,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json index c877e501f0d3..b5c73e2b1d82 100644 --- a/packages/babel-helper-split-export-declaration/package.json +++ b/packages/babel-helper-split-export-declaration/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-split-export-declaration", - "version": "7.7.0", + "version": "7.7.4", "description": "", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", "license": "MIT", @@ -9,6 +9,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.0" + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 6622b66cad9f..d02bdfcd1a58 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.6.4", + "version": "7.7.4", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.6.4", + "@babel/core": "^7.7.4", "@babel/helper-fixtures": "^7.6.3", "@babel/polyfill": "^7.6.0", "babel-check-duplicated-nodes": "^1.0.0", diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index 743c33bf99a4..f347da77b22a 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-wrap-function", - "version": "7.7.0", + "version": "7.7.4", "description": "Helper to wrap functions inside a function call.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.7.0", - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/helper-function-name": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 31ff1ee3c5a5..46b496e2e4a4 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.7.0", + "version": "7.7.4", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -11,11 +11,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.7.0", - "@babel/traverse": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/template": "^7.7.4", + "@babel/traverse": "^7.7.4", + "@babel/types": "^7.7.4" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index ace2ab57c6ad..f21c4734e10a 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -19,7 +19,7 @@ "compiler" ], "dependencies": { - "@babel/register": "^7.7.0", + "@babel/register": "^7.7.4", "commander": "^2.8.1", "core-js": "^3.2.1", "lodash": "^4.17.13", @@ -31,7 +31,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.4", "@babel/helper-fixtures": "^7.6.3", "fs-readdir-recursive": "^1.0.0", "make-dir": "^2.1.0" diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index ebf2db424378..11d26d0e1ca1 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.3", + "version": "7.7.4", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-plugin-external-helpers/package.json b/packages/babel-plugin-external-helpers/package.json index 7a4bd988941c..bca1c2aa3162 100644 --- a/packages/babel-plugin-external-helpers/package.json +++ b/packages/babel-plugin-external-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-external-helpers", - "version": "7.2.0", + "version": "7.7.4", "description": "This plugin contains helper functions that’ll be placed at the top of the generated code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-async-generator-functions/package.json b/packages/babel-plugin-proposal-async-generator-functions/package.json index 276aa93ea371..fff4bbb5eb32 100644 --- a/packages/babel-plugin-proposal-async-generator-functions/package.json +++ b/packages/babel-plugin-proposal-async-generator-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-async-generator-functions", - "version": "7.7.0", + "version": "7.7.4", "description": "Turn async generator functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions", "license": "MIT", @@ -13,14 +13,14 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.0", - "@babel/plugin-syntax-async-generators": "^7.2.0" + "@babel/helper-remap-async-to-generator": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-class-properties/package.json b/packages/babel-plugin-proposal-class-properties/package.json index 5036770a07d3..806cb9b77677 100644 --- a/packages/babel-plugin-proposal-class-properties/package.json +++ b/packages/babel-plugin-proposal-class-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-class-properties", - "version": "7.7.0", + "version": "7.7.4", "description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index e7f9f4de57e3..260dfcdde5bf 100644 --- a/packages/babel-plugin-proposal-decorators/package.json +++ b/packages/babel-plugin-proposal-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-decorators", - "version": "7.7.0", + "version": "7.7.4", "author": "Logan Smyth ", "license": "MIT", "publishConfig": { @@ -15,15 +15,15 @@ "decorators" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-decorators": "^7.2.0" + "@babel/plugin-syntax-decorators": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-do-expressions/package.json b/packages/babel-plugin-proposal-do-expressions/package.json index 3e5a41f94936..25e90b2120b0 100644 --- a/packages/babel-plugin-proposal-do-expressions/package.json +++ b/packages/babel-plugin-proposal-do-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-do-expressions", - "version": "7.6.0", + "version": "7.7.4", "description": "Compile do expressions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-do-expressions", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-do-expressions": "^7.2.0" + "@babel/plugin-syntax-do-expressions": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-dynamic-import/package.json b/packages/babel-plugin-proposal-dynamic-import/package.json index 1ade94814252..baf2c7f87520 100644 --- a/packages/babel-plugin-proposal-dynamic-import/package.json +++ b/packages/babel-plugin-proposal-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-dynamic-import", - "version": "7.7.0", + "version": "7.7.4", "description": "Transform import() expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0" + "@babel/plugin-syntax-dynamic-import": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-export-default-from/package.json b/packages/babel-plugin-proposal-export-default-from/package.json index 5062421a48ed..f1534e5c4912 100644 --- a/packages/babel-plugin-proposal-export-default-from/package.json +++ b/packages/babel-plugin-proposal-export-default-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-export-default-from", - "version": "7.5.2", + "version": "7.7.4", "description": "Compile export default to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-export-default-from": "^7.2.0" + "@babel/plugin-syntax-export-default-from": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-export-namespace-from/package.json b/packages/babel-plugin-proposal-export-namespace-from/package.json index 1f0081f49c38..62a1e8d95340 100644 --- a/packages/babel-plugin-proposal-export-namespace-from/package.json +++ b/packages/babel-plugin-proposal-export-namespace-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-export-namespace-from", - "version": "7.5.2", + "version": "7.7.4", "description": "Compile export namespace to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-namespace-from", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-export-namespace-from": "^7.2.0" + "@babel/plugin-syntax-export-namespace-from": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-function-bind/package.json b/packages/babel-plugin-proposal-function-bind/package.json index 177ce26ee514..dbbc3f274edd 100644 --- a/packages/babel-plugin-proposal-function-bind/package.json +++ b/packages/babel-plugin-proposal-function-bind/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-function-bind", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile function bind operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-bind", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-function-bind": "^7.2.0" + "@babel/plugin-syntax-function-bind": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-function-sent/package.json b/packages/babel-plugin-proposal-function-sent/package.json index f8335257f1a6..91bf98f85e97 100644 --- a/packages/babel-plugin-proposal-function-sent/package.json +++ b/packages/babel-plugin-proposal-function-sent/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-function-sent", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile the function.sent meta property to valid ES2015 code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-sent", "license": "MIT", @@ -13,14 +13,14 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-wrap-function": "^7.7.0", - "@babel/plugin-syntax-function-sent": "^7.2.0" + "@babel/helper-wrap-function": "^7.7.4", + "@babel/plugin-syntax-function-sent": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-json-strings/package.json b/packages/babel-plugin-proposal-json-strings/package.json index 421ccf784f36..90e0d9d7011a 100644 --- a/packages/babel-plugin-proposal-json-strings/package.json +++ b/packages/babel-plugin-proposal-json-strings/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-json-strings", - "version": "7.2.0", + "version": "7.7.4", "description": "Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.2.0" + "@babel/plugin-syntax-json-strings": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/package.json b/packages/babel-plugin-proposal-logical-assignment-operators/package.json index ee5957903079..a5942961f7ce 100644 --- a/packages/babel-plugin-proposal-logical-assignment-operators/package.json +++ b/packages/babel-plugin-proposal-logical-assignment-operators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-logical-assignment-operators", - "version": "7.2.0", + "version": "7.7.4", "description": "Transforms logical assignment operators into short-circuited assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-logical-assignment-operators", "license": "MIT", @@ -13,15 +13,15 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.2.0" + "@babel/plugin-syntax-logical-assignment-operators": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.2.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.2.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json index dd9e329c3beb..5f17a0642723 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-nullish-coalescing-operator", - "version": "7.4.4", + "version": "7.7.4", "description": "Remove nullish coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-nullish-coalescing-operator", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.2.0" + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-numeric-separator/package.json b/packages/babel-plugin-proposal-numeric-separator/package.json index 275d2b8425a9..deae174debd3 100644 --- a/packages/babel-plugin-proposal-numeric-separator/package.json +++ b/packages/babel-plugin-proposal-numeric-separator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-numeric-separator", - "version": "7.2.0", + "version": "7.7.4", "description": "Remove numeric separators from Decimal, Binary, Hex and Octal literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-numeric-separator", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-numeric-separator": "^7.2.0" + "@babel/plugin-syntax-numeric-separator": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index 6f02a07f0308..99b78403ddf5 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/package.json +++ b/packages/babel-plugin-proposal-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-object-rest-spread", - "version": "7.6.2", + "version": "7.7.4", "description": "Compile object rest and spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0" + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-optional-catch-binding/package.json b/packages/babel-plugin-proposal-optional-catch-binding/package.json index 86e80fad2678..a25265df7aff 100644 --- a/packages/babel-plugin-proposal-optional-catch-binding/package.json +++ b/packages/babel-plugin-proposal-optional-catch-binding/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-catch-binding", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index 0f1b1586b077..474055ae10a9 100644 --- a/packages/babel-plugin-proposal-optional-chaining/package.json +++ b/packages/babel-plugin-proposal-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-chaining", - "version": "7.6.0", + "version": "7.7.4", "description": "Transform optional chaining operators into a series of nil checks", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining", "license": "MIT", @@ -13,14 +13,14 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-chaining": "^7.2.0" + "@babel/plugin-syntax-optional-chaining": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-transform-block-scoping": "^7.6.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/plugin-transform-block-scoping": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-partial-application/package.json b/packages/babel-plugin-proposal-partial-application/package.json index 79303c737cc7..8b1ccefb0859 100644 --- a/packages/babel-plugin-proposal-partial-application/package.json +++ b/packages/babel-plugin-proposal-partial-application/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-partial-application", - "version": "7.4.4", + "version": "7.7.4", "description": "Introduces a new ? token in an argument list which allows for partially applying an argument list to a call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-partial-application", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-partial-application": "^7.4.4" + "@babel/plugin-syntax-partial-application": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-pipeline-operator/package.json b/packages/babel-plugin-proposal-pipeline-operator/package.json index bf0b947a8e84..348d74afedfd 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/package.json +++ b/packages/babel-plugin-proposal-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-pipeline-operator", - "version": "7.5.0", + "version": "7.7.4", "description": "Transform pipeline operator into call expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-pipeline-operator": "^7.5.0" + "@babel/plugin-syntax-pipeline-operator": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-private-methods/package.json b/packages/babel-plugin-proposal-private-methods/package.json index 1095dc809d44..ef25c513e368 100644 --- a/packages/babel-plugin-proposal-private-methods/package.json +++ b/packages/babel-plugin-proposal-private-methods/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-private-methods", - "version": "7.6.0", + "version": "7.7.4", "description": "This plugin transforms private class methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-private-methods", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.6.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-throw-expressions/package.json b/packages/babel-plugin-proposal-throw-expressions/package.json index 2f6bc414a717..7a649b3ccf7a 100644 --- a/packages/babel-plugin-proposal-throw-expressions/package.json +++ b/packages/babel-plugin-proposal-throw-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-throw-expressions", - "version": "7.2.0", + "version": "7.7.4", "description": "Wraps Throw Expressions in an IIFE", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-throw-expressions", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-throw-expressions": "^7.2.0" + "@babel/plugin-syntax-throw-expressions": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index b478bbdde033..58509325b3f5 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-unicode-property-regex", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -22,14 +22,14 @@ "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-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-async-generators/package.json b/packages/babel-plugin-syntax-async-generators/package.json index 60a1702af977..9bda12487b03 100644 --- a/packages/babel-plugin-syntax-async-generators/package.json +++ b/packages/babel-plugin-syntax-async-generators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-async-generators", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of async generator functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-bigint/package.json b/packages/babel-plugin-syntax-bigint/package.json index 9993d4d33f1a..a2ec1ae96ca9 100644 --- a/packages/babel-plugin-syntax-bigint/package.json +++ b/packages/babel-plugin-syntax-bigint/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-bigint", - "version": "7.4.4", + "version": "7.7.4", "description": "Allow parsing of BigInt literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-bigint", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-class-properties/package.json b/packages/babel-plugin-syntax-class-properties/package.json index dba0685a8477..2231253bad40 100644 --- a/packages/babel-plugin-syntax-class-properties/package.json +++ b/packages/babel-plugin-syntax-class-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-class-properties", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of class properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-decorators/package.json b/packages/babel-plugin-syntax-decorators/package.json index a8bae4e61af0..91177eecd70b 100644 --- a/packages/babel-plugin-syntax-decorators/package.json +++ b/packages/babel-plugin-syntax-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-decorators", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-do-expressions/package.json b/packages/babel-plugin-syntax-do-expressions/package.json index d95b511792ad..2ab86a23d6a7 100644 --- a/packages/babel-plugin-syntax-do-expressions/package.json +++ b/packages/babel-plugin-syntax-do-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-do-expressions", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of do expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-do-expressions", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-dynamic-import/package.json b/packages/babel-plugin-syntax-dynamic-import/package.json index 23240cbaa16e..9f74cc9e7fc9 100644 --- a/packages/babel-plugin-syntax-dynamic-import/package.json +++ b/packages/babel-plugin-syntax-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-dynamic-import", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of import()", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-export-default-from/package.json b/packages/babel-plugin-syntax-export-default-from/package.json index 7c2f2ab05435..eca0d9983344 100644 --- a/packages/babel-plugin-syntax-export-default-from/package.json +++ b/packages/babel-plugin-syntax-export-default-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-export-default-from", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of export default from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-export-namespace-from/package.json b/packages/babel-plugin-syntax-export-namespace-from/package.json index fde4093e1be8..81a13ede4603 100644 --- a/packages/babel-plugin-syntax-export-namespace-from/package.json +++ b/packages/babel-plugin-syntax-export-namespace-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-export-namespace-from", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of export namespace from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-namespace-from", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-flow/package.json b/packages/babel-plugin-syntax-flow/package.json index 2885aa9f81ec..1b7a83c059e4 100644 --- a/packages/babel-plugin-syntax-flow/package.json +++ b/packages/babel-plugin-syntax-flow/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-flow", - "version": "7.7.0", + "version": "7.7.4", "description": "Allow parsing of the flow syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-function-bind/package.json b/packages/babel-plugin-syntax-function-bind/package.json index 86cf0265d67e..980eec9a5b70 100644 --- a/packages/babel-plugin-syntax-function-bind/package.json +++ b/packages/babel-plugin-syntax-function-bind/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-function-bind", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of function bind", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-bind", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-function-sent/package.json b/packages/babel-plugin-syntax-function-sent/package.json index 1b503528cb48..e01cb2111f14 100644 --- a/packages/babel-plugin-syntax-function-sent/package.json +++ b/packages/babel-plugin-syntax-function-sent/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-function-sent", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of the function.sent meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-sent", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-import-meta/package.json b/packages/babel-plugin-syntax-import-meta/package.json index 25c7cb70c748..e2147ed79359 100644 --- a/packages/babel-plugin-syntax-import-meta/package.json +++ b/packages/babel-plugin-syntax-import-meta/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-import-meta", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of import.meta", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-import-meta", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-json-strings/package.json b/packages/babel-plugin-syntax-json-strings/package.json index 3f1dcab3841e..6aa7913d8a1b 100644 --- a/packages/babel-plugin-syntax-json-strings/package.json +++ b/packages/babel-plugin-syntax-json-strings/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-json-strings", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-jsx/package.json b/packages/babel-plugin-syntax-jsx/package.json index dd4ead2baaf8..9bdc4f010b05 100644 --- a/packages/babel-plugin-syntax-jsx/package.json +++ b/packages/babel-plugin-syntax-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-jsx", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/package.json b/packages/babel-plugin-syntax-logical-assignment-operators/package.json index aeea2eaa72e7..f2363a94805b 100644 --- a/packages/babel-plugin-syntax-logical-assignment-operators/package.json +++ b/packages/babel-plugin-syntax-logical-assignment-operators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-logical-assignment-operators", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of the logical assignment operators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-logical-assignment-operators", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json index 323934061e24..48c06414a9dc 100644 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-nullish-coalescing-operator", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of the nullish-coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-numeric-separator/package.json b/packages/babel-plugin-syntax-numeric-separator/package.json index c60d9ccdf975..6196086522c0 100644 --- a/packages/babel-plugin-syntax-numeric-separator/package.json +++ b/packages/babel-plugin-syntax-numeric-separator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-numeric-separator", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of Decimal, Binary, Hex and Octal literals that contain a Numeric Literal Separator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-numeric-separator", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-object-rest-spread/package.json b/packages/babel-plugin-syntax-object-rest-spread/package.json index e0b6524d3a5b..d350831d1050 100644 --- a/packages/babel-plugin-syntax-object-rest-spread/package.json +++ b/packages/babel-plugin-syntax-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-object-rest-spread", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of object rest/spread", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-optional-catch-binding/package.json b/packages/babel-plugin-syntax-optional-catch-binding/package.json index 09e1ff1b176f..3811d3081647 100644 --- a/packages/babel-plugin-syntax-optional-catch-binding/package.json +++ b/packages/babel-plugin-syntax-optional-catch-binding/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-optional-catch-binding", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-optional-chaining/package.json b/packages/babel-plugin-syntax-optional-chaining/package.json index 22adb320d437..f4c1c17f42d0 100644 --- a/packages/babel-plugin-syntax-optional-chaining/package.json +++ b/packages/babel-plugin-syntax-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-optional-chaining", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of optional properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-partial-application/package.json b/packages/babel-plugin-syntax-partial-application/package.json index 50f8fcdf7e6b..f5cb98d4af43 100644 --- a/packages/babel-plugin-syntax-partial-application/package.json +++ b/packages/babel-plugin-syntax-partial-application/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-partial-application", - "version": "7.4.4", + "version": "7.7.4", "description": "Allow parsing of partial application syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-partial-application", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-pipeline-operator/package.json b/packages/babel-plugin-syntax-pipeline-operator/package.json index 61f571097149..2064600de73e 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/package.json +++ b/packages/babel-plugin-syntax-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-pipeline-operator", - "version": "7.5.0", + "version": "7.7.4", "description": "Allow parsing of the pipeline operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-pipeline-operator", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-throw-expressions/package.json b/packages/babel-plugin-syntax-throw-expressions/package.json index 55afeeb6b1dc..25d83e9a543e 100644 --- a/packages/babel-plugin-syntax-throw-expressions/package.json +++ b/packages/babel-plugin-syntax-throw-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-throw-expressions", - "version": "7.2.0", + "version": "7.7.4", "description": "Allow parsing of Throw Expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-throw-expressions", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-top-level-await/package.json b/packages/babel-plugin-syntax-top-level-await/package.json index 5b42d9a1f1c9..a2005f8995a7 100644 --- a/packages/babel-plugin-syntax-top-level-await/package.json +++ b/packages/babel-plugin-syntax-top-level-await/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-top-level-await", - "version": "7.7.0", + "version": "7.7.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", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-typescript/package.json b/packages/babel-plugin-syntax-typescript/package.json index d3410aca3a27..817423c55d81 100644 --- a/packages/babel-plugin-syntax-typescript/package.json +++ b/packages/babel-plugin-syntax-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-typescript", - "version": "7.3.3", + "version": "7.7.4", "description": "Allow parsing of TypeScript syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript", "license": "MIT", @@ -19,6 +19,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.3.3" + "@babel/core": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-arrow-functions/package.json b/packages/babel-plugin-transform-arrow-functions/package.json index 7506dfc22b99..2edcb84f3cef 100644 --- a/packages/babel-plugin-transform-arrow-functions/package.json +++ b/packages/babel-plugin-transform-arrow-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-arrow-functions", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES2015 arrow functions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions", "license": "MIT", @@ -18,8 +18,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/traverse": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/traverse": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-async-to-generator/package.json b/packages/babel-plugin-transform-async-to-generator/package.json index 7703da8097fe..0eb48c81b85e 100644 --- a/packages/babel-plugin-transform-async-to-generator/package.json +++ b/packages/babel-plugin-transform-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-async-to-generator", - "version": "7.7.0", + "version": "7.7.4", "description": "Turn async functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator", "license": "MIT", @@ -12,15 +12,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "^7.7.0", + "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.0" + "@babel/helper-remap-async-to-generator": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-block-scoped-functions/package.json b/packages/babel-plugin-transform-block-scoped-functions/package.json index b6ea3d6117f3..c52956f9a862 100644 --- a/packages/babel-plugin-transform-block-scoped-functions/package.json +++ b/packages/babel-plugin-transform-block-scoped-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoped-functions", - "version": "7.2.0", + "version": "7.7.4", "description": "Babel plugin to ensure function declarations at the block level are block scoped", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index 5a6c85f93138..221bcdba0fc8 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.6.3", + "version": "7.7.4", "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-classes/package.json b/packages/babel-plugin-transform-classes/package.json index cfb696cf0a8f..accd40160c82 100644 --- a/packages/babel-plugin-transform-classes/package.json +++ b/packages/babel-plugin-transform-classes/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-classes", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile ES2015 classes to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes", "license": "MIT", @@ -9,13 +9,13 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.0", - "@babel/helper-define-map": "^7.7.0", - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-optimise-call-expression": "^7.7.0", + "@babel/helper-annotate-as-pure": "^7.7.4", + "@babel/helper-define-map": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-optimise-call-expression": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", + "@babel/helper-replace-supers": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", "globals": "^11.1.0" }, "keywords": [ @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-computed-properties/package.json b/packages/babel-plugin-transform-computed-properties/package.json index c749cfab88d6..07c60ccae34c 100644 --- a/packages/babel-plugin-transform-computed-properties/package.json +++ b/packages/babel-plugin-transform-computed-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-computed-properties", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES2015 computed properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-destructuring/package.json b/packages/babel-plugin-transform-destructuring/package.json index 5e0b750bd541..46b4da5a92a7 100644 --- a/packages/babel-plugin-transform-destructuring/package.json +++ b/packages/babel-plugin-transform-destructuring/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-destructuring", - "version": "7.6.0", + "version": "7.7.4", "description": "Compile ES2015 destructuring to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 77dc9f4deb5e..8bb1d1506d86 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-dotall-regex", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -18,14 +18,14 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex", "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-duplicate-keys/package.json b/packages/babel-plugin-transform-duplicate-keys/package.json index e58d6908cf20..81511155271d 100644 --- a/packages/babel-plugin-transform-duplicate-keys/package.json +++ b/packages/babel-plugin-transform-duplicate-keys/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-duplicate-keys", - "version": "7.5.0", + "version": "7.7.4", "description": "Compile objects with duplicate keys to valid strict ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-duplicate-keys", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-exponentiation-operator/package.json b/packages/babel-plugin-transform-exponentiation-operator/package.json index aaf4029930b0..538bd8355db4 100644 --- a/packages/babel-plugin-transform-exponentiation-operator/package.json +++ b/packages/babel-plugin-transform-exponentiation-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-exponentiation-operator", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile exponentiation operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index 7c5ab0d57b47..c8d728525adf 100644 --- a/packages/babel-plugin-transform-flow-comments/package.json +++ b/packages/babel-plugin-transform-flow-comments/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-comments", - "version": "7.6.3", + "version": "7.7.4", "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", @@ -12,15 +12,15 @@ "babel-plugin" ], "dependencies": { - "@babel/generator": "^7.6.3", + "@babel/generator": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.2.0" + "@babel/plugin-syntax-flow": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-flow-strip-types/package.json b/packages/babel-plugin-transform-flow-strip-types/package.json index 7754af0e1c17..47810c636b4d 100644 --- a/packages/babel-plugin-transform-flow-strip-types/package.json +++ b/packages/babel-plugin-transform-flow-strip-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-strip-types", - "version": "7.6.3", + "version": "7.7.4", "description": "Strip flow type annotations from your output code.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.2.0" + "@babel/plugin-syntax-flow": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-for-of/package.json b/packages/babel-plugin-transform-for-of/package.json index 66d3aa78455d..fee89eaa0d74 100644 --- a/packages/babel-plugin-transform-for-of/package.json +++ b/packages/babel-plugin-transform-for-of/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-for-of", - "version": "7.4.4", + "version": "7.7.4", "description": "Compile ES2015 for...of to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-function-name/package.json b/packages/babel-plugin-transform-function-name/package.json index c6be0eee3d0a..1fdf6e7259ab 100644 --- a/packages/babel-plugin-transform-function-name/package.json +++ b/packages/babel-plugin-transform-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-function-name", - "version": "7.7.0", + "version": "7.7.4", "description": "Apply ES2015 function.name semantics to all functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.7.0", + "@babel/helper-function-name": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-instanceof/package.json b/packages/babel-plugin-transform-instanceof/package.json index 323984f68c50..b6f8e9770235 100644 --- a/packages/babel-plugin-transform-instanceof/package.json +++ b/packages/babel-plugin-transform-instanceof/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-instanceof", - "version": "7.5.5", + "version": "7.7.4", "description": "This plugin transforms all the ES2015 'instanceof' methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-instanceof", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-jscript/package.json b/packages/babel-plugin-transform-jscript/package.json index 81bbf34e52c0..635f3f5bfe33 100644 --- a/packages/babel-plugin-transform-jscript/package.json +++ b/packages/babel-plugin-transform-jscript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-jscript", - "version": "7.2.0", + "version": "7.7.4", "description": "Babel plugin to fix buggy JScript named function expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-jscript", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-literals/package.json b/packages/babel-plugin-transform-literals/package.json index 5f171fa2f0e8..0c25a118b762 100644 --- a/packages/babel-plugin-transform-literals/package.json +++ b/packages/babel-plugin-transform-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-literals", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES2015 unicode string and number literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-literals", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-member-expression-literals/package.json b/packages/babel-plugin-transform-member-expression-literals/package.json index 58e267904e81..22f042a2a7b4 100644 --- a/packages/babel-plugin-transform-member-expression-literals/package.json +++ b/packages/babel-plugin-transform-member-expression-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-member-expression-literals", - "version": "7.2.0", + "version": "7.7.4", "description": "Ensure that reserved words are quoted in property accesses", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-member-expression-literals", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-modules-amd/package.json b/packages/babel-plugin-transform-modules-amd/package.json index fd87e33c074a..d13bf03757e8 100644 --- a/packages/babel-plugin-transform-modules-amd/package.json +++ b/packages/babel-plugin-transform-modules-amd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-amd", - "version": "7.5.0", + "version": "7.7.4", "description": "This plugin transforms ES2015 modules to AMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-module-transforms": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index 2b278105db8c..b691678b523d 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.7.0", + "version": "7.7.4", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", @@ -9,9 +9,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.0", + "@babel/helper-module-transforms": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.7.0", + "@babel/helper-simple-access": "^7.7.4", "babel-plugin-dynamic-import-node": "^2.3.0" }, "keywords": [ @@ -21,8 +21,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index 381c7ba180a3..e00b97eec6aa 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-systemjs", - "version": "7.7.0", + "version": "7.7.4", "description": "This plugin transforms ES2015 modules to SystemJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.7.0", + "@babel/helper-hoist-variables": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, @@ -20,8 +20,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-modules-umd/package.json b/packages/babel-plugin-transform-modules-umd/package.json index 8db718dec04f..8ba30be09fa7 100644 --- a/packages/babel-plugin-transform-modules-umd/package.json +++ b/packages/babel-plugin-transform-modules-umd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-umd", - "version": "7.7.0", + "version": "7.7.4", "description": "This plugin transforms ES2015 modules to UMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.0", + "@babel/helper-module-transforms": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "keywords": [ @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } 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 8186a98c0685..e861e3695003 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -21,14 +21,14 @@ }, "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.0" + "@babel/helper-create-regexp-features-plugin": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0", + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", "core-js": "^3.2.1", "core-js-pure": "^3.2.1" } diff --git a/packages/babel-plugin-transform-new-target/package.json b/packages/babel-plugin-transform-new-target/package.json index f415edcfec42..d92a9bba46cb 100644 --- a/packages/babel-plugin-transform-new-target/package.json +++ b/packages/babel-plugin-transform-new-target/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-new-target", - "version": "7.4.4", + "version": "7.7.4", "description": "Transforms new.target meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target", "license": "MIT", @@ -18,9 +18,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/plugin-proposal-class-properties": "^7.4.4", - "@babel/plugin-transform-arrow-functions": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/plugin-proposal-class-properties": "^7.7.4", + "@babel/plugin-transform-arrow-functions": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-object-assign/package.json b/packages/babel-plugin-transform-object-assign/package.json index b0852beb749c..19032ac21818 100644 --- a/packages/babel-plugin-transform-object-assign/package.json +++ b/packages/babel-plugin-transform-object-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-assign", - "version": "7.2.0", + "version": "7.7.4", "description": "Replace Object.assign with an inline helper", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-assign", "author": "Jed Watson", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json index 850f7c9e1c53..a8206199b6d8 100644 --- a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json +++ b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-set-prototype-of-to-assign", - "version": "7.2.0", + "version": "7.7.4", "description": "Turn Object.setPrototypeOf to assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-set-prototype-of-to-assign", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-object-super/package.json b/packages/babel-plugin-transform-object-super/package.json index 488357a6e245..9cfaa7d129c4 100644 --- a/packages/babel-plugin-transform-object-super/package.json +++ b/packages/babel-plugin-transform-object-super/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-super", - "version": "7.5.5", + "version": "7.7.4", "description": "Compile ES2015 object super to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.5.5" + "@babel/helper-replace-supers": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-parameters/package.json b/packages/babel-plugin-transform-parameters/package.json index fa8403ed44ce..94d346458946 100644 --- a/packages/babel-plugin-transform-parameters/package.json +++ b/packages/babel-plugin-transform-parameters/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-parameters", - "version": "7.4.4", + "version": "7.7.4", "description": "Compile ES2015 default and rest parameters to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", "license": "MIT", @@ -9,8 +9,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-call-delegate": "^7.4.4", - "@babel/helper-get-function-arity": "^7.0.0", + "@babel/helper-call-delegate": "^7.7.4", + "@babel/helper-get-function-arity": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "keywords": [ @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-property-literals/package.json b/packages/babel-plugin-transform-property-literals/package.json index d74f95007361..b2765963a1a2 100644 --- a/packages/babel-plugin-transform-property-literals/package.json +++ b/packages/babel-plugin-transform-property-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-property-literals", - "version": "7.2.0", + "version": "7.7.4", "description": "Ensure that reserved words are quoted in object property keys", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-literals", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-property-mutators/package.json b/packages/babel-plugin-transform-property-mutators/package.json index b280968195ce..447459e94a65 100644 --- a/packages/babel-plugin-transform-property-mutators/package.json +++ b/packages/babel-plugin-transform-property-mutators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-property-mutators", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES5 property mutator shorthand syntax to Object.defineProperty", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-mutators", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-define-map": "^7.1.0", + "@babel/helper-define-map": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-proto-to-assign/package.json b/packages/babel-plugin-transform-proto-to-assign/package.json index 7b5799fa217d..9d299ace3cc7 100644 --- a/packages/babel-plugin-transform-proto-to-assign/package.json +++ b/packages/babel-plugin-transform-proto-to-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-proto-to-assign", - "version": "7.5.5", + "version": "7.7.4", "description": "Babel plugin for turning __proto__ into a shallow property clone", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-proto-to-assign", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.5", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index 10c33b538817..5db0453a5d35 100644 --- a/packages/babel-plugin-transform-react-constant-elements/package.json +++ b/packages/babel-plugin-transform-react-constant-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-constant-elements", - "version": "7.6.3", + "version": "7.7.4", "description": "Treat React JSX elements as value types and hoist them to the highest scope", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-annotate-as-pure": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-display-name/package.json b/packages/babel-plugin-transform-react-display-name/package.json index 97aa1609d217..93b5cfad77c4 100644 --- a/packages/babel-plugin-transform-react-display-name/package.json +++ b/packages/babel-plugin-transform-react-display-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-display-name", - "version": "7.2.0", + "version": "7.7.4", "description": "Add displayName to React.createClass calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-inline-elements/package.json b/packages/babel-plugin-transform-react-inline-elements/package.json index fe32f272e543..d4cf5aadd9ab 100644 --- a/packages/babel-plugin-transform-react-inline-elements/package.json +++ b/packages/babel-plugin-transform-react-inline-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-inline-elements", - "version": "7.2.0", + "version": "7.7.4", "description": "Turn JSX elements into exploded React objects", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.0.0", + "@babel/helper-builder-react-jsx": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-jsx-compat/package.json b/packages/babel-plugin-transform-react-jsx-compat/package.json index 87a9d5e4735e..5e5d54534d33 100644 --- a/packages/babel-plugin-transform-react-jsx-compat/package.json +++ b/packages/babel-plugin-transform-react-jsx-compat/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-compat", - "version": "7.2.0", + "version": "7.7.4", "description": "Turn JSX into React Pre-0.12 function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-compat", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.0.0", + "@babel/helper-builder-react-jsx": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-jsx-self/package.json b/packages/babel-plugin-transform-react-jsx-self/package.json index d649d89f05ae..798b3f52c8bc 100644 --- a/packages/babel-plugin-transform-react-jsx-self/package.json +++ b/packages/babel-plugin-transform-react-jsx-self/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-self", - "version": "7.2.0", + "version": "7.7.4", "description": "Add a __self prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" + "@babel/plugin-syntax-jsx": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-jsx-source/package.json b/packages/babel-plugin-transform-react-jsx-source/package.json index 829536fe4dc2..9b9593f73be9 100644 --- a/packages/babel-plugin-transform-react-jsx-source/package.json +++ b/packages/babel-plugin-transform-react-jsx-source/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-source", - "version": "7.5.0", + "version": "7.7.4", "description": "Add a __source prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" + "@babel/plugin-syntax-jsx": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.5.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index a3c3b36d70e1..05f8d6a09f7e 100644 --- a/packages/babel-plugin-transform-react-jsx/package.json +++ b/packages/babel-plugin-transform-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx", - "version": "7.7.0", + "version": "7.7.4", "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", @@ -12,15 +12,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.7.0", + "@babel/helper-builder-react-jsx": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.2.0" + "@babel/plugin-syntax-jsx": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index 503edd243e8a..4d77c3ad8ecb 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -2,7 +2,7 @@ "name": "@babel/plugin-transform-regenerator", "author": "Ben Newman ", "description": "Explode async and generator functions into a state machine.", - "version": "7.7.0", + "version": "7.7.4", "homepage": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "main": "lib/index.js", @@ -17,7 +17,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-reserved-words/package.json b/packages/babel-plugin-transform-reserved-words/package.json index dfce3bc9cf07..4773bb09029b 100644 --- a/packages/babel-plugin-transform-reserved-words/package.json +++ b/packages/babel-plugin-transform-reserved-words/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-reserved-words", - "version": "7.2.0", + "version": "7.7.4", "description": "Ensure that no reserved words are used.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 68ab0c2d4ff3..ae758bd3d220 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.6.2", + "version": "7.7.4", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -12,7 +12,7 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "resolve": "^1.8.1", "semver": "^5.5.1" @@ -21,12 +21,12 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/helpers": "^7.6.2", - "@babel/preset-env": "^7.6.2", - "@babel/runtime": "^7.6.2", - "@babel/template": "^7.6.0", + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/helpers": "^7.7.4", + "@babel/preset-env": "^7.7.4", + "@babel/runtime": "^7.7.4", + "@babel/template": "^7.7.4", "@babel/types": "7.0.0-beta.53" } } diff --git a/packages/babel-plugin-transform-shorthand-properties/package.json b/packages/babel-plugin-transform-shorthand-properties/package.json index 5233742c2adf..883951e6a7b8 100644 --- a/packages/babel-plugin-transform-shorthand-properties/package.json +++ b/packages/babel-plugin-transform-shorthand-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-shorthand-properties", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES2015 shorthand properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-spread/package.json b/packages/babel-plugin-transform-spread/package.json index 75133a6987b3..f68feab9e44a 100644 --- a/packages/babel-plugin-transform-spread/package.json +++ b/packages/babel-plugin-transform-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-spread", - "version": "7.6.2", + "version": "7.7.4", "description": "Compile ES2015 spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-sticky-regex/package.json b/packages/babel-plugin-transform-sticky-regex/package.json index 0ff694871615..d11aab37675b 100644 --- a/packages/babel-plugin-transform-sticky-regex/package.json +++ b/packages/babel-plugin-transform-sticky-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-sticky-regex", - "version": "7.2.0", + "version": "7.7.4", "description": "Compile ES2015 sticky regex to an ES5 RegExp constructor", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-strict-mode/package.json b/packages/babel-plugin-transform-strict-mode/package.json index bb59d8c74be0..d846e76d96f9 100644 --- a/packages/babel-plugin-transform-strict-mode/package.json +++ b/packages/babel-plugin-transform-strict-mode/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-strict-mode", - "version": "7.2.0", + "version": "7.7.4", "description": "This plugin places a 'use strict'; directive at the top of all files to enable strict mode", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-template-literals/package.json b/packages/babel-plugin-transform-template-literals/package.json index 0cf36ea7c2ed..e57b5b1ae326 100644 --- a/packages/babel-plugin-transform-template-literals/package.json +++ b/packages/babel-plugin-transform-template-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-template-literals", - "version": "7.4.4", + "version": "7.7.4", "description": "Compile ES2015 template literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-annotate-as-pure": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "keywords": [ @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.4.4", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-typeof-symbol/package.json b/packages/babel-plugin-transform-typeof-symbol/package.json index e893284ebc60..df9e97cd526f 100644 --- a/packages/babel-plugin-transform-typeof-symbol/package.json +++ b/packages/babel-plugin-transform-typeof-symbol/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typeof-symbol", - "version": "7.2.0", + "version": "7.7.4", "description": "This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol", "license": "MIT", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.2.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index abe6f25e2b07..c58f50f108c3 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.7.2", + "version": "7.7.4", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -13,15 +13,15 @@ "typescript" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.0", + "@babel/helper-create-class-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-typescript": "^7.2.0" + "@babel/plugin-syntax-typescript": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.2", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index f71c3d1dd38b..daaf3701ec24 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-unicode-regex", - "version": "7.7.0", + "version": "7.7.4", "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", @@ -12,14 +12,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.0", + "@babel/helper-create-regexp-features-plugin": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index d06d42d706e1..af9a02f5a8ab 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.3", + "version": "7.7.4", "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -12,14 +12,14 @@ "prepublishOnly": "cd ../.. && make prepublish-build-preset-env-standalone" }, "devDependencies": { - "@babel/plugin-proposal-dynamic-import": "^7.7.0", - "@babel/plugin-proposal-json-strings": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.2.0", - "@babel/plugin-syntax-top-level-await": "^7.7.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", - "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/preset-env": "^7.7.1", - "@babel/standalone": "^7.7.3", + "@babel/plugin-proposal-dynamic-import": "^7.7.4", + "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-top-level-await": "^7.7.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", + "@babel/plugin-transform-new-target": "^7.7.4", + "@babel/preset-env": "^7.7.4", + "@babel/standalone": "^7.7.4", "lodash": "^4.17.13" }, "keywords": [ diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index f8c13559c29b..3b0fdf4abf33 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.1", + "version": "7.7.4", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -14,52 +14,52 @@ "build-data": "node ./scripts/build-data.js; node ./scripts/build-modules-support.js" }, "dependencies": { - "@babel/helper-module-imports": "^7.7.0", + "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.7.0", - "@babel/plugin-proposal-dynamic-import": "^7.7.0", - "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.6.2", - "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.0", - "@babel/plugin-syntax-async-generators": "^7.2.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@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.7.0", - "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.7.0", - "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.6.3", - "@babel/plugin-transform-classes": "^7.7.0", - "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.7.0", - "@babel/plugin-transform-duplicate-keys": "^7.5.0", - "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.7.0", - "@babel/plugin-transform-literals": "^7.2.0", - "@babel/plugin-transform-member-expression-literals": "^7.2.0", - "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.7.0", - "@babel/plugin-transform-modules-systemjs": "^7.7.0", - "@babel/plugin-transform-modules-umd": "^7.7.0", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0", - "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/plugin-transform-object-super": "^7.5.5", - "@babel/plugin-transform-parameters": "^7.4.4", - "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-regenerator": "^7.7.0", - "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.6.2", - "@babel/plugin-transform-sticky-regex": "^7.2.0", - "@babel/plugin-transform-template-literals": "^7.4.4", - "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-unicode-regex": "^7.7.0", - "@babel/types": "^7.7.1", + "@babel/plugin-proposal-async-generator-functions": "^7.7.4", + "@babel/plugin-proposal-dynamic-import": "^7.7.4", + "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.7.4", + "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", + "@babel/plugin-syntax-top-level-await": "^7.7.4", + "@babel/plugin-transform-arrow-functions": "^7.7.4", + "@babel/plugin-transform-async-to-generator": "^7.7.4", + "@babel/plugin-transform-block-scoped-functions": "^7.7.4", + "@babel/plugin-transform-block-scoping": "^7.7.4", + "@babel/plugin-transform-classes": "^7.7.4", + "@babel/plugin-transform-computed-properties": "^7.7.4", + "@babel/plugin-transform-destructuring": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-duplicate-keys": "^7.7.4", + "@babel/plugin-transform-exponentiation-operator": "^7.7.4", + "@babel/plugin-transform-for-of": "^7.7.4", + "@babel/plugin-transform-function-name": "^7.7.4", + "@babel/plugin-transform-literals": "^7.7.4", + "@babel/plugin-transform-member-expression-literals": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.4", + "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/plugin-transform-modules-systemjs": "^7.7.4", + "@babel/plugin-transform-modules-umd": "^7.7.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", + "@babel/plugin-transform-new-target": "^7.7.4", + "@babel/plugin-transform-object-super": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-property-literals": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.4", + "@babel/plugin-transform-reserved-words": "^7.7.4", + "@babel/plugin-transform-shorthand-properties": "^7.7.4", + "@babel/plugin-transform-spread": "^7.7.4", + "@babel/plugin-transform-sticky-regex": "^7.7.4", + "@babel/plugin-transform-template-literals": "^7.7.4", + "@babel/plugin-transform-typeof-symbol": "^7.7.4", + "@babel/plugin-transform-unicode-regex": "^7.7.4", + "@babel/types": "^7.7.4", "browserslist": "^4.6.0", "core-js-compat": "^3.1.1", "invariant": "^2.2.2", @@ -70,10 +70,10 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.7.0", - "@babel/core": "^7.7.0", + "@babel/cli": "^7.7.4", + "@babel/core": "^7.7.4", "@babel/helper-fixtures": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.0.0", + "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", "compat-table": "kangax/compat-table#4195aca631ad904cb0efeb62a9c2d8c8511706f8", diff --git a/packages/babel-preset-flow/package.json b/packages/babel-preset-flow/package.json index 80db216b5fdc..500bdad7a86f 100644 --- a/packages/babel-preset-flow/package.json +++ b/packages/babel-preset-flow/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-flow", - "version": "7.0.0", + "version": "7.7.4", "description": "Babel preset for all Flow plugins.", "author": "James Kyle ", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-flow", @@ -17,13 +17,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-flow-strip-types": "^7.0.0" + "@babel/plugin-transform-flow-strip-types": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index 2793bfb44bc6..0fffaa4ccf6a 100644 --- a/packages/babel-preset-react/package.json +++ b/packages/babel-preset-react/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-react", - "version": "7.7.0", + "version": "7.7.4", "description": "Babel preset for all React plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,17 +12,17 @@ "main": "lib/index.js", "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-react-display-name": "^7.0.0", - "@babel/plugin-transform-react-jsx": "^7.7.0", - "@babel/plugin-transform-react-jsx-self": "^7.0.0", - "@babel/plugin-transform-react-jsx-source": "^7.0.0" + "@babel/plugin-transform-react-display-name": "^7.7.4", + "@babel/plugin-transform-react-jsx": "^7.7.4", + "@babel/plugin-transform-react-jsx-self": "^7.7.4", + "@babel/plugin-transform-react-jsx-source": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", - "@babel/helper-plugin-test-runner": "^7.0.0", - "@babel/helper-transform-fixture-test-runner": "^7.6.3" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/helper-transform-fixture-test-runner": "^7.7.4" } } diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index fa98c56cd283..4cad9fd9728f 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.7.2", + "version": "7.7.4", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -14,13 +14,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.2" + "@babel/plugin-transform-typescript": "^7.7.4" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.2", - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/core": "^7.7.4", + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 5edcac8d4e97..5f26b90e092c 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.7.0", + "version": "7.7.4", "description": "babel require hook", "license": "MIT", "publishConfig": { @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.0", + "@babel/core": "^7.7.4", "default-require-extensions": "^2.0.0" } } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index d5bc51194622..0d0e4a256a03 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.2", + "version": "7.7.4", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { @@ -13,6 +13,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.7.0" + "@babel/helpers": "^7.7.4" } } diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 1aff3a832aa7..49ed281e9e51 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.2", + "version": "7.7.4", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index d0dc352d9599..e89764fa589d 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.2", + "version": "7.7.4", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { @@ -17,6 +17,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.7.0" + "@babel/helpers": "^7.7.4" } } diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 3f7831157508..05dffa672968 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.3", + "version": "7.7.4", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -12,95 +12,95 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.7.2", + "@babel/core": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-external-helpers": "^7.2.0", - "@babel/plugin-proposal-async-generator-functions": "^7.7.0", - "@babel/plugin-proposal-class-properties": "^7.7.0", - "@babel/plugin-proposal-decorators": "^7.7.0", - "@babel/plugin-proposal-do-expressions": "^7.6.0", - "@babel/plugin-proposal-export-default-from": "^7.5.2", - "@babel/plugin-proposal-export-namespace-from": "^7.5.2", - "@babel/plugin-proposal-function-bind": "^7.2.0", - "@babel/plugin-proposal-function-sent": "^7.7.0", - "@babel/plugin-proposal-json-strings": "^7.2.0", - "@babel/plugin-proposal-logical-assignment-operators": "^7.2.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", - "@babel/plugin-proposal-numeric-separator": "^7.2.0", - "@babel/plugin-proposal-object-rest-spread": "^7.6.2", - "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", - "@babel/plugin-proposal-optional-chaining": "^7.6.0", - "@babel/plugin-proposal-pipeline-operator": "^7.5.0", - "@babel/plugin-proposal-private-methods": "^7.6.0", - "@babel/plugin-proposal-throw-expressions": "^7.2.0", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.0", - "@babel/plugin-syntax-async-generators": "^7.2.0", - "@babel/plugin-syntax-class-properties": "^7.2.0", - "@babel/plugin-syntax-decorators": "^7.2.0", - "@babel/plugin-syntax-do-expressions": "^7.2.0", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "@babel/plugin-syntax-export-default-from": "^7.2.0", - "@babel/plugin-syntax-export-namespace-from": "^7.2.0", - "@babel/plugin-syntax-flow": "^7.7.0", - "@babel/plugin-syntax-function-bind": "^7.2.0", - "@babel/plugin-syntax-function-sent": "^7.2.0", - "@babel/plugin-syntax-import-meta": "^7.2.0", - "@babel/plugin-syntax-jsx": "^7.2.0", - "@babel/plugin-syntax-object-rest-spread": "^7.2.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", - "@babel/plugin-syntax-pipeline-operator": "^7.5.0", - "@babel/plugin-syntax-typescript": "^7.3.3", - "@babel/plugin-transform-arrow-functions": "^7.2.0", - "@babel/plugin-transform-async-to-generator": "^7.7.0", - "@babel/plugin-transform-block-scoped-functions": "^7.2.0", - "@babel/plugin-transform-block-scoping": "^7.6.3", - "@babel/plugin-transform-classes": "^7.7.0", - "@babel/plugin-transform-computed-properties": "^7.2.0", - "@babel/plugin-transform-destructuring": "^7.6.0", - "@babel/plugin-transform-dotall-regex": "^7.7.0", - "@babel/plugin-transform-duplicate-keys": "^7.5.0", - "@babel/plugin-transform-exponentiation-operator": "^7.2.0", - "@babel/plugin-transform-flow-comments": "^7.6.3", - "@babel/plugin-transform-flow-strip-types": "^7.6.3", - "@babel/plugin-transform-for-of": "^7.4.4", - "@babel/plugin-transform-function-name": "^7.7.0", - "@babel/plugin-transform-instanceof": "^7.5.5", - "@babel/plugin-transform-jscript": "^7.2.0", - "@babel/plugin-transform-literals": "^7.2.0", - "@babel/plugin-transform-member-expression-literals": "^7.2.0", - "@babel/plugin-transform-modules-amd": "^7.5.0", - "@babel/plugin-transform-modules-commonjs": "^7.7.0", - "@babel/plugin-transform-modules-systemjs": "^7.7.0", - "@babel/plugin-transform-modules-umd": "^7.7.0", - "@babel/plugin-transform-new-target": "^7.4.4", - "@babel/plugin-transform-object-assign": "^7.2.0", - "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.2.0", - "@babel/plugin-transform-object-super": "^7.5.5", - "@babel/plugin-transform-parameters": "^7.4.4", - "@babel/plugin-transform-property-literals": "^7.2.0", - "@babel/plugin-transform-property-mutators": "^7.2.0", - "@babel/plugin-transform-proto-to-assign": "^7.5.5", - "@babel/plugin-transform-react-constant-elements": "^7.6.3", - "@babel/plugin-transform-react-display-name": "^7.2.0", - "@babel/plugin-transform-react-inline-elements": "^7.2.0", - "@babel/plugin-transform-react-jsx": "^7.7.0", - "@babel/plugin-transform-react-jsx-compat": "^7.2.0", - "@babel/plugin-transform-react-jsx-self": "^7.2.0", - "@babel/plugin-transform-react-jsx-source": "^7.5.0", - "@babel/plugin-transform-regenerator": "^7.7.0", - "@babel/plugin-transform-reserved-words": "^7.2.0", - "@babel/plugin-transform-runtime": "^7.6.2", - "@babel/plugin-transform-shorthand-properties": "^7.2.0", - "@babel/plugin-transform-spread": "^7.6.2", - "@babel/plugin-transform-sticky-regex": "^7.2.0", - "@babel/plugin-transform-strict-mode": "^7.2.0", - "@babel/plugin-transform-template-literals": "^7.4.4", - "@babel/plugin-transform-typeof-symbol": "^7.2.0", - "@babel/plugin-transform-typescript": "^7.7.2", - "@babel/plugin-transform-unicode-regex": "^7.7.0", - "@babel/preset-flow": "^7.0.0", - "@babel/preset-react": "^7.7.0", - "@babel/preset-typescript": "^7.7.2" + "@babel/plugin-external-helpers": "^7.7.4", + "@babel/plugin-proposal-async-generator-functions": "^7.7.4", + "@babel/plugin-proposal-class-properties": "^7.7.4", + "@babel/plugin-proposal-decorators": "^7.7.4", + "@babel/plugin-proposal-do-expressions": "^7.7.4", + "@babel/plugin-proposal-export-default-from": "^7.7.4", + "@babel/plugin-proposal-export-namespace-from": "^7.7.4", + "@babel/plugin-proposal-function-bind": "^7.7.4", + "@babel/plugin-proposal-function-sent": "^7.7.4", + "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-proposal-logical-assignment-operators": "^7.7.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", + "@babel/plugin-proposal-numeric-separator": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", + "@babel/plugin-proposal-optional-chaining": "^7.7.4", + "@babel/plugin-proposal-pipeline-operator": "^7.7.4", + "@babel/plugin-proposal-private-methods": "^7.7.4", + "@babel/plugin-proposal-throw-expressions": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-syntax-async-generators": "^7.7.4", + "@babel/plugin-syntax-class-properties": "^7.7.4", + "@babel/plugin-syntax-decorators": "^7.7.4", + "@babel/plugin-syntax-do-expressions": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.7.4", + "@babel/plugin-syntax-export-default-from": "^7.7.4", + "@babel/plugin-syntax-export-namespace-from": "^7.7.4", + "@babel/plugin-syntax-flow": "^7.7.4", + "@babel/plugin-syntax-function-bind": "^7.7.4", + "@babel/plugin-syntax-function-sent": "^7.7.4", + "@babel/plugin-syntax-import-meta": "^7.7.4", + "@babel/plugin-syntax-jsx": "^7.7.4", + "@babel/plugin-syntax-object-rest-spread": "^7.7.4", + "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", + "@babel/plugin-syntax-pipeline-operator": "^7.7.4", + "@babel/plugin-syntax-typescript": "^7.7.4", + "@babel/plugin-transform-arrow-functions": "^7.7.4", + "@babel/plugin-transform-async-to-generator": "^7.7.4", + "@babel/plugin-transform-block-scoped-functions": "^7.7.4", + "@babel/plugin-transform-block-scoping": "^7.7.4", + "@babel/plugin-transform-classes": "^7.7.4", + "@babel/plugin-transform-computed-properties": "^7.7.4", + "@babel/plugin-transform-destructuring": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-duplicate-keys": "^7.7.4", + "@babel/plugin-transform-exponentiation-operator": "^7.7.4", + "@babel/plugin-transform-flow-comments": "^7.7.4", + "@babel/plugin-transform-flow-strip-types": "^7.7.4", + "@babel/plugin-transform-for-of": "^7.7.4", + "@babel/plugin-transform-function-name": "^7.7.4", + "@babel/plugin-transform-instanceof": "^7.7.4", + "@babel/plugin-transform-jscript": "^7.7.4", + "@babel/plugin-transform-literals": "^7.7.4", + "@babel/plugin-transform-member-expression-literals": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.4", + "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/plugin-transform-modules-systemjs": "^7.7.4", + "@babel/plugin-transform-modules-umd": "^7.7.4", + "@babel/plugin-transform-new-target": "^7.7.4", + "@babel/plugin-transform-object-assign": "^7.7.4", + "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.7.4", + "@babel/plugin-transform-object-super": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-property-literals": "^7.7.4", + "@babel/plugin-transform-property-mutators": "^7.7.4", + "@babel/plugin-transform-proto-to-assign": "^7.7.4", + "@babel/plugin-transform-react-constant-elements": "^7.7.4", + "@babel/plugin-transform-react-display-name": "^7.7.4", + "@babel/plugin-transform-react-inline-elements": "^7.7.4", + "@babel/plugin-transform-react-jsx": "^7.7.4", + "@babel/plugin-transform-react-jsx-compat": "^7.7.4", + "@babel/plugin-transform-react-jsx-self": "^7.7.4", + "@babel/plugin-transform-react-jsx-source": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.4", + "@babel/plugin-transform-reserved-words": "^7.7.4", + "@babel/plugin-transform-runtime": "^7.7.4", + "@babel/plugin-transform-shorthand-properties": "^7.7.4", + "@babel/plugin-transform-spread": "^7.7.4", + "@babel/plugin-transform-sticky-regex": "^7.7.4", + "@babel/plugin-transform-strict-mode": "^7.7.4", + "@babel/plugin-transform-template-literals": "^7.7.4", + "@babel/plugin-transform-typeof-symbol": "^7.7.4", + "@babel/plugin-transform-typescript": "^7.7.4", + "@babel/plugin-transform-unicode-regex": "^7.7.4", + "@babel/preset-flow": "^7.7.4", + "@babel/preset-react": "^7.7.4", + "@babel/preset-typescript": "^7.7.4" }, "keywords": [ "babel", diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index bf01d6cc6f06..3be2e36d3413 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -1,6 +1,6 @@ { "name": "@babel/template", - "version": "7.7.0", + "version": "7.7.4", "description": "Generate an AST from a string template.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.0", - "@babel/types": "^7.7.0" + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" } } diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index ee21b6e83e09..662699e7cd78 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.7.2", + "version": "7.7.4", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,16 +12,16 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.2", - "@babel/helper-function-name": "^7.7.0", - "@babel/helper-split-export-declaration": "^7.7.0", - "@babel/parser": "^7.7.2", - "@babel/types": "^7.7.2", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "^7.0.0" + "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 04946bc67d68..f9f6036ac775 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.7.2", + "version": "7.7.4", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -17,7 +17,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.7.2", - "@babel/parser": "^7.7.2" + "@babel/generator": "^7.7.4", + "@babel/parser": "^7.7.4" } } From 5dbb90ede3fce6b6705b8ccaaebe4414ed14ca71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 23 Nov 2019 00:38:07 +0100 Subject: [PATCH 824/965] Add v7.7.4 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf1ad543c9d..088d87f0363a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,53 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba + +## v7.7.4 (2019-11-23) + +#### :bug: Bug Fix +* `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime` + * [#10748](https://github.com/babel/babel/pull/10748) Add support for native esm to @babel/runtime. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-preset-env` + * [#10742](https://github.com/babel/babel/pull/10742) Update preset-env mappings. ([@existentialism](https://github.com/existentialism)) +* `babel-parser` + * [#10737](https://github.com/babel/babel/pull/10737) Flow enums: fix enum body location. ([@gkz](https://github.com/gkz)) + * [#10657](https://github.com/babel/babel/pull/10657) Fix some incorrect typeof parsing in flow. ([@existentialism](https://github.com/existentialism)) + * [#10582](https://github.com/babel/babel/pull/10582) [parser] Allow optional async methods. ([@gonzarodriguezt](https://github.com/gonzarodriguezt)) + * [#10710](https://github.com/babel/babel/pull/10710) register import equals specifier. ([@JLHwung](https://github.com/JLHwung)) + * [#10592](https://github.com/babel/babel/pull/10592) Allow TypeScript type assertions in array destructuring. ([@SakibulMowla](https://github.com/SakibulMowla)) +* `babel-preset-env-standalone` + * [#10732](https://github.com/babel/babel/pull/10732) fix: add missing available plugins to babel-preset-env-standalone. ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-transform-function-name`, `babel-plugin-transform-modules-umd`, `babel-preset-env` + * [#10701](https://github.com/babel/babel/pull/10701) Circumvent typeof transform for umd build template. ([@JLHwung](https://github.com/JLHwung)) +* `babel-cli` + * [#10698](https://github.com/babel/babel/pull/10698) Babel should not silently remove unknown options after commander arguments. ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-proposal-optional-chaining` + * [#10694](https://github.com/babel/babel/pull/10694) Fix optional method chaining in derived classes. ([@Shriram-Balaji](https://github.com/Shriram-Balaji)) +* `babel-parser`, `babel-types` + * [#10677](https://github.com/babel/babel/pull/10677) Add `asserts this [is type]` parsing support. ([@JLHwung](https://github.com/JLHwung)) +* `babel-traverse` + * [#10598](https://github.com/babel/babel/pull/10598) Fix parentheses on replaceWithMultiple for JSX. ([@khoumani](https://github.com/khoumani)) +* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env` + * [#10683](https://github.com/babel/babel/pull/10683) Fix: Don't call Object.keys on non-objects (babel#10482). ([@chrishinrichs](https://github.com/chrishinrichs)) + +#### :nail_care: Polish +* `babel-plugin-proposal-nullish-coalescing-operator` + * [#10720](https://github.com/babel/babel/pull/10720) polish: skip creating extra reference for safely re-used node. ([@JLHwung](https://github.com/JLHwung)) + +#### :house: Internal +* Other + * [#10731](https://github.com/babel/babel/pull/10731) Removed duplicate key in package.json. ([@rajasekarm](https://github.com/rajasekarm)) + * [#10718](https://github.com/babel/babel/pull/10718) chore: use loose mode of transform. ([@JLHwung](https://github.com/JLHwung)) + * [#10579](https://github.com/babel/babel/pull/10579) Implement PR workflow for running test262 on babel PRs. ([@jbhoosreddy](https://github.com/jbhoosreddy)) + * [#10648](https://github.com/babel/babel/pull/10648) bump @babel/* dev dependencies. ([@JLHwung](https://github.com/JLHwung)) + * [#10569](https://github.com/babel/babel/pull/10569) E2E test Babel with itself before publishing. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core` + * [#10668](https://github.com/babel/babel/pull/10668) Reduce standalone build size. ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-transform-literals`, `babel-preset-env-standalone` + * [#10725](https://github.com/babel/babel/pull/10725) fix typo [ci-skip]. ([@JLHwung](https://github.com/JLHwung)) +* `babel-cli` + * [#10692](https://github.com/babel/babel/pull/10692) Add missing flow type to babel-cli for consistency. ([@ZYSzys](https://github.com/ZYSzys)) + ## v7.7.3 (2019-11-08) #### :bug: Bug Fix From d38c4dd57b0bb2bb41f2ece730493c779a68b1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 23 Nov 2019 12:17:11 +0100 Subject: [PATCH 825/965] babel-eslint-v11.0.0-beta.1 --- eslint/babel-eslint-parser/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index ebbcbdb79d26..1da21995f97d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,6 +1,6 @@ { "name": "babel-eslint", - "version": "11.0.0-beta.0", + "version": "11.0.0-beta.1", "description": "Custom parser for ESLint", "author": "Sebastian McKenzie ", "license": "MIT", From e239eb4c5593516fbbd4a4f0173c994f193f8825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 24 Nov 2019 03:59:26 +0100 Subject: [PATCH 826/965] Update babel-eslint used in top-level package.json (#10754) --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 92d3e45e4661..a53340629611 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@babel/preset-flow": "^7.0.0", "@babel/register": "^7.7.0", "@babel/runtime": "^7.7.2", - "babel-eslint": "^11.0.0-beta.0", + "babel-eslint": "^11.0.0-beta.1", "babel-jest": "^24.9.0", "babel-loader": "^8.0.6", "babel-plugin-transform-charcodes": "^0.2.0", diff --git a/yarn.lock b/yarn.lock index 76fa1ca435a3..a75389b0bfc2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2504,14 +2504,14 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -babel-eslint@^11.0.0-beta.0: - version "11.0.0-beta.0" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-11.0.0-beta.0.tgz#3645b9b84d848e070e0afadc95d0c8ff96f4c63a" - integrity sha512-GJTX0XL22be/A5sFp1/4qQIOnZJ/KJ8YrA0aW07SZoDXTMLB1KQT0rYl4a9Y5DfJGPuVDVf0bMYyvLLXmXPpHw== +babel-eslint@^11.0.0-beta.1: + version "11.0.0-beta.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-11.0.0-beta.1.tgz#1762faffeaee26877761b9a19af43cef679999a4" + integrity sha512-4xDIJZUn6RDNfSfKmrywNT+e37srxxPP+GdciWakL5U36fde3/K7Y/X8XyEquXGQz02tPvzRuF6SNrR61uZ+fA== dependencies: eslint-scope "3.7.1" eslint-visitor-keys "^1.0.0" - semver "^5.6.0" + semver "^6.3.0" babel-jest@^24.9.0: version "24.9.0" From 0b06b23b005ca0fe3b42ea14dd4b9ae5adbdaf08 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 25 Nov 2019 12:44:46 -0500 Subject: [PATCH 827/965] Clean up @babel/eslint-plugin-development (#10757) * Clean up @babel/eslint-plugin-development * Add directory field to package.json --- eslint/babel-eslint-plugin-development/package.json | 13 +++++++++---- eslint/babel-eslint-plugin-development/src/index.js | 12 +++++++----- .../src/rules/no-deprecated-clone.js | 8 +++----- .../src/rules/no-undefined-identifier.js | 8 +++----- .../src/rules/plugin-name.js | 6 ++---- .../src/utils/get-export-name.js | 6 ++---- .../src/utils/get-reference-origin.js | 9 ++++----- .../src/utils/is-babel-plugin-factory.js | 10 ++++------ .../src/utils/is-from-babel-types.js | 8 +++----- .../test/rules/no-deprecated-clone.js | 6 ++---- .../test/rules/no-undefined-identifier.js | 6 ++---- .../test/rules/plugin-name.js | 6 ++---- 12 files changed, 43 insertions(+), 55 deletions(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 68d877ba3c71..d5db3ada858d 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -1,7 +1,7 @@ { "name": "@babel/eslint-plugin-development", - "version": "1.0.1", - "description": "A set of eslint rules to enforce best practices in the development of Babel plugins.", + "version": "0.0.0", + "description": "ESLint rules that enforce best practices in the development of Babel plugins.", "private": true, "keywords": [ "eslint", @@ -26,6 +26,11 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/babel/eslint-plugin-babel-plugin.git" - } + "url": "https://github.com/babel/babel.git", + "directory": "eslint/babel-eslint-plugin-development" + }, + "bugs": { + "url": "https://github.com/babel/babel/issues" + }, + "homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin-development" } diff --git a/eslint/babel-eslint-plugin-development/src/index.js b/eslint/babel-eslint-plugin-development/src/index.js index 3965315c844b..ae6662710684 100644 --- a/eslint/babel-eslint-plugin-development/src/index.js +++ b/eslint/babel-eslint-plugin-development/src/index.js @@ -1,9 +1,11 @@ -"use strict"; +import noDeprecatedClone from "./rules/no-deprecated-clone"; +import noUndefinedIdentifier from "./rules/no-undefined-identifier"; +import pluginName from "./rules/plugin-name"; -module.exports = { +export default { rules: { - "no-deprecated-clone": require("./rules/no-deprecated-clone"), - "no-undefined-identifier": require("./rules/no-undefined-identifier"), - "plugin-name": require("./rules/plugin-name"), + "no-deprecated-clone": noDeprecatedClone, + "no-undefined-identifier": noUndefinedIdentifier, + "plugin-name": pluginName, }, }; diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js index e6e72f1b9b06..dddc5eb3b729 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-deprecated-clone.js @@ -1,9 +1,7 @@ -"use strict"; +import getReferenceOrigin from "../utils/get-reference-origin"; +import isFromBabelTypes from "../utils/is-from-babel-types"; -const getReferenceOrigin = require("../utils/get-reference-origin"); -const isFromBabelTypes = require("../utils/is-from-babel-types"); - -module.exports = { +export default { meta: { schema: [], fixable: "code", diff --git a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js index c1b4b8a99382..33e154be8979 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js +++ b/eslint/babel-eslint-plugin-development/src/rules/no-undefined-identifier.js @@ -1,7 +1,5 @@ -"use strict"; - -const getReferenceOrigin = require("../utils/get-reference-origin"); -const isFromBabelTypes = require("../utils/is-from-babel-types"); +import getReferenceOrigin from "../utils/get-reference-origin"; +import isFromBabelTypes from "../utils/is-from-babel-types"; function firstArgumentIsUndefinedString(argumentsArray) { return ( @@ -11,7 +9,7 @@ function firstArgumentIsUndefinedString(argumentsArray) { ); } -module.exports = { +export default { meta: { schema: [], }, diff --git a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js index 58a4bc9f6337..df14476cd43b 100644 --- a/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js +++ b/eslint/babel-eslint-plugin-development/src/rules/plugin-name.js @@ -1,6 +1,4 @@ -"use strict"; - -const isBabelPluginFactory = require("../utils/is-babel-plugin-factory"); +import isBabelPluginFactory from "../utils/is-babel-plugin-factory"; function getReturnValue(node) { const { body } = node; @@ -14,7 +12,7 @@ function getReturnValue(node) { return body; } -module.exports = { +export default { meta: { schema: [], }, diff --git a/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js b/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js index 8c6e2c5e4086..2d75e3e46a4d 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js +++ b/eslint/babel-eslint-plugin-development/src/utils/get-export-name.js @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = function getExportName(node) { +export default function getExportName(node) { const { parent } = node; if (parent.type === "ExportDefaultDeclaration") { @@ -21,4 +19,4 @@ module.exports = function getExportName(node) { ) { return "module.exports"; } -}; +} diff --git a/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js b/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js index 44cebc4edc0b..25fd7b0a541f 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js +++ b/eslint/babel-eslint-plugin-development/src/utils/get-reference-origin.js @@ -1,7 +1,3 @@ -"use strict"; - -module.exports = getReferenceOrigin; - /*:: type ReferenceOriginImport = { kind: "import", source: string, name: string }; type ReferenceOriginParam = { @@ -26,7 +22,10 @@ type ReferenceOrigin = // from. // It resolves imports, parameters of exported functions and property accesses. // See the ReferenceOrigin type for more informations. -function getReferenceOrigin(node, scope) /*: ?ReferenceOrigin */ { +export default function getReferenceOrigin( + node, + scope, +) /*: ?ReferenceOrigin */ { if (node.type === "Identifier") { const variable = getVariableDefinition(node.name, scope); if (!variable) return null; diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js b/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js index 287124e22809..19d889bffe21 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js +++ b/eslint/babel-eslint-plugin-development/src/utils/is-babel-plugin-factory.js @@ -1,9 +1,7 @@ -"use strict"; +import getReferenceOrigin from "./get-reference-origin"; +import getExportName from "./get-export-name"; -const getReferenceOrigin = require("./get-reference-origin"); -const getExportName = require("./get-export-name"); - -module.exports = function isBabelPluginFactory(node, scope) { +export default function isBabelPluginFactory(node, scope) { const { parent } = node; if (parent.type === "CallExpression") { @@ -23,4 +21,4 @@ module.exports = function isBabelPluginFactory(node, scope) { // export default function ({ types: t }) {} // module.exports = function ({ types: t }) {} return exportName === "default" || exportName === "module.exports"; -}; +} diff --git a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js index 36ab618817d6..4a7a24bca040 100644 --- a/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js +++ b/eslint/babel-eslint-plugin-development/src/utils/is-from-babel-types.js @@ -1,10 +1,8 @@ -"use strict"; - -const isBabelPluginFactory = require("./is-babel-plugin-factory"); +import isBabelPluginFactory from "./is-babel-plugin-factory"; // Check if a ReferenceOrigin (returned by ./get-reference-origin.js) // is a reference to a @babel/types export. -module.exports = function isFromBabelTypes( +export default function isFromBabelTypes( origin /*: ReferenceOrigin */, scope /*: Scope */, ) { @@ -32,4 +30,4 @@ module.exports = function isFromBabelTypes( } return false; -}; +} diff --git a/eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js b/eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js index 473a3a32b21a..9905bc170f0c 100644 --- a/eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js +++ b/eslint/babel-eslint-plugin-development/test/rules/no-deprecated-clone.js @@ -1,7 +1,5 @@ -"use strict"; - -const rule = require("../../src/rules/no-deprecated-clone"); -const { RuleTester } = require("eslint"); +import rule from "../../src/rules/no-deprecated-clone"; +import { RuleTester } from "eslint"; const cloneError = "t.clone() is deprecated. Use t.cloneNode() instead."; const cloneDeepError = diff --git a/eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js b/eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js index c77516b177a4..d6d8c6b28b6b 100644 --- a/eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js +++ b/eslint/babel-eslint-plugin-development/test/rules/no-undefined-identifier.js @@ -1,7 +1,5 @@ -"use strict"; - -const rule = require("../../src/rules/no-undefined-identifier"); -const { RuleTester } = require("eslint"); +import rule from "../../src/rules/no-undefined-identifier"; +import { RuleTester } from "eslint"; const error = "Use path.scope.buildUndefinedNode() to create an undefined identifier directly."; diff --git a/eslint/babel-eslint-plugin-development/test/rules/plugin-name.js b/eslint/babel-eslint-plugin-development/test/rules/plugin-name.js index 670ced512279..d39924efe752 100644 --- a/eslint/babel-eslint-plugin-development/test/rules/plugin-name.js +++ b/eslint/babel-eslint-plugin-development/test/rules/plugin-name.js @@ -1,7 +1,5 @@ -"use strict"; - -const rule = require("../../src/rules/plugin-name"); -const { RuleTester } = require("eslint"); +import rule from "../../src/rules/plugin-name"; +import { RuleTester } from "eslint"; const missingPluginError = "This file does not export a Babel plugin."; const missingNameError = "This Babel plugin doesn't have a 'name' property."; From 66a70267b656485277fa2dd4807b89b6f35f46a1 Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Mon, 25 Nov 2019 20:02:02 +0200 Subject: [PATCH 828/965] Add CodeSandbox CI Config (#10639) * Add CodeSandbox CI Config * Force build * New build --- .codesandbox/ci.json | 5 +++++ package.json | 1 + 2 files changed, 6 insertions(+) create mode 100644 .codesandbox/ci.json diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json new file mode 100644 index 000000000000..b1f6755c74df --- /dev/null +++ b/.codesandbox/ci.json @@ -0,0 +1,5 @@ +{ + "installCommand": "bootstrap", + "buildCommand": false, + "sandboxes": ["kypop"] +} diff --git a/package.json b/package.json index a53340629611..3c8dfec39166 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "license": "MIT", "scripts": { + "bootstrap": "make bootstrap", "build": "make build", "fix": "make fix", "lint": "make lint", From 01c33a571904f01f7e50c19cd5139f77cffbe1ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 25 Nov 2019 21:48:12 +0100 Subject: [PATCH 829/965] Fix dependencies on @babel/* packages (#10762) * Remove dep on Babel 7 beta * Add missing dependencies used in babel.config.js * Update lockfile --- package.json | 3 + .../package.json | 2 +- yarn.lock | 178 ++++++------------ 3 files changed, 58 insertions(+), 125 deletions(-) diff --git a/package.json b/package.json index 3c8dfec39166..a204c5e72859 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,10 @@ "@babel/plugin-proposal-export-namespace-from": "^7.5.2", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", "@babel/plugin-proposal-numeric-separator": "^7.2.0", + "@babel/plugin-proposal-object-rest-spread": "^7.7.4", "@babel/plugin-proposal-optional-chaining": "^7.6.0", + "@babel/plugin-transform-flow-strip-types": "^7.7.4", + "@babel/plugin-transform-for-of": "^7.7.4", "@babel/plugin-transform-modules-commonjs": "^7.7.0", "@babel/plugin-transform-runtime": "^7.6.2", "@babel/preset-env": "^7.7.1", diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index ae758bd3d220..f73c1269fcb8 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -27,6 +27,6 @@ "@babel/preset-env": "^7.7.4", "@babel/runtime": "^7.7.4", "@babel/template": "^7.7.4", - "@babel/types": "7.0.0-beta.53" + "@babel/types": "^7.7.4" } } diff --git a/yarn.lock b/yarn.lock index a75389b0bfc2..0a5995b5d32a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -315,13 +315,13 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-numeric-separator" "^7.2.0" -"@babel/plugin-proposal-object-rest-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.6.2.tgz#8ffccc8f3a6545e9f78988b6bf4fe881b88e8096" - integrity sha512-LDBXlmADCsMZV1Y9OQwMc0MyGZ8Ta/zlD9N67BfQT8uYwkRswiu2hU6nJKrjrt/58aH/vqfQlR/9yId/7A2gWw== +"@babel/plugin-proposal-object-rest-spread@^7.6.2", "@babel/plugin-proposal-object-rest-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" + integrity sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-object-rest-spread" "^7.2.0" + "@babel/plugin-syntax-object-rest-spread" "^7.7.4" "@babel/plugin-proposal-optional-catch-binding@^7.2.0": version "7.2.0" @@ -368,10 +368,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-flow@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" - integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== +"@babel/plugin-syntax-flow@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.7.4.tgz#6d91b59e1a0e4c17f36af2e10dd64ef220919d7b" + integrity sha512-2AMAWl5PsmM5KPkB22cvOkUyWk6MjUaqhHNU5nSPUl/ns3j5qLfw2SuYP5RbVZ0tfLvePr4zUScbICtDP2CUNw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -396,10 +396,10 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" - integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz#47cf220d19d6d0d7b154304701f468fc1cc6ff46" + integrity sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -506,18 +506,18 @@ "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-flow-strip-types@^7.0.0": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.4.tgz#d267a081f49a8705fc9146de0768c6b58dccd8f7" - integrity sha512-WyVedfeEIILYEaWGAUWzVNyqG4sfsNooMhXWsu/YzOvVGcsnPb5PguysjJqI3t3qiaYj0BR8T2f5njdjTGe44Q== +"@babel/plugin-transform-flow-strip-types@^7.0.0", "@babel/plugin-transform-flow-strip-types@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz#cc73f85944782df1d77d80977bc097920a8bf31a" + integrity sha512-w9dRNlHY5ElNimyMYy0oQowvQpwt/PRHI0QS98ZJCTZU2bvSnKXo5zEiD5u76FBPigTm8TkqzmnUTg16T7qbkA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow" "^7.2.0" + "@babel/plugin-syntax-flow" "^7.7.4" -"@babel/plugin-transform-for-of@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz#0267fc735e24c808ba173866c6c4d1440fc3c556" - integrity sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ== +"@babel/plugin-transform-for-of@^7.4.4", "@babel/plugin-transform-for-of@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz#248800e3a5e507b1f103d8b4ca998e77c63932bc" + integrity sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -3357,7 +3357,7 @@ commander@2.17.x: resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== -commander@^2.20.0, commander@^2.8.1, commander@~2.20.3: +commander@^2.20.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -4022,7 +4022,7 @@ domhandler@^2.3.0: dependencies: domelementtype "1" -domutils@1.5.1: +domutils@1.5.1, domutils@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= @@ -4030,14 +4030,6 @@ domutils@1.5.1: dom-serializer "0" domelementtype "1" -domutils@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" - integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== - dependencies: - dom-serializer "0" - domelementtype "1" - dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" @@ -4677,16 +4669,11 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0: +extsprintf@1.3.0, extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - falafel@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" @@ -5781,21 +5768,16 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" @@ -7557,7 +7539,7 @@ minimist-options@^3.0.1: arrify "^1.0.1" is-plain-obj "^1.1.0" -minimist@0.0.8: +minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= @@ -7567,11 +7549,6 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@~0.0.1: - version "0.0.10" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" - integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= - minipass@^2.3.5, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" @@ -7698,16 +7675,11 @@ mute-stdout@^1.0.0: resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== -mute-stream@0.0.7: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -mute-stream@~0.0.4: - version "0.0.8" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" - integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== - mz@^2.5.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -8799,7 +8771,7 @@ pseudomap@^1.0.2: resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= -psl@^1.1.24, psl@^1.1.28: +psl@^1.1.24: version "1.4.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== @@ -8851,7 +8823,7 @@ punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -9031,7 +9003,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", "readable-stream@2 || 3", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -9044,15 +9016,6 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" - integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - "readable-stream@>=1.1.13-1 <1.2.0-0": version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" @@ -9063,6 +9026,15 @@ read@1, read@~1.0.1: isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@^3.0.2, readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" @@ -9384,14 +9356,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: - version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" - integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== - dependencies: - glob "^7.1.3" - -rimraf@2.6.3: +rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -9480,7 +9445,7 @@ rxjs@^6.3.3, rxjs@^6.4.0: dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -10012,25 +9977,18 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" -string_decoder@^1.0.0, string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== +string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== dependencies: - safe-buffer "~5.2.0" + safe-buffer "~5.1.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -10391,15 +10349,7 @@ to-through@^2.0.0: dependencies: through2 "^2.0.3" -tough-cookie@^2.3.3, tough-cookie@^2.3.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tough-cookie@~2.4.3: +tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== @@ -10488,7 +10438,7 @@ typescript@^3.6.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== -uglify-js@3.4.x: +uglify-js@3.4.x, uglify-js@^3.0.5, uglify-js@^3.1.4: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== @@ -10506,14 +10456,6 @@ uglify-js@^2.8.29: optionalDependencies: uglify-to-browserify "~1.0.0" -uglify-js@^3.0.5, uglify-js@^3.1.4: - version "3.6.9" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.6.9.tgz#85d353edb6ddfb62a9d798f36e91792249320611" - integrity sha512-pcnnhaoG6RtrvHJ1dFncAe8Od6Nuy30oaJ82ts6//sGSXOP5UjBMEthiProjXmMNHOfd93sqlkztifFMcb+4yw== - dependencies: - commander "~2.20.3" - source-map "~0.6.1" - uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" @@ -10709,7 +10651,7 @@ util.promisify@^1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util@0.10.3: +util@0.10.3, util@~0.10.1: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= @@ -10723,13 +10665,6 @@ util@^0.11.0: dependencies: inherits "2.0.3" -util@~0.10.1: - version "0.10.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== - dependencies: - inherits "2.0.3" - uuid@^3.0.1, uuid@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" @@ -11034,16 +10969,11 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -wordwrap@0.0.2: +wordwrap@0.0.2, wordwrap@~0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= - wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" From 52f964126d75e5863e3435b65ce3cf943fb59bfb Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 25 Nov 2019 16:14:00 -0500 Subject: [PATCH 830/965] Update babel-eslint-plugin-dev engines (#10761) [ci-skip] --- eslint/babel-eslint-plugin-development/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index d5db3ada858d..609022429995 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -18,7 +18,7 @@ "eslint": "^5.9.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=10.9" }, "publishConfig": { "access": "public" From e81bbd69b35157867c572cbb5f898edc7036fba0 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 25 Nov 2019 16:17:45 -0500 Subject: [PATCH 831/965] Clean up @babel/eslint-parser (#10753) * Ensure compilation works for @babel/eslint-parser * Update with review suggestions * Incorporate feedback :) --- eslint/babel-eslint-parser/README.md | 44 +++++++++--------- eslint/babel-eslint-parser/package.json | 24 +++++----- .../babel-eslint-parser/src/analyze-scope.js | 35 ++++++++------- .../src/babylon-to-espree/convertAST.js | 10 ++--- .../src/babylon-to-espree/convertComments.js | 6 +-- .../babylon-to-espree/convertProgramNode.js | 6 +-- .../babylon-to-espree/convertTemplateType.js | 6 +-- .../src/babylon-to-espree/convertToken.js | 6 +-- .../src/babylon-to-espree/convertTokens.js | 10 ++--- .../src/babylon-to-espree/index.js | 12 +++-- eslint/babel-eslint-parser/src/index.js | 20 ++++----- .../src/parse-with-scope.js | 12 +++-- eslint/babel-eslint-parser/src/parse.js | 16 +++---- .../babel-eslint-parser/src/visitor-keys.js | 8 ++-- ...babel-eslint.js => babel-eslint-parser.js} | 45 +++++++++---------- .../test/helpers/assert-implements-ast.js | 12 +++-- .../babel-eslint-parser/test/integration.js | 35 +++++++-------- .../test/non-regression.js | 11 ++--- 18 files changed, 140 insertions(+), 178 deletions(-) rename eslint/babel-eslint-parser/test/{babel-eslint.js => babel-eslint-parser.js} (92%) diff --git a/eslint/babel-eslint-parser/README.md b/eslint/babel-eslint-parser/README.md index cc7fd8f5141c..5d27fc7211eb 100644 --- a/eslint/babel-eslint-parser/README.md +++ b/eslint/babel-eslint-parser/README.md @@ -1,17 +1,13 @@ -# babel-eslint [![npm](https://img.shields.io/npm/v/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) [![travis](https://img.shields.io/travis/babel/babel-eslint/master.svg)](https://travis-ci.org/babel/babel-eslint) [![npm-downloads](https://img.shields.io/npm/dm/babel-eslint.svg)](https://www.npmjs.com/package/babel-eslint) +# @babel/eslint-parser [![npm](https://img.shields.io/npm/v/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) [![travis](https://img.shields.io/travis/babel/@babel/eslint-parser/master.svg)](https://travis-ci.org/babel/@babel/eslint-parser) [![npm-downloads](https://img.shields.io/npm/dm/@babel/eslint-parser.svg)](https://www.npmjs.com/package/@babel/eslint-parser) -**babel-eslint** allows you to lint **ALL** valid Babel code with the fantastic +**@babel/eslint-parser** allows you to lint **ALL** valid Babel code with the fantastic [ESLint](https://github.com/eslint/eslint). -## Breaking change in v11.x.x +## When should I use @babel/eslint-parser? -As of the v11.x.x release, babel-eslint now requires Babel as a peer dependency and expects a valid [Babel configuration file](https://babeljs.io/docs/en/configuration) to exist. This ensures that the same Babel configuration is used during both linting and compilation. +ESLint's default parser and core rules [only support the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. @babel/eslint-parser is a parser that allows ESLint to run on source code that is transformed by Babel. -## When should I use babel-eslint? - -ESLint's default parser and core rules [only support the latest final ECMAScript standard](https://github.com/eslint/eslint/blob/a675c89573836adaf108a932696b061946abf1e6/README.md#what-about-experimental-features) and do not support experimental (such as new features) and non-standard (such as Flow or TypeScript types) syntax provided by Babel. babel-eslint is a parser that allows ESLint to run on source code that is transformed by Babel. - -**Note:** You only need to use babel-eslint if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). +**Note:** You only need to use @babel/parser-eslint if you are using Babel to transform your code. If this is not the case, please use the relevant parser for your chosen flavor of ECMAScript (note that the default parser supports all non-experimental syntax as well as JSX). ## How does it work? @@ -19,51 +15,51 @@ ESLint allows for the use of [custom parsers](https://eslint.org/docs/developer- transformed into an [ESTree](https://github.com/estree/estree)-compliant structure that ESLint can understand. All location info such as line numbers, columns is also retained so you can track down errors with ease. -**Note:** ESLint's core rules do not support experimental syntax and may therefore not work as expected when using babel-eslint. Please use the companion [`eslint-plugin-babel`](https://github.com/babel/eslint-plugin-babel) plugin for core rules that you have issues with. +**Note:** ESLint's core rules do not support experimental syntax and may therefore not work as expected when using `@babel/eslint-parser`. Please use the companion [`@babel/eslint-plugin`](https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin) plugin for core rules that you have issues with. ## Usage ### Installation ```sh -$ npm install eslint babel-eslint --save-dev +$ npm install eslint @babel/core @babel/eslint-parser --save-dev # or -$ yarn add eslint babel-eslint -D +$ yarn add eslint @babel/core @babel/eslint-parser -D ``` -**Note:** babel-eslint requires `babel/core@>=7.2.0` and a valid Babel configuration file to run. If you do not have this already set up, please see the [Babel Usage Guide](https://babeljs.io/docs/en/usage). +**Note:** @babel/eslint-parser requires `@babel/core@>=7.2.0` and a valid Babel configuration file to run. If you do not have this already set up, please see the [Babel Usage Guide](https://babeljs.io/docs/en/usage). ### Setup -To use babel-eslint, `"babel-eslint"` must be specified as the `parser` in your ESLint configuration file (see [here](https://eslint.org/docs/user-guide/configuring#specifying-parser) for more detailed information). +To use @babel/eslint-parser, `"@babel/eslint-parser"` must be specified as the `parser` in your ESLint configuration file (see [here](https://eslint.org/docs/user-guide/configuring#specifying-parser) for more detailed information). **.eslintrc.js** ```js module.exports = { - parser: "babel-eslint", + parser: "@babel/eslint-parser", }; ``` With the parser set, your configuration can be configured as described in the [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) documentation. -**Note:** The `parserOptions` described in the [official documentation](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) are for the default parser and are not necessarily supported by babel-eslint. Please see the section directly below for supported `parserOptions`. +**Note:** The `parserOptions` described in the [official documentation](https://eslint.org/docs/user-guide/configuring#specifying-parser-options) are for the default parser and are not necessarily supported by @babel/eslint-parser. Please see the section directly below for supported `parserOptions`. ### Additional parser configuration Additional configuration options can be set in your ESLint configuration under the `parserOptions` key. Please note that the `ecmaFeatures` config property may still be required for ESLint to work properly with features not in ECMAScript 5 by default. -- `requireConfigFile` (default `true`) can be set to `false` to allow babel-eslint to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files), though we recommend using the default parser via [glob-based configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns). Note: babel-eslint will not parse any experimental syntax when no configuration file is found. +- `requireConfigFile` (default `true`) can be set to `false` to allow @babel/eslint-parser to run on files that do not have a Babel configuration associated with them. This can be useful for linting files that are not transformed by Babel (such as tooling configuration files), though we recommend using the default parser via [glob-based configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns). Note: @babel/eslint-parser will not parse any experimental syntax when no configuration file is found. - `sourceType` can be set to `"module"`(default) or `"script"` if your code isn't using ECMAScript modules. - `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. - `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. -- `babelOptions` passes through Babel's configuration [loading](https://babeljs.io/docs/en/options#config-loading-options) and [merging](https://babeljs.io/docs/en/options#config-merging-options) options (for instance, in case of a monorepo). When not defined, babel-eslint will use Babel's default configuration file resolution logic. +- `babelOptions` passes through Babel's configuration [loading](https://babeljs.io/docs/en/options#config-loading-options) and [merging](https://babeljs.io/docs/en/options#config-merging-options) options (for instance, in case of a monorepo). When not defined, @babel/eslint-parser will use Babel's default configuration file resolution logic. **.eslintrc.js** ```js module.exports = { - parser: "babel-eslint", + parser: "@babel/eslint-parser", parserOptions: { sourceType: "module", allowImportExportEverywhere: false, @@ -89,7 +85,7 @@ module.exports = { overrides: [ { files: ["files/transformed/by/babel/*.js"], - parser: "babel-eslint", + parser: "@babel/eslint-parser", } ] }; @@ -107,13 +103,13 @@ Flow: > Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`. -- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076) +- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/@babel/eslint-parser/issues/130#issuecomment-111215076) - Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'` -- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926) +- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/@babel/eslint-parser/issues/132#issuecomment-112815926) Modules/strict mode -- `no-unused-vars: ["error", { vars: local }]` [#136](https://github.com/babel/babel-eslint/issues/136) +- `no-unused-vars: ["error", { vars: local }]` [#136](https://github.com/babel/@babel/eslint-parser/issues/136) Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues. @@ -123,6 +119,6 @@ Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-ba ## Questions and support -If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of `eslint` and `babel-eslint`. If it is not reproducible with the default parser, it is most likely an issue with babel-eslint. +If you have an issue, please first check if it can be reproduced with the default parser and with the latest versions of `eslint` and `@babel/eslint-parser`. If it is not reproducible with the default parser, it is most likely an issue with `@babel/eslint-parser`. For questions and support please visit the [`#discussion`](https://babeljs.slack.com/messages/discussion/) Babel Slack channel (sign up [here](https://github.com/babel/notes/issues/38)) or the ESLint [Gitter](https://gitter.im/eslint/eslint). diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 1da21995f97d..e24970d36b8c 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -1,32 +1,30 @@ { - "name": "babel-eslint", - "version": "11.0.0-beta.1", - "description": "Custom parser for ESLint", + "name": "@babel/eslint-parser", + "version": "0.0.0", + "description": "ESLint parser that allows for linting of experimental syntax transformed by Babel", "author": "Sebastian McKenzie ", "license": "MIT", "private": true, "repository": { "type": "git", - "url": "https://github.com/babel/babel-eslint.git" + "url": "https://github.com/babel/babel.git", + "directory": "eslint/babel-eslint-parser" }, "bugs": { - "url": "https://github.com/babel/babel-eslint/issues" - }, - "homepage": "https://github.com/babel/babel-eslint", - "scripts": { - "changelog": "git log `git describe --tags --abbrev=0`..HEAD --pretty=format:' * %s (%an)' | grep -v 'Merge pull request'" + "url": "https://github.com/babel/babel/issues" }, + "homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-parser", "engines": { - "node": ">=6" + "node": ">=10.9" }, "main": "lib/index.js", "peerDependencies": { "@babel/core": ">=7.2.0", - "eslint": ">= 4.12.1" + "eslint": ">= 6.0.0" }, "dependencies": { - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "^1.0.0", + "eslint-scope": "5.0.0", + "eslint-visitor-keys": "^1.1.0", "semver": "^6.3.0" }, "devDependencies": { diff --git a/eslint/babel-eslint-parser/src/analyze-scope.js b/eslint/babel-eslint-parser/src/analyze-scope.js index a388a45366fa..24a1b5491c12 100644 --- a/eslint/babel-eslint-parser/src/analyze-scope.js +++ b/eslint/babel-eslint-parser/src/analyze-scope.js @@ -1,12 +1,10 @@ -"use strict"; - -const t = require("@babel/core").types; -const escope = require("eslint-scope"); -const Definition = require("eslint-scope/lib/definition").Definition; -const OriginalPatternVisitor = require("eslint-scope/lib/pattern-visitor"); -const OriginalReferencer = require("eslint-scope/lib/referencer"); -const fallback = require("eslint-visitor-keys").getKeys; -const childVisitorKeys = require("./visitor-keys"); +import { types as t } from "@babel/core"; +import escope from "eslint-scope"; +import { Definition } from "eslint-scope/lib/definition"; +import OriginalPatternVisitor from "eslint-scope/lib/pattern-visitor"; +import OriginalReferencer from "eslint-scope/lib/referencer"; +import { getKeys as fallback } from "eslint-visitor-keys"; +import childVisitorKeys from "./visitor-keys"; const flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ "ArrayPattern", @@ -18,13 +16,16 @@ const flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ "ObjectPattern", "RestElement", ]); -const visitorKeysMap = Object.keys(t.VISITOR_KEYS).reduce(function(acc, key) { - const value = t.VISITOR_KEYS[key]; +const visitorKeysMap = Object.entries(t.VISITOR_KEYS).reduce(function( + acc, + [key, value], +) { if (flowFlippedAliasKeys.indexOf(value) === -1) { acc[key] = value; } return acc; -}, {}); +}, +{}); const propertyTypes = { // loops @@ -124,7 +125,7 @@ class Referencer extends OriginalReferencer { // inherits. visitProperty(node) { - if (node.value && node.value.type === "TypeCastExpression") { + if (node.value?.type === "TypeCastExpression") { this._visitTypeAnnotation(node.value); } this._visitArray(node.decorators); @@ -294,9 +295,9 @@ class Referencer extends OriginalReferencer { } _checkIdentifierOrVisit(node) { - if (node && node.typeAnnotation) { + if (node?.typeAnnotation) { this._visitTypeAnnotation(node.typeAnnotation); - } else if (node && node.type === "Identifier") { + } else if (node?.type === "Identifier") { this.visit(node); } else { this._visitTypeAnnotation(node); @@ -312,7 +313,7 @@ class Referencer extends OriginalReferencer { } } -module.exports = function(ast, parserOptions) { +export default function(ast, parserOptions) { const options = { ignoreEval: true, optimistic: false, @@ -335,4 +336,4 @@ module.exports = function(ast, parserOptions) { referencer.visit(ast); return scopeManager; -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js index 9f2fb000b920..4acce5fb5036 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js @@ -1,7 +1,5 @@ -"use strict"; - -const t = require("@babel/core").types; -const convertProgramNode = require("./convertProgramNode"); +import { types as t } from "@babel/core"; +import convertProgramNode from "./convertProgramNode"; module.exports = function(ast, traverse, code) { const state = { source: code }; @@ -79,8 +77,8 @@ const astTransformVisitor = { // template string range fixes if (path.isTemplateLiteral()) { - for (let j = 0; j < node.quasis.length; j++) { - const q = node.quasis[j]; + for (let i = 0; i < node.quasis.length; i++) { + const q = node.quasis[i]; q.range[0] -= 1; if (q.tail) { q.range[1] += 1; diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js index 57b0e44d4d54..b52ec9ff5a48 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertComments.js @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = function(comments) { +export default function(comments) { for (let i = 0; i < comments.length; i++) { const comment = comments[i]; if (comment.type === "CommentBlock") { @@ -14,4 +12,4 @@ module.exports = function(comments) { comment.range = [comment.start, comment.end]; } } -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js index 810b19888213..a435487cb6a9 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertProgramNode.js @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = function(ast) { +export default function(ast) { ast.type = "Program"; ast.sourceType = ast.program.sourceType; ast.directives = ast.program.directives; @@ -37,4 +35,4 @@ module.exports = function(ast) { ast.loc.start.line = ast.body[0].loc.start.line; ast.range[0] = ast.body[0].start; } -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js index accde61e56d6..d918417d8038 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = function(tokens, tt) { +export default function(tokens, tt) { let curlyBrace = null; let templateTokens = []; const result = []; @@ -89,4 +87,4 @@ module.exports = function(tokens, tt) { }); return result; -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js index 2d8e9b1aac34..46a8656dd0e1 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js @@ -1,6 +1,4 @@ -"use strict"; - -module.exports = function(token, tt, source) { +export default function(token, tt, source) { const type = token.type; token.range = [token.start, token.end]; @@ -82,4 +80,4 @@ module.exports = function(token, tt, source) { } return token; -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js index 0f49d9373089..41978339a78c 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js @@ -1,10 +1,8 @@ -"use strict"; +import convertTemplateType from "./convertTemplateType"; +import convertToken from "./convertToken"; -const convertTemplateType = require("./convertTemplateType"); -const convertToken = require("./convertToken"); - -module.exports = function(tokens, tt, code) { +export default function(tokens, tt, code) { return convertTemplateType(tokens, tt) .filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock") .map(t => convertToken(t, tt, code)); -}; +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/index.js b/eslint/babel-eslint-parser/src/babylon-to-espree/index.js index cc4dda974358..7112aa8f24ff 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/index.js @@ -1,11 +1,9 @@ -"use strict"; +import convertTokens from "./convertTokens"; +import convertComments from "./convertComments"; +import convertAST from "./convertAST"; -const convertTokens = require("./convertTokens"); -const convertComments = require("./convertComments"); -const convertAST = require("./convertAST"); - -module.exports = function(ast, traverse, tt, code) { +export default function(ast, traverse, tt, code) { ast.tokens = convertTokens(ast.tokens, tt, code); convertComments(ast.comments); convertAST(ast, traverse, code); -}; +} diff --git a/eslint/babel-eslint-parser/src/index.js b/eslint/babel-eslint-parser/src/index.js index c5c597017eb7..cbb9f65abd71 100644 --- a/eslint/babel-eslint-parser/src/index.js +++ b/eslint/babel-eslint-parser/src/index.js @@ -1,10 +1,8 @@ -"use strict"; +import semver from "semver"; +import { version as CURRENT_BABEL_VERSION } from "@babel/core"; +import parseWithScope from "./parse-with-scope"; +import packageJson from "../package.json"; -const semver = require("semver"); -const babelCore = require("@babel/core"); -const packageJson = require("../package.json"); - -const CURRENT_BABEL_VERSION = babelCore.version; const SUPPORTED_BABEL_VERSION_RANGE = packageJson.peerDependencies["@babel/core"]; const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies( @@ -12,11 +10,11 @@ const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies( SUPPORTED_BABEL_VERSION_RANGE, ); -exports.parse = function(code, options) { +export function parse(code, options) { return exports.parseForESLint(code, options).ast; -}; +} -exports.parseForESLint = function(code, options = {}) { +export function parseForESLint(code, options = {}) { if (!IS_RUNNING_SUPPORTED_VERSION) { throw new Error( `babel-eslint@${packageJson.version} does not support @babel/core@${CURRENT_BABEL_VERSION}. Please downgrade to babel-eslint@^10 or upgrade to @babel/core@${SUPPORTED_BABEL_VERSION_RANGE}`, @@ -29,5 +27,5 @@ exports.parseForESLint = function(code, options = {}) { options.allowImportExportEverywhere = options.allowImportExportEverywhere || false; - return require("./parse-with-scope")(code, options); -}; + return parseWithScope(code, options); +} diff --git a/eslint/babel-eslint-parser/src/parse-with-scope.js b/eslint/babel-eslint-parser/src/parse-with-scope.js index 36e3fce5b067..17516f5724d7 100644 --- a/eslint/babel-eslint-parser/src/parse-with-scope.js +++ b/eslint/babel-eslint-parser/src/parse-with-scope.js @@ -1,12 +1,10 @@ -"use strict"; +import visitorKeys from "./visitor-keys"; +import analyzeScope from "./analyze-scope"; +import parse from "./parse"; -const visitorKeys = require("./visitor-keys"); -const analyzeScope = require("./analyze-scope"); -const parse = require("./parse"); - -module.exports = function(code, options) { +export default function(code, options) { const ast = parse(code, options); const scopeManager = analyzeScope(ast, options); return { ast, scopeManager, visitorKeys }; -}; +} diff --git a/eslint/babel-eslint-parser/src/parse.js b/eslint/babel-eslint-parser/src/parse.js index 5ae4db7e30ec..9c0a9a61d199 100644 --- a/eslint/babel-eslint-parser/src/parse.js +++ b/eslint/babel-eslint-parser/src/parse.js @@ -1,14 +1,12 @@ -"use strict"; - -const babylonToEspree = require("./babylon-to-espree"); -const { - parseSync: parse, - tokTypes: tt, +import babylonToEspree from "./babylon-to-espree"; +import { + parseSync as parse, + tokTypes as tt, traverse, loadPartialConfig, -} = require("@babel/core"); +} from "@babel/core"; -module.exports = function(code, options) { +export default function(code, options) { let opts = { sourceType: options.sourceType, filename: options.filePath, @@ -70,4 +68,4 @@ module.exports = function(code, options) { babylonToEspree(ast, traverse, tt, code); return ast; -}; +} diff --git a/eslint/babel-eslint-parser/src/visitor-keys.js b/eslint/babel-eslint-parser/src/visitor-keys.js index 236cf0a782e9..6676a86602e3 100644 --- a/eslint/babel-eslint-parser/src/visitor-keys.js +++ b/eslint/babel-eslint-parser/src/visitor-keys.js @@ -1,9 +1,9 @@ -"use strict"; +import { types as t } from "@babel/core"; +import { KEYS as ESLINT_VISITOR_KEYS } from "eslint-visitor-keys"; -const BABEL_VISITOR_KEYS = require("@babel/core").types.VISITOR_KEYS; -const ESLINT_VISITOR_KEYS = require("eslint-visitor-keys").KEYS; +const { VISITOR_KEYS: BABEL_VISITOR_KEYS } = t; -module.exports = Object.assign( +export default Object.assign( { Literal: ESLINT_VISITOR_KEYS.Literal, MethodDefinition: ["decorators"].concat( diff --git a/eslint/babel-eslint-parser/test/babel-eslint.js b/eslint/babel-eslint-parser/test/babel-eslint-parser.js similarity index 92% rename from eslint/babel-eslint-parser/test/babel-eslint.js rename to eslint/babel-eslint-parser/test/babel-eslint-parser.js index 6d812e4c5499..37f15c03d310 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint.js +++ b/eslint/babel-eslint-parser/test/babel-eslint-parser.js @@ -1,19 +1,14 @@ -"use strict"; - -const assert = require("assert"); -const path = require("path"); -const babelEslint = require("../"); -const espree = require("espree"); -const escope = require("eslint-scope"); -const unpad = require("dedent"); -const assertImplementsAST = require("./helpers/assert-implements-ast"); +import assert from "assert"; +import path from "path"; +import espree from "espree"; +import escope from "eslint-scope"; +import unpad from "dedent"; +import { parseForESLint } from "../src"; +import assertImplementsAST from "./helpers/assert-implements-ast"; const babelOptions = { - configFile: path.resolve( - __dirname, - "./fixtures/config/babel.config.js" - ), -} + configFile: path.resolve(__dirname, "./fixtures/config/babel.config.js"), +}; function parseAndAssertSame(code) { code = unpad(code); @@ -35,7 +30,7 @@ function parseAndAssertSame(code) { ecmaVersion: 2018, sourceType: "module", }); - const babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, babelOptions, @@ -46,14 +41,14 @@ function parseAndAssertSame(code) { describe("babylon-to-espree", () => { describe("compatibility", () => { it("should allow ast.analyze to be called without options", function() { - const esAST = babelEslint.parseForESLint("`test`", { + const esAST = parseForESLint("`test`", { eslintScopeManager: true, eslintVisitorKeys: true, babelOptions, }).ast; expect(() => { - escope.analyze(esAST) - }).not.toThrow(new TypeError('Should allow no options argument.')); + escope.analyze(esAST); + }).not.toThrow(new TypeError("Should allow no options argument.")); }); }); @@ -100,13 +95,13 @@ describe("babylon-to-espree", () => { it("template with nested function/object", () => { parseAndAssertSame( - "`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`" + "`outer${{x: {y: 10}}}bar${`nested${function(){return 1;}}endnest`}end`", ); }); it("template with braces inside and outside of template string #96", () => { parseAndAssertSame( - "if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }" + "if (a) { var target = `{}a:${webpackPort}{}}}}`; } else { app.use(); }", ); }); @@ -245,7 +240,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the optional chaining operator yet it("optional chaining operator (token)", () => { const code = "foo?.bar"; - const babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, babelOptions, @@ -256,7 +251,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the nullish coalescing operator yet it("nullish coalescing operator (token)", () => { const code = "foo ?? bar"; - const babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, babelOptions, @@ -267,7 +262,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the pipeline operator yet it("pipeline operator (token)", () => { const code = "foo |> bar"; - const babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, babelOptions, @@ -278,7 +273,7 @@ describe("babylon-to-espree", () => { // Espree doesn't support the private fields yet it("hash (token)", () => { const code = "class A { #x }"; - const babylonAST = babelEslint.parseForESLint(code, { + const babylonAST = parseForESLint(code, { eslintVisitorKeys: true, eslintScopeManager: true, babelOptions, @@ -398,7 +393,7 @@ describe("babylon-to-espree", () => { it("MethodDefinition 2", () => { parseAndAssertSame( - "export default class Bar { get bar() { return 42; }}" + "export default class Bar { get bar() { return 42; }}", ); }); diff --git a/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js index 84e370f48ed2..3c435940a4cf 100644 --- a/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js +++ b/eslint/babel-eslint-parser/test/helpers/assert-implements-ast.js @@ -1,7 +1,5 @@ -"use strict"; - // Checks if the source ast implements the target ast. Ignores extra keys on source ast -module.exports = function assertImplementsAST(target, source, path) { +export default function assertImplementsAST(target, source, path) { if (!path) { path = []; } @@ -16,7 +14,7 @@ module.exports = function assertImplementsAST(target, source, path) { const typeB = source === null ? "null" : typeof source; if (typeA !== typeB) { error( - `have different types (${typeA} !== ${typeB}) (${target} !== ${source})` + `have different types (${typeA} !== ${typeB}) (${target} !== ${source})`, ); } else if ( typeA === "object" && @@ -24,7 +22,7 @@ module.exports = function assertImplementsAST(target, source, path) { target.constructor.name !== source.constructor.name ) { error( - `object have different constructors (${target.constructor.name} !== ${source.constructor.name}` + `object have different constructors (${target.constructor.name} !== ${source.constructor.name}`, ); } else if (typeA === "object") { const keysTarget = Object.keys(target); @@ -36,7 +34,7 @@ module.exports = function assertImplementsAST(target, source, path) { } } else if (target !== source) { error( - `are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})` + `are different (${JSON.stringify(target)} !== ${JSON.stringify(source)})`, ); } -}; +} diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index 8503bd582607..ecad41bdd0b7 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -1,10 +1,7 @@ -"use strict"; - -const eslint = require("eslint"); -const fs = require("fs"); -const path = require("path"); - -const parser = require("../"); +import eslint from "eslint"; +import fs from "fs"; +import path from "path"; +import * as parser from "../src"; eslint.linter.defineParser("current-babel-eslint", parser); @@ -72,7 +69,7 @@ function strictSuite() { if (err) return done(err); expect(report[0].ruleId).toBe(ruleId); done(); - } + }, ); }); // it @@ -96,7 +93,7 @@ function strictSuite() { if (err) return done(err); expect(report.length).toBe(0); done(); - } + }, ); }); // it @@ -113,7 +110,7 @@ function strictSuite() { expect(report[0].ruleId).toBe(ruleId); }); done(); - } + }, ); }); // it @@ -133,7 +130,7 @@ function strictSuite() { // result of the previous assertion. expect(report[0].nodeType).not.toBe("Program"); done(); - } + }, ); }); // it @@ -148,7 +145,7 @@ function strictSuite() { if (err) return done(err); expect(report[0].ruleId).toBe(ruleId); done(); - } + }, ); }); // it @@ -171,7 +168,7 @@ function strictSuite() { if (err) return done(err); expect(report.length).toBe(0); done(); - } + }, ); }); // it @@ -188,7 +185,7 @@ function strictSuite() { expect(report[i].ruleId).toBe(ruleId); }); done(); - } + }, ); }); // it @@ -203,7 +200,7 @@ function strictSuite() { if (err) return done(err); expect(report[0].ruleId).toBe(ruleId); done(); - } + }, ); }); // it @@ -219,7 +216,7 @@ function strictSuite() { expect(report[0].ruleId).toBe(ruleId); expect(report[0].nodeType.indexOf("Function")).toBe(-1); done(); - } + }, ); }); // it @@ -229,10 +226,10 @@ function strictSuite() { describe("https://github.com/babel/babel-eslint/issues/558", () => { it("doesn't crash with eslint-plugin-import", () => { const engine = new eslint.CLIEngine({ ignore: false }); - const files = ['a.js', 'b.js', 'c.js']; + const files = ["a.js", "b.js", "c.js"]; let fileWithPath = files.map(file => - path.resolve(__dirname, `./fixtures/eslint-plugin-import/${file}`)); + path.resolve(__dirname, `./fixtures/eslint-plugin-import/${file}`), + ); engine.executeOnFiles(fileWithPath); }); }); - diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 857c30d05dc7..b1feb30eabb7 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1,10 +1,7 @@ -"use strict"; - -const eslint = require("eslint"); -const path = require("path"); -const unpad = require("dedent"); - -const parser = require("../"); +import eslint from "eslint"; +import path from "path"; +import unpad from "dedent"; +import * as parser from "../src"; function verifyAndAssertMessagesWithSpecificESLint( code, From 7f732ad0198004a1d31543ddd848e6edc646e771 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 25 Nov 2019 17:15:34 -0500 Subject: [PATCH 832/965] Clean up @babel/eslint-plugin (#10756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Clean up @babel/eslint-plugin * Add directory field to package.json * Update eslint/babel-eslint-plugin/README.md Co-Authored-By: Huáng Jùnliàng * Incorporate feedback :) --- eslint/babel-eslint-plugin/README.md | 32 ++++---- eslint/babel-eslint-plugin/package.json | 15 ++-- eslint/babel-eslint-plugin/src/index.js | 76 +++++++++++-------- .../src/rules/array-bracket-spacing.js | 9 +-- .../src/rules/arrow-parens.js | 9 +-- .../src/rules/camelcase.js | 2 +- .../src/rules/flow-object-type.js | 11 ++- .../src/rules/func-params-comma-dangle.js | 9 +-- .../src/rules/generator-star-spacing.js | 9 +-- .../babel-eslint-plugin/src/rules/new-cap.js | 7 +- .../src/rules/no-await-in-loop.js | 9 +-- .../src/rules/no-invalid-this.js | 7 +- .../src/rules/no-unused-expressions.js | 7 +- .../src/rules/object-curly-spacing.js | 7 +- .../src/rules/object-shorthand.js | 9 +-- .../babel-eslint-plugin/src/rules/quotes.js | 7 +- eslint/babel-eslint-plugin/src/rules/semi.js | 7 +- .../src/rules/valid-typeof.js | 7 +- .../test/rules/camelcase.js | 6 +- .../babel-eslint-plugin/test/rules/new-cap.js | 6 +- .../test/rules/no-invalid-this.js | 8 +- .../test/rules/no-unused-expressions.js | 6 +- .../test/rules/object-curly-spacing.js | 6 +- .../babel-eslint-plugin/test/rules/quotes.js | 6 +- eslint/babel-eslint-plugin/test/rules/semi.js | 6 +- .../test/rules/valid-typeof.js | 6 +- 26 files changed, 139 insertions(+), 150 deletions(-) diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index fba35aa4dc3f..1ea757adac1e 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,24 +1,22 @@ -# eslint-plugin-babel +# @babel/eslint-plugin -An `eslint` plugin companion to `babel-eslint`. `babel-eslint` does a great job at adapting `eslint` +Companion rules for `@babel/eslint-parser`. `@babel/eslint-parser` does a great job at adapting `eslint` for use with Babel, but it can't change the built in rules to support experimental features. -`eslint-plugin-babel` re-implements problematic rules so they do not give false positives or negatives. +`@babel/eslint-plugin` re-implements problematic rules so they do not give false positives or negatives. -> Requires Node 4 or greater +> Requires Node 10.9 or greater ### Install ```sh -npm install eslint-plugin-babel --save-dev +npm install @babel/eslint-plugin --save-dev ``` -Load the plugin in your `.eslintrc` file: +Load the plugin in your `.eslintrc.json` file: ```json { - "plugins": [ - "babel" - ] + "plugins": ["@babel/eslint-plugin"] } ``` @@ -28,14 +26,14 @@ original ones as well!). ```json { "rules": { - "babel/new-cap": 1, - "babel/camelcase": 1, - "babel/no-invalid-this": 1, - "babel/object-curly-spacing": 1, - "babel/quotes": 1, - "babel/semi": 1, - "babel/no-unused-expressions": 1, - "babel/valid-typeof": 1 + "babel/new-cap": "error", + "babel/camelcase": "error", + "babel/no-invalid-this": "error", + "babel/object-curly-spacing": "error", + "babel/quotes": "error", + "babel/semi": "error", + "babel/no-unused-expressions": "error", + "babel/valid-typeof": "error" } } ``` diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 653ebcaf4387..442670ee8ccb 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -1,11 +1,12 @@ { - "name": "eslint-plugin-babel", - "version": "5.3.0", - "description": "an eslint rule plugin companion to babel-eslint", + "name": "@babel/eslint-plugin", + "version": "0.0.0", + "description": "Companion rules for @babel/eslint-parser", "main": "lib/index.js", "repository": { "type": "git", - "url": "git+https://github.com/babel/eslint-plugin-babel.git" + "url": "git+https://github.com/babel/babel.git", + "directory": "eslint/babel-eslint-plugin" }, "keywords": [ "babel", @@ -18,12 +19,12 @@ "license": "MIT", "private": true, "engines": { - "node": ">=4" + "node": ">=10.9" }, "bugs": { - "url": "https://github.com/babel/eslint-plugin-babel/issues" + "url": "https://github.com/babel/babel/issues" }, - "homepage": "https://github.com/babel/eslint-plugin-babel#readme", + "homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin", "peerDependencies": { "eslint": ">=4.0.0" }, diff --git a/eslint/babel-eslint-plugin/src/index.js b/eslint/babel-eslint-plugin/src/index.js index eda05b28c808..2e8a37bad182 100644 --- a/eslint/babel-eslint-plugin/src/index.js +++ b/eslint/babel-eslint-plugin/src/index.js @@ -1,38 +1,52 @@ -"use strict"; +import arrayBracketSpacing from "./rules/array-bracket-spacing"; +import arrowParens from "./rules/arrow-parens"; +import flowObjectType from "./rules/flow-object-type"; +import funcParamsCommaDangle from "./rules/func-params-comma-dangle"; +import generatorStarSpacing from "./rules/generator-star-spacing"; +import newCap from "./rules/new-cap"; +import camelcase from "./rules/camelcase"; +import noAwaitInLoop from "./rules/no-await-in-loop"; +import noInvalidThis from "./rules/no-invalid-this"; +import noUnusedExpressions from "./rules/no-unused-expressions"; +import objectCurlySpacing from "./rules/object-curly-spacing"; +import objectShorthand from "./rules/object-shorthand"; +import quotes from "./rules/quotes"; +import semi from "./rules/semi"; +import validTypeof from "./rules/valid-typeof"; module.exports = { rules: { - "array-bracket-spacing": require("./rules/array-bracket-spacing"), - "arrow-parens": require("./rules/arrow-parens"), - "flow-object-type": require("./rules/flow-object-type"), - "func-params-comma-dangle": require("./rules/func-params-comma-dangle"), - "generator-star-spacing": require("./rules/generator-star-spacing"), - "new-cap": require("./rules/new-cap"), - camelcase: require("./rules/camelcase"), - "no-await-in-loop": require("./rules/no-await-in-loop"), - "no-invalid-this": require("./rules/no-invalid-this"), - "no-unused-expressions": require("./rules/no-unused-expressions"), - "object-curly-spacing": require("./rules/object-curly-spacing"), - "object-shorthand": require("./rules/object-shorthand"), - quotes: require("./rules/quotes"), - semi: require("./rules/semi"), - "valid-typeof": require("./rules/valid-typeof"), + "array-bracket-spacing": arrayBracketSpacing, + "arrow-parens": arrowParens, + "flow-object-type": flowObjectType, + "func-params-comma-dangle": funcParamsCommaDangle, + "generator-star-spacing": generatorStarSpacing, + "new-cap": newCap, + camelcase, + "no-await-in-loop": noAwaitInLoop, + "no-invalid-this": noInvalidThis, + "no-unused-expressions": noUnusedExpressions, + "object-curly-spacing": objectCurlySpacing, + "object-shorthand": objectShorthand, + quotes, + semi, + "valid-typeof": validTypeof, }, rulesConfig: { - "array-bracket-spacing": 0, - "arrow-parens": 0, - camelcase: 0, - "flow-object-type": 0, - "func-params-comma-dangle": 0, - "generator-star-spacing": 0, - "new-cap": 0, - "no-await-in-loop": 0, - "no-invalid-this": 0, - "no-unused-expressions": 0, - "object-curly-spacing": 0, - "object-shorthand": 0, - quotes: 0, - semi: 0, - "valid-typeof": 0, + "array-bracket-spacing": "off", + "arrow-parens": "off", + camelcase: "off", + "flow-object-type": "off", + "func-params-comma-dangle": "off", + "generator-star-spacing": "off", + "new-cap": "off", + "no-await-in-loop": "off", + "no-invalid-this": "off", + "no-unused-expressions": "off", + "object-curly-spacing": "off", + "object-shorthand": "off", + quotes: "off", + semi: "off", + "valid-typeof": "off", }, }; diff --git a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js index 59228c20784d..b071db8ec8ad 100644 --- a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -25,9 +24,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js index cdd25819311f..c5ac81a29045 100644 --- a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js +++ b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -10,9 +9,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/camelcase.js b/eslint/babel-eslint-plugin/src/rules/camelcase.js index 6528b4a7f423..84e1605c5ff4 100644 --- a/eslint/babel-eslint-plugin/src/rules/camelcase.js +++ b/eslint/babel-eslint-plugin/src/rules/camelcase.js @@ -9,7 +9,7 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = { +export default { meta: { docs: { description: "enforce camelcase naming convention", diff --git a/eslint/babel-eslint-plugin/src/rules/flow-object-type.js b/eslint/babel-eslint-plugin/src/rules/flow-object-type.js index 4e45f8328b03..2834b19f11c1 100644 --- a/eslint/babel-eslint-plugin/src/rules/flow-object-type.js +++ b/eslint/babel-eslint-plugin/src/rules/flow-object-type.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -10,9 +9,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) @@ -24,7 +23,7 @@ module.exports = { "The babel/flow-object-type rule is deprecated. Please " + "use the flowtype/object-type-delimiter rule instead.\n" + // eslint-disable-next-line - "Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter" + "Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter", ); isWarnedForDeprecation = true; diff --git a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js index d50427103407..00d8006f85e6 100644 --- a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js +++ b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -10,9 +9,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js index 8d65262b5763..108c29951326 100644 --- a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -22,9 +21,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/new-cap.js b/eslint/babel-eslint-plugin/src/rules/new-cap.js index 17d40497550d..9e8320c0e76f 100644 --- a/eslint/babel-eslint-plugin/src/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/src/rules/new-cap.js @@ -1,7 +1,6 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const newCapRule = new eslint.Linter().getRules().get("new-cap"); /** @@ -13,7 +12,7 @@ function isDecorator(node) { return node.parent.type === "Decorator"; } -module.exports = ruleComposer.filterReports( +export default ruleComposer.filterReports( newCapRule, problem => !isDecorator(problem.node), ); diff --git a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js index cf984f09b34e..05470be35bca 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js +++ b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js @@ -1,14 +1,13 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/src/rules/no-invalid-this.js index 101ec655a6d8..4c6434235c2a 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/src/rules/no-invalid-this.js @@ -1,10 +1,9 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const noInvalidThisRule = new eslint.Linter().getRules().get("no-invalid-this"); -module.exports = ruleComposer.filterReports(noInvalidThisRule, problem => { +export default ruleComposer.filterReports(noInvalidThisRule, problem => { let inClassProperty = false; let node = problem.node; diff --git a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js index 6bc1db49d9ac..de72047dd00b 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js @@ -1,7 +1,6 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const rule = new eslint.Linter().getRules().get("no-unused-expressions"); /** @@ -57,7 +56,7 @@ function isOptionalCallExpression(node) { ); } -module.exports = ruleComposer.filterReports( +export default ruleComposer.filterReports( rule, problem => !isInDoStatement(problem.node) && !isOptionalCallExpression(problem.node), diff --git a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js index 4b13d0bd3289..52d877ac8732 100644 --- a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js @@ -1,12 +1,11 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const objectCurlySpacingRule = new eslint.Linter() .getRules() .get("object-curly-spacing"); -module.exports = ruleComposer.filterReports( +export default ruleComposer.filterReports( objectCurlySpacingRule, (problem, metadata) => { const node = problem.node; diff --git a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js index 92fb8949ef17..47b865f1e309 100644 --- a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js +++ b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js @@ -1,7 +1,6 @@ -"use strict"; - let isWarnedForDeprecation = false; -module.exports = { + +export default { meta: { deprecated: true, schema: [ @@ -10,9 +9,9 @@ module.exports = { }, ], }, - create: function() { + create() { return { - Program: function() { + Program() { if ( isWarnedForDeprecation || /=-(f|-format)=/.test(process.argv.join("=")) diff --git a/eslint/babel-eslint-plugin/src/rules/quotes.js b/eslint/babel-eslint-plugin/src/rules/quotes.js index a4bb46df453f..5b38352658f3 100644 --- a/eslint/babel-eslint-plugin/src/rules/quotes.js +++ b/eslint/babel-eslint-plugin/src/rules/quotes.js @@ -1,10 +1,9 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const quotesRule = new eslint.Linter().getRules().get("quotes"); -module.exports = ruleComposer.filterReports(quotesRule, problem => { +export default ruleComposer.filterReports(quotesRule, problem => { // Workaround for JSX fragment syntax until // https://github.com/eslint/eslint/issues/9662 if (problem.node.parent.type === "JSXFragment") { diff --git a/eslint/babel-eslint-plugin/src/rules/semi.js b/eslint/babel-eslint-plugin/src/rules/semi.js index d732f42dcd0e..a1dabd1bbf96 100644 --- a/eslint/babel-eslint-plugin/src/rules/semi.js +++ b/eslint/babel-eslint-plugin/src/rules/semi.js @@ -1,7 +1,6 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const semiRule = new eslint.Linter().getRules().get("semi"); const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` @@ -104,7 +103,7 @@ const semiRuleWithClassProperty = ruleComposer.joinReports([ }), ]); -module.exports = ruleComposer.filterReports( +export default ruleComposer.filterReports( semiRuleWithClassProperty, problem => { const node = problem.node; diff --git a/eslint/babel-eslint-plugin/src/rules/valid-typeof.js b/eslint/babel-eslint-plugin/src/rules/valid-typeof.js index aa8321ec98f9..ebdd7a33f1e9 100644 --- a/eslint/babel-eslint-plugin/src/rules/valid-typeof.js +++ b/eslint/babel-eslint-plugin/src/rules/valid-typeof.js @@ -1,9 +1,8 @@ -"use strict"; +import ruleComposer from "eslint-rule-composer"; +import eslint from "eslint"; -const ruleComposer = require("eslint-rule-composer"); -const eslint = require("eslint"); const validTypeOf = new eslint.Linter().getRules().get("valid-typeof"); -module.exports = ruleComposer.filterReports(validTypeOf, problem => { +export default ruleComposer.filterReports(validTypeOf, problem => { return problem.node.value !== "bigint"; }); diff --git a/eslint/babel-eslint-plugin/test/rules/camelcase.js b/eslint/babel-eslint-plugin/test/rules/camelcase.js index f6d1d9249be9..c44861557ab1 100644 --- a/eslint/babel-eslint-plugin/test/rules/camelcase.js +++ b/eslint/babel-eslint-plugin/test/rules/camelcase.js @@ -3,14 +3,12 @@ * @author Nicholas C. Zakas */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../src/rules/camelcase"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/camelcase"; +import RuleTester from "../helpers/RuleTester"; //------------------------------------------------------------------------------ // Tests diff --git a/eslint/babel-eslint-plugin/test/rules/new-cap.js b/eslint/babel-eslint-plugin/test/rules/new-cap.js index 1dc8d3069a97..058ef3d9153f 100644 --- a/eslint/babel-eslint-plugin/test/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/test/rules/new-cap.js @@ -3,10 +3,10 @@ * @author Nicholas C. Zakas */ -var rule = require("../../src/rules/new-cap"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/new-cap"; +import RuleTester from "../helpers/RuleTester"; -var ruleTester = new RuleTester(); +const ruleTester = new RuleTester(); ruleTester.run("babel/new-cap", rule, { valid: [ // Original test cases. diff --git a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js index 7264a030f026..eeca380d389e 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js @@ -3,15 +3,13 @@ * @author Toru Nagashima */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const cloneDeep = require("lodash.clonedeep"); -const rule = require("../../src/rules/no-invalid-this"), - RuleTester = require("../helpers/RuleTester"); +import cloneDeep from "lodash.clonedeep"; +import rule from "../../src/rules/no-invalid-this"; +import RuleTester from "../helpers/RuleTester"; //------------------------------------------------------------------------------ // Helpers diff --git a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js index fc07ad73d572..1bb327883bfc 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js @@ -3,14 +3,12 @@ * @author Michael Ficarra */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../src/rules/no-unused-expressions"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/no-unused-expressions"; +import RuleTester from "../helpers/RuleTester"; //------------------------------------------------------------------------------ // Tests diff --git a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js index ff51d248baec..dfe03196f208 100644 --- a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js @@ -6,10 +6,10 @@ * @copyright 2015 Mathieu M-Gosselin. All rights reserved. */ -var rule = require("../../src/rules/object-curly-spacing"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/object-curly-spacing"; +import RuleTester from "../helpers/RuleTester"; -var ruleTester = new RuleTester(); +const ruleTester = new RuleTester(); ruleTester.run("babel/object-curly-spacing", rule, { valid: [ // always - object literals diff --git a/eslint/babel-eslint-plugin/test/rules/quotes.js b/eslint/babel-eslint-plugin/test/rules/quotes.js index 938da649d21e..7bd4e7ea34ad 100644 --- a/eslint/babel-eslint-plugin/test/rules/quotes.js +++ b/eslint/babel-eslint-plugin/test/rules/quotes.js @@ -1,7 +1,7 @@ -var rule = require("../../src/rules/quotes"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/quotes"; +import RuleTester from "../helpers/RuleTester"; -var ruleTester = new RuleTester(); +const ruleTester = new RuleTester(); ruleTester.run("babel/quotes", rule, { valid: [ 'var foo = "bar";', diff --git a/eslint/babel-eslint-plugin/test/rules/semi.js b/eslint/babel-eslint-plugin/test/rules/semi.js index ac95f38482db..c5b8a8fc4a09 100644 --- a/eslint/babel-eslint-plugin/test/rules/semi.js +++ b/eslint/babel-eslint-plugin/test/rules/semi.js @@ -4,14 +4,12 @@ * @author Nicholas C. Zakas */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../src/rules/semi"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/semi"; +import RuleTester from "../helpers/RuleTester"; const ruleTester = new RuleTester(); diff --git a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js index c6092a72f688..ee23bd5291ce 100644 --- a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js +++ b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js @@ -3,14 +3,12 @@ * @author Ian Christian Myers */ -"use strict"; - //------------------------------------------------------------------------------ // Requirements //------------------------------------------------------------------------------ -const rule = require("../../src/rules/valid-typeof"), - RuleTester = require("../helpers/RuleTester"); +import rule from "../../src/rules/valid-typeof"; +import RuleTester from "../helpers/RuleTester"; //------------------------------------------------------------------------------ // Tests From 4e774b726475aff9a6a1d2111afec21158979566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 26 Nov 2019 02:51:11 -0500 Subject: [PATCH 833/965] fix: rewriteBindingInitVisitor should skip on scopable node (#10764) --- .../src/rewrite-live-references.js | 5 +---- .../test/fixtures/regression/9346/input.mjs | 4 ++++ .../test/fixtures/regression/9346/options.json | 5 +++++ .../test/fixtures/regression/9346/output.js | 14 ++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs create mode 100644 packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json create mode 100644 packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/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 8bd93f509c25..f665926decb2 100644 --- a/packages/babel-helper-module-transforms/src/rewrite-live-references.js +++ b/packages/babel-helper-module-transforms/src/rewrite-live-references.js @@ -80,10 +80,7 @@ export default function rewriteLiveReferences( * A visitor to inject export update statements during binding initialization. */ const rewriteBindingInitVisitor = { - ClassProperty(path) { - path.skip(); - }, - Function(path) { + Scope(path) { path.skip(); }, ClassDeclaration(path) { diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs new file mode 100644 index 000000000000..a662778eac25 --- /dev/null +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs @@ -0,0 +1,4 @@ +export function bug() {} +{ + let bug = 2; +} diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json new file mode 100644 index 000000000000..9e5a4ccdb0df --- /dev/null +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "transform-modules-amd" + ] +} diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/output.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/output.js new file mode 100644 index 000000000000..f76724189f9f --- /dev/null +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/output.js @@ -0,0 +1,14 @@ +define(["exports"], function (_exports) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.bug = bug; + + function bug() {} + + { + let bug = 2; + } +}); From a6e8b3843b53c6e106d9fb2e37fea60c306dd97c Mon Sep 17 00:00:00 2001 From: Jaroslav Kubicek Date: Fri, 29 Nov 2019 20:34:41 +0100 Subject: [PATCH 834/965] chore: update snapshot for corejs3 targets unit test --- .../debug/entry-corejs3-specific-targets/stdout.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 2229f64bab90..2adaac616ba5 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 @@ -65,7 +65,7 @@ Using polyfills with `entry` option: es.array.copy-within { "ie":"10", "safari":"7" } es.array.every { "safari":"7" } es.array.fill { "ie":"10", "safari":"7" } - es.array.filter { "ie":"10", "ios":"9", "safari":"7" } + es.array.filter { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.array.find { "ie":"10", "safari":"7" } es.array.find-index { "ie":"10", "safari":"7" } es.array.flat { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } @@ -77,7 +77,7 @@ Using polyfills with `entry` option: es.array.iterator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.join { "ie":"10", "safari":"7" } es.array.last-index-of { "safari":"7" } - es.array.map { "ie":"10", "ios":"9", "safari":"7" } + es.array.map { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.of { "ie":"10", "safari":"7" } es.array.reduce { "safari":"7" } es.array.reduce-right { "safari":"7" } @@ -131,7 +131,7 @@ Using polyfills with `entry` option: es.number.parse-int { "ie":"10", "safari":"7" } es.number.to-fixed { "edge":"13", "ie":"10", "safari":"7" } es.number.to-precision { "safari":"7" } - es.object.assign { "ie":"10", "safari":"7" } + es.object.assign { "edge":"13", "ie":"10", "safari":"7" } es.object.define-getter { "chrome":"54", "edge":"13", "ie":"10", "safari":"7" } es.object.define-properties { "safari":"7" } es.object.define-property { "safari":"7" } @@ -170,7 +170,7 @@ Using polyfills with `entry` option: es.reflect.is-extensible { "ie":"10", "ios":"9", "safari":"7" } es.reflect.own-keys { "ie":"10", "ios":"9", "safari":"7" } es.reflect.prevent-extensions { "ie":"10", "ios":"9", "safari":"7" } - es.reflect.set { "ie":"10", "ios":"9", "safari":"7" } + es.reflect.set { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.reflect.set-prototype-of { "ie":"10", "ios":"9", "safari":"7" } es.regexp.constructor { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.regexp.exec { "safari":"7" } From 26c0a32c7c09700ccc8e19152c460573da65b657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Kub=C3=AD=C4=8Dek?= Date: Sun, 1 Dec 2019 00:07:05 +0100 Subject: [PATCH 835/965] refactor: Improve error message in @babel/core when root config is not found (#10778) --- .../babel-core/src/config/files/configuration.js | 2 +- .../babel-core/src/config/files/index-browser.js | 2 ++ packages/babel-core/src/config/files/index.js | 1 + packages/babel-core/src/config/partial.js | 13 ++++++++++--- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js index 515171ceba94..06c304d6b79e 100644 --- a/packages/babel-core/src/config/files/configuration.js +++ b/packages/babel-core/src/config/files/configuration.js @@ -18,7 +18,7 @@ import type { CallerMetadata } from "../validation/options"; const debug = buildDebug("babel:config:loading:files:configuration"); -const ROOT_CONFIG_FILENAMES = [ +export const ROOT_CONFIG_FILENAMES = [ "babel.config.js", "babel.config.cjs", "babel.config.json", diff --git a/packages/babel-core/src/config/files/index-browser.js b/packages/babel-core/src/config/files/index-browser.js index 1d2adccaa811..b21b43e7778d 100644 --- a/packages/babel-core/src/config/files/index-browser.js +++ b/packages/babel-core/src/config/files/index-browser.js @@ -51,6 +51,8 @@ export function loadConfig( throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); } +export const ROOT_CONFIG_FILENAMES = []; + // eslint-disable-next-line no-unused-vars export function resolvePlugin(name: string, dirname: string): string | null { return null; diff --git a/packages/babel-core/src/config/files/index.js b/packages/babel-core/src/config/files/index.js index 3c74f2d4eebb..464ef66253f4 100644 --- a/packages/babel-core/src/config/files/index.js +++ b/packages/babel-core/src/config/files/index.js @@ -14,6 +14,7 @@ export { findRelativeConfig, findRootConfig, loadConfig, + ROOT_CONFIG_FILENAMES, } from "./configuration"; export type { ConfigFile, diff --git a/packages/babel-core/src/config/partial.js b/packages/babel-core/src/config/partial.js index 9f5f85ed4edc..2cf96e8653ed 100644 --- a/packages/babel-core/src/config/partial.js +++ b/packages/babel-core/src/config/partial.js @@ -12,7 +12,12 @@ import { type RootMode, } from "./validation/options"; -import { findConfigUpwards, type ConfigFile, type IgnoreFile } from "./files"; +import { + findConfigUpwards, + ROOT_CONFIG_FILENAMES, + type ConfigFile, + type IgnoreFile, +} from "./files"; function resolveRootMode(rootDir: string, rootMode: RootMode): string { switch (rootMode) { @@ -31,7 +36,9 @@ function resolveRootMode(rootDir: string, rootMode: RootMode): string { throw Object.assign( (new Error( `Babel was run with rootMode:"upward" but a root could not ` + - `be found when searching upward from "${rootDir}"`, + `be found when searching upward from "${rootDir}".\n` + + `One of the following config files must be in the directory tree: ` + + `"${ROOT_CONFIG_FILENAMES.join(", ")}".`, ): any), { code: "BABEL_ROOT_NOT_FOUND", @@ -40,7 +47,7 @@ function resolveRootMode(rootDir: string, rootMode: RootMode): string { ); } default: - throw new Error(`Assertion failure - unknown rootMode value`); + throw new Error(`Assertion failure - unknown rootMode value.`); } } From 8f8916748646d667d13fcba682281a9a2ebd831f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 2 Dec 2019 22:30:21 +0100 Subject: [PATCH 836/965] Update core-js-compat (#10795) * Update core-js-compat * Update lockfile --- packages/babel-preset-env/package.json | 2 +- yarn.lock | 68 +++++++++++++------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 3b0fdf4abf33..6e43b2fff2ea 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -61,7 +61,7 @@ "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/types": "^7.7.4", "browserslist": "^4.6.0", - "core-js-compat": "^3.1.1", + "core-js-compat": "^3.4.7", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.5.0" diff --git a/yarn.lock b/yarn.lock index 0a5995b5d32a..f8c8092acdce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2852,14 +2852,14 @@ browserify@^16.2.3: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.6.0, browserslist@^4.6.6: - version "4.7.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.0.tgz#9ee89225ffc07db03409f2fee524dc8227458a17" - integrity sha512-9rGNDtnj+HaahxiVV38Gn8n8Lr8REKsel68v1sPFfIGEK6uSXTY3h9acgiT1dZVtOOUtifo/Dn8daDQ5dUgVsA== +browserslist@^4.6.0, browserslist@^4.8.0: + version "4.8.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.0.tgz#6f06b0f974a7cc3a84babc2ccc56493668e3c789" + integrity sha512-HYnxc/oLRWvJ3TsGegR0SRL/UDnknGq2s/a8dYYEO+kOQ9m9apKoS5oiathLKZdh/e9uE+/J3j92qPlGD/vTqA== dependencies: - caniuse-lite "^1.0.30000989" - electron-to-chromium "^1.3.247" - node-releases "^1.1.29" + caniuse-lite "^1.0.30001012" + electron-to-chromium "^1.3.317" + node-releases "^1.1.41" bser@^2.0.0: version "2.1.0" @@ -3062,10 +3062,10 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30000989: - version "1.0.30000989" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000989.tgz#b9193e293ccf7e4426c5245134b8f2a56c0ac4b9" - integrity sha512-vrMcvSuMz16YY6GSVZ0dWDTJP8jqk3iFQ/Aq5iqblPwxSVVZI+zxDyTX0VPqtQsDnfdrBDcsmhgTEOh5R8Lbpw== +caniuse-lite@^1.0.30001012: + version "1.0.30001013" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001013.tgz#da2440d4d266a17d40eb79bd19c0c8cc1d029c72" + integrity sha512-hOAXaWKuq/UVFgYawxIOdPdyMQdYcwOCDOjnZcKn7wCgFUrhP7smuNZjGLuJlPSgE6aRA4cRJ+bGSrhtEt7ZAg== capture-exit@^2.0.0: version "2.0.0" @@ -3561,11 +3561,11 @@ copy-props@^2.0.1: is-plain-object "^2.0.1" core-js-compat@^3.1.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.2.1.tgz#0cbdbc2e386e8e00d3b85dc81c848effec5b8150" - integrity sha512-MwPZle5CF9dEaMYdDeWm73ao/IflDH+FjeJCWEADcEgFSE9TLimFKwJsfmkwzI8eC0Aj0mgvMDjeQjrElkz4/A== + version "3.4.7" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.4.7.tgz#39f8080b1d92a524d6d90505c42b9c5c1eb90611" + integrity sha512-57+mgz/P/xsGdjwQYkwtBZR3LuISaxD1dEwVDtbk8xJMqAmwqaxLOvnNT7kdJ7jYE/NjNptyzXi+IQFMi/2fCw== dependencies: - browserslist "^4.6.6" + browserslist "^4.8.0" semver "^6.3.0" core-util-is@1.0.2, core-util-is@~1.0.0: @@ -4092,10 +4092,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.247: - version "1.3.252" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.252.tgz#5b6261965b564a0f4df0f1c86246487897017f52" - integrity sha512-NWJ5TztDnjExFISZHFwpoJjMbLUifsNBnx7u2JI0gCw6SbKyQYYWWtBHasO/jPtHym69F4EZuTpRNGN11MT/jg== +electron-to-chromium@^1.3.317: + version "1.3.321" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.321.tgz#913869f5ec85daabba0e75c9c314b4bf26cdb01e" + integrity sha512-jJy/BZK2s2eAjMPXVMSaCmo7/pSY2aKkfQ+LoAb5Wk39qAhyP9r8KU74c4qTgr9cD/lPUhJgReZxxqU0n5puog== elegant-spinner@^1.0.1: version "1.0.1" @@ -7852,12 +7852,12 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.29: - version "1.1.29" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.29.tgz#86a57c6587a30ecd6726449e5d293466b0a0bb86" - integrity sha512-R5bDhzh6I+tpi/9i2hrrvGJ3yKPYzlVOORDkXhnZuwi5D3q1I5w4vYy24PJXTcLk9Q0kws9TO77T75bcK8/ysQ== +node-releases@^1.1.41: + version "1.1.41" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.41.tgz#57674a82a37f812d18e3b26118aefaf53a00afed" + integrity sha512-+IctMa7wIs8Cfsa8iYzeaLTFwv5Y4r5jZud+4AnfymzeEXKBCavFX0KBgzVaPVqf0ywa6PrO8/b+bPqdwjGBSg== dependencies: - semver "^5.3.0" + semver "^6.3.0" "nopt@2 || 3": version "3.0.6" @@ -9003,7 +9003,7 @@ read@1, read@~1.0.1: dependencies: mute-stream "~0.0.4" -"readable-stream@1 || 2", "readable-stream@2 || 3", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: +"readable-stream@1 || 2", readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3, readable-stream@^2.3.5, readable-stream@^2.3.6, readable-stream@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== @@ -9016,6 +9016,15 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" +"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + "readable-stream@>=1.1.13-1 <1.2.0-0": version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" @@ -9026,15 +9035,6 @@ read@1, read@~1.0.1: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^3.0.2, readable-stream@^3.1.1: - version "3.4.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" - integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" From 5440ae1cae173774a75e81dc816789b1f6c06445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 2 Dec 2019 22:41:39 +0100 Subject: [PATCH 837/965] Correctly disambiguate / after async fuctions (#10475) * Correctly disambiguate / after async fuctions --- .../babel-parser/src/parser/expression.js | 14 ++ .../input.js | 2 + .../output.json | 185 ++++++++++++++++++ .../context-regex-after-statement/input.js | 2 + .../context-regex-after-statement/output.json | 122 ++++++++++++ 5 files changed, 325 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 89088db4d98b..81d34b837d2d 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -19,6 +19,7 @@ // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser import { types as tt, type TokenType } from "../tokenizer/types"; +import { types as ct } from "../tokenizer/context"; import * as N from "../types"; import LValParser from "./lval"; import { @@ -970,6 +971,19 @@ export default class ExpressionParser extends LValParser { this.match(tt._function) && !this.canInsertSemicolon() ) { + const last = this.state.context.length - 1; + if (this.state.context[last] !== ct.functionStatement) { + // Since "async" is an identifier and normally identifiers + // can't be followed by expression, the tokenizer assumes + // that "function" starts a statement. + // Fixing it in the tokenizer would mean tracking not only the + // previous token ("async"), but also the one before to know + // its beforeExpr value. + // It's easier and more efficient to adjust the context here. + throw new Error("Internal error"); + } + this.state.context[last] = ct.functionExpression; + this.next(); return this.parseFunction(node, undefined, true); } else if ( diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/input.js new file mode 100644 index 000000000000..1415f9866a40 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/input.js @@ -0,0 +1,2 @@ +void async function fn() {} +/foo/g \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json new file mode 100644 index 000000000000..9bd2028bf81f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json @@ -0,0 +1,185 @@ +{ + "type": "File", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "BinaryExpression", + "start": 0, + "end": 34, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "left": { + "type": "BinaryExpression", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "left": { + "type": "UnaryExpression", + "start": 0, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "operator": "void", + "prefix": true, + "argument": { + "type": "FunctionExpression", + "start": 5, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "id": { + "type": "Identifier", + "start": 20, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "fn" + }, + "name": "fn" + }, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 25 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "body": [], + "directives": [] + } + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 29, + "end": 32, + "loc": { + "start": { + "line": 2, + "column": 1 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "foo" + }, + "name": "foo" + } + }, + "operator": "/", + "right": { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 2, + "column": 5 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "g" + }, + "name": "g" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/input.js new file mode 100644 index 000000000000..beb4d4ea4675 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/input.js @@ -0,0 +1,2 @@ +async function fn() {} +/foo/g \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json new file mode 100644 index 000000000000..05504dd0734f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json @@ -0,0 +1,122 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "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": 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": 22, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ExpressionStatement", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expression": { + "type": "RegExpLiteral", + "start": 23, + "end": 29, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "extra": { + "raw": "/foo/g" + }, + "pattern": "foo", + "flags": "g" + } + } + ], + "directives": [] + } +} \ No newline at end of file From 7195f0d8cfb90d762c2dc5d1dbd02e373d4c813f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 16 Sep 2019 00:07:10 +0200 Subject: [PATCH 838/965] Unify logic for running parser tests from external suites (#10444) --- Makefile | 8 +- package.json | 1 + scripts/tests/flow/index.js | 132 ++++++++ .../tests/flow/run_babel_parser_flow_tests.js | 311 ------------------ ...flow_tests_whitelist.txt => whitelist.txt} | 25 +- scripts/tests/test262/index.js | 193 +++++++++++ .../tests/test262/run_babel_parser_test262.js | 126 ------- .../test262/run_babel_parser_test262_utils.js | 297 ----------------- .../{test262_whitelist.txt => whitelist.txt} | 2 +- scripts/tests/utils/parser-test-runner.js | 237 +++++++++++++ yarn.lock | 5 + 11 files changed, 581 insertions(+), 756 deletions(-) create mode 100644 scripts/tests/flow/index.js delete mode 100644 scripts/tests/flow/run_babel_parser_flow_tests.js rename scripts/tests/flow/{flow_tests_whitelist.txt => whitelist.txt} (67%) create mode 100644 scripts/tests/test262/index.js delete mode 100644 scripts/tests/test262/run_babel_parser_test262.js delete mode 100644 scripts/tests/test262/run_babel_parser_test262_utils.js rename scripts/tests/test262/{test262_whitelist.txt => whitelist.txt} (99%) create mode 100644 scripts/tests/utils/parser-test-runner.js diff --git a/Makefile b/Makefile index bc69709bdd19..896425533d55 100644 --- a/Makefile +++ b/Makefile @@ -159,13 +159,13 @@ bootstrap-flow: cd build/flow && git checkout $(FLOW_COMMIT) test-flow: - node scripts/tests/flow/run_babel_parser_flow_tests.js + node scripts/tests/flow test-flow-ci: build-bundle-ci bootstrap-flow $(MAKE) test-flow test-flow-update-whitelist: - node scripts/tests/flow/run_babel_parser_flow_tests.js --update-whitelist + node scripts/tests/flow --update-whitelist bootstrap-test262: rm -rf build/test262 @@ -174,13 +174,13 @@ bootstrap-test262: cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: - node scripts/tests/test262/run_babel_parser_test262.js + node scripts/tests/test262 test-test262-ci: build-bundle-ci bootstrap-test262 $(MAKE) test-test262 test-test262-update-whitelist: - node scripts/tests/test262/run_babel_parser_test262.js --update-whitelist + node scripts/tests/test262 --update-whitelist # Does not work on Windows clone-license: diff --git a/package.json b/package.json index a204c5e72859..efdd7916d469 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "lerna-changelog": "^0.5.0", "lint-staged": "^9.2.0", "lodash": "^4.17.13", + "mergeiterator": "^1.2.5", "output-file-sync": "^2.0.0", "prettier": "^1.19.1", "pump": "^3.0.0", diff --git a/scripts/tests/flow/index.js b/scripts/tests/flow/index.js new file mode 100644 index 000000000000..9b12bf07053e --- /dev/null +++ b/scripts/tests/flow/index.js @@ -0,0 +1,132 @@ +const fs = require("fs").promises; +const path = require("path"); +const merge = require("mergeiterator"); +const TestRunner = require("../utils/parser-test-runner"); + +const flowOptionsMapping = { + esproposal_class_instance_fields: "classProperties", + esproposal_class_static_fields: "classProperties", + esproposal_export_star_as: "exportNamespaceFrom", + esproposal_decorators: "decorators-legacy", + esproposal_nullish_coalescing: "nullishCoalescingOperator", + esproposal_optional_chaining: "optionalChaining", + types: "flowComments", + intern_comments: false, +}; + +function getPlugins(test) { + const plugins = [ + "dynamicImport", + ["flow", { all: true }], + "flowComments", + "jsx", + "classProperties", + "classPrivateProperties", + "classPrivateMethods", + "bigInt", + "numericSeparator", + ]; + + if (!test.options) return plugins; + + for (const [option, enabled] of Object.entries(test.options)) { + if (!enabled) { + const idx = plugins.indexOf(flowOptionsMapping[option]); + if (idx !== -1) plugins.splice(idx, 1); + } else if (!(option in flowOptionsMapping)) { + throw new Error("Parser options not mapped " + option); + } else if (flowOptionsMapping[option]) { + plugins.push(flowOptionsMapping[option]); + } + } + + return plugins; +} + +async function* readdirRecursive(root, dir = ".") { + const names = await fs.readdir(path.join(root, dir)); + + const dirs = []; + + for (const name of names) { + const file = path.join(dir, name); + const stats = await fs.stat(path.join(root, file)); + if (!stats.isDirectory()) { + if (!file) continue; + yield file; + } else { + dirs.push(readdirRecursive(root, file)); + } + } + + yield* merge(dirs); +} + +async function* loadTests(root) { + for await (const file of readdirRecursive(root)) { + if (file.slice(-3) === ".js") { + const noExt = path.join(root, file).slice(0, -3); + + const [contents, tree, options] = await Promise.all([ + fs.readFile(noExt + ".js", "utf8"), + fs.readFile(noExt + ".tree.json", "utf8").catch(() => null), + fs.readFile(noExt + ".options.json", "utf8").catch(() => null), + ]); + + yield { + file, + contents, + tree: JSON.parse(tree), + options: JSON.parse(options), + }; + } + } +} + +const runner = new TestRunner({ + testDir: path.join(__dirname, "../../../build/flow/src/parser/test/flow"), + whitelist: path.join(__dirname, "whitelist.txt"), + shouldUpdate: process.argv.includes("--update-whitelist"), + + async *getTests() { + for await (const test of loadTests(this.testDir)) { + const shouldSuccess = + test.tree && (!test.tree.errors || !test.tree.errors.length); + + yield { + contents: test.contents, + fileName: test.file, + id: test.file, + expectedError: !shouldSuccess, + plugins: getPlugins(test), + }; + } + }, + + parse(test, parser) { + try { + parser(test.contents, { + sourceType: "module", + plugins: test.plugins, + }); + } catch (e) { + // lets retry in script mode + if (!test.expectedError) { + try { + parser(test.contents, { + sourceType: "script", + plugins: test.plugins, + }); + return; + } catch {} + } + + throw e; + } + }, +}); + +runner.run().catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/scripts/tests/flow/run_babel_parser_flow_tests.js b/scripts/tests/flow/run_babel_parser_flow_tests.js deleted file mode 100644 index f087fb6614e3..000000000000 --- a/scripts/tests/flow/run_babel_parser_flow_tests.js +++ /dev/null @@ -1,311 +0,0 @@ -"use strict"; - -const path = require("path"); -const fs = require("fs"); -const chalk = require("chalk"); -const parse = require("../../../packages/babel-parser").parse; - -const TESTS_FOLDER = path.join( - __dirname, - "../../../build/flow/src/parser/test/flow" -); -const WHITELIST_PATH = path.join(__dirname, "./flow_tests_whitelist.txt"); - -const shouldUpdateWhitelist = process.argv.indexOf("--update-whitelist") > 0; - -function map_get_default(map, key, defaultConstructor) { - if (map.has(key)) { - return map.get(key); - } - const value = new defaultConstructor(); - map.set(key, value); - return value; -} - -function get_whitelist(filename) { - return fs - .readFileSync(filename, "utf8") - .split("\n") - .map(line => line.replace(/#.*$/, "").trim()) - .filter(Boolean); -} - -function list_files(root, dir) { - const files = fs.readdirSync(dir ? path.join(root, dir) : root); - let result = []; - for (let i = 0; i < files.length; i++) { - const file = dir ? path.join(dir, files[i]) : files[i]; - const stats = fs.statSync(path.join(root, file)); - if (stats.isDirectory()) { - result = result.concat(list_files(root, file)); - } else { - result.push(file); - } - } - return result.sort(); -} - -function get_tests(root_dir) { - const files = list_files(root_dir); - const tests = new Map(); - for (let i = 0; i < files.length; i++) { - const file = files[i]; - const test_name = path.dirname(file); - const case_parts = path.basename(file).split("."); - const case_name = case_parts[0]; - - // Hack to ignore hidden files. - if (case_name === "") { - continue; - } - - const cases = map_get_default(tests, test_name, Map); - const case_ = map_get_default(cases, case_name, Object); - - const content = fs.readFileSync(path.join(root_dir, file), "utf8"); - const ext = case_parts[case_parts.length - 1]; - const kind = - case_parts.length > 2 ? case_parts[case_parts.length - 2] : null; - - if (ext === "js") { - case_.file = file; - case_.content = content; - } else if (ext === "json" && kind === "tree") { - case_.expected_ast = JSON.parse(content); - } else if (ext === "json" && kind === "options") { - case_.options = JSON.parse(content); - } - } - return tests; -} - -function update_whitelist(summary) { - const contains = (tests, file) => - tests.some(({ test }) => test.file === file); - - const disallowed = summary.disallowed.success.concat( - summary.disallowed.failure - ); - - const oldLines = fs - .readFileSync(WHITELIST_PATH, "utf8") - .trim() - .split("\n") - .filter(line => { - const file = line.replace(/#.*$/, "").trim(); - return ( - !contains(disallowed, file) && summary.unrecognized.indexOf(file) === -1 - ); - }); - - const newLines = summary.disallowed.failure - .map(({ test }) => test.file) - .filter(test => oldLines.indexOf(test) === -1); - - const result = oldLines.concat(newLines).join("\n") + "\n"; - - fs.writeFileSync(WHITELIST_PATH, result); -} - -const options = { - plugins: [ - "dynamicImport", - ["flow", { all: true }], - "flowComments", - "jsx", - "classProperties", - "classPrivateProperties", - "classPrivateMethods", - "bigInt", - "numericSeparator", - ], - sourceType: "module", - ranges: true, -}; - -const flowOptionsMapping = { - esproposal_class_instance_fields: "classProperties", - esproposal_class_static_fields: "classProperties", - esproposal_export_star_as: "exportNamespaceFrom", - esproposal_decorators: "decorators-legacy", - esproposal_nullish_coalescing: "nullishCoalescingOperator", - esproposal_optional_chaining: "optionalChaining", - types: "flowComments", - intern_comments: false, -}; - -const summary = { - passed: true, - allowed: { - success: [], - failure: [], - }, - disallowed: { - success: [], - failure: [], - }, - unrecognized: [], -}; - -const tests = get_tests(TESTS_FOLDER); -const whitelist = get_whitelist(WHITELIST_PATH); - -const unrecognized = new Set(whitelist); - -tests.forEach(section => { - section.forEach(test => { - const shouldSuccess = - test.expected_ast && - (!Array.isArray(test.expected_ast.errors) || - test.expected_ast.errors.length === 0); - const inWhitelist = whitelist.indexOf(test.file) > -1; - - const babelParserOptions = Object.assign({}, options); - babelParserOptions.plugins = babelParserOptions.plugins.slice(); - - if (test.options) { - Object.keys(test.options).forEach(option => { - if (!test.options[option]) { - const idx = babelParserOptions.plugins.indexOf( - flowOptionsMapping[option] - ); - if (idx) { - babelParserOptions.plugins.splice(idx, 1); - } - return; - } - if (!(option in flowOptionsMapping)) { - throw new Error("Parser options not mapped " + option); - } - if (flowOptionsMapping[option]) { - babelParserOptions.plugins.push(flowOptionsMapping[option]); - } - }); - } - - let failed = false; - let exception = null; - try { - parse(test.content, babelParserOptions); - } catch (e) { - exception = e; - failed = true; - - // lets retry in script mode - if (shouldSuccess) { - try { - parse( - test.content, - Object.assign({}, babelParserOptions, { sourceType: "script" }) - ); - exception = null; - failed = false; - } catch (e) {} - } - } - - const isSuccess = shouldSuccess !== failed; - const isAllowed = isSuccess !== inWhitelist; - - summary[isAllowed ? "allowed" : "disallowed"][ - isSuccess ? "success" : "failure" - ].push({ test, exception, shouldSuccess, babelParserOptions }); - summary.passed &= isAllowed; - - unrecognized.delete(test.file); - - process.stdout.write(chalk.gray(".")); - }); -}); - -summary.unrecognized = Array.from(unrecognized); -summary.passed &= summary.unrecognized.length === 0; - -// This is needed because, after the dots written using -// `process.stdout.write(".")` there is no final newline -console.log(); - -if (summary.disallowed.failure.length || summary.disallowed.success.length) { - console.log("\n-- FAILED TESTS --"); - summary.disallowed.failure.forEach( - ({ test, shouldSuccess, exception, babelParserOptions }) => { - console.log(chalk.red(`✘ ${test.file}`)); - if (shouldSuccess) { - console.log(chalk.yellow(" Should parse successfully, but did not")); - console.log(chalk.yellow(` Failed with: \`${exception.message}\``)); - } else { - console.log(chalk.yellow(" Should fail parsing, but did not")); - } - console.log( - chalk.yellow( - ` Active plugins: ${JSON.stringify(babelParserOptions.plugins)}` - ) - ); - } - ); - summary.disallowed.success.forEach( - ({ test, shouldSuccess, babelParserOptions }) => { - console.log(chalk.red(`✘ ${test.file}`)); - if (shouldSuccess) { - console.log( - chalk.yellow( - " Correctly parsed successfully, but" + - " was disallowed by the whitelist" - ) - ); - } else { - console.log( - chalk.yellow( - " Correctly failed parsing, but" + - " was disallowed by the whitelist" - ) - ); - } - console.log( - chalk.yellow( - ` Active plugins: ${JSON.stringify(babelParserOptions.plugins)}` - ) - ); - } - ); -} - -console.log("-- SUMMARY --"); -console.log( - chalk.green("✔ " + summary.allowed.success.length + " tests passed") -); -console.log( - chalk.green( - "✔ " + - summary.allowed.failure.length + - " tests failed but were allowed in the whitelist" - ) -); -console.log( - chalk.red("✘ " + summary.disallowed.failure.length + " tests failed") -); -console.log( - chalk.red( - "✘ " + - summary.disallowed.success.length + - " tests passed but were disallowed in the whitelist" - ) -); -console.log( - chalk.red( - "✘ " + - summary.unrecognized.length + - " tests specified in the whitelist were not found" - ) -); - -// Some padding to separate the output from the message `make` -// adds at the end of failing scripts -console.log(); - -if (shouldUpdateWhitelist) { - update_whitelist(summary); - console.log("\nWhitelist updated"); -} else { - process.exit(summary.passed ? 0 : 1); -} diff --git a/scripts/tests/flow/flow_tests_whitelist.txt b/scripts/tests/flow/whitelist.txt similarity index 67% rename from scripts/tests/flow/flow_tests_whitelist.txt rename to scripts/tests/flow/whitelist.txt index f3704b19d867..8e24ebf0a28d 100644 --- a/scripts/tests/flow/flow_tests_whitelist.txt +++ b/scripts/tests/flow/whitelist.txt @@ -1,13 +1,4 @@ -# This file lists tests that are known to produce incorrect results when parsed -# with the babel parser: -# -# - Tests that are expected to parse successfully but for which the babel parser reports -# a syntax error -# - Tests that contain invalid syntax but for which the babel parser reports no syntax -# error -# -# Entries should be removed incrementally as the babel parser is improved. - +ES6/modules/migrated_0020.js JSX_invalid/migrated_0000.js arrow_function_invalid/migrated_0002.js async_await/migrated_0007.js @@ -15,18 +6,18 @@ async_await/migrated_0020.js async_await/migrated_0024.js async_await/migrated_0027.js async_generators/migrated_0007.js +class_method_kinds/polymorphic_getter.js class_properties/migrated_0021.js class_properties/migrated_0026.js decorators/migrated_0003.js -private_class_properties/multiple.js +export_import_reserved_words/migrated_0003.js +export_statements/export_trailing_comma.js +nullish_coalescing/precedence_and.js +nullish_coalescing/precedence_or.js private_class_properties/getter_and_field.js private_class_properties/getter_duplicate.js +private_class_properties/multiple.js +private_class_properties/multiple.js private_class_properties/setter_and_field.js private_class_properties/setter_duplicate.js types/member/reserved_words.js -class_method_kinds/polymorphic_getter.js -ES6/modules/migrated_0020.js -export_import_reserved_words/migrated_0003.js -export_statements/export_trailing_comma.js -nullish_coalescing/precedence_and.js -nullish_coalescing/precedence_or.js diff --git a/scripts/tests/test262/index.js b/scripts/tests/test262/index.js new file mode 100644 index 000000000000..0fd8eb229c42 --- /dev/null +++ b/scripts/tests/test262/index.js @@ -0,0 +1,193 @@ +const path = require("path"); +const TestStream = require("test262-stream"); +const TestRunner = require("../utils/parser-test-runner"); + +const ignoredFeatures = [ + "Array.prototype.flat", + "Array.prototype.flatMap", + "Array.prototype.values", + "ArrayBuffer", + "async-functions", + "async-iteration", + "arrow-function", + "Atomics", + "caller", + "class", + "computed-property-names", + "const", + "cross-realm", + "DataView", + "DataView.prototype.getFloat32", + "DataView.prototype.getFloat64", + "DataView.prototype.getInt8", + "DataView.prototype.getInt16", + "DataView.prototype.getInt32", + "DataView.prototype.getUint16", + "DataView.prototype.getUint32", + "DataView.prototype.setUint8", + "default-parameters", + "destructuring-assignment", + "destructuring-binding", + "FinalizationGroup", + "Float32Array", + "Float64Array", + "for-of", + "generators", + "globalThis", + "hashbang", + "host-gc-required", + "Int8Array", + "Int32Array", + "Intl.DateTimeFormat-datetimestyle", + "Intl.DateTimeFormat-dayPeriod", + "Intl.DateTimeFormat-fractionalSecondDigits", + "Intl.DateTimeFormat-formatRange", + "Intl.ListFormat", + "Intl.Locale", + "Intl.NumberFormat-unified", + "Intl.RelativeTimeFormat", + "Intl.Segmenter", + "IsHTMLDDA", + "json-superset", + "let", + "Map", + "new.target", + "Object.fromEntries", + "Object.is", + "object-rest", + "object-spread", + "optional-catch-binding", + "Promise.allSettled", + "Promise.prototype.finally", + "Proxy", + "proxy-missing-checks", + "Reflect", + "Reflect.construct", + "Reflect.set", + "Reflect.setPrototypeOf", + "regexp-dotall", + "regexp-lookbehind", + "regexp-named-groups", + "regexp-unicode-property-escapes", + "rest-parameters", + "SharedArrayBuffer", + "Set", + "String.fromCodePoint", + "String.prototype.endsWith", + "String.prototype.includes", + "String.prototype.matchAll", + "String.prototype.trimEnd", + "String.prototype.trimStart", + "string-trimming", + "super", + "Symbol", + "Symbol.asyncIterator", + "Symbol.hasInstance", + "Symbol.isConcatSpreadable", + "Symbol.iterator", + "Symbol.match", + "Symbol.matchAll", + "Symbol.prototype.description", + "Symbol.replace", + "Symbol.search", + "Symbol.split", + "Symbol.species", + "Symbol.toPrimitive", + "Symbol.toStringTag", + "Symbol.unscopables", + "tail-call-optimization", + "template", + "TypedArray", + "u180e", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "WeakMap", + "WeakSet", + "WeakRef", + "well-formed-json-stringify", +]; + +const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"]; + +const featuresToPlugins = { + BigInt: "bigInt", + "class-fields-private": "classPrivateProperties", + "class-fields-public": "classProperties", + "class-methods-private": "classPrivateMethods", + "class-static-fields-public": "classProperties", + "class-static-fields-private": "classPrivateProperties", + "class-static-methods-private": "classPrivateMethods", + "dynamic-import": "dynamicImport", + "export-star-as-namespace-from-module": "exportNamespaceFrom", + "import.meta": "importMeta", + "numeric-separator-literal": "numericSeparator", + "optional-chaining": "optionalChaining", + "top-level-await": "topLevelAwait", +}; + +const unmappedFeatures = new Set(); + +function* getPlugins(features) { + if (!features) return; + + for (const f of features) { + if (featuresToPlugins[f]) { + yield featuresToPlugins[f]; + } else if (!ignoredFeatures.includes(f)) { + unmappedFeatures.add(f); + } + } +} + +const runner = new TestRunner({ + testDir: path.join(__dirname, "../../../build/test262"), + whitelist: path.join(__dirname, "whitelist.txt"), + logInterval: 500, + shouldUpdate: process.argv.includes("--update-whitelist"), + + async *getTests() { + const stream = new TestStream(this.testDir, { + omitRuntime: true, + }); + + for await (const test of stream) { + // strip test/ + const fileName = test.file.substr(5); + + if (ignoredTests.some(start => fileName.startsWith(start))) continue; + + yield { + contents: test.contents, + fileName, + id: `${fileName}(${test.scenario})`, + sourceType: test.attrs.flags.module ? "module" : "script", + plugins: Array.from(getPlugins(test.attrs.features)), + expectedError: + !!test.attrs.negative && + (test.attrs.negative.phase === "parse" || + test.attrs.negative.phase === "early"), + }; + } + }, +}); + +runner + .run() + .then(() => { + if (unmappedFeatures.size) { + console.log(""); + console.log( + "The following Features are not currently mapped or ignored:" + ); + console.log( + Array.from(unmappedFeatures) + .join("\n") + .replace(/^/gm, " ") + ); + } + }) + .catch(err => { + console.error(err); + process.exitCode = 1; + }); diff --git a/scripts/tests/test262/run_babel_parser_test262.js b/scripts/tests/test262/run_babel_parser_test262.js deleted file mode 100644 index acd0c5122606..000000000000 --- a/scripts/tests/test262/run_babel_parser_test262.js +++ /dev/null @@ -1,126 +0,0 @@ -"use strict"; - -const path = require("path"); -const chalk = require("chalk"); -const utils = require("./run_babel_parser_test262_utils"); - -const testDir = path.join(__dirname, "../../../build/test262"); -const whitelistFile = path.join(__dirname, "test262_whitelist.txt"); -const shouldUpdate = process.argv.indexOf("--update-whitelist") > -1; - -Promise.all([utils.getTests(testDir), utils.getWhitelist(whitelistFile)]) - .then(function([tests, whitelist]) { - const total = tests.length; - const reportInc = Math.floor(total / 20); - - console.log(`Now running ${total} tests...`); - - const results = tests.map(function(test, idx) { - if (idx % reportInc === 0) { - console.log(`> ${Math.round((100 * idx) / total)}% complete`); - } - - return utils.runTest(test); - }); - - return utils.interpret(results, whitelist); - }) - .then(function(summary) { - const goodnews = [ - summary.allowed.success.length + " valid programs parsed without error", - summary.allowed.failure.length + - " invalid programs produced a parsing error", - summary.allowed.falsePositive.length + - " invalid programs did not produce a parsing error" + - " (and allowed by the whitelist file)", - summary.allowed.falseNegative.length + - " valid programs produced a parsing error" + - " (and allowed by the whitelist file)", - ]; - const badnews = []; - const badnewsDetails = []; - - void [ - { - tests: summary.disallowed.success, - label: - "valid programs parsed without error" + - " (in violation of the whitelist file)", - }, - { - tests: summary.disallowed.failure, - label: - "invalid programs produced a parsing error" + - " (in violation of the whitelist file)", - }, - { - tests: summary.disallowed.falsePositive, - label: - "invalid programs did not produce a parsing error" + - " (without a corresponding entry in the whitelist file)", - }, - { - tests: summary.disallowed.falseNegative, - label: - "valid programs produced a parsing error" + - " (without a corresponding entry in the whitelist file)", - }, - { - tests: summary.unrecognized, - label: "non-existent programs specified in the whitelist file", - }, - ].forEach(function({ tests, label }) { - if (!tests.length) { - return; - } - - const desc = tests.length + " " + label; - - badnews.push(desc); - badnewsDetails.push(desc + ":"); - badnewsDetails.push( - ...tests.map(function(test) { - return test.id || test; - }) - ); - }); - - console.log("Testing complete."); - console.log("Summary:"); - console.log(chalk.green(goodnews.join("\n").replace(/^/gm, " ✔ "))); - - if (!summary.passed) { - console.log(""); - console.log(chalk.red(badnews.join("\n").replace(/^/gm, " ✘ "))); - console.log(""); - console.log("Details:"); - console.log(badnewsDetails.join("\n").replace(/^/gm, " ")); - } - - if (shouldUpdate) { - return utils.updateWhitelist(whitelistFile, summary).then(function() { - console.log(""); - console.log("Whitelist file updated."); - }); - } else { - process.exitCode = summary.passed ? 0 : 1; - } - - const unmappedFeatures = utils.getUnmappedFeatures(); - - if (unmappedFeatures.size) { - console.log(""); - console.log( - "The following Features are not currently mapped or ignored:" - ); - console.log( - Array.from(unmappedFeatures) - .join("\n") - .replace(/^/gm, " ") - ); - } - }) - .catch(function(err) { - console.error(err); - process.exitCode = 1; - }); diff --git a/scripts/tests/test262/run_babel_parser_test262_utils.js b/scripts/tests/test262/run_babel_parser_test262_utils.js deleted file mode 100644 index 2c35d0ed5933..000000000000 --- a/scripts/tests/test262/run_babel_parser_test262_utils.js +++ /dev/null @@ -1,297 +0,0 @@ -"use strict"; - -const fs = require("graceful-fs"); -const promisify = require("util").promisify; -const TestStream = require("test262-stream"); -const pfs = { - readFile: promisify(fs.readFile), - writeFile: promisify(fs.writeFile), - readdir: promisify(fs.readdir), - stat: promisify(fs.stat), -}; - -const parse = require("../../../packages/babel-parser").parse; - -const ignoredFeatures = [ - "Array.prototype.flat", - "Array.prototype.flatMap", - "Array.prototype.values", - "ArrayBuffer", - "async-functions", - "async-iteration", - "arrow-function", - "Atomics", - "caller", - "class", - "computed-property-names", - "const", - "cross-realm", - "DataView", - "DataView.prototype.getFloat32", - "DataView.prototype.getFloat64", - "DataView.prototype.getInt8", - "DataView.prototype.getInt16", - "DataView.prototype.getInt32", - "DataView.prototype.getUint16", - "DataView.prototype.getUint32", - "DataView.prototype.setUint8", - "default-parameters", - "destructuring-assignment", - "destructuring-binding", - "Float32Array", - "Float64Array", - "for-of", - "generators", - "globalThis", - "hashbang", - "Int8Array", - "Int32Array", - "Intl.ListFormat", - "Intl.Locale", - "Intl.NumberFormat-unified", - "Intl.RelativeTimeFormat", - "Intl.Segmenter", - "IsHTMLDDA", - "json-superset", - "let", - "Map", - "new.target", - "Object.fromEntries", - "Object.is", - "object-rest", - "object-spread", - "optional-catch-binding", - "Promise.prototype.finally", - "Proxy", - "Reflect", - "Reflect.construct", - "Reflect.set", - "Reflect.setPrototypeOf", - "regexp-dotall", - "regexp-lookbehind", - "regexp-named-groups", - "regexp-unicode-property-escapes", - "SharedArrayBuffer", - "Set", - "String.fromCodePoint", - "String.prototype.endsWith", - "String.prototype.includes", - "String.prototype.matchAll", - "String.prototype.trimEnd", - "String.prototype.trimStart", - "string-trimming", - "super", - "Symbol", - "Symbol.asyncIterator", - "Symbol.hasInstance", - "Symbol.isConcatSpreadable", - "Symbol.iterator", - "Symbol.match", - "Symbol.matchAll", - "Symbol.prototype.description", - "Symbol.replace", - "Symbol.search", - "Symbol.split", - "Symbol.species", - "Symbol.toPrimitive", - "Symbol.toStringTag", - "Symbol.unscopables", - "tail-call-optimization", - "template", - "TypedArray", - "u180e", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "WeakMap", - "WeakSet", - "well-formed-json-stringify", -]; - -const ignoredTests = ["built-ins/RegExp/", "language/literals/regexp/"]; - -const featuresToPlugins = { - BigInt: "bigInt", - "class-fields-private": "classPrivateProperties", - "class-fields-public": "classProperties", - "class-methods-private": "classPrivateMethods", - "class-static-fields-public": "classProperties", - "class-static-fields-private": "classPrivateProperties", - "class-static-methods-private": "classPrivateMethods", - "dynamic-import": "dynamicImport", - "export-star-as-namespace-from-module": "exportNamespaceFrom", - "import.meta": "importMeta", - "numeric-separator-literal": "numericSeparator", - "optional-chaining": "optionalChaining", - "top-level-await": "topLevelAwait", -}; - -function getPlugins(features) { - return ( - features && - features - .map(f => { - if (!featuresToPlugins[f] && !ignoredFeatures.includes(f)) { - unmappedFeatures.add(f); - } - return featuresToPlugins[f]; - }) - .filter(Boolean) - ); -} - -const unmappedFeatures = new Set(); - -exports.getUnmappedFeatures = function() { - return unmappedFeatures; -}; - -exports.getTests = function(testDir) { - const stream = new TestStream(testDir, { - omitRuntime: true, - }); - const tests = []; - - stream.on("data", test => { - // strip test/ - const fileName = test.file.substr(5); - - if (ignoredTests.some(start => fileName.startsWith(start))) return; - - tests.push({ - contents: test.contents, - fileName, - id: `${fileName}(${test.scenario})`, - sourceType: test.attrs.flags.module ? "module" : "script", - plugins: getPlugins(test.attrs.features), - expectedError: - !!test.attrs.negative && - (test.attrs.negative.phase === "parse" || - test.attrs.negative.phase === "early"), - }); - }); - - return new Promise((resolve, reject) => { - stream.on("end", () => resolve(tests)); - stream.on("error", reject); - }); -}; - -exports.runTest = function(test) { - try { - parse(test.contents, { - sourceType: test.sourceType, - plugins: test.plugins, - }); - test.actualError = false; - } catch (err) { - test.actualError = true; - } - - test.result = test.expectedError !== test.actualError ? "fail" : "pass"; - - return test; -}; - -exports.getWhitelist = function(filename) { - return pfs.readFile(filename, "utf-8").then(function(contents) { - return contents - .split("\n") - .map(function(line) { - return line.replace(/#.*$/, "").trim(); - }) - .filter(function(line) { - return line.length > 0; - }) - .reduce(function(table, filename) { - table[filename] = true; - return table; - }, Object.create(null)); - }); -}; - -exports.updateWhitelist = function(filename, summary) { - return pfs.readFile(filename, "utf-8").then(function(contents) { - const toRemove = summary.disallowed.success - .concat(summary.disallowed.failure) - .map(function(test) { - return test.id; - }) - .concat(summary.unrecognized); - const toAdd = summary.disallowed.falsePositive - .concat(summary.disallowed.falseNegative) - .map(function(test) { - return test.id; - }); - const newContents = contents - .split("\n") - .map(function(line) { - const testId = line.replace(/#.*$/, "").trim(); - - if (toRemove.indexOf(testId) > -1) { - return null; - } - - return line; - }) - .filter(function(line) { - return line !== null && line !== ""; - }) - .concat(toAdd) - .sort() - .join("\n"); - - return pfs.writeFile(filename, newContents, "utf-8"); - }); -}; - -exports.interpret = function(results, whitelist) { - const summary = { - passed: true, - allowed: { - success: [], - failure: [], - falsePositive: [], - falseNegative: [], - }, - disallowed: { - success: [], - failure: [], - falsePositive: [], - falseNegative: [], - }, - unrecognized: null, - }; - - results.forEach(function(result) { - let classification, isAllowed; - const inWhitelist = result.id in whitelist; - delete whitelist[result.id]; - - if (!result.expectedError) { - if (!result.actualError) { - classification = "success"; - isAllowed = !inWhitelist; - } else { - classification = "falseNegative"; - isAllowed = inWhitelist; - } - } else { - if (!result.actualError) { - classification = "falsePositive"; - isAllowed = inWhitelist; - } else { - classification = "failure"; - isAllowed = !inWhitelist; - } - } - - summary.passed &= isAllowed; - summary[isAllowed ? "allowed" : "disallowed"][classification].push(result); - }); - - summary.unrecognized = Object.keys(whitelist); - summary.passed = !!summary.passed && summary.unrecognized.length === 0; - - return summary; -}; diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/whitelist.txt similarity index 99% rename from scripts/tests/test262/test262_whitelist.txt rename to scripts/tests/test262/whitelist.txt index 1e21dcd228dc..512bee9a2ca8 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/whitelist.txt @@ -191,4 +191,4 @@ language/statements/class/elements/syntax/early-errors/invalid-names/method-outt language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(default) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) \ No newline at end of file +language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) diff --git a/scripts/tests/utils/parser-test-runner.js b/scripts/tests/utils/parser-test-runner.js new file mode 100644 index 000000000000..764ef593d4f5 --- /dev/null +++ b/scripts/tests/utils/parser-test-runner.js @@ -0,0 +1,237 @@ +"use strict"; + +const fs = require("fs").promises; +const chalk = require("chalk"); +const { parse: parser } = require("../../../packages/babel-parser"); + +const dot = chalk.gray("."); + +class TestRunner { + constructor({ + testDir, + whitelist, + logInterval = 1, + shouldUpdate, + getTests, + parse = this.parse, + }) { + this.testDir = testDir; + this.whitelist = whitelist; + this.logInterval = logInterval; + this.shouldUpdate = shouldUpdate; + this.getTests = getTests; + this.parse = parse; + } + + async run() { + const whitelistP = this.getWhitelist(); + + console.log(`Now running tests...`); + + const results = []; + for await (const result of this.runTests()) { + results.push(result); + if (results.length % this.logInterval === 0) process.stdout.write(dot); + } + process.stdout.write("\n"); + + const summary = this.interpret(results, await whitelistP); + + await this.output(summary); + } + + async *runTests() { + for await (const test of this.getTests()) { + yield this.runTest(test); + } + } + + runTest(test) { + try { + this.parse(test, parser); + test.actualError = false; + } catch (err) { + test.actualError = true; + } + + test.result = test.expectedError !== test.actualError ? "fail" : "pass"; + + return test; + } + + parse(test, parser) { + parser(test.contents, { + sourceType: test.sourceType, + plugins: test.plugins, + }); + } + + async getWhitelist() { + const contents = await fs.readFile(this.whitelist, "utf-8"); + const table = new Set(); + + for (const line of contents.split("\n")) { + const filename = line.replace(/#.*$/, "").trim(); + if (filename) table.add(filename); + } + + return table; + } + + async updateWhitelist(summary) { + const contents = await fs.readFile(this.whitelist, "utf-8"); + + const toRemove = summary.disallowed.success + .concat(summary.disallowed.failure) + .map(test => test.id) + .concat(summary.unrecognized); + + const updated = summary.disallowed.falsePositive + .concat(summary.disallowed.falseNegative) + .map(test => test.id); + + for (const line of contents.split("\n")) { + const testId = line.replace(/#.*$/, "").trim(); + if (!toRemove.includes(testId) && line) { + updated.push(line); + } + } + + updated.sort(); + + await fs.writeFile(this.whitelist, updated.join("\n") + "\n", "utf8"); + } + + interpret(results, whitelist) { + const summary = { + passed: true, + allowed: { + success: [], + failure: [], + falsePositive: [], + falseNegative: [], + }, + disallowed: { + success: [], + failure: [], + falsePositive: [], + falseNegative: [], + }, + unrecognized: null, + count: results.length, + }; + + results.forEach(function(result) { + let classification, isAllowed; + const inWhitelist = whitelist.has(result.id); + whitelist.delete(result.id); + + if (!result.expectedError) { + if (!result.actualError) { + classification = "success"; + isAllowed = !inWhitelist; + } else { + classification = "falseNegative"; + isAllowed = inWhitelist; + } + } else { + if (!result.actualError) { + classification = "falsePositive"; + isAllowed = inWhitelist; + } else { + classification = "failure"; + isAllowed = !inWhitelist; + } + } + + summary.passed &= isAllowed; + summary[isAllowed ? "allowed" : "disallowed"][classification].push( + result + ); + }); + + summary.unrecognized = Array.from(whitelist); + summary.passed = !!summary.passed && summary.unrecognized.length === 0; + + return summary; + } + + async output(summary) { + const goodnews = [ + summary.allowed.success.length + " valid programs parsed without error", + summary.allowed.failure.length + + " invalid programs produced a parsing error", + summary.allowed.falsePositive.length + + " invalid programs did not produce a parsing error" + + " (and allowed by the whitelist file)", + summary.allowed.falseNegative.length + + " valid programs produced a parsing error" + + " (and allowed by the whitelist file)", + ]; + const badnews = []; + const badnewsDetails = []; + + void [ + { + tests: summary.disallowed.success, + label: + "valid programs parsed without error" + + " (in violation of the whitelist file)", + }, + { + tests: summary.disallowed.failure, + label: + "invalid programs produced a parsing error" + + " (in violation of the whitelist file)", + }, + { + tests: summary.disallowed.falsePositive, + label: + "invalid programs did not produce a parsing error" + + " (without a corresponding entry in the whitelist file)", + }, + { + tests: summary.disallowed.falseNegative, + label: + "valid programs produced a parsing error" + + " (without a corresponding entry in the whitelist file)", + }, + { + tests: summary.unrecognized, + label: "non-existent programs specified in the whitelist file", + }, + ].forEach(function({ tests, label }) { + if (!tests.length) { + return; + } + + const desc = tests.length + " " + label; + + badnews.push(desc); + badnewsDetails.push(desc + ":"); + badnewsDetails.push(...tests.map(test => ` ${test.id || test}`)); + }); + + console.log(`Testing complete (${summary.count} tests).`); + console.log("Summary:"); + console.log(chalk.green(goodnews.join("\n").replace(/^/gm, " ✔ "))); + + if (!summary.passed) { + console.log(""); + console.log(chalk.red(badnews.join("\n").replace(/^/gm, " ✘ "))); + console.log(""); + console.log("Details:"); + console.log(badnewsDetails.join("\n").replace(/^/gm, " ")); + } + + if (this.shouldUpdate) { + await this.updateWhitelist(summary); + console.log(""); + console.log("Whitelist file updated."); + } else { + process.exitCode = summary.passed ? 0 : 1; + } + } +} + +module.exports = exports = TestRunner; diff --git a/yarn.lock b/yarn.lock index f8c8092acdce..99c6211d1b03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7438,6 +7438,11 @@ merge2@^1.2.3: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== +mergeiterator@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/mergeiterator/-/mergeiterator-1.2.5.tgz#40f0a27888f2eb85d80fa4c29632cf400a0b8c7b" + integrity sha512-KVZWGnRkEgmVewnpVIEUm/KuQ2kHx4T0zYQlPbGypBk4kM5sJ1+7bPDR2N4yg3EoS1CiGKk2GRb5PkAsMEoh3w== + micromatch@^2.1.5: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" From e74efd2c0a03badef66c28f29d566967ac8af0ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 16 Sep 2019 01:28:17 +0200 Subject: [PATCH 839/965] Run parser tests from the official TypeScript parser (#10444) --- .travis.yml | 3 + Makefile | 26 +- .../typescript/lint.sh => lint-ts-typings.sh} | 0 scripts/{tests => parser-tests}/flow/index.js | 0 .../flow/whitelist.txt | 0 .../{tests => parser-tests}/test262/index.js | 0 .../test262/whitelist.txt | 0 scripts/parser-tests/typescript/index.js | 58 ++ scripts/parser-tests/typescript/whitelist.txt | 501 ++++++++++++++++++ .../utils/parser-test-runner.js | 0 10 files changed, 583 insertions(+), 5 deletions(-) rename scripts/{tests/typescript/lint.sh => lint-ts-typings.sh} (100%) rename scripts/{tests => parser-tests}/flow/index.js (100%) rename scripts/{tests => parser-tests}/flow/whitelist.txt (100%) rename scripts/{tests => parser-tests}/test262/index.js (100%) rename scripts/{tests => parser-tests}/test262/whitelist.txt (100%) create mode 100644 scripts/parser-tests/typescript/index.js create mode 100644 scripts/parser-tests/typescript/whitelist.txt rename scripts/{tests => parser-tests}/utils/parser-test-runner.js (100%) diff --git a/.travis.yml b/.travis.yml index d9fce0df2bd8..092a03c33665 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ script: - if [ "$JOB" = "test" ]; then make -j test-ci; fi - if [ "$JOB" = "lint" ]; then make -j code-quality-ci; fi - if [ "$JOB" = "babel-parser-flow-tests" ]; then make -j test-flow-ci; fi + - if [ "$JOB" = "babel-parser-typescript-tests" ]; then make -j test-typescript-ci; fi - if [ "$JOB" = "babel-parser-test262-tests" ]; then make -j test-test262-ci; fi matrix: @@ -42,6 +43,8 @@ matrix: - node_js: "8" - node_js: "node" env: JOB=babel-parser-flow-tests + - node_js: "node" + env: JOB=babel-parser-typescript-tests - node_js: "node" env: JOB=babel-parser-test262-tests diff --git a/Makefile b/Makefile index 896425533d55..e1bc7c939168 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 TEST262_COMMIT = 8688c4ab79059c3097098605e69f1ee5eda6c409 +TYPESCRIPT_COMMIT = 038d95144d8b93c2799d1732181c89c3d84362d5 FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" @@ -111,7 +112,7 @@ lint-js: yarn eslint scripts $(SOURCES) '*.js' --format=codeframe lint-ts: - scripts/tests/typescript/lint.sh + scripts/lint-ts-typings.sh fix: fix-json fix-js @@ -159,13 +160,28 @@ bootstrap-flow: cd build/flow && git checkout $(FLOW_COMMIT) test-flow: - node scripts/tests/flow + node scripts/parser-tests/flow test-flow-ci: build-bundle-ci bootstrap-flow $(MAKE) test-flow test-flow-update-whitelist: - node scripts/tests/flow --update-whitelist + node scripts/parser-tests/flow --update-whitelist + +bootstrap-typescript: + rm -rf ./build/typescript + mkdir -p ./build + git clone --branch=master --single-branch --shallow-since=2019-09-01 https://github.com/microsoft/TypeScript.git ./build/typescript + cd build/typescript && git checkout $(TYPESCRIPT_COMMIT) + +test-typescript: + node scripts/parser-tests/typescript + +test-typescript-ci: build-bundle-ci bootstrap-typescript + $(MAKE) test-typescript + +test-typescript-update-whitelist: + node scripts/parser-tests/typescript --update-whitelist bootstrap-test262: rm -rf build/test262 @@ -174,13 +190,13 @@ bootstrap-test262: cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: - node scripts/tests/test262 + node scripts/parser-tests/test262 test-test262-ci: build-bundle-ci bootstrap-test262 $(MAKE) test-test262 test-test262-update-whitelist: - node scripts/tests/test262 --update-whitelist + node scripts/parser-tests/test262 --update-whitelist # Does not work on Windows clone-license: diff --git a/scripts/tests/typescript/lint.sh b/scripts/lint-ts-typings.sh similarity index 100% rename from scripts/tests/typescript/lint.sh rename to scripts/lint-ts-typings.sh diff --git a/scripts/tests/flow/index.js b/scripts/parser-tests/flow/index.js similarity index 100% rename from scripts/tests/flow/index.js rename to scripts/parser-tests/flow/index.js diff --git a/scripts/tests/flow/whitelist.txt b/scripts/parser-tests/flow/whitelist.txt similarity index 100% rename from scripts/tests/flow/whitelist.txt rename to scripts/parser-tests/flow/whitelist.txt diff --git a/scripts/tests/test262/index.js b/scripts/parser-tests/test262/index.js similarity index 100% rename from scripts/tests/test262/index.js rename to scripts/parser-tests/test262/index.js diff --git a/scripts/tests/test262/whitelist.txt b/scripts/parser-tests/test262/whitelist.txt similarity index 100% rename from scripts/tests/test262/whitelist.txt rename to scripts/parser-tests/test262/whitelist.txt diff --git a/scripts/parser-tests/typescript/index.js b/scripts/parser-tests/typescript/index.js new file mode 100644 index 000000000000..0de0384529c7 --- /dev/null +++ b/scripts/parser-tests/typescript/index.js @@ -0,0 +1,58 @@ +const path = require("path"); +const fs = require("fs").promises; +const ts = require("typescript"); +const TestRunner = require("../utils/parser-test-runner"); + +async function* loadTests(dir) { + const names = await fs.readdir(dir); + + for (const name of names) { + const contents = await fs.readFile(path.join(dir, name), "utf8"); + yield { name, contents }; + } +} + +const plugins = [ + "typescript", + "classProperties", + "decorators-legacy", + "bigInt", + "dynamicImport", +]; + +const runner = new TestRunner({ + testDir: path.join( + __dirname, + "../../../build/typescript/tests/cases/compiler" + ), + whitelist: path.join(__dirname, "whitelist.txt"), + logInterval: 50, + shouldUpdate: process.argv.includes("--update-whitelist"), + + async *getTests() { + for await (const test of loadTests(this.testDir)) { + const isTSX = test.name.slice(-4) === ".tsx"; + const ast = ts.createSourceFile( + test.name, + test.contents, + ts.ScriptTarget.Latest, + false, + isTSX ? ts.ScriptKind.TSX : ts.ScriptKind.TS + ); + + yield { + contents: test.contents, + fileName: test.name, + id: test.name, + expectedError: ast.parseDiagnostics.length > 0, + sourceType: "module", + plugins: isTSX ? plugins.concat("jsx") : plugins, + }; + } + }, +}); + +runner.run().catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/scripts/parser-tests/typescript/whitelist.txt b/scripts/parser-tests/typescript/whitelist.txt new file mode 100644 index 000000000000..41a3182becc5 --- /dev/null +++ b/scripts/parser-tests/typescript/whitelist.txt @@ -0,0 +1,501 @@ +ArrowFunctionExpression1.ts +ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts +MemberAccessorDeclaration15.ts +ParameterList13.ts +ParameterList4.ts +ParameterList5.ts +ParameterList6.ts +accessorParameterAccessibilityModifier.ts +accessorWithRestParam.ts +accessorWithoutBody1.ts +accessorWithoutBody2.ts +aliasUsageInAccessorsOfClass.ts +aliasUsageInArray.ts +aliasUsageInFunctionExpression.ts +aliasUsageInGenericFunction.ts +aliasUsageInIndexerOfClass.ts +aliasUsageInObjectLiteral.ts +aliasUsageInOrExpression.ts +aliasUsageInTypeArgumentOfExtendsClause.ts +aliasUsageInVarAssignment.ts +aliasUsedAsNameValue.ts +allowImportClausesToMergeWithTypes.ts +allowJscheckJsTypeParameterNoCrash.ts +alwaysStrict.ts +alwaysStrictES6.ts +alwaysStrictModule.ts +alwaysStrictModule2.ts +alwaysStrictNoImplicitUseStrict.ts +ambientWithStatements.ts +amdDeclarationEmitNoExtraDeclare.ts +amdModuleConstEnumUsage.ts +amdModuleName2.ts +anyDeclare.ts +argumentsBindsToFunctionScopeArgumentList.ts +arrayOfExportedClass.ts +arrowFunctionErrorSpan.ts +asiReturn.ts +assignToInvalidLHS.ts +assignmentToParenthesizedExpression1.ts +asyncFunctionsAcrossFiles.ts +augmentExportEquals1.ts +augmentExportEquals1_1.ts +augmentExportEquals2.ts +augmentExportEquals2_1.ts +augmentExportEquals3.ts +augmentExportEquals3_1.ts +augmentExportEquals4.ts +augmentExportEquals4_1.ts +augmentExportEquals6.ts +augmentExportEquals6_1.ts +augmentExportEquals7.ts +augmentedTypesClass.ts +augmentedTypesClass2.ts +augmentedTypesClass2a.ts +augmentedTypesClass4.ts +augmentedTypesEnum.ts +augmentedTypesEnum2.ts +augmentedTypesFunction.ts +augmentedTypesInterface.ts +augmentedTypesVar.ts +awaitInNonAsyncFunction.ts +awaitLiteralValues.ts +bigIntWithTargetES3.ts +bigintWithLib.ts +breakNotInIterationOrSwitchStatement1.ts +breakNotInIterationOrSwitchStatement2.ts +breakTarget5.ts +breakTarget6.ts +cacheResolutions.ts +cachedModuleResolution1.ts +cachedModuleResolution2.ts +cachedModuleResolution3.ts +cachedModuleResolution4.ts +cachedModuleResolution5.ts +cachedModuleResolution6.ts +cachedModuleResolution7.ts +cachedModuleResolution8.ts +cachedModuleResolution9.ts +callOverloads2.ts +catchClauseWithInitializer1.ts +catchClauseWithTypeAnnotation.ts +checkSuperCallBeforeThisAccessing9.ts +classCannotExtendVar.ts +classExpressionPropertyModifiers.ts +classExpressionWithDecorator1.ts +classExtendsAcrossFiles.ts +classExtendsMultipleBaseClasses.ts +classHeritageWithTrailingSeparator.ts +classOverloadForFunction.ts +collisionArgumentsArrowFunctions.ts +collisionArgumentsClassConstructor.ts +collisionArgumentsClassMethod.ts +collisionArgumentsFunction.ts +collisionArgumentsFunctionExpressions.ts +collisionExportsRequireAndClass.ts +commonSourceDir5.ts +commonSourceDir6.ts +commonjsSafeImport.ts +complicatedPrivacy.ts +conflictingTypeAnnotatedVar.ts +constDeclarationShadowedByVarDeclaration.ts +constDeclarations-invalidContexts.ts +constDeclarations-scopes.ts +constDeclarations-validContexts.ts +constEnumNoPreserveDeclarationReexport.ts +constEnumPreserveEmitReexport.ts +constInClassExpression.ts +constructorArgsErrors1.ts +constructorArgsErrors2.ts +constructorArgsErrors3.ts +constructorArgsErrors4.ts +constructorArgsErrors5.ts +continueNotInIterationStatement1.ts +continueNotInIterationStatement2.ts +continueNotInIterationStatement3.ts +continueNotInIterationStatement4.ts +continueTarget1.ts +continueTarget5.ts +continueTarget6.ts +convertKeywordsYes.ts +declarationEmitAmdModuleNameDirective.ts +declarationEmitComputedNameCausesImportToBePainted.ts +declarationEmitComputedNameConstEnumAlias.ts +declarationEmitCrossFileImportTypeOfAmbientModule.ts +declarationEmitDefaultExportWithStaticAssignment.ts +declarationEmitDestructuring2.ts +declarationEmitDestructuringOptionalBindingParametersInOverloads.ts +declarationEmitDestructuringParameterProperties.ts +declarationEmitDestructuringWithOptionalBindingParameters.ts +declarationEmitExpandoPropertyPrivateName.ts +declarationEmitExportAssignment.ts +declarationEmitExportDeclaration.ts +declarationEmitForTypesWhichNeedImportTypes.ts +declarationEmitInterfaceWithNonEntityNameExpressionHeritage.ts +declarationEmitPrefersPathKindBasedOnBundling.ts +declarationEmitPrefersPathKindBasedOnBundling2.ts +declarationEmitPrivateSymbolCausesVarDeclarationEmit2.ts +declarationMapsMultifile.ts +declarationMapsOutFile.ts +declarationsForInferredTypeFromOtherFile.ts +declareAlreadySeen.ts +declareModifierOnImport1.ts +decoratorMetadataRestParameterWithImportedType.ts +decoratorMetadataWithImportDeclarationNameCollision.ts +decoratorMetadataWithImportDeclarationNameCollision3.ts +decoratorMetadataWithImportDeclarationNameCollision4.ts +decoratorMetadataWithImportDeclarationNameCollision5.ts +decoratorMetadataWithImportDeclarationNameCollision7.ts +decoratorReferenceOnOtherProperty.ts +decoratorsOnComputedProperties.ts +decrementAndIncrementOperators.ts +defaultArgsInOverloads.ts +defaultDeclarationEmitDefaultImport.ts +defaultIsNotVisibleInLocalScope.ts +defaultPropsEmptyCurlyBecomesAnyForJs.ts +defaultValueInFunctionTypes.ts +deleteOperator1.ts +deleteOperatorInStrictMode.ts +dependencyViaImportAlias.ts +destructureOptionalParameter.ts +destructuredDeclarationEmit.ts +doubleUnderscoreExportStarConflict.ts +downlevelLetConst1.ts +duplicateIdentifierBindingElementInParameterDeclaration1.ts +duplicateIdentifierBindingElementInParameterDeclaration2.ts +duplicateIdentifierEnum.ts +duplicateIdentifierInCatchBlock.ts +duplicateIdentifierRelatedSpans1.ts +duplicateIdentifierRelatedSpans2.ts +duplicateIdentifiersAcrossFileBoundaries.ts +duplicateLabel1.ts +duplicateLabel2.ts +duplicateVarAndImport.ts +duplicateVarAndImport2.ts +duplicateVarsAcrossFileBoundaries.ts +dynamicImportTrailingComma.ts +dynamicNames.ts +elidedEmbeddedStatementsReplacedWithSemicolon.ts +emitClassMergedWithConstNamespaceNotElided.ts +emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts +emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts +emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts +emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts +emitThisInSuperMethodCall.ts +enumGenericTypeClash.ts +enumIdentifierLiterals.ts +errorOnInitializerInInterfaceProperty.ts +errorOnInitializerInObjectTypeLiteralProperty.ts +es3-oldStyleOctalLiteralInEnums.ts +es3-oldStyleOctalLiteralTypes.ts +es3defaultAliasIsQuoted.ts +es5-asyncFunctionWithStatements.ts +es5-importHelpersAsyncFunctions.ts +es5-oldStyleOctalLiteralInEnums.ts +es5ModuleInternalNamedImports.ts +es6ExportAssignment2.ts +es6ExportAssignment3.ts +es6ImportDefaultBindingFollowedWithNamedImport.ts +es6ImportDefaultBindingFollowedWithNamedImport1.ts +es6ImportDefaultBindingFollowedWithNamedImport1InEs5.ts +es6ImportDefaultBindingFollowedWithNamedImport1WithExport.ts +es6ImportDefaultBindingFollowedWithNamedImportDts.ts +es6ImportDefaultBindingFollowedWithNamedImportDts1.ts +es6ImportDefaultBindingFollowedWithNamedImportInEs5.ts +es6ImportDefaultBindingFollowedWithNamedImportWithExport.ts +es6ImportDefaultBindingFollowedWithNamespaceBinding1WithExport.ts +es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.ts +es6ImportDefaultBindingMergeErrors.ts +es6ImportDefaultBindingWithExport.ts +es6ImportEqualsDeclaration.ts +es6ImportEqualsExportModuleCommonJsError.ts +es6ImportEqualsExportModuleEs2015Error.ts +es6ImportNameSpaceImportMergeErrors.ts +es6ImportNameSpaceImportWithExport.ts +es6ImportNamedImport.ts +es6ImportNamedImportAmd.ts +es6ImportNamedImportDts.ts +es6ImportNamedImportInEs5.ts +es6ImportNamedImportInExportAssignment.ts +es6ImportNamedImportMergeErrors.ts +es6ImportNamedImportNoExportMember.ts +es6ImportNamedImportNoNamedExports.ts +es6ImportNamedImportWithExport.ts +es6ImportNamedImportWithTypesAndValues.ts +es6ImportWithoutFromClauseWithExport.ts +es6ModuleInternalNamedImports.ts +es6ModuleInternalNamedImports2.ts +es6UseOfTopLevelRequire.ts +esModuleInterop.ts +esModuleInteropImportTSLibHasImport.ts +esModuleInteropNamedDefaultImports.ts +esModuleInteropTslibHelpers.ts +exportAlreadySeen.ts +exportAssignClassAndModule.ts +exportAssignmentImportMergeNoCrash.ts +exportAssignmentMembersVisibleInAugmentation.ts +exportAssignmentWithDeclareAndExportModifiers.ts +exportAssignmentWithDeclareModifier.ts +exportAssignmentWithExportModifier.ts +exportAssignmentWithoutAllowSyntheticDefaultImportsError.ts +exportClassExtendingIntersection.ts +exportClassWithoutName.ts +exportDeclarationInInternalModule.ts +exportDeclarationsInAmbientNamespaces.ts +exportDefaultAbstractClass.ts +exportDefaultAsyncFunction2.ts +exportDefaultMarksIdentifierAsUsed.ts +exportDefaultStripsFreshness.ts +exportEqualsOfModule.ts +exportImport.ts +exportImportNonInstantiatedModule2.ts +exportSameNameFuncVar.ts +exportSpecifierAndExportedMemberDeclaration.ts +exportSpecifierAndLocalMemberDeclaration.ts +exportStarFromEmptyModule.ts +expressionsForbiddenInParameterInitializers.ts +extendingClassFromAliasAndUsageInIndexer.ts +extendsClauseAlreadySeen.ts +extendsClauseAlreadySeen2.ts +externalModuleAssignToVar.ts +fatarrowfunctionsOptionalArgsErrors1.ts +fileWithNextLine2.ts +fileWithNextLine3.ts +funClodule.ts +functionAndImportNameConflict.ts +functionCall15.ts +functionDeclarationWithResolutionOfTypeNamedArguments01.ts +functionExpressionInWithBlock.ts +functionExpressionWithResolutionOfTypeNamedArguments01.ts +functionsWithModifiersInBlocks1.ts +gettersAndSettersErrors.ts +giant.ts +illegalModifiersOnClassElements.ts +illegalSuperCallsInConstructor.ts +implementClausePrecedingExtends.ts +implementsClauseAlreadySeen.ts +importAndVariableDeclarationConflict1.ts +importAndVariableDeclarationConflict3.ts +importAndVariableDeclarationConflict4.ts +importAsBaseClass.ts +importDecl.ts +importDeclWithClassModifiers.ts +importDeclWithDeclareModifier.ts +importDeclWithDeclareModifierInAmbientContext.ts +importHelpers.ts +importHelpersAmd.ts +importHelpersInAmbientContext.ts +importHelpersInIsolatedModules.ts +importHelpersInTsx.tsx +importHelpersNoHelpers.ts +importHelpersNoModule.ts +importHelpersOutFile.ts +importHelpersSystem.ts +importWithTrailingSlash.ts +importedModuleClassNameClash.ts +indexSignatureTypeCheck.ts +indexSignatureTypeCheck2.ts +indexSignatureWithAccessibilityModifier.ts +indexSignatureWithInitializer1.ts +indexTypeCheck.ts +indexWithoutParamType.ts +indexerAsOptional.ts +indexerSignatureWithRestParam.ts +initializedParameterBeforeNonoptionalNotOptional.ts +interfaceMayNotBeExtendedWitACall.ts +interfaceWithImplements1.ts +invalidContinueInDownlevelAsync.ts +invalidReferenceSyntax1.ts +isLiteral1.ts +isLiteral2.ts +isolatedModulesReExportType.ts +jsEnumTagOnObjectFrozen.ts +jsFileCompilationBindDuplicateIdentifier.ts +jsFileCompilationBindErrors.ts +jsFileCompilationDuplicateFunctionImplementation.ts +jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts +jsFileCompilationExternalPackageError.ts +jsNoImplicitAnyNoCascadingReferenceErrors.ts +jsdocAccessEnumType.ts +jsxAttributeWithoutExpressionReact.tsx +letAndVarRedeclaration.ts +letAsIdentifier.ts +letAsIdentifierInStrictMode.ts +letDeclarations-invalidContexts.ts +letDeclarations-scopes-duplicates.ts +letDeclarations-scopes-duplicates2.ts +letDeclarations-scopes-duplicates3.ts +letDeclarations-scopes-duplicates4.ts +letDeclarations-scopes-duplicates5.ts +letDeclarations-scopes-duplicates6.ts +letDeclarations-scopes-duplicates7.ts +letDeclarations-scopes.ts +letDeclarations-validContexts.ts +literalsInComputedProperties1.ts +mergeWithImportedType.ts +mergedDeclarations6.ts +metadataOfClassFromAlias.ts +metadataOfClassFromAlias2.ts +metadataReferencedWithinFilteredUnion.ts +mismatchedClassConstructorVariable.ts +missingSemicolonInModuleSpecifier.ts +misspelledNewMetaProperty.ts +modifierOnParameter1.ts +modifiersInObjectLiterals.ts +modifiersOnInterfaceIndexSignature1.ts +moduleAugmentationCollidingNamesInAugmentation1.ts +moduleAugmentationDeclarationEmit1.ts +moduleAugmentationDeclarationEmit2.ts +moduleAugmentationDisallowedExtensions.ts +moduleAugmentationDuringSyntheticDefaultCheck.ts +moduleAugmentationExtendAmbientModule1.ts +moduleAugmentationExtendAmbientModule2.ts +moduleAugmentationExtendFileModule1.ts +moduleAugmentationExtendFileModule2.ts +moduleAugmentationGlobal1.ts +moduleAugmentationGlobal2.ts +moduleAugmentationGlobal3.ts +moduleAugmentationImportsAndExports1.ts +moduleAugmentationImportsAndExports2.ts +moduleAugmentationImportsAndExports3.ts +moduleAugmentationImportsAndExports4.ts +moduleAugmentationImportsAndExports5.ts +moduleAugmentationImportsAndExports6.ts +moduleAugmentationNoNewNames.ts +moduleAugmentationsBundledOutput1.ts +moduleAugmentationsImports1.ts +moduleAugmentationsImports2.ts +moduleAugmentationsImports3.ts +moduleAugmentationsImports4.ts +moduleDuplicateIdentifiers.ts +moduleElementsInWrongContext.ts +moduleElementsInWrongContext2.ts +moduleElementsInWrongContext3.ts +moduleResolutionNoTs.ts +moduleResolutionWithSymlinks.ts +moduleResolutionWithSymlinks_withOutDir.ts +moduleResolution_automaticTypeDirectiveNames.ts +moduleSharesNameWithImportDeclarationInsideIt3.ts +moduleSharesNameWithImportDeclarationInsideIt5.ts +module_augmentUninstantiatedModule2.ts +multiImportExport.ts +multiLinePropertyAccessAndArrowFunctionIndent1.ts +multipleClassPropertyModifiers.ts +multipleClassPropertyModifiersErrors.ts +multipleInheritance.ts +nameCollisions.ts +narrowedImports.ts +newNamesInGlobalAugmentations1.ts +noBundledEmitFromNodeModules.ts +noCrashOnImportShadowing.ts +noImplicitAnyDestructuringVarDeclaration.ts +noSymbolForMergeCrash.ts +nodeResolution4.ts +nodeResolution6.ts +nodeResolution8.ts +nonMergedOverloads.ts +numberVsBigIntOperations.ts +objectBindingPattern_restElementWithPropertyName.ts +objectLiteralMemberWithModifiers1.ts +objectLiteralMemberWithModifiers2.ts +objectLiteralMemberWithQuestionMark1.ts +objectLiteralMemberWithoutBlock1.ts +objectTypeWithOptionalProperty1.ts +outModuleConcatAmd.ts +outModuleConcatCommonjs.ts +outModuleConcatCommonjsDeclarationOnly.ts +outModuleConcatES6.ts +outModuleConcatSystem.ts +outModuleConcatUmd.ts +outModuleTripleSlashRefs.ts +parameterInitializerBeforeDestructuringEmit.ts +parameterPropertyOutsideConstructor.ts +parseGenericArrowRatherThanLeftShift.ts +pathMappingBasedModuleResolution3_classic.ts +pathMappingBasedModuleResolution3_node.ts +privacyCheckExternalModuleExportAssignmentOfGenericClass.ts +privacyImportParseErrors.ts +privacyTopLevelAmbientExternalModuleImportWithExport.ts +privacyTopLevelAmbientExternalModuleImportWithoutExport.ts +reExportGlobalDeclaration1.ts +reExportUndefined1.ts +reExportUndefined2.ts +readonlyInNonPropertyParameters.ts +recursiveExportAssignmentAndFindAliasedType1.ts +recursiveExportAssignmentAndFindAliasedType2.ts +recursiveExportAssignmentAndFindAliasedType3.ts +recursiveExportAssignmentAndFindAliasedType4.ts +recursiveExportAssignmentAndFindAliasedType5.ts +recursiveExportAssignmentAndFindAliasedType6.ts +recursiveExportAssignmentAndFindAliasedType7.ts +redeclareParameterInCatchBlock.ts +reexportedMissingAlias.ts +relativeNamesInClassicResolution.ts +requireAsFunctionInExternalModule.ts +restParamAsOptional.ts +restParamModifier2.ts +restParameterNotLast.ts +restParameterWithBindingPattern3.ts +shadowedReservedCompilerDeclarationsWithNoEmit.ts +shadowingViaLocalValue.ts +shadowingViaLocalValueOrBindingElement.ts +shorthandPropertyAssignmentInES6Module.ts +shorthandPropertyAssignmentsInDestructuring.ts +shorthandPropertyAssignmentsInDestructuring_ES6.ts +sourceMap-LineBreaks.ts +sourceMapValidationDecorators.ts +sourceMapValidationStatements.ts +spaceBeforeQuestionMarkInPropertyAssignment.ts +standaloneBreak.ts +staticIndexer.ts +staticModifierAlreadySeen.ts +staticMustPrecedePublic.ts +staticPrototypeProperty.ts +strictModeReservedWord.ts +strictModeReservedWordInClassDeclaration.ts +superCallFromClassThatHasNoBaseType1.ts +superCallFromFunction1.ts +superCallOutsideConstructor.ts +superCallsInConstructor.ts +superInObjectLiterals_ES5.ts +superInObjectLiterals_ES6.ts +super_inside-object-literal-getters-and-setters.ts +switchStatementsWithMultipleDefaults1.ts +symbolLinkDeclarationEmitModuleNames.ts +symbolMergeValueAndImportedType.ts +systemExportAssignment.ts +systemExportAssignment2.ts +systemModule11.ts +systemModule15.ts +systemModule17.ts +systemModuleWithSuperClass.ts +systemObjectShorthandRename.ts +targetEs6DecoratorMetadataImportNotElided.ts +targetTypeCastTest.ts +throwWithoutNewLine2.ts +tsxDeepAttributeAssignabilityError.tsx +typeReferenceDirectives10.ts +typeReferenceDirectives11.ts +typeReferenceDirectives12.ts +typeReferenceDirectives13.ts +typeReferenceDirectives5.ts +typeReferenceDirectives7.ts +typeReferenceDirectives8.ts +typeReferenceDirectives9.ts +unaryOperatorsInStrictMode.ts +unusedImports1.ts +unusedImports11.ts +unusedImports12.ts +unusedImports2.ts +unusedImports3.ts +unusedImports4.ts +unusedImports5.ts +unusedInvalidTypeArguments.ts +varAndFunctionShareName.ts +varArgConstructorMemberParameter.ts +variableDeclarationInStrictMode1.ts +withStatement.ts +withStatementErrors.ts +withStatementInternalComments.ts +withStatementNestedScope.ts +yieldStringLiteral.ts diff --git a/scripts/tests/utils/parser-test-runner.js b/scripts/parser-tests/utils/parser-test-runner.js similarity index 100% rename from scripts/tests/utils/parser-test-runner.js rename to scripts/parser-tests/utils/parser-test-runner.js From d18afbd7c3e977208194acbea4c0de0313a6e1eb Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Wed, 4 Dec 2019 02:32:36 +0900 Subject: [PATCH 840/965] Allow tuple rest trailing comma (#10800) --- .../src/plugins/typescript/index.js | 7 +- .../types/tuple-rest-trailing-comma/input.ts | 1 + .../tuple-rest-trailing-comma/output.json | 178 ++++++++++++++++++ 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 1ca9c6a71cce..2b442620a507 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -618,7 +618,12 @@ export default (superClass: Class): Class => const restNode: N.TsRestType = this.startNode(); this.next(); // skips ellipsis restNode.typeAnnotation = this.tsParseType(); - this.checkCommaAfterRest(charCodes.rightSquareBracket); + if ( + this.match(tt.comma) && + this.lookaheadCharCode() !== charCodes.rightSquareBracket + ) { + this.raiseRestNotLast(this.state.start); + } return this.finishNode(restNode, "TSRestType"); } diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/input.ts b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/input.ts new file mode 100644 index 000000000000..416732dd8c56 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/input.ts @@ -0,0 +1 @@ +let x: [string, ...string[],] diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json new file mode 100644 index 000000000000..28b281a6ccdc --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json @@ -0,0 +1,178 @@ +{ + "type": "File", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 29 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 5, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "typeAnnotation": { + "type": "TSTupleType", + "start": 7, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "elementTypes": [ + { + "type": "TSStringKeyword", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + { + "type": "TSRestType", + "start": 16, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "typeAnnotation": { + "type": "TSArrayType", + "start": 19, + "end": 27, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 27 + } + }, + "elementType": { + "type": "TSStringKeyword", + "start": 19, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 25 + } + } + } + } + } + ] + } + } + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file From 3d0c5d2afc4ef02412f0c67293dbc9d80a97187a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 4 Dec 2019 01:09:14 +0100 Subject: [PATCH 841/965] Do not transpile typeof helper with itself in babel/runtime (#10788) * Do not transpile typeof helper with itself in babel/runtime * Nits * Remove console.log --- .../package.json | 1 + .../scripts/build-dist.js | 20 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index f73c1269fcb8..2c7415ae94ad 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -24,6 +24,7 @@ "@babel/core": "^7.7.4", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/helpers": "^7.7.4", + "@babel/plugin-transform-typeof-symbol": "^7.7.4", "@babel/preset-env": "^7.7.4", "@babel/runtime": "^7.7.4", "@babel/template": "^7.7.4", diff --git a/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/packages/babel-plugin-transform-runtime/scripts/build-dist.js index e36ef0c68b0a..a107bbea1fa2 100644 --- a/packages/babel-plugin-transform-runtime/scripts/build-dist.js +++ b/packages/babel-plugin-transform-runtime/scripts/build-dist.js @@ -9,6 +9,7 @@ const t = require("@babel/types"); const transformRuntime = require("../"); +const runtimeVersion = require("@babel/runtime/package.json").version; const corejs2Definitions = require("../lib/runtime-corejs2-definitions").default(); const corejs3Definitions = require("../lib/runtime-corejs3-definitions").default(); @@ -151,15 +152,30 @@ function buildHelper( tree.body.push(...helper.nodes); return babel.transformFromAst(tree, null, { - presets: [[require("@babel/preset-env"), { modules: false }]], + filename: helperFilename, + presets: [ + [ + "@babel/preset-env", + { modules: false, exclude: ["@babel/plugin-transform-typeof-symbol"] }, + ], + ], plugins: [ - [transformRuntime, { corejs, useESModules: esm }], + [ + transformRuntime, + { corejs, useESModules: esm, version: runtimeVersion }, + ], buildRuntimeRewritePlugin( runtimeName, path.relative(path.dirname(helperFilename), pkgDirname), helperName ), ], + overrides: [ + { + exclude: /typeof/, + plugins: ["@babel/plugin-transform-typeof-symbol"], + }, + ], }).code; } From bb6cc619796666668c8228094bf6beecfbb86ce4 Mon Sep 17 00:00:00 2001 From: Alex Lewis Date: Wed, 4 Dec 2019 06:56:25 -0500 Subject: [PATCH 842/965] fix(optional chaining): Optional delete returns true with nullish base (#10806) Per issue 10805, the return value when using delete on a nullish base is currently undefined. The correct return type should be true. --- .../typeof-reserved-invalid-1/options.json | 7 ++----- .../typeof-reserved-invalid-5/options.json | 7 ++----- .../babel-plugin-proposal-optional-chaining/src/index.js | 6 +++++- .../test/fixtures/general/delete/exec.js | 2 +- .../test/fixtures/general/delete/output.js | 8 ++++---- .../test/fixtures/regression/9346/options.json | 4 +--- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json index 151f6c5a3cd5..077518333db1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-1/options.json @@ -1,8 +1,5 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ], + "plugins": ["jsx", "flow"], "throws": "Unexpected token, expected \"{\" (2:26)" -} \ No newline at end of file +} diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json index 749dcb796d32..a06d10b640b8 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-invalid-5/options.json @@ -1,8 +1,5 @@ { "sourceType": "module", - "plugins": [ - "jsx", - "flow" - ], + "plugins": ["jsx", "flow"], "throws": "Unexpected token (2:23)" -} \ No newline at end of file +} diff --git a/packages/babel-plugin-proposal-optional-chaining/src/index.js b/packages/babel-plugin-proposal-optional-chaining/src/index.js index 918a59ade508..6a30dc74b909 100644 --- a/packages/babel-plugin-proposal-optional-chaining/src/index.js +++ b/packages/babel-plugin-proposal-optional-chaining/src/index.js @@ -14,6 +14,7 @@ export default declare((api, options) => { visitor: { "OptionalCallExpression|OptionalMemberExpression"(path) { const { parentPath, scope } = path; + let isDeleteOperation = false; const optionals = []; let optionalPath = path; @@ -38,6 +39,7 @@ export default declare((api, options) => { let replacementPath = path; if (parentPath.isUnaryExpression({ operator: "delete" })) { replacementPath = parentPath; + isDeleteOperation = true; } for (let i = optionals.length - 1; i >= 0; i--) { const node = optionals[i]; @@ -113,7 +115,9 @@ export default declare((api, options) => { scope.buildUndefinedNode(), ), ), - scope.buildUndefinedNode(), + isDeleteOperation + ? t.booleanLiteral(true) + : scope.buildUndefinedNode(), replacementPath.node, ), ); diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/exec.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/exec.js index b2ecbb0a69c0..51021b6cbdb9 100644 --- a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/exec.js +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/exec.js @@ -16,7 +16,7 @@ expect(test).toBe(true); test = delete obj?.b?.b; expect(obj.b).toBeUndefined(); -expect(test).toBeUndefined(); +expect(test).toBe(true); delete obj?.a; expect(obj.a).toBeUndefined(); diff --git a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/output.js b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/output.js index 5a9498166caf..e5260f8ca9a0 100644 --- a/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/output.js +++ b/packages/babel-plugin-proposal-optional-chaining/test/fixtures/general/delete/output.js @@ -7,7 +7,7 @@ const obj = { b: 0 } }; -let test = obj === null || obj === void 0 ? void 0 : (_obj$a = obj.a) === null || _obj$a === void 0 ? void 0 : delete _obj$a.b; -test = obj === null || obj === void 0 ? void 0 : delete obj.a.b; -test = obj === null || obj === void 0 ? void 0 : (_obj$b = obj.b) === null || _obj$b === void 0 ? void 0 : delete _obj$b.b; -obj === null || obj === void 0 ? void 0 : delete obj.a; +let test = obj === null || obj === void 0 ? true : (_obj$a = obj.a) === null || _obj$a === void 0 ? true : delete _obj$a.b; +test = obj === null || obj === void 0 ? true : delete obj.a.b; +test = obj === null || obj === void 0 ? true : (_obj$b = obj.b) === null || _obj$b === void 0 ? true : delete _obj$b.b; +obj === null || obj === void 0 ? true : delete obj.a; diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json index 9e5a4ccdb0df..8cbc099aab70 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "transform-modules-amd" - ] + "plugins": ["transform-modules-amd"] } From e94da0dce5f3101cb3a77f78e1b6802ddf2c6cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 4 Dec 2019 18:35:37 -0500 Subject: [PATCH 843/965] Incorrect trace position in fixture runner (#10566) * test: add test case * fix: incorrect fixture callsite position --- .../src/index.js | 6 ++++-- .../test/index.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/babel-helper-transform-fixture-test-runner/src/index.js b/packages/babel-helper-transform-fixture-test-runner/src/index.js index eed9dde11342..0ec7c043c16e 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -62,11 +62,12 @@ function runModuleInTestContext(id: string, relativeFilename: string) { const req = id => runModuleInTestContext(id, filename); const src = fs.readFileSync(filename, "utf8"); - const code = `(function (exports, require, module, __filename, __dirname) {${src}\n});`; + const code = `(function (exports, require, module, __filename, __dirname) {\n${src}\n});`; vm.runInContext(code, testContext, { filename, displayErrors: true, + lineOffset: -1, }).call(module.exports, module.exports, req, module, filename, dirname); return module.exports; @@ -94,10 +95,11 @@ export function runCodeInTestContext(code: string, opts: { filename: string }) { // Expose the test options as "opts", but otherwise run the test in a CommonJS-like environment. // Note: This isn't doing .call(module.exports, ...) because some of our tests currently // rely on 'this === global'. - const src = `(function(exports, require, module, __filename, __dirname, opts) {${code}\n});`; + const src = `(function(exports, require, module, __filename, __dirname, opts) {\n${code}\n});`; return vm.runInContext(src, testContext, { filename, displayErrors: true, + lineOffset: -1, })(module.exports, req, module, filename, dirname, opts); } finally { process.chdir(oldCwd); diff --git a/packages/babel-helper-transform-fixture-test-runner/test/index.js b/packages/babel-helper-transform-fixture-test-runner/test/index.js index 2ec3d6bb2cce..1d02bf80290f 100644 --- a/packages/babel-helper-transform-fixture-test-runner/test/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/test/index.js @@ -35,4 +35,17 @@ describe("helper-transform-fixture-test-runner", function() { ); } }); + it("should print correct trace position when error is thrown in the first line", () => { + const opts = { + filename: `${__filename}.fake4`, + }; + runCodeInTestContext( + `try { throw new Error() } catch (e) { + opts.stack = e.stack + } + `, + opts, + ); + expect(opts.stack).toContain(opts.filename + ":1:13"); + }); }); From 2b472912e4a0f0994193d07a476512cc47ffdece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 4 Dec 2019 22:28:25 -0500 Subject: [PATCH 844/965] Tune makefile scripts (#10781) * chore: replace node by `yarn node` * chore: fix tsc command * chore: use `yarn` to wrap node * chore: supress yarn run output * chore: disable silent mode for builtin yarn command --- Makefile | 69 ++++++++++++++++++++------------------ scripts/lint-ts-typings.sh | 3 +- scripts/test-cov.sh | 3 +- scripts/test.sh | 6 ++-- 4 files changed, 42 insertions(+), 39 deletions(-) diff --git a/Makefile b/Makefile index e1bc7c939168..50ff34f61cba 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ EMPTY := SPACE := $(EMPTY) $(EMPTY) COMMA_SEPARATED_SOURCES = $(subst $(SPACE),$(COMMA),$(SOURCES)) +YARN := yarn --silent +NODE := $(YARN) node + .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap @@ -23,10 +26,10 @@ ifneq ("$(BABEL_COVERAGE)", "true") endif build-bundle: clean clean-lib - yarn gulp build + $(YARN) gulp build $(MAKE) generate-standalone generate-type-helpers # call build again as the generated files might need to be compiled again. - yarn gulp build + $(YARN) gulp build $(MAKE) build-typings $(MAKE) build-dist @@ -34,18 +37,18 @@ build-bundle-ci: bootstrap-only $(MAKE) build-bundle generate-standalone: - node packages/babel-standalone/scripts/generate.js + $(NODE) packages/babel-standalone/scripts/generate.js generate-type-helpers: - node packages/babel-types/scripts/generateTypeHelpers.js + $(NODE) packages/babel-types/scripts/generateTypeHelpers.js build-typings: build-flow-typings build-typescript-typings build-flow-typings: - node packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow + $(NODE) packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow build-typescript-typings: - node packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts + $(NODE) packages/babel-types/scripts/generators/typescript.js > packages/babel-types/lib/index.d.ts build-standalone: build-babel-standalone build-preset-env-standalone @@ -53,16 +56,16 @@ build-standalone-ci: build-bundle-ci $(MAKE) build-standalone build-babel-standalone: - yarn gulp build-babel-standalone + $(YARN) gulp build-babel-standalone build-preset-env-standalone: - yarn gulp build-babel-preset-env-standalone + $(YARN) gulp build-babel-preset-env-standalone prepublish-build-standalone: - BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-standalone + BABEL_ENV=production IS_PUBLISH=true $(YARN) gulp build-babel-standalone prepublish-build-preset-env-standalone: - BABEL_ENV=production IS_PUBLISH=true yarn gulp build-babel-preset-env-standalone + BABEL_ENV=production IS_PUBLISH=true $(YARN) gulp build-babel-preset-env-standalone build-dist: build-polyfill-dist build-plugin-transform-runtime-dist @@ -72,17 +75,17 @@ build-polyfill-dist: build-plugin-transform-runtime-dist: cd packages/babel-plugin-transform-runtime; \ - node scripts/build-dist.js + $(NODE) scripts/build-dist.js build-no-bundle: clean clean-lib - BABEL_ENV=development yarn gulp build-no-bundle + BABEL_ENV=development $(YARN) gulp build-no-bundle # Ensure that build artifacts for types are created during local # development too. $(MAKE) generate-type-helpers $(MAKE) build-typings watch: build-no-bundle - BABEL_ENV=development yarn gulp watch + BABEL_ENV=development $(YARN) gulp watch code-quality-ci: flowcheck-ci lint-ci @@ -92,10 +95,10 @@ flowcheck-ci: bootstrap-flowcheck code-quality: flow lint flow: - yarn flow check --strip-root + $(YARN) flow check --strip-root bootstrap-flowcheck: bootstrap-only - yarn gulp build-babel-types + $(YARN) gulp build-babel-types $(MAKE) build-typings lint-ci: lint-js-ci lint-ts-ci @@ -109,7 +112,7 @@ lint-ts-ci: bootstrap-flowcheck lint: lint-js lint-ts lint-js: - yarn eslint scripts $(SOURCES) '*.js' --format=codeframe + $(YARN) eslint scripts $(SOURCES) '*.js' --format=codeframe lint-ts: scripts/lint-ts-typings.sh @@ -117,10 +120,10 @@ lint-ts: fix: fix-json fix-js fix-js: - yarn eslint scripts $(SOURCES) '*.js' --format=codeframe --fix + $(YARN) eslint scripts $(SOURCES) '*.js' --format=codeframe --fix fix-json: - yarn prettier "{$(COMMA_SEPARATED_SOURCES)}/*/test/fixtures/**/options.json" --write --loglevel warn + $(YARN) prettier "{$(COMMA_SEPARATED_SOURCES)}/*/test/fixtures/**/options.json" --write --loglevel warn clean: test-clean rm -f .npmrc @@ -133,7 +136,7 @@ test-clean: $(foreach source, $(SOURCES), \ $(call clean-source-test, $(source))) -# Does not work on Windows; use "yarn jest" instead +# Does not work on Windows; use "$(YARN) jest" instead test-only: BABEL_ENV=test ./scripts/test.sh $(MAKE) test-clean @@ -143,7 +146,7 @@ test: lint test-only test-ci: jest-ci jest-ci: build-standalone-ci - BABEL_ENV=test yarn jest --maxWorkers=4 --ci + BABEL_ENV=test $(YARN) jest --maxWorkers=4 --ci $(MAKE) test-clean # Does not work on Windows @@ -160,13 +163,13 @@ bootstrap-flow: cd build/flow && git checkout $(FLOW_COMMIT) test-flow: - node scripts/parser-tests/flow + $(NODE) scripts/parser-tests/flow test-flow-ci: build-bundle-ci bootstrap-flow $(MAKE) test-flow test-flow-update-whitelist: - node scripts/parser-tests/flow --update-whitelist + $(NODE) scripts/parser-tests/flow --update-whitelist bootstrap-typescript: rm -rf ./build/typescript @@ -175,13 +178,13 @@ bootstrap-typescript: cd build/typescript && git checkout $(TYPESCRIPT_COMMIT) test-typescript: - node scripts/parser-tests/typescript + $(NODE) scripts/parser-tests/typescript test-typescript-ci: build-bundle-ci bootstrap-typescript $(MAKE) test-typescript test-typescript-update-whitelist: - node scripts/parser-tests/typescript --update-whitelist + $(NODE) scripts/parser-tests/typescript --update-whitelist bootstrap-test262: rm -rf build/test262 @@ -190,13 +193,13 @@ bootstrap-test262: cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: - node scripts/parser-tests/test262 + $(NODE) scripts/parser-tests/test262 test-test262-ci: build-bundle-ci bootstrap-test262 $(MAKE) test-test262 test-test262-update-whitelist: - node scripts/parser-tests/test262 --update-whitelist + $(NODE) scripts/parser-tests/test262 --update-whitelist # Does not work on Windows clone-license: @@ -213,11 +216,11 @@ prepublish: new-version: git pull --rebase - yarn lerna version --force-publish=$(FORCE_PUBLISH) + $(YARN) lerna version --force-publish=$(FORCE_PUBLISH) # NOTE: Run make new-version first publish: prepublish - yarn lerna publish from-git + $(YARN) lerna publish from-git $(MAKE) clean publish-ci: prepublish @@ -227,7 +230,7 @@ else echo "Missing NPM_TOKEN env var" exit 1 endif - yarn lerna publish from-git --yes + $(YARN) lerna publish from-git --yes rm -f .npmrc $(MAKE) clean @@ -237,8 +240,8 @@ ifneq ("$(I_AM_USING_VERDACCIO)", "I_AM_SURE") exit 1 endif $(MAKE) prepublish-build - yarn lerna version patch --force-publish=$(FORCE_PUBLISH) --no-push --yes --tag-version-prefix="version-e2e-test-" - yarn lerna publish from-git --registry http://localhost:4873 --yes --tag-version-prefix="version-e2e-test-" + $(YARN) lerna version patch --force-publish=$(FORCE_PUBLISH) --no-push --yes --tag-version-prefix="version-e2e-test-" + $(YARN) lerna publish from-git --registry http://localhost:4873 --yes --tag-version-prefix="version-e2e-test-" $(MAKE) clean publish-eslint: @@ -253,7 +256,7 @@ yarn-install: clean-all lerna-bootstrap: yarn-install # todo: remove `-- -- --ignore-engines` in Babel 8 - yarn lerna bootstrap -- -- --ignore-engines + $(YARN) lerna bootstrap -- -- --ignore-engines bootstrap: bootstrap-only $(MAKE) build @@ -300,7 +303,7 @@ define clean-source-all endef define set-json-field - node -e "\ + $(NODE) -e "\ require('fs').writeFileSync('$1'.trim(), \ JSON.stringify({ ...require('$1'.trim()), $2: $3 }, null, 2) + '\\n' \ )" diff --git a/scripts/lint-ts-typings.sh b/scripts/lint-ts-typings.sh index 7a5f9193287f..1e308cd44ce8 100755 --- a/scripts/lint-ts-typings.sh +++ b/scripts/lint-ts-typings.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e -node="node" tsFlags="--strict" -$node ./node_modules/typescript/bin/tsc $tsFlags ./packages/babel-types/lib/index.d.ts +yarn --silent tsc $tsFlags ./packages/babel-types/lib/index.d.ts diff --git a/scripts/test-cov.sh b/scripts/test-cov.sh index 6914ef3fb0f9..4d90d4bda385 100755 --- a/scripts/test-cov.sh +++ b/scripts/test-cov.sh @@ -1,10 +1,11 @@ #!/bin/bash set -e +node="yarn --silent node" jestArgs="--coverage" if [ -n "$CI" ]; then jestArgs="${jestArgs} --maxWorkers=4 --ci" fi -node_modules/.bin/jest $jestArgs +$node node_modules/.bin/jest $jestArgs diff --git a/scripts/test.sh b/scripts/test.sh index b14189e28a70..40109fbe3aa3 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,11 +1,11 @@ #!/bin/bash set -e -node="node" +node="yarn --silent node" jestArgs=() if [ "$TEST_DEBUG" ]; then - node="node --inspect-brk" + node="$node --inspect-brk" jestArgs+=("--runInBand") fi @@ -23,4 +23,4 @@ if [ -n "$TEST_ONLY" ]; then jestArgs+=("(packages|codemods|eslint)/.*$TEST_ONLY.*/test") fi -$node node_modules/jest/bin/jest.js "${jestArgs[@]}" +$node node_modules/.bin/jest "${jestArgs[@]}" From a0bed42aec00196e0611df3cbb2ec6ebc36fbec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 4 Dec 2019 23:09:52 -0500 Subject: [PATCH 845/965] Bundle standalone using rollup (#10779) * chore: bundle babel-standalone via rollup Co-authored-by: Daniel Tschinder * chore: build babel-preset-env-standalone via Rollup # Conflicts: # yarn.lock * chore: add babelEnvName * chore: farewell webpack * chore: add terser minification * chore: dedupe some popular dependencies * chore: remove unused devDependencies * chore: move plugin-babel-source to scripts/ * make prettier happy * fix: rewrite available-plugins into esm * chore: add extra unambiguous sources when env is rollup/standalone --- Gulpfile.js | 264 +++- babel.config.js | 62 +- package.json | 17 +- .../src/available-plugins.js | 18 +- scripts/gulp-tasks.js | 185 --- scripts/rollup-plugin-babel-source.js | 66 + yarn.lock | 1194 ++++++----------- 7 files changed, 703 insertions(+), 1103 deletions(-) delete mode 100644 scripts/gulp-tasks.js create mode 100644 scripts/rollup-plugin-babel-source.js diff --git a/Gulpfile.js b/Gulpfile.js index 8e1b9b530a9a..a91d4e54b84d 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -10,12 +10,17 @@ const fancyLog = require("fancy-log"); const filter = require("gulp-filter"); const gulp = require("gulp"); const path = require("path"); -const webpack = require("webpack"); const rollup = require("rollup"); +const rollupAlias = require("@rollup/plugin-alias"); const rollupBabel = require("rollup-plugin-babel"); +const rollupBabelSource = require("./scripts/rollup-plugin-babel-source"); +const rollupCommonJs = require("rollup-plugin-commonjs"); +const rollupJson = require("@rollup/plugin-json"); +const rollupNodeBuiltins = require("rollup-plugin-node-builtins"); +const rollupNodeGlobals = require("rollup-plugin-node-globals"); const rollupNodeResolve = require("rollup-plugin-node-resolve"); const rollupReplace = require("rollup-plugin-replace"); -const { registerStandalonePackageTask } = require("./scripts/gulp-tasks"); +const { terser: rollupTerser } = require("rollup-plugin-terser"); const defaultSourcesGlob = "./@(codemods|packages|eslint)/*/src/**/*.js"; @@ -75,42 +80,203 @@ function buildBabel(exclude, sourcesGlob = defaultSourcesGlob) { .pipe(gulp.dest(base)); } +let babelVersion = require("./packages/babel-core/package.json").version; function buildRollup(packages) { + const sourcemap = process.env.NODE_ENV === "production"; + const minify = !!process.env.IS_PUBLISH; return Promise.all( - packages.map(pkg => { - const input = getIndexFromPackage(pkg); - fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`); - return rollup - .rollup({ - input, - plugins: [ - rollupReplace({ - "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), - }), - rollupBabel({ - envName: "babel-parser", - }), - rollupNodeResolve(), - ], - }) - .then(bundle => { - return bundle.write({ - file: path.join(pkg, "lib/index.js"), - format: "cjs", - name: "babel-parser", - sourcemap: process.env.NODE_ENV !== "production", + packages.map( + ({ src, format, dest, name, filename, version = babelVersion }) => { + const extraPlugins = []; + let inputExternal = undefined, + outputGlobals = undefined, + nodeResolveBrowser = false, + babelEnvName = "rollup"; + switch (src) { + case "packages/babel-standalone": + nodeResolveBrowser = true; + babelEnvName = "standalone"; + if (minify) { + extraPlugins.push( + rollupTerser({ + include: /^.+\.min\.js$/, + }) + ); + } + break; + case "packages/babel-preset-env-standalone": + nodeResolveBrowser = true; + babelEnvName = "standalone"; + if (minify) { + extraPlugins.push( + rollupTerser({ + include: /^.+\.min\.js$/, + }) + ); + } + inputExternal = ["@babel/standalone"]; + outputGlobals = { + "@babel/standalone": "Babel", + }; + extraPlugins.push( + rollupAlias({ + entries: [ + { + find: "./available-plugins", + replacement: require.resolve( + path.join(__dirname, src, "./src/available-plugins") + ), + }, + { + find: "caniuse-lite/data/regions", + replacement: require.resolve( + path.join(__dirname, src, "./src/caniuse-lite-regions") + ), + }, + ], + }) + ); + break; + } + // If this build is part of a pull request, include the pull request number in + // the version number. + if (process.env.CIRCLE_PR_NUMBER) { + const prVersion = "+pr." + process.env.CIRCLE_PR_NUMBER; + babelVersion += prVersion; + version += prVersion; + } + const input = getIndexFromPackage(src); + fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`); + return rollup + .rollup({ + input, + external: inputExternal, + plugins: [ + ...extraPlugins, + rollupBabelSource(), + rollupReplace({ + "process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV), + BABEL_VERSION: JSON.stringify(babelVersion), + VERSION: JSON.stringify(version), + }), + rollupBabel({ + envName: babelEnvName, + babelrc: false, + extends: "./babel.config.js", + }), + rollupNodeResolve({ + browser: nodeResolveBrowser, + preferBuiltins: true, + //todo: When Yarn workspaces is enabled, remove `dedupe` option + dedupe(importee) { + return ( + importee.startsWith("lodash/") || + [ + "babel-plugin-dynamic-import-node/utils", + "esutils", + "semver", + "source-map", + ].includes(importee) + ); + }, + }), + rollupCommonJs({ + include: [/node_modules/, "packages/babel-preset-env/data/**"], + namedExports: { + "babel-plugin-dynamic-import-node/utils.js": [ + "createDynamicImportTransform", + "getImportSource", + ], + "@babel/standalone": ["availablePlugins", "registerPlugin"], + }, + }), + rollupJson(), + rollupNodeBuiltins(), + rollupNodeGlobals({ sourceMap: sourcemap }), + ], + }) + .then(bundle => { + const outputFile = path.resolve(src, dest, filename || "index.js"); + return bundle + .write({ + file: outputFile, + format, + name, + globals: outputGlobals, + sourcemap: sourcemap, + }) + .then(() => { + if (!process.env.IS_PUBLISH) { + fancyLog( + chalk.yellow( + `Skipped minification of '${chalk.cyan( + path.relative(path.join(__dirname, ".."), outputFile) + )}' because not publishing` + ) + ); + return undefined; + } + fancyLog( + `Minifying '${chalk.cyan( + path.relative(path.join(__dirname, ".."), outputFile) + )}'...` + ); + + return bundle.write({ + file: outputFile.replace(/\.js$/, ".min.js"), + format, + name, + globals: outputGlobals, + sourcemap: sourcemap, + }); + }); }); - }); - }) + } + ) ); } -const bundles = ["packages/babel-parser"]; +const libBundles = [ + { + src: "packages/babel-parser", + format: "cjs", + dest: "lib", + version: require("./packages/babel-parser/package").version, + }, +]; + +const standaloneBundle = [ + { + src: "packages/babel-standalone", + format: "umd", + name: "Babel", + filename: "babel.js", + dest: "", + version: require("./packages/babel-core/package").version, + }, +]; + +const presetEnvStandaloneBundle = [ + { + src: "packages/babel-preset-env-standalone", + format: "umd", + name: "BabelPresetEnv", + filename: "babel-preset-env.js", + dest: "", + version: require("./packages/babel-preset-env/package").version, + }, +]; + +gulp.task("build-rollup", () => buildRollup(libBundles)); +gulp.task("build-babel-standalone", () => buildRollup(standaloneBundle)); + +gulp.task("build-babel-preset-env-standalone", () => + buildRollup(presetEnvStandaloneBundle) +); -gulp.task("build-rollup", () => buildRollup(bundles)); -gulp.task("build-babel", () => buildBabel(/* exclude */ bundles)); +gulp.task("build-babel", () => buildBabel(/* exclude */ libBundles)); gulp.task("build-babel-types", () => - buildBabel(/* exclude */ bundles, "packages/babel-types/src/**/*.js") + buildBabel(/* exclude */ libBundles, "packages/babel-types/src/**/*.js") ); gulp.task("build", gulp.parallel("build-rollup", "build-babel")); @@ -128,41 +294,3 @@ gulp.task( ); }) ); - -registerStandalonePackageTask( - gulp, - "babel", - "Babel", - path.join(__dirname, "packages"), - require("./packages/babel-standalone/package.json").version -); - -const presetEnvWebpackPlugins = [ - new webpack.NormalModuleReplacementPlugin( - /\.\/available-plugins/, - require.resolve( - path.join( - __dirname, - "./packages/babel-preset-env-standalone/src/available-plugins" - ) - ) - ), - new webpack.NormalModuleReplacementPlugin( - /caniuse-lite\/data\/regions\/.+/, - require.resolve( - path.join( - __dirname, - "./packages/babel-preset-env-standalone/src/caniuse-lite-regions" - ) - ) - ), -]; - -registerStandalonePackageTask( - gulp, - "babel-preset-env", - "babelPresetEnv", - path.join(__dirname, "packages"), - require("./packages/babel-preset-env-standalone/package.json").version, - presetEnvWebpackPlugins -); diff --git a/babel.config.js b/babel.config.js index 228e9802befb..367b87d714da 100644 --- a/babel.config.js +++ b/babel.config.js @@ -11,18 +11,33 @@ module.exports = function(api) { exclude: ["transform-typeof-symbol"], }; const envOpts = Object.assign({}, envOptsNoTargets); - let transformRuntimeOpts = null; let convertESM = true; let ignoreLib = true; - let includeRuntime = false; const nodeVersion = "6.9"; + // The vast majority of our src files are modules, but we use + // unambiguous to keep things simple until we get around to renaming + // the modules to be more easily distinguished from CommonJS + const unambiguousSources = [ + "packages/*/src", + "packages/*/test", + "codemods/*/src", + "codemods/*/test", + "eslint/*/src", + "eslint/*/test", + ]; switch (env) { // Configs used during bundling builds. - case "babel-parser": + case "rollup": convertESM = false; ignoreLib = false; + // rollup-commonjs will converts node_modules to ESM + unambiguousSources.push( + "**/node_modules", + // todo: remove this after it is rewritten into ESM + "packages/babel-preset-env/data" + ); envOpts.targets = { node: nodeVersion, }; @@ -30,7 +45,11 @@ module.exports = function(api) { case "standalone": convertESM = false; ignoreLib = false; - includeRuntime = true; + unambiguousSources.push( + "**/node_modules", + "packages/babel-preset-env/data" + ); + // targets to browserslists: defaults break; case "production": // Config during builds before publish. @@ -51,17 +70,6 @@ module.exports = function(api) { break; } - if (includeRuntime) { - const babelRuntimePackageJSONPath = require.resolve( - "@babel/runtime/package.json" - ); - const path = require("path"); - transformRuntimeOpts = { - version: require(babelRuntimePackageJSONPath).version, - absoluteRuntime: path.dirname(babelRuntimePackageJSONPath), - }; - } - const config = { // Our dependencies are all standard CommonJS, along with all sorts of // other random files in Babel's codebase, so we use script as the default, @@ -116,31 +124,9 @@ module.exports = function(api) { presets: [["@babel/env", envOptsNoTargets]], }, { - // The vast majority of our src files are modules, but we use - // unambiguous to keep things simple until we get around to renaming - // the modules to be more easily distinguished from CommonJS - test: [ - "packages/*/src", - "packages/*/test", - "codemods/*/src", - "codemods/*/test", - "eslint/*/src", - "eslint/*/test", - ], + test: unambiguousSources, sourceType: "unambiguous", }, - { - // The runtime transform shouldn't process its own runtime or core-js. - exclude: [ - "packages/babel-runtime", - /[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/, - ], - plugins: [ - includeRuntime - ? ["@babel/transform-runtime", transformRuntimeOpts] - : null, - ].filter(Boolean), - }, ].filter(Boolean), }; diff --git a/package.json b/package.json index efdd7916d469..b189fa16925a 100644 --- a/package.json +++ b/package.json @@ -27,16 +27,16 @@ "@babel/preset-flow": "^7.0.0", "@babel/register": "^7.7.0", "@babel/runtime": "^7.7.2", + "@rollup/plugin-alias": "^2.2.0", + "@rollup/plugin-json": "^4.0.0", "babel-eslint": "^11.0.0-beta.1", "babel-jest": "^24.9.0", - "babel-loader": "^8.0.6", "babel-plugin-transform-charcodes": "^0.2.0", "browserify": "^16.2.3", "bundle-collapser": "^1.2.1", "chalk": "^2.4.2", "charcodes": "^0.2.0", "derequire": "^2.0.2", - "duplicate-package-checker-webpack-plugin": "^2.1.0", "enhanced-resolve": "^3.0.0", "eslint": "^6.0.1", "eslint-config-babel": "^9.0.0", @@ -52,7 +52,6 @@ "gulp-newer": "^1.0.0", "gulp-plumber": "^1.2.1", "gulp-rename": "^1.4.0", - "gulp-uglify": "^3.0.2", "gulp-watch": "^5.0.1", "husky": "^3.0.0", "jest": "^24.9.0", @@ -65,17 +64,17 @@ "prettier": "^1.19.1", "pump": "^3.0.0", "rimraf": "^2.6.3", - "rollup": "^1.12.0", + "rollup": "^1.27.5", "rollup-plugin-babel": "^4.0.0", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-node-builtins": "^2.1.2", + "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-node-resolve": "^5.0.0", "rollup-plugin-replace": "^2.2.0", + "rollup-plugin-terser": "^5.1.2", "test262-stream": "^1.3.0", "through2": "^2.0.0", - "typescript": "^3.6.3", - "warnings-to-errors-webpack-plugin": "^2.0.0", - "webpack": "^3.4.1", - "webpack-dependency-suite": "^2.4.4", - "webpack-stream": "^4.0.0" + "typescript": "^3.6.3" }, "resolutions": { "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates" diff --git a/packages/babel-preset-env-standalone/src/available-plugins.js b/packages/babel-preset-env-standalone/src/available-plugins.js index 7259b2ea378f..4262018f7c98 100644 --- a/packages/babel-preset-env-standalone/src/available-plugins.js +++ b/packages/babel-preset-env-standalone/src/available-plugins.js @@ -1,12 +1,18 @@ import { availablePlugins, registerPlugin } from "@babel/standalone"; +import proposalJsonStrings from "@babel/plugin-proposal-json-strings"; +import proposalDynamicImport from "@babel/plugin-proposal-dynamic-import"; +import syntaxJsonStrings from "@babel/plugin-syntax-json-strings"; +import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await"; +import transformNamedCapturingGroupsRegex from "@babel/plugin-transform-named-capturing-groups-regex"; +import transformNewTarget from "@babel/plugin-transform-new-target"; const notIncludedPlugins = { - "transform-named-capturing-groups-regex": require("@babel/plugin-transform-named-capturing-groups-regex"), - "transform-new-target": require("@babel/plugin-transform-new-target"), - "proposal-json-strings": require("@babel/plugin-proposal-json-strings"), - "proposal-dynamic-import": require("@babel/plugin-proposal-dynamic-import"), - "syntax-json-strings": require("@babel/plugin-syntax-json-strings"), - "syntax-top-level-await": require("@babel/plugin-syntax-top-level-await"), + "proposal-dynamic-import": proposalDynamicImport, + "proposal-json-strings": proposalJsonStrings, + "syntax-json-strings": syntaxJsonStrings, + "syntax-top-level-await": syntaxTopLevelAwait, + "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex, + "transform-new-target": transformNewTarget, }; Object.keys(notIncludedPlugins).forEach(pluginName => { diff --git a/scripts/gulp-tasks.js b/scripts/gulp-tasks.js deleted file mode 100644 index 8118932a8899..000000000000 --- a/scripts/gulp-tasks.js +++ /dev/null @@ -1,185 +0,0 @@ -"use strict"; - -/** - * This file contains the Gulp tasks for babel-standalone. Note that - * babel-standalone is compiled using Webpack, and performs its own Babel - * compilation of all the JavaScript files. This is because it targets web - * browsers, so more transforms are needed than the regular Babel builds that - * only target Node.js. - * - * The tasks in this file are designed to be reusable, so that they can be used - * to make standalone builds of other Babel plugins/presets (such as babel-minify) - */ - -const fs = require("fs"); -const path = require("path"); -const pump = require("pump"); -const chalk = require("chalk"); -const through = require("through2"); -const fancyLog = require("fancy-log"); -const rename = require("gulp-rename"); -const webpack = require("webpack"); -const { RootMostResolvePlugin } = require("webpack-dependency-suite"); -const DuplicatePackageCheckerPlugin = require("duplicate-package-checker-webpack-plugin"); -const WarningsToErrorsPlugin = require("warnings-to-errors-webpack-plugin"); -const webpackStream = require("webpack-stream"); -const uglify = require("gulp-uglify"); - -function generateResolveAlias() { - const alias = {}; - const packagePath = path.resolve(process.cwd(), "packages"); - fs.readdirSync(packagePath).forEach(folder => { - alias[folder.replace("babel-", "@babel/") + "$"] = path.resolve( - packagePath, - folder, - "src" - ); - }); - return alias; -} - -function webpackBuild(opts) { - const plugins = opts.plugins || []; - let babelVersion = require("../packages/babel-core/package.json").version; - let version = opts.version || babelVersion; - // If this build is part of a pull request, include the pull request number in - // the version number. - if (process.env.CIRCLE_PR_NUMBER) { - const prVersion = "+pr." + process.env.CIRCLE_PR_NUMBER; - babelVersion += prVersion; - version += prVersion; - } - - const config = { - module: { - rules: [ - { - test: /\.js$/, - loader: "babel-loader", - options: { - // Use the bundled config so that module syntax is passed through - // for Webpack. - envName: "standalone", - }, - }, - ], - }, - node: { - // Mock Node.js modules that Babel require()s but that we don't - // particularly care about. - fs: "empty", - module: "empty", - net: "empty", - }, - output: { - filename: opts.filename, - library: opts.library, - libraryTarget: "umd", - }, - plugins: [ - new WarningsToErrorsPlugin(), - new DuplicatePackageCheckerPlugin({ - exclude(instance) { - return instance.name === "semver"; - }, - }), - new webpack.DefinePlugin({ - "process.env.NODE_ENV": '"production"', - BABEL_VERSION: JSON.stringify(babelVersion), - VERSION: JSON.stringify(version), - }), - /*new webpack.NormalModuleReplacementPlugin( - /..\/..\/package/, - "../../../../src/babel-package-shim" - ),*/ - new webpack.optimize.ModuleConcatenationPlugin(), - ].concat(plugins), - resolve: { - //todo: remove resolve.alias when babel packages offer ESModule entry - alias: generateResolveAlias(), - plugins: [ - // Dedupe packages that are used across multiple plugins. - // This replaces DedupePlugin from Webpack 1.x - new RootMostResolvePlugin(__dirname, true), - ], - }, - }; - - if (opts.library !== "Babel") { - config.externals = { - "@babel/standalone": "Babel", - }; - } - - return webpackStream(config, webpack); - // To write JSON for debugging: - /*return webpackStream(config, webpack, (err, stats) => { - require("fancy-log")(stats.toString({ colors: true })); - require("fs").writeFileSync( - "webpack-debug.json", - JSON.stringify(stats.toJson()) - ); - });*/ -} - -function logUglify() { - return through.obj(function(file, enc, callback) { - fancyLog( - `Minifying '${chalk.cyan( - path.relative(path.join(__dirname, ".."), file.path) - )}'...` - ); - callback(null, file); - }); -} - -function logNoUglify() { - return through.obj(function(file, enc, callback) { - fancyLog( - chalk.yellow( - `Skipped minification of '${chalk.cyan( - path.relative(path.join(__dirname, ".."), file.path) - )}' because not publishing` - ) - ); - callback(null, file); - }); -} - -function registerStandalonePackageTask( - gulp, - name, - exportName, - pathname, - version, - plugins -) { - const standaloneName = name + "-standalone"; - const standalonePath = path.join(pathname, standaloneName); - gulp.task("build-" + standaloneName, cb => { - pump( - [ - gulp.src(path.join(standalonePath, "src/index.js")), - webpackBuild({ - filename: name + ".js", - library: exportName, - version, - plugins, - }), - gulp.dest(standalonePath), - ].concat( - // Minification is super slow, so we skip it unless we are publishing - process.env.IS_PUBLISH ? logUglify() : logNoUglify(), - process.env.IS_PUBLISH ? uglify() : [], - rename({ extname: ".min.js" }), - gulp.dest(standalonePath) - ), - cb - ); - }); -} - -module.exports = { - webpackBuild: webpackBuild, - registerStandalonePackageTask: registerStandalonePackageTask, -}; diff --git a/scripts/rollup-plugin-babel-source.js b/scripts/rollup-plugin-babel-source.js new file mode 100644 index 000000000000..79f1a6c4101b --- /dev/null +++ b/scripts/rollup-plugin-babel-source.js @@ -0,0 +1,66 @@ +const path = require("path"); +const fs = require("fs"); +const dirname = path.join(__dirname, ".."); + +module.exports = function() { + return { + name: "babel-source", + load(id) { + const matches = id.match(/packages\/(babel-[^/]+)\/src\//); + if (matches) { + // check if browser field exists for this file and replace + const packageFolder = path.join(dirname, "packages", matches[1]); + const packageJson = require(path.join(packageFolder, "package.json")); + + if ( + packageJson["browser"] && + typeof packageJson["browser"] === "object" + ) { + for (let nodeFile in packageJson["browser"]) { + const browserFile = packageJson["browser"][nodeFile].replace( + /^(\.\/)?lib\//, + "src/" + ); + nodeFile = nodeFile.replace(/^(\.\/)?lib\//, "src/"); + if (id.endsWith(nodeFile)) { + if (browserFile === false) { + return ""; + } + return fs.readFileSync( + path.join(packageFolder, browserFile), + "UTF-8" + ); + } + } + } + } + return null; + }, + resolveId(importee) { + let packageFolderName; + const matches = importee.match(/^@babel\/([^/]+)$/); + if (matches) { + packageFolderName = `babel-${matches[1]}`; + } + + if (packageFolderName) { + // resolve babel package names to their src index file + const packageFolder = path.join(dirname, "packages", packageFolderName); + const packageJson = require(path.join(packageFolder, "package.json")); + + const filename = + typeof packageJson["browser"] === "string" + ? packageJson["browser"] + : packageJson["main"]; + + return path.join( + packageFolder, + // replace lib with src in the pkg.json entry + filename.replace(/^(\.\/)?lib\//, "src/") + ); + } + + return null; + }, + }; +}; diff --git a/yarn.lock b/yarn.lock index 99c6211d1b03..5893166beb0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1781,6 +1781,20 @@ dependencies: "@types/node" ">= 8" +"@rollup/plugin-alias@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-alias/-/plugin-alias-2.2.0.tgz#3ac52ece8b39583249884adb90fb316484389fe5" + integrity sha512-//6zmlHGbmousaatu4pBlC61gqZykLbH0c2GESBO4JgK5xFZgb/ih0zlg/5/BmTAczX5R/xsHRnsYsu4KyHV5w== + dependencies: + slash "^3.0.0" + +"@rollup/plugin-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.0.0.tgz#4462e83c7ad5544bef4a601a6e8450daedc4b69b" + integrity sha512-Z65CtEVWv40+ri4CvmswyhtuUtki9yP5p0UJN/GyCKKyU4jRuDS9CG0ZuV7/XuS7zGkoajyE7E4XBEaC4GW62A== + dependencies: + rollup-pluginutils "^2.5.0" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -1788,13 +1802,6 @@ dependencies: any-observable "^0.3.0" -"@types/acorn@^4.0.2": - version "4.0.5" - resolved "https://registry.yarnpkg.com/@types/acorn/-/acorn-4.0.5.tgz#e29fdf884695e77be4e99e67d748f5147255752d" - integrity sha512-603sPiZ4GVRHPvn6vNgEAvJewKsy+zwRWYS2MeIMemgoAtcjlw2G3lALxrb9OPA17J28bkB71R33yXlQbUatCA== - dependencies: - "@types/estree" "*" - "@types/babel__core@^7.1.0": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" @@ -1828,41 +1835,11 @@ dependencies: "@babel/types" "^7.3.0" -"@types/cheerio@^0.22.1": - version "0.22.12" - resolved "https://registry.yarnpkg.com/@types/cheerio/-/cheerio-0.22.12.tgz#93c050401d4935a5376e8b352965f7458bed5340" - integrity sha512-aczowyAJNfrkBV+HS8DyAA87OnvkqGrrOmm5s7V6Jbgimzv/1ZoAy91cLJX8GQrUS60KufD7EIzA2LbK8HV4hg== - dependencies: - "@types/node" "*" - -"@types/debug@^0.0.29": - version "0.0.29" - resolved "https://registry.yarnpkg.com/@types/debug/-/debug-0.0.29.tgz#a1e514adfbd92f03a224ba54d693111dbf1f3754" - integrity sha1-oeUUrfvZLwOiJLpU1pMRHb8fN1Q= - -"@types/enhanced-resolve@^3.0.3": - version "3.0.6" - resolved "https://registry.yarnpkg.com/@types/enhanced-resolve/-/enhanced-resolve-3.0.6.tgz#a51eaa24f4458ed13fb42a7048c0b66f92e95a28" - integrity sha512-mAWc6JpDiA6GnPCF5023YSGMa/E7baMvLs+HtT9E6Z52lUds3pthf4APhVQpbmV6sZTrbASgBEDdh70eGWTJFw== - dependencies: - "@types/node" "*" - "@types/tapable" "^0" - -"@types/escape-string-regexp@^0.0.30": - version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/escape-string-regexp/-/escape-string-regexp-0.0.30.tgz#8cfaf0b5d2e46943d6efd77d3f4d18bfa1c9f225" - integrity sha1-jPrwtdLkaUPW79d9P00Yv6HJ8iU= - "@types/estree@*", "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== -"@types/estree@0.0.35": - version "0.0.35" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.35.tgz#8999974b34028686a8d61a719e61c138d3755107" - integrity sha1-iZmXSzQChoao1hpxnmHBONN1UQc= - "@types/events@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" @@ -1897,26 +1874,16 @@ "@types/istanbul-lib-coverage" "*" "@types/istanbul-lib-report" "*" -"@types/lodash@^4.14.67": - version "4.14.136" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.136.tgz#413e85089046b865d960c9ff1d400e04c31ab60f" - integrity sha512-0GJhzBdvsW2RUccNHOBkabI8HZVdOXmXbXhuKlDEd5Vv12P7oAVGfomGp3Ne21o5D/qu1WmthlNKFaoZJJeErA== - "@types/minimatch@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@*", "@types/node@>= 8", "@types/node@^12.6.2": +"@types/node@*", "@types/node@>= 8": version "12.12.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.11.tgz#bec2961975888d964196bf0016a2f984d793d3ce" integrity sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ== -"@types/node@^8.0.0": - version "8.10.50" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.50.tgz#f3d68482b1f54b5f4fba8daaac385db12bb6a706" - integrity sha512-+ZbcUwJdaBgOZpwXeT0v+gHC/jQbEfzoc9s4d0rN0JIKeQbuTrT+A2n1aQY6LpZjrLXJT7avVUqiCecCJeeZxA== - "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" @@ -1929,38 +1896,11 @@ dependencies: "@types/node" "*" -"@types/semver@^5.3.32": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" - integrity sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ== - "@types/stack-utils@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== -"@types/tapable@^0": - version "0.2.5" - resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-0.2.5.tgz#2443fc12da514c81346b1a665675559cee21fa75" - integrity sha512-dEoVvo/I9QFomyhY+4Q6Qk+I+dhG59TYceZgC6Q0mCifVPErx6Y83PNTKGDS5e9h9Eti6q0S2mm16BU6iQK+3w== - -"@types/uglify-js@*": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.4.tgz#96beae23df6f561862a830b4288a49e86baac082" - integrity sha512-SudIN9TRJ+v8g5pTG8RRCqfqTMNqgWCKKd3vtynhGzkIIjxaicNAMuY5TRadJ6tzDu3Dotf3ngaMILtmOdmWEQ== - dependencies: - source-map "^0.6.1" - -"@types/webpack@^3.0.0": - version "3.8.18" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.18.tgz#dd57fbedf23a07653817365fefc4586e9c48f0bd" - integrity sha512-qRk84mxsmMImpDAS7WHwdVSUabNSvdYD9M15U7OXaEo+ZkMW6zmdwmZRWr8SF6ZAA93ppkh5lNky5TiCuqcfAA== - dependencies: - "@types/node" "*" - "@types/tapable" "^0" - "@types/uglify-js" "*" - source-map "^0.6.0" - "@types/yargs-parser@*": version "13.1.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-13.1.0.tgz#c563aa192f39350a1d18da36c5a8da382bbd8228" @@ -2000,12 +1940,12 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -acorn-dynamic-import@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz#c752bd210bef679501b6c6cb7fc84f8f47158cc4" - integrity sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ= +abstract-leveldown@~0.12.0, abstract-leveldown@~0.12.1: + version "0.12.4" + resolved "https://registry.yarnpkg.com/abstract-leveldown/-/abstract-leveldown-0.12.4.tgz#29e18e632e60e4e221d5810247852a63d7b2e410" + integrity sha1-KeGOYy5g5OIh1YECR4UqY9ey5BA= dependencies: - acorn "^4.0.3" + xtend "~3.0.0" acorn-dynamic-import@^4.0.0: version "4.0.0" @@ -2045,16 +1985,21 @@ acorn@^4.0.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= -acorn@^5.0.0, acorn@^5.0.3, acorn@^5.5.3: +acorn@^5.0.0, acorn@^5.5.3, acorn@^5.7.3: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.0.7, acorn@^6.1.1, acorn@^6.2.0: +acorn@^6.0.1, acorn@^6.0.7, acorn@^6.1.1: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== +acorn@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" + integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== + agent-base@4, agent-base@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" @@ -2076,12 +2021,7 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" -ajv-keywords@^3.1.0: - version "3.4.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.4.1.tgz#ef916e271c64ac12171fd8384eaae6b2345854da" - integrity sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ== - -ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: +ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== @@ -2091,15 +2031,6 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - integrity sha1-DNkKVhCT810KmSVsIrcGlDP60Rc= - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -2422,7 +2353,7 @@ assert-plus@1.0.0, assert-plus@^1.0.0: resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= -assert@^1.1.1, assert@^1.4.0: +assert@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/assert/-/assert-1.5.0.tgz#55c109aaf6e0aefdb3dc4b71240c70bf574b18eb" integrity sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA== @@ -2435,11 +2366,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@0.9.6: - version "0.9.6" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" - integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -2472,13 +2398,6 @@ async-settle@^1.0.0: dependencies: async-done "^1.2.2" -async@^2.1.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -2526,16 +2445,6 @@ babel-jest@^24.9.0: chalk "^2.4.2" slash "^2.0.0" -babel-loader@^8.0.6: - version "8.0.6" - resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.6.tgz#e33bdb6f362b03f4bb141a0c21ab87c501b70dfb" - integrity sha512-4BmWKtBOBm13uoUwd08UwjZlaw3O9GWf456R9j+5YykFZ6LUIjIKLc0zEZf+hauxPOJs96C8k6FvYD09vWzhYw== - dependencies: - find-cache-dir "^2.0.0" - loader-utils "^1.0.2" - mkdirp "^0.5.1" - pify "^4.0.1" - babel-plugin-dynamic-import-node@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz#f00f507bdaa3c3e3ff6e7e5e98d90a7acab96f7f" @@ -2625,16 +2534,18 @@ before-after-hook@^2.0.0: resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635" integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A== -big.js@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" - integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== - binary-extensions@^1.0.0: version "1.13.1" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== +bl@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-0.8.2.tgz#c9b6bca08d1bc2ea00fc8afb4f1a5fd1e1c66e4e" + integrity sha1-yba8oI0bwuoA/Ir7Txpf0eHGbk4= + dependencies: + readable-stream "~1.0.26" + bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: version "3.7.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" @@ -2645,11 +2556,6 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" integrity sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA== -boolbase@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" - integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2770,6 +2676,15 @@ browserify-des@^1.0.0: inherits "^2.0.1" safe-buffer "^5.1.2" +browserify-fs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-fs/-/browserify-fs-1.0.0.tgz#f075aa8a729d4d1716d066620e386fcc1311a96f" + integrity sha1-8HWqinKdTRcW0GZiDjhvzBMRqW8= + dependencies: + level-filesystem "^1.0.1" + level-js "^2.1.3" + levelup "^0.18.2" + browserify-rsa@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" @@ -2791,7 +2706,7 @@ browserify-sign@^4.0.0: inherits "^2.0.1" parse-asn1 "^5.0.0" -browserify-zlib@^0.2.0, browserify-zlib@~0.2.0: +browserify-zlib@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" integrity sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA== @@ -2878,6 +2793,11 @@ buffer-equal@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" integrity sha1-WWFrSYME1Var1GaWayLu2j7KX74= +buffer-es6@^4.9.2, buffer-es6@^4.9.3: + version "4.9.3" + resolved "https://registry.yarnpkg.com/buffer-es6/-/buffer-es6-4.9.3.tgz#f26347b82df76fd37e18bcb5288c4970cfd5c404" + integrity sha1-8mNHuC33b9N+GLy1KIxJcM/VxAQ= + buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -2888,15 +2808,6 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= -buffer@^4.3.0: - version "4.9.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" - integrity sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg= - dependencies: - base64-js "^1.0.2" - ieee754 "^1.1.4" - isarray "^1.0.0" - buffer@^5.0.2: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" @@ -3012,14 +2923,6 @@ callsites@^3.0.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camel-case@3.0.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" - integrity sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M= - dependencies: - no-case "^2.2.0" - upper-case "^1.1.1" - camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -3037,11 +2940,6 @@ camelcase-keys@^4.0.0: map-obj "^2.0.0" quick-lru "^1.0.0" -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - integrity sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk= - camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -3079,14 +2977,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - integrity sha1-qg0yYptu6XIgBBHL1EYckHvCt60= - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - chalk@^1.0.0, chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" @@ -3098,7 +2988,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -3117,19 +3007,7 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -cheerio@^1.0.0-rc.1: - version "1.0.0-rc.3" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" - integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== - dependencies: - css-select "~1.2.0" - dom-serializer "~0.1.1" - entities "~1.1.1" - htmlparser2 "^3.9.1" - lodash "^4.15.0" - parse5 "^3.0.1" - -chokidar@^2.0.0, chokidar@^2.0.2, chokidar@^2.1.8: +chokidar@^2.0.0, chokidar@^2.1.8: version "2.1.8" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917" integrity sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg== @@ -3176,13 +3054,6 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -clean-css@4.2.x: - version "4.2.1" - resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.1.tgz#2d411ef76b8569b6d0c84068dabe85b0aa5e5c17" - integrity sha512-4ZxI6dy4lrY6FHzfiy1aEOXgu4LIsW2MhwG0VBKdcoGoH/XLFgaHSdLTGr4O8Be6A8r3MOphEiI8Gc1n0ecf3g== - dependencies: - source-map "~0.6.0" - cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -3203,15 +3074,6 @@ cli-width@^2.0.0: resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - integrity sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE= - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" @@ -3264,6 +3126,11 @@ clone@^2.1.1: resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" integrity sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18= +clone@~0.1.9: + version "0.1.19" + resolved "https://registry.yarnpkg.com/clone/-/clone-0.1.19.tgz#613fb68639b26a494ac53253e15b1a6bd88ada85" + integrity sha1-YT+2hjmyaklKxTJT4Vsaa9iK2oU= + cloneable-readable@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/cloneable-readable/-/cloneable-readable-1.1.3.tgz#120a00cb053bfb63a222e709f9683ea2e11d8cec" @@ -3352,11 +3219,6 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@2.17.x: - version "2.17.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf" - integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg== - commander@^2.20.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -3390,7 +3252,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: +concat-stream@^1.4.4, concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -3430,7 +3292,7 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -constants-browserify@^1.0.0, constants-browserify@~1.0.0: +constants-browserify@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U= @@ -3614,15 +3476,6 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" -cross-spawn@^5.0.1: - version "5.1.0" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" - integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= - dependencies: - lru-cache "^4.0.1" - shebang-command "^1.2.0" - which "^1.2.9" - cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -3651,21 +3504,6 @@ crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -css-select@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" - integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= - dependencies: - boolbase "~1.0.0" - css-what "2.1" - domutils "1.5.1" - nth-check "~1.0.1" - -css-what@2.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" - integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== - cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -3755,7 +3593,7 @@ debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: dependencies: ms "2.0.0" -debug@^3.0.0, debug@^3.1.0, debug@^3.2.6: +debug@^3.1.0, debug@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== @@ -3782,7 +3620,7 @@ decamelize-keys@^1.0.0: decamelize "^1.1.0" map-obj "^1.0.0" -decamelize@^1.0.0, decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: +decamelize@^1.1.0, decamelize@^1.1.1, decamelize@^1.1.2, decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= @@ -3826,6 +3664,13 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" +deferred-leveldown@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/deferred-leveldown/-/deferred-leveldown-0.2.0.tgz#2cef1f111e1c57870d8bbb8af2650e587cd2f5b4" + integrity sha1-LO8fER4cV4cNi7uK8mUOWHzS9bQ= + dependencies: + abstract-leveldown "~0.12.1" + define-properties@^1.1.2, define-properties@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" @@ -3990,24 +3835,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-serializer@0, dom-serializer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" - integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== - dependencies: - domelementtype "^1.3.0" - entities "^1.1.1" - -domain-browser@^1.1.1, domain-browser@^1.2.0: +domain-browser@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" integrity sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA== -domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - domexception@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" @@ -4015,21 +3847,6 @@ domexception@^1.0.1: dependencies: webidl-conversions "^4.0.2" -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" - -domutils@1.5.1, domutils@^1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= - dependencies: - dom-serializer "0" - domelementtype "1" - dot-prop@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-3.0.0.tgz#1b708af094a49c9a0e7dbcad790aba539dac1177" @@ -4066,16 +3883,6 @@ duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" -duplicate-package-checker-webpack-plugin@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/duplicate-package-checker-webpack-plugin/-/duplicate-package-checker-webpack-plugin-2.1.0.tgz#6723ee32d89947997470778973c10788cb69e496" - integrity sha512-Blok+Cb8zDavYQyeTtSkmNp/aiyRn5+JV/4EhDDH5VJChnyIzPhq+S5MyWnFpqpv8jNKmD3cXmXFEVU509pzXQ== - dependencies: - chalk "^2.3.0" - find-root "^1.0.0" - lodash "^4.17.4" - semver "^5.4.1" - each-props@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" @@ -4125,11 +3932,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -emojis-list@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" - integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= - encoding@^0.1.11: version "0.1.12" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" @@ -4144,7 +3946,7 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -enhanced-resolve@^3.0.0, enhanced-resolve@^3.4.0: +enhanced-resolve@^3.0.0: version "3.4.1" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz#0421e339fd71419b3da13d129b3979040230476e" integrity sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24= @@ -4154,11 +3956,6 @@ enhanced-resolve@^3.0.0, enhanced-resolve@^3.4.0: object-assign "^4.0.1" tapable "^0.2.7" -entities@^1.1.1, entities@~1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" - integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== - env-paths@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-1.0.0.tgz#4168133b42bb05c38a35b1ae4397c8298ab369e0" @@ -4169,7 +3966,7 @@ err-code@^1.0.0: resolved "https://registry.yarnpkg.com/err-code/-/err-code-1.1.2.tgz#06e0116d3028f6aef4806849eb0ea6a748ae6960" integrity sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA= -errno@^0.1.3: +errno@^0.1.1, errno@^0.1.3, errno@~0.1.1: version "0.1.7" resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" integrity sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg== @@ -4269,14 +4066,6 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: d "1" es5-ext "~0.10.14" -es6-templates@^0.2.2: - version "0.2.3" - resolved "https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4" - integrity sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ= - dependencies: - recast "~0.11.12" - through "~2.3.6" - es6-weak-map@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" @@ -4445,7 +4234,7 @@ espree@^6.0.0: acorn-jsx "^5.0.0" eslint-visitor-keys "^1.0.0" -esprima@^3.1.3, esprima@~3.1.0: +esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= @@ -4474,6 +4263,11 @@ estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= +estree-walker@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.5.2.tgz#d3850be7529c9580d815600b53126515e146dd39" + integrity sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig== + estree-walker@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" @@ -4502,11 +4296,6 @@ events@^2.0.0: resolved "https://registry.yarnpkg.com/events/-/events-2.1.0.tgz#2a9a1e18e6106e0e812aa9ebd4a819b3c29c0ba5" integrity sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg== -events@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/events/-/events-3.0.0.tgz#9a0a0dfaf62893d92b875b8f2698ca4114973e88" - integrity sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA== - evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -4520,19 +4309,6 @@ exec-sh@^0.3.2: resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== -execa@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777" - integrity sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" @@ -4735,11 +4511,6 @@ fast-levenshtein@~2.0.4: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastparse@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" - integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== - fb-watchman@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" @@ -4816,11 +4587,6 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" -find-root@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" - integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -4940,7 +4706,7 @@ for-own@^1.0.0: dependencies: for-in "^1.0.1" -foreach@^2.0.5: +foreach@^2.0.5, foreach@~2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= @@ -5036,6 +4802,13 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +fwd-stream@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/fwd-stream/-/fwd-stream-1.0.4.tgz#ed281cabed46feecf921ee32dc4c50b372ac7cfa" + integrity sha1-7Sgcq+1G/uz5Ie4y3ExQs3KsfPo= + dependencies: + readable-stream "~1.0.26-4" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -5101,11 +4874,6 @@ get-stdin@^7.0.0: resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-7.0.0.tgz#8d5de98f15171a125c5e516643c7a6d0ea8a96f6" integrity sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ== -get-stream@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" - integrity sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ= - get-stream@^4.0.0, get-stream@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" @@ -5390,22 +5158,6 @@ gulp-rename@^1.4.0: resolved "https://registry.yarnpkg.com/gulp-rename/-/gulp-rename-1.4.0.tgz#de1c718e7c4095ae861f7296ef4f3248648240bd" integrity sha512-swzbIGb/arEoFK89tPY58vg3Ok1bw+d35PfUNwWqdo7KM4jkmuGA78JiDNqR+JeZFaeeHnRg9N7aihX3YPmsyg== -gulp-uglify@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gulp-uglify/-/gulp-uglify-3.0.2.tgz#5f5b2e8337f879ca9dec971feb1b82a5a87850b0" - integrity sha512-gk1dhB74AkV2kzqPMQBLA3jPoIAPd/nlNzP2XMDSG8XZrqnlCiDGAqC+rZOumzFvB5zOphlFh6yr3lgcAb/OOg== - dependencies: - array-each "^1.0.1" - extend-shallow "^3.0.2" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - isobject "^3.0.1" - make-error-cause "^1.1.1" - safe-buffer "^5.1.2" - through2 "^2.0.0" - uglify-js "^3.0.5" - vinyl-sourcemaps-apply "^0.2.0" - gulp-watch@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/gulp-watch/-/gulp-watch-5.0.1.tgz#83d378752f5bfb46da023e73c17ed1da7066215d" @@ -5472,23 +5224,11 @@ has-ansi@^2.0.0: dependencies: ansi-regex "^2.0.0" -has-flag@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" - integrity sha1-6CB68cx7MNRGzHC3NLXovhj4jVE= - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-gulplog@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" - integrity sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4= - dependencies: - sparkles "^1.0.0" - has-symbols@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" @@ -5553,11 +5293,6 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" -he@1.2.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" - integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== - hmac-drbg@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -5586,47 +5321,11 @@ html-encoding-sniffer@^1.0.2: dependencies: whatwg-encoding "^1.0.1" -html-loader@^0.4.5: - version "0.4.5" - resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.4.5.tgz#5fbcd87cd63a5c49a7fce2fe56f425e05729c68c" - integrity sha1-X7zYfNY6XEmn/OL+VvQl4Fcpxow= - dependencies: - es6-templates "^0.2.2" - fastparse "^1.1.1" - html-minifier "^3.0.1" - loader-utils "^1.0.2" - object-assign "^4.1.0" - -html-minifier@^3.0.1: - version "3.5.21" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" - integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== - dependencies: - camel-case "3.0.x" - clean-css "4.2.x" - commander "2.17.x" - he "1.2.x" - param-case "2.1.x" - relateurl "0.2.x" - uglify-js "3.4.x" - htmlescape@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" integrity sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E= -htmlparser2@^3.9.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" - integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== - dependencies: - domelementtype "^1.3.1" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^3.1.1" - http-cache-semantics@^3.8.1: version "3.8.1" resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz#39b0e16add9b605bf0a9ef3d9daaf4843b4cacd2" @@ -5692,6 +5391,11 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: dependencies: safer-buffer ">= 2.1.2 < 3" +idb-wrapper@^1.5.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/idb-wrapper/-/idb-wrapper-1.7.2.tgz#8251afd5e77fe95568b1c16152eb44b396767ea2" + integrity sha512-zfNREywMuf0NzDo9mVsL0yegjsirJxHpKHvWcyRozIqQy89g0a3U+oBPOCN4cc0oCiOuYgZHimzaW/R46G1Mpg== + ieee754@^1.1.4: version "1.1.13" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" @@ -5755,6 +5459,11 @@ indent-string@^3.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indexof@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" + integrity sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10= + infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -5768,7 +5477,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= @@ -5846,7 +5555,7 @@ insert-module-globals@^7.0.0: undeclared-identifiers "^1.1.2" xtend "^4.0.0" -interpret@^1.0.0, interpret@^1.1.0: +interpret@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== @@ -6084,6 +5793,11 @@ is-obj@^1.0.0, is-obj@^1.0.1: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= +is-object@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/is-object/-/is-object-0.1.2.tgz#00efbc08816c33cfc4ac8251d132e10dc65098d7" + integrity sha1-AO+8CIFsM8/ErIJR0TLhDcZQmNc= + is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" @@ -6144,6 +5858,13 @@ is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= +is-reference@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.1.4.tgz#3f95849886ddb70256a3e6d062b1a68c13c51427" + integrity sha512-uJA/CDPO3Tao3GTrxYn6AwkM4nUPJiGGYu5+cB8qbC7WGFlrKZbiRo7SFKxUAEpFUfiHofWCXBUNhvYJMh+6zw== + dependencies: + "@types/estree" "0.0.39" + is-regex@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" @@ -6226,6 +5947,11 @@ is-wsl@^1.1.0: resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= +is@~0.2.6: + version "0.2.7" + resolved "https://registry.yarnpkg.com/is/-/is-0.2.7.tgz#3b34a2c48f359972f35042849193ae7264b63562" + integrity sha1-OzSixI81mXLzUEKEkZOucmS2NWI= + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" @@ -6236,6 +5962,11 @@ isarray@1.0.0, isarray@^1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= +isbuffer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/isbuffer/-/isbuffer-0.0.0.tgz#38c146d9df528b8bf9b0701c3d43cf12df3fc39b" + integrity sha1-OMFG2d9Si4v5sHAcPUPPEt8/w5s= + isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -6727,11 +6458,6 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= -json-loader@^0.5.4: - version "0.5.7" - resolved "https://registry.yarnpkg.com/json-loader/-/json-loader-0.5.7.tgz#dca14a70235ff82f0ac9a3abeb60d337a365185d" - integrity sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w== - json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -6764,18 +6490,6 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= -json5@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" - integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= - -json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== - dependencies: - minimist "^1.2.0" - json5@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.1.tgz#81b6cb04e9ba496f1c7005d07b4368a2638f90b6" @@ -6877,11 +6591,6 @@ last-run@^1.1.0: default-resolution "^2.0.0" es6-weak-map "^2.0.1" -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - integrity sha1-odePw6UEdMuAhF07O24dpJpEbo4= - lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -6944,6 +6653,91 @@ lerna@^3.19.0: import-local "^2.0.0" npmlog "^4.1.2" +level-blobs@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/level-blobs/-/level-blobs-0.1.7.tgz#9ab9b97bb99f1edbf9f78a3433e21ed56386bdaf" + integrity sha1-mrm5e7mfHtv594o0M+Ie1WOGva8= + dependencies: + level-peek "1.0.6" + once "^1.3.0" + readable-stream "^1.0.26-4" + +level-filesystem@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/level-filesystem/-/level-filesystem-1.2.0.tgz#a00aca9919c4a4dfafdca6a8108d225aadff63b3" + integrity sha1-oArKmRnEpN+v3KaoEI0iWq3/Y7M= + dependencies: + concat-stream "^1.4.4" + errno "^0.1.1" + fwd-stream "^1.0.4" + level-blobs "^0.1.7" + level-peek "^1.0.6" + level-sublevel "^5.2.0" + octal "^1.0.0" + once "^1.3.0" + xtend "^2.2.0" + +level-fix-range@2.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/level-fix-range/-/level-fix-range-2.0.0.tgz#c417d62159442151a19d9a2367868f1724c2d548" + integrity sha1-xBfWIVlEIVGhnZojZ4aPFyTC1Ug= + dependencies: + clone "~0.1.9" + +level-fix-range@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/level-fix-range/-/level-fix-range-1.0.2.tgz#bf15b915ae36d8470c821e883ddf79cd16420828" + integrity sha1-vxW5Fa422EcMgh6IPd95zRZCCCg= + +"level-hooks@>=4.4.0 <5": + version "4.5.0" + resolved "https://registry.yarnpkg.com/level-hooks/-/level-hooks-4.5.0.tgz#1b9ae61922930f3305d1a61fc4d83c8102c0dd93" + integrity sha1-G5rmGSKTDzMF0aYfxNg8gQLA3ZM= + dependencies: + string-range "~1.2" + +level-js@^2.1.3: + version "2.2.4" + resolved "https://registry.yarnpkg.com/level-js/-/level-js-2.2.4.tgz#bc055f4180635d4489b561c9486fa370e8c11697" + integrity sha1-vAVfQYBjXUSJtWHJSG+jcOjBFpc= + dependencies: + abstract-leveldown "~0.12.0" + idb-wrapper "^1.5.0" + isbuffer "~0.0.0" + ltgt "^2.1.2" + typedarray-to-buffer "~1.0.0" + xtend "~2.1.2" + +level-peek@1.0.6, level-peek@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/level-peek/-/level-peek-1.0.6.tgz#bec51c72a82ee464d336434c7c876c3fcbcce77f" + integrity sha1-vsUccqgu5GTTNkNMfIdsP8vM538= + dependencies: + level-fix-range "~1.0.2" + +level-sublevel@^5.2.0: + version "5.2.3" + resolved "https://registry.yarnpkg.com/level-sublevel/-/level-sublevel-5.2.3.tgz#744c12c72d2e72be78dde3b9b5cd84d62191413a" + integrity sha1-dEwSxy0ucr543eO5tc2E1iGRQTo= + dependencies: + level-fix-range "2.0" + level-hooks ">=4.4.0 <5" + string-range "~1.2.1" + xtend "~2.0.4" + +levelup@^0.18.2: + version "0.18.6" + resolved "https://registry.yarnpkg.com/levelup/-/levelup-0.18.6.tgz#e6a01cb089616c8ecc0291c2a9bd3f0c44e3e5eb" + integrity sha1-5qAcsIlhbI7MApHCqb0/DETj5es= + dependencies: + bl "~0.8.1" + deferred-leveldown "~0.2.0" + errno "~0.1.1" + prr "~0.0.0" + readable-stream "~1.0.26" + semver "~2.3.1" + xtend "~3.0.0" + leven@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" @@ -7081,20 +6875,6 @@ load-json-file@^5.3.0: strip-bom "^3.0.0" type-fest "^0.3.0" -loader-runner@^2.3.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.4.0.tgz#ed47066bfe534d7e84c4c7b9998c2a75607d9357" - integrity sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw== - -loader-utils@^1.0.2, loader-utils@^1.1.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7" - integrity sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA== - dependencies: - big.js "^5.2.2" - emojis-list "^2.0.0" - json5 "^1.0.1" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -7123,11 +6903,6 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash.clone@^4.3.2: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" - integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= - lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" @@ -7153,11 +6928,6 @@ lodash.set@^4.3.2: resolved "https://registry.yarnpkg.com/lodash.set/-/lodash.set-4.3.2.tgz#d8757b1da807dde24816b0d6a84bea1a76230b23" integrity sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM= -lodash.some@^4.2.2: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= - lodash.sortby@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" @@ -7183,7 +6953,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.4, lodash@^4.2.1: +lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -7211,11 +6981,6 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - integrity sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc= - loose-envify@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -7231,19 +6996,6 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lower-case@^1.1.1: - version "1.1.4" - resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.4.tgz#9a2cabd1b9e8e0ae993a4bf7d5875c39c42e8eac" - integrity sha1-miyr0bno4K6ZOkv31YdcOcQujqw= - -lru-cache@^4.0.1: - version "4.1.5" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" - integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -7251,11 +7003,23 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +ltgt@^2.1.2: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltgt/-/ltgt-2.2.1.tgz#f35ca91c493f7b73da0e07495304f17b31f87ee5" + integrity sha1-81ypHEk/e3PaDgdJUwTxezH4fuU= + macos-release@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-2.3.0.tgz#eb1930b036c0800adebccd5f17bc4c12de8bb71f" integrity sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA== +magic-string@^0.22.5: + version "0.22.5" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.22.5.tgz#8e9cf5afddf44385c1da5bc2a6a0dbd10b03657e" + integrity sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w== + dependencies: + vlq "^0.2.2" + magic-string@^0.25.2: version "0.25.3" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" @@ -7278,18 +7042,6 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-error-cause@^1.1.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/make-error-cause/-/make-error-cause-1.2.2.tgz#df0388fcd0b37816dff0a5fb8108939777dcbc9d" - integrity sha1-3wOI/NCzeBbf8KX7gQiTl3fcvJ0= - dependencies: - make-error "^1.2.0" - -make-error@^1.2.0: - version "1.3.5" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" - integrity sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g== - make-fetch-happen@^5.0.0: version "5.0.2" resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz#aa8387104f2687edca01c8687ee45013d02d19bd" @@ -7367,14 +7119,7 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - integrity sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y= - dependencies: - mimic-fn "^1.0.0" - -memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: +memory-fs@^0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552" integrity sha1-OpoguEYlI+RHz7x+i7gO1me/xVI= @@ -7600,7 +7345,7 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" -mkdirp@*, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +mkdirp@*, mkdirp@^0.5.0, mkdirp@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= @@ -7730,7 +7475,7 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" -neo-async@^2.5.0, neo-async@^2.6.0: +neo-async@^2.6.0: version "2.6.1" resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== @@ -7745,13 +7490,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== -no-case@^2.2.0: - version "2.3.2" - resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" - integrity sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ== - dependencies: - lower-case "^1.1.1" - node-fetch-npm@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7" @@ -7796,35 +7534,6 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-libs-browser@^2.0.0: - version "2.2.1" - resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-2.2.1.tgz#b64f513d18338625f90346d27b0d235e631f6425" - integrity sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q== - dependencies: - assert "^1.1.1" - browserify-zlib "^0.2.0" - buffer "^4.3.0" - console-browserify "^1.1.0" - constants-browserify "^1.0.0" - crypto-browserify "^3.11.0" - domain-browser "^1.1.1" - events "^3.0.0" - https-browserify "^1.0.0" - os-browserify "^0.3.0" - path-browserify "0.0.1" - process "^0.11.10" - punycode "^1.2.4" - querystring-es3 "^0.2.0" - readable-stream "^2.3.3" - stream-browserify "^2.0.1" - stream-http "^2.7.2" - string_decoder "^1.0.0" - timers-browserify "^2.0.4" - tty-browserify "0.0.0" - url "^0.11.0" - util "^0.11.0" - vm-browserify "^1.0.1" - node-modules-regexp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" @@ -7983,13 +7692,6 @@ npm-run-path@^3.0.0: gauge "~2.7.3" set-blocking "~2.0.0" -nth-check@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" - integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== - dependencies: - boolbase "~1.0.0" - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -8029,6 +7731,20 @@ object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.0.6, object-keys@^1.1.1 resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== +object-keys@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.2.0.tgz#cddec02998b091be42bf1035ae32e49f1cb6ea67" + integrity sha1-zd7AKZiwkb5CvxA1rjLknxy26mc= + dependencies: + foreach "~2.0.1" + indexof "~0.0.1" + is "~0.2.6" + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + integrity sha1-KKaq50KN0sOpLz2V8hM13SBOAzY= + object-visit@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" @@ -8095,6 +7811,11 @@ object.reduce@^1.0.0: for-own "^1.0.0" make-iterator "^1.0.0" +octal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/octal/-/octal-1.0.0.tgz#63e7162a68efbeb9e213588d58e989d1e5c4530b" + integrity sha1-Y+cWKmjvvrniE1iNWOmJ0eXEUws= + octokit-pagination-methods@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" @@ -8153,7 +7874,7 @@ ordered-read-streams@^1.0.0: dependencies: readable-stream "^2.0.1" -os-browserify@^0.3.0, os-browserify@~0.3.0: +os-browserify@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" integrity sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc= @@ -8170,15 +7891,6 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-locale@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" - integrity sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA== - dependencies: - execa "^0.7.0" - lcid "^1.0.0" - mem "^1.1.0" - os-name@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801" @@ -8326,13 +8038,6 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" -param-case@2.1.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" - integrity sha1-35T9jPZTHs915r75oIWPvHK+Ikc= - dependencies: - no-case "^2.2.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -8441,19 +8146,12 @@ parse5@4.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== -parse5@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" - integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== - dependencies: - "@types/node" "*" - pascalcase@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= -path-browserify@0.0.1, path-browserify@~0.0.0: +path-browserify@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.1.tgz#e6c4ddd7ed3aa27c68a20cc4e50e1a4ee83bbc4a" integrity sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ== @@ -8696,17 +8394,22 @@ pretty-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" integrity sha1-t+PqQkNaTJsnWdmeDyAesZWALuE= -private@^0.1.6, private@~0.1.5: +private@^0.1.6: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== +process-es6@^0.11.2, process-es6@^0.11.6: + version "0.11.6" + resolved "https://registry.yarnpkg.com/process-es6/-/process-es6-0.11.6.tgz#c6bb389f9a951f82bd4eb169600105bd2ff9c778" + integrity sha1-xrs4n5qVH4K9TrFpYAEFvS/5x3g= + process-nextick-args@^2.0.0, process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process@^0.11.10, process@~0.11.0: +process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" integrity sha1-czIwDoQBYb2j5podHZGn1LwW8YI= @@ -8766,16 +8469,16 @@ protoduck@^5.0.1: dependencies: genfun "^5.0.0" +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + integrity sha1-GoS4WQgyVQFBGFPQCB7j+obikmo= + prr@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= - psl@^1.1.24: version "1.4.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" @@ -8823,7 +8526,7 @@ punycode@1.3.2: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= -punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: +punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= @@ -8843,7 +8546,7 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -querystring-es3@^0.2.0, querystring-es3@~0.2.0: +querystring-es3@~0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= @@ -9021,7 +8724,7 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.1.1: +"readable-stream@2 || 3", readable-stream@^3.0.2: version "3.4.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== @@ -9030,7 +8733,7 @@ read@1, read@~1.0.1: string_decoder "^1.1.1" util-deprecate "^1.0.1" -"readable-stream@>=1.1.13-1 <1.2.0-0": +"readable-stream@>=1.1.13-1 <1.2.0-0", readable-stream@^1.0.26-4: version "1.1.14" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" integrity sha1-fPTFTvZI44EwhMY23SB54WbAgdk= @@ -9040,6 +8743,16 @@ read@1, read@~1.0.1: isarray "0.0.1" string_decoder "~0.10.x" +readable-stream@~1.0.26, readable-stream@~1.0.26-4: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + integrity sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw= + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + readdir-scoped-modules@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz#8d45407b4f870a0dcaebc0e28670d18e74514309" @@ -9066,16 +8779,6 @@ realpath-native@^1.1.0: dependencies: util.promisify "^1.0.0" -recast@~0.11.12: - version "0.11.23" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" - integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= - dependencies: - ast-types "0.9.6" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" - rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -9167,11 +8870,6 @@ regjsparser@^0.6.0: dependencies: jsesc "~0.5.0" -relateurl@0.2.x: - version "0.2.7" - resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" - integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= - remove-bom-buffer@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz#c2bf1e377520d324f623892e33c10cac2c252b53" @@ -9354,13 +9052,6 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - integrity sha1-YTObci/mo1FWiSENJOFMlhSGE+8= - dependencies: - align-text "^0.1.1" - rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -9384,6 +9075,39 @@ rollup-plugin-babel@^4.0.0: "@babel/helper-module-imports" "^7.0.0" rollup-pluginutils "^2.8.1" +rollup-plugin-commonjs@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-10.1.0.tgz#417af3b54503878e084d127adf4d1caf8beb86fb" + integrity sha512-jlXbjZSQg8EIeAAvepNwhJj++qJWNJw1Cl0YnOqKtP5Djx+fFGkp3WRh+W0ASCaFG5w1jhmzDxgu3SJuVxPF4Q== + dependencies: + estree-walker "^0.6.1" + is-reference "^1.1.2" + magic-string "^0.25.2" + resolve "^1.11.0" + rollup-pluginutils "^2.8.1" + +rollup-plugin-node-builtins@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-builtins/-/rollup-plugin-node-builtins-2.1.2.tgz#24a1fed4a43257b6b64371d8abc6ce1ab14597e9" + integrity sha1-JKH+1KQyV7a2Q3HYq8bOGrFFl+k= + dependencies: + browserify-fs "^1.0.0" + buffer-es6 "^4.9.2" + crypto-browserify "^3.11.0" + process-es6 "^0.11.2" + +rollup-plugin-node-globals@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz#5e1f24a9bb97c0ef51249f625e16c7e61b7c020b" + integrity sha512-xRkB+W/m1KLIzPUmG0ofvR+CPNcvuCuNdjVBVS7ALKSxr3EDhnzNceGkGi1m8MToSli13AzKFYH4ie9w3I5L3g== + dependencies: + acorn "^5.7.3" + buffer-es6 "^4.9.3" + estree-walker "^0.5.2" + magic-string "^0.22.5" + process-es6 "^0.11.6" + rollup-pluginutils "^2.3.1" + rollup-plugin-node-resolve@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-5.2.0.tgz#730f93d10ed202473b1fb54a5997a7db8c6d8523" @@ -9403,6 +9127,24 @@ rollup-plugin-replace@^2.2.0: magic-string "^0.25.2" rollup-pluginutils "^2.6.0" +rollup-plugin-terser@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz#3e41256205cb75f196fc70d4634227d1002c255c" + integrity sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g== + dependencies: + "@babel/code-frame" "^7.0.0" + jest-worker "^24.6.0" + rollup-pluginutils "^2.8.1" + serialize-javascript "^1.7.0" + terser "^4.1.0" + +rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0: + version "2.8.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" + integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== + dependencies: + estree-walker "^0.6.1" + rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: version "2.8.1" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97" @@ -9410,14 +9152,14 @@ rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: dependencies: estree-walker "^0.6.1" -rollup@^1.12.0: - version "1.17.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.17.0.tgz#47ee8b04514544fc93b39bae06271244c8db7dfa" - integrity sha512-k/j1m0NIsI4SYgCJR4MWPstGJOWfJyd6gycKoMhyoKPVXxm+L49XtbUwZyFsrSU2YXsOkM4u1ll9CS/ZgJBUpw== +rollup@^1.27.5: + version "1.27.5" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.27.5.tgz#d100fb0ffd8353575cb2057152547b9abfddfe59" + integrity sha512-8rfVdzuTg2kt8ObD9LNJpEwUN7B6lsl3sHc5fddtgICpLjpYeSf4m2+RftBzcCaBTMi1iYX3Ez8zFT4Gj2nJjg== dependencies: - "@types/estree" "0.0.39" - "@types/node" "^12.6.2" - acorn "^6.2.0" + "@types/estree" "*" + "@types/node" "*" + acorn "^7.1.0" rsvp@^4.8.4: version "4.8.5" @@ -9514,11 +9256,21 @@ semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-2.3.2.tgz#b9848f25d6cf36333073ec9ef8856d42f1233e52" + integrity sha1-uYSPJdbPNjMwc+ye+IVtQvEjPlI= + semver@~5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= +serialize-javascript@^1.7.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.9.1.tgz#cfc200aef77b600c47da9bb8149c943e798c2fdb" + integrity sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A== + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -9534,11 +9286,6 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" -setimmediate@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" - integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= - sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -9696,11 +9443,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - source-map-resolve@^0.5.0: version "0.5.2" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" @@ -9712,7 +9454,7 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.5.16, source-map-support@^0.5.6: +source-map-support@^0.5.16, source-map-support@^0.5.6, source-map-support@~0.5.12: version "0.5.16" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042" integrity sha512-efyLRJDr68D9hBBNIPWFjhpFzURh+KJykQwvMyW5UiZzYwoF6l4YMMDIJJEyFWxWCqfyxLzz6tSfUFR+kXXsVQ== @@ -9725,12 +9467,12 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.0, source-map@~0.5.1, source-map@~0.5.3: +source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.6, source-map@~0.5.3: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= -source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -9849,7 +9591,7 @@ stealthy-require@^1.1.1: resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= -stream-browserify@^2.0.0, stream-browserify@^2.0.1: +stream-browserify@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.2.tgz#87521d38a44aa7ee91ce1cd2a47df0cb49dd660b" integrity sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg== @@ -9878,7 +9620,7 @@ stream-exhaust@^1.0.1: resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== -stream-http@^2.0.0, stream-http@^2.7.2: +stream-http@^2.0.0: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== @@ -9922,6 +9664,11 @@ string-length@^2.0.0: astral-regex "^1.0.0" strip-ansi "^4.0.0" +string-range@~1.2, string-range@~1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/string-range/-/string-range-1.2.2.tgz#a893ed347e72299bc83befbbf2a692a8d239d5dd" + integrity sha1-qJPtNH5yKZvIO++78qaSqNI51d0= + string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -9931,7 +9678,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== @@ -9982,7 +9729,7 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" -string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@~1.1.1: +string_decoder@^1.1.1, string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== @@ -10092,13 +9839,6 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^4.2.1: - version "4.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" - integrity sha1-vnoN5ITexcXN34s9WRJQRJEvY1s= - dependencies: - has-flag "^2.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -10183,6 +9923,15 @@ temp-write@^3.4.0: temp-dir "^1.0.0" uuid "^3.0.1" +terser@^4.1.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.0.tgz#22c46b4817cf4c9565434bfe6ad47336af259ac3" + integrity sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA== + dependencies: + commander "^2.20.0" + source-map "~0.6.1" + source-map-support "~0.5.12" + test-exclude@^5.2.3: version "5.2.3" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" @@ -10261,7 +10010,7 @@ through2@^3.0.0: dependencies: readable-stream "2 || 3" -through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -10278,13 +10027,6 @@ timers-browserify@^1.0.1: dependencies: process "~0.11.0" -timers-browserify@^2.0.4: - version "2.0.10" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.10.tgz#1d28e3d2aadf1d5a5996c4e9f95601cd053480ae" - integrity sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg== - dependencies: - setimmediate "^1.0.4" - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -10389,11 +10131,6 @@ tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== -tty-browserify@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" - integrity sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY= - tty-browserify@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" @@ -10433,6 +10170,11 @@ type@^1.0.1: resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61" integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw== +typedarray-to-buffer@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-1.0.4.tgz#9bb8ba0e841fb3f4cf1fe7c245e9f3fa8a5fe99c" + integrity sha1-m7i6DoQfs/TPH+fCRenz+opf6Zw= + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -10443,7 +10185,7 @@ typescript@^3.6.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== -uglify-js@3.4.x, uglify-js@^3.0.5, uglify-js@^3.1.4: +uglify-js@^3.1.4: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== @@ -10451,30 +10193,6 @@ uglify-js@3.4.x, uglify-js@^3.0.5, uglify-js@^3.1.4: commander "~2.19.0" source-map "~0.6.1" -uglify-js@^2.8.29: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - integrity sha1-KcVzMUgFe7Th913zW3qcty5qWd0= - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - integrity sha1-bgkk1r2mta/jSeOabWMoUKD4grc= - -uglifyjs-webpack-plugin@^0.4.6: - version "0.4.6" - resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz#b951f4abb6bd617e66f63eb891498e391763e309" - integrity sha1-uVH0q7a9YX5m9j64kUmOORdj4wk= - dependencies: - source-map "^0.5.6" - uglify-js "^2.8.29" - webpack-sources "^1.0.1" - uid-number@0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" @@ -10606,11 +10324,6 @@ upath@^1.1.1: resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== -upper-case@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" - integrity sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg= - uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -10623,7 +10336,7 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= -url@^0.11.0, url@~0.11.0: +url@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= @@ -10663,13 +10376,6 @@ util@0.10.3, util@~0.10.1: dependencies: inherits "2.0.1" -util@^0.11.0: - version "0.11.1" - resolved "https://registry.yarnpkg.com/util/-/util-0.11.1.tgz#3236733720ec64bb27f6e26f421aaa2e1b588d61" - integrity sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ== - dependencies: - inherits "2.0.3" - uuid@^3.0.1, uuid@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" @@ -10787,7 +10493,12 @@ vinyl@^2.0.0, vinyl@^2.1.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vm-browserify@^1.0.0, vm-browserify@^1.0.1: +vlq@^0.2.2: + version "0.2.3" + resolved "https://registry.yarnpkg.com/vlq/-/vlq-0.2.3.tgz#8f3e4328cf63b1540c0d67e1b2778386f8975b26" + integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== + +vm-browserify@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== @@ -10806,20 +10517,6 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" -warnings-to-errors-webpack-plugin@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/warnings-to-errors-webpack-plugin/-/warnings-to-errors-webpack-plugin-2.0.0.tgz#1ce862fa845c77a3c21bb68c839efaa7ebbdb9fb" - integrity sha512-0Girb3F5xc5U1TpYMiLDcie5oB+Ko2EuujOYyS3aXpKS4Yp264WkIuJ+0vF8wnmkDkmZAOBxahBedEL0mLjHQA== - -watchpack@^1.4.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.6.0.tgz#4bc12c2ebe8aa277a71f1d3f14d685c7b446cd00" - integrity sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA== - dependencies: - chokidar "^2.0.2" - graceful-fs "^4.1.2" - neo-async "^2.5.0" - wcwidth@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -10832,82 +10529,6 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== -webpack-dependency-suite@^2.4.4: - version "2.4.5" - resolved "https://registry.yarnpkg.com/webpack-dependency-suite/-/webpack-dependency-suite-2.4.5.tgz#e2d3c9a178140edb7be41de57413a31cb2f11ec0" - integrity sha512-UyAXvIu12XjcuiUkO1QQ7xRC/rpOyCfdCOhlhgJrLkt2FqK/l0dhynVxLRHO/QyGoNpfoO0N7k+m/LTxfriwrQ== - dependencies: - "@types/acorn" "^4.0.2" - "@types/cheerio" "^0.22.1" - "@types/debug" "^0.0.29" - "@types/enhanced-resolve" "^3.0.3" - "@types/escape-string-regexp" "^0.0.30" - "@types/estree" "0.0.35" - "@types/lodash" "^4.14.67" - "@types/node" "^8.0.0" - "@types/semver" "^5.3.32" - "@types/webpack" "^3.0.0" - acorn "^5.0.3" - cheerio "^1.0.0-rc.1" - debug "^3.0.0" - escape-string-regexp "^1.0.5" - html-loader "^0.4.5" - loader-utils "^1.1.0" - lodash "^4.17.4" - semver "^5.3.0" - source-map "^0.5.6" - -webpack-sources@^1.0.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.3.0.tgz#2a28dcb9f1f45fe960d8f1493252b5ee6530fa85" - integrity sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack-stream@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-4.0.3.tgz#96399fd7911b94c264bfc59e356738a89b5ca136" - integrity sha512-Tx7ks7Of/JiPz7/tUM4WqSg4OcXF4m4OzNSaEzNA1TNXQaiTHIjiKqUoL79wGXbFt2q1IP8VG5DcEdaxifY5Ew== - dependencies: - fancy-log "^1.3.2" - lodash.clone "^4.3.2" - lodash.some "^4.2.2" - memory-fs "^0.4.1" - plugin-error "^1.0.1" - supports-color "^5.3.0" - through "^2.3.8" - vinyl "^2.1.0" - webpack "^3.4.1" - -webpack@^3.4.1: - version "3.12.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.12.0.tgz#3f9e34360370602fcf639e97939db486f4ec0d74" - integrity sha512-Sw7MdIIOv/nkzPzee4o0EdvCuPmxT98+vVpIvwtcwcF1Q4SDSNp92vwcKc4REe7NItH9f1S4ra9FuQ7yuYZ8bQ== - dependencies: - acorn "^5.0.0" - acorn-dynamic-import "^2.0.0" - ajv "^6.1.0" - ajv-keywords "^3.1.0" - async "^2.1.2" - enhanced-resolve "^3.4.0" - escope "^3.6.0" - interpret "^1.0.0" - json-loader "^0.5.4" - json5 "^0.5.1" - loader-runner "^2.3.0" - loader-utils "^1.1.0" - memory-fs "~0.4.1" - mkdirp "~0.5.0" - node-libs-browser "^2.0.0" - source-map "^0.5.3" - supports-color "^4.2.1" - tapable "^0.2.7" - uglifyjs-webpack-plugin "^0.4.6" - watchpack "^1.4.0" - webpack-sources "^1.0.1" - yargs "^8.0.2" - whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: version "1.0.5" resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" @@ -10962,11 +10583,6 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - integrity sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0= - windows-release@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/windows-release/-/windows-release-3.2.0.tgz#8122dad5afc303d833422380680a79cdfa91785f" @@ -10974,7 +10590,7 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -wordwrap@0.0.2, wordwrap@~0.0.2: +wordwrap@~0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= @@ -11088,6 +10704,31 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== +xtend@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.2.0.tgz#eef6b1f198c1c8deafad8b1765a04dad4a01c5a9" + integrity sha1-7vax8ZjByN6vrYsXZaBNrUoBxak= + +xtend@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.0.6.tgz#5ea657a6dba447069c2e59c58a1138cb0c5e6cee" + integrity sha1-XqZXptukRwacLlnFihE4ywxebO4= + dependencies: + is-object "~0.1.2" + object-keys "~0.2.0" + +xtend@~2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + integrity sha1-bv7MKk2tjmlixJAbM3znuoe10os= + dependencies: + object-keys "~0.4.0" + +xtend@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" + integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo= + y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -11098,11 +10739,6 @@ y18n@^4.0.0: resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= - yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3: version "3.1.1" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" @@ -11145,13 +10781,6 @@ yargs-parser@^5.0.0: dependencies: camelcase "^3.0.0" -yargs-parser@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - integrity sha1-jQrELxbqVd69MyyvTEA4s+P139k= - dependencies: - camelcase "^4.1.0" - yargs@^13.3.0: version "13.3.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83" @@ -11222,32 +10851,3 @@ yargs@^7.1.0: which-module "^1.0.0" y18n "^3.2.1" yargs-parser "^5.0.0" - -yargs@^8.0.2: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - integrity sha1-YpmpBVsc78lp/355wdkY3Osiw2A= - dependencies: - camelcase "^4.1.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - read-pkg-up "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^7.0.0" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - integrity sha1-9+572FfdfB0tOMDnTvvWgdFDH9E= - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" From c6e966cac95f5fb415984af430e9f1a153ec3078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 5 Dec 2019 02:23:53 -0500 Subject: [PATCH 846/965] [parser] Use scope flags to check arguments (#10801) * chore: add test case Co-authored-by: Jens Maier * use scope flags to check arguments --- .../babel-parser/src/parser/expression.js | 6 +- packages/babel-parser/src/util/scope.js | 5 +- .../input.js | 5 + .../options.json | 3 + .../output.json | 328 ++++++++++++++++++ .../arguments-in-nested-class/input.js | 5 + .../arguments-in-nested-class/options.json | 3 + .../arguments-in-nested-class/output.json | 311 +++++++++++++++++ 8 files changed, 664 insertions(+), 2 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 81d34b837d2d..99f0d0977929 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -2208,7 +2208,11 @@ export default class ExpressionParser extends LValParser { } } - if (this.state.inClassProperty && word === "arguments") { + if ( + this.scope.inClass && + !this.scope.inNonArrowFunction && + word === "arguments" + ) { this.raise( startLoc, "'arguments' is not allowed in class field initializer", diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index e40cb53e3e33..f367ae5e76b6 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -64,6 +64,9 @@ export default class ScopeHandler { get allowDirectSuper() { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0; } + get inClass() { + return (this.currentThisScope().flags & SCOPE_CLASS) > 0; + } get inNonArrowFunction() { return (this.currentThisScope().flags & SCOPE_FUNCTION) > 0; } @@ -199,7 +202,7 @@ export default class ScopeHandler { } } - // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`. + // Could be useful for `arguments`, `this`, `new.target`, `super()`, `super.property`, and `super[property]`. // $FlowIgnore currentThisScope(): IScope { for (let i = this.scopeStack.length - 1; ; i--) { diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js new file mode 100644 index 000000000000..4594b01a45b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/input.js @@ -0,0 +1,5 @@ +function fn() { + class A { + foo = class B { @bar(arguments) foo }; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json new file mode 100644 index 000000000000..c61fa716aeb5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties", ["decorators", { "decoratorsBeforeExport": false }]] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json new file mode 100644 index 000000000000..deb781226e7f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json @@ -0,0 +1,328 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "errors": [ + "SyntaxError: 'arguments' is not allowed in class field initializer (3:25)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "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": 76, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 18, + "end": 74, + "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": 74, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 32, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 42 + } + }, + "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": "ClassExpression", + "start": 38, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 46, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 41 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 48, + "end": 67, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "decorators": [ + { + "type": "Decorator", + "start": 48, + "end": 63, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 35 + } + }, + "expression": { + "type": "CallExpression", + "start": 49, + "end": 63, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 35 + } + }, + "callee": { + "type": "Identifier", + "start": 49, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 24 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "arguments": [ + { + "type": "Identifier", + "start": 53, + "end": 62, + "loc": { + "start": { + "line": 3, + "column": 25 + }, + "end": { + "line": 3, + "column": 34 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + ] + } + } + ], + "static": false, + "key": { + "type": "Identifier", + "start": 64, + "end": 67, + "loc": { + "start": { + "line": 3, + "column": 36 + }, + "end": { + "line": 3, + "column": 39 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "computed": false, + "value": null + } + ] + } + } + } + ] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js new file mode 100644 index 000000000000..5bcc6b3ee5fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/input.js @@ -0,0 +1,5 @@ +function fn() { + class A { + foo = class B { bar() { arguments } }; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json new file mode 100644 index 000000000000..9c27576d4ad0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json new file mode 100644 index 000000000000..107a090b5e92 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json @@ -0,0 +1,311 @@ +{ + "type": "File", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 76, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "FunctionDeclaration", + "start": 0, + "end": 76, + "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": 76, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 18, + "end": 74, + "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": 74, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 4, + "column": 3 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 32, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 42 + } + }, + "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": "ClassExpression", + "start": 38, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 41 + } + }, + "id": { + "type": "Identifier", + "start": 44, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 46, + "end": 69, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 41 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 48, + "end": 67, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 48, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 20 + }, + "end": { + "line": 3, + "column": 23 + }, + "identifierName": "bar" + }, + "name": "bar" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 54, + "end": 67, + "loc": { + "start": { + "line": 3, + "column": 26 + }, + "end": { + "line": 3, + "column": 39 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 56, + "end": 65, + "loc": { + "start": { + "line": 3, + "column": 28 + }, + "end": { + "line": 3, + "column": 37 + } + }, + "expression": { + "type": "Identifier", + "start": 56, + "end": 65, + "loc": { + "start": { + "line": 3, + "column": 28 + }, + "end": { + "line": 3, + "column": 37 + }, + "identifierName": "arguments" + }, + "name": "arguments" + } + } + ], + "directives": [] + } + } + ] + } + } + } + ] + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file From c9a68984d6e727b4c326fc9ad55caa8d54fbea29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 5 Dec 2019 02:28:52 -0500 Subject: [PATCH 847/965] `babel --watch` should have equivalent file selection logic with `babel` (#10283) * fix(watcher): skip non-compilable file only when it is not included in filenames argument * perf: disable globbing for watch --- packages/babel-cli/src/babel/file.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js index 1ad5d6b84772..c1c60ff91615 100644 --- a/packages/babel-cli/src/babel/file.js +++ b/packages/babel-cli/src/babel/file.js @@ -216,6 +216,7 @@ export default async function({ const chokidar = util.requireChokidar(); chokidar .watch(filenames, { + disableGlobbing: true, persistent: true, ignoreInitial: true, awaitWriteFinish: { @@ -224,7 +225,10 @@ export default async function({ }, }) .on("all", function(type: string, filename: string): void { - if (!util.isCompilableExtension(filename, cliOptions.extensions)) { + if ( + !util.isCompilableExtension(filename, cliOptions.extensions) && + !filenames.includes(filename) + ) { return; } From d3a37b5d08074c007268eb15a11ae432165bad5d Mon Sep 17 00:00:00 2001 From: shimataro Date: Fri, 6 Dec 2019 21:30:23 +0900 Subject: [PATCH 848/965] Add ".js" extension to injected polyfill imports (#10549) * Node modules compatibility: add ".js" extension to imported polyfills * Update fixtures * add extensions on calling `addDefaultImport()`, not in the function. --- .../interop-loose/imports-hoisting/output.js | 4 +- .../interop-loose/multi-load/output.js | 4 +- .../interop/imports-hoisting/output.js | 4 +- .../fixtures/interop/multi-load/output.js | 4 +- .../test/fixtures/regression/T7041/output.js | 2 +- .../src/index.js | 20 +- .../absoluteRuntime/relative/output.js | 2 +- .../fixtures/absoluteRuntime/true/output.js | 2 +- .../aliased-constructors/output.js | 6 +- .../runtime-corejs2/catch-all/output.js | 2 +- .../fixtures/runtime-corejs2/class/output.js | 2 +- .../runtime-corejs2/es6-for-of/output.js | 2 +- .../evaluated-static-methods/output.js | 4 +- .../fixtures/runtime-corejs2/full/output.mjs | 4 +- .../fixtures/runtime-corejs2/math/output.js | 34 +- .../runtime-corejs2/modules-helpers/output.js | 6 +- .../runtime-corejs2/modules/output.js | 6 +- .../regenerator-runtime/output.js | 2 +- .../symbol-iterator-in/output.js | 2 +- .../runtime-corejs2/symbol-iterator/output.js | 2 +- .../aliased-constructors/output.js | 6 +- .../built-in-globals-proposals/output.js | 40 +- .../built-in-globals/output.js | 30 +- .../output.js | 82 +-- .../built-in-instance-methods/output.js | 74 +-- .../output.js | 216 +++---- .../built-in-static-methods/output.js | 164 ++--- .../runtime-corejs3/catch-all/output.js | 2 +- .../fixtures/runtime-corejs3/class/output.js | 2 +- .../runtime-corejs3/es6-for-of/output.js | 2 +- .../evaluated-instance-methods/output.js | 4 +- .../evaluated-static-methods/output.js | 4 +- .../fixtures/runtime-corejs3/full/output.mjs | 4 +- .../runtime-corejs3/instance-call/output.js | 2 +- .../instance-computed/output.js | 2 +- .../runtime-corejs3/instance-get/output.js | 2 +- .../instance-inference-optimization/output.js | 2 +- .../runtime-corejs3/modules-helpers/output.js | 6 +- .../runtime-corejs3/modules-loose/output.js | 6 +- .../runtime-corejs3/modules/output.js | 8 +- .../regenerator-runtime/output.js | 2 +- .../symbol-iterator-get-method/output.js | 2 +- .../symbol-iterator-get/output.js | 2 +- .../symbol-iterator-in/output.js | 2 +- .../runtime-corejs3/symbol-iterator/output.js | 2 +- .../test/fixtures/runtime/class/output.js | 2 +- .../test/fixtures/runtime/full/output.mjs | 2 +- .../runtime/modules-helpers/output.js | 6 +- .../test/fixtures/runtime/modules/output.js | 2 +- .../runtime/regenerator-runtime/output.js | 2 +- .../corejs-useES6Modules/output.mjs | 8 +- .../fixtures/use-options/corejs/output.mjs | 8 +- .../useESModules-cjs-auto/output.js | 8 +- .../use-options/useESModules-cjs/output.js | 8 +- .../useESModules-mjs-auto/output.mjs | 8 +- .../use-options/useESModules-mjs/output.mjs | 8 +- packages/babel-preset-env/src/utils.js | 4 +- .../fixtures/corejs2/entry-all/output.mjs | 298 ++++----- .../corejs2/entry-chrome-48/output.mjs | 120 ++-- .../corejs2/entry-chrome-49/output.mjs | 90 +-- .../corejs2/entry-chrome-66/output.mjs | 8 +- .../corejs2/entry-chrome-71/output.mjs | 6 +- .../corejs2/entry-chromeandroid/output.mjs | 26 +- .../entry-core-js-main-require/output.mjs | 32 +- .../corejs2/entry-core-js-main/output.mjs | 32 +- .../corejs2/entry-electron/output.mjs | 40 +- .../fixtures/corejs2/entry-ie-11/output.mjs | 254 ++++---- .../fixtures/corejs2/entry-ie-9/output.mjs | 260 ++++---- .../fixtures/corejs2/entry-import/output.mjs | 32 +- .../corejs2/entry-node-10.13/output.mjs | 2 +- .../corejs2/entry-node-web/output.mjs | 34 +- .../fixtures/corejs2/entry-node/output.mjs | 28 +- .../fixtures/corejs2/entry-require/output.js | 32 +- .../corejs2/entry-shippedProposals/output.js | 298 ++++----- .../corejs2/exclude-built-ins/output.mjs | 4 +- .../corejs2/exclude-include/output.mjs | 34 +- .../corejs2/exclude-regenerator/output.mjs | 296 ++++----- .../corejs2/force-all-transforms/output.mjs | 34 +- .../corejs2/include-built-ins/output.mjs | 36 +- .../fixtures/corejs2/usage-all/output.mjs | 20 +- .../output.mjs | 2 +- .../usage-evaluated-class-methods/output.mjs | 8 +- .../output.mjs | 4 +- .../usage-evaluated-not-confident/output.mjs | 11 +- .../usage-for-of-destructure-with/output.mjs | 4 +- .../output.mjs | 2 +- .../corejs2/usage-instance-methods/output.mjs | 42 +- .../corejs2/usage-modules-transform/output.js | 4 +- .../corejs2/usage-native-support/output.mjs | 2 +- .../corejs2/usage-number-ie-11/output.mjs | 6 +- .../corejs2/usage-promise-all/output.mjs | 10 +- .../corejs2/usage-promise-finally/output.mjs | 6 +- .../corejs2/usage-promise-race/output.mjs | 10 +- .../usage-regenerator-used-async/output.mjs | 2 +- .../output.mjs | 2 +- .../corejs2/usage-shippedProposals/output.js | 28 +- .../usage-source-type-script-query/output.js | 6 +- .../usage-source-type-script/output.js | 6 +- .../usage-symbol-iterator-in/output.mjs | 6 +- .../corejs2/usage-symbol-iterator/output.mjs | 6 +- .../fixtures/corejs2/usage-timers/output.mjs | 4 +- .../usage-typed-array-static/output.mjs | 2 +- .../corejs2/usage-typed-array/output.mjs | 2 +- .../corejs2/usage-yield-star/output.mjs | 2 +- .../corejs3/entry-all-chrome-71/output.mjs | 172 +++--- .../fixtures/corejs3/entry-all/output.mjs | 580 +++++++++--------- .../corejs3/entry-chrome-48/output.mjs | 190 +++--- .../corejs3/entry-chrome-49/output.mjs | 152 ++--- .../corejs3/entry-chrome-66/output.mjs | 28 +- .../corejs3/entry-chrome-71/output.mjs | 10 +- .../corejs3/entry-chromeandroid/output.mjs | 50 +- .../corejs3/entry-electron/output.mjs | 58 +- .../output.mjs | 170 ++--- .../output.mjs | 570 ++++++++--------- .../output.mjs | 40 +- .../corejs3/entry-entries-features/output.mjs | 52 +- .../corejs3/entry-entries-missed/output.mjs | 36 +- .../entry-entries-mixed-chrome-71/output.mjs | 20 +- .../corejs3/entry-entries-mixed/output.mjs | 100 +-- .../output.mjs | 4 +- .../corejs3/entry-entries-modules/output.mjs | 6 +- .../output.mjs | 162 ++--- .../entry-entries-proposals/output.mjs | 170 ++--- .../entry-entries-stable-chrome-71/output.mjs | 2 +- .../corejs3/entry-entries-stable/output.mjs | 14 +- .../entry-entries-stage-chrome-71/output.mjs | 162 ++--- .../corejs3/entry-entries-stage/output.mjs | 170 ++--- .../entry-entries-web-chrome-71/output.mjs | 2 +- .../corejs3/entry-entries-web/output.mjs | 16 +- .../fixtures/corejs3/entry-ie-11/output.mjs | 360 +++++------ .../fixtures/corejs3/entry-ie-9/output.mjs | 372 +++++------ .../fixtures/corejs3/entry-import/output.mjs | 58 +- .../corejs3/entry-node-10.13/output.mjs | 16 +- .../fixtures/corejs3/entry-node-11/output.mjs | 10 +- .../corejs3/entry-node-web/output.mjs | 58 +- .../fixtures/corejs3/entry-node/output.mjs | 52 +- .../corejs3/entry-normalization/output.mjs | 20 +- .../corejs3/entry-require-all/output.js | 222 +++---- .../entry-require-es-chrome-71/output.js | 8 +- .../entry-require-es-proposals/output.js | 214 +++---- .../fixtures/corejs3/entry-require/output.js | 58 +- .../corejs3/entry-stable-chrome-71/output.mjs | 10 +- .../entry-stable-samsung-8.2/output.mjs | 38 +- .../fixtures/corejs3/entry-stable/output.mjs | 416 ++++++------- .../corejs3/exclude-built-ins/output.mjs | 34 +- .../corejs3/exclude-include/output.mjs | 58 +- .../corejs3/exclude-regenerator/output.mjs | 416 ++++++------- .../test/fixtures/corejs3/exclude/output.mjs | 4 +- .../corejs3/force-all-transforms/output.mjs | 58 +- .../corejs3/include-built-ins/output.mjs | 62 +- .../usage-all-proposals-chrome-71/output.mjs | 30 +- .../corejs3/usage-all-proposals/output.mjs | 60 +- .../fixtures/corejs3/usage-all/output.mjs | 28 +- .../output.mjs | 4 +- .../output.mjs | 10 +- .../usage-destructuring-assignment/output.mjs | 6 +- .../usage-destructuring-catch/output.mjs | 6 +- .../usage-destructuring-for-x/output.mjs | 6 +- .../usage-destructuring-iife/output.mjs | 8 +- .../usage-destructuring-params/output.mjs | 6 +- .../output.mjs | 6 +- .../output.mjs | 16 +- .../corejs3/usage-dynamic-import/output.mjs | 4 +- .../usage-evaluated-class-methods/output.mjs | 8 +- .../output.mjs | 4 +- .../fixtures/corejs3/usage-fetch/output.mjs | 4 +- .../usage-for-of-destructure-with/output.mjs | 6 +- .../fixtures/corejs3/usage-for-of/output.mjs | 6 +- .../test/fixtures/corejs3/usage-in/output.mjs | 10 +- .../corejs3/usage-instance-methods/output.mjs | 44 +- .../corejs3/usage-modules-transform/output.js | 4 +- .../corejs3/usage-number-ie-11/output.mjs | 6 +- .../usage-object-destructuring/output.mjs | 32 +- .../corejs3/usage-promise-all/output.mjs | 10 +- .../corejs3/usage-promise-finally/output.mjs | 6 +- .../corejs3/usage-promise-race/output.mjs | 10 +- .../output.mjs | 2 +- .../usage-regenerator-used-async/output.mjs | 6 +- .../output.mjs | 2 +- .../corejs3/usage-shippedProposals/output.js | 30 +- .../usage-source-type-script-query/output.js | 6 +- .../usage-source-type-script/output.js | 6 +- .../fixtures/corejs3/usage-spread/output.mjs | 6 +- .../corejs3/usage-static-methods/output.mjs | 8 +- .../usage-symbol-iterator-in/output.mjs | 14 +- .../corejs3/usage-symbol-iterator/output.mjs | 14 +- .../fixtures/corejs3/usage-timers/output.mjs | 8 +- .../usage-typed-array-edge-13/output.mjs | 10 +- .../usage-typed-array-static/output.mjs | 56 +- .../corejs3/usage-typed-array/output.mjs | 54 +- .../corejs3/usage-yield-star/output.mjs | 4 +- .../helpers/esm/iterableToArray.js | 4 +- .../helpers/iterableToArray.js | 4 +- 193 files changed, 4547 insertions(+), 4548 deletions(-) diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js index d17f42975dae..cb014def7c22 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js @@ -1,8 +1,8 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); -var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral.js")); function _templateObject() { const data = (0, _taggedTemplateLiteral2.default)(["foo"]); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js index fc02ffa1536e..a14b440e0a15 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js @@ -1,9 +1,9 @@ "use strict"; -var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault.js"); exports.__esModule = true; -var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault")); +var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault.js")); console.log(_interopRequireDefault2.default); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js index d17f42975dae..cb014def7c22 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js @@ -1,8 +1,8 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); -var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral.js")); function _templateObject() { const data = (0, _taggedTemplateLiteral2.default)(["foo"]); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js index 2e762d530630..ef2c4d88034a 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js @@ -1,11 +1,11 @@ "use strict"; -var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", { value: true }); -var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault")); +var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault.js")); console.log(_interopRequireDefault2.default); diff --git a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js index 5c1627f53221..2ec4fecf3982 100644 --- a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js +++ b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime/regenerator"); +var _regeneratorRuntime = require("@babel/runtime/regenerator/index.js"); var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index a9d0fd350deb..532be2a590d4 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -234,7 +234,7 @@ export default declare((api, options, dirname) => { : "helpers"; return this.addDefaultImport( - `${modulePath}/${helpersDir}/${name}`, + `${modulePath}/${helpersDir}/${name}.js`, name, blockHoist, ); @@ -275,7 +275,7 @@ export default declare((api, options, dirname) => { if (name === "regeneratorRuntime" && useRuntimeRegenerator) { path.replaceWith( this.addDefaultImport( - `${modulePath}/regenerator`, + `${modulePath}/regenerator/index.js`, "regeneratorRuntime", ), ); @@ -291,7 +291,7 @@ export default declare((api, options, dirname) => { // transform global built-ins like `Symbol()`, `new Promise` path.replaceWith( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`, + `${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`, name, ), ); @@ -332,7 +332,7 @@ export default declare((api, options, dirname) => { node.callee = t.memberExpression( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`, `${propertyName}InstanceProperty`, ), [context2], @@ -354,7 +354,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${modulePath}/core-js/get-iterator`, + `${modulePath}/core-js/get-iterator.js`, "getIterator", ), [object], @@ -371,7 +371,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${modulePath}/core-js/is-iterable`, + `${modulePath}/core-js/is-iterable.js`, "isIterable", ), [path.node.right], @@ -399,7 +399,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${moduleName}/core-js/get-iterator-method`, + `${moduleName}/core-js/get-iterator-method.js`, "getIteratorMethod", ), [object], @@ -427,7 +427,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`, `${propertyName}InstanceProperty`, ), [object], @@ -439,7 +439,7 @@ export default declare((api, options, dirname) => { path.replaceWith( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`, + `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}.js`, `${objectName}$${propertyName}`, ), ); @@ -460,7 +460,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.memberExpression( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`, + `${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`, name, ), node.property, diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js index e783188c9e48..b7cb3430b3fa 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck.js"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js index e783188c9e48..b7cb3430b3fa 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck.js"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js index 4e753ff15d6f..d4a30ccb3aa2 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js @@ -1,8 +1,8 @@ -var _Map = require("@babel/runtime-corejs2/core-js/map"); +var _Map = require("@babel/runtime-corejs2/core-js/map.js"); -var _Symbol = require("@babel/runtime-corejs2/core-js/symbol"); +var _Symbol = require("@babel/runtime-corejs2/core-js/symbol.js"); -var _Promise = require("@babel/runtime-corejs2/core-js/promise"); +var _Promise = require("@babel/runtime-corejs2/core-js/promise.js"); obj.constructor === Object; obj.constructor === _Promise; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js index de4a16bd915b..95aa6157d958 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js @@ -1,3 +1,3 @@ -var _Promise = require("@babel/runtime-corejs2/core-js/promise"); +var _Promise = require("@babel/runtime-corejs2/core-js/promise.js"); _Promise.resolve; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js index 132a249e9768..4fc91217ed7b 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime-corejs2/helpers/classCallCheck"); +var _classCallCheck = require("@babel/runtime-corejs2/helpers/classCallCheck.js"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js index be11791731f3..a8c4aef4dd5b 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js @@ -1,4 +1,4 @@ -var _getIterator = require("@babel/runtime-corejs2/core-js/get-iterator"); +var _getIterator = require("@babel/runtime-corejs2/core-js/get-iterator.js"); var _iteratorNormalCompletion = true; var _didIteratorError = false; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js index 59868c6f60d5..6320b2e7bdf7 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js @@ -1,6 +1,6 @@ -var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array"); +var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array.js"); -var _Array$from = require("@babel/runtime-corejs2/core-js/array/from"); +var _Array$from = require("@babel/runtime-corejs2/core-js/array/from.js"); var _isArray = "isArray"; _Array$from; // polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs index 841a99d5778e..8c57291c45ec 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs @@ -1,5 +1,5 @@ -import _regeneratorRuntime from "@babel/runtime-corejs2/regenerator"; -import _Symbol from "@babel/runtime-corejs2/core-js/symbol"; +import _regeneratorRuntime from "@babel/runtime-corejs2/regenerator/index.js"; +import _Symbol from "@babel/runtime-corejs2/core-js/symbol.js"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js index 7b773a5ec2fe..d1109bc0c1d5 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js @@ -1,36 +1,36 @@ -var _Math$trunc = require("@babel/runtime-corejs2/core-js/math/trunc"); +var _Math$trunc = require("@babel/runtime-corejs2/core-js/math/trunc.js"); -var _Math$tanh = require("@babel/runtime-corejs2/core-js/math/tanh"); +var _Math$tanh = require("@babel/runtime-corejs2/core-js/math/tanh.js"); -var _Math$sinh = require("@babel/runtime-corejs2/core-js/math/sinh"); +var _Math$sinh = require("@babel/runtime-corejs2/core-js/math/sinh.js"); -var _Math$sign = require("@babel/runtime-corejs2/core-js/math/sign"); +var _Math$sign = require("@babel/runtime-corejs2/core-js/math/sign.js"); -var _Math$log2 = require("@babel/runtime-corejs2/core-js/math/log2"); +var _Math$log2 = require("@babel/runtime-corejs2/core-js/math/log2.js"); -var _Math$log1p = require("@babel/runtime-corejs2/core-js/math/log1p"); +var _Math$log1p = require("@babel/runtime-corejs2/core-js/math/log1p.js"); -var _Math$log = require("@babel/runtime-corejs2/core-js/math/log10"); +var _Math$log = require("@babel/runtime-corejs2/core-js/math/log10.js"); -var _Math$imul = require("@babel/runtime-corejs2/core-js/math/imul"); +var _Math$imul = require("@babel/runtime-corejs2/core-js/math/imul.js"); -var _Math$hypot = require("@babel/runtime-corejs2/core-js/math/hypot"); +var _Math$hypot = require("@babel/runtime-corejs2/core-js/math/hypot.js"); -var _Math$fround = require("@babel/runtime-corejs2/core-js/math/fround"); +var _Math$fround = require("@babel/runtime-corejs2/core-js/math/fround.js"); -var _Math$expm = require("@babel/runtime-corejs2/core-js/math/expm1"); +var _Math$expm = require("@babel/runtime-corejs2/core-js/math/expm1.js"); -var _Math$cosh = require("@babel/runtime-corejs2/core-js/math/cosh"); +var _Math$cosh = require("@babel/runtime-corejs2/core-js/math/cosh.js"); -var _Math$clz = require("@babel/runtime-corejs2/core-js/math/clz32"); +var _Math$clz = require("@babel/runtime-corejs2/core-js/math/clz32.js"); -var _Math$cbrt = require("@babel/runtime-corejs2/core-js/math/cbrt"); +var _Math$cbrt = require("@babel/runtime-corejs2/core-js/math/cbrt.js"); -var _Math$atanh = require("@babel/runtime-corejs2/core-js/math/atanh"); +var _Math$atanh = require("@babel/runtime-corejs2/core-js/math/atanh.js"); -var _Math$asinh = require("@babel/runtime-corejs2/core-js/math/asinh"); +var _Math$asinh = require("@babel/runtime-corejs2/core-js/math/asinh.js"); -var _Math$acosh = require("@babel/runtime-corejs2/core-js/math/acosh"); +var _Math$acosh = require("@babel/runtime-corejs2/core-js/math/acosh.js"); _Math$acosh; _Math$asinh; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js index 8b91c079a609..045066bf2dc5 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault.js"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck.js")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass.js")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js index c3eab7f58ed2..79ad15d13c20 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault.js"); -var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys"); +var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys.js"); -var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property"); +var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property.js"); _Object$defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js index 852c24b9c4a3..0e5d6a2644d4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime-corejs2/regenerator"); +var _regeneratorRuntime = require("@babel/runtime-corejs2/regenerator/index.js"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js index 8d5e3c048d4f..0f508eedc462 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js @@ -1,3 +1,3 @@ -var _isIterable = require("@babel/runtime-corejs2/core-js/is-iterable"); +var _isIterable = require("@babel/runtime-corejs2/core-js/is-iterable.js"); _isIterable(Object(arr)); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js index dc708b45cc42..f890976ca4f7 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js @@ -1,3 +1,3 @@ -var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator"); +var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator.js"); _Symbol$iterator; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js index 45bcce8ebc04..4cfad5710a13 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js @@ -1,8 +1,8 @@ -var _Map = require("@babel/runtime-corejs3/core-js-stable/map"); +var _Map = require("@babel/runtime-corejs3/core-js-stable/map.js"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); obj.constructor === Object; obj.constructor === _Promise; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js index 90766b4cd4be..96fc2c806283 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js @@ -1,42 +1,42 @@ -var _setTimeout = require("@babel/runtime-corejs3/core-js/set-timeout"); +var _setTimeout = require("@babel/runtime-corejs3/core-js/set-timeout.js"); -var _setInterval = require("@babel/runtime-corejs3/core-js/set-interval"); +var _setInterval = require("@babel/runtime-corejs3/core-js/set-interval.js"); -var _setImmediate = require("@babel/runtime-corejs3/core-js/set-immediate"); +var _setImmediate = require("@babel/runtime-corejs3/core-js/set-immediate.js"); -var _queueMicrotask = require("@babel/runtime-corejs3/core-js/queue-microtask"); +var _queueMicrotask = require("@babel/runtime-corejs3/core-js/queue-microtask.js"); -var _parseInt = require("@babel/runtime-corejs3/core-js/parse-int"); +var _parseInt = require("@babel/runtime-corejs3/core-js/parse-int.js"); -var _parseFloat = require("@babel/runtime-corejs3/core-js/parse-float"); +var _parseFloat = require("@babel/runtime-corejs3/core-js/parse-float.js"); -var _globalThis = require("@babel/runtime-corejs3/core-js/global-this"); +var _globalThis = require("@babel/runtime-corejs3/core-js/global-this.js"); -var _compositeSymbol = require("@babel/runtime-corejs3/core-js/composite-symbol"); +var _compositeSymbol = require("@babel/runtime-corejs3/core-js/composite-symbol.js"); -var _compositeKey = require("@babel/runtime-corejs3/core-js/composite-key"); +var _compositeKey = require("@babel/runtime-corejs3/core-js/composite-key.js"); -var _clearImmediate = require("@babel/runtime-corejs3/core-js/clear-immediate"); +var _clearImmediate = require("@babel/runtime-corejs3/core-js/clear-immediate.js"); -var _WeakSet = require("@babel/runtime-corejs3/core-js/weak-set"); +var _WeakSet = require("@babel/runtime-corejs3/core-js/weak-set.js"); -var _WeakMap = require("@babel/runtime-corejs3/core-js/weak-map"); +var _WeakMap = require("@babel/runtime-corejs3/core-js/weak-map.js"); -var _URLSearchParams = require("@babel/runtime-corejs3/core-js/url-search-params"); +var _URLSearchParams = require("@babel/runtime-corejs3/core-js/url-search-params.js"); -var _URL = require("@babel/runtime-corejs3/core-js/url"); +var _URL = require("@babel/runtime-corejs3/core-js/url.js"); -var _Symbol = require("@babel/runtime-corejs3/core-js/symbol"); +var _Symbol = require("@babel/runtime-corejs3/core-js/symbol.js"); -var _Set = require("@babel/runtime-corejs3/core-js/set"); +var _Set = require("@babel/runtime-corejs3/core-js/set.js"); -var _Promise = require("@babel/runtime-corejs3/core-js/promise"); +var _Promise = require("@babel/runtime-corejs3/core-js/promise.js"); -var _Observable = require("@babel/runtime-corejs3/core-js/observable"); +var _Observable = require("@babel/runtime-corejs3/core-js/observable.js"); -var _Map = require("@babel/runtime-corejs3/core-js/map"); +var _Map = require("@babel/runtime-corejs3/core-js/map.js"); -var _AggregateError = require("@babel/runtime-corejs3/core-js/aggregate-error"); +var _AggregateError = require("@babel/runtime-corejs3/core-js/aggregate-error.js"); _AggregateError; _Map; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js index dc1abb21353d..c5d70a81c941 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js @@ -1,32 +1,32 @@ -var _setTimeout = require("@babel/runtime-corejs3/core-js-stable/set-timeout"); +var _setTimeout = require("@babel/runtime-corejs3/core-js-stable/set-timeout.js"); -var _setInterval = require("@babel/runtime-corejs3/core-js-stable/set-interval"); +var _setInterval = require("@babel/runtime-corejs3/core-js-stable/set-interval.js"); -var _setImmediate = require("@babel/runtime-corejs3/core-js-stable/set-immediate"); +var _setImmediate = require("@babel/runtime-corejs3/core-js-stable/set-immediate.js"); -var _queueMicrotask = require("@babel/runtime-corejs3/core-js-stable/queue-microtask"); +var _queueMicrotask = require("@babel/runtime-corejs3/core-js-stable/queue-microtask.js"); -var _parseInt = require("@babel/runtime-corejs3/core-js-stable/parse-int"); +var _parseInt = require("@babel/runtime-corejs3/core-js-stable/parse-int.js"); -var _parseFloat = require("@babel/runtime-corejs3/core-js-stable/parse-float"); +var _parseFloat = require("@babel/runtime-corejs3/core-js-stable/parse-float.js"); -var _clearImmediate = require("@babel/runtime-corejs3/core-js-stable/clear-immediate"); +var _clearImmediate = require("@babel/runtime-corejs3/core-js-stable/clear-immediate.js"); -var _WeakSet = require("@babel/runtime-corejs3/core-js-stable/weak-set"); +var _WeakSet = require("@babel/runtime-corejs3/core-js-stable/weak-set.js"); -var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map"); +var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map.js"); -var _URLSearchParams = require("@babel/runtime-corejs3/core-js-stable/url-search-params"); +var _URLSearchParams = require("@babel/runtime-corejs3/core-js-stable/url-search-params.js"); -var _URL = require("@babel/runtime-corejs3/core-js-stable/url"); +var _URL = require("@babel/runtime-corejs3/core-js-stable/url.js"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); -var _Set = require("@babel/runtime-corejs3/core-js-stable/set"); +var _Set = require("@babel/runtime-corejs3/core-js-stable/set.js"); -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); -var _Map = require("@babel/runtime-corejs3/core-js-stable/map"); +var _Map = require("@babel/runtime-corejs3/core-js-stable/map.js"); AggregateError; _Map; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js index 3b89460c5163..348f038fbccc 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js @@ -1,84 +1,84 @@ -var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/values"); +var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/values.js"); -var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-start"); +var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-start.js"); -var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-right"); +var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-right.js"); -var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-left"); +var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-left.js"); -var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-end"); +var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-end.js"); -var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim"); +var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim.js"); -var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/starts-with"); +var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/starts-with.js"); -var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/splice"); +var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/splice.js"); -var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/sort"); +var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/sort.js"); -var _someInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/some"); +var _someInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/some.js"); -var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/slice"); +var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/slice.js"); -var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reverse"); +var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reverse.js"); -var _replaceAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/replace-all"); +var _replaceAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/replace-all.js"); -var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/repeat"); +var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/repeat.js"); -var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce-right"); +var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce-right.js"); -var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce"); +var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce.js"); -var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-start"); +var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-start.js"); -var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-end"); +var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-end.js"); -var _matchAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/match-all"); +var _matchAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/match-all.js"); -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map.js"); -var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/last-index-of"); +var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/last-index-of.js"); -var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/keys"); +var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/keys.js"); -var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/index-of"); +var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/index-of.js"); -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/includes"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/includes.js"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/for-each"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/for-each.js"); -var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat"); +var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat.js"); -var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat-map"); +var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat-map.js"); -var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flags"); +var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flags.js"); -var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find-index"); +var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find-index.js"); -var _findInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find"); +var _findInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find.js"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter.js"); -var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/fill"); +var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/fill.js"); -var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/every"); +var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/every.js"); -var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/entries"); +var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/entries.js"); -var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/ends-with"); +var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/ends-with.js"); -var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/copy-within"); +var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/copy-within.js"); -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/concat"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/concat.js"); -var _codePointsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-points"); +var _codePointsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-points.js"); -var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-point-at"); +var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-point-at.js"); -var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/bind"); +var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/bind.js"); -var _atInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/at"); +var _atInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/at.js"); _atInstanceProperty(object); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js index 8afcf571496b..092fa1a2da35 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js @@ -1,76 +1,76 @@ -var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/values"); +var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/values.js"); -var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-start"); +var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-start.js"); -var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-right"); +var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-right.js"); -var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-left"); +var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-left.js"); -var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-end"); +var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-end.js"); -var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim"); +var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim.js"); -var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"); +var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/starts-with.js"); -var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/splice"); +var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/splice.js"); -var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort"); +var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort.js"); -var _someInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/some"); +var _someInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/some.js"); -var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice"); +var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice.js"); -var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse"); +var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse.js"); -var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/repeat"); +var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/repeat.js"); -var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce-right"); +var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce-right.js"); -var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce"); +var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce.js"); -var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-start"); +var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-start.js"); -var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-end"); +var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-end.js"); -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map.js"); -var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/last-index-of"); +var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/last-index-of.js"); -var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/keys"); +var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/keys.js"); -var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/index-of"); +var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/index-of.js"); -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); -var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat"); +var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat.js"); -var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map"); +var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map.js"); -var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flags"); +var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flags.js"); -var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find-index"); +var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find-index.js"); -var _findInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find"); +var _findInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find.js"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter.js"); -var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/fill"); +var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/fill.js"); -var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/every"); +var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/every.js"); -var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/entries"); +var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/entries.js"); -var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/ends-with"); +var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/ends-with.js"); -var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/copy-within"); +var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/copy-within.js"); -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat.js"); -var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/code-point-at"); +var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/code-point-at.js"); -var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/bind"); +var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/bind.js"); object.at; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js index 179e6e640ee4..bfac78e8d194 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js @@ -1,218 +1,218 @@ -var _Symbol = require("@babel/runtime-corejs3/core-js/symbol"); +var _Symbol = require("@babel/runtime-corejs3/core-js/symbol.js"); -var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js/symbol/unscopables"); +var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js/symbol/unscopables.js"); -var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js/symbol/to-string-tag"); +var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js/symbol/to-string-tag.js"); -var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js/symbol/to-primitive"); +var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js/symbol/to-primitive.js"); -var _Symbol$split = require("@babel/runtime-corejs3/core-js/symbol/split"); +var _Symbol$split = require("@babel/runtime-corejs3/core-js/symbol/split.js"); -var _Symbol$species = require("@babel/runtime-corejs3/core-js/symbol/species"); +var _Symbol$species = require("@babel/runtime-corejs3/core-js/symbol/species.js"); -var _Symbol$search = require("@babel/runtime-corejs3/core-js/symbol/search"); +var _Symbol$search = require("@babel/runtime-corejs3/core-js/symbol/search.js"); -var _Symbol$replace = require("@babel/runtime-corejs3/core-js/symbol/replace"); +var _Symbol$replace = require("@babel/runtime-corejs3/core-js/symbol/replace.js"); -var _Symbol$patternMatch = require("@babel/runtime-corejs3/core-js/symbol/pattern-match"); +var _Symbol$patternMatch = require("@babel/runtime-corejs3/core-js/symbol/pattern-match.js"); -var _Symbol$observable = require("@babel/runtime-corejs3/core-js/symbol/observable"); +var _Symbol$observable = require("@babel/runtime-corejs3/core-js/symbol/observable.js"); -var _Symbol$match = require("@babel/runtime-corejs3/core-js/symbol/match"); +var _Symbol$match = require("@babel/runtime-corejs3/core-js/symbol/match.js"); -var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js/symbol/key-for"); +var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js/symbol/key-for.js"); -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js/symbol/iterator"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js/symbol/iterator.js"); -var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js/symbol/is-concat-spreadable"); +var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js/symbol/is-concat-spreadable.js"); -var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js/symbol/has-instance"); +var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js/symbol/has-instance.js"); -var _Symbol$for = require("@babel/runtime-corejs3/core-js/symbol/for"); +var _Symbol$for = require("@babel/runtime-corejs3/core-js/symbol/for.js"); -var _Symbol$dispose = require("@babel/runtime-corejs3/core-js/symbol/dispose"); +var _Symbol$dispose = require("@babel/runtime-corejs3/core-js/symbol/dispose.js"); -var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js/symbol/async-iterator"); +var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js/symbol/async-iterator.js"); -var _String$raw = require("@babel/runtime-corejs3/core-js/string/raw"); +var _String$raw = require("@babel/runtime-corejs3/core-js/string/raw.js"); -var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js/string/from-code-point"); +var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js/string/from-code-point.js"); -var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/set-prototype-of"); +var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/set-prototype-of.js"); -var _Reflect$set = require("@babel/runtime-corejs3/core-js/reflect/set"); +var _Reflect$set = require("@babel/runtime-corejs3/core-js/reflect/set.js"); -var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js/reflect/prevent-extensions"); +var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js/reflect/prevent-extensions.js"); -var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js/reflect/own-keys"); +var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js/reflect/own-keys.js"); -var _Reflect$metadata = require("@babel/runtime-corejs3/core-js/reflect/metadata"); +var _Reflect$metadata = require("@babel/runtime-corejs3/core-js/reflect/metadata.js"); -var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js/reflect/is-extensible"); +var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js/reflect/is-extensible.js"); -var _Reflect$hasOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-own-metadata"); +var _Reflect$hasOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-own-metadata.js"); -var _Reflect$hasMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-metadata"); +var _Reflect$hasMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-metadata.js"); -var _Reflect$has = require("@babel/runtime-corejs3/core-js/reflect/has"); +var _Reflect$has = require("@babel/runtime-corejs3/core-js/reflect/has.js"); -var _Reflect$get = require("@babel/runtime-corejs3/core-js/reflect/get"); +var _Reflect$get = require("@babel/runtime-corejs3/core-js/reflect/get.js"); -var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/get-prototype-of"); +var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/get-prototype-of.js"); -var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/reflect/get-own-property-descriptor"); +var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/reflect/get-own-property-descriptor.js"); -var _Reflect$getOwnMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata-keys"); +var _Reflect$getOwnMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata-keys.js"); -var _Reflect$getOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata"); +var _Reflect$getOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata.js"); -var _Reflect$getMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-metadata-keys"); +var _Reflect$getMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-metadata-keys.js"); -var _Reflect$getMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-metadata"); +var _Reflect$getMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-metadata.js"); -var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js/reflect/delete-property"); +var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js/reflect/delete-property.js"); -var _Reflect$deleteMetadata = require("@babel/runtime-corejs3/core-js/reflect/delete-metadata"); +var _Reflect$deleteMetadata = require("@babel/runtime-corejs3/core-js/reflect/delete-metadata.js"); -var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js/reflect/define-property"); +var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js/reflect/define-property.js"); -var _Reflect$defineMetadata = require("@babel/runtime-corejs3/core-js/reflect/define-metadata"); +var _Reflect$defineMetadata = require("@babel/runtime-corejs3/core-js/reflect/define-metadata.js"); -var _Reflect$construct = require("@babel/runtime-corejs3/core-js/reflect/construct"); +var _Reflect$construct = require("@babel/runtime-corejs3/core-js/reflect/construct.js"); -var _Reflect$apply = require("@babel/runtime-corejs3/core-js/reflect/apply"); +var _Reflect$apply = require("@babel/runtime-corejs3/core-js/reflect/apply.js"); -var _Object$values = require("@babel/runtime-corejs3/core-js/object/values"); +var _Object$values = require("@babel/runtime-corejs3/core-js/object/values.js"); -var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js/object/set-prototype-of"); +var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js/object/set-prototype-of.js"); -var _Object$seal = require("@babel/runtime-corejs3/core-js/object/seal"); +var _Object$seal = require("@babel/runtime-corejs3/core-js/object/seal.js"); -var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js/object/prevent-extensions"); +var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js/object/prevent-extensions.js"); -var _Object$keys = require("@babel/runtime-corejs3/core-js/object/keys"); +var _Object$keys = require("@babel/runtime-corejs3/core-js/object/keys.js"); -var _Object$is = require("@babel/runtime-corejs3/core-js/object/is"); +var _Object$is = require("@babel/runtime-corejs3/core-js/object/is.js"); -var _Object$isSealed = require("@babel/runtime-corejs3/core-js/object/is-sealed"); +var _Object$isSealed = require("@babel/runtime-corejs3/core-js/object/is-sealed.js"); -var _Object$isFrozen = require("@babel/runtime-corejs3/core-js/object/is-frozen"); +var _Object$isFrozen = require("@babel/runtime-corejs3/core-js/object/is-frozen.js"); -var _Object$isExtensible = require("@babel/runtime-corejs3/core-js/object/is-extensible"); +var _Object$isExtensible = require("@babel/runtime-corejs3/core-js/object/is-extensible.js"); -var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js/object/get-prototype-of"); +var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js/object/get-prototype-of.js"); -var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols"); +var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js"); -var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js/object/get-own-property-names"); +var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js/object/get-own-property-names.js"); -var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptors"); +var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptors.js"); -var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"); +var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor.js"); -var _Object$fromEntries = require("@babel/runtime-corejs3/core-js/object/from-entries"); +var _Object$fromEntries = require("@babel/runtime-corejs3/core-js/object/from-entries.js"); -var _Object$freeze = require("@babel/runtime-corejs3/core-js/object/freeze"); +var _Object$freeze = require("@babel/runtime-corejs3/core-js/object/freeze.js"); -var _Object$entries = require("@babel/runtime-corejs3/core-js/object/entries"); +var _Object$entries = require("@babel/runtime-corejs3/core-js/object/entries.js"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property.js"); -var _Object$defineProperties = require("@babel/runtime-corejs3/core-js/object/define-properties"); +var _Object$defineProperties = require("@babel/runtime-corejs3/core-js/object/define-properties.js"); -var _Object$create = require("@babel/runtime-corejs3/core-js/object/create"); +var _Object$create = require("@babel/runtime-corejs3/core-js/object/create.js"); -var _Object$assign = require("@babel/runtime-corejs3/core-js/object/assign"); +var _Object$assign = require("@babel/runtime-corejs3/core-js/object/assign.js"); -var _Number$parseInt = require("@babel/runtime-corejs3/core-js/number/parse-int"); +var _Number$parseInt = require("@babel/runtime-corejs3/core-js/number/parse-int.js"); -var _Number$parseFloat = require("@babel/runtime-corejs3/core-js/number/parse-float"); +var _Number$parseFloat = require("@babel/runtime-corejs3/core-js/number/parse-float.js"); -var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js/number/is-safe-integer"); +var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js/number/is-safe-integer.js"); -var _Number$isNaN = require("@babel/runtime-corejs3/core-js/number/is-nan"); +var _Number$isNaN = require("@babel/runtime-corejs3/core-js/number/is-nan.js"); -var _Number$isInteger = require("@babel/runtime-corejs3/core-js/number/is-integer"); +var _Number$isInteger = require("@babel/runtime-corejs3/core-js/number/is-integer.js"); -var _Number$isFinite = require("@babel/runtime-corejs3/core-js/number/is-finite"); +var _Number$isFinite = require("@babel/runtime-corejs3/core-js/number/is-finite.js"); -var _Number$fromString = require("@babel/runtime-corejs3/core-js/number/from-string"); +var _Number$fromString = require("@babel/runtime-corejs3/core-js/number/from-string.js"); -var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/min-safe-integer"); +var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/min-safe-integer.js"); -var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/max-safe-integer"); +var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/max-safe-integer.js"); -var _Number$EPSILON = require("@babel/runtime-corejs3/core-js/number/epsilon"); +var _Number$EPSILON = require("@babel/runtime-corejs3/core-js/number/epsilon.js"); -var _Math$umulh = require("@babel/runtime-corejs3/core-js/math/umulh"); +var _Math$umulh = require("@babel/runtime-corejs3/core-js/math/umulh.js"); -var _Math$trunc = require("@babel/runtime-corejs3/core-js/math/trunc"); +var _Math$trunc = require("@babel/runtime-corejs3/core-js/math/trunc.js"); -var _Math$tanh = require("@babel/runtime-corejs3/core-js/math/tanh"); +var _Math$tanh = require("@babel/runtime-corejs3/core-js/math/tanh.js"); -var _Math$sinh = require("@babel/runtime-corejs3/core-js/math/sinh"); +var _Math$sinh = require("@babel/runtime-corejs3/core-js/math/sinh.js"); -var _Math$signbit = require("@babel/runtime-corejs3/core-js/math/signbit"); +var _Math$signbit = require("@babel/runtime-corejs3/core-js/math/signbit.js"); -var _Math$sign = require("@babel/runtime-corejs3/core-js/math/sign"); +var _Math$sign = require("@babel/runtime-corejs3/core-js/math/sign.js"); -var _Math$seededPRNG = require("@babel/runtime-corejs3/core-js/math/seeded-prng"); +var _Math$seededPRNG = require("@babel/runtime-corejs3/core-js/math/seeded-prng.js"); -var _Math$scale = require("@babel/runtime-corejs3/core-js/math/scale"); +var _Math$scale = require("@babel/runtime-corejs3/core-js/math/scale.js"); -var _Math$radians = require("@babel/runtime-corejs3/core-js/math/radians"); +var _Math$radians = require("@babel/runtime-corejs3/core-js/math/radians.js"); -var _Math$log2 = require("@babel/runtime-corejs3/core-js/math/log2"); +var _Math$log2 = require("@babel/runtime-corejs3/core-js/math/log2.js"); -var _Math$log1p = require("@babel/runtime-corejs3/core-js/math/log1p"); +var _Math$log1p = require("@babel/runtime-corejs3/core-js/math/log1p.js"); -var _Math$log = require("@babel/runtime-corejs3/core-js/math/log10"); +var _Math$log = require("@babel/runtime-corejs3/core-js/math/log10.js"); -var _Math$isubh = require("@babel/runtime-corejs3/core-js/math/isubh"); +var _Math$isubh = require("@babel/runtime-corejs3/core-js/math/isubh.js"); -var _Math$imulh = require("@babel/runtime-corejs3/core-js/math/imulh"); +var _Math$imulh = require("@babel/runtime-corejs3/core-js/math/imulh.js"); -var _Math$imul = require("@babel/runtime-corejs3/core-js/math/imul"); +var _Math$imul = require("@babel/runtime-corejs3/core-js/math/imul.js"); -var _Math$iaddh = require("@babel/runtime-corejs3/core-js/math/iaddh"); +var _Math$iaddh = require("@babel/runtime-corejs3/core-js/math/iaddh.js"); -var _Math$hypot = require("@babel/runtime-corejs3/core-js/math/hypot"); +var _Math$hypot = require("@babel/runtime-corejs3/core-js/math/hypot.js"); -var _Math$fscale = require("@babel/runtime-corejs3/core-js/math/fscale"); +var _Math$fscale = require("@babel/runtime-corejs3/core-js/math/fscale.js"); -var _Math$fround = require("@babel/runtime-corejs3/core-js/math/fround"); +var _Math$fround = require("@babel/runtime-corejs3/core-js/math/fround.js"); -var _Math$expm = require("@babel/runtime-corejs3/core-js/math/expm1"); +var _Math$expm = require("@babel/runtime-corejs3/core-js/math/expm1.js"); -var _Math$degrees = require("@babel/runtime-corejs3/core-js/math/degrees"); +var _Math$degrees = require("@babel/runtime-corejs3/core-js/math/degrees.js"); -var _Math$cosh = require("@babel/runtime-corejs3/core-js/math/cosh"); +var _Math$cosh = require("@babel/runtime-corejs3/core-js/math/cosh.js"); -var _Math$clz = require("@babel/runtime-corejs3/core-js/math/clz32"); +var _Math$clz = require("@babel/runtime-corejs3/core-js/math/clz32.js"); -var _Math$clamp = require("@babel/runtime-corejs3/core-js/math/clamp"); +var _Math$clamp = require("@babel/runtime-corejs3/core-js/math/clamp.js"); -var _Math$cbrt = require("@babel/runtime-corejs3/core-js/math/cbrt"); +var _Math$cbrt = require("@babel/runtime-corejs3/core-js/math/cbrt.js"); -var _Math$atanh = require("@babel/runtime-corejs3/core-js/math/atanh"); +var _Math$atanh = require("@babel/runtime-corejs3/core-js/math/atanh.js"); -var _Math$asinh = require("@babel/runtime-corejs3/core-js/math/asinh"); +var _Math$asinh = require("@babel/runtime-corejs3/core-js/math/asinh.js"); -var _Math$acosh = require("@babel/runtime-corejs3/core-js/math/acosh"); +var _Math$acosh = require("@babel/runtime-corejs3/core-js/math/acosh.js"); -var _Math$RAD_PER_DEG = require("@babel/runtime-corejs3/core-js/math/rad-per-deg"); +var _Math$RAD_PER_DEG = require("@babel/runtime-corejs3/core-js/math/rad-per-deg.js"); -var _Math$DEG_PER_RAD = require("@babel/runtime-corejs3/core-js/math/deg-per-rad"); +var _Math$DEG_PER_RAD = require("@babel/runtime-corejs3/core-js/math/deg-per-rad.js"); -var _JSON$stringify = require("@babel/runtime-corejs3/core-js/json/stringify"); +var _JSON$stringify = require("@babel/runtime-corejs3/core-js/json/stringify.js"); -var _Date$now = require("@babel/runtime-corejs3/core-js/date/now"); +var _Date$now = require("@babel/runtime-corejs3/core-js/date/now.js"); -var _Array$of = require("@babel/runtime-corejs3/core-js/array/of"); +var _Array$of = require("@babel/runtime-corejs3/core-js/array/of.js"); -var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array.js"); -var _Array$from = require("@babel/runtime-corejs3/core-js/array/from"); +var _Array$from = require("@babel/runtime-corejs3/core-js/array/from.js"); _Array$from; _Array$isArray; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js index 28156f8a6e85..2f31d6ada5fa 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js @@ -1,166 +1,166 @@ -var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js-stable/symbol/unscopables"); +var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js-stable/symbol/unscopables.js"); -var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js-stable/symbol/to-string-tag"); +var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js-stable/symbol/to-string-tag.js"); -var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js-stable/symbol/to-primitive"); +var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js-stable/symbol/to-primitive.js"); -var _Symbol$split = require("@babel/runtime-corejs3/core-js-stable/symbol/split"); +var _Symbol$split = require("@babel/runtime-corejs3/core-js-stable/symbol/split.js"); -var _Symbol$species = require("@babel/runtime-corejs3/core-js-stable/symbol/species"); +var _Symbol$species = require("@babel/runtime-corejs3/core-js-stable/symbol/species.js"); -var _Symbol$search = require("@babel/runtime-corejs3/core-js-stable/symbol/search"); +var _Symbol$search = require("@babel/runtime-corejs3/core-js-stable/symbol/search.js"); -var _Symbol$replace = require("@babel/runtime-corejs3/core-js-stable/symbol/replace"); +var _Symbol$replace = require("@babel/runtime-corejs3/core-js-stable/symbol/replace.js"); -var _Symbol$match = require("@babel/runtime-corejs3/core-js-stable/symbol/match"); +var _Symbol$match = require("@babel/runtime-corejs3/core-js-stable/symbol/match.js"); -var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js-stable/symbol/key-for"); +var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js-stable/symbol/key-for.js"); -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator.js"); -var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js-stable/symbol/is-concat-spreadable"); +var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js-stable/symbol/is-concat-spreadable.js"); -var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js-stable/symbol/has-instance"); +var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js-stable/symbol/has-instance.js"); -var _Symbol$for = require("@babel/runtime-corejs3/core-js-stable/symbol/for"); +var _Symbol$for = require("@babel/runtime-corejs3/core-js-stable/symbol/for.js"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); -var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js-stable/symbol/async-iterator"); +var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js-stable/symbol/async-iterator.js"); -var _String$raw = require("@babel/runtime-corejs3/core-js-stable/string/raw"); +var _String$raw = require("@babel/runtime-corejs3/core-js-stable/string/raw.js"); -var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js-stable/string/from-code-point"); +var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js-stable/string/from-code-point.js"); -var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/set-prototype-of"); +var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/set-prototype-of.js"); -var _Reflect$set = require("@babel/runtime-corejs3/core-js-stable/reflect/set"); +var _Reflect$set = require("@babel/runtime-corejs3/core-js-stable/reflect/set.js"); -var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/reflect/prevent-extensions"); +var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/reflect/prevent-extensions.js"); -var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js-stable/reflect/own-keys"); +var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js-stable/reflect/own-keys.js"); -var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js-stable/reflect/is-extensible"); +var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js-stable/reflect/is-extensible.js"); -var _Reflect$has = require("@babel/runtime-corejs3/core-js-stable/reflect/has"); +var _Reflect$has = require("@babel/runtime-corejs3/core-js-stable/reflect/has.js"); -var _Reflect$get = require("@babel/runtime-corejs3/core-js-stable/reflect/get"); +var _Reflect$get = require("@babel/runtime-corejs3/core-js-stable/reflect/get.js"); -var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/get-prototype-of"); +var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/get-prototype-of.js"); -var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/reflect/get-own-property-descriptor"); +var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/reflect/get-own-property-descriptor.js"); -var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/delete-property"); +var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/delete-property.js"); -var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/define-property"); +var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/define-property.js"); -var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct"); +var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct.js"); -var _Reflect$apply = require("@babel/runtime-corejs3/core-js-stable/reflect/apply"); +var _Reflect$apply = require("@babel/runtime-corejs3/core-js-stable/reflect/apply.js"); -var _Object$values = require("@babel/runtime-corejs3/core-js-stable/object/values"); +var _Object$values = require("@babel/runtime-corejs3/core-js-stable/object/values.js"); -var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of"); +var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of.js"); -var _Object$seal = require("@babel/runtime-corejs3/core-js-stable/object/seal"); +var _Object$seal = require("@babel/runtime-corejs3/core-js-stable/object/seal.js"); -var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/object/prevent-extensions"); +var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/object/prevent-extensions.js"); -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); -var _Object$is = require("@babel/runtime-corejs3/core-js-stable/object/is"); +var _Object$is = require("@babel/runtime-corejs3/core-js-stable/object/is.js"); -var _Object$isSealed = require("@babel/runtime-corejs3/core-js-stable/object/is-sealed"); +var _Object$isSealed = require("@babel/runtime-corejs3/core-js-stable/object/is-sealed.js"); -var _Object$isFrozen = require("@babel/runtime-corejs3/core-js-stable/object/is-frozen"); +var _Object$isFrozen = require("@babel/runtime-corejs3/core-js-stable/object/is-frozen.js"); -var _Object$isExtensible = require("@babel/runtime-corejs3/core-js-stable/object/is-extensible"); +var _Object$isExtensible = require("@babel/runtime-corejs3/core-js-stable/object/is-extensible.js"); -var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of"); +var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of.js"); -var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"); +var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js"); -var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-names"); +var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js"); -var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors"); +var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js"); -var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor"); +var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js"); -var _Object$fromEntries = require("@babel/runtime-corejs3/core-js-stable/object/from-entries"); +var _Object$fromEntries = require("@babel/runtime-corejs3/core-js-stable/object/from-entries.js"); -var _Object$freeze = require("@babel/runtime-corejs3/core-js-stable/object/freeze"); +var _Object$freeze = require("@babel/runtime-corejs3/core-js-stable/object/freeze.js"); -var _Object$entries = require("@babel/runtime-corejs3/core-js-stable/object/entries"); +var _Object$entries = require("@babel/runtime-corejs3/core-js-stable/object/entries.js"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property.js"); -var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties"); +var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties.js"); -var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create"); +var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create.js"); -var _Object$assign = require("@babel/runtime-corejs3/core-js-stable/object/assign"); +var _Object$assign = require("@babel/runtime-corejs3/core-js-stable/object/assign.js"); -var _Number$parseInt = require("@babel/runtime-corejs3/core-js-stable/number/parse-int"); +var _Number$parseInt = require("@babel/runtime-corejs3/core-js-stable/number/parse-int.js"); -var _Number$parseFloat = require("@babel/runtime-corejs3/core-js-stable/number/parse-float"); +var _Number$parseFloat = require("@babel/runtime-corejs3/core-js-stable/number/parse-float.js"); -var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-safe-integer"); +var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-safe-integer.js"); -var _Number$isNaN = require("@babel/runtime-corejs3/core-js-stable/number/is-nan"); +var _Number$isNaN = require("@babel/runtime-corejs3/core-js-stable/number/is-nan.js"); -var _Number$isInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-integer"); +var _Number$isInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-integer.js"); -var _Number$isFinite = require("@babel/runtime-corejs3/core-js-stable/number/is-finite"); +var _Number$isFinite = require("@babel/runtime-corejs3/core-js-stable/number/is-finite.js"); -var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/min-safe-integer"); +var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/min-safe-integer.js"); -var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/max-safe-integer"); +var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/max-safe-integer.js"); -var _Number$EPSILON = require("@babel/runtime-corejs3/core-js-stable/number/epsilon"); +var _Number$EPSILON = require("@babel/runtime-corejs3/core-js-stable/number/epsilon.js"); -var _Math$trunc = require("@babel/runtime-corejs3/core-js-stable/math/trunc"); +var _Math$trunc = require("@babel/runtime-corejs3/core-js-stable/math/trunc.js"); -var _Math$tanh = require("@babel/runtime-corejs3/core-js-stable/math/tanh"); +var _Math$tanh = require("@babel/runtime-corejs3/core-js-stable/math/tanh.js"); -var _Math$sinh = require("@babel/runtime-corejs3/core-js-stable/math/sinh"); +var _Math$sinh = require("@babel/runtime-corejs3/core-js-stable/math/sinh.js"); -var _Math$sign = require("@babel/runtime-corejs3/core-js-stable/math/sign"); +var _Math$sign = require("@babel/runtime-corejs3/core-js-stable/math/sign.js"); -var _Math$log2 = require("@babel/runtime-corejs3/core-js-stable/math/log2"); +var _Math$log2 = require("@babel/runtime-corejs3/core-js-stable/math/log2.js"); -var _Math$log1p = require("@babel/runtime-corejs3/core-js-stable/math/log1p"); +var _Math$log1p = require("@babel/runtime-corejs3/core-js-stable/math/log1p.js"); -var _Math$log = require("@babel/runtime-corejs3/core-js-stable/math/log10"); +var _Math$log = require("@babel/runtime-corejs3/core-js-stable/math/log10.js"); -var _Math$imul = require("@babel/runtime-corejs3/core-js-stable/math/imul"); +var _Math$imul = require("@babel/runtime-corejs3/core-js-stable/math/imul.js"); -var _Math$hypot = require("@babel/runtime-corejs3/core-js-stable/math/hypot"); +var _Math$hypot = require("@babel/runtime-corejs3/core-js-stable/math/hypot.js"); -var _Math$fround = require("@babel/runtime-corejs3/core-js-stable/math/fround"); +var _Math$fround = require("@babel/runtime-corejs3/core-js-stable/math/fround.js"); -var _Math$expm = require("@babel/runtime-corejs3/core-js-stable/math/expm1"); +var _Math$expm = require("@babel/runtime-corejs3/core-js-stable/math/expm1.js"); -var _Math$cosh = require("@babel/runtime-corejs3/core-js-stable/math/cosh"); +var _Math$cosh = require("@babel/runtime-corejs3/core-js-stable/math/cosh.js"); -var _Math$clz = require("@babel/runtime-corejs3/core-js-stable/math/clz32"); +var _Math$clz = require("@babel/runtime-corejs3/core-js-stable/math/clz32.js"); -var _Math$cbrt = require("@babel/runtime-corejs3/core-js-stable/math/cbrt"); +var _Math$cbrt = require("@babel/runtime-corejs3/core-js-stable/math/cbrt.js"); -var _Math$atanh = require("@babel/runtime-corejs3/core-js-stable/math/atanh"); +var _Math$atanh = require("@babel/runtime-corejs3/core-js-stable/math/atanh.js"); -var _Math$asinh = require("@babel/runtime-corejs3/core-js-stable/math/asinh"); +var _Math$asinh = require("@babel/runtime-corejs3/core-js-stable/math/asinh.js"); -var _Math$acosh = require("@babel/runtime-corejs3/core-js-stable/math/acosh"); +var _Math$acosh = require("@babel/runtime-corejs3/core-js-stable/math/acosh.js"); -var _JSON$stringify = require("@babel/runtime-corejs3/core-js-stable/json/stringify"); +var _JSON$stringify = require("@babel/runtime-corejs3/core-js-stable/json/stringify.js"); -var _Date$now = require("@babel/runtime-corejs3/core-js-stable/date/now"); +var _Date$now = require("@babel/runtime-corejs3/core-js-stable/date/now.js"); -var _Array$of = require("@babel/runtime-corejs3/core-js-stable/array/of"); +var _Array$of = require("@babel/runtime-corejs3/core-js-stable/array/of.js"); -var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array.js"); -var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from"); +var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from.js"); _Array$from; _Array$isArray; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js index 5e5d7dce0288..567f36f03796 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js @@ -1,3 +1,3 @@ -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); _Promise.resolve; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js index 093be2446f56..167296ebdf13 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime-corejs3/helpers/classCallCheck"); +var _classCallCheck = require("@babel/runtime-corejs3/helpers/classCallCheck.js"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js index 2bb4ba66cbc7..76d9855865d4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js @@ -1,4 +1,4 @@ -var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator"); +var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator.js"); var _iteratorNormalCompletion = true; var _didIteratorError = false; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js index 1f2bc8c78155..fb790934e640 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js @@ -1,6 +1,6 @@ -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map.js"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter.js"); var _map = "map"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js index 83dde082836f..c798604064bb 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js @@ -1,6 +1,6 @@ -var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array.js"); -var _Array$from = require("@babel/runtime-corejs3/core-js/array/from"); +var _Array$from = require("@babel/runtime-corejs3/core-js/array/from.js"); var _isArray = "isArray"; _Array$from; // polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs index e0183d2e2afd..7226920eee13 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs @@ -1,5 +1,5 @@ -import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator"; -import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol"; +import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator/index.js"; +import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol.js"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js index 36aa68a81998..935ca1892790 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js @@ -1,4 +1,4 @@ -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); var _context, _context2, _context3; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js index 983b263388cf..5ed82b3fc734 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js @@ -1,3 +1,3 @@ -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter.js"); _filterInstanceProperty(bar).call(bar); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js index ae165e25b1e7..b7d78ef5edb1 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js @@ -1,4 +1,4 @@ -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); _includesInstanceProperty(foo); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js index fe473d9f3f88..2d9298e4b7c7 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js @@ -1,4 +1,4 @@ -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat.js"); var _context; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js index cef08c661a7f..1d71f49dc87c 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck.js")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass.js")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js index 2a1a8fe7aa92..7b6c4da4e724 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js @@ -1,12 +1,12 @@ "use strict"; -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); var _context; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); exports.__esModule = true; var _exportNames = { diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js index 75793607c414..f429ca11c01d 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js @@ -1,14 +1,14 @@ "use strict"; -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); var _context; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property.js"); _Object$defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js index 217ed8f6dc06..f72539f5a90e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime-corejs3/regenerator"); +var _regeneratorRuntime = require("@babel/runtime-corejs3/regenerator/index.js"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js index 4b9498983c1a..b1a441f0c8d0 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js @@ -1,3 +1,3 @@ -var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method"); +var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method.js"); const method = _getIteratorMethod(array); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js index 2627981407a6..7adf28a42d63 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js @@ -1,3 +1,3 @@ -var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator"); +var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator.js"); const iterator = _getIterator(array); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js index 42b70766acdd..97f966ea805b 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js @@ -1,3 +1,3 @@ -var _isIterable = require("@babel/runtime-corejs3/core-js/is-iterable"); +var _isIterable = require("@babel/runtime-corejs3/core-js/is-iterable.js"); _isIterable(Object(arr)); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js index 936e4485756e..57fe73d33e98 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js @@ -1,3 +1,3 @@ -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator.js"); _Symbol$iterator; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js index 60d3e2fb724e..3c996824be2a 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs index 2576947e3dd3..5d7578d1dde9 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs @@ -1,4 +1,4 @@ -import _regeneratorRuntime from "@babel/runtime/regenerator"; +import _regeneratorRuntime from "@babel/runtime/regenerator/index.js"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js index 7a95ad78e496..900ad7f56f43 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck.js")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass.js")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js index 260de19e94a1..eaa575fa1a59 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js @@ -1,6 +1,6 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js index 5bd92072ae8f..4a7d49a65697 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime/regenerator"); +var _regeneratorRuntime = require("@babel/runtime/regenerator/index.js"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs index 828c9aa787ef..be6fe5291855 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime-corejs2/helpers/esm/classCallCheck"; -import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn"; -import _getPrototypeOf from "@babel/runtime-corejs2/helpers/esm/getPrototypeOf"; -import _inherits from "@babel/runtime-corejs2/helpers/esm/inherits"; +import _classCallCheck from "@babel/runtime-corejs2/helpers/esm/classCallCheck.js"; +import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn.js"; +import _getPrototypeOf from "@babel/runtime-corejs2/helpers/esm/getPrototypeOf.js"; +import _inherits from "@babel/runtime-corejs2/helpers/esm/inherits.js"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs index 44f4d72a0409..91f313b2c4ca 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck"; -import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/possibleConstructorReturn"; -import _getPrototypeOf from "@babel/runtime-corejs2/helpers/getPrototypeOf"; -import _inherits from "@babel/runtime-corejs2/helpers/inherits"; +import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck.js"; +import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/possibleConstructorReturn.js"; +import _getPrototypeOf from "@babel/runtime-corejs2/helpers/getPrototypeOf.js"; +import _inherits from "@babel/runtime-corejs2/helpers/inherits.js"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js index 39882dcd466a..312b5bda92c2 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js @@ -1,10 +1,10 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); -var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn"); +var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn.js"); -var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf"); +var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf.js"); -var _inherits = require("@babel/runtime/helpers/inherits"); +var _inherits = require("@babel/runtime/helpers/inherits.js"); let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js index 39882dcd466a..312b5bda92c2 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js @@ -1,10 +1,10 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); -var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn"); +var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn.js"); -var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf"); +var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf.js"); -var _inherits = require("@babel/runtime/helpers/inherits"); +var _inherits = require("@babel/runtime/helpers/inherits.js"); let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs index 0247fa0b5556..69e96b7bc40e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; -import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import _inherits from "@babel/runtime/helpers/esm/inherits"; +import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck.js"; +import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn.js"; +import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf.js"; +import _inherits from "@babel/runtime/helpers/esm/inherits.js"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs index 0247fa0b5556..69e96b7bc40e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; -import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; -import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; -import _inherits from "@babel/runtime/helpers/esm/inherits"; +import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck.js"; +import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn.js"; +import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf.js"; +import _inherits from "@babel/runtime/helpers/esm/inherits.js"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index cb35951a8f87..d9b42a42cdd4 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -152,11 +152,11 @@ export function isPolyfillSource(source: ?string): boolean { } const modulePathMap = { - "regenerator-runtime": "regenerator-runtime/runtime", + "regenerator-runtime": "regenerator-runtime/runtime.js", }; export function getModulePath(mod: string): string { - return modulePathMap[mod] || `core-js/modules/${mod}`; + return modulePathMap[mod] || `core-js/modules/${mod}.js`; } export function createImport(path: NodePath, mod: string) { diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs index 50550d4322d8..7018d87d49bc 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs @@ -1,149 +1,149 @@ -import "core-js/modules/es6.array.copy-within"; -import "core-js/modules/es6.array.every"; -import "core-js/modules/es6.array.fill"; -import "core-js/modules/es6.array.filter"; -import "core-js/modules/es6.array.find"; -import "core-js/modules/es6.array.find-index"; -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.for-each"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es7.array.includes"; -import "core-js/modules/es6.array.index-of"; -import "core-js/modules/es6.array.is-array"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.array.last-index-of"; -import "core-js/modules/es6.array.map"; -import "core-js/modules/es6.array.of"; -import "core-js/modules/es6.array.reduce"; -import "core-js/modules/es6.array.reduce-right"; -import "core-js/modules/es6.array.some"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.date.now"; -import "core-js/modules/es6.date.to-iso-string"; -import "core-js/modules/es6.date.to-json"; -import "core-js/modules/es6.date.to-primitive"; -import "core-js/modules/es6.date.to-string"; -import "core-js/modules/es6.function.bind"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.function.name"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.math.acosh"; -import "core-js/modules/es6.math.asinh"; -import "core-js/modules/es6.math.atanh"; -import "core-js/modules/es6.math.cbrt"; -import "core-js/modules/es6.math.clz32"; -import "core-js/modules/es6.math.cosh"; -import "core-js/modules/es6.math.expm1"; -import "core-js/modules/es6.math.fround"; -import "core-js/modules/es6.math.hypot"; -import "core-js/modules/es6.math.imul"; -import "core-js/modules/es6.math.log1p"; -import "core-js/modules/es6.math.log10"; -import "core-js/modules/es6.math.log2"; -import "core-js/modules/es6.math.sign"; -import "core-js/modules/es6.math.sinh"; -import "core-js/modules/es6.math.tanh"; -import "core-js/modules/es6.math.trunc"; -import "core-js/modules/es6.number.constructor"; -import "core-js/modules/es6.number.epsilon"; -import "core-js/modules/es6.number.is-finite"; -import "core-js/modules/es6.number.is-integer"; -import "core-js/modules/es6.number.is-nan"; -import "core-js/modules/es6.number.is-safe-integer"; -import "core-js/modules/es6.number.max-safe-integer"; -import "core-js/modules/es6.number.min-safe-integer"; -import "core-js/modules/es6.number.parse-float"; -import "core-js/modules/es6.number.parse-int"; -import "core-js/modules/es6.object.assign"; -import "core-js/modules/es6.object.create"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es6.object.define-property"; -import "core-js/modules/es6.object.define-properties"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es6.object.freeze"; -import "core-js/modules/es6.object.get-own-property-descriptor"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es6.object.get-own-property-names"; -import "core-js/modules/es6.object.get-prototype-of"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.prevent-extensions"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.object.is"; -import "core-js/modules/es6.object.is-frozen"; -import "core-js/modules/es6.object.is-sealed"; -import "core-js/modules/es6.object.is-extensible"; -import "core-js/modules/es6.object.keys"; -import "core-js/modules/es6.object.seal"; -import "core-js/modules/es6.object.set-prototype-of"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.reflect.apply"; -import "core-js/modules/es6.reflect.construct"; -import "core-js/modules/es6.reflect.define-property"; -import "core-js/modules/es6.reflect.delete-property"; -import "core-js/modules/es6.reflect.get"; -import "core-js/modules/es6.reflect.get-own-property-descriptor"; -import "core-js/modules/es6.reflect.get-prototype-of"; -import "core-js/modules/es6.reflect.has"; -import "core-js/modules/es6.reflect.is-extensible"; -import "core-js/modules/es6.reflect.own-keys"; -import "core-js/modules/es6.reflect.prevent-extensions"; -import "core-js/modules/es6.reflect.set"; -import "core-js/modules/es6.reflect.set-prototype-of"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.flags"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.string.anchor"; -import "core-js/modules/es6.string.big"; -import "core-js/modules/es6.string.blink"; -import "core-js/modules/es6.string.bold"; -import "core-js/modules/es6.string.code-point-at"; -import "core-js/modules/es6.string.ends-with"; -import "core-js/modules/es6.string.fixed"; -import "core-js/modules/es6.string.fontcolor"; -import "core-js/modules/es6.string.fontsize"; -import "core-js/modules/es6.string.from-code-point"; -import "core-js/modules/es6.string.includes"; -import "core-js/modules/es6.string.italics"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.string.link"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es6.string.raw"; -import "core-js/modules/es6.string.repeat"; -import "core-js/modules/es6.string.small"; -import "core-js/modules/es6.string.starts-with"; -import "core-js/modules/es6.string.strike"; -import "core-js/modules/es6.string.sub"; -import "core-js/modules/es6.string.sup"; -import "core-js/modules/es6.string.trim"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.data-view"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es6.array.copy-within.js"; +import "core-js/modules/es6.array.every.js"; +import "core-js/modules/es6.array.fill.js"; +import "core-js/modules/es6.array.filter.js"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es6.array.find-index.js"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.for-each.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.array.index-of.js"; +import "core-js/modules/es6.array.is-array.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.array.last-index-of.js"; +import "core-js/modules/es6.array.map.js"; +import "core-js/modules/es6.array.of.js"; +import "core-js/modules/es6.array.reduce.js"; +import "core-js/modules/es6.array.reduce-right.js"; +import "core-js/modules/es6.array.some.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.date.now.js"; +import "core-js/modules/es6.date.to-iso-string.js"; +import "core-js/modules/es6.date.to-json.js"; +import "core-js/modules/es6.date.to-primitive.js"; +import "core-js/modules/es6.date.to-string.js"; +import "core-js/modules/es6.function.bind.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.function.name.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.math.acosh.js"; +import "core-js/modules/es6.math.asinh.js"; +import "core-js/modules/es6.math.atanh.js"; +import "core-js/modules/es6.math.cbrt.js"; +import "core-js/modules/es6.math.clz32.js"; +import "core-js/modules/es6.math.cosh.js"; +import "core-js/modules/es6.math.expm1.js"; +import "core-js/modules/es6.math.fround.js"; +import "core-js/modules/es6.math.hypot.js"; +import "core-js/modules/es6.math.imul.js"; +import "core-js/modules/es6.math.log1p.js"; +import "core-js/modules/es6.math.log10.js"; +import "core-js/modules/es6.math.log2.js"; +import "core-js/modules/es6.math.sign.js"; +import "core-js/modules/es6.math.sinh.js"; +import "core-js/modules/es6.math.tanh.js"; +import "core-js/modules/es6.math.trunc.js"; +import "core-js/modules/es6.number.constructor.js"; +import "core-js/modules/es6.number.epsilon.js"; +import "core-js/modules/es6.number.is-finite.js"; +import "core-js/modules/es6.number.is-integer.js"; +import "core-js/modules/es6.number.is-nan.js"; +import "core-js/modules/es6.number.is-safe-integer.js"; +import "core-js/modules/es6.number.max-safe-integer.js"; +import "core-js/modules/es6.number.min-safe-integer.js"; +import "core-js/modules/es6.number.parse-float.js"; +import "core-js/modules/es6.number.parse-int.js"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/es6.object.create.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es6.object.define-property.js"; +import "core-js/modules/es6.object.define-properties.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es6.object.freeze.js"; +import "core-js/modules/es6.object.get-own-property-descriptor.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es6.object.get-own-property-names.js"; +import "core-js/modules/es6.object.get-prototype-of.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.prevent-extensions.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.object.is.js"; +import "core-js/modules/es6.object.is-frozen.js"; +import "core-js/modules/es6.object.is-sealed.js"; +import "core-js/modules/es6.object.is-extensible.js"; +import "core-js/modules/es6.object.keys.js"; +import "core-js/modules/es6.object.seal.js"; +import "core-js/modules/es6.object.set-prototype-of.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.reflect.apply.js"; +import "core-js/modules/es6.reflect.construct.js"; +import "core-js/modules/es6.reflect.define-property.js"; +import "core-js/modules/es6.reflect.delete-property.js"; +import "core-js/modules/es6.reflect.get.js"; +import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es6.reflect.get-prototype-of.js"; +import "core-js/modules/es6.reflect.has.js"; +import "core-js/modules/es6.reflect.is-extensible.js"; +import "core-js/modules/es6.reflect.own-keys.js"; +import "core-js/modules/es6.reflect.prevent-extensions.js"; +import "core-js/modules/es6.reflect.set.js"; +import "core-js/modules/es6.reflect.set-prototype-of.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.flags.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.string.anchor.js"; +import "core-js/modules/es6.string.big.js"; +import "core-js/modules/es6.string.blink.js"; +import "core-js/modules/es6.string.bold.js"; +import "core-js/modules/es6.string.code-point-at.js"; +import "core-js/modules/es6.string.ends-with.js"; +import "core-js/modules/es6.string.fixed.js"; +import "core-js/modules/es6.string.fontcolor.js"; +import "core-js/modules/es6.string.fontsize.js"; +import "core-js/modules/es6.string.from-code-point.js"; +import "core-js/modules/es6.string.includes.js"; +import "core-js/modules/es6.string.italics.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.string.link.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es6.string.raw.js"; +import "core-js/modules/es6.string.repeat.js"; +import "core-js/modules/es6.string.small.js"; +import "core-js/modules/es6.string.starts-with.js"; +import "core-js/modules/es6.string.strike.js"; +import "core-js/modules/es6.string.sub.js"; +import "core-js/modules/es6.string.sup.js"; +import "core-js/modules/es6.string.trim.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.data-view.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs index 7f3479ae14b9..1811cef4ca3c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs @@ -1,61 +1,61 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.object.assign"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.reflect.apply"; -import "core-js/modules/es6.reflect.construct"; -import "core-js/modules/es6.reflect.define-property"; -import "core-js/modules/es6.reflect.delete-property"; -import "core-js/modules/es6.reflect.get"; -import "core-js/modules/es6.reflect.get-own-property-descriptor"; -import "core-js/modules/es6.reflect.get-prototype-of"; -import "core-js/modules/es6.reflect.has"; -import "core-js/modules/es6.reflect.is-extensible"; -import "core-js/modules/es6.reflect.own-keys"; -import "core-js/modules/es6.reflect.prevent-extensions"; -import "core-js/modules/es6.reflect.set"; -import "core-js/modules/es6.reflect.set-prototype-of"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.flags"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.reflect.apply.js"; +import "core-js/modules/es6.reflect.construct.js"; +import "core-js/modules/es6.reflect.define-property.js"; +import "core-js/modules/es6.reflect.delete-property.js"; +import "core-js/modules/es6.reflect.get.js"; +import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es6.reflect.get-prototype-of.js"; +import "core-js/modules/es6.reflect.has.js"; +import "core-js/modules/es6.reflect.is-extensible.js"; +import "core-js/modules/es6.reflect.own-keys.js"; +import "core-js/modules/es6.reflect.prevent-extensions.js"; +import "core-js/modules/es6.reflect.set.js"; +import "core-js/modules/es6.reflect.set-prototype-of.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.flags.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs index d424cb017c55..891074950b84 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs @@ -1,46 +1,46 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.map"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs index ce33befd1127..1529357732f9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs index aaa9444a59bd..c85d4fceeb29 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs index 50912e84ee5f..512ddb139ed5 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs @@ -1,14 +1,14 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs index 0d844da81283..9dfaa7fef810 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs @@ -1,16 +1,16 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs index 0d844da81283..9dfaa7fef810 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs @@ -1,16 +1,16 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs index c71a6a9b4044..b6eddfc04f71 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs @@ -1,21 +1,21 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.function.bind"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.function.bind.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; a ** b; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs index 220ad965edab..863ad413a5a1 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs @@ -1,127 +1,127 @@ -import "core-js/modules/es6.array.copy-within"; -import "core-js/modules/es6.array.fill"; -import "core-js/modules/es6.array.find"; -import "core-js/modules/es6.array.find-index"; -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es7.array.includes"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.array.of"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.date.to-primitive"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.function.name"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.math.acosh"; -import "core-js/modules/es6.math.asinh"; -import "core-js/modules/es6.math.atanh"; -import "core-js/modules/es6.math.cbrt"; -import "core-js/modules/es6.math.clz32"; -import "core-js/modules/es6.math.cosh"; -import "core-js/modules/es6.math.expm1"; -import "core-js/modules/es6.math.fround"; -import "core-js/modules/es6.math.hypot"; -import "core-js/modules/es6.math.imul"; -import "core-js/modules/es6.math.log1p"; -import "core-js/modules/es6.math.log10"; -import "core-js/modules/es6.math.log2"; -import "core-js/modules/es6.math.sign"; -import "core-js/modules/es6.math.sinh"; -import "core-js/modules/es6.math.tanh"; -import "core-js/modules/es6.math.trunc"; -import "core-js/modules/es6.number.constructor"; -import "core-js/modules/es6.number.epsilon"; -import "core-js/modules/es6.number.is-finite"; -import "core-js/modules/es6.number.is-integer"; -import "core-js/modules/es6.number.is-nan"; -import "core-js/modules/es6.number.is-safe-integer"; -import "core-js/modules/es6.number.max-safe-integer"; -import "core-js/modules/es6.number.min-safe-integer"; -import "core-js/modules/es6.number.parse-float"; -import "core-js/modules/es6.number.parse-int"; -import "core-js/modules/es6.object.assign"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es6.object.freeze"; -import "core-js/modules/es6.object.get-own-property-descriptor"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es6.object.get-own-property-names"; -import "core-js/modules/es6.object.get-prototype-of"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.prevent-extensions"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.object.is"; -import "core-js/modules/es6.object.is-frozen"; -import "core-js/modules/es6.object.is-sealed"; -import "core-js/modules/es6.object.is-extensible"; -import "core-js/modules/es6.object.keys"; -import "core-js/modules/es6.object.seal"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.reflect.apply"; -import "core-js/modules/es6.reflect.construct"; -import "core-js/modules/es6.reflect.define-property"; -import "core-js/modules/es6.reflect.delete-property"; -import "core-js/modules/es6.reflect.get"; -import "core-js/modules/es6.reflect.get-own-property-descriptor"; -import "core-js/modules/es6.reflect.get-prototype-of"; -import "core-js/modules/es6.reflect.has"; -import "core-js/modules/es6.reflect.is-extensible"; -import "core-js/modules/es6.reflect.own-keys"; -import "core-js/modules/es6.reflect.prevent-extensions"; -import "core-js/modules/es6.reflect.set"; -import "core-js/modules/es6.reflect.set-prototype-of"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.flags"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.string.anchor"; -import "core-js/modules/es6.string.big"; -import "core-js/modules/es6.string.blink"; -import "core-js/modules/es6.string.bold"; -import "core-js/modules/es6.string.code-point-at"; -import "core-js/modules/es6.string.ends-with"; -import "core-js/modules/es6.string.fixed"; -import "core-js/modules/es6.string.fontcolor"; -import "core-js/modules/es6.string.fontsize"; -import "core-js/modules/es6.string.from-code-point"; -import "core-js/modules/es6.string.includes"; -import "core-js/modules/es6.string.italics"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.string.link"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es6.string.raw"; -import "core-js/modules/es6.string.repeat"; -import "core-js/modules/es6.string.small"; -import "core-js/modules/es6.string.starts-with"; -import "core-js/modules/es6.string.strike"; -import "core-js/modules/es6.string.sub"; -import "core-js/modules/es6.string.sup"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es6.array.copy-within.js"; +import "core-js/modules/es6.array.fill.js"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es6.array.find-index.js"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.array.of.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.date.to-primitive.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.function.name.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.math.acosh.js"; +import "core-js/modules/es6.math.asinh.js"; +import "core-js/modules/es6.math.atanh.js"; +import "core-js/modules/es6.math.cbrt.js"; +import "core-js/modules/es6.math.clz32.js"; +import "core-js/modules/es6.math.cosh.js"; +import "core-js/modules/es6.math.expm1.js"; +import "core-js/modules/es6.math.fround.js"; +import "core-js/modules/es6.math.hypot.js"; +import "core-js/modules/es6.math.imul.js"; +import "core-js/modules/es6.math.log1p.js"; +import "core-js/modules/es6.math.log10.js"; +import "core-js/modules/es6.math.log2.js"; +import "core-js/modules/es6.math.sign.js"; +import "core-js/modules/es6.math.sinh.js"; +import "core-js/modules/es6.math.tanh.js"; +import "core-js/modules/es6.math.trunc.js"; +import "core-js/modules/es6.number.constructor.js"; +import "core-js/modules/es6.number.epsilon.js"; +import "core-js/modules/es6.number.is-finite.js"; +import "core-js/modules/es6.number.is-integer.js"; +import "core-js/modules/es6.number.is-nan.js"; +import "core-js/modules/es6.number.is-safe-integer.js"; +import "core-js/modules/es6.number.max-safe-integer.js"; +import "core-js/modules/es6.number.min-safe-integer.js"; +import "core-js/modules/es6.number.parse-float.js"; +import "core-js/modules/es6.number.parse-int.js"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es6.object.freeze.js"; +import "core-js/modules/es6.object.get-own-property-descriptor.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es6.object.get-own-property-names.js"; +import "core-js/modules/es6.object.get-prototype-of.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.prevent-extensions.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.object.is.js"; +import "core-js/modules/es6.object.is-frozen.js"; +import "core-js/modules/es6.object.is-sealed.js"; +import "core-js/modules/es6.object.is-extensible.js"; +import "core-js/modules/es6.object.keys.js"; +import "core-js/modules/es6.object.seal.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.reflect.apply.js"; +import "core-js/modules/es6.reflect.construct.js"; +import "core-js/modules/es6.reflect.define-property.js"; +import "core-js/modules/es6.reflect.delete-property.js"; +import "core-js/modules/es6.reflect.get.js"; +import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es6.reflect.get-prototype-of.js"; +import "core-js/modules/es6.reflect.has.js"; +import "core-js/modules/es6.reflect.is-extensible.js"; +import "core-js/modules/es6.reflect.own-keys.js"; +import "core-js/modules/es6.reflect.prevent-extensions.js"; +import "core-js/modules/es6.reflect.set.js"; +import "core-js/modules/es6.reflect.set-prototype-of.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.flags.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.string.anchor.js"; +import "core-js/modules/es6.string.big.js"; +import "core-js/modules/es6.string.blink.js"; +import "core-js/modules/es6.string.bold.js"; +import "core-js/modules/es6.string.code-point-at.js"; +import "core-js/modules/es6.string.ends-with.js"; +import "core-js/modules/es6.string.fixed.js"; +import "core-js/modules/es6.string.fontcolor.js"; +import "core-js/modules/es6.string.fontsize.js"; +import "core-js/modules/es6.string.from-code-point.js"; +import "core-js/modules/es6.string.includes.js"; +import "core-js/modules/es6.string.italics.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.string.link.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es6.string.raw.js"; +import "core-js/modules/es6.string.repeat.js"; +import "core-js/modules/es6.string.small.js"; +import "core-js/modules/es6.string.starts-with.js"; +import "core-js/modules/es6.string.strike.js"; +import "core-js/modules/es6.string.sub.js"; +import "core-js/modules/es6.string.sup.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs index 9012ed720c20..e20ac4ded964 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs @@ -1,130 +1,130 @@ -import "core-js/modules/es6.array.copy-within"; -import "core-js/modules/es6.array.fill"; -import "core-js/modules/es6.array.find"; -import "core-js/modules/es6.array.find-index"; -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es7.array.includes"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.array.of"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.date.to-primitive"; -import "core-js/modules/es6.date.to-string"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.function.name"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.math.acosh"; -import "core-js/modules/es6.math.asinh"; -import "core-js/modules/es6.math.atanh"; -import "core-js/modules/es6.math.cbrt"; -import "core-js/modules/es6.math.clz32"; -import "core-js/modules/es6.math.cosh"; -import "core-js/modules/es6.math.expm1"; -import "core-js/modules/es6.math.fround"; -import "core-js/modules/es6.math.hypot"; -import "core-js/modules/es6.math.imul"; -import "core-js/modules/es6.math.log1p"; -import "core-js/modules/es6.math.log10"; -import "core-js/modules/es6.math.log2"; -import "core-js/modules/es6.math.sign"; -import "core-js/modules/es6.math.sinh"; -import "core-js/modules/es6.math.tanh"; -import "core-js/modules/es6.math.trunc"; -import "core-js/modules/es6.number.constructor"; -import "core-js/modules/es6.number.epsilon"; -import "core-js/modules/es6.number.is-finite"; -import "core-js/modules/es6.number.is-integer"; -import "core-js/modules/es6.number.is-nan"; -import "core-js/modules/es6.number.is-safe-integer"; -import "core-js/modules/es6.number.max-safe-integer"; -import "core-js/modules/es6.number.min-safe-integer"; -import "core-js/modules/es6.number.parse-float"; -import "core-js/modules/es6.number.parse-int"; -import "core-js/modules/es6.object.assign"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es6.object.freeze"; -import "core-js/modules/es6.object.get-own-property-descriptor"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es6.object.get-own-property-names"; -import "core-js/modules/es6.object.get-prototype-of"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.prevent-extensions"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.object.is"; -import "core-js/modules/es6.object.is-frozen"; -import "core-js/modules/es6.object.is-sealed"; -import "core-js/modules/es6.object.is-extensible"; -import "core-js/modules/es6.object.keys"; -import "core-js/modules/es6.object.seal"; -import "core-js/modules/es6.object.set-prototype-of"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.reflect.apply"; -import "core-js/modules/es6.reflect.construct"; -import "core-js/modules/es6.reflect.define-property"; -import "core-js/modules/es6.reflect.delete-property"; -import "core-js/modules/es6.reflect.get"; -import "core-js/modules/es6.reflect.get-own-property-descriptor"; -import "core-js/modules/es6.reflect.get-prototype-of"; -import "core-js/modules/es6.reflect.has"; -import "core-js/modules/es6.reflect.is-extensible"; -import "core-js/modules/es6.reflect.own-keys"; -import "core-js/modules/es6.reflect.prevent-extensions"; -import "core-js/modules/es6.reflect.set"; -import "core-js/modules/es6.reflect.set-prototype-of"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.flags"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.string.anchor"; -import "core-js/modules/es6.string.big"; -import "core-js/modules/es6.string.blink"; -import "core-js/modules/es6.string.bold"; -import "core-js/modules/es6.string.code-point-at"; -import "core-js/modules/es6.string.ends-with"; -import "core-js/modules/es6.string.fixed"; -import "core-js/modules/es6.string.fontcolor"; -import "core-js/modules/es6.string.fontsize"; -import "core-js/modules/es6.string.from-code-point"; -import "core-js/modules/es6.string.includes"; -import "core-js/modules/es6.string.italics"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.string.link"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es6.string.raw"; -import "core-js/modules/es6.string.repeat"; -import "core-js/modules/es6.string.small"; -import "core-js/modules/es6.string.starts-with"; -import "core-js/modules/es6.string.strike"; -import "core-js/modules/es6.string.sub"; -import "core-js/modules/es6.string.sup"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.data-view"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es6.array.copy-within.js"; +import "core-js/modules/es6.array.fill.js"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es6.array.find-index.js"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.array.of.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.date.to-primitive.js"; +import "core-js/modules/es6.date.to-string.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.function.name.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.math.acosh.js"; +import "core-js/modules/es6.math.asinh.js"; +import "core-js/modules/es6.math.atanh.js"; +import "core-js/modules/es6.math.cbrt.js"; +import "core-js/modules/es6.math.clz32.js"; +import "core-js/modules/es6.math.cosh.js"; +import "core-js/modules/es6.math.expm1.js"; +import "core-js/modules/es6.math.fround.js"; +import "core-js/modules/es6.math.hypot.js"; +import "core-js/modules/es6.math.imul.js"; +import "core-js/modules/es6.math.log1p.js"; +import "core-js/modules/es6.math.log10.js"; +import "core-js/modules/es6.math.log2.js"; +import "core-js/modules/es6.math.sign.js"; +import "core-js/modules/es6.math.sinh.js"; +import "core-js/modules/es6.math.tanh.js"; +import "core-js/modules/es6.math.trunc.js"; +import "core-js/modules/es6.number.constructor.js"; +import "core-js/modules/es6.number.epsilon.js"; +import "core-js/modules/es6.number.is-finite.js"; +import "core-js/modules/es6.number.is-integer.js"; +import "core-js/modules/es6.number.is-nan.js"; +import "core-js/modules/es6.number.is-safe-integer.js"; +import "core-js/modules/es6.number.max-safe-integer.js"; +import "core-js/modules/es6.number.min-safe-integer.js"; +import "core-js/modules/es6.number.parse-float.js"; +import "core-js/modules/es6.number.parse-int.js"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es6.object.freeze.js"; +import "core-js/modules/es6.object.get-own-property-descriptor.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es6.object.get-own-property-names.js"; +import "core-js/modules/es6.object.get-prototype-of.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.prevent-extensions.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.object.is.js"; +import "core-js/modules/es6.object.is-frozen.js"; +import "core-js/modules/es6.object.is-sealed.js"; +import "core-js/modules/es6.object.is-extensible.js"; +import "core-js/modules/es6.object.keys.js"; +import "core-js/modules/es6.object.seal.js"; +import "core-js/modules/es6.object.set-prototype-of.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.reflect.apply.js"; +import "core-js/modules/es6.reflect.construct.js"; +import "core-js/modules/es6.reflect.define-property.js"; +import "core-js/modules/es6.reflect.delete-property.js"; +import "core-js/modules/es6.reflect.get.js"; +import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es6.reflect.get-prototype-of.js"; +import "core-js/modules/es6.reflect.has.js"; +import "core-js/modules/es6.reflect.is-extensible.js"; +import "core-js/modules/es6.reflect.own-keys.js"; +import "core-js/modules/es6.reflect.prevent-extensions.js"; +import "core-js/modules/es6.reflect.set.js"; +import "core-js/modules/es6.reflect.set-prototype-of.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.flags.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.string.anchor.js"; +import "core-js/modules/es6.string.big.js"; +import "core-js/modules/es6.string.blink.js"; +import "core-js/modules/es6.string.bold.js"; +import "core-js/modules/es6.string.code-point-at.js"; +import "core-js/modules/es6.string.ends-with.js"; +import "core-js/modules/es6.string.fixed.js"; +import "core-js/modules/es6.string.fontcolor.js"; +import "core-js/modules/es6.string.fontsize.js"; +import "core-js/modules/es6.string.from-code-point.js"; +import "core-js/modules/es6.string.includes.js"; +import "core-js/modules/es6.string.italics.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.string.link.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es6.string.raw.js"; +import "core-js/modules/es6.string.repeat.js"; +import "core-js/modules/es6.string.small.js"; +import "core-js/modules/es6.string.starts-with.js"; +import "core-js/modules/es6.string.strike.js"; +import "core-js/modules/es6.string.sub.js"; +import "core-js/modules/es6.string.sup.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.data-view.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs index 68e37cc3ea2e..80e66244c33e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs index 0518d02b9cc2..492a3a5dc474 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs @@ -1 +1 @@ -import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es7.array.flat-map.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs index a9f27a4dced7..aaf24470787d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs index 2afa855ac7eb..c928cc22c4ac 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs @@ -1,14 +1,14 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "regenerator-runtime/runtime.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js b/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js index 70393b8eae04..47a513bd3dca 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js @@ -1,33 +1,33 @@ -require("core-js/modules/es7.array.flat-map"); +require("core-js/modules/es7.array.flat-map.js"); -require("core-js/modules/es6.array.sort"); +require("core-js/modules/es6.array.sort.js"); -require("core-js/modules/es7.object.define-getter"); +require("core-js/modules/es7.object.define-getter.js"); -require("core-js/modules/es7.object.define-setter"); +require("core-js/modules/es7.object.define-setter.js"); -require("core-js/modules/es7.object.lookup-getter"); +require("core-js/modules/es7.object.lookup-getter.js"); -require("core-js/modules/es7.object.lookup-setter"); +require("core-js/modules/es7.object.lookup-setter.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); -require("core-js/modules/es7.promise.finally"); +require("core-js/modules/es7.promise.finally.js"); -require("core-js/modules/es7.symbol.async-iterator"); +require("core-js/modules/es7.symbol.async-iterator.js"); -require("core-js/modules/es7.string.pad-start"); +require("core-js/modules/es7.string.pad-start.js"); -require("core-js/modules/es7.string.pad-end"); +require("core-js/modules/es7.string.pad-end.js"); -require("core-js/modules/es7.string.trim-left"); +require("core-js/modules/es7.string.trim-left.js"); -require("core-js/modules/es7.string.trim-right"); +require("core-js/modules/es7.string.trim-right.js"); -require("core-js/modules/web.timers"); +require("core-js/modules/web.timers.js"); -require("core-js/modules/web.immediate"); +require("core-js/modules/web.immediate.js"); -require("core-js/modules/web.dom.iterable"); +require("core-js/modules/web.dom.iterable.js"); 1 ** 2; 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 54c32b60fc2c..fa7c74df32ac 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 @@ -1,300 +1,300 @@ -require("core-js/modules/es6.array.copy-within"); +require("core-js/modules/es6.array.copy-within.js"); -require("core-js/modules/es6.array.every"); +require("core-js/modules/es6.array.every.js"); -require("core-js/modules/es6.array.fill"); +require("core-js/modules/es6.array.fill.js"); -require("core-js/modules/es6.array.filter"); +require("core-js/modules/es6.array.filter.js"); -require("core-js/modules/es6.array.find"); +require("core-js/modules/es6.array.find.js"); -require("core-js/modules/es6.array.find-index"); +require("core-js/modules/es6.array.find-index.js"); -require("core-js/modules/es7.array.flat-map"); +require("core-js/modules/es7.array.flat-map.js"); -require("core-js/modules/es6.array.for-each"); +require("core-js/modules/es6.array.for-each.js"); -require("core-js/modules/es6.array.from"); +require("core-js/modules/es6.array.from.js"); -require("core-js/modules/es7.array.includes"); +require("core-js/modules/es7.array.includes.js"); -require("core-js/modules/es6.array.index-of"); +require("core-js/modules/es6.array.index-of.js"); -require("core-js/modules/es6.array.is-array"); +require("core-js/modules/es6.array.is-array.js"); -require("core-js/modules/es6.array.iterator"); +require("core-js/modules/es6.array.iterator.js"); -require("core-js/modules/es6.array.last-index-of"); +require("core-js/modules/es6.array.last-index-of.js"); -require("core-js/modules/es6.array.map"); +require("core-js/modules/es6.array.map.js"); -require("core-js/modules/es6.array.of"); +require("core-js/modules/es6.array.of.js"); -require("core-js/modules/es6.array.reduce"); +require("core-js/modules/es6.array.reduce.js"); -require("core-js/modules/es6.array.reduce-right"); +require("core-js/modules/es6.array.reduce-right.js"); -require("core-js/modules/es6.array.some"); +require("core-js/modules/es6.array.some.js"); -require("core-js/modules/es6.array.sort"); +require("core-js/modules/es6.array.sort.js"); -require("core-js/modules/es6.array.species"); +require("core-js/modules/es6.array.species.js"); -require("core-js/modules/es6.date.now"); +require("core-js/modules/es6.date.now.js"); -require("core-js/modules/es6.date.to-iso-string"); +require("core-js/modules/es6.date.to-iso-string.js"); -require("core-js/modules/es6.date.to-json"); +require("core-js/modules/es6.date.to-json.js"); -require("core-js/modules/es6.date.to-primitive"); +require("core-js/modules/es6.date.to-primitive.js"); -require("core-js/modules/es6.date.to-string"); +require("core-js/modules/es6.date.to-string.js"); -require("core-js/modules/es6.function.bind"); +require("core-js/modules/es6.function.bind.js"); -require("core-js/modules/es6.function.has-instance"); +require("core-js/modules/es6.function.has-instance.js"); -require("core-js/modules/es6.function.name"); +require("core-js/modules/es6.function.name.js"); -require("core-js/modules/es6.map"); +require("core-js/modules/es6.map.js"); -require("core-js/modules/es6.math.acosh"); +require("core-js/modules/es6.math.acosh.js"); -require("core-js/modules/es6.math.asinh"); +require("core-js/modules/es6.math.asinh.js"); -require("core-js/modules/es6.math.atanh"); +require("core-js/modules/es6.math.atanh.js"); -require("core-js/modules/es6.math.cbrt"); +require("core-js/modules/es6.math.cbrt.js"); -require("core-js/modules/es6.math.clz32"); +require("core-js/modules/es6.math.clz32.js"); -require("core-js/modules/es6.math.cosh"); +require("core-js/modules/es6.math.cosh.js"); -require("core-js/modules/es6.math.expm1"); +require("core-js/modules/es6.math.expm1.js"); -require("core-js/modules/es6.math.fround"); +require("core-js/modules/es6.math.fround.js"); -require("core-js/modules/es6.math.hypot"); +require("core-js/modules/es6.math.hypot.js"); -require("core-js/modules/es6.math.imul"); +require("core-js/modules/es6.math.imul.js"); -require("core-js/modules/es6.math.log1p"); +require("core-js/modules/es6.math.log1p.js"); -require("core-js/modules/es6.math.log10"); +require("core-js/modules/es6.math.log10.js"); -require("core-js/modules/es6.math.log2"); +require("core-js/modules/es6.math.log2.js"); -require("core-js/modules/es6.math.sign"); +require("core-js/modules/es6.math.sign.js"); -require("core-js/modules/es6.math.sinh"); +require("core-js/modules/es6.math.sinh.js"); -require("core-js/modules/es6.math.tanh"); +require("core-js/modules/es6.math.tanh.js"); -require("core-js/modules/es6.math.trunc"); +require("core-js/modules/es6.math.trunc.js"); -require("core-js/modules/es6.number.constructor"); +require("core-js/modules/es6.number.constructor.js"); -require("core-js/modules/es6.number.epsilon"); +require("core-js/modules/es6.number.epsilon.js"); -require("core-js/modules/es6.number.is-finite"); +require("core-js/modules/es6.number.is-finite.js"); -require("core-js/modules/es6.number.is-integer"); +require("core-js/modules/es6.number.is-integer.js"); -require("core-js/modules/es6.number.is-nan"); +require("core-js/modules/es6.number.is-nan.js"); -require("core-js/modules/es6.number.is-safe-integer"); +require("core-js/modules/es6.number.is-safe-integer.js"); -require("core-js/modules/es6.number.max-safe-integer"); +require("core-js/modules/es6.number.max-safe-integer.js"); -require("core-js/modules/es6.number.min-safe-integer"); +require("core-js/modules/es6.number.min-safe-integer.js"); -require("core-js/modules/es6.number.parse-float"); +require("core-js/modules/es6.number.parse-float.js"); -require("core-js/modules/es6.number.parse-int"); +require("core-js/modules/es6.number.parse-int.js"); -require("core-js/modules/es6.object.assign"); +require("core-js/modules/es6.object.assign.js"); -require("core-js/modules/es6.object.create"); +require("core-js/modules/es6.object.create.js"); -require("core-js/modules/es7.object.define-getter"); +require("core-js/modules/es7.object.define-getter.js"); -require("core-js/modules/es7.object.define-setter"); +require("core-js/modules/es7.object.define-setter.js"); -require("core-js/modules/es6.object.define-property"); +require("core-js/modules/es6.object.define-property.js"); -require("core-js/modules/es6.object.define-properties"); +require("core-js/modules/es6.object.define-properties.js"); -require("core-js/modules/es7.object.entries"); +require("core-js/modules/es7.object.entries.js"); -require("core-js/modules/es6.object.freeze"); +require("core-js/modules/es6.object.freeze.js"); -require("core-js/modules/es6.object.get-own-property-descriptor"); +require("core-js/modules/es6.object.get-own-property-descriptor.js"); -require("core-js/modules/es7.object.get-own-property-descriptors"); +require("core-js/modules/es7.object.get-own-property-descriptors.js"); -require("core-js/modules/es6.object.get-own-property-names"); +require("core-js/modules/es6.object.get-own-property-names.js"); -require("core-js/modules/es6.object.get-prototype-of"); +require("core-js/modules/es6.object.get-prototype-of.js"); -require("core-js/modules/es7.object.lookup-getter"); +require("core-js/modules/es7.object.lookup-getter.js"); -require("core-js/modules/es7.object.lookup-setter"); +require("core-js/modules/es7.object.lookup-setter.js"); -require("core-js/modules/es6.object.prevent-extensions"); +require("core-js/modules/es6.object.prevent-extensions.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); -require("core-js/modules/es6.object.is"); +require("core-js/modules/es6.object.is.js"); -require("core-js/modules/es6.object.is-frozen"); +require("core-js/modules/es6.object.is-frozen.js"); -require("core-js/modules/es6.object.is-sealed"); +require("core-js/modules/es6.object.is-sealed.js"); -require("core-js/modules/es6.object.is-extensible"); +require("core-js/modules/es6.object.is-extensible.js"); -require("core-js/modules/es6.object.keys"); +require("core-js/modules/es6.object.keys.js"); -require("core-js/modules/es6.object.seal"); +require("core-js/modules/es6.object.seal.js"); -require("core-js/modules/es6.object.set-prototype-of"); +require("core-js/modules/es6.object.set-prototype-of.js"); -require("core-js/modules/es7.object.values"); +require("core-js/modules/es7.object.values.js"); -require("core-js/modules/es6.promise"); +require("core-js/modules/es6.promise.js"); -require("core-js/modules/es7.promise.finally"); +require("core-js/modules/es7.promise.finally.js"); -require("core-js/modules/es6.reflect.apply"); +require("core-js/modules/es6.reflect.apply.js"); -require("core-js/modules/es6.reflect.construct"); +require("core-js/modules/es6.reflect.construct.js"); -require("core-js/modules/es6.reflect.define-property"); +require("core-js/modules/es6.reflect.define-property.js"); -require("core-js/modules/es6.reflect.delete-property"); +require("core-js/modules/es6.reflect.delete-property.js"); -require("core-js/modules/es6.reflect.get"); +require("core-js/modules/es6.reflect.get.js"); -require("core-js/modules/es6.reflect.get-own-property-descriptor"); +require("core-js/modules/es6.reflect.get-own-property-descriptor.js"); -require("core-js/modules/es6.reflect.get-prototype-of"); +require("core-js/modules/es6.reflect.get-prototype-of.js"); -require("core-js/modules/es6.reflect.has"); +require("core-js/modules/es6.reflect.has.js"); -require("core-js/modules/es6.reflect.is-extensible"); +require("core-js/modules/es6.reflect.is-extensible.js"); -require("core-js/modules/es6.reflect.own-keys"); +require("core-js/modules/es6.reflect.own-keys.js"); -require("core-js/modules/es6.reflect.prevent-extensions"); +require("core-js/modules/es6.reflect.prevent-extensions.js"); -require("core-js/modules/es6.reflect.set"); +require("core-js/modules/es6.reflect.set.js"); -require("core-js/modules/es6.reflect.set-prototype-of"); +require("core-js/modules/es6.reflect.set-prototype-of.js"); -require("core-js/modules/es6.regexp.constructor"); +require("core-js/modules/es6.regexp.constructor.js"); -require("core-js/modules/es6.regexp.flags"); +require("core-js/modules/es6.regexp.flags.js"); -require("core-js/modules/es6.regexp.match"); +require("core-js/modules/es6.regexp.match.js"); -require("core-js/modules/es6.regexp.replace"); +require("core-js/modules/es6.regexp.replace.js"); -require("core-js/modules/es6.regexp.split"); +require("core-js/modules/es6.regexp.split.js"); -require("core-js/modules/es6.regexp.search"); +require("core-js/modules/es6.regexp.search.js"); -require("core-js/modules/es6.regexp.to-string"); +require("core-js/modules/es6.regexp.to-string.js"); -require("core-js/modules/es6.set"); +require("core-js/modules/es6.set.js"); -require("core-js/modules/es6.symbol"); +require("core-js/modules/es6.symbol.js"); -require("core-js/modules/es7.symbol.async-iterator"); +require("core-js/modules/es7.symbol.async-iterator.js"); -require("core-js/modules/es6.string.anchor"); +require("core-js/modules/es6.string.anchor.js"); -require("core-js/modules/es6.string.big"); +require("core-js/modules/es6.string.big.js"); -require("core-js/modules/es6.string.blink"); +require("core-js/modules/es6.string.blink.js"); -require("core-js/modules/es6.string.bold"); +require("core-js/modules/es6.string.bold.js"); -require("core-js/modules/es6.string.code-point-at"); +require("core-js/modules/es6.string.code-point-at.js"); -require("core-js/modules/es6.string.ends-with"); +require("core-js/modules/es6.string.ends-with.js"); -require("core-js/modules/es6.string.fixed"); +require("core-js/modules/es6.string.fixed.js"); -require("core-js/modules/es6.string.fontcolor"); +require("core-js/modules/es6.string.fontcolor.js"); -require("core-js/modules/es6.string.fontsize"); +require("core-js/modules/es6.string.fontsize.js"); -require("core-js/modules/es6.string.from-code-point"); +require("core-js/modules/es6.string.from-code-point.js"); -require("core-js/modules/es6.string.includes"); +require("core-js/modules/es6.string.includes.js"); -require("core-js/modules/es6.string.italics"); +require("core-js/modules/es6.string.italics.js"); -require("core-js/modules/es6.string.iterator"); +require("core-js/modules/es6.string.iterator.js"); -require("core-js/modules/es6.string.link"); +require("core-js/modules/es6.string.link.js"); -require("core-js/modules/es7.string.pad-start"); +require("core-js/modules/es7.string.pad-start.js"); -require("core-js/modules/es7.string.pad-end"); +require("core-js/modules/es7.string.pad-end.js"); -require("core-js/modules/es6.string.raw"); +require("core-js/modules/es6.string.raw.js"); -require("core-js/modules/es6.string.repeat"); +require("core-js/modules/es6.string.repeat.js"); -require("core-js/modules/es6.string.small"); +require("core-js/modules/es6.string.small.js"); -require("core-js/modules/es6.string.starts-with"); +require("core-js/modules/es6.string.starts-with.js"); -require("core-js/modules/es6.string.strike"); +require("core-js/modules/es6.string.strike.js"); -require("core-js/modules/es6.string.sub"); +require("core-js/modules/es6.string.sub.js"); -require("core-js/modules/es6.string.sup"); +require("core-js/modules/es6.string.sup.js"); -require("core-js/modules/es6.string.trim"); +require("core-js/modules/es6.string.trim.js"); -require("core-js/modules/es7.string.trim-left"); +require("core-js/modules/es7.string.trim-left.js"); -require("core-js/modules/es7.string.trim-right"); +require("core-js/modules/es7.string.trim-right.js"); -require("core-js/modules/es6.typed.array-buffer"); +require("core-js/modules/es6.typed.array-buffer.js"); -require("core-js/modules/es6.typed.data-view"); +require("core-js/modules/es6.typed.data-view.js"); -require("core-js/modules/es6.typed.int8-array"); +require("core-js/modules/es6.typed.int8-array.js"); -require("core-js/modules/es6.typed.uint8-array"); +require("core-js/modules/es6.typed.uint8-array.js"); -require("core-js/modules/es6.typed.uint8-clamped-array"); +require("core-js/modules/es6.typed.uint8-clamped-array.js"); -require("core-js/modules/es6.typed.int16-array"); +require("core-js/modules/es6.typed.int16-array.js"); -require("core-js/modules/es6.typed.uint16-array"); +require("core-js/modules/es6.typed.uint16-array.js"); -require("core-js/modules/es6.typed.int32-array"); +require("core-js/modules/es6.typed.int32-array.js"); -require("core-js/modules/es6.typed.uint32-array"); +require("core-js/modules/es6.typed.uint32-array.js"); -require("core-js/modules/es6.typed.float32-array"); +require("core-js/modules/es6.typed.float32-array.js"); -require("core-js/modules/es6.typed.float64-array"); +require("core-js/modules/es6.typed.float64-array.js"); -require("core-js/modules/es6.weak-map"); +require("core-js/modules/es6.weak-map.js"); -require("core-js/modules/es6.weak-set"); +require("core-js/modules/es6.weak-set.js"); -require("core-js/modules/web.timers"); +require("core-js/modules/web.timers.js"); -require("core-js/modules/web.immediate"); +require("core-js/modules/web.immediate.js"); -require("core-js/modules/web.dom.iterable"); +require("core-js/modules/web.dom.iterable.js"); -require("regenerator-runtime/runtime"); +require("regenerator-runtime/runtime.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs index 71b8fdb1d834..94a7a9e9d580 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs index 265ac0ac0365..34713f0f0404 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs @@ -1,20 +1,20 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.map"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs index e8994bd76301..7e9825a05bd8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs @@ -1,148 +1,148 @@ -import "core-js/modules/es6.array.copy-within"; -import "core-js/modules/es6.array.every"; -import "core-js/modules/es6.array.fill"; -import "core-js/modules/es6.array.filter"; -import "core-js/modules/es6.array.find"; -import "core-js/modules/es6.array.find-index"; -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.for-each"; -import "core-js/modules/es6.array.from"; -import "core-js/modules/es7.array.includes"; -import "core-js/modules/es6.array.index-of"; -import "core-js/modules/es6.array.is-array"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.array.last-index-of"; -import "core-js/modules/es6.array.map"; -import "core-js/modules/es6.array.of"; -import "core-js/modules/es6.array.reduce"; -import "core-js/modules/es6.array.reduce-right"; -import "core-js/modules/es6.array.some"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.array.species"; -import "core-js/modules/es6.date.now"; -import "core-js/modules/es6.date.to-iso-string"; -import "core-js/modules/es6.date.to-json"; -import "core-js/modules/es6.date.to-primitive"; -import "core-js/modules/es6.date.to-string"; -import "core-js/modules/es6.function.bind"; -import "core-js/modules/es6.function.has-instance"; -import "core-js/modules/es6.function.name"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.math.acosh"; -import "core-js/modules/es6.math.asinh"; -import "core-js/modules/es6.math.atanh"; -import "core-js/modules/es6.math.cbrt"; -import "core-js/modules/es6.math.clz32"; -import "core-js/modules/es6.math.cosh"; -import "core-js/modules/es6.math.expm1"; -import "core-js/modules/es6.math.fround"; -import "core-js/modules/es6.math.hypot"; -import "core-js/modules/es6.math.imul"; -import "core-js/modules/es6.math.log1p"; -import "core-js/modules/es6.math.log10"; -import "core-js/modules/es6.math.log2"; -import "core-js/modules/es6.math.sign"; -import "core-js/modules/es6.math.sinh"; -import "core-js/modules/es6.math.tanh"; -import "core-js/modules/es6.math.trunc"; -import "core-js/modules/es6.number.constructor"; -import "core-js/modules/es6.number.epsilon"; -import "core-js/modules/es6.number.is-finite"; -import "core-js/modules/es6.number.is-integer"; -import "core-js/modules/es6.number.is-nan"; -import "core-js/modules/es6.number.is-safe-integer"; -import "core-js/modules/es6.number.max-safe-integer"; -import "core-js/modules/es6.number.min-safe-integer"; -import "core-js/modules/es6.number.parse-float"; -import "core-js/modules/es6.number.parse-int"; -import "core-js/modules/es6.object.assign"; -import "core-js/modules/es6.object.create"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es6.object.define-property"; -import "core-js/modules/es6.object.define-properties"; -import "core-js/modules/es7.object.entries"; -import "core-js/modules/es6.object.freeze"; -import "core-js/modules/es6.object.get-own-property-descriptor"; -import "core-js/modules/es7.object.get-own-property-descriptors"; -import "core-js/modules/es6.object.get-own-property-names"; -import "core-js/modules/es6.object.get-prototype-of"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.prevent-extensions"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.object.is"; -import "core-js/modules/es6.object.is-frozen"; -import "core-js/modules/es6.object.is-sealed"; -import "core-js/modules/es6.object.is-extensible"; -import "core-js/modules/es6.object.keys"; -import "core-js/modules/es6.object.seal"; -import "core-js/modules/es6.object.set-prototype-of"; -import "core-js/modules/es7.object.values"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.reflect.apply"; -import "core-js/modules/es6.reflect.construct"; -import "core-js/modules/es6.reflect.define-property"; -import "core-js/modules/es6.reflect.delete-property"; -import "core-js/modules/es6.reflect.get"; -import "core-js/modules/es6.reflect.get-own-property-descriptor"; -import "core-js/modules/es6.reflect.get-prototype-of"; -import "core-js/modules/es6.reflect.has"; -import "core-js/modules/es6.reflect.is-extensible"; -import "core-js/modules/es6.reflect.own-keys"; -import "core-js/modules/es6.reflect.prevent-extensions"; -import "core-js/modules/es6.reflect.set"; -import "core-js/modules/es6.reflect.set-prototype-of"; -import "core-js/modules/es6.regexp.constructor"; -import "core-js/modules/es6.regexp.flags"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.regexp.to-string"; -import "core-js/modules/es6.set"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.string.anchor"; -import "core-js/modules/es6.string.big"; -import "core-js/modules/es6.string.blink"; -import "core-js/modules/es6.string.bold"; -import "core-js/modules/es6.string.code-point-at"; -import "core-js/modules/es6.string.ends-with"; -import "core-js/modules/es6.string.fixed"; -import "core-js/modules/es6.string.fontcolor"; -import "core-js/modules/es6.string.fontsize"; -import "core-js/modules/es6.string.from-code-point"; -import "core-js/modules/es6.string.includes"; -import "core-js/modules/es6.string.italics"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.string.link"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es6.string.raw"; -import "core-js/modules/es6.string.repeat"; -import "core-js/modules/es6.string.small"; -import "core-js/modules/es6.string.starts-with"; -import "core-js/modules/es6.string.strike"; -import "core-js/modules/es6.string.sub"; -import "core-js/modules/es6.string.sup"; -import "core-js/modules/es6.string.trim"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/es6.typed.array-buffer"; -import "core-js/modules/es6.typed.data-view"; -import "core-js/modules/es6.typed.int8-array"; -import "core-js/modules/es6.typed.uint8-array"; -import "core-js/modules/es6.typed.uint8-clamped-array"; -import "core-js/modules/es6.typed.int16-array"; -import "core-js/modules/es6.typed.uint16-array"; -import "core-js/modules/es6.typed.int32-array"; -import "core-js/modules/es6.typed.uint32-array"; -import "core-js/modules/es6.typed.float32-array"; -import "core-js/modules/es6.typed.float64-array"; -import "core-js/modules/es6.weak-map"; -import "core-js/modules/es6.weak-set"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.copy-within.js"; +import "core-js/modules/es6.array.every.js"; +import "core-js/modules/es6.array.fill.js"; +import "core-js/modules/es6.array.filter.js"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es6.array.find-index.js"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.for-each.js"; +import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.array.index-of.js"; +import "core-js/modules/es6.array.is-array.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.array.last-index-of.js"; +import "core-js/modules/es6.array.map.js"; +import "core-js/modules/es6.array.of.js"; +import "core-js/modules/es6.array.reduce.js"; +import "core-js/modules/es6.array.reduce-right.js"; +import "core-js/modules/es6.array.some.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.array.species.js"; +import "core-js/modules/es6.date.now.js"; +import "core-js/modules/es6.date.to-iso-string.js"; +import "core-js/modules/es6.date.to-json.js"; +import "core-js/modules/es6.date.to-primitive.js"; +import "core-js/modules/es6.date.to-string.js"; +import "core-js/modules/es6.function.bind.js"; +import "core-js/modules/es6.function.has-instance.js"; +import "core-js/modules/es6.function.name.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.math.acosh.js"; +import "core-js/modules/es6.math.asinh.js"; +import "core-js/modules/es6.math.atanh.js"; +import "core-js/modules/es6.math.cbrt.js"; +import "core-js/modules/es6.math.clz32.js"; +import "core-js/modules/es6.math.cosh.js"; +import "core-js/modules/es6.math.expm1.js"; +import "core-js/modules/es6.math.fround.js"; +import "core-js/modules/es6.math.hypot.js"; +import "core-js/modules/es6.math.imul.js"; +import "core-js/modules/es6.math.log1p.js"; +import "core-js/modules/es6.math.log10.js"; +import "core-js/modules/es6.math.log2.js"; +import "core-js/modules/es6.math.sign.js"; +import "core-js/modules/es6.math.sinh.js"; +import "core-js/modules/es6.math.tanh.js"; +import "core-js/modules/es6.math.trunc.js"; +import "core-js/modules/es6.number.constructor.js"; +import "core-js/modules/es6.number.epsilon.js"; +import "core-js/modules/es6.number.is-finite.js"; +import "core-js/modules/es6.number.is-integer.js"; +import "core-js/modules/es6.number.is-nan.js"; +import "core-js/modules/es6.number.is-safe-integer.js"; +import "core-js/modules/es6.number.max-safe-integer.js"; +import "core-js/modules/es6.number.min-safe-integer.js"; +import "core-js/modules/es6.number.parse-float.js"; +import "core-js/modules/es6.number.parse-int.js"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/es6.object.create.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es6.object.define-property.js"; +import "core-js/modules/es6.object.define-properties.js"; +import "core-js/modules/es7.object.entries.js"; +import "core-js/modules/es6.object.freeze.js"; +import "core-js/modules/es6.object.get-own-property-descriptor.js"; +import "core-js/modules/es7.object.get-own-property-descriptors.js"; +import "core-js/modules/es6.object.get-own-property-names.js"; +import "core-js/modules/es6.object.get-prototype-of.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.prevent-extensions.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.object.is.js"; +import "core-js/modules/es6.object.is-frozen.js"; +import "core-js/modules/es6.object.is-sealed.js"; +import "core-js/modules/es6.object.is-extensible.js"; +import "core-js/modules/es6.object.keys.js"; +import "core-js/modules/es6.object.seal.js"; +import "core-js/modules/es6.object.set-prototype-of.js"; +import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.reflect.apply.js"; +import "core-js/modules/es6.reflect.construct.js"; +import "core-js/modules/es6.reflect.define-property.js"; +import "core-js/modules/es6.reflect.delete-property.js"; +import "core-js/modules/es6.reflect.get.js"; +import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es6.reflect.get-prototype-of.js"; +import "core-js/modules/es6.reflect.has.js"; +import "core-js/modules/es6.reflect.is-extensible.js"; +import "core-js/modules/es6.reflect.own-keys.js"; +import "core-js/modules/es6.reflect.prevent-extensions.js"; +import "core-js/modules/es6.reflect.set.js"; +import "core-js/modules/es6.reflect.set-prototype-of.js"; +import "core-js/modules/es6.regexp.constructor.js"; +import "core-js/modules/es6.regexp.flags.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.regexp.to-string.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.string.anchor.js"; +import "core-js/modules/es6.string.big.js"; +import "core-js/modules/es6.string.blink.js"; +import "core-js/modules/es6.string.bold.js"; +import "core-js/modules/es6.string.code-point-at.js"; +import "core-js/modules/es6.string.ends-with.js"; +import "core-js/modules/es6.string.fixed.js"; +import "core-js/modules/es6.string.fontcolor.js"; +import "core-js/modules/es6.string.fontsize.js"; +import "core-js/modules/es6.string.from-code-point.js"; +import "core-js/modules/es6.string.includes.js"; +import "core-js/modules/es6.string.italics.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.string.link.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es6.string.raw.js"; +import "core-js/modules/es6.string.repeat.js"; +import "core-js/modules/es6.string.small.js"; +import "core-js/modules/es6.string.starts-with.js"; +import "core-js/modules/es6.string.strike.js"; +import "core-js/modules/es6.string.sub.js"; +import "core-js/modules/es6.string.sup.js"; +import "core-js/modules/es6.string.trim.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es6.typed.array-buffer.js"; +import "core-js/modules/es6.typed.data-view.js"; +import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.uint8-array.js"; +import "core-js/modules/es6.typed.uint8-clamped-array.js"; +import "core-js/modules/es6.typed.int16-array.js"; +import "core-js/modules/es6.typed.uint16-array.js"; +import "core-js/modules/es6.typed.int32-array.js"; +import "core-js/modules/es6.typed.uint32-array.js"; +import "core-js/modules/es6.typed.float32-array.js"; +import "core-js/modules/es6.typed.float64-array.js"; +import "core-js/modules/es6.weak-map.js"; +import "core-js/modules/es6.weak-set.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs index 3cb3bf4ca5aa..60839e67fabc 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; +import "regenerator-runtime/runtime.js"; var a = 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs index cdc603eea1d3..e1954cab2637 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/es7.array.flat-map"; -import "core-js/modules/es6.array.sort"; -import "core-js/modules/es6.map"; -import "core-js/modules/es7.object.define-getter"; -import "core-js/modules/es7.object.define-setter"; -import "core-js/modules/es7.object.lookup-getter"; -import "core-js/modules/es7.object.lookup-setter"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.set"; -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.trim-left"; -import "core-js/modules/es7.string.trim-right"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es6.array.sort.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es7.object.define-getter.js"; +import "core-js/modules/es7.object.define-setter.js"; +import "core-js/modules/es7.object.lookup-getter.js"; +import "core-js/modules/es7.object.lookup-setter.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.set.js"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.trim-left.js"; +import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.dom.iterable.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs index ccc11ee5c78d..6512ed99e3c0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs @@ -1,13 +1,13 @@ -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/es6.regexp.match"; -import "core-js/modules/es6.promise"; -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.array.from"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/es6.regexp.match.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.array.from.js"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs index 71719adea2ca..4fe6620a6201 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/web.dom.iterable.js"; var a = new Map(); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs index 113f840cdd16..d3ed9f7ffb41 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es6.object.assign"; -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.object.assign.js"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.object.to-string.js"; var objectClass = Object; var arrayInstance = []; var assignStr = "assign"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs index 726b4b40a3b6..ae45b1ccf195 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.array.find"; -import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es7.array.includes.js"; var arrayInstance = []; var inclidesStr = "includes"; var findStr = "find"; // Allow instance methods be assigned to variables. diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs index 8ce9547c189d..0ac3ed1d7662 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es6.array.map"; -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.array.map.js"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.object.values.js"; Object['values'](); // include []['map'](); // include @@ -10,4 +10,3 @@ Object['values'](); // include Object[keys](); // don't include [][filter](); // don't include - diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs index 6762f8384120..5f5557676306 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.pad-start.js"; for (const { padStart diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs index 98577785b4fe..92269937e9c0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/web.dom.iterable.js"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs index e0f8fc879b64..250d30f782da 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs @@ -1,24 +1,24 @@ -import "core-js/modules/es6.regexp.split"; -import "core-js/modules/es6.regexp.replace"; -import "core-js/modules/es6.regexp.search"; -import "core-js/modules/es6.array.copy-within"; -import "core-js/modules/es6.string.ends-with"; -import "core-js/modules/es6.string.code-point-at"; -import "core-js/modules/es6.string.starts-with"; -import "core-js/modules/es7.string.pad-end"; -import "core-js/modules/es7.string.pad-start"; -import "core-js/modules/es6.array.fill"; -import "core-js/modules/es6.function.bind"; -import "core-js/modules/es6.array.find-index"; -import "core-js/modules/es6.array.find"; -import "core-js/modules/es7.array.includes"; -import "core-js/modules/es6.string.includes"; -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.object.to-string"; -import "core-js/modules/es6.map"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.array.from"; +import "core-js/modules/es6.regexp.split.js"; +import "core-js/modules/es6.regexp.replace.js"; +import "core-js/modules/es6.regexp.search.js"; +import "core-js/modules/es6.array.copy-within.js"; +import "core-js/modules/es6.string.ends-with.js"; +import "core-js/modules/es6.string.code-point-at.js"; +import "core-js/modules/es6.string.starts-with.js"; +import "core-js/modules/es7.string.pad-end.js"; +import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es6.array.fill.js"; +import "core-js/modules/es6.function.bind.js"; +import "core-js/modules/es6.array.find-index.js"; +import "core-js/modules/es6.array.find.js"; +import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.string.includes.js"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.map.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.array.from.js"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js index 4a62ea9e8164..63fb2491591c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js @@ -1,7 +1,7 @@ "use strict"; -require("core-js/modules/es6.promise"); +require("core-js/modules/es6.promise.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); Promise; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs index 845aac57c5c0..a47c05365d53 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/web.dom.iterable.js"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs index 7e47082d45e4..4706b0b649e3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.number.parse-int"; -import "core-js/modules/es6.number.constructor"; -import "core-js/modules/es6.number.parse-float"; +import "core-js/modules/es6.number.parse-int.js"; +import "core-js/modules/es6.number.constructor.js"; +import "core-js/modules/es6.number.parse-float.js"; Number.parseFloat("3.14"); Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs index 199377053c8a..2fdc46576a55 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es6.object.to-string"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es6.object.to-string.js"; var p = Promise.resolve(0); Promise.all([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs index a2103a5120a2..bd2a053b687b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es7.promise.finally"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es6.object.to-string.js"; var p = Promise.resolve(0); p.finally(function () { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs index b4a03612d049..530e1fbb1477 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/web.dom.iterable"; -import "core-js/modules/es6.array.iterator"; -import "core-js/modules/es6.string.iterator"; -import "core-js/modules/es6.promise"; -import "core-js/modules/es6.object.to-string"; +import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.iterator.js"; +import "core-js/modules/es6.string.iterator.js"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es6.object.to-string.js"; var p = Promise.resolve(0); Promise.race([p]).then(function (outcome) { alert("OK"); 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 178c426ba53f..c73c0f569615 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,4 +1,4 @@ -import "regenerator-runtime/runtime"; +import "regenerator-runtime/runtime.js"; function a() { return regeneratorRuntime.async(function a$(_context) { diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs index ce5acd262e9f..571c3d9e614a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs @@ -1,4 +1,4 @@ -import "regenerator-runtime/runtime"; +import "regenerator-runtime/runtime.js"; var _marked = /*#__PURE__*/ 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 53afb8206c83..5dc8847cf692 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 @@ -1,32 +1,32 @@ "use strict"; -require("core-js/modules/es6.object.define-properties"); +require("core-js/modules/es6.object.define-properties.js"); -require("core-js/modules/es7.object.get-own-property-descriptors"); +require("core-js/modules/es7.object.get-own-property-descriptors.js"); -require("core-js/modules/es6.array.for-each"); +require("core-js/modules/es6.array.for-each.js"); -require("core-js/modules/es6.array.filter"); +require("core-js/modules/es6.array.filter.js"); -require("core-js/modules/es6.object.define-property"); +require("core-js/modules/es6.object.define-property.js"); -require("core-js/modules/es6.array.index-of"); +require("core-js/modules/es6.array.index-of.js"); -require("core-js/modules/web.dom.iterable"); +require("core-js/modules/web.dom.iterable.js"); -require("core-js/modules/es6.array.iterator"); +require("core-js/modules/es6.array.iterator.js"); -require("core-js/modules/es6.object.keys"); +require("core-js/modules/es6.object.keys.js"); -require("regenerator-runtime/runtime"); +require("regenerator-runtime/runtime.js"); -require("core-js/modules/es7.symbol.async-iterator"); +require("core-js/modules/es7.symbol.async-iterator.js"); -require("core-js/modules/es6.symbol"); +require("core-js/modules/es6.symbol.js"); -require("core-js/modules/es6.promise"); +require("core-js/modules/es6.promise.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js index 6f953a53d427..8532303350ac 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es7.array.includes"); +require("core-js/modules/es7.array.includes.js"); -require("core-js/modules/es6.promise"); +require("core-js/modules/es6.promise.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js index 6f953a53d427..8532303350ac 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es7.array.includes"); +require("core-js/modules/es7.array.includes.js"); -require("core-js/modules/es6.promise"); +require("core-js/modules/es6.promise.js"); -require("core-js/modules/es6.object.to-string"); +require("core-js/modules/es6.object.to-string.js"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs index 024e49245f9c..2849b1a039e6 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/web.dom.iterable.js"; Symbol.iterator in arr; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs index a99eae6b7eb3..07219832983e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es7.symbol.async-iterator"; -import "core-js/modules/es6.symbol"; -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es7.symbol.async-iterator.js"; +import "core-js/modules/es6.symbol.js"; +import "core-js/modules/web.dom.iterable.js"; arr[Symbol.iterator](); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs index 9f0806068bfb..7ad87d9bee6e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.promise"; -import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.promise.js"; +import "core-js/modules/es6.object.to-string.js"; Promise.resolve().then(function (it) { setTimeout(foo, 1, 2); setInterval(foo, 1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs index 995d901c5ced..a2f08cc2f4d4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.int8-array.js"; Int8Array.of(); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs index 5f5982426d2b..06fa6ff9568b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.int8-array.js"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs index 25cd531c2235..8b71967b061b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable"; +import "core-js/modules/web.dom.iterable.js"; function* a() { yield* 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs index efa4728cac88..798a7c828d60 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/web.immediate"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.immediate.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs index de6d3f35f1d0..fd39d7a3b317 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs @@ -1,291 +1,291 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.every"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.for-each"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.is-array"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.reduce"; -import "core-js/modules/es.array.reduce-right"; -import "core-js/modules/es.array.reverse"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.some"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.array-buffer.is-view"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.data-view"; -import "core-js/modules/es.date.now"; -import "core-js/modules/es.date.to-iso-string"; -import "core-js/modules/es.date.to-json"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.date.to-string"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.number.to-precision"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.create"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-properties"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.parse-float"; -import "core-js/modules/es.parse-int"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.global-this"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs index 064f9d4a4469..601127a9745c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs @@ -1,97 +1,97 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs index add5d817c3ca..a13a091765f8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs @@ -1,78 +1,78 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs index 8051a9cde054..502e4f373a90 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs index 7ff494cd47e4..084a2d1b4ee7 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/web.immediate"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/web.immediate.js"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs index 929415b8b20e..57993826a43d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs @@ -1,26 +1,26 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs index 34a798940e85..27fe9ec4c6e3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; a ** b; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs index be5df68026ae..09e8d2f08d22 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs @@ -1,85 +1,85 @@ -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs index 51a04c11f07a..fe66e4a68403 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs @@ -1,286 +1,286 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.every"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.for-each"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.is-array"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.reduce"; -import "core-js/modules/es.array.reduce-right"; -import "core-js/modules/es.array.reverse"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.some"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.array-buffer.is-view"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.data-view"; -import "core-js/modules/es.date.now"; -import "core-js/modules/es.date.to-iso-string"; -import "core-js/modules/es.date.to-json"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.date.to-string"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.number.to-precision"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.create"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-properties"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.parse-float"; -import "core-js/modules/es.parse-int"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.global-this"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs index 709c4c46f314..71011e6365c3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs @@ -1,20 +1,20 @@ -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.replace-all.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs index bd40e3a515d5..85587d7b4a1f 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs @@ -1,26 +1,26 @@ -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/web.dom-collections.iterator.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs index db5f1173b2fc..2473bf6c7026 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; import 'core-js/features/something.new'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs index ef5c31db184c..7b9b5ef5dbe8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; import 'core-js/something'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs index 24251fba896e..885edac26439 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs @@ -1,52 +1,52 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.create"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-properties"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; import 'core-js/something'; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs index 55d6e9dbd5c4..397c25c08b26 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs @@ -1,2 +1,2 @@ -import 'core-js/modules/es.object.from-entries'; -import 'core-js/modules/esnext.string.replace-all'; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.string.replace-all.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs index e761a4ac12c5..332d84698bac 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs @@ -1,3 +1,3 @@ -import 'core-js/modules/es.symbol'; -import 'core-js/modules/es.object.from-entries'; -import 'core-js/modules/esnext.string.replace-all'; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/esnext.string.replace-all.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs index c010a7b5fccb..017c5c10d294 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs @@ -1,81 +1,81 @@ -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs index d59c98b71768..4dee28cfd441 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.global-this"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs index 770311665f95..047f3181727f 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs @@ -1 +1 @@ -import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.from-entries.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs index 896c1ad687dd..013b99c3059e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs index c010a7b5fccb..017c5c10d294 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs @@ -1,81 +1,81 @@ -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs index d59c98b71768..4dee28cfd441 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/esnext.aggregate-error"; -import "core-js/modules/esnext.array.last-index"; -import "core-js/modules/esnext.array.last-item"; -import "core-js/modules/esnext.composite-key"; -import "core-js/modules/esnext.composite-symbol"; -import "core-js/modules/esnext.global-this"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.from"; -import "core-js/modules/esnext.map.group-by"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-by"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.of"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.math.clamp"; -import "core-js/modules/esnext.math.deg-per-rad"; -import "core-js/modules/esnext.math.degrees"; -import "core-js/modules/esnext.math.fscale"; -import "core-js/modules/esnext.math.iaddh"; -import "core-js/modules/esnext.math.imulh"; -import "core-js/modules/esnext.math.isubh"; -import "core-js/modules/esnext.math.rad-per-deg"; -import "core-js/modules/esnext.math.radians"; -import "core-js/modules/esnext.math.scale"; -import "core-js/modules/esnext.math.seeded-prng"; -import "core-js/modules/esnext.math.signbit"; -import "core-js/modules/esnext.math.umulh"; -import "core-js/modules/esnext.number.from-string"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.promise.all-settled"; -import "core-js/modules/esnext.promise.any"; -import "core-js/modules/esnext.promise.try"; -import "core-js/modules/esnext.reflect.define-metadata"; -import "core-js/modules/esnext.reflect.delete-metadata"; -import "core-js/modules/esnext.reflect.get-metadata"; -import "core-js/modules/esnext.reflect.get-metadata-keys"; -import "core-js/modules/esnext.reflect.get-own-metadata"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys"; -import "core-js/modules/esnext.reflect.has-metadata"; -import "core-js/modules/esnext.reflect.has-own-metadata"; -import "core-js/modules/esnext.reflect.metadata"; -import "core-js/modules/esnext.set.add-all"; -import "core-js/modules/esnext.set.delete-all"; -import "core-js/modules/esnext.set.difference"; -import "core-js/modules/esnext.set.every"; -import "core-js/modules/esnext.set.filter"; -import "core-js/modules/esnext.set.find"; -import "core-js/modules/esnext.set.from"; -import "core-js/modules/esnext.set.intersection"; -import "core-js/modules/esnext.set.is-disjoint-from"; -import "core-js/modules/esnext.set.is-subset-of"; -import "core-js/modules/esnext.set.is-superset-of"; -import "core-js/modules/esnext.set.join"; -import "core-js/modules/esnext.set.map"; -import "core-js/modules/esnext.set.of"; -import "core-js/modules/esnext.set.reduce"; -import "core-js/modules/esnext.set.some"; -import "core-js/modules/esnext.set.symmetric-difference"; -import "core-js/modules/esnext.set.union"; -import "core-js/modules/esnext.string.at"; -import "core-js/modules/esnext.string.code-points"; -import "core-js/modules/esnext.string.match-all"; -import "core-js/modules/esnext.string.replace-all"; -import "core-js/modules/esnext.symbol.dispose"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/esnext.symbol.pattern-match"; -import "core-js/modules/esnext.weak-map.delete-all"; -import "core-js/modules/esnext.weak-map.from"; -import "core-js/modules/esnext.weak-map.of"; -import "core-js/modules/esnext.weak-set.add-all"; -import "core-js/modules/esnext.weak-set.delete-all"; -import "core-js/modules/esnext.weak-set.from"; -import "core-js/modules/esnext.weak-set.of"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/esnext.aggregate-error.js"; +import "core-js/modules/esnext.array.last-index.js"; +import "core-js/modules/esnext.array.last-item.js"; +import "core-js/modules/esnext.composite-key.js"; +import "core-js/modules/esnext.composite-symbol.js"; +import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.from.js"; +import "core-js/modules/esnext.map.group-by.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-by.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.of.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.math.clamp.js"; +import "core-js/modules/esnext.math.deg-per-rad.js"; +import "core-js/modules/esnext.math.degrees.js"; +import "core-js/modules/esnext.math.fscale.js"; +import "core-js/modules/esnext.math.iaddh.js"; +import "core-js/modules/esnext.math.imulh.js"; +import "core-js/modules/esnext.math.isubh.js"; +import "core-js/modules/esnext.math.rad-per-deg.js"; +import "core-js/modules/esnext.math.radians.js"; +import "core-js/modules/esnext.math.scale.js"; +import "core-js/modules/esnext.math.seeded-prng.js"; +import "core-js/modules/esnext.math.signbit.js"; +import "core-js/modules/esnext.math.umulh.js"; +import "core-js/modules/esnext.number.from-string.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.promise.all-settled.js"; +import "core-js/modules/esnext.promise.any.js"; +import "core-js/modules/esnext.promise.try.js"; +import "core-js/modules/esnext.reflect.define-metadata.js"; +import "core-js/modules/esnext.reflect.delete-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata.js"; +import "core-js/modules/esnext.reflect.get-metadata-keys.js"; +import "core-js/modules/esnext.reflect.get-own-metadata.js"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; +import "core-js/modules/esnext.reflect.has-metadata.js"; +import "core-js/modules/esnext.reflect.has-own-metadata.js"; +import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/esnext.set.add-all.js"; +import "core-js/modules/esnext.set.delete-all.js"; +import "core-js/modules/esnext.set.difference.js"; +import "core-js/modules/esnext.set.every.js"; +import "core-js/modules/esnext.set.filter.js"; +import "core-js/modules/esnext.set.find.js"; +import "core-js/modules/esnext.set.from.js"; +import "core-js/modules/esnext.set.intersection.js"; +import "core-js/modules/esnext.set.is-disjoint-from.js"; +import "core-js/modules/esnext.set.is-subset-of.js"; +import "core-js/modules/esnext.set.is-superset-of.js"; +import "core-js/modules/esnext.set.join.js"; +import "core-js/modules/esnext.set.map.js"; +import "core-js/modules/esnext.set.of.js"; +import "core-js/modules/esnext.set.reduce.js"; +import "core-js/modules/esnext.set.some.js"; +import "core-js/modules/esnext.set.symmetric-difference.js"; +import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.string.at.js"; +import "core-js/modules/esnext.string.code-points.js"; +import "core-js/modules/esnext.string.match-all.js"; +import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/esnext.symbol.dispose.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.symbol.pattern-match.js"; +import "core-js/modules/esnext.weak-map.delete-all.js"; +import "core-js/modules/esnext.weak-map.from.js"; +import "core-js/modules/esnext.weak-map.of.js"; +import "core-js/modules/esnext.weak-set.add-all.js"; +import "core-js/modules/esnext.weak-set.delete-all.js"; +import "core-js/modules/esnext.weak-set.from.js"; +import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs index 6dbf8852bca6..5e2ff95b9d6b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs @@ -1 +1 @@ -import "core-js/modules/web.immediate"; +import "core-js/modules/web.immediate.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs index 37348c29d894..385b070eeb42 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs @@ -1,9 +1,9 @@ -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs index f6b2431273cf..1e79fffa55f3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs @@ -1,181 +1,181 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs index 80f642659b89..a6aa5d76eae2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs @@ -1,187 +1,187 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.array-buffer.is-view"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.data-view"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs index 1332106cce0a..b8b3d8fe4ed8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs index dd8a2c20f45c..f375ee9a47f2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/web.queue-microtask"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/web.queue-microtask.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs index db959e64958b..2b28997de326 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/web.queue-microtask"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/web.queue-microtask.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs index cd01fb3f1a40..0866f7e7310b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs index a3a45d940508..845fba0f5b03 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs @@ -1,27 +1,27 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs index 479672b52e8e..c7471c042309 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.map"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; import 'foo/index.js'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js index 788e39cdfeb8..4a5699dac78d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js @@ -1,223 +1,223 @@ -require("core-js/modules/es.symbol.description"); +require("core-js/modules/es.symbol.description.js"); -require("core-js/modules/es.symbol.async-iterator"); +require("core-js/modules/es.symbol.async-iterator.js"); -require("core-js/modules/es.array.flat"); +require("core-js/modules/es.array.flat.js"); -require("core-js/modules/es.array.flat-map"); +require("core-js/modules/es.array.flat-map.js"); -require("core-js/modules/es.array.iterator"); +require("core-js/modules/es.array.iterator.js"); -require("core-js/modules/es.array.sort"); +require("core-js/modules/es.array.sort.js"); -require("core-js/modules/es.array.unscopables.flat"); +require("core-js/modules/es.array.unscopables.flat.js"); -require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.array.unscopables.flat-map.js"); -require("core-js/modules/es.math.hypot"); +require("core-js/modules/es.math.hypot.js"); -require("core-js/modules/es.object.define-getter"); +require("core-js/modules/es.object.define-getter.js"); -require("core-js/modules/es.object.define-setter"); +require("core-js/modules/es.object.define-setter.js"); -require("core-js/modules/es.object.from-entries"); +require("core-js/modules/es.object.from-entries.js"); -require("core-js/modules/es.object.lookup-getter"); +require("core-js/modules/es.object.lookup-getter.js"); -require("core-js/modules/es.object.lookup-setter"); +require("core-js/modules/es.object.lookup-setter.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.promise.finally"); +require("core-js/modules/es.promise.finally.js"); -require("core-js/modules/es.string.pad-end"); +require("core-js/modules/es.string.pad-end.js"); -require("core-js/modules/es.string.pad-start"); +require("core-js/modules/es.string.pad-start.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.string.trim-end"); +require("core-js/modules/es.string.trim-end.js"); -require("core-js/modules/es.string.trim-start"); +require("core-js/modules/es.string.trim-start.js"); -require("core-js/modules/esnext.aggregate-error"); +require("core-js/modules/esnext.aggregate-error.js"); -require("core-js/modules/esnext.array.last-index"); +require("core-js/modules/esnext.array.last-index.js"); -require("core-js/modules/esnext.array.last-item"); +require("core-js/modules/esnext.array.last-item.js"); -require("core-js/modules/esnext.composite-key"); +require("core-js/modules/esnext.composite-key.js"); -require("core-js/modules/esnext.composite-symbol"); +require("core-js/modules/esnext.composite-symbol.js"); -require("core-js/modules/esnext.global-this"); +require("core-js/modules/esnext.global-this.js"); -require("core-js/modules/esnext.map.delete-all"); +require("core-js/modules/esnext.map.delete-all.js"); -require("core-js/modules/esnext.map.every"); +require("core-js/modules/esnext.map.every.js"); -require("core-js/modules/esnext.map.filter"); +require("core-js/modules/esnext.map.filter.js"); -require("core-js/modules/esnext.map.find"); +require("core-js/modules/esnext.map.find.js"); -require("core-js/modules/esnext.map.find-key"); +require("core-js/modules/esnext.map.find-key.js"); -require("core-js/modules/esnext.map.from"); +require("core-js/modules/esnext.map.from.js"); -require("core-js/modules/esnext.map.group-by"); +require("core-js/modules/esnext.map.group-by.js"); -require("core-js/modules/esnext.map.includes"); +require("core-js/modules/esnext.map.includes.js"); -require("core-js/modules/esnext.map.key-by"); +require("core-js/modules/esnext.map.key-by.js"); -require("core-js/modules/esnext.map.key-of"); +require("core-js/modules/esnext.map.key-of.js"); -require("core-js/modules/esnext.map.map-keys"); +require("core-js/modules/esnext.map.map-keys.js"); -require("core-js/modules/esnext.map.map-values"); +require("core-js/modules/esnext.map.map-values.js"); -require("core-js/modules/esnext.map.merge"); +require("core-js/modules/esnext.map.merge.js"); -require("core-js/modules/esnext.map.of"); +require("core-js/modules/esnext.map.of.js"); -require("core-js/modules/esnext.map.reduce"); +require("core-js/modules/esnext.map.reduce.js"); -require("core-js/modules/esnext.map.some"); +require("core-js/modules/esnext.map.some.js"); -require("core-js/modules/esnext.map.update"); +require("core-js/modules/esnext.map.update.js"); -require("core-js/modules/esnext.math.clamp"); +require("core-js/modules/esnext.math.clamp.js"); -require("core-js/modules/esnext.math.deg-per-rad"); +require("core-js/modules/esnext.math.deg-per-rad.js"); -require("core-js/modules/esnext.math.degrees"); +require("core-js/modules/esnext.math.degrees.js"); -require("core-js/modules/esnext.math.fscale"); +require("core-js/modules/esnext.math.fscale.js"); -require("core-js/modules/esnext.math.iaddh"); +require("core-js/modules/esnext.math.iaddh.js"); -require("core-js/modules/esnext.math.imulh"); +require("core-js/modules/esnext.math.imulh.js"); -require("core-js/modules/esnext.math.isubh"); +require("core-js/modules/esnext.math.isubh.js"); -require("core-js/modules/esnext.math.rad-per-deg"); +require("core-js/modules/esnext.math.rad-per-deg.js"); -require("core-js/modules/esnext.math.radians"); +require("core-js/modules/esnext.math.radians.js"); -require("core-js/modules/esnext.math.scale"); +require("core-js/modules/esnext.math.scale.js"); -require("core-js/modules/esnext.math.seeded-prng"); +require("core-js/modules/esnext.math.seeded-prng.js"); -require("core-js/modules/esnext.math.signbit"); +require("core-js/modules/esnext.math.signbit.js"); -require("core-js/modules/esnext.math.umulh"); +require("core-js/modules/esnext.math.umulh.js"); -require("core-js/modules/esnext.number.from-string"); +require("core-js/modules/esnext.number.from-string.js"); -require("core-js/modules/esnext.observable"); +require("core-js/modules/esnext.observable.js"); -require("core-js/modules/esnext.promise.all-settled"); +require("core-js/modules/esnext.promise.all-settled.js"); -require("core-js/modules/esnext.promise.any"); +require("core-js/modules/esnext.promise.any.js"); -require("core-js/modules/esnext.promise.try"); +require("core-js/modules/esnext.promise.try.js"); -require("core-js/modules/esnext.reflect.define-metadata"); +require("core-js/modules/esnext.reflect.define-metadata.js"); -require("core-js/modules/esnext.reflect.delete-metadata"); +require("core-js/modules/esnext.reflect.delete-metadata.js"); -require("core-js/modules/esnext.reflect.get-metadata"); +require("core-js/modules/esnext.reflect.get-metadata.js"); -require("core-js/modules/esnext.reflect.get-metadata-keys"); +require("core-js/modules/esnext.reflect.get-metadata-keys.js"); -require("core-js/modules/esnext.reflect.get-own-metadata"); +require("core-js/modules/esnext.reflect.get-own-metadata.js"); -require("core-js/modules/esnext.reflect.get-own-metadata-keys"); +require("core-js/modules/esnext.reflect.get-own-metadata-keys.js"); -require("core-js/modules/esnext.reflect.has-metadata"); +require("core-js/modules/esnext.reflect.has-metadata.js"); -require("core-js/modules/esnext.reflect.has-own-metadata"); +require("core-js/modules/esnext.reflect.has-own-metadata.js"); -require("core-js/modules/esnext.reflect.metadata"); +require("core-js/modules/esnext.reflect.metadata.js"); -require("core-js/modules/esnext.set.add-all"); +require("core-js/modules/esnext.set.add-all.js"); -require("core-js/modules/esnext.set.delete-all"); +require("core-js/modules/esnext.set.delete-all.js"); -require("core-js/modules/esnext.set.difference"); +require("core-js/modules/esnext.set.difference.js"); -require("core-js/modules/esnext.set.every"); +require("core-js/modules/esnext.set.every.js"); -require("core-js/modules/esnext.set.filter"); +require("core-js/modules/esnext.set.filter.js"); -require("core-js/modules/esnext.set.find"); +require("core-js/modules/esnext.set.find.js"); -require("core-js/modules/esnext.set.from"); +require("core-js/modules/esnext.set.from.js"); -require("core-js/modules/esnext.set.intersection"); +require("core-js/modules/esnext.set.intersection.js"); -require("core-js/modules/esnext.set.is-disjoint-from"); +require("core-js/modules/esnext.set.is-disjoint-from.js"); -require("core-js/modules/esnext.set.is-subset-of"); +require("core-js/modules/esnext.set.is-subset-of.js"); -require("core-js/modules/esnext.set.is-superset-of"); +require("core-js/modules/esnext.set.is-superset-of.js"); -require("core-js/modules/esnext.set.join"); +require("core-js/modules/esnext.set.join.js"); -require("core-js/modules/esnext.set.map"); +require("core-js/modules/esnext.set.map.js"); -require("core-js/modules/esnext.set.of"); +require("core-js/modules/esnext.set.of.js"); -require("core-js/modules/esnext.set.reduce"); +require("core-js/modules/esnext.set.reduce.js"); -require("core-js/modules/esnext.set.some"); +require("core-js/modules/esnext.set.some.js"); -require("core-js/modules/esnext.set.symmetric-difference"); +require("core-js/modules/esnext.set.symmetric-difference.js"); -require("core-js/modules/esnext.set.union"); +require("core-js/modules/esnext.set.union.js"); -require("core-js/modules/esnext.string.at"); +require("core-js/modules/esnext.string.at.js"); -require("core-js/modules/esnext.string.code-points"); +require("core-js/modules/esnext.string.code-points.js"); -require("core-js/modules/esnext.string.match-all"); +require("core-js/modules/esnext.string.match-all.js"); -require("core-js/modules/esnext.string.replace-all"); +require("core-js/modules/esnext.string.replace-all.js"); -require("core-js/modules/esnext.symbol.dispose"); +require("core-js/modules/esnext.symbol.dispose.js"); -require("core-js/modules/esnext.symbol.observable"); +require("core-js/modules/esnext.symbol.observable.js"); -require("core-js/modules/esnext.symbol.pattern-match"); +require("core-js/modules/esnext.symbol.pattern-match.js"); -require("core-js/modules/esnext.weak-map.delete-all"); +require("core-js/modules/esnext.weak-map.delete-all.js"); -require("core-js/modules/esnext.weak-map.from"); +require("core-js/modules/esnext.weak-map.from.js"); -require("core-js/modules/esnext.weak-map.of"); +require("core-js/modules/esnext.weak-map.of.js"); -require("core-js/modules/esnext.weak-set.add-all"); +require("core-js/modules/esnext.weak-set.add-all.js"); -require("core-js/modules/esnext.weak-set.delete-all"); +require("core-js/modules/esnext.weak-set.delete-all.js"); -require("core-js/modules/esnext.weak-set.from"); +require("core-js/modules/esnext.weak-set.from.js"); -require("core-js/modules/esnext.weak-set.of"); +require("core-js/modules/esnext.weak-set.of.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.iterator"); +require("core-js/modules/web.dom-collections.iterator.js"); -require("core-js/modules/web.immediate"); +require("core-js/modules/web.immediate.js"); -require("core-js/modules/web.queue-microtask"); +require("core-js/modules/web.queue-microtask.js"); -require("core-js/modules/web.url"); +require("core-js/modules/web.url.js"); -require("core-js/modules/web.url.to-json"); +require("core-js/modules/web.url.to-json.js"); -require("core-js/modules/web.url-search-params"); +require("core-js/modules/web.url-search-params.js"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js index ca0c13b8c25b..fb095b53d149 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js @@ -1,9 +1,9 @@ -require("core-js/modules/es.array.unscopables.flat"); +require("core-js/modules/es.array.unscopables.flat.js"); -require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.array.unscopables.flat-map.js"); -require("core-js/modules/es.math.hypot"); +require("core-js/modules/es.math.hypot.js"); -require("core-js/modules/es.object.from-entries"); +require("core-js/modules/es.object.from-entries.js"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js index 72ba892bc13d..11c15bc9e94c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js @@ -1,215 +1,215 @@ -require("core-js/modules/es.symbol.description"); +require("core-js/modules/es.symbol.description.js"); -require("core-js/modules/es.symbol.async-iterator"); +require("core-js/modules/es.symbol.async-iterator.js"); -require("core-js/modules/es.array.flat"); +require("core-js/modules/es.array.flat.js"); -require("core-js/modules/es.array.flat-map"); +require("core-js/modules/es.array.flat-map.js"); -require("core-js/modules/es.array.iterator"); +require("core-js/modules/es.array.iterator.js"); -require("core-js/modules/es.array.sort"); +require("core-js/modules/es.array.sort.js"); -require("core-js/modules/es.array.unscopables.flat"); +require("core-js/modules/es.array.unscopables.flat.js"); -require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.array.unscopables.flat-map.js"); -require("core-js/modules/es.math.hypot"); +require("core-js/modules/es.math.hypot.js"); -require("core-js/modules/es.object.define-getter"); +require("core-js/modules/es.object.define-getter.js"); -require("core-js/modules/es.object.define-setter"); +require("core-js/modules/es.object.define-setter.js"); -require("core-js/modules/es.object.from-entries"); +require("core-js/modules/es.object.from-entries.js"); -require("core-js/modules/es.object.lookup-getter"); +require("core-js/modules/es.object.lookup-getter.js"); -require("core-js/modules/es.object.lookup-setter"); +require("core-js/modules/es.object.lookup-setter.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.promise.finally"); +require("core-js/modules/es.promise.finally.js"); -require("core-js/modules/es.string.pad-end"); +require("core-js/modules/es.string.pad-end.js"); -require("core-js/modules/es.string.pad-start"); +require("core-js/modules/es.string.pad-start.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.string.trim-end"); +require("core-js/modules/es.string.trim-end.js"); -require("core-js/modules/es.string.trim-start"); +require("core-js/modules/es.string.trim-start.js"); -require("core-js/modules/esnext.aggregate-error"); +require("core-js/modules/esnext.aggregate-error.js"); -require("core-js/modules/esnext.array.last-index"); +require("core-js/modules/esnext.array.last-index.js"); -require("core-js/modules/esnext.array.last-item"); +require("core-js/modules/esnext.array.last-item.js"); -require("core-js/modules/esnext.composite-key"); +require("core-js/modules/esnext.composite-key.js"); -require("core-js/modules/esnext.composite-symbol"); +require("core-js/modules/esnext.composite-symbol.js"); -require("core-js/modules/esnext.global-this"); +require("core-js/modules/esnext.global-this.js"); -require("core-js/modules/esnext.map.delete-all"); +require("core-js/modules/esnext.map.delete-all.js"); -require("core-js/modules/esnext.map.every"); +require("core-js/modules/esnext.map.every.js"); -require("core-js/modules/esnext.map.filter"); +require("core-js/modules/esnext.map.filter.js"); -require("core-js/modules/esnext.map.find"); +require("core-js/modules/esnext.map.find.js"); -require("core-js/modules/esnext.map.find-key"); +require("core-js/modules/esnext.map.find-key.js"); -require("core-js/modules/esnext.map.from"); +require("core-js/modules/esnext.map.from.js"); -require("core-js/modules/esnext.map.group-by"); +require("core-js/modules/esnext.map.group-by.js"); -require("core-js/modules/esnext.map.includes"); +require("core-js/modules/esnext.map.includes.js"); -require("core-js/modules/esnext.map.key-by"); +require("core-js/modules/esnext.map.key-by.js"); -require("core-js/modules/esnext.map.key-of"); +require("core-js/modules/esnext.map.key-of.js"); -require("core-js/modules/esnext.map.map-keys"); +require("core-js/modules/esnext.map.map-keys.js"); -require("core-js/modules/esnext.map.map-values"); +require("core-js/modules/esnext.map.map-values.js"); -require("core-js/modules/esnext.map.merge"); +require("core-js/modules/esnext.map.merge.js"); -require("core-js/modules/esnext.map.of"); +require("core-js/modules/esnext.map.of.js"); -require("core-js/modules/esnext.map.reduce"); +require("core-js/modules/esnext.map.reduce.js"); -require("core-js/modules/esnext.map.some"); +require("core-js/modules/esnext.map.some.js"); -require("core-js/modules/esnext.map.update"); +require("core-js/modules/esnext.map.update.js"); -require("core-js/modules/esnext.math.clamp"); +require("core-js/modules/esnext.math.clamp.js"); -require("core-js/modules/esnext.math.deg-per-rad"); +require("core-js/modules/esnext.math.deg-per-rad.js"); -require("core-js/modules/esnext.math.degrees"); +require("core-js/modules/esnext.math.degrees.js"); -require("core-js/modules/esnext.math.fscale"); +require("core-js/modules/esnext.math.fscale.js"); -require("core-js/modules/esnext.math.iaddh"); +require("core-js/modules/esnext.math.iaddh.js"); -require("core-js/modules/esnext.math.imulh"); +require("core-js/modules/esnext.math.imulh.js"); -require("core-js/modules/esnext.math.isubh"); +require("core-js/modules/esnext.math.isubh.js"); -require("core-js/modules/esnext.math.rad-per-deg"); +require("core-js/modules/esnext.math.rad-per-deg.js"); -require("core-js/modules/esnext.math.radians"); +require("core-js/modules/esnext.math.radians.js"); -require("core-js/modules/esnext.math.scale"); +require("core-js/modules/esnext.math.scale.js"); -require("core-js/modules/esnext.math.seeded-prng"); +require("core-js/modules/esnext.math.seeded-prng.js"); -require("core-js/modules/esnext.math.signbit"); +require("core-js/modules/esnext.math.signbit.js"); -require("core-js/modules/esnext.math.umulh"); +require("core-js/modules/esnext.math.umulh.js"); -require("core-js/modules/esnext.number.from-string"); +require("core-js/modules/esnext.number.from-string.js"); -require("core-js/modules/esnext.observable"); +require("core-js/modules/esnext.observable.js"); -require("core-js/modules/esnext.promise.all-settled"); +require("core-js/modules/esnext.promise.all-settled.js"); -require("core-js/modules/esnext.promise.any"); +require("core-js/modules/esnext.promise.any.js"); -require("core-js/modules/esnext.promise.try"); +require("core-js/modules/esnext.promise.try.js"); -require("core-js/modules/esnext.reflect.define-metadata"); +require("core-js/modules/esnext.reflect.define-metadata.js"); -require("core-js/modules/esnext.reflect.delete-metadata"); +require("core-js/modules/esnext.reflect.delete-metadata.js"); -require("core-js/modules/esnext.reflect.get-metadata"); +require("core-js/modules/esnext.reflect.get-metadata.js"); -require("core-js/modules/esnext.reflect.get-metadata-keys"); +require("core-js/modules/esnext.reflect.get-metadata-keys.js"); -require("core-js/modules/esnext.reflect.get-own-metadata"); +require("core-js/modules/esnext.reflect.get-own-metadata.js"); -require("core-js/modules/esnext.reflect.get-own-metadata-keys"); +require("core-js/modules/esnext.reflect.get-own-metadata-keys.js"); -require("core-js/modules/esnext.reflect.has-metadata"); +require("core-js/modules/esnext.reflect.has-metadata.js"); -require("core-js/modules/esnext.reflect.has-own-metadata"); +require("core-js/modules/esnext.reflect.has-own-metadata.js"); -require("core-js/modules/esnext.reflect.metadata"); +require("core-js/modules/esnext.reflect.metadata.js"); -require("core-js/modules/esnext.set.add-all"); +require("core-js/modules/esnext.set.add-all.js"); -require("core-js/modules/esnext.set.delete-all"); +require("core-js/modules/esnext.set.delete-all.js"); -require("core-js/modules/esnext.set.difference"); +require("core-js/modules/esnext.set.difference.js"); -require("core-js/modules/esnext.set.every"); +require("core-js/modules/esnext.set.every.js"); -require("core-js/modules/esnext.set.filter"); +require("core-js/modules/esnext.set.filter.js"); -require("core-js/modules/esnext.set.find"); +require("core-js/modules/esnext.set.find.js"); -require("core-js/modules/esnext.set.from"); +require("core-js/modules/esnext.set.from.js"); -require("core-js/modules/esnext.set.intersection"); +require("core-js/modules/esnext.set.intersection.js"); -require("core-js/modules/esnext.set.is-disjoint-from"); +require("core-js/modules/esnext.set.is-disjoint-from.js"); -require("core-js/modules/esnext.set.is-subset-of"); +require("core-js/modules/esnext.set.is-subset-of.js"); -require("core-js/modules/esnext.set.is-superset-of"); +require("core-js/modules/esnext.set.is-superset-of.js"); -require("core-js/modules/esnext.set.join"); +require("core-js/modules/esnext.set.join.js"); -require("core-js/modules/esnext.set.map"); +require("core-js/modules/esnext.set.map.js"); -require("core-js/modules/esnext.set.of"); +require("core-js/modules/esnext.set.of.js"); -require("core-js/modules/esnext.set.reduce"); +require("core-js/modules/esnext.set.reduce.js"); -require("core-js/modules/esnext.set.some"); +require("core-js/modules/esnext.set.some.js"); -require("core-js/modules/esnext.set.symmetric-difference"); +require("core-js/modules/esnext.set.symmetric-difference.js"); -require("core-js/modules/esnext.set.union"); +require("core-js/modules/esnext.set.union.js"); -require("core-js/modules/esnext.string.at"); +require("core-js/modules/esnext.string.at.js"); -require("core-js/modules/esnext.string.code-points"); +require("core-js/modules/esnext.string.code-points.js"); -require("core-js/modules/esnext.string.match-all"); +require("core-js/modules/esnext.string.match-all.js"); -require("core-js/modules/esnext.string.replace-all"); +require("core-js/modules/esnext.string.replace-all.js"); -require("core-js/modules/esnext.symbol.dispose"); +require("core-js/modules/esnext.symbol.dispose.js"); -require("core-js/modules/esnext.symbol.observable"); +require("core-js/modules/esnext.symbol.observable.js"); -require("core-js/modules/esnext.symbol.pattern-match"); +require("core-js/modules/esnext.symbol.pattern-match.js"); -require("core-js/modules/esnext.weak-map.delete-all"); +require("core-js/modules/esnext.weak-map.delete-all.js"); -require("core-js/modules/esnext.weak-map.from"); +require("core-js/modules/esnext.weak-map.from.js"); -require("core-js/modules/esnext.weak-map.of"); +require("core-js/modules/esnext.weak-map.of.js"); -require("core-js/modules/esnext.weak-set.add-all"); +require("core-js/modules/esnext.weak-set.add-all.js"); -require("core-js/modules/esnext.weak-set.delete-all"); +require("core-js/modules/esnext.weak-set.delete-all.js"); -require("core-js/modules/esnext.weak-set.from"); +require("core-js/modules/esnext.weak-set.from.js"); -require("core-js/modules/esnext.weak-set.of"); +require("core-js/modules/esnext.weak-set.of.js"); -require("core-js/modules/web.url"); +require("core-js/modules/web.url.js"); -require("core-js/modules/web.url.to-json"); +require("core-js/modules/web.url.to-json.js"); -require("core-js/modules/web.url-search-params"); +require("core-js/modules/web.url-search-params.js"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js index 974ad1fee63b..4adcce188e71 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js @@ -1,59 +1,59 @@ -require("core-js/modules/es.symbol.description"); +require("core-js/modules/es.symbol.description.js"); -require("core-js/modules/es.symbol.async-iterator"); +require("core-js/modules/es.symbol.async-iterator.js"); -require("core-js/modules/es.array.flat"); +require("core-js/modules/es.array.flat.js"); -require("core-js/modules/es.array.flat-map"); +require("core-js/modules/es.array.flat-map.js"); -require("core-js/modules/es.array.iterator"); +require("core-js/modules/es.array.iterator.js"); -require("core-js/modules/es.array.sort"); +require("core-js/modules/es.array.sort.js"); -require("core-js/modules/es.array.unscopables.flat"); +require("core-js/modules/es.array.unscopables.flat.js"); -require("core-js/modules/es.array.unscopables.flat-map"); +require("core-js/modules/es.array.unscopables.flat-map.js"); -require("core-js/modules/es.math.hypot"); +require("core-js/modules/es.math.hypot.js"); -require("core-js/modules/es.object.define-getter"); +require("core-js/modules/es.object.define-getter.js"); -require("core-js/modules/es.object.define-setter"); +require("core-js/modules/es.object.define-setter.js"); -require("core-js/modules/es.object.from-entries"); +require("core-js/modules/es.object.from-entries.js"); -require("core-js/modules/es.object.lookup-getter"); +require("core-js/modules/es.object.lookup-getter.js"); -require("core-js/modules/es.object.lookup-setter"); +require("core-js/modules/es.object.lookup-setter.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.promise.finally"); +require("core-js/modules/es.promise.finally.js"); -require("core-js/modules/es.string.pad-end"); +require("core-js/modules/es.string.pad-end.js"); -require("core-js/modules/es.string.pad-start"); +require("core-js/modules/es.string.pad-start.js"); -require("core-js/modules/es.string.replace"); +require("core-js/modules/es.string.replace.js"); -require("core-js/modules/es.string.trim"); +require("core-js/modules/es.string.trim.js"); -require("core-js/modules/es.string.trim-end"); +require("core-js/modules/es.string.trim-end.js"); -require("core-js/modules/es.string.trim-start"); +require("core-js/modules/es.string.trim-start.js"); -require("core-js/modules/web.dom-collections.for-each"); +require("core-js/modules/web.dom-collections.for-each.js"); -require("core-js/modules/web.dom-collections.iterator"); +require("core-js/modules/web.dom-collections.iterator.js"); -require("core-js/modules/web.immediate"); +require("core-js/modules/web.immediate.js"); -require("core-js/modules/web.queue-microtask"); +require("core-js/modules/web.queue-microtask.js"); -require("core-js/modules/web.url"); +require("core-js/modules/web.url.js"); -require("core-js/modules/web.url.to-json"); +require("core-js/modules/web.url.to-json.js"); -require("core-js/modules/web.url-search-params"); +require("core-js/modules/web.url-search-params.js"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs index 521c32b6f351..d22766766ad8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/web.immediate"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/web.immediate.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs index e99fb491804b..2f14f6361ac9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs index 212123a9631a..0b2a038c3a50 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs @@ -1,209 +1,209 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.every"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.for-each"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.is-array"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.reduce"; -import "core-js/modules/es.array.reduce-right"; -import "core-js/modules/es.array.reverse"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.some"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.array-buffer.is-view"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.data-view"; -import "core-js/modules/es.date.now"; -import "core-js/modules/es.date.to-iso-string"; -import "core-js/modules/es.date.to-json"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.date.to-string"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.number.to-precision"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.create"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-properties"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.parse-float"; -import "core-js/modules/es.parse-int"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs index cb63c2cc360c..77197ebfec0b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs index 170d86bd7cae..b407fe959bad 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs @@ -1,32 +1,32 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs index 93f856aa51c3..280e0c0cefca 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs @@ -1,208 +1,208 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.symbol.has-instance"; -import "core-js/modules/es.symbol.is-concat-spreadable"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.symbol.replace"; -import "core-js/modules/es.symbol.search"; -import "core-js/modules/es.symbol.species"; -import "core-js/modules/es.symbol.split"; -import "core-js/modules/es.symbol.to-primitive"; -import "core-js/modules/es.symbol.to-string-tag"; -import "core-js/modules/es.symbol.unscopables"; -import "core-js/modules/es.array.concat"; -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.every"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.for-each"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.index-of"; -import "core-js/modules/es.array.is-array"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.join"; -import "core-js/modules/es.array.last-index-of"; -import "core-js/modules/es.array.map"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.array.reduce"; -import "core-js/modules/es.array.reduce-right"; -import "core-js/modules/es.array.reverse"; -import "core-js/modules/es.array.slice"; -import "core-js/modules/es.array.some"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.species"; -import "core-js/modules/es.array.splice"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.array-buffer.constructor"; -import "core-js/modules/es.array-buffer.is-view"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.data-view"; -import "core-js/modules/es.date.now"; -import "core-js/modules/es.date.to-iso-string"; -import "core-js/modules/es.date.to-json"; -import "core-js/modules/es.date.to-primitive"; -import "core-js/modules/es.date.to-string"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.function.has-instance"; -import "core-js/modules/es.function.name"; -import "core-js/modules/es.json.to-string-tag"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.acosh"; -import "core-js/modules/es.math.asinh"; -import "core-js/modules/es.math.atanh"; -import "core-js/modules/es.math.cbrt"; -import "core-js/modules/es.math.clz32"; -import "core-js/modules/es.math.cosh"; -import "core-js/modules/es.math.expm1"; -import "core-js/modules/es.math.fround"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.math.imul"; -import "core-js/modules/es.math.log10"; -import "core-js/modules/es.math.log1p"; -import "core-js/modules/es.math.log2"; -import "core-js/modules/es.math.sign"; -import "core-js/modules/es.math.sinh"; -import "core-js/modules/es.math.tanh"; -import "core-js/modules/es.math.to-string-tag"; -import "core-js/modules/es.math.trunc"; -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.epsilon"; -import "core-js/modules/es.number.is-finite"; -import "core-js/modules/es.number.is-integer"; -import "core-js/modules/es.number.is-nan"; -import "core-js/modules/es.number.is-safe-integer"; -import "core-js/modules/es.number.max-safe-integer"; -import "core-js/modules/es.number.min-safe-integer"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; -import "core-js/modules/es.number.to-fixed"; -import "core-js/modules/es.number.to-precision"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.create"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-properties"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.freeze"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.get-own-property-descriptor"; -import "core-js/modules/es.object.get-own-property-descriptors"; -import "core-js/modules/es.object.get-own-property-names"; -import "core-js/modules/es.object.get-prototype-of"; -import "core-js/modules/es.object.is"; -import "core-js/modules/es.object.is-extensible"; -import "core-js/modules/es.object.is-frozen"; -import "core-js/modules/es.object.is-sealed"; -import "core-js/modules/es.object.keys"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.object.prevent-extensions"; -import "core-js/modules/es.object.seal"; -import "core-js/modules/es.object.set-prototype-of"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.object.values"; -import "core-js/modules/es.parse-float"; -import "core-js/modules/es.parse-int"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.reflect.apply"; -import "core-js/modules/es.reflect.construct"; -import "core-js/modules/es.reflect.define-property"; -import "core-js/modules/es.reflect.delete-property"; -import "core-js/modules/es.reflect.get"; -import "core-js/modules/es.reflect.get-own-property-descriptor"; -import "core-js/modules/es.reflect.get-prototype-of"; -import "core-js/modules/es.reflect.has"; -import "core-js/modules/es.reflect.is-extensible"; -import "core-js/modules/es.reflect.own-keys"; -import "core-js/modules/es.reflect.prevent-extensions"; -import "core-js/modules/es.reflect.set"; -import "core-js/modules/es.reflect.set-prototype-of"; -import "core-js/modules/es.regexp.constructor"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.from-code-point"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.raw"; -import "core-js/modules/es.string.repeat"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/es.string.anchor"; -import "core-js/modules/es.string.big"; -import "core-js/modules/es.string.blink"; -import "core-js/modules/es.string.bold"; -import "core-js/modules/es.string.fixed"; -import "core-js/modules/es.string.fontcolor"; -import "core-js/modules/es.string.fontsize"; -import "core-js/modules/es.string.italics"; -import "core-js/modules/es.string.link"; -import "core-js/modules/es.string.small"; -import "core-js/modules/es.string.strike"; -import "core-js/modules/es.string.sub"; -import "core-js/modules/es.string.sup"; -import "core-js/modules/es.typed-array.float32-array"; -import "core-js/modules/es.typed-array.float64-array"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.int16-array"; -import "core-js/modules/es.typed-array.int32-array"; -import "core-js/modules/es.typed-array.uint8-array"; -import "core-js/modules/es.typed-array.uint8-clamped-array"; -import "core-js/modules/es.typed-array.uint16-array"; -import "core-js/modules/es.typed-array.uint32-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.from"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; -import "core-js/modules/es.weak-map"; -import "core-js/modules/es.weak-set"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.timers"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.symbol.has-instance.js"; +import "core-js/modules/es.symbol.is-concat-spreadable.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.symbol.replace.js"; +import "core-js/modules/es.symbol.search.js"; +import "core-js/modules/es.symbol.species.js"; +import "core-js/modules/es.symbol.split.js"; +import "core-js/modules/es.symbol.to-primitive.js"; +import "core-js/modules/es.symbol.to-string-tag.js"; +import "core-js/modules/es.symbol.unscopables.js"; +import "core-js/modules/es.array.concat.js"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.every.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.index-of.js"; +import "core-js/modules/es.array.is-array.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.join.js"; +import "core-js/modules/es.array.last-index-of.js"; +import "core-js/modules/es.array.map.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.array.reduce.js"; +import "core-js/modules/es.array.reduce-right.js"; +import "core-js/modules/es.array.reverse.js"; +import "core-js/modules/es.array.slice.js"; +import "core-js/modules/es.array.some.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.species.js"; +import "core-js/modules/es.array.splice.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.array-buffer.constructor.js"; +import "core-js/modules/es.array-buffer.is-view.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.data-view.js"; +import "core-js/modules/es.date.now.js"; +import "core-js/modules/es.date.to-iso-string.js"; +import "core-js/modules/es.date.to-json.js"; +import "core-js/modules/es.date.to-primitive.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.function.has-instance.js"; +import "core-js/modules/es.function.name.js"; +import "core-js/modules/es.json.to-string-tag.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.acosh.js"; +import "core-js/modules/es.math.asinh.js"; +import "core-js/modules/es.math.atanh.js"; +import "core-js/modules/es.math.cbrt.js"; +import "core-js/modules/es.math.clz32.js"; +import "core-js/modules/es.math.cosh.js"; +import "core-js/modules/es.math.expm1.js"; +import "core-js/modules/es.math.fround.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.math.imul.js"; +import "core-js/modules/es.math.log10.js"; +import "core-js/modules/es.math.log1p.js"; +import "core-js/modules/es.math.log2.js"; +import "core-js/modules/es.math.sign.js"; +import "core-js/modules/es.math.sinh.js"; +import "core-js/modules/es.math.tanh.js"; +import "core-js/modules/es.math.to-string-tag.js"; +import "core-js/modules/es.math.trunc.js"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.epsilon.js"; +import "core-js/modules/es.number.is-finite.js"; +import "core-js/modules/es.number.is-integer.js"; +import "core-js/modules/es.number.is-nan.js"; +import "core-js/modules/es.number.is-safe-integer.js"; +import "core-js/modules/es.number.max-safe-integer.js"; +import "core-js/modules/es.number.min-safe-integer.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.to-fixed.js"; +import "core-js/modules/es.number.to-precision.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.create.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-properties.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.freeze.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.get-own-property-descriptor.js"; +import "core-js/modules/es.object.get-own-property-descriptors.js"; +import "core-js/modules/es.object.get-own-property-names.js"; +import "core-js/modules/es.object.get-prototype-of.js"; +import "core-js/modules/es.object.is.js"; +import "core-js/modules/es.object.is-extensible.js"; +import "core-js/modules/es.object.is-frozen.js"; +import "core-js/modules/es.object.is-sealed.js"; +import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.object.prevent-extensions.js"; +import "core-js/modules/es.object.seal.js"; +import "core-js/modules/es.object.set-prototype-of.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.parse-float.js"; +import "core-js/modules/es.parse-int.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.reflect.apply.js"; +import "core-js/modules/es.reflect.construct.js"; +import "core-js/modules/es.reflect.define-property.js"; +import "core-js/modules/es.reflect.delete-property.js"; +import "core-js/modules/es.reflect.get.js"; +import "core-js/modules/es.reflect.get-own-property-descriptor.js"; +import "core-js/modules/es.reflect.get-prototype-of.js"; +import "core-js/modules/es.reflect.has.js"; +import "core-js/modules/es.reflect.is-extensible.js"; +import "core-js/modules/es.reflect.own-keys.js"; +import "core-js/modules/es.reflect.prevent-extensions.js"; +import "core-js/modules/es.reflect.set.js"; +import "core-js/modules/es.reflect.set-prototype-of.js"; +import "core-js/modules/es.regexp.constructor.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.from-code-point.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.raw.js"; +import "core-js/modules/es.string.repeat.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/es.string.anchor.js"; +import "core-js/modules/es.string.big.js"; +import "core-js/modules/es.string.blink.js"; +import "core-js/modules/es.string.bold.js"; +import "core-js/modules/es.string.fixed.js"; +import "core-js/modules/es.string.fontcolor.js"; +import "core-js/modules/es.string.fontsize.js"; +import "core-js/modules/es.string.italics.js"; +import "core-js/modules/es.string.link.js"; +import "core-js/modules/es.string.small.js"; +import "core-js/modules/es.string.strike.js"; +import "core-js/modules/es.string.sub.js"; +import "core-js/modules/es.string.sup.js"; +import "core-js/modules/es.typed-array.float32-array.js"; +import "core-js/modules/es.typed-array.float64-array.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.int16-array.js"; +import "core-js/modules/es.typed-array.int32-array.js"; +import "core-js/modules/es.typed-array.uint8-array.js"; +import "core-js/modules/es.typed-array.uint8-clamped-array.js"; +import "core-js/modules/es.typed-array.uint16-array.js"; +import "core-js/modules/es.typed-array.uint32-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.from.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.weak-map.js"; +import "core-js/modules/es.weak-set.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.timers.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs index 8f37a64f243e..19acbcd9864b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs index acdf857cf0e3..3fcb19e0e634 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs @@ -1,31 +1,31 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; import 'regenerator-runtime/runtime'; var a = 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs index 49a4b1893150..8448c0e3d5a1 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs @@ -1,31 +1,31 @@ -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.async-iterator"; -import "core-js/modules/es.array.flat"; -import "core-js/modules/es.array.flat-map"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.sort"; -import "core-js/modules/es.array.unscopables.flat"; -import "core-js/modules/es.array.unscopables.flat-map"; -import "core-js/modules/es.map"; -import "core-js/modules/es.math.hypot"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.define-setter"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.lookup-getter"; -import "core-js/modules/es.object.lookup-setter"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/es.string.trim-end"; -import "core-js/modules/es.string.trim-start"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.queue-microtask"; -import "core-js/modules/web.url"; -import "core-js/modules/web.url.to-json"; -import "core-js/modules/web.url-search-params"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.async-iterator.js"; +import "core-js/modules/es.array.flat.js"; +import "core-js/modules/es.array.flat-map.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.sort.js"; +import "core-js/modules/es.array.unscopables.flat.js"; +import "core-js/modules/es.array.unscopables.flat-map.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.math.hypot.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.define-setter.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.lookup-getter.js"; +import "core-js/modules/es.object.lookup-setter.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/es.string.trim-end.js"; +import "core-js/modules/es.string.trim-start.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/web.url.js"; +import "core-js/modules/web.url.to-json.js"; +import "core-js/modules/web.url-search-params.js"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs index bf51809e7297..38f7fe27928b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.symbol.observable.js"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs index 699c00e7ae82..a3b599fbe61b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs @@ -1,33 +1,33 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.map"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/esnext.global-this"; -import "core-js/modules/esnext.map.delete-all"; -import "core-js/modules/esnext.map.every"; -import "core-js/modules/esnext.map.filter"; -import "core-js/modules/esnext.map.find"; -import "core-js/modules/esnext.map.find-key"; -import "core-js/modules/esnext.map.includes"; -import "core-js/modules/esnext.map.key-of"; -import "core-js/modules/esnext.map.map-keys"; -import "core-js/modules/esnext.map.map-values"; -import "core-js/modules/esnext.map.merge"; -import "core-js/modules/esnext.map.reduce"; -import "core-js/modules/esnext.map.some"; -import "core-js/modules/esnext.map.update"; -import "core-js/modules/esnext.observable"; -import "core-js/modules/esnext.symbol.observable"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.queue-microtask"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/esnext.global-this.js"; +import "core-js/modules/esnext.map.delete-all.js"; +import "core-js/modules/esnext.map.every.js"; +import "core-js/modules/esnext.map.filter.js"; +import "core-js/modules/esnext.map.find.js"; +import "core-js/modules/esnext.map.find-key.js"; +import "core-js/modules/esnext.map.includes.js"; +import "core-js/modules/esnext.map.key-of.js"; +import "core-js/modules/esnext.map.map-keys.js"; +import "core-js/modules/esnext.map.map-values.js"; +import "core-js/modules/esnext.map.merge.js"; +import "core-js/modules/esnext.map.reduce.js"; +import "core-js/modules/esnext.map.some.js"; +import "core-js/modules/esnext.map.update.js"; +import "core-js/modules/esnext.observable.js"; +import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs index 320fcf8662c5..793df090786d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.symbol.match"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.map"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.match"; -import "core-js/modules/web.dom-collections.iterator"; -import "core-js/modules/web.queue-microtask"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.symbol.match.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.match.js"; +import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/web.queue-microtask.js"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs index e73421da0ea4..38658887bc1d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var a = new Map(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs index 008dade84785..a409508fd7d3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.set"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.set.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var Set = window.Set; var Map = something.Map; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs index 19ec5a3bda5b..d30f753148f2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; [a, b] = c; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs index 07b47aee452a..d6ea420672f0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; try { a(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs index 13575cf7d08e..e9fa6896c10d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; for (var [a, b] in c) { ; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs index 096af6abc7d1..05e5c56169a8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.from"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; !function (foo, { entries: entries }) {}({}, Object); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs index e2100787e008..ae45a17279c2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; function a(_ref) { var [b, c] = _ref; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs index c995f912ab42..0651a494f89a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var [a, b] = c; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs index a748b6c1d722..3bcf00646f83 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.object.define-getter"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.flags"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.replace"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.object.define-getter.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.flags.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.replace.js"; var a = []; a.values(); ''.replace(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs index 03c0a1be1e86..01c8e26378b2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; var foo = import('foo'); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs index 0237af3f76ea..4383703ff9c4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var objectClass = Object; var arrayInstance = []; var assignStr = "assign"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs index 854101328ea4..0eee4eb0e4d1 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.includes.js"; var arrayInstance = []; var inclidesStr = "includes"; var findStr = "find"; // Allow instance methods be assigned to variables. diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs index 6637fedce2be..d004a9f40a38 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; var foo = fetch('foo'); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs index 2769d6c95b21..8f6d528ca3e0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; for (const { padStart diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs index b8da08e913ef..a1b3d7980532 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; for (var a of b) { ; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs index 6c58b94f862a..9c9182420e87 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.from-entries"; -import "core-js/modules/es.object.values"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.values.js"; 'entries' in Object; 'includes' in [1, 2, 3]; 'va' + 'lues' in Object; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs index be008261d43e..0c859c26ad61 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs @@ -1,25 +1,25 @@ -import "core-js/modules/es.array.copy-within"; -import "core-js/modules/es.array.fill"; -import "core-js/modules/es.array.find"; -import "core-js/modules/es.array.find-index"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.includes"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.map"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.string.code-point-at"; -import "core-js/modules/es.string.ends-with"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.pad-end"; -import "core-js/modules/es.string.pad-start"; -import "core-js/modules/es.string.replace"; -import "core-js/modules/es.string.search"; -import "core-js/modules/es.string.split"; -import "core-js/modules/es.string.starts-with"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.copy-within.js"; +import "core-js/modules/es.array.fill.js"; +import "core-js/modules/es.array.find.js"; +import "core-js/modules/es.array.find-index.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.map.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.string.code-point-at.js"; +import "core-js/modules/es.string.ends-with.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.pad-end.js"; +import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.string.search.js"; +import "core-js/modules/es.string.split.js"; +import "core-js/modules/es.string.starts-with.js"; +import "core-js/modules/web.dom-collections.iterator.js"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js index b86b98172305..d8afc08612b0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js @@ -1,7 +1,7 @@ "use strict"; -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); Promise; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs index e43b0499157a..9356b7e4979c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.number.constructor"; -import "core-js/modules/es.number.parse-float"; -import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.constructor.js"; +import "core-js/modules/es.number.parse-float.js"; +import "core-js/modules/es.number.parse-int.js"; Number.parseFloat("3.14"); Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs index d220e642b57a..cbf26aa16703 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/es.array.filter"; -import "core-js/modules/es.array.for-each"; -import "core-js/modules/es.array.from"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array.of"; -import "core-js/modules/es.date.to-string"; -import "core-js/modules/es.function.bind"; -import "core-js/modules/es.object.entries"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.regexp.exec"; -import "core-js/modules/es.regexp.to-string"; -import "core-js/modules/es.string.includes"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/es.string.trim"; -import "core-js/modules/web.dom-collections.for-each"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.filter.js"; +import "core-js/modules/es.array.for-each.js"; +import "core-js/modules/es.array.from.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array.of.js"; +import "core-js/modules/es.date.to-string.js"; +import "core-js/modules/es.function.bind.js"; +import "core-js/modules/es.object.entries.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.regexp.exec.js"; +import "core-js/modules/es.regexp.to-string.js"; +import "core-js/modules/es.string.includes.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.string.trim.js"; +import "core-js/modules/web.dom-collections.for-each.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var bind, toString; var { bind: bind diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs index a645ea5c4549..0498cf0db797 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var p = Promise.resolve(0); Promise.all([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs index d0d487d3454d..5860eb9aecfa 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise.finally.js"; var p = Promise.resolve(0); p.finally(function () { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs index f818ab24bbfc..e9eeee0d740e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; var p = Promise.resolve(0); Promise.race([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs index 9e343bd1dfaf..20a7a28e19ce 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.js"; async function a() {} 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 03624378656f..5a7ce6455fa7 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 @@ -1,6 +1,6 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "regenerator-runtime/runtime"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "regenerator-runtime/runtime.js"; function a() { return regeneratorRuntime.async(function a$(_context) { diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs index ce5acd262e9f..571c3d9e614a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs @@ -1,4 +1,4 @@ -import "regenerator-runtime/runtime"; +import "regenerator-runtime/runtime.js"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js index c8fb626d57dd..40d6f0bbbab9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js @@ -1,34 +1,34 @@ "use strict"; -require("core-js/modules/es.symbol"); +require("core-js/modules/es.symbol.js"); -require("core-js/modules/es.symbol.description"); +require("core-js/modules/es.symbol.description.js"); -require("core-js/modules/es.symbol.iterator"); +require("core-js/modules/es.symbol.iterator.js"); -require("core-js/modules/es.symbol.match"); +require("core-js/modules/es.symbol.match.js"); -require("core-js/modules/es.array.from"); +require("core-js/modules/es.array.from.js"); -require("core-js/modules/es.array.iterator"); +require("core-js/modules/es.array.iterator.js"); -require("core-js/modules/es.map"); +require("core-js/modules/es.map.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); -require("core-js/modules/es.regexp.exec"); +require("core-js/modules/es.regexp.exec.js"); -require("core-js/modules/es.string.iterator"); +require("core-js/modules/es.string.iterator.js"); -require("core-js/modules/es.string.match"); +require("core-js/modules/es.string.match.js"); -require("core-js/modules/web.dom-collections.iterator"); +require("core-js/modules/web.dom-collections.iterator.js"); -require("core-js/modules/web.queue-microtask"); +require("core-js/modules/web.queue-microtask.js"); -require("core-js/modules/esnext.global-this"); +require("core-js/modules/esnext.global-this.js"); Array.from; // static method diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js index b089b3d0a5f3..f066f71e5a77 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es.array.includes"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js index b089b3d0a5f3..f066f71e5a77 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es.array.includes"); +require("core-js/modules/es.array.includes.js"); -require("core-js/modules/es.object.to-string"); +require("core-js/modules/es.object.to-string.js"); -require("core-js/modules/es.promise"); +require("core-js/modules/es.promise.js"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs index a7a87ab7066d..f8123ece74b9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; a = [b, ...c]; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs index ffd45f77578e..81c0f641f16d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.object.assign"; -import "core-js/modules/es.object.define-property"; -import "core-js/modules/es.object.keys"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.object.assign.js"; +import "core-js/modules/es.object.define-property.js"; +import "core-js/modules/es.object.keys.js"; Object.keys(foo); var getOwnPropertySymbols = Object.getOwnPropertySymbols; var { diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs index 6260f4e1fa77..d2a01e9dfca1 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; Symbol.iterator in arr; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs index 01d8ee8fb522..54df03710ee9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol"; -import "core-js/modules/es.symbol.description"; -import "core-js/modules/es.symbol.iterator"; -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.string.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.symbol.js"; +import "core-js/modules/es.symbol.description.js"; +import "core-js/modules/es.symbol.iterator.js"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; arr[Symbol.iterator](); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs index dc5557373e12..74bba776a922 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.promise"; -import "core-js/modules/web.immediate"; -import "core-js/modules/web.timers"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.promise.js"; +import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.timers.js"; Promise.resolve().then(function (it) { setTimeout(foo, 1, 2); setInterval(foo, 1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs index f2fbbbe4b600..aedb1b6a809e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs index 469c6467c34a..33f6402de643 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs @@ -1,29 +1,29 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.of"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.of.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; Int8Array.of(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs index dcce776d0823..037147d591d8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs @@ -1,28 +1,28 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/es.array-buffer.slice"; -import "core-js/modules/es.object.to-string"; -import "core-js/modules/es.typed-array.int8-array"; -import "core-js/modules/es.typed-array.copy-within"; -import "core-js/modules/es.typed-array.every"; -import "core-js/modules/es.typed-array.fill"; -import "core-js/modules/es.typed-array.filter"; -import "core-js/modules/es.typed-array.find"; -import "core-js/modules/es.typed-array.find-index"; -import "core-js/modules/es.typed-array.for-each"; -import "core-js/modules/es.typed-array.includes"; -import "core-js/modules/es.typed-array.index-of"; -import "core-js/modules/es.typed-array.iterator"; -import "core-js/modules/es.typed-array.join"; -import "core-js/modules/es.typed-array.last-index-of"; -import "core-js/modules/es.typed-array.map"; -import "core-js/modules/es.typed-array.reduce"; -import "core-js/modules/es.typed-array.reduce-right"; -import "core-js/modules/es.typed-array.reverse"; -import "core-js/modules/es.typed-array.set"; -import "core-js/modules/es.typed-array.slice"; -import "core-js/modules/es.typed-array.some"; -import "core-js/modules/es.typed-array.sort"; -import "core-js/modules/es.typed-array.subarray"; -import "core-js/modules/es.typed-array.to-locale-string"; -import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/es.array-buffer.slice.js"; +import "core-js/modules/es.object.to-string.js"; +import "core-js/modules/es.typed-array.int8-array.js"; +import "core-js/modules/es.typed-array.copy-within.js"; +import "core-js/modules/es.typed-array.every.js"; +import "core-js/modules/es.typed-array.fill.js"; +import "core-js/modules/es.typed-array.filter.js"; +import "core-js/modules/es.typed-array.find.js"; +import "core-js/modules/es.typed-array.find-index.js"; +import "core-js/modules/es.typed-array.for-each.js"; +import "core-js/modules/es.typed-array.includes.js"; +import "core-js/modules/es.typed-array.index-of.js"; +import "core-js/modules/es.typed-array.iterator.js"; +import "core-js/modules/es.typed-array.join.js"; +import "core-js/modules/es.typed-array.last-index-of.js"; +import "core-js/modules/es.typed-array.map.js"; +import "core-js/modules/es.typed-array.reduce.js"; +import "core-js/modules/es.typed-array.reduce-right.js"; +import "core-js/modules/es.typed-array.reverse.js"; +import "core-js/modules/es.typed-array.set.js"; +import "core-js/modules/es.typed-array.slice.js"; +import "core-js/modules/es.typed-array.some.js"; +import "core-js/modules/es.typed-array.sort.js"; +import "core-js/modules/es.typed-array.subarray.js"; +import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.typed-array.to-string.js"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs index be5b5a63a311..923ee6b8b9ac 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.iterator"; -import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/es.array.iterator.js"; +import "core-js/modules/web.dom-collections.iterator.js"; function* a() { yield* 1; diff --git a/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js b/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js index 9f20ecdbd956..0495898ba8f3 100644 --- a/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js +++ b/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js @@ -1,5 +1,5 @@ -import _Array$from from "../../core-js/array/from"; -import _isIterable from "../../core-js/is-iterable"; +import _Array$from from "../../core-js/array/from.js"; +import _isIterable from "../../core-js/is-iterable.js"; export default function _iterableToArray(iter) { if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); } \ No newline at end of file diff --git a/packages/babel-runtime-corejs2/helpers/iterableToArray.js b/packages/babel-runtime-corejs2/helpers/iterableToArray.js index c7834a312257..0e58c478e900 100644 --- a/packages/babel-runtime-corejs2/helpers/iterableToArray.js +++ b/packages/babel-runtime-corejs2/helpers/iterableToArray.js @@ -1,6 +1,6 @@ -var _Array$from = require("../core-js/array/from"); +var _Array$from = require("../core-js/array/from.js"); -var _isIterable = require("../core-js/is-iterable"); +var _isIterable = require("../core-js/is-iterable.js"); function _iterableToArray(iter) { if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); From d04508e510abc624b3e423ff334eff47f297502a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 6 Dec 2019 14:12:41 +0100 Subject: [PATCH 849/965] v7.7.5 --- lerna.json | 2 +- packages/babel-cli/package.json | 4 ++-- packages/babel-core/package.json | 6 +++--- .../babel-helper-module-transforms/package.json | 2 +- .../package.json | 4 ++-- packages/babel-parser/package.json | 2 +- .../package.json | 4 ++-- .../package.json | 6 +++--- .../package.json | 6 +++--- .../package.json | 4 ++-- .../babel-plugin-transform-runtime/package.json | 8 ++++---- packages/babel-preset-env-standalone/package.json | 6 +++--- packages/babel-preset-env/package.json | 12 ++++++------ packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 14 +++++++------- 17 files changed, 43 insertions(+), 43 deletions(-) diff --git a/lerna.json b/lerna.json index 8c6c32dbf7a8..829afaf6c3ce 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.4", + "version": "7.7.5", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index ee759a3e0c89..10da6ba7e9f2 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.7.4", + "version": "7.7.5", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -35,7 +35,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-fixtures": "^7.6.3" }, "bin": { diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 657862ad476b..37f4247175cb 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.7.4", + "version": "7.7.5", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -42,7 +42,7 @@ "@babel/code-frame": "^7.5.5", "@babel/generator": "^7.7.4", "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.4", + "@babel/parser": "^7.7.5", "@babel/template": "^7.7.4", "@babel/traverse": "^7.7.4", "@babel/types": "^7.7.4", @@ -55,6 +55,6 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.7.4" + "@babel/helper-transform-fixture-test-runner": "^7.7.5" } } diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index daf59cd11646..8ec8978cc149 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-transforms", - "version": "7.7.4", + "version": "7.7.5", "description": "Babel helper functions for implementing ES6 module transformations", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index d02bdfcd1a58..51522ee32c70 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.7.4", + "version": "7.7.5", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "main": "lib/index.js", "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-fixtures": "^7.6.3", "@babel/polyfill": "^7.6.0", "babel-check-duplicated-nodes": "^1.0.0", diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 11d26d0e1ca1..2907032f3a44 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.4", + "version": "7.7.5", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index 474055ae10a9..43da0deec0db 100644 --- a/packages/babel-plugin-proposal-optional-chaining/package.json +++ b/packages/babel-plugin-proposal-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-chaining", - "version": "7.7.4", + "version": "7.7.5", "description": "Transform optional chaining operators into a series of nil checks", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-transform-block-scoping": "^7.7.4" } diff --git a/packages/babel-plugin-transform-modules-amd/package.json b/packages/babel-plugin-transform-modules-amd/package.json index d13bf03757e8..e0ceb66bcb5e 100644 --- a/packages/babel-plugin-transform-modules-amd/package.json +++ b/packages/babel-plugin-transform-modules-amd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-amd", - "version": "7.7.4", + "version": "7.7.5", "description": "This plugin transforms ES2015 modules to AMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.4", + "@babel/helper-module-transforms": "^7.7.5", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index b691678b523d..4b9ae9bff564 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.7.4", + "version": "7.7.5", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", @@ -9,7 +9,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.4", + "@babel/helper-module-transforms": "^7.7.5", "@babel/helper-plugin-utils": "^7.0.0", "@babel/helper-simple-access": "^7.7.4", "babel-plugin-dynamic-import-node": "^2.3.0" @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-syntax-object-rest-spread": "^7.7.4" } diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index 4d77c3ad8ecb..b1d2ff187eae 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -2,7 +2,7 @@ "name": "@babel/plugin-transform-regenerator", "author": "Ben Newman ", "description": "Explode async and generator functions into a state machine.", - "version": "7.7.4", + "version": "7.7.5", "homepage": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "main": "lib/index.js", @@ -17,7 +17,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 2c7415ae94ad..d271ead782b7 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.7.4", + "version": "7.7.5", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -21,12 +21,12 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/helpers": "^7.7.4", "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/preset-env": "^7.7.4", - "@babel/runtime": "^7.7.4", + "@babel/preset-env": "^7.7.5", + "@babel/runtime": "^7.7.5", "@babel/template": "^7.7.4", "@babel/types": "^7.7.4" } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index af9a02f5a8ab..d23a587aa605 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.4", + "version": "7.7.5", "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -18,8 +18,8 @@ "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/preset-env": "^7.7.4", - "@babel/standalone": "^7.7.4", + "@babel/preset-env": "^7.7.5", + "@babel/standalone": "^7.7.5", "lodash": "^4.17.13" }, "keywords": [ diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 6e43b2fff2ea..414637eb6167 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.4", + "version": "7.7.5", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -42,8 +42,8 @@ "@babel/plugin-transform-function-name": "^7.7.4", "@babel/plugin-transform-literals": "^7.7.4", "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.4", - "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.5", + "@babel/plugin-transform-modules-commonjs": "^7.7.5", "@babel/plugin-transform-modules-systemjs": "^7.7.4", "@babel/plugin-transform-modules-umd": "^7.7.4", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", @@ -51,7 +51,7 @@ "@babel/plugin-transform-object-super": "^7.7.4", "@babel/plugin-transform-parameters": "^7.7.4", "@babel/plugin-transform-property-literals": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.5", "@babel/plugin-transform-reserved-words": "^7.7.4", "@babel/plugin-transform-shorthand-properties": "^7.7.4", "@babel/plugin-transform-spread": "^7.7.4", @@ -70,8 +70,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.7.4", - "@babel/core": "^7.7.4", + "@babel/cli": "^7.7.5", + "@babel/core": "^7.7.5", "@babel/helper-fixtures": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 0d0e4a256a03..cd74fca34b45 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.4", + "version": "7.7.5", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 49ed281e9e51..f99f10fba9a7 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.4", + "version": "7.7.5", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index e89764fa589d..e3c22b8cb825 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.4", + "version": "7.7.5", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 05dffa672968..5fa017758ade 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.4", + "version": "7.7.5", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -12,7 +12,7 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.5", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.7.4", "@babel/plugin-proposal-async-generator-functions": "^7.7.4", @@ -29,7 +29,7 @@ "@babel/plugin-proposal-numeric-separator": "^7.7.4", "@babel/plugin-proposal-object-rest-spread": "^7.7.4", "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-optional-chaining": "^7.7.4", + "@babel/plugin-proposal-optional-chaining": "^7.7.5", "@babel/plugin-proposal-pipeline-operator": "^7.7.4", "@babel/plugin-proposal-private-methods": "^7.7.4", "@babel/plugin-proposal-throw-expressions": "^7.7.4", @@ -68,8 +68,8 @@ "@babel/plugin-transform-jscript": "^7.7.4", "@babel/plugin-transform-literals": "^7.7.4", "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.4", - "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/plugin-transform-modules-amd": "^7.7.5", + "@babel/plugin-transform-modules-commonjs": "^7.7.5", "@babel/plugin-transform-modules-systemjs": "^7.7.4", "@babel/plugin-transform-modules-umd": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", @@ -87,9 +87,9 @@ "@babel/plugin-transform-react-jsx-compat": "^7.7.4", "@babel/plugin-transform-react-jsx-self": "^7.7.4", "@babel/plugin-transform-react-jsx-source": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.4", + "@babel/plugin-transform-regenerator": "^7.7.5", "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-runtime": "^7.7.4", + "@babel/plugin-transform-runtime": "^7.7.5", "@babel/plugin-transform-shorthand-properties": "^7.7.4", "@babel/plugin-transform-spread": "^7.7.4", "@babel/plugin-transform-sticky-regex": "^7.7.4", From 8a8474c321e358ffbdc5d8d9cef443a8526cf7b4 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Fri, 6 Dec 2019 13:15:23 +0000 Subject: [PATCH 850/965] Add v7.7.5 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 088d87f0363a..1fd31fe3736d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,35 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.7.5 (2019-12-06) + +#### :bug: Bug Fix +* `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-regenerator`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2` + * [#10549](https://github.com/babel/babel/pull/10549) Add ".js" extension to injected polyfill imports ([@shimataro](https://github.com/shimataro)) +* `babel-cli` + * [#10283](https://github.com/babel/babel/pull/10283) `babel --watch` should have equivalent file selection logic with `babel` ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10801](https://github.com/babel/babel/pull/10801) Use scope flags to check arguments ([@JLHwung](https://github.com/JLHwung)) + * [#10800](https://github.com/babel/babel/pull/10800) Allow tuple rest trailing comma ([@yeonjuan](https://github.com/yeonjuan)) + * [#10475](https://github.com/babel/babel/pull/10475) Correctly disambiguate / after async fuctions ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-parser`, `babel-plugin-proposal-optional-chaining`, `babel-plugin-transform-modules-amd` + * [#10806](https://github.com/babel/babel/pull/10806) fix(optional chaining): Optional delete returns true with nullish base ([@mpaarating](https://github.com/mpaarating)) +* `babel-helper-module-transforms`, `babel-plugin-transform-modules-amd` + * [#10764](https://github.com/babel/babel/pull/10764) fix: rewriteBindingInitVisitor should skip on scopable node ([@JLHwung](https://github.com/JLHwung)) + +#### :nail_care: Polish +* `babel-plugin-transform-runtime` + * [#10788](https://github.com/babel/babel/pull/10788) Do not transpile typeof helper with itself in babel/runtime ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core` + * [#10778](https://github.com/babel/babel/pull/10778) refactor: Improve error message in @babel/core ([@jaroslav-kubicek](https://github.com/jaroslav-kubicek)) + +#### :house: Internal +* `babel-preset-env-standalone` + * [#10779](https://github.com/babel/babel/pull/10779) Bundle standalone using rollup ([@JLHwung](https://github.com/JLHwung)) +* Other + * [#10781](https://github.com/babel/babel/pull/10781) Tune makefile scripts ([@JLHwung](https://github.com/JLHwung)) +* `babel-helper-transform-fixture-test-runner` + * [#10566](https://github.com/babel/babel/pull/10566) Incorrect trace position in fixture runner ([@JLHwung](https://github.com/JLHwung)) ## v7.7.4 (2019-11-23) From 655a9727379bc59c9619621e413eb41835e5dc7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 7 Dec 2019 15:21:52 -0500 Subject: [PATCH 851/965] chore: add PR Revert labels to changelog (#10836) --- lerna.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 829afaf6c3ce..866f7611113a 100644 --- a/lerna.json +++ b/lerna.json @@ -11,7 +11,8 @@ "PR: Polish :nail_care:": ":nail_care: Polish", "PR: Docs :memo:": ":memo: Documentation", "PR: Internal :house:": ":house: Internal", - "PR: Performance :running_woman:": ":running_woman: Performance" + "PR: Performance :running_woman:": ":running_woman: Performance", + "PR: Revert :leftwards_arrow_with_hook:": ":leftwards_arrow_with_hook: Revert" } }, "command": { From 4436ffd604912df589f34a368d57ef5c89acc6fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 7 Dec 2019 17:05:35 -0500 Subject: [PATCH 852/965] Revert "Add ".js" extension to injected polyfill imports (#10549)" (#10835) This reverts commit d3a37b5d08074c007268eb15a11ae432165bad5d. --- .../interop-loose/imports-hoisting/output.js | 4 +- .../interop-loose/multi-load/output.js | 4 +- .../interop/imports-hoisting/output.js | 4 +- .../fixtures/interop/multi-load/output.js | 4 +- .../test/fixtures/regression/T7041/output.js | 2 +- .../src/index.js | 20 +- .../absoluteRuntime/relative/output.js | 2 +- .../fixtures/absoluteRuntime/true/output.js | 2 +- .../aliased-constructors/output.js | 6 +- .../runtime-corejs2/catch-all/output.js | 2 +- .../fixtures/runtime-corejs2/class/output.js | 2 +- .../runtime-corejs2/es6-for-of/output.js | 2 +- .../evaluated-static-methods/output.js | 4 +- .../fixtures/runtime-corejs2/full/output.mjs | 4 +- .../fixtures/runtime-corejs2/math/output.js | 34 +- .../runtime-corejs2/modules-helpers/output.js | 6 +- .../runtime-corejs2/modules/output.js | 6 +- .../regenerator-runtime/output.js | 2 +- .../symbol-iterator-in/output.js | 2 +- .../runtime-corejs2/symbol-iterator/output.js | 2 +- .../aliased-constructors/output.js | 6 +- .../built-in-globals-proposals/output.js | 40 +- .../built-in-globals/output.js | 30 +- .../output.js | 82 +-- .../built-in-instance-methods/output.js | 74 +-- .../output.js | 216 +++---- .../built-in-static-methods/output.js | 164 ++--- .../runtime-corejs3/catch-all/output.js | 2 +- .../fixtures/runtime-corejs3/class/output.js | 2 +- .../runtime-corejs3/es6-for-of/output.js | 2 +- .../evaluated-instance-methods/output.js | 4 +- .../evaluated-static-methods/output.js | 4 +- .../fixtures/runtime-corejs3/full/output.mjs | 4 +- .../runtime-corejs3/instance-call/output.js | 2 +- .../instance-computed/output.js | 2 +- .../runtime-corejs3/instance-get/output.js | 2 +- .../instance-inference-optimization/output.js | 2 +- .../runtime-corejs3/modules-helpers/output.js | 6 +- .../runtime-corejs3/modules-loose/output.js | 6 +- .../runtime-corejs3/modules/output.js | 8 +- .../regenerator-runtime/output.js | 2 +- .../symbol-iterator-get-method/output.js | 2 +- .../symbol-iterator-get/output.js | 2 +- .../symbol-iterator-in/output.js | 2 +- .../runtime-corejs3/symbol-iterator/output.js | 2 +- .../test/fixtures/runtime/class/output.js | 2 +- .../test/fixtures/runtime/full/output.mjs | 2 +- .../runtime/modules-helpers/output.js | 6 +- .../test/fixtures/runtime/modules/output.js | 2 +- .../runtime/regenerator-runtime/output.js | 2 +- .../corejs-useES6Modules/output.mjs | 8 +- .../fixtures/use-options/corejs/output.mjs | 8 +- .../useESModules-cjs-auto/output.js | 8 +- .../use-options/useESModules-cjs/output.js | 8 +- .../useESModules-mjs-auto/output.mjs | 8 +- .../use-options/useESModules-mjs/output.mjs | 8 +- packages/babel-preset-env/src/utils.js | 4 +- .../fixtures/corejs2/entry-all/output.mjs | 298 ++++----- .../corejs2/entry-chrome-48/output.mjs | 120 ++-- .../corejs2/entry-chrome-49/output.mjs | 90 +-- .../corejs2/entry-chrome-66/output.mjs | 8 +- .../corejs2/entry-chrome-71/output.mjs | 6 +- .../corejs2/entry-chromeandroid/output.mjs | 26 +- .../entry-core-js-main-require/output.mjs | 32 +- .../corejs2/entry-core-js-main/output.mjs | 32 +- .../corejs2/entry-electron/output.mjs | 40 +- .../fixtures/corejs2/entry-ie-11/output.mjs | 254 ++++---- .../fixtures/corejs2/entry-ie-9/output.mjs | 260 ++++---- .../fixtures/corejs2/entry-import/output.mjs | 32 +- .../corejs2/entry-node-10.13/output.mjs | 2 +- .../corejs2/entry-node-web/output.mjs | 34 +- .../fixtures/corejs2/entry-node/output.mjs | 28 +- .../fixtures/corejs2/entry-require/output.js | 32 +- .../corejs2/entry-shippedProposals/output.js | 298 ++++----- .../corejs2/exclude-built-ins/output.mjs | 4 +- .../corejs2/exclude-include/output.mjs | 34 +- .../corejs2/exclude-regenerator/output.mjs | 296 ++++----- .../corejs2/force-all-transforms/output.mjs | 34 +- .../corejs2/include-built-ins/output.mjs | 36 +- .../fixtures/corejs2/usage-all/output.mjs | 20 +- .../output.mjs | 2 +- .../usage-evaluated-class-methods/output.mjs | 8 +- .../output.mjs | 4 +- .../usage-evaluated-not-confident/output.mjs | 11 +- .../usage-for-of-destructure-with/output.mjs | 4 +- .../output.mjs | 2 +- .../corejs2/usage-instance-methods/output.mjs | 42 +- .../corejs2/usage-modules-transform/output.js | 4 +- .../corejs2/usage-native-support/output.mjs | 2 +- .../corejs2/usage-number-ie-11/output.mjs | 6 +- .../corejs2/usage-promise-all/output.mjs | 10 +- .../corejs2/usage-promise-finally/output.mjs | 6 +- .../corejs2/usage-promise-race/output.mjs | 10 +- .../usage-regenerator-used-async/output.mjs | 2 +- .../output.mjs | 2 +- .../corejs2/usage-shippedProposals/output.js | 28 +- .../usage-source-type-script-query/output.js | 6 +- .../usage-source-type-script/output.js | 6 +- .../usage-symbol-iterator-in/output.mjs | 6 +- .../corejs2/usage-symbol-iterator/output.mjs | 6 +- .../fixtures/corejs2/usage-timers/output.mjs | 4 +- .../usage-typed-array-static/output.mjs | 2 +- .../corejs2/usage-typed-array/output.mjs | 2 +- .../corejs2/usage-yield-star/output.mjs | 2 +- .../corejs3/entry-all-chrome-71/output.mjs | 172 +++--- .../fixtures/corejs3/entry-all/output.mjs | 580 +++++++++--------- .../corejs3/entry-chrome-48/output.mjs | 190 +++--- .../corejs3/entry-chrome-49/output.mjs | 152 ++--- .../corejs3/entry-chrome-66/output.mjs | 28 +- .../corejs3/entry-chrome-71/output.mjs | 10 +- .../corejs3/entry-chromeandroid/output.mjs | 50 +- .../corejs3/entry-electron/output.mjs | 58 +- .../output.mjs | 170 ++--- .../output.mjs | 570 ++++++++--------- .../output.mjs | 40 +- .../corejs3/entry-entries-features/output.mjs | 52 +- .../corejs3/entry-entries-missed/output.mjs | 36 +- .../entry-entries-mixed-chrome-71/output.mjs | 20 +- .../corejs3/entry-entries-mixed/output.mjs | 100 +-- .../output.mjs | 4 +- .../corejs3/entry-entries-modules/output.mjs | 6 +- .../output.mjs | 162 ++--- .../entry-entries-proposals/output.mjs | 170 ++--- .../entry-entries-stable-chrome-71/output.mjs | 2 +- .../corejs3/entry-entries-stable/output.mjs | 14 +- .../entry-entries-stage-chrome-71/output.mjs | 162 ++--- .../corejs3/entry-entries-stage/output.mjs | 170 ++--- .../entry-entries-web-chrome-71/output.mjs | 2 +- .../corejs3/entry-entries-web/output.mjs | 16 +- .../fixtures/corejs3/entry-ie-11/output.mjs | 360 +++++------ .../fixtures/corejs3/entry-ie-9/output.mjs | 372 +++++------ .../fixtures/corejs3/entry-import/output.mjs | 58 +- .../corejs3/entry-node-10.13/output.mjs | 16 +- .../fixtures/corejs3/entry-node-11/output.mjs | 10 +- .../corejs3/entry-node-web/output.mjs | 58 +- .../fixtures/corejs3/entry-node/output.mjs | 52 +- .../corejs3/entry-normalization/output.mjs | 20 +- .../corejs3/entry-require-all/output.js | 222 +++---- .../entry-require-es-chrome-71/output.js | 8 +- .../entry-require-es-proposals/output.js | 214 +++---- .../fixtures/corejs3/entry-require/output.js | 58 +- .../corejs3/entry-stable-chrome-71/output.mjs | 10 +- .../entry-stable-samsung-8.2/output.mjs | 38 +- .../fixtures/corejs3/entry-stable/output.mjs | 416 ++++++------- .../corejs3/exclude-built-ins/output.mjs | 34 +- .../corejs3/exclude-include/output.mjs | 58 +- .../corejs3/exclude-regenerator/output.mjs | 416 ++++++------- .../test/fixtures/corejs3/exclude/output.mjs | 4 +- .../corejs3/force-all-transforms/output.mjs | 58 +- .../corejs3/include-built-ins/output.mjs | 62 +- .../usage-all-proposals-chrome-71/output.mjs | 30 +- .../corejs3/usage-all-proposals/output.mjs | 60 +- .../fixtures/corejs3/usage-all/output.mjs | 28 +- .../output.mjs | 4 +- .../output.mjs | 10 +- .../usage-destructuring-assignment/output.mjs | 6 +- .../usage-destructuring-catch/output.mjs | 6 +- .../usage-destructuring-for-x/output.mjs | 6 +- .../usage-destructuring-iife/output.mjs | 8 +- .../usage-destructuring-params/output.mjs | 6 +- .../output.mjs | 6 +- .../output.mjs | 16 +- .../corejs3/usage-dynamic-import/output.mjs | 4 +- .../usage-evaluated-class-methods/output.mjs | 8 +- .../output.mjs | 4 +- .../fixtures/corejs3/usage-fetch/output.mjs | 4 +- .../usage-for-of-destructure-with/output.mjs | 6 +- .../fixtures/corejs3/usage-for-of/output.mjs | 6 +- .../test/fixtures/corejs3/usage-in/output.mjs | 10 +- .../corejs3/usage-instance-methods/output.mjs | 44 +- .../corejs3/usage-modules-transform/output.js | 4 +- .../corejs3/usage-number-ie-11/output.mjs | 6 +- .../usage-object-destructuring/output.mjs | 32 +- .../corejs3/usage-promise-all/output.mjs | 10 +- .../corejs3/usage-promise-finally/output.mjs | 6 +- .../corejs3/usage-promise-race/output.mjs | 10 +- .../output.mjs | 2 +- .../usage-regenerator-used-async/output.mjs | 6 +- .../output.mjs | 2 +- .../corejs3/usage-shippedProposals/output.js | 30 +- .../usage-source-type-script-query/output.js | 6 +- .../usage-source-type-script/output.js | 6 +- .../fixtures/corejs3/usage-spread/output.mjs | 6 +- .../corejs3/usage-static-methods/output.mjs | 8 +- .../usage-symbol-iterator-in/output.mjs | 14 +- .../corejs3/usage-symbol-iterator/output.mjs | 14 +- .../fixtures/corejs3/usage-timers/output.mjs | 8 +- .../usage-typed-array-edge-13/output.mjs | 10 +- .../usage-typed-array-static/output.mjs | 56 +- .../corejs3/usage-typed-array/output.mjs | 54 +- .../corejs3/usage-yield-star/output.mjs | 4 +- .../helpers/esm/iterableToArray.js | 4 +- .../helpers/iterableToArray.js | 4 +- 193 files changed, 4548 insertions(+), 4547 deletions(-) diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js index cb014def7c22..d17f42975dae 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-hoisting/output.js @@ -1,8 +1,8 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral.js")); +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); function _templateObject() { const data = (0, _taggedTemplateLiteral2.default)(["foo"]); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js index a14b440e0a15..fc02ffa1536e 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/output.js @@ -1,9 +1,9 @@ "use strict"; -var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault"); exports.__esModule = true; -var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault.js")); +var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault")); console.log(_interopRequireDefault2.default); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js index cb014def7c22..d17f42975dae 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-hoisting/output.js @@ -1,8 +1,8 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral.js")); +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); function _templateObject() { const data = (0, _taggedTemplateLiteral2.default)(["foo"]); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js index ef2c4d88034a..2e762d530630 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/output.js @@ -1,11 +1,11 @@ "use strict"; -var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault3 = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); -var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault.js")); +var _interopRequireDefault2 = _interopRequireDefault3(require("@babel/runtime/helpers/interopRequireDefault")); console.log(_interopRequireDefault2.default); diff --git a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js index 2ec4fecf3982..5c1627f53221 100644 --- a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js +++ b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/T7041/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime/regenerator/index.js"); +var _regeneratorRuntime = require("@babel/runtime/regenerator"); var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 532be2a590d4..a9d0fd350deb 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -234,7 +234,7 @@ export default declare((api, options, dirname) => { : "helpers"; return this.addDefaultImport( - `${modulePath}/${helpersDir}/${name}.js`, + `${modulePath}/${helpersDir}/${name}`, name, blockHoist, ); @@ -275,7 +275,7 @@ export default declare((api, options, dirname) => { if (name === "regeneratorRuntime" && useRuntimeRegenerator) { path.replaceWith( this.addDefaultImport( - `${modulePath}/regenerator/index.js`, + `${modulePath}/regenerator`, "regeneratorRuntime", ), ); @@ -291,7 +291,7 @@ export default declare((api, options, dirname) => { // transform global built-ins like `Symbol()`, `new Promise` path.replaceWith( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`, + `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`, name, ), ); @@ -332,7 +332,7 @@ export default declare((api, options, dirname) => { node.callee = t.memberExpression( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, `${propertyName}InstanceProperty`, ), [context2], @@ -354,7 +354,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${modulePath}/core-js/get-iterator.js`, + `${modulePath}/core-js/get-iterator`, "getIterator", ), [object], @@ -371,7 +371,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${modulePath}/core-js/is-iterable.js`, + `${modulePath}/core-js/is-iterable`, "isIterable", ), [path.node.right], @@ -399,7 +399,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${moduleName}/core-js/get-iterator-method.js`, + `${moduleName}/core-js/get-iterator-method`, "getIteratorMethod", ), [object], @@ -427,7 +427,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.callExpression( this.addDefaultImport( - `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}.js`, + `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`, `${propertyName}InstanceProperty`, ), [object], @@ -439,7 +439,7 @@ export default declare((api, options, dirname) => { path.replaceWith( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}.js`, + `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`, `${objectName}$${propertyName}`, ), ); @@ -460,7 +460,7 @@ export default declare((api, options, dirname) => { path.replaceWith( t.memberExpression( this.addDefaultImport( - `${modulePath}/${corejsRoot}/${BuiltIns[name].path}.js`, + `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`, name, ), node.property, diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js index b7cb3430b3fa..e783188c9e48 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck.js"); +var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js index b7cb3430b3fa..e783188c9e48 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/true/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck.js"); +var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js index d4a30ccb3aa2..4e753ff15d6f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/aliased-constructors/output.js @@ -1,8 +1,8 @@ -var _Map = require("@babel/runtime-corejs2/core-js/map.js"); +var _Map = require("@babel/runtime-corejs2/core-js/map"); -var _Symbol = require("@babel/runtime-corejs2/core-js/symbol.js"); +var _Symbol = require("@babel/runtime-corejs2/core-js/symbol"); -var _Promise = require("@babel/runtime-corejs2/core-js/promise.js"); +var _Promise = require("@babel/runtime-corejs2/core-js/promise"); obj.constructor === Object; obj.constructor === _Promise; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js index 95aa6157d958..de4a16bd915b 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/catch-all/output.js @@ -1,3 +1,3 @@ -var _Promise = require("@babel/runtime-corejs2/core-js/promise.js"); +var _Promise = require("@babel/runtime-corejs2/core-js/promise"); _Promise.resolve; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js index 4fc91217ed7b..132a249e9768 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime-corejs2/helpers/classCallCheck.js"); +var _classCallCheck = require("@babel/runtime-corejs2/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js index a8c4aef4dd5b..be11791731f3 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/es6-for-of/output.js @@ -1,4 +1,4 @@ -var _getIterator = require("@babel/runtime-corejs2/core-js/get-iterator.js"); +var _getIterator = require("@babel/runtime-corejs2/core-js/get-iterator"); var _iteratorNormalCompletion = true; var _didIteratorError = false; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js index 6320b2e7bdf7..59868c6f60d5 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/evaluated-static-methods/output.js @@ -1,6 +1,6 @@ -var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array.js"); +var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array"); -var _Array$from = require("@babel/runtime-corejs2/core-js/array/from.js"); +var _Array$from = require("@babel/runtime-corejs2/core-js/array/from"); var _isArray = "isArray"; _Array$from; // polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs index 8c57291c45ec..841a99d5778e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/full/output.mjs @@ -1,5 +1,5 @@ -import _regeneratorRuntime from "@babel/runtime-corejs2/regenerator/index.js"; -import _Symbol from "@babel/runtime-corejs2/core-js/symbol.js"; +import _regeneratorRuntime from "@babel/runtime-corejs2/regenerator"; +import _Symbol from "@babel/runtime-corejs2/core-js/symbol"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js index d1109bc0c1d5..7b773a5ec2fe 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/math/output.js @@ -1,36 +1,36 @@ -var _Math$trunc = require("@babel/runtime-corejs2/core-js/math/trunc.js"); +var _Math$trunc = require("@babel/runtime-corejs2/core-js/math/trunc"); -var _Math$tanh = require("@babel/runtime-corejs2/core-js/math/tanh.js"); +var _Math$tanh = require("@babel/runtime-corejs2/core-js/math/tanh"); -var _Math$sinh = require("@babel/runtime-corejs2/core-js/math/sinh.js"); +var _Math$sinh = require("@babel/runtime-corejs2/core-js/math/sinh"); -var _Math$sign = require("@babel/runtime-corejs2/core-js/math/sign.js"); +var _Math$sign = require("@babel/runtime-corejs2/core-js/math/sign"); -var _Math$log2 = require("@babel/runtime-corejs2/core-js/math/log2.js"); +var _Math$log2 = require("@babel/runtime-corejs2/core-js/math/log2"); -var _Math$log1p = require("@babel/runtime-corejs2/core-js/math/log1p.js"); +var _Math$log1p = require("@babel/runtime-corejs2/core-js/math/log1p"); -var _Math$log = require("@babel/runtime-corejs2/core-js/math/log10.js"); +var _Math$log = require("@babel/runtime-corejs2/core-js/math/log10"); -var _Math$imul = require("@babel/runtime-corejs2/core-js/math/imul.js"); +var _Math$imul = require("@babel/runtime-corejs2/core-js/math/imul"); -var _Math$hypot = require("@babel/runtime-corejs2/core-js/math/hypot.js"); +var _Math$hypot = require("@babel/runtime-corejs2/core-js/math/hypot"); -var _Math$fround = require("@babel/runtime-corejs2/core-js/math/fround.js"); +var _Math$fround = require("@babel/runtime-corejs2/core-js/math/fround"); -var _Math$expm = require("@babel/runtime-corejs2/core-js/math/expm1.js"); +var _Math$expm = require("@babel/runtime-corejs2/core-js/math/expm1"); -var _Math$cosh = require("@babel/runtime-corejs2/core-js/math/cosh.js"); +var _Math$cosh = require("@babel/runtime-corejs2/core-js/math/cosh"); -var _Math$clz = require("@babel/runtime-corejs2/core-js/math/clz32.js"); +var _Math$clz = require("@babel/runtime-corejs2/core-js/math/clz32"); -var _Math$cbrt = require("@babel/runtime-corejs2/core-js/math/cbrt.js"); +var _Math$cbrt = require("@babel/runtime-corejs2/core-js/math/cbrt"); -var _Math$atanh = require("@babel/runtime-corejs2/core-js/math/atanh.js"); +var _Math$atanh = require("@babel/runtime-corejs2/core-js/math/atanh"); -var _Math$asinh = require("@babel/runtime-corejs2/core-js/math/asinh.js"); +var _Math$asinh = require("@babel/runtime-corejs2/core-js/math/asinh"); -var _Math$acosh = require("@babel/runtime-corejs2/core-js/math/acosh.js"); +var _Math$acosh = require("@babel/runtime-corejs2/core-js/math/acosh"); _Math$acosh; _Math$asinh; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js index 045066bf2dc5..8b91c079a609 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck.js")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass.js")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js index 79ad15d13c20..c3eab7f58ed2 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/modules/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault"); -var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys.js"); +var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys"); -var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property.js"); +var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js index 0e5d6a2644d4..852c24b9c4a3 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime-corejs2/regenerator/index.js"); +var _regeneratorRuntime = require("@babel/runtime-corejs2/regenerator"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js index 0f508eedc462..8d5e3c048d4f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator-in/output.js @@ -1,3 +1,3 @@ -var _isIterable = require("@babel/runtime-corejs2/core-js/is-iterable.js"); +var _isIterable = require("@babel/runtime-corejs2/core-js/is-iterable"); _isIterable(Object(arr)); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js index f890976ca4f7..dc708b45cc42 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs2/symbol-iterator/output.js @@ -1,3 +1,3 @@ -var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator.js"); +var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator"); _Symbol$iterator; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js index 4cfad5710a13..45bcce8ebc04 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/aliased-constructors/output.js @@ -1,8 +1,8 @@ -var _Map = require("@babel/runtime-corejs3/core-js-stable/map.js"); +var _Map = require("@babel/runtime-corejs3/core-js-stable/map"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); obj.constructor === Object; obj.constructor === _Promise; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js index 96fc2c806283..90766b4cd4be 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals-proposals/output.js @@ -1,42 +1,42 @@ -var _setTimeout = require("@babel/runtime-corejs3/core-js/set-timeout.js"); +var _setTimeout = require("@babel/runtime-corejs3/core-js/set-timeout"); -var _setInterval = require("@babel/runtime-corejs3/core-js/set-interval.js"); +var _setInterval = require("@babel/runtime-corejs3/core-js/set-interval"); -var _setImmediate = require("@babel/runtime-corejs3/core-js/set-immediate.js"); +var _setImmediate = require("@babel/runtime-corejs3/core-js/set-immediate"); -var _queueMicrotask = require("@babel/runtime-corejs3/core-js/queue-microtask.js"); +var _queueMicrotask = require("@babel/runtime-corejs3/core-js/queue-microtask"); -var _parseInt = require("@babel/runtime-corejs3/core-js/parse-int.js"); +var _parseInt = require("@babel/runtime-corejs3/core-js/parse-int"); -var _parseFloat = require("@babel/runtime-corejs3/core-js/parse-float.js"); +var _parseFloat = require("@babel/runtime-corejs3/core-js/parse-float"); -var _globalThis = require("@babel/runtime-corejs3/core-js/global-this.js"); +var _globalThis = require("@babel/runtime-corejs3/core-js/global-this"); -var _compositeSymbol = require("@babel/runtime-corejs3/core-js/composite-symbol.js"); +var _compositeSymbol = require("@babel/runtime-corejs3/core-js/composite-symbol"); -var _compositeKey = require("@babel/runtime-corejs3/core-js/composite-key.js"); +var _compositeKey = require("@babel/runtime-corejs3/core-js/composite-key"); -var _clearImmediate = require("@babel/runtime-corejs3/core-js/clear-immediate.js"); +var _clearImmediate = require("@babel/runtime-corejs3/core-js/clear-immediate"); -var _WeakSet = require("@babel/runtime-corejs3/core-js/weak-set.js"); +var _WeakSet = require("@babel/runtime-corejs3/core-js/weak-set"); -var _WeakMap = require("@babel/runtime-corejs3/core-js/weak-map.js"); +var _WeakMap = require("@babel/runtime-corejs3/core-js/weak-map"); -var _URLSearchParams = require("@babel/runtime-corejs3/core-js/url-search-params.js"); +var _URLSearchParams = require("@babel/runtime-corejs3/core-js/url-search-params"); -var _URL = require("@babel/runtime-corejs3/core-js/url.js"); +var _URL = require("@babel/runtime-corejs3/core-js/url"); -var _Symbol = require("@babel/runtime-corejs3/core-js/symbol.js"); +var _Symbol = require("@babel/runtime-corejs3/core-js/symbol"); -var _Set = require("@babel/runtime-corejs3/core-js/set.js"); +var _Set = require("@babel/runtime-corejs3/core-js/set"); -var _Promise = require("@babel/runtime-corejs3/core-js/promise.js"); +var _Promise = require("@babel/runtime-corejs3/core-js/promise"); -var _Observable = require("@babel/runtime-corejs3/core-js/observable.js"); +var _Observable = require("@babel/runtime-corejs3/core-js/observable"); -var _Map = require("@babel/runtime-corejs3/core-js/map.js"); +var _Map = require("@babel/runtime-corejs3/core-js/map"); -var _AggregateError = require("@babel/runtime-corejs3/core-js/aggregate-error.js"); +var _AggregateError = require("@babel/runtime-corejs3/core-js/aggregate-error"); _AggregateError; _Map; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js index c5d70a81c941..dc1abb21353d 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-globals/output.js @@ -1,32 +1,32 @@ -var _setTimeout = require("@babel/runtime-corejs3/core-js-stable/set-timeout.js"); +var _setTimeout = require("@babel/runtime-corejs3/core-js-stable/set-timeout"); -var _setInterval = require("@babel/runtime-corejs3/core-js-stable/set-interval.js"); +var _setInterval = require("@babel/runtime-corejs3/core-js-stable/set-interval"); -var _setImmediate = require("@babel/runtime-corejs3/core-js-stable/set-immediate.js"); +var _setImmediate = require("@babel/runtime-corejs3/core-js-stable/set-immediate"); -var _queueMicrotask = require("@babel/runtime-corejs3/core-js-stable/queue-microtask.js"); +var _queueMicrotask = require("@babel/runtime-corejs3/core-js-stable/queue-microtask"); -var _parseInt = require("@babel/runtime-corejs3/core-js-stable/parse-int.js"); +var _parseInt = require("@babel/runtime-corejs3/core-js-stable/parse-int"); -var _parseFloat = require("@babel/runtime-corejs3/core-js-stable/parse-float.js"); +var _parseFloat = require("@babel/runtime-corejs3/core-js-stable/parse-float"); -var _clearImmediate = require("@babel/runtime-corejs3/core-js-stable/clear-immediate.js"); +var _clearImmediate = require("@babel/runtime-corejs3/core-js-stable/clear-immediate"); -var _WeakSet = require("@babel/runtime-corejs3/core-js-stable/weak-set.js"); +var _WeakSet = require("@babel/runtime-corejs3/core-js-stable/weak-set"); -var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map.js"); +var _WeakMap = require("@babel/runtime-corejs3/core-js-stable/weak-map"); -var _URLSearchParams = require("@babel/runtime-corejs3/core-js-stable/url-search-params.js"); +var _URLSearchParams = require("@babel/runtime-corejs3/core-js-stable/url-search-params"); -var _URL = require("@babel/runtime-corejs3/core-js-stable/url.js"); +var _URL = require("@babel/runtime-corejs3/core-js-stable/url"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); -var _Set = require("@babel/runtime-corejs3/core-js-stable/set.js"); +var _Set = require("@babel/runtime-corejs3/core-js-stable/set"); -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); -var _Map = require("@babel/runtime-corejs3/core-js-stable/map.js"); +var _Map = require("@babel/runtime-corejs3/core-js-stable/map"); AggregateError; _Map; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js index 348f038fbccc..3b89460c5163 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods-proposals/output.js @@ -1,84 +1,84 @@ -var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/values.js"); +var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/values"); -var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-start.js"); +var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-start"); -var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-right.js"); +var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-right"); -var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-left.js"); +var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-left"); -var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-end.js"); +var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim-end"); -var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim.js"); +var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/trim"); -var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/starts-with.js"); +var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/starts-with"); -var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/splice.js"); +var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/splice"); -var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/sort.js"); +var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/sort"); -var _someInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/some.js"); +var _someInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/some"); -var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/slice.js"); +var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/slice"); -var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reverse.js"); +var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reverse"); -var _replaceAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/replace-all.js"); +var _replaceAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/replace-all"); -var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/repeat.js"); +var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/repeat"); -var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce-right.js"); +var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce-right"); -var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce.js"); +var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/reduce"); -var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-start.js"); +var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-start"); -var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-end.js"); +var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/pad-end"); -var _matchAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/match-all.js"); +var _matchAllInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/match-all"); -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map.js"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map"); -var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/last-index-of.js"); +var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/last-index-of"); -var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/keys.js"); +var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/keys"); -var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/index-of.js"); +var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/index-of"); -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/includes.js"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/includes"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/for-each.js"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/for-each"); -var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat.js"); +var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat"); -var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat-map.js"); +var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flat-map"); -var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flags.js"); +var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/flags"); -var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find-index.js"); +var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find-index"); -var _findInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find.js"); +var _findInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/find"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter.js"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter"); -var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/fill.js"); +var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/fill"); -var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/every.js"); +var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/every"); -var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/entries.js"); +var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/entries"); -var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/ends-with.js"); +var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/ends-with"); -var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/copy-within.js"); +var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/copy-within"); -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/concat.js"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/concat"); -var _codePointsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-points.js"); +var _codePointsInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-points"); -var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-point-at.js"); +var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/code-point-at"); -var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/bind.js"); +var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/bind"); -var _atInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/at.js"); +var _atInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/at"); _atInstanceProperty(object); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js index 092fa1a2da35..8afcf571496b 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-instance-methods/output.js @@ -1,76 +1,76 @@ -var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/values.js"); +var _valuesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/values"); -var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-start.js"); +var _trimStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-start"); -var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-right.js"); +var _trimRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-right"); -var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-left.js"); +var _trimLeftInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-left"); -var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-end.js"); +var _trimEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim-end"); -var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim.js"); +var _trimInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/trim"); -var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/starts-with.js"); +var _startsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"); -var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/splice.js"); +var _spliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/splice"); -var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort.js"); +var _sortInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/sort"); -var _someInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/some.js"); +var _someInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/some"); -var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice.js"); +var _sliceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/slice"); -var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse.js"); +var _reverseInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reverse"); -var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/repeat.js"); +var _repeatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/repeat"); -var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce-right.js"); +var _reduceRightInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce-right"); -var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce.js"); +var _reduceInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/reduce"); -var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-start.js"); +var _padStartInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-start"); -var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-end.js"); +var _padEndInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/pad-end"); -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map.js"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/map"); -var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/last-index-of.js"); +var _lastIndexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/last-index-of"); -var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/keys.js"); +var _keysInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/keys"); -var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/index-of.js"); +var _indexOfInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/index-of"); -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); -var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat.js"); +var _flatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat"); -var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map.js"); +var _flatMapInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flat-map"); -var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flags.js"); +var _flagsInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/flags"); -var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find-index.js"); +var _findIndexInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find-index"); -var _findInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find.js"); +var _findInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/find"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter.js"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter"); -var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/fill.js"); +var _fillInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/fill"); -var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/every.js"); +var _everyInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/every"); -var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/entries.js"); +var _entriesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/entries"); -var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/ends-with.js"); +var _endsWithInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/ends-with"); -var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/copy-within.js"); +var _copyWithinInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/copy-within"); -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat.js"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat"); -var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/code-point-at.js"); +var _codePointAtInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/code-point-at"); -var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/bind.js"); +var _bindInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/bind"); object.at; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js index bfac78e8d194..179e6e640ee4 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods-proposals/output.js @@ -1,218 +1,218 @@ -var _Symbol = require("@babel/runtime-corejs3/core-js/symbol.js"); +var _Symbol = require("@babel/runtime-corejs3/core-js/symbol"); -var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js/symbol/unscopables.js"); +var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js/symbol/unscopables"); -var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js/symbol/to-string-tag.js"); +var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js/symbol/to-string-tag"); -var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js/symbol/to-primitive.js"); +var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js/symbol/to-primitive"); -var _Symbol$split = require("@babel/runtime-corejs3/core-js/symbol/split.js"); +var _Symbol$split = require("@babel/runtime-corejs3/core-js/symbol/split"); -var _Symbol$species = require("@babel/runtime-corejs3/core-js/symbol/species.js"); +var _Symbol$species = require("@babel/runtime-corejs3/core-js/symbol/species"); -var _Symbol$search = require("@babel/runtime-corejs3/core-js/symbol/search.js"); +var _Symbol$search = require("@babel/runtime-corejs3/core-js/symbol/search"); -var _Symbol$replace = require("@babel/runtime-corejs3/core-js/symbol/replace.js"); +var _Symbol$replace = require("@babel/runtime-corejs3/core-js/symbol/replace"); -var _Symbol$patternMatch = require("@babel/runtime-corejs3/core-js/symbol/pattern-match.js"); +var _Symbol$patternMatch = require("@babel/runtime-corejs3/core-js/symbol/pattern-match"); -var _Symbol$observable = require("@babel/runtime-corejs3/core-js/symbol/observable.js"); +var _Symbol$observable = require("@babel/runtime-corejs3/core-js/symbol/observable"); -var _Symbol$match = require("@babel/runtime-corejs3/core-js/symbol/match.js"); +var _Symbol$match = require("@babel/runtime-corejs3/core-js/symbol/match"); -var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js/symbol/key-for.js"); +var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js/symbol/key-for"); -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js/symbol/iterator.js"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js/symbol/iterator"); -var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js/symbol/is-concat-spreadable.js"); +var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js/symbol/is-concat-spreadable"); -var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js/symbol/has-instance.js"); +var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js/symbol/has-instance"); -var _Symbol$for = require("@babel/runtime-corejs3/core-js/symbol/for.js"); +var _Symbol$for = require("@babel/runtime-corejs3/core-js/symbol/for"); -var _Symbol$dispose = require("@babel/runtime-corejs3/core-js/symbol/dispose.js"); +var _Symbol$dispose = require("@babel/runtime-corejs3/core-js/symbol/dispose"); -var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js/symbol/async-iterator.js"); +var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js/symbol/async-iterator"); -var _String$raw = require("@babel/runtime-corejs3/core-js/string/raw.js"); +var _String$raw = require("@babel/runtime-corejs3/core-js/string/raw"); -var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js/string/from-code-point.js"); +var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js/string/from-code-point"); -var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/set-prototype-of.js"); +var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/set-prototype-of"); -var _Reflect$set = require("@babel/runtime-corejs3/core-js/reflect/set.js"); +var _Reflect$set = require("@babel/runtime-corejs3/core-js/reflect/set"); -var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js/reflect/prevent-extensions.js"); +var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js/reflect/prevent-extensions"); -var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js/reflect/own-keys.js"); +var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js/reflect/own-keys"); -var _Reflect$metadata = require("@babel/runtime-corejs3/core-js/reflect/metadata.js"); +var _Reflect$metadata = require("@babel/runtime-corejs3/core-js/reflect/metadata"); -var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js/reflect/is-extensible.js"); +var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js/reflect/is-extensible"); -var _Reflect$hasOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-own-metadata.js"); +var _Reflect$hasOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-own-metadata"); -var _Reflect$hasMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-metadata.js"); +var _Reflect$hasMetadata = require("@babel/runtime-corejs3/core-js/reflect/has-metadata"); -var _Reflect$has = require("@babel/runtime-corejs3/core-js/reflect/has.js"); +var _Reflect$has = require("@babel/runtime-corejs3/core-js/reflect/has"); -var _Reflect$get = require("@babel/runtime-corejs3/core-js/reflect/get.js"); +var _Reflect$get = require("@babel/runtime-corejs3/core-js/reflect/get"); -var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/get-prototype-of.js"); +var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js/reflect/get-prototype-of"); -var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/reflect/get-own-property-descriptor.js"); +var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/reflect/get-own-property-descriptor"); -var _Reflect$getOwnMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata-keys.js"); +var _Reflect$getOwnMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata-keys"); -var _Reflect$getOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata.js"); +var _Reflect$getOwnMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-own-metadata"); -var _Reflect$getMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-metadata-keys.js"); +var _Reflect$getMetadataKeys = require("@babel/runtime-corejs3/core-js/reflect/get-metadata-keys"); -var _Reflect$getMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-metadata.js"); +var _Reflect$getMetadata = require("@babel/runtime-corejs3/core-js/reflect/get-metadata"); -var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js/reflect/delete-property.js"); +var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js/reflect/delete-property"); -var _Reflect$deleteMetadata = require("@babel/runtime-corejs3/core-js/reflect/delete-metadata.js"); +var _Reflect$deleteMetadata = require("@babel/runtime-corejs3/core-js/reflect/delete-metadata"); -var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js/reflect/define-property.js"); +var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js/reflect/define-property"); -var _Reflect$defineMetadata = require("@babel/runtime-corejs3/core-js/reflect/define-metadata.js"); +var _Reflect$defineMetadata = require("@babel/runtime-corejs3/core-js/reflect/define-metadata"); -var _Reflect$construct = require("@babel/runtime-corejs3/core-js/reflect/construct.js"); +var _Reflect$construct = require("@babel/runtime-corejs3/core-js/reflect/construct"); -var _Reflect$apply = require("@babel/runtime-corejs3/core-js/reflect/apply.js"); +var _Reflect$apply = require("@babel/runtime-corejs3/core-js/reflect/apply"); -var _Object$values = require("@babel/runtime-corejs3/core-js/object/values.js"); +var _Object$values = require("@babel/runtime-corejs3/core-js/object/values"); -var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js/object/set-prototype-of.js"); +var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js/object/set-prototype-of"); -var _Object$seal = require("@babel/runtime-corejs3/core-js/object/seal.js"); +var _Object$seal = require("@babel/runtime-corejs3/core-js/object/seal"); -var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js/object/prevent-extensions.js"); +var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js/object/prevent-extensions"); -var _Object$keys = require("@babel/runtime-corejs3/core-js/object/keys.js"); +var _Object$keys = require("@babel/runtime-corejs3/core-js/object/keys"); -var _Object$is = require("@babel/runtime-corejs3/core-js/object/is.js"); +var _Object$is = require("@babel/runtime-corejs3/core-js/object/is"); -var _Object$isSealed = require("@babel/runtime-corejs3/core-js/object/is-sealed.js"); +var _Object$isSealed = require("@babel/runtime-corejs3/core-js/object/is-sealed"); -var _Object$isFrozen = require("@babel/runtime-corejs3/core-js/object/is-frozen.js"); +var _Object$isFrozen = require("@babel/runtime-corejs3/core-js/object/is-frozen"); -var _Object$isExtensible = require("@babel/runtime-corejs3/core-js/object/is-extensible.js"); +var _Object$isExtensible = require("@babel/runtime-corejs3/core-js/object/is-extensible"); -var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js/object/get-prototype-of.js"); +var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js/object/get-prototype-of"); -var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols.js"); +var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js/object/get-own-property-symbols"); -var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js/object/get-own-property-names.js"); +var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js/object/get-own-property-names"); -var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptors.js"); +var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptors"); -var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor.js"); +var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js/object/get-own-property-descriptor"); -var _Object$fromEntries = require("@babel/runtime-corejs3/core-js/object/from-entries.js"); +var _Object$fromEntries = require("@babel/runtime-corejs3/core-js/object/from-entries"); -var _Object$freeze = require("@babel/runtime-corejs3/core-js/object/freeze.js"); +var _Object$freeze = require("@babel/runtime-corejs3/core-js/object/freeze"); -var _Object$entries = require("@babel/runtime-corejs3/core-js/object/entries.js"); +var _Object$entries = require("@babel/runtime-corejs3/core-js/object/entries"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property.js"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property"); -var _Object$defineProperties = require("@babel/runtime-corejs3/core-js/object/define-properties.js"); +var _Object$defineProperties = require("@babel/runtime-corejs3/core-js/object/define-properties"); -var _Object$create = require("@babel/runtime-corejs3/core-js/object/create.js"); +var _Object$create = require("@babel/runtime-corejs3/core-js/object/create"); -var _Object$assign = require("@babel/runtime-corejs3/core-js/object/assign.js"); +var _Object$assign = require("@babel/runtime-corejs3/core-js/object/assign"); -var _Number$parseInt = require("@babel/runtime-corejs3/core-js/number/parse-int.js"); +var _Number$parseInt = require("@babel/runtime-corejs3/core-js/number/parse-int"); -var _Number$parseFloat = require("@babel/runtime-corejs3/core-js/number/parse-float.js"); +var _Number$parseFloat = require("@babel/runtime-corejs3/core-js/number/parse-float"); -var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js/number/is-safe-integer.js"); +var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js/number/is-safe-integer"); -var _Number$isNaN = require("@babel/runtime-corejs3/core-js/number/is-nan.js"); +var _Number$isNaN = require("@babel/runtime-corejs3/core-js/number/is-nan"); -var _Number$isInteger = require("@babel/runtime-corejs3/core-js/number/is-integer.js"); +var _Number$isInteger = require("@babel/runtime-corejs3/core-js/number/is-integer"); -var _Number$isFinite = require("@babel/runtime-corejs3/core-js/number/is-finite.js"); +var _Number$isFinite = require("@babel/runtime-corejs3/core-js/number/is-finite"); -var _Number$fromString = require("@babel/runtime-corejs3/core-js/number/from-string.js"); +var _Number$fromString = require("@babel/runtime-corejs3/core-js/number/from-string"); -var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/min-safe-integer.js"); +var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/min-safe-integer"); -var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/max-safe-integer.js"); +var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js/number/max-safe-integer"); -var _Number$EPSILON = require("@babel/runtime-corejs3/core-js/number/epsilon.js"); +var _Number$EPSILON = require("@babel/runtime-corejs3/core-js/number/epsilon"); -var _Math$umulh = require("@babel/runtime-corejs3/core-js/math/umulh.js"); +var _Math$umulh = require("@babel/runtime-corejs3/core-js/math/umulh"); -var _Math$trunc = require("@babel/runtime-corejs3/core-js/math/trunc.js"); +var _Math$trunc = require("@babel/runtime-corejs3/core-js/math/trunc"); -var _Math$tanh = require("@babel/runtime-corejs3/core-js/math/tanh.js"); +var _Math$tanh = require("@babel/runtime-corejs3/core-js/math/tanh"); -var _Math$sinh = require("@babel/runtime-corejs3/core-js/math/sinh.js"); +var _Math$sinh = require("@babel/runtime-corejs3/core-js/math/sinh"); -var _Math$signbit = require("@babel/runtime-corejs3/core-js/math/signbit.js"); +var _Math$signbit = require("@babel/runtime-corejs3/core-js/math/signbit"); -var _Math$sign = require("@babel/runtime-corejs3/core-js/math/sign.js"); +var _Math$sign = require("@babel/runtime-corejs3/core-js/math/sign"); -var _Math$seededPRNG = require("@babel/runtime-corejs3/core-js/math/seeded-prng.js"); +var _Math$seededPRNG = require("@babel/runtime-corejs3/core-js/math/seeded-prng"); -var _Math$scale = require("@babel/runtime-corejs3/core-js/math/scale.js"); +var _Math$scale = require("@babel/runtime-corejs3/core-js/math/scale"); -var _Math$radians = require("@babel/runtime-corejs3/core-js/math/radians.js"); +var _Math$radians = require("@babel/runtime-corejs3/core-js/math/radians"); -var _Math$log2 = require("@babel/runtime-corejs3/core-js/math/log2.js"); +var _Math$log2 = require("@babel/runtime-corejs3/core-js/math/log2"); -var _Math$log1p = require("@babel/runtime-corejs3/core-js/math/log1p.js"); +var _Math$log1p = require("@babel/runtime-corejs3/core-js/math/log1p"); -var _Math$log = require("@babel/runtime-corejs3/core-js/math/log10.js"); +var _Math$log = require("@babel/runtime-corejs3/core-js/math/log10"); -var _Math$isubh = require("@babel/runtime-corejs3/core-js/math/isubh.js"); +var _Math$isubh = require("@babel/runtime-corejs3/core-js/math/isubh"); -var _Math$imulh = require("@babel/runtime-corejs3/core-js/math/imulh.js"); +var _Math$imulh = require("@babel/runtime-corejs3/core-js/math/imulh"); -var _Math$imul = require("@babel/runtime-corejs3/core-js/math/imul.js"); +var _Math$imul = require("@babel/runtime-corejs3/core-js/math/imul"); -var _Math$iaddh = require("@babel/runtime-corejs3/core-js/math/iaddh.js"); +var _Math$iaddh = require("@babel/runtime-corejs3/core-js/math/iaddh"); -var _Math$hypot = require("@babel/runtime-corejs3/core-js/math/hypot.js"); +var _Math$hypot = require("@babel/runtime-corejs3/core-js/math/hypot"); -var _Math$fscale = require("@babel/runtime-corejs3/core-js/math/fscale.js"); +var _Math$fscale = require("@babel/runtime-corejs3/core-js/math/fscale"); -var _Math$fround = require("@babel/runtime-corejs3/core-js/math/fround.js"); +var _Math$fround = require("@babel/runtime-corejs3/core-js/math/fround"); -var _Math$expm = require("@babel/runtime-corejs3/core-js/math/expm1.js"); +var _Math$expm = require("@babel/runtime-corejs3/core-js/math/expm1"); -var _Math$degrees = require("@babel/runtime-corejs3/core-js/math/degrees.js"); +var _Math$degrees = require("@babel/runtime-corejs3/core-js/math/degrees"); -var _Math$cosh = require("@babel/runtime-corejs3/core-js/math/cosh.js"); +var _Math$cosh = require("@babel/runtime-corejs3/core-js/math/cosh"); -var _Math$clz = require("@babel/runtime-corejs3/core-js/math/clz32.js"); +var _Math$clz = require("@babel/runtime-corejs3/core-js/math/clz32"); -var _Math$clamp = require("@babel/runtime-corejs3/core-js/math/clamp.js"); +var _Math$clamp = require("@babel/runtime-corejs3/core-js/math/clamp"); -var _Math$cbrt = require("@babel/runtime-corejs3/core-js/math/cbrt.js"); +var _Math$cbrt = require("@babel/runtime-corejs3/core-js/math/cbrt"); -var _Math$atanh = require("@babel/runtime-corejs3/core-js/math/atanh.js"); +var _Math$atanh = require("@babel/runtime-corejs3/core-js/math/atanh"); -var _Math$asinh = require("@babel/runtime-corejs3/core-js/math/asinh.js"); +var _Math$asinh = require("@babel/runtime-corejs3/core-js/math/asinh"); -var _Math$acosh = require("@babel/runtime-corejs3/core-js/math/acosh.js"); +var _Math$acosh = require("@babel/runtime-corejs3/core-js/math/acosh"); -var _Math$RAD_PER_DEG = require("@babel/runtime-corejs3/core-js/math/rad-per-deg.js"); +var _Math$RAD_PER_DEG = require("@babel/runtime-corejs3/core-js/math/rad-per-deg"); -var _Math$DEG_PER_RAD = require("@babel/runtime-corejs3/core-js/math/deg-per-rad.js"); +var _Math$DEG_PER_RAD = require("@babel/runtime-corejs3/core-js/math/deg-per-rad"); -var _JSON$stringify = require("@babel/runtime-corejs3/core-js/json/stringify.js"); +var _JSON$stringify = require("@babel/runtime-corejs3/core-js/json/stringify"); -var _Date$now = require("@babel/runtime-corejs3/core-js/date/now.js"); +var _Date$now = require("@babel/runtime-corejs3/core-js/date/now"); -var _Array$of = require("@babel/runtime-corejs3/core-js/array/of.js"); +var _Array$of = require("@babel/runtime-corejs3/core-js/array/of"); -var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array.js"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array"); -var _Array$from = require("@babel/runtime-corejs3/core-js/array/from.js"); +var _Array$from = require("@babel/runtime-corejs3/core-js/array/from"); _Array$from; _Array$isArray; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js index 2f31d6ada5fa..28156f8a6e85 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/built-in-static-methods/output.js @@ -1,166 +1,166 @@ -var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js-stable/symbol/unscopables.js"); +var _Symbol$unscopables = require("@babel/runtime-corejs3/core-js-stable/symbol/unscopables"); -var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js-stable/symbol/to-string-tag.js"); +var _Symbol$toStringTag = require("@babel/runtime-corejs3/core-js-stable/symbol/to-string-tag"); -var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js-stable/symbol/to-primitive.js"); +var _Symbol$toPrimitive = require("@babel/runtime-corejs3/core-js-stable/symbol/to-primitive"); -var _Symbol$split = require("@babel/runtime-corejs3/core-js-stable/symbol/split.js"); +var _Symbol$split = require("@babel/runtime-corejs3/core-js-stable/symbol/split"); -var _Symbol$species = require("@babel/runtime-corejs3/core-js-stable/symbol/species.js"); +var _Symbol$species = require("@babel/runtime-corejs3/core-js-stable/symbol/species"); -var _Symbol$search = require("@babel/runtime-corejs3/core-js-stable/symbol/search.js"); +var _Symbol$search = require("@babel/runtime-corejs3/core-js-stable/symbol/search"); -var _Symbol$replace = require("@babel/runtime-corejs3/core-js-stable/symbol/replace.js"); +var _Symbol$replace = require("@babel/runtime-corejs3/core-js-stable/symbol/replace"); -var _Symbol$match = require("@babel/runtime-corejs3/core-js-stable/symbol/match.js"); +var _Symbol$match = require("@babel/runtime-corejs3/core-js-stable/symbol/match"); -var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js-stable/symbol/key-for.js"); +var _Symbol$keyFor = require("@babel/runtime-corejs3/core-js-stable/symbol/key-for"); -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator.js"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator"); -var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js-stable/symbol/is-concat-spreadable.js"); +var _Symbol$isConcatSpreadable = require("@babel/runtime-corejs3/core-js-stable/symbol/is-concat-spreadable"); -var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js-stable/symbol/has-instance.js"); +var _Symbol$hasInstance = require("@babel/runtime-corejs3/core-js-stable/symbol/has-instance"); -var _Symbol$for = require("@babel/runtime-corejs3/core-js-stable/symbol/for.js"); +var _Symbol$for = require("@babel/runtime-corejs3/core-js-stable/symbol/for"); -var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol.js"); +var _Symbol = require("@babel/runtime-corejs3/core-js-stable/symbol"); -var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js-stable/symbol/async-iterator.js"); +var _Symbol$asyncIterator = require("@babel/runtime-corejs3/core-js-stable/symbol/async-iterator"); -var _String$raw = require("@babel/runtime-corejs3/core-js-stable/string/raw.js"); +var _String$raw = require("@babel/runtime-corejs3/core-js-stable/string/raw"); -var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js-stable/string/from-code-point.js"); +var _String$fromCodePoint = require("@babel/runtime-corejs3/core-js-stable/string/from-code-point"); -var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/set-prototype-of.js"); +var _Reflect$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/set-prototype-of"); -var _Reflect$set = require("@babel/runtime-corejs3/core-js-stable/reflect/set.js"); +var _Reflect$set = require("@babel/runtime-corejs3/core-js-stable/reflect/set"); -var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/reflect/prevent-extensions.js"); +var _Reflect$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/reflect/prevent-extensions"); -var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js-stable/reflect/own-keys.js"); +var _Reflect$ownKeys = require("@babel/runtime-corejs3/core-js-stable/reflect/own-keys"); -var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js-stable/reflect/is-extensible.js"); +var _Reflect$isExtensible = require("@babel/runtime-corejs3/core-js-stable/reflect/is-extensible"); -var _Reflect$has = require("@babel/runtime-corejs3/core-js-stable/reflect/has.js"); +var _Reflect$has = require("@babel/runtime-corejs3/core-js-stable/reflect/has"); -var _Reflect$get = require("@babel/runtime-corejs3/core-js-stable/reflect/get.js"); +var _Reflect$get = require("@babel/runtime-corejs3/core-js-stable/reflect/get"); -var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/get-prototype-of.js"); +var _Reflect$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/reflect/get-prototype-of"); -var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/reflect/get-own-property-descriptor.js"); +var _Reflect$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/reflect/get-own-property-descriptor"); -var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/delete-property.js"); +var _Reflect$deleteProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/delete-property"); -var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/define-property.js"); +var _Reflect$defineProperty = require("@babel/runtime-corejs3/core-js-stable/reflect/define-property"); -var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct.js"); +var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct"); -var _Reflect$apply = require("@babel/runtime-corejs3/core-js-stable/reflect/apply.js"); +var _Reflect$apply = require("@babel/runtime-corejs3/core-js-stable/reflect/apply"); -var _Object$values = require("@babel/runtime-corejs3/core-js-stable/object/values.js"); +var _Object$values = require("@babel/runtime-corejs3/core-js-stable/object/values"); -var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of.js"); +var _Object$setPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/set-prototype-of"); -var _Object$seal = require("@babel/runtime-corejs3/core-js-stable/object/seal.js"); +var _Object$seal = require("@babel/runtime-corejs3/core-js-stable/object/seal"); -var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/object/prevent-extensions.js"); +var _Object$preventExtensions = require("@babel/runtime-corejs3/core-js-stable/object/prevent-extensions"); -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); -var _Object$is = require("@babel/runtime-corejs3/core-js-stable/object/is.js"); +var _Object$is = require("@babel/runtime-corejs3/core-js-stable/object/is"); -var _Object$isSealed = require("@babel/runtime-corejs3/core-js-stable/object/is-sealed.js"); +var _Object$isSealed = require("@babel/runtime-corejs3/core-js-stable/object/is-sealed"); -var _Object$isFrozen = require("@babel/runtime-corejs3/core-js-stable/object/is-frozen.js"); +var _Object$isFrozen = require("@babel/runtime-corejs3/core-js-stable/object/is-frozen"); -var _Object$isExtensible = require("@babel/runtime-corejs3/core-js-stable/object/is-extensible.js"); +var _Object$isExtensible = require("@babel/runtime-corejs3/core-js-stable/object/is-extensible"); -var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of.js"); +var _Object$getPrototypeOf = require("@babel/runtime-corejs3/core-js-stable/object/get-prototype-of"); -var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js"); +var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols"); -var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-names.js"); +var _Object$getOwnPropertyNames = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-names"); -var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js"); +var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors"); -var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js"); +var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor"); -var _Object$fromEntries = require("@babel/runtime-corejs3/core-js-stable/object/from-entries.js"); +var _Object$fromEntries = require("@babel/runtime-corejs3/core-js-stable/object/from-entries"); -var _Object$freeze = require("@babel/runtime-corejs3/core-js-stable/object/freeze.js"); +var _Object$freeze = require("@babel/runtime-corejs3/core-js-stable/object/freeze"); -var _Object$entries = require("@babel/runtime-corejs3/core-js-stable/object/entries.js"); +var _Object$entries = require("@babel/runtime-corejs3/core-js-stable/object/entries"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property.js"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); -var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties.js"); +var _Object$defineProperties = require("@babel/runtime-corejs3/core-js-stable/object/define-properties"); -var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create.js"); +var _Object$create = require("@babel/runtime-corejs3/core-js-stable/object/create"); -var _Object$assign = require("@babel/runtime-corejs3/core-js-stable/object/assign.js"); +var _Object$assign = require("@babel/runtime-corejs3/core-js-stable/object/assign"); -var _Number$parseInt = require("@babel/runtime-corejs3/core-js-stable/number/parse-int.js"); +var _Number$parseInt = require("@babel/runtime-corejs3/core-js-stable/number/parse-int"); -var _Number$parseFloat = require("@babel/runtime-corejs3/core-js-stable/number/parse-float.js"); +var _Number$parseFloat = require("@babel/runtime-corejs3/core-js-stable/number/parse-float"); -var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-safe-integer.js"); +var _Number$isSafeInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-safe-integer"); -var _Number$isNaN = require("@babel/runtime-corejs3/core-js-stable/number/is-nan.js"); +var _Number$isNaN = require("@babel/runtime-corejs3/core-js-stable/number/is-nan"); -var _Number$isInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-integer.js"); +var _Number$isInteger = require("@babel/runtime-corejs3/core-js-stable/number/is-integer"); -var _Number$isFinite = require("@babel/runtime-corejs3/core-js-stable/number/is-finite.js"); +var _Number$isFinite = require("@babel/runtime-corejs3/core-js-stable/number/is-finite"); -var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/min-safe-integer.js"); +var _Number$MIN_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/min-safe-integer"); -var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/max-safe-integer.js"); +var _Number$MAX_SAFE_INTEGER = require("@babel/runtime-corejs3/core-js-stable/number/max-safe-integer"); -var _Number$EPSILON = require("@babel/runtime-corejs3/core-js-stable/number/epsilon.js"); +var _Number$EPSILON = require("@babel/runtime-corejs3/core-js-stable/number/epsilon"); -var _Math$trunc = require("@babel/runtime-corejs3/core-js-stable/math/trunc.js"); +var _Math$trunc = require("@babel/runtime-corejs3/core-js-stable/math/trunc"); -var _Math$tanh = require("@babel/runtime-corejs3/core-js-stable/math/tanh.js"); +var _Math$tanh = require("@babel/runtime-corejs3/core-js-stable/math/tanh"); -var _Math$sinh = require("@babel/runtime-corejs3/core-js-stable/math/sinh.js"); +var _Math$sinh = require("@babel/runtime-corejs3/core-js-stable/math/sinh"); -var _Math$sign = require("@babel/runtime-corejs3/core-js-stable/math/sign.js"); +var _Math$sign = require("@babel/runtime-corejs3/core-js-stable/math/sign"); -var _Math$log2 = require("@babel/runtime-corejs3/core-js-stable/math/log2.js"); +var _Math$log2 = require("@babel/runtime-corejs3/core-js-stable/math/log2"); -var _Math$log1p = require("@babel/runtime-corejs3/core-js-stable/math/log1p.js"); +var _Math$log1p = require("@babel/runtime-corejs3/core-js-stable/math/log1p"); -var _Math$log = require("@babel/runtime-corejs3/core-js-stable/math/log10.js"); +var _Math$log = require("@babel/runtime-corejs3/core-js-stable/math/log10"); -var _Math$imul = require("@babel/runtime-corejs3/core-js-stable/math/imul.js"); +var _Math$imul = require("@babel/runtime-corejs3/core-js-stable/math/imul"); -var _Math$hypot = require("@babel/runtime-corejs3/core-js-stable/math/hypot.js"); +var _Math$hypot = require("@babel/runtime-corejs3/core-js-stable/math/hypot"); -var _Math$fround = require("@babel/runtime-corejs3/core-js-stable/math/fround.js"); +var _Math$fround = require("@babel/runtime-corejs3/core-js-stable/math/fround"); -var _Math$expm = require("@babel/runtime-corejs3/core-js-stable/math/expm1.js"); +var _Math$expm = require("@babel/runtime-corejs3/core-js-stable/math/expm1"); -var _Math$cosh = require("@babel/runtime-corejs3/core-js-stable/math/cosh.js"); +var _Math$cosh = require("@babel/runtime-corejs3/core-js-stable/math/cosh"); -var _Math$clz = require("@babel/runtime-corejs3/core-js-stable/math/clz32.js"); +var _Math$clz = require("@babel/runtime-corejs3/core-js-stable/math/clz32"); -var _Math$cbrt = require("@babel/runtime-corejs3/core-js-stable/math/cbrt.js"); +var _Math$cbrt = require("@babel/runtime-corejs3/core-js-stable/math/cbrt"); -var _Math$atanh = require("@babel/runtime-corejs3/core-js-stable/math/atanh.js"); +var _Math$atanh = require("@babel/runtime-corejs3/core-js-stable/math/atanh"); -var _Math$asinh = require("@babel/runtime-corejs3/core-js-stable/math/asinh.js"); +var _Math$asinh = require("@babel/runtime-corejs3/core-js-stable/math/asinh"); -var _Math$acosh = require("@babel/runtime-corejs3/core-js-stable/math/acosh.js"); +var _Math$acosh = require("@babel/runtime-corejs3/core-js-stable/math/acosh"); -var _JSON$stringify = require("@babel/runtime-corejs3/core-js-stable/json/stringify.js"); +var _JSON$stringify = require("@babel/runtime-corejs3/core-js-stable/json/stringify"); -var _Date$now = require("@babel/runtime-corejs3/core-js-stable/date/now.js"); +var _Date$now = require("@babel/runtime-corejs3/core-js-stable/date/now"); -var _Array$of = require("@babel/runtime-corejs3/core-js-stable/array/of.js"); +var _Array$of = require("@babel/runtime-corejs3/core-js-stable/array/of"); -var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array.js"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js-stable/array/is-array"); -var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from.js"); +var _Array$from = require("@babel/runtime-corejs3/core-js-stable/array/from"); _Array$from; _Array$isArray; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js index 567f36f03796..5e5d7dce0288 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/catch-all/output.js @@ -1,3 +1,3 @@ -var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise.js"); +var _Promise = require("@babel/runtime-corejs3/core-js-stable/promise"); _Promise.resolve; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js index 167296ebdf13..093be2446f56 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime-corejs3/helpers/classCallCheck.js"); +var _classCallCheck = require("@babel/runtime-corejs3/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js index 76d9855865d4..2bb4ba66cbc7 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/es6-for-of/output.js @@ -1,4 +1,4 @@ -var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator.js"); +var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator"); var _iteratorNormalCompletion = true; var _didIteratorError = false; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js index fb790934e640..1f2bc8c78155 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-instance-methods/output.js @@ -1,6 +1,6 @@ -var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map.js"); +var _mapInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/map"); -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter.js"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js/instance/filter"); var _map = "map"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js index c798604064bb..83dde082836f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/evaluated-static-methods/output.js @@ -1,6 +1,6 @@ -var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array.js"); +var _Array$isArray = require("@babel/runtime-corejs3/core-js/array/is-array"); -var _Array$from = require("@babel/runtime-corejs3/core-js/array/from.js"); +var _Array$from = require("@babel/runtime-corejs3/core-js/array/from"); var _isArray = "isArray"; _Array$from; // polyfill diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs index 7226920eee13..e0183d2e2afd 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/full/output.mjs @@ -1,5 +1,5 @@ -import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator/index.js"; -import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol.js"; +import _regeneratorRuntime from "@babel/runtime-corejs3/regenerator"; +import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js index 935ca1892790..36aa68a81998 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-call/output.js @@ -1,4 +1,4 @@ -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); var _context, _context2, _context3; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js index 5ed82b3fc734..983b263388cf 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-computed/output.js @@ -1,3 +1,3 @@ -var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter.js"); +var _filterInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/filter"); _filterInstanceProperty(bar).call(bar); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js index b7d78ef5edb1..ae165e25b1e7 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-get/output.js @@ -1,4 +1,4 @@ -var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes.js"); +var _includesInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/includes"); _includesInstanceProperty(foo); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js index 2d9298e4b7c7..fe473d9f3f88 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/instance-inference-optimization/output.js @@ -1,4 +1,4 @@ -var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat.js"); +var _concatInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/concat"); var _context; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js index 1d71f49dc87c..cef08c661a7f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck.js")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass.js")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js index 7b6c4da4e724..2a1a8fe7aa92 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules-loose/output.js @@ -1,12 +1,12 @@ "use strict"; -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); var _context; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); exports.__esModule = true; var _exportNames = { diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js index f429ca11c01d..75793607c414 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/modules/output.js @@ -1,14 +1,14 @@ "use strict"; -var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys.js"); +var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys"); -var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each.js"); +var _forEachInstanceProperty = require("@babel/runtime-corejs3/core-js-stable/instance/for-each"); var _context; -var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); -var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property.js"); +var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js index f72539f5a90e..217ed8f6dc06 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime-corejs3/regenerator/index.js"); +var _regeneratorRuntime = require("@babel/runtime-corejs3/regenerator"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js index b1a441f0c8d0..4b9498983c1a 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get-method/output.js @@ -1,3 +1,3 @@ -var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method.js"); +var _getIteratorMethod = require("@babel/runtime-corejs3/core-js/get-iterator-method"); const method = _getIteratorMethod(array); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js index 7adf28a42d63..2627981407a6 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-get/output.js @@ -1,3 +1,3 @@ -var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator.js"); +var _getIterator = require("@babel/runtime-corejs3/core-js/get-iterator"); const iterator = _getIterator(array); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js index 97f966ea805b..42b70766acdd 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator-in/output.js @@ -1,3 +1,3 @@ -var _isIterable = require("@babel/runtime-corejs3/core-js/is-iterable.js"); +var _isIterable = require("@babel/runtime-corejs3/core-js/is-iterable"); _isIterable(Object(arr)); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js index 57fe73d33e98..936e4485756e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime-corejs3/symbol-iterator/output.js @@ -1,3 +1,3 @@ -var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator.js"); +var _Symbol$iterator = require("@babel/runtime-corejs3/core-js-stable/symbol/iterator"); _Symbol$iterator; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js index 3c996824be2a..60d3e2fb724e 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/class/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs index 5d7578d1dde9..2576947e3dd3 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs @@ -1,4 +1,4 @@ -import _regeneratorRuntime from "@babel/runtime/regenerator/index.js"; +import _regeneratorRuntime from "@babel/runtime/regenerator"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js index 900ad7f56f43..7a95ad78e496 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules-helpers/output.js @@ -1,10 +1,10 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck.js")); +var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass.js")); +var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); var _foo = _interopRequireDefault(require("foo")); diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js index eaa575fa1a59..260de19e94a1 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/output.js @@ -1,6 +1,6 @@ "use strict"; -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault.js"); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js index 4a7d49a65697..5bd92072ae8f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/regenerator-runtime/output.js @@ -1,4 +1,4 @@ -var _regeneratorRuntime = require("@babel/runtime/regenerator/index.js"); +var _regeneratorRuntime = require("@babel/runtime/regenerator"); void /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs index be6fe5291855..828c9aa787ef 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs-useES6Modules/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime-corejs2/helpers/esm/classCallCheck.js"; -import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn.js"; -import _getPrototypeOf from "@babel/runtime-corejs2/helpers/esm/getPrototypeOf.js"; -import _inherits from "@babel/runtime-corejs2/helpers/esm/inherits.js"; +import _classCallCheck from "@babel/runtime-corejs2/helpers/esm/classCallCheck"; +import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn"; +import _getPrototypeOf from "@babel/runtime-corejs2/helpers/esm/getPrototypeOf"; +import _inherits from "@babel/runtime-corejs2/helpers/esm/inherits"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs index 91f313b2c4ca..44f4d72a0409 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/corejs/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck.js"; -import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/possibleConstructorReturn.js"; -import _getPrototypeOf from "@babel/runtime-corejs2/helpers/getPrototypeOf.js"; -import _inherits from "@babel/runtime-corejs2/helpers/inherits.js"; +import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck"; +import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/possibleConstructorReturn"; +import _getPrototypeOf from "@babel/runtime-corejs2/helpers/getPrototypeOf"; +import _inherits from "@babel/runtime-corejs2/helpers/inherits"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js index 312b5bda92c2..39882dcd466a 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs-auto/output.js @@ -1,10 +1,10 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); -var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn.js"); +var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn"); -var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf.js"); +var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf"); -var _inherits = require("@babel/runtime/helpers/inherits.js"); +var _inherits = require("@babel/runtime/helpers/inherits"); let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js index 312b5bda92c2..39882dcd466a 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-cjs/output.js @@ -1,10 +1,10 @@ -var _classCallCheck = require("@babel/runtime/helpers/classCallCheck.js"); +var _classCallCheck = require("@babel/runtime/helpers/classCallCheck"); -var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn.js"); +var _possibleConstructorReturn = require("@babel/runtime/helpers/possibleConstructorReturn"); -var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf.js"); +var _getPrototypeOf = require("@babel/runtime/helpers/getPrototypeOf"); -var _inherits = require("@babel/runtime/helpers/inherits.js"); +var _inherits = require("@babel/runtime/helpers/inherits"); let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs index 69e96b7bc40e..0247fa0b5556 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs-auto/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck.js"; -import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn.js"; -import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf.js"; -import _inherits from "@babel/runtime/helpers/esm/inherits.js"; +import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; +import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; +import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; +import _inherits from "@babel/runtime/helpers/esm/inherits"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs index 69e96b7bc40e..0247fa0b5556 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs +++ b/packages/babel-plugin-transform-runtime/test/fixtures/use-options/useESModules-mjs/output.mjs @@ -1,7 +1,7 @@ -import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck.js"; -import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn.js"; -import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf.js"; -import _inherits from "@babel/runtime/helpers/esm/inherits.js"; +import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; +import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn"; +import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf"; +import _inherits from "@babel/runtime/helpers/esm/inherits"; let Foo = /*#__PURE__*/ diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index d9b42a42cdd4..cb35951a8f87 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -152,11 +152,11 @@ export function isPolyfillSource(source: ?string): boolean { } const modulePathMap = { - "regenerator-runtime": "regenerator-runtime/runtime.js", + "regenerator-runtime": "regenerator-runtime/runtime", }; export function getModulePath(mod: string): string { - return modulePathMap[mod] || `core-js/modules/${mod}.js`; + return modulePathMap[mod] || `core-js/modules/${mod}`; } export function createImport(path: NodePath, mod: string) { diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs index 7018d87d49bc..50550d4322d8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-all/output.mjs @@ -1,149 +1,149 @@ -import "core-js/modules/es6.array.copy-within.js"; -import "core-js/modules/es6.array.every.js"; -import "core-js/modules/es6.array.fill.js"; -import "core-js/modules/es6.array.filter.js"; -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es6.array.find-index.js"; -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.for-each.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es7.array.includes.js"; -import "core-js/modules/es6.array.index-of.js"; -import "core-js/modules/es6.array.is-array.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.array.last-index-of.js"; -import "core-js/modules/es6.array.map.js"; -import "core-js/modules/es6.array.of.js"; -import "core-js/modules/es6.array.reduce.js"; -import "core-js/modules/es6.array.reduce-right.js"; -import "core-js/modules/es6.array.some.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.date.now.js"; -import "core-js/modules/es6.date.to-iso-string.js"; -import "core-js/modules/es6.date.to-json.js"; -import "core-js/modules/es6.date.to-primitive.js"; -import "core-js/modules/es6.date.to-string.js"; -import "core-js/modules/es6.function.bind.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.function.name.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.math.acosh.js"; -import "core-js/modules/es6.math.asinh.js"; -import "core-js/modules/es6.math.atanh.js"; -import "core-js/modules/es6.math.cbrt.js"; -import "core-js/modules/es6.math.clz32.js"; -import "core-js/modules/es6.math.cosh.js"; -import "core-js/modules/es6.math.expm1.js"; -import "core-js/modules/es6.math.fround.js"; -import "core-js/modules/es6.math.hypot.js"; -import "core-js/modules/es6.math.imul.js"; -import "core-js/modules/es6.math.log1p.js"; -import "core-js/modules/es6.math.log10.js"; -import "core-js/modules/es6.math.log2.js"; -import "core-js/modules/es6.math.sign.js"; -import "core-js/modules/es6.math.sinh.js"; -import "core-js/modules/es6.math.tanh.js"; -import "core-js/modules/es6.math.trunc.js"; -import "core-js/modules/es6.number.constructor.js"; -import "core-js/modules/es6.number.epsilon.js"; -import "core-js/modules/es6.number.is-finite.js"; -import "core-js/modules/es6.number.is-integer.js"; -import "core-js/modules/es6.number.is-nan.js"; -import "core-js/modules/es6.number.is-safe-integer.js"; -import "core-js/modules/es6.number.max-safe-integer.js"; -import "core-js/modules/es6.number.min-safe-integer.js"; -import "core-js/modules/es6.number.parse-float.js"; -import "core-js/modules/es6.number.parse-int.js"; -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/es6.object.create.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es6.object.define-property.js"; -import "core-js/modules/es6.object.define-properties.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es6.object.freeze.js"; -import "core-js/modules/es6.object.get-own-property-descriptor.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es6.object.get-own-property-names.js"; -import "core-js/modules/es6.object.get-prototype-of.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.prevent-extensions.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.object.is.js"; -import "core-js/modules/es6.object.is-frozen.js"; -import "core-js/modules/es6.object.is-sealed.js"; -import "core-js/modules/es6.object.is-extensible.js"; -import "core-js/modules/es6.object.keys.js"; -import "core-js/modules/es6.object.seal.js"; -import "core-js/modules/es6.object.set-prototype-of.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.reflect.apply.js"; -import "core-js/modules/es6.reflect.construct.js"; -import "core-js/modules/es6.reflect.define-property.js"; -import "core-js/modules/es6.reflect.delete-property.js"; -import "core-js/modules/es6.reflect.get.js"; -import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es6.reflect.get-prototype-of.js"; -import "core-js/modules/es6.reflect.has.js"; -import "core-js/modules/es6.reflect.is-extensible.js"; -import "core-js/modules/es6.reflect.own-keys.js"; -import "core-js/modules/es6.reflect.prevent-extensions.js"; -import "core-js/modules/es6.reflect.set.js"; -import "core-js/modules/es6.reflect.set-prototype-of.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.flags.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.string.anchor.js"; -import "core-js/modules/es6.string.big.js"; -import "core-js/modules/es6.string.blink.js"; -import "core-js/modules/es6.string.bold.js"; -import "core-js/modules/es6.string.code-point-at.js"; -import "core-js/modules/es6.string.ends-with.js"; -import "core-js/modules/es6.string.fixed.js"; -import "core-js/modules/es6.string.fontcolor.js"; -import "core-js/modules/es6.string.fontsize.js"; -import "core-js/modules/es6.string.from-code-point.js"; -import "core-js/modules/es6.string.includes.js"; -import "core-js/modules/es6.string.italics.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.string.link.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es6.string.raw.js"; -import "core-js/modules/es6.string.repeat.js"; -import "core-js/modules/es6.string.small.js"; -import "core-js/modules/es6.string.starts-with.js"; -import "core-js/modules/es6.string.strike.js"; -import "core-js/modules/es6.string.sub.js"; -import "core-js/modules/es6.string.sup.js"; -import "core-js/modules/es6.string.trim.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.data-view.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es6.array.copy-within"; +import "core-js/modules/es6.array.every"; +import "core-js/modules/es6.array.fill"; +import "core-js/modules/es6.array.filter"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es6.array.find-index"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.for-each"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.array.index-of"; +import "core-js/modules/es6.array.is-array"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.array.last-index-of"; +import "core-js/modules/es6.array.map"; +import "core-js/modules/es6.array.of"; +import "core-js/modules/es6.array.reduce"; +import "core-js/modules/es6.array.reduce-right"; +import "core-js/modules/es6.array.some"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.date.now"; +import "core-js/modules/es6.date.to-iso-string"; +import "core-js/modules/es6.date.to-json"; +import "core-js/modules/es6.date.to-primitive"; +import "core-js/modules/es6.date.to-string"; +import "core-js/modules/es6.function.bind"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.function.name"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.math.acosh"; +import "core-js/modules/es6.math.asinh"; +import "core-js/modules/es6.math.atanh"; +import "core-js/modules/es6.math.cbrt"; +import "core-js/modules/es6.math.clz32"; +import "core-js/modules/es6.math.cosh"; +import "core-js/modules/es6.math.expm1"; +import "core-js/modules/es6.math.fround"; +import "core-js/modules/es6.math.hypot"; +import "core-js/modules/es6.math.imul"; +import "core-js/modules/es6.math.log1p"; +import "core-js/modules/es6.math.log10"; +import "core-js/modules/es6.math.log2"; +import "core-js/modules/es6.math.sign"; +import "core-js/modules/es6.math.sinh"; +import "core-js/modules/es6.math.tanh"; +import "core-js/modules/es6.math.trunc"; +import "core-js/modules/es6.number.constructor"; +import "core-js/modules/es6.number.epsilon"; +import "core-js/modules/es6.number.is-finite"; +import "core-js/modules/es6.number.is-integer"; +import "core-js/modules/es6.number.is-nan"; +import "core-js/modules/es6.number.is-safe-integer"; +import "core-js/modules/es6.number.max-safe-integer"; +import "core-js/modules/es6.number.min-safe-integer"; +import "core-js/modules/es6.number.parse-float"; +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/es6.object.create"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es6.object.define-property"; +import "core-js/modules/es6.object.define-properties"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es6.object.freeze"; +import "core-js/modules/es6.object.get-own-property-descriptor"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es6.object.get-own-property-names"; +import "core-js/modules/es6.object.get-prototype-of"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.prevent-extensions"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.object.is"; +import "core-js/modules/es6.object.is-frozen"; +import "core-js/modules/es6.object.is-sealed"; +import "core-js/modules/es6.object.is-extensible"; +import "core-js/modules/es6.object.keys"; +import "core-js/modules/es6.object.seal"; +import "core-js/modules/es6.object.set-prototype-of"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.reflect.apply"; +import "core-js/modules/es6.reflect.construct"; +import "core-js/modules/es6.reflect.define-property"; +import "core-js/modules/es6.reflect.delete-property"; +import "core-js/modules/es6.reflect.get"; +import "core-js/modules/es6.reflect.get-own-property-descriptor"; +import "core-js/modules/es6.reflect.get-prototype-of"; +import "core-js/modules/es6.reflect.has"; +import "core-js/modules/es6.reflect.is-extensible"; +import "core-js/modules/es6.reflect.own-keys"; +import "core-js/modules/es6.reflect.prevent-extensions"; +import "core-js/modules/es6.reflect.set"; +import "core-js/modules/es6.reflect.set-prototype-of"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.flags"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.string.anchor"; +import "core-js/modules/es6.string.big"; +import "core-js/modules/es6.string.blink"; +import "core-js/modules/es6.string.bold"; +import "core-js/modules/es6.string.code-point-at"; +import "core-js/modules/es6.string.ends-with"; +import "core-js/modules/es6.string.fixed"; +import "core-js/modules/es6.string.fontcolor"; +import "core-js/modules/es6.string.fontsize"; +import "core-js/modules/es6.string.from-code-point"; +import "core-js/modules/es6.string.includes"; +import "core-js/modules/es6.string.italics"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.string.link"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es6.string.raw"; +import "core-js/modules/es6.string.repeat"; +import "core-js/modules/es6.string.small"; +import "core-js/modules/es6.string.starts-with"; +import "core-js/modules/es6.string.strike"; +import "core-js/modules/es6.string.sub"; +import "core-js/modules/es6.string.sup"; +import "core-js/modules/es6.string.trim"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.data-view"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs index 1811cef4ca3c..7f3479ae14b9 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-48/output.mjs @@ -1,61 +1,61 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.reflect.apply.js"; -import "core-js/modules/es6.reflect.construct.js"; -import "core-js/modules/es6.reflect.define-property.js"; -import "core-js/modules/es6.reflect.delete-property.js"; -import "core-js/modules/es6.reflect.get.js"; -import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es6.reflect.get-prototype-of.js"; -import "core-js/modules/es6.reflect.has.js"; -import "core-js/modules/es6.reflect.is-extensible.js"; -import "core-js/modules/es6.reflect.own-keys.js"; -import "core-js/modules/es6.reflect.prevent-extensions.js"; -import "core-js/modules/es6.reflect.set.js"; -import "core-js/modules/es6.reflect.set-prototype-of.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.flags.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.reflect.apply"; +import "core-js/modules/es6.reflect.construct"; +import "core-js/modules/es6.reflect.define-property"; +import "core-js/modules/es6.reflect.delete-property"; +import "core-js/modules/es6.reflect.get"; +import "core-js/modules/es6.reflect.get-own-property-descriptor"; +import "core-js/modules/es6.reflect.get-prototype-of"; +import "core-js/modules/es6.reflect.has"; +import "core-js/modules/es6.reflect.is-extensible"; +import "core-js/modules/es6.reflect.own-keys"; +import "core-js/modules/es6.reflect.prevent-extensions"; +import "core-js/modules/es6.reflect.set"; +import "core-js/modules/es6.reflect.set-prototype-of"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.flags"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs index 891074950b84..d424cb017c55 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-49/output.mjs @@ -1,46 +1,46 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.map"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs index 1529357732f9..ce33befd1127 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-66/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs index c85d4fceeb29..aaa9444a59bd 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chrome-71/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs index 512ddb139ed5..50912e84ee5f 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-chromeandroid/output.mjs @@ -1,14 +1,14 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs index 9dfaa7fef810..0d844da81283 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main-require/output.mjs @@ -1,16 +1,16 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs index 9dfaa7fef810..0d844da81283 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-core-js-main/output.mjs @@ -1,16 +1,16 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs index b6eddfc04f71..c71a6a9b4044 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-electron/output.mjs @@ -1,21 +1,21 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.function.bind.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.function.bind"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; a ** b; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs index 863ad413a5a1..220ad965edab 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-11/output.mjs @@ -1,127 +1,127 @@ -import "core-js/modules/es6.array.copy-within.js"; -import "core-js/modules/es6.array.fill.js"; -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es6.array.find-index.js"; -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es7.array.includes.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.array.of.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.date.to-primitive.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.function.name.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.math.acosh.js"; -import "core-js/modules/es6.math.asinh.js"; -import "core-js/modules/es6.math.atanh.js"; -import "core-js/modules/es6.math.cbrt.js"; -import "core-js/modules/es6.math.clz32.js"; -import "core-js/modules/es6.math.cosh.js"; -import "core-js/modules/es6.math.expm1.js"; -import "core-js/modules/es6.math.fround.js"; -import "core-js/modules/es6.math.hypot.js"; -import "core-js/modules/es6.math.imul.js"; -import "core-js/modules/es6.math.log1p.js"; -import "core-js/modules/es6.math.log10.js"; -import "core-js/modules/es6.math.log2.js"; -import "core-js/modules/es6.math.sign.js"; -import "core-js/modules/es6.math.sinh.js"; -import "core-js/modules/es6.math.tanh.js"; -import "core-js/modules/es6.math.trunc.js"; -import "core-js/modules/es6.number.constructor.js"; -import "core-js/modules/es6.number.epsilon.js"; -import "core-js/modules/es6.number.is-finite.js"; -import "core-js/modules/es6.number.is-integer.js"; -import "core-js/modules/es6.number.is-nan.js"; -import "core-js/modules/es6.number.is-safe-integer.js"; -import "core-js/modules/es6.number.max-safe-integer.js"; -import "core-js/modules/es6.number.min-safe-integer.js"; -import "core-js/modules/es6.number.parse-float.js"; -import "core-js/modules/es6.number.parse-int.js"; -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es6.object.freeze.js"; -import "core-js/modules/es6.object.get-own-property-descriptor.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es6.object.get-own-property-names.js"; -import "core-js/modules/es6.object.get-prototype-of.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.prevent-extensions.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.object.is.js"; -import "core-js/modules/es6.object.is-frozen.js"; -import "core-js/modules/es6.object.is-sealed.js"; -import "core-js/modules/es6.object.is-extensible.js"; -import "core-js/modules/es6.object.keys.js"; -import "core-js/modules/es6.object.seal.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.reflect.apply.js"; -import "core-js/modules/es6.reflect.construct.js"; -import "core-js/modules/es6.reflect.define-property.js"; -import "core-js/modules/es6.reflect.delete-property.js"; -import "core-js/modules/es6.reflect.get.js"; -import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es6.reflect.get-prototype-of.js"; -import "core-js/modules/es6.reflect.has.js"; -import "core-js/modules/es6.reflect.is-extensible.js"; -import "core-js/modules/es6.reflect.own-keys.js"; -import "core-js/modules/es6.reflect.prevent-extensions.js"; -import "core-js/modules/es6.reflect.set.js"; -import "core-js/modules/es6.reflect.set-prototype-of.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.flags.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.string.anchor.js"; -import "core-js/modules/es6.string.big.js"; -import "core-js/modules/es6.string.blink.js"; -import "core-js/modules/es6.string.bold.js"; -import "core-js/modules/es6.string.code-point-at.js"; -import "core-js/modules/es6.string.ends-with.js"; -import "core-js/modules/es6.string.fixed.js"; -import "core-js/modules/es6.string.fontcolor.js"; -import "core-js/modules/es6.string.fontsize.js"; -import "core-js/modules/es6.string.from-code-point.js"; -import "core-js/modules/es6.string.includes.js"; -import "core-js/modules/es6.string.italics.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.string.link.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es6.string.raw.js"; -import "core-js/modules/es6.string.repeat.js"; -import "core-js/modules/es6.string.small.js"; -import "core-js/modules/es6.string.starts-with.js"; -import "core-js/modules/es6.string.strike.js"; -import "core-js/modules/es6.string.sub.js"; -import "core-js/modules/es6.string.sup.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es6.array.copy-within"; +import "core-js/modules/es6.array.fill"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es6.array.find-index"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.array.of"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.date.to-primitive"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.function.name"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.math.acosh"; +import "core-js/modules/es6.math.asinh"; +import "core-js/modules/es6.math.atanh"; +import "core-js/modules/es6.math.cbrt"; +import "core-js/modules/es6.math.clz32"; +import "core-js/modules/es6.math.cosh"; +import "core-js/modules/es6.math.expm1"; +import "core-js/modules/es6.math.fround"; +import "core-js/modules/es6.math.hypot"; +import "core-js/modules/es6.math.imul"; +import "core-js/modules/es6.math.log1p"; +import "core-js/modules/es6.math.log10"; +import "core-js/modules/es6.math.log2"; +import "core-js/modules/es6.math.sign"; +import "core-js/modules/es6.math.sinh"; +import "core-js/modules/es6.math.tanh"; +import "core-js/modules/es6.math.trunc"; +import "core-js/modules/es6.number.constructor"; +import "core-js/modules/es6.number.epsilon"; +import "core-js/modules/es6.number.is-finite"; +import "core-js/modules/es6.number.is-integer"; +import "core-js/modules/es6.number.is-nan"; +import "core-js/modules/es6.number.is-safe-integer"; +import "core-js/modules/es6.number.max-safe-integer"; +import "core-js/modules/es6.number.min-safe-integer"; +import "core-js/modules/es6.number.parse-float"; +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es6.object.freeze"; +import "core-js/modules/es6.object.get-own-property-descriptor"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es6.object.get-own-property-names"; +import "core-js/modules/es6.object.get-prototype-of"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.prevent-extensions"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.object.is"; +import "core-js/modules/es6.object.is-frozen"; +import "core-js/modules/es6.object.is-sealed"; +import "core-js/modules/es6.object.is-extensible"; +import "core-js/modules/es6.object.keys"; +import "core-js/modules/es6.object.seal"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.reflect.apply"; +import "core-js/modules/es6.reflect.construct"; +import "core-js/modules/es6.reflect.define-property"; +import "core-js/modules/es6.reflect.delete-property"; +import "core-js/modules/es6.reflect.get"; +import "core-js/modules/es6.reflect.get-own-property-descriptor"; +import "core-js/modules/es6.reflect.get-prototype-of"; +import "core-js/modules/es6.reflect.has"; +import "core-js/modules/es6.reflect.is-extensible"; +import "core-js/modules/es6.reflect.own-keys"; +import "core-js/modules/es6.reflect.prevent-extensions"; +import "core-js/modules/es6.reflect.set"; +import "core-js/modules/es6.reflect.set-prototype-of"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.flags"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.string.anchor"; +import "core-js/modules/es6.string.big"; +import "core-js/modules/es6.string.blink"; +import "core-js/modules/es6.string.bold"; +import "core-js/modules/es6.string.code-point-at"; +import "core-js/modules/es6.string.ends-with"; +import "core-js/modules/es6.string.fixed"; +import "core-js/modules/es6.string.fontcolor"; +import "core-js/modules/es6.string.fontsize"; +import "core-js/modules/es6.string.from-code-point"; +import "core-js/modules/es6.string.includes"; +import "core-js/modules/es6.string.italics"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.string.link"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es6.string.raw"; +import "core-js/modules/es6.string.repeat"; +import "core-js/modules/es6.string.small"; +import "core-js/modules/es6.string.starts-with"; +import "core-js/modules/es6.string.strike"; +import "core-js/modules/es6.string.sub"; +import "core-js/modules/es6.string.sup"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs index e20ac4ded964..9012ed720c20 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-ie-9/output.mjs @@ -1,130 +1,130 @@ -import "core-js/modules/es6.array.copy-within.js"; -import "core-js/modules/es6.array.fill.js"; -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es6.array.find-index.js"; -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es7.array.includes.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.array.of.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.date.to-primitive.js"; -import "core-js/modules/es6.date.to-string.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.function.name.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.math.acosh.js"; -import "core-js/modules/es6.math.asinh.js"; -import "core-js/modules/es6.math.atanh.js"; -import "core-js/modules/es6.math.cbrt.js"; -import "core-js/modules/es6.math.clz32.js"; -import "core-js/modules/es6.math.cosh.js"; -import "core-js/modules/es6.math.expm1.js"; -import "core-js/modules/es6.math.fround.js"; -import "core-js/modules/es6.math.hypot.js"; -import "core-js/modules/es6.math.imul.js"; -import "core-js/modules/es6.math.log1p.js"; -import "core-js/modules/es6.math.log10.js"; -import "core-js/modules/es6.math.log2.js"; -import "core-js/modules/es6.math.sign.js"; -import "core-js/modules/es6.math.sinh.js"; -import "core-js/modules/es6.math.tanh.js"; -import "core-js/modules/es6.math.trunc.js"; -import "core-js/modules/es6.number.constructor.js"; -import "core-js/modules/es6.number.epsilon.js"; -import "core-js/modules/es6.number.is-finite.js"; -import "core-js/modules/es6.number.is-integer.js"; -import "core-js/modules/es6.number.is-nan.js"; -import "core-js/modules/es6.number.is-safe-integer.js"; -import "core-js/modules/es6.number.max-safe-integer.js"; -import "core-js/modules/es6.number.min-safe-integer.js"; -import "core-js/modules/es6.number.parse-float.js"; -import "core-js/modules/es6.number.parse-int.js"; -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es6.object.freeze.js"; -import "core-js/modules/es6.object.get-own-property-descriptor.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es6.object.get-own-property-names.js"; -import "core-js/modules/es6.object.get-prototype-of.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.prevent-extensions.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.object.is.js"; -import "core-js/modules/es6.object.is-frozen.js"; -import "core-js/modules/es6.object.is-sealed.js"; -import "core-js/modules/es6.object.is-extensible.js"; -import "core-js/modules/es6.object.keys.js"; -import "core-js/modules/es6.object.seal.js"; -import "core-js/modules/es6.object.set-prototype-of.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.reflect.apply.js"; -import "core-js/modules/es6.reflect.construct.js"; -import "core-js/modules/es6.reflect.define-property.js"; -import "core-js/modules/es6.reflect.delete-property.js"; -import "core-js/modules/es6.reflect.get.js"; -import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es6.reflect.get-prototype-of.js"; -import "core-js/modules/es6.reflect.has.js"; -import "core-js/modules/es6.reflect.is-extensible.js"; -import "core-js/modules/es6.reflect.own-keys.js"; -import "core-js/modules/es6.reflect.prevent-extensions.js"; -import "core-js/modules/es6.reflect.set.js"; -import "core-js/modules/es6.reflect.set-prototype-of.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.flags.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.string.anchor.js"; -import "core-js/modules/es6.string.big.js"; -import "core-js/modules/es6.string.blink.js"; -import "core-js/modules/es6.string.bold.js"; -import "core-js/modules/es6.string.code-point-at.js"; -import "core-js/modules/es6.string.ends-with.js"; -import "core-js/modules/es6.string.fixed.js"; -import "core-js/modules/es6.string.fontcolor.js"; -import "core-js/modules/es6.string.fontsize.js"; -import "core-js/modules/es6.string.from-code-point.js"; -import "core-js/modules/es6.string.includes.js"; -import "core-js/modules/es6.string.italics.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.string.link.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es6.string.raw.js"; -import "core-js/modules/es6.string.repeat.js"; -import "core-js/modules/es6.string.small.js"; -import "core-js/modules/es6.string.starts-with.js"; -import "core-js/modules/es6.string.strike.js"; -import "core-js/modules/es6.string.sub.js"; -import "core-js/modules/es6.string.sup.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.data-view.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es6.array.copy-within"; +import "core-js/modules/es6.array.fill"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es6.array.find-index"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.array.of"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.date.to-primitive"; +import "core-js/modules/es6.date.to-string"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.function.name"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.math.acosh"; +import "core-js/modules/es6.math.asinh"; +import "core-js/modules/es6.math.atanh"; +import "core-js/modules/es6.math.cbrt"; +import "core-js/modules/es6.math.clz32"; +import "core-js/modules/es6.math.cosh"; +import "core-js/modules/es6.math.expm1"; +import "core-js/modules/es6.math.fround"; +import "core-js/modules/es6.math.hypot"; +import "core-js/modules/es6.math.imul"; +import "core-js/modules/es6.math.log1p"; +import "core-js/modules/es6.math.log10"; +import "core-js/modules/es6.math.log2"; +import "core-js/modules/es6.math.sign"; +import "core-js/modules/es6.math.sinh"; +import "core-js/modules/es6.math.tanh"; +import "core-js/modules/es6.math.trunc"; +import "core-js/modules/es6.number.constructor"; +import "core-js/modules/es6.number.epsilon"; +import "core-js/modules/es6.number.is-finite"; +import "core-js/modules/es6.number.is-integer"; +import "core-js/modules/es6.number.is-nan"; +import "core-js/modules/es6.number.is-safe-integer"; +import "core-js/modules/es6.number.max-safe-integer"; +import "core-js/modules/es6.number.min-safe-integer"; +import "core-js/modules/es6.number.parse-float"; +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es6.object.freeze"; +import "core-js/modules/es6.object.get-own-property-descriptor"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es6.object.get-own-property-names"; +import "core-js/modules/es6.object.get-prototype-of"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.prevent-extensions"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.object.is"; +import "core-js/modules/es6.object.is-frozen"; +import "core-js/modules/es6.object.is-sealed"; +import "core-js/modules/es6.object.is-extensible"; +import "core-js/modules/es6.object.keys"; +import "core-js/modules/es6.object.seal"; +import "core-js/modules/es6.object.set-prototype-of"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.reflect.apply"; +import "core-js/modules/es6.reflect.construct"; +import "core-js/modules/es6.reflect.define-property"; +import "core-js/modules/es6.reflect.delete-property"; +import "core-js/modules/es6.reflect.get"; +import "core-js/modules/es6.reflect.get-own-property-descriptor"; +import "core-js/modules/es6.reflect.get-prototype-of"; +import "core-js/modules/es6.reflect.has"; +import "core-js/modules/es6.reflect.is-extensible"; +import "core-js/modules/es6.reflect.own-keys"; +import "core-js/modules/es6.reflect.prevent-extensions"; +import "core-js/modules/es6.reflect.set"; +import "core-js/modules/es6.reflect.set-prototype-of"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.flags"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.string.anchor"; +import "core-js/modules/es6.string.big"; +import "core-js/modules/es6.string.blink"; +import "core-js/modules/es6.string.bold"; +import "core-js/modules/es6.string.code-point-at"; +import "core-js/modules/es6.string.ends-with"; +import "core-js/modules/es6.string.fixed"; +import "core-js/modules/es6.string.fontcolor"; +import "core-js/modules/es6.string.fontsize"; +import "core-js/modules/es6.string.from-code-point"; +import "core-js/modules/es6.string.includes"; +import "core-js/modules/es6.string.italics"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.string.link"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es6.string.raw"; +import "core-js/modules/es6.string.repeat"; +import "core-js/modules/es6.string.small"; +import "core-js/modules/es6.string.starts-with"; +import "core-js/modules/es6.string.strike"; +import "core-js/modules/es6.string.sub"; +import "core-js/modules/es6.string.sup"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.data-view"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs index 80e66244c33e..68e37cc3ea2e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-import/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs index 492a3a5dc474..0518d02b9cc2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-10.13/output.mjs @@ -1 +1 @@ -import "core-js/modules/es7.array.flat-map.js"; +import "core-js/modules/es7.array.flat-map"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs index aaf24470787d..a9f27a4dced7 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node-web/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs index c928cc22c4ac..2afa855ac7eb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-node/output.mjs @@ -1,14 +1,14 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "regenerator-runtime/runtime"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js b/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js index 47a513bd3dca..70393b8eae04 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/entry-require/output.js @@ -1,33 +1,33 @@ -require("core-js/modules/es7.array.flat-map.js"); +require("core-js/modules/es7.array.flat-map"); -require("core-js/modules/es6.array.sort.js"); +require("core-js/modules/es6.array.sort"); -require("core-js/modules/es7.object.define-getter.js"); +require("core-js/modules/es7.object.define-getter"); -require("core-js/modules/es7.object.define-setter.js"); +require("core-js/modules/es7.object.define-setter"); -require("core-js/modules/es7.object.lookup-getter.js"); +require("core-js/modules/es7.object.lookup-getter"); -require("core-js/modules/es7.object.lookup-setter.js"); +require("core-js/modules/es7.object.lookup-setter"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); -require("core-js/modules/es7.promise.finally.js"); +require("core-js/modules/es7.promise.finally"); -require("core-js/modules/es7.symbol.async-iterator.js"); +require("core-js/modules/es7.symbol.async-iterator"); -require("core-js/modules/es7.string.pad-start.js"); +require("core-js/modules/es7.string.pad-start"); -require("core-js/modules/es7.string.pad-end.js"); +require("core-js/modules/es7.string.pad-end"); -require("core-js/modules/es7.string.trim-left.js"); +require("core-js/modules/es7.string.trim-left"); -require("core-js/modules/es7.string.trim-right.js"); +require("core-js/modules/es7.string.trim-right"); -require("core-js/modules/web.timers.js"); +require("core-js/modules/web.timers"); -require("core-js/modules/web.immediate.js"); +require("core-js/modules/web.immediate"); -require("core-js/modules/web.dom.iterable.js"); +require("core-js/modules/web.dom.iterable"); 1 ** 2; 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 fa7c74df32ac..54c32b60fc2c 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 @@ -1,300 +1,300 @@ -require("core-js/modules/es6.array.copy-within.js"); +require("core-js/modules/es6.array.copy-within"); -require("core-js/modules/es6.array.every.js"); +require("core-js/modules/es6.array.every"); -require("core-js/modules/es6.array.fill.js"); +require("core-js/modules/es6.array.fill"); -require("core-js/modules/es6.array.filter.js"); +require("core-js/modules/es6.array.filter"); -require("core-js/modules/es6.array.find.js"); +require("core-js/modules/es6.array.find"); -require("core-js/modules/es6.array.find-index.js"); +require("core-js/modules/es6.array.find-index"); -require("core-js/modules/es7.array.flat-map.js"); +require("core-js/modules/es7.array.flat-map"); -require("core-js/modules/es6.array.for-each.js"); +require("core-js/modules/es6.array.for-each"); -require("core-js/modules/es6.array.from.js"); +require("core-js/modules/es6.array.from"); -require("core-js/modules/es7.array.includes.js"); +require("core-js/modules/es7.array.includes"); -require("core-js/modules/es6.array.index-of.js"); +require("core-js/modules/es6.array.index-of"); -require("core-js/modules/es6.array.is-array.js"); +require("core-js/modules/es6.array.is-array"); -require("core-js/modules/es6.array.iterator.js"); +require("core-js/modules/es6.array.iterator"); -require("core-js/modules/es6.array.last-index-of.js"); +require("core-js/modules/es6.array.last-index-of"); -require("core-js/modules/es6.array.map.js"); +require("core-js/modules/es6.array.map"); -require("core-js/modules/es6.array.of.js"); +require("core-js/modules/es6.array.of"); -require("core-js/modules/es6.array.reduce.js"); +require("core-js/modules/es6.array.reduce"); -require("core-js/modules/es6.array.reduce-right.js"); +require("core-js/modules/es6.array.reduce-right"); -require("core-js/modules/es6.array.some.js"); +require("core-js/modules/es6.array.some"); -require("core-js/modules/es6.array.sort.js"); +require("core-js/modules/es6.array.sort"); -require("core-js/modules/es6.array.species.js"); +require("core-js/modules/es6.array.species"); -require("core-js/modules/es6.date.now.js"); +require("core-js/modules/es6.date.now"); -require("core-js/modules/es6.date.to-iso-string.js"); +require("core-js/modules/es6.date.to-iso-string"); -require("core-js/modules/es6.date.to-json.js"); +require("core-js/modules/es6.date.to-json"); -require("core-js/modules/es6.date.to-primitive.js"); +require("core-js/modules/es6.date.to-primitive"); -require("core-js/modules/es6.date.to-string.js"); +require("core-js/modules/es6.date.to-string"); -require("core-js/modules/es6.function.bind.js"); +require("core-js/modules/es6.function.bind"); -require("core-js/modules/es6.function.has-instance.js"); +require("core-js/modules/es6.function.has-instance"); -require("core-js/modules/es6.function.name.js"); +require("core-js/modules/es6.function.name"); -require("core-js/modules/es6.map.js"); +require("core-js/modules/es6.map"); -require("core-js/modules/es6.math.acosh.js"); +require("core-js/modules/es6.math.acosh"); -require("core-js/modules/es6.math.asinh.js"); +require("core-js/modules/es6.math.asinh"); -require("core-js/modules/es6.math.atanh.js"); +require("core-js/modules/es6.math.atanh"); -require("core-js/modules/es6.math.cbrt.js"); +require("core-js/modules/es6.math.cbrt"); -require("core-js/modules/es6.math.clz32.js"); +require("core-js/modules/es6.math.clz32"); -require("core-js/modules/es6.math.cosh.js"); +require("core-js/modules/es6.math.cosh"); -require("core-js/modules/es6.math.expm1.js"); +require("core-js/modules/es6.math.expm1"); -require("core-js/modules/es6.math.fround.js"); +require("core-js/modules/es6.math.fround"); -require("core-js/modules/es6.math.hypot.js"); +require("core-js/modules/es6.math.hypot"); -require("core-js/modules/es6.math.imul.js"); +require("core-js/modules/es6.math.imul"); -require("core-js/modules/es6.math.log1p.js"); +require("core-js/modules/es6.math.log1p"); -require("core-js/modules/es6.math.log10.js"); +require("core-js/modules/es6.math.log10"); -require("core-js/modules/es6.math.log2.js"); +require("core-js/modules/es6.math.log2"); -require("core-js/modules/es6.math.sign.js"); +require("core-js/modules/es6.math.sign"); -require("core-js/modules/es6.math.sinh.js"); +require("core-js/modules/es6.math.sinh"); -require("core-js/modules/es6.math.tanh.js"); +require("core-js/modules/es6.math.tanh"); -require("core-js/modules/es6.math.trunc.js"); +require("core-js/modules/es6.math.trunc"); -require("core-js/modules/es6.number.constructor.js"); +require("core-js/modules/es6.number.constructor"); -require("core-js/modules/es6.number.epsilon.js"); +require("core-js/modules/es6.number.epsilon"); -require("core-js/modules/es6.number.is-finite.js"); +require("core-js/modules/es6.number.is-finite"); -require("core-js/modules/es6.number.is-integer.js"); +require("core-js/modules/es6.number.is-integer"); -require("core-js/modules/es6.number.is-nan.js"); +require("core-js/modules/es6.number.is-nan"); -require("core-js/modules/es6.number.is-safe-integer.js"); +require("core-js/modules/es6.number.is-safe-integer"); -require("core-js/modules/es6.number.max-safe-integer.js"); +require("core-js/modules/es6.number.max-safe-integer"); -require("core-js/modules/es6.number.min-safe-integer.js"); +require("core-js/modules/es6.number.min-safe-integer"); -require("core-js/modules/es6.number.parse-float.js"); +require("core-js/modules/es6.number.parse-float"); -require("core-js/modules/es6.number.parse-int.js"); +require("core-js/modules/es6.number.parse-int"); -require("core-js/modules/es6.object.assign.js"); +require("core-js/modules/es6.object.assign"); -require("core-js/modules/es6.object.create.js"); +require("core-js/modules/es6.object.create"); -require("core-js/modules/es7.object.define-getter.js"); +require("core-js/modules/es7.object.define-getter"); -require("core-js/modules/es7.object.define-setter.js"); +require("core-js/modules/es7.object.define-setter"); -require("core-js/modules/es6.object.define-property.js"); +require("core-js/modules/es6.object.define-property"); -require("core-js/modules/es6.object.define-properties.js"); +require("core-js/modules/es6.object.define-properties"); -require("core-js/modules/es7.object.entries.js"); +require("core-js/modules/es7.object.entries"); -require("core-js/modules/es6.object.freeze.js"); +require("core-js/modules/es6.object.freeze"); -require("core-js/modules/es6.object.get-own-property-descriptor.js"); +require("core-js/modules/es6.object.get-own-property-descriptor"); -require("core-js/modules/es7.object.get-own-property-descriptors.js"); +require("core-js/modules/es7.object.get-own-property-descriptors"); -require("core-js/modules/es6.object.get-own-property-names.js"); +require("core-js/modules/es6.object.get-own-property-names"); -require("core-js/modules/es6.object.get-prototype-of.js"); +require("core-js/modules/es6.object.get-prototype-of"); -require("core-js/modules/es7.object.lookup-getter.js"); +require("core-js/modules/es7.object.lookup-getter"); -require("core-js/modules/es7.object.lookup-setter.js"); +require("core-js/modules/es7.object.lookup-setter"); -require("core-js/modules/es6.object.prevent-extensions.js"); +require("core-js/modules/es6.object.prevent-extensions"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); -require("core-js/modules/es6.object.is.js"); +require("core-js/modules/es6.object.is"); -require("core-js/modules/es6.object.is-frozen.js"); +require("core-js/modules/es6.object.is-frozen"); -require("core-js/modules/es6.object.is-sealed.js"); +require("core-js/modules/es6.object.is-sealed"); -require("core-js/modules/es6.object.is-extensible.js"); +require("core-js/modules/es6.object.is-extensible"); -require("core-js/modules/es6.object.keys.js"); +require("core-js/modules/es6.object.keys"); -require("core-js/modules/es6.object.seal.js"); +require("core-js/modules/es6.object.seal"); -require("core-js/modules/es6.object.set-prototype-of.js"); +require("core-js/modules/es6.object.set-prototype-of"); -require("core-js/modules/es7.object.values.js"); +require("core-js/modules/es7.object.values"); -require("core-js/modules/es6.promise.js"); +require("core-js/modules/es6.promise"); -require("core-js/modules/es7.promise.finally.js"); +require("core-js/modules/es7.promise.finally"); -require("core-js/modules/es6.reflect.apply.js"); +require("core-js/modules/es6.reflect.apply"); -require("core-js/modules/es6.reflect.construct.js"); +require("core-js/modules/es6.reflect.construct"); -require("core-js/modules/es6.reflect.define-property.js"); +require("core-js/modules/es6.reflect.define-property"); -require("core-js/modules/es6.reflect.delete-property.js"); +require("core-js/modules/es6.reflect.delete-property"); -require("core-js/modules/es6.reflect.get.js"); +require("core-js/modules/es6.reflect.get"); -require("core-js/modules/es6.reflect.get-own-property-descriptor.js"); +require("core-js/modules/es6.reflect.get-own-property-descriptor"); -require("core-js/modules/es6.reflect.get-prototype-of.js"); +require("core-js/modules/es6.reflect.get-prototype-of"); -require("core-js/modules/es6.reflect.has.js"); +require("core-js/modules/es6.reflect.has"); -require("core-js/modules/es6.reflect.is-extensible.js"); +require("core-js/modules/es6.reflect.is-extensible"); -require("core-js/modules/es6.reflect.own-keys.js"); +require("core-js/modules/es6.reflect.own-keys"); -require("core-js/modules/es6.reflect.prevent-extensions.js"); +require("core-js/modules/es6.reflect.prevent-extensions"); -require("core-js/modules/es6.reflect.set.js"); +require("core-js/modules/es6.reflect.set"); -require("core-js/modules/es6.reflect.set-prototype-of.js"); +require("core-js/modules/es6.reflect.set-prototype-of"); -require("core-js/modules/es6.regexp.constructor.js"); +require("core-js/modules/es6.regexp.constructor"); -require("core-js/modules/es6.regexp.flags.js"); +require("core-js/modules/es6.regexp.flags"); -require("core-js/modules/es6.regexp.match.js"); +require("core-js/modules/es6.regexp.match"); -require("core-js/modules/es6.regexp.replace.js"); +require("core-js/modules/es6.regexp.replace"); -require("core-js/modules/es6.regexp.split.js"); +require("core-js/modules/es6.regexp.split"); -require("core-js/modules/es6.regexp.search.js"); +require("core-js/modules/es6.regexp.search"); -require("core-js/modules/es6.regexp.to-string.js"); +require("core-js/modules/es6.regexp.to-string"); -require("core-js/modules/es6.set.js"); +require("core-js/modules/es6.set"); -require("core-js/modules/es6.symbol.js"); +require("core-js/modules/es6.symbol"); -require("core-js/modules/es7.symbol.async-iterator.js"); +require("core-js/modules/es7.symbol.async-iterator"); -require("core-js/modules/es6.string.anchor.js"); +require("core-js/modules/es6.string.anchor"); -require("core-js/modules/es6.string.big.js"); +require("core-js/modules/es6.string.big"); -require("core-js/modules/es6.string.blink.js"); +require("core-js/modules/es6.string.blink"); -require("core-js/modules/es6.string.bold.js"); +require("core-js/modules/es6.string.bold"); -require("core-js/modules/es6.string.code-point-at.js"); +require("core-js/modules/es6.string.code-point-at"); -require("core-js/modules/es6.string.ends-with.js"); +require("core-js/modules/es6.string.ends-with"); -require("core-js/modules/es6.string.fixed.js"); +require("core-js/modules/es6.string.fixed"); -require("core-js/modules/es6.string.fontcolor.js"); +require("core-js/modules/es6.string.fontcolor"); -require("core-js/modules/es6.string.fontsize.js"); +require("core-js/modules/es6.string.fontsize"); -require("core-js/modules/es6.string.from-code-point.js"); +require("core-js/modules/es6.string.from-code-point"); -require("core-js/modules/es6.string.includes.js"); +require("core-js/modules/es6.string.includes"); -require("core-js/modules/es6.string.italics.js"); +require("core-js/modules/es6.string.italics"); -require("core-js/modules/es6.string.iterator.js"); +require("core-js/modules/es6.string.iterator"); -require("core-js/modules/es6.string.link.js"); +require("core-js/modules/es6.string.link"); -require("core-js/modules/es7.string.pad-start.js"); +require("core-js/modules/es7.string.pad-start"); -require("core-js/modules/es7.string.pad-end.js"); +require("core-js/modules/es7.string.pad-end"); -require("core-js/modules/es6.string.raw.js"); +require("core-js/modules/es6.string.raw"); -require("core-js/modules/es6.string.repeat.js"); +require("core-js/modules/es6.string.repeat"); -require("core-js/modules/es6.string.small.js"); +require("core-js/modules/es6.string.small"); -require("core-js/modules/es6.string.starts-with.js"); +require("core-js/modules/es6.string.starts-with"); -require("core-js/modules/es6.string.strike.js"); +require("core-js/modules/es6.string.strike"); -require("core-js/modules/es6.string.sub.js"); +require("core-js/modules/es6.string.sub"); -require("core-js/modules/es6.string.sup.js"); +require("core-js/modules/es6.string.sup"); -require("core-js/modules/es6.string.trim.js"); +require("core-js/modules/es6.string.trim"); -require("core-js/modules/es7.string.trim-left.js"); +require("core-js/modules/es7.string.trim-left"); -require("core-js/modules/es7.string.trim-right.js"); +require("core-js/modules/es7.string.trim-right"); -require("core-js/modules/es6.typed.array-buffer.js"); +require("core-js/modules/es6.typed.array-buffer"); -require("core-js/modules/es6.typed.data-view.js"); +require("core-js/modules/es6.typed.data-view"); -require("core-js/modules/es6.typed.int8-array.js"); +require("core-js/modules/es6.typed.int8-array"); -require("core-js/modules/es6.typed.uint8-array.js"); +require("core-js/modules/es6.typed.uint8-array"); -require("core-js/modules/es6.typed.uint8-clamped-array.js"); +require("core-js/modules/es6.typed.uint8-clamped-array"); -require("core-js/modules/es6.typed.int16-array.js"); +require("core-js/modules/es6.typed.int16-array"); -require("core-js/modules/es6.typed.uint16-array.js"); +require("core-js/modules/es6.typed.uint16-array"); -require("core-js/modules/es6.typed.int32-array.js"); +require("core-js/modules/es6.typed.int32-array"); -require("core-js/modules/es6.typed.uint32-array.js"); +require("core-js/modules/es6.typed.uint32-array"); -require("core-js/modules/es6.typed.float32-array.js"); +require("core-js/modules/es6.typed.float32-array"); -require("core-js/modules/es6.typed.float64-array.js"); +require("core-js/modules/es6.typed.float64-array"); -require("core-js/modules/es6.weak-map.js"); +require("core-js/modules/es6.weak-map"); -require("core-js/modules/es6.weak-set.js"); +require("core-js/modules/es6.weak-set"); -require("core-js/modules/web.timers.js"); +require("core-js/modules/web.timers"); -require("core-js/modules/web.immediate.js"); +require("core-js/modules/web.immediate"); -require("core-js/modules/web.dom.iterable.js"); +require("core-js/modules/web.dom.iterable"); -require("regenerator-runtime/runtime.js"); +require("regenerator-runtime/runtime"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs index 94a7a9e9d580..71b8fdb1d834 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-built-ins/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs index 34713f0f0404..265ac0ac0365 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-include/output.mjs @@ -1,20 +1,20 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.map"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs index 7e9825a05bd8..e8994bd76301 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/exclude-regenerator/output.mjs @@ -1,148 +1,148 @@ -import "core-js/modules/es6.array.copy-within.js"; -import "core-js/modules/es6.array.every.js"; -import "core-js/modules/es6.array.fill.js"; -import "core-js/modules/es6.array.filter.js"; -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es6.array.find-index.js"; -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.for-each.js"; -import "core-js/modules/es6.array.from.js"; -import "core-js/modules/es7.array.includes.js"; -import "core-js/modules/es6.array.index-of.js"; -import "core-js/modules/es6.array.is-array.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.array.last-index-of.js"; -import "core-js/modules/es6.array.map.js"; -import "core-js/modules/es6.array.of.js"; -import "core-js/modules/es6.array.reduce.js"; -import "core-js/modules/es6.array.reduce-right.js"; -import "core-js/modules/es6.array.some.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.array.species.js"; -import "core-js/modules/es6.date.now.js"; -import "core-js/modules/es6.date.to-iso-string.js"; -import "core-js/modules/es6.date.to-json.js"; -import "core-js/modules/es6.date.to-primitive.js"; -import "core-js/modules/es6.date.to-string.js"; -import "core-js/modules/es6.function.bind.js"; -import "core-js/modules/es6.function.has-instance.js"; -import "core-js/modules/es6.function.name.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.math.acosh.js"; -import "core-js/modules/es6.math.asinh.js"; -import "core-js/modules/es6.math.atanh.js"; -import "core-js/modules/es6.math.cbrt.js"; -import "core-js/modules/es6.math.clz32.js"; -import "core-js/modules/es6.math.cosh.js"; -import "core-js/modules/es6.math.expm1.js"; -import "core-js/modules/es6.math.fround.js"; -import "core-js/modules/es6.math.hypot.js"; -import "core-js/modules/es6.math.imul.js"; -import "core-js/modules/es6.math.log1p.js"; -import "core-js/modules/es6.math.log10.js"; -import "core-js/modules/es6.math.log2.js"; -import "core-js/modules/es6.math.sign.js"; -import "core-js/modules/es6.math.sinh.js"; -import "core-js/modules/es6.math.tanh.js"; -import "core-js/modules/es6.math.trunc.js"; -import "core-js/modules/es6.number.constructor.js"; -import "core-js/modules/es6.number.epsilon.js"; -import "core-js/modules/es6.number.is-finite.js"; -import "core-js/modules/es6.number.is-integer.js"; -import "core-js/modules/es6.number.is-nan.js"; -import "core-js/modules/es6.number.is-safe-integer.js"; -import "core-js/modules/es6.number.max-safe-integer.js"; -import "core-js/modules/es6.number.min-safe-integer.js"; -import "core-js/modules/es6.number.parse-float.js"; -import "core-js/modules/es6.number.parse-int.js"; -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/es6.object.create.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es6.object.define-property.js"; -import "core-js/modules/es6.object.define-properties.js"; -import "core-js/modules/es7.object.entries.js"; -import "core-js/modules/es6.object.freeze.js"; -import "core-js/modules/es6.object.get-own-property-descriptor.js"; -import "core-js/modules/es7.object.get-own-property-descriptors.js"; -import "core-js/modules/es6.object.get-own-property-names.js"; -import "core-js/modules/es6.object.get-prototype-of.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.prevent-extensions.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.object.is.js"; -import "core-js/modules/es6.object.is-frozen.js"; -import "core-js/modules/es6.object.is-sealed.js"; -import "core-js/modules/es6.object.is-extensible.js"; -import "core-js/modules/es6.object.keys.js"; -import "core-js/modules/es6.object.seal.js"; -import "core-js/modules/es6.object.set-prototype-of.js"; -import "core-js/modules/es7.object.values.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.reflect.apply.js"; -import "core-js/modules/es6.reflect.construct.js"; -import "core-js/modules/es6.reflect.define-property.js"; -import "core-js/modules/es6.reflect.delete-property.js"; -import "core-js/modules/es6.reflect.get.js"; -import "core-js/modules/es6.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es6.reflect.get-prototype-of.js"; -import "core-js/modules/es6.reflect.has.js"; -import "core-js/modules/es6.reflect.is-extensible.js"; -import "core-js/modules/es6.reflect.own-keys.js"; -import "core-js/modules/es6.reflect.prevent-extensions.js"; -import "core-js/modules/es6.reflect.set.js"; -import "core-js/modules/es6.reflect.set-prototype-of.js"; -import "core-js/modules/es6.regexp.constructor.js"; -import "core-js/modules/es6.regexp.flags.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.regexp.to-string.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.string.anchor.js"; -import "core-js/modules/es6.string.big.js"; -import "core-js/modules/es6.string.blink.js"; -import "core-js/modules/es6.string.bold.js"; -import "core-js/modules/es6.string.code-point-at.js"; -import "core-js/modules/es6.string.ends-with.js"; -import "core-js/modules/es6.string.fixed.js"; -import "core-js/modules/es6.string.fontcolor.js"; -import "core-js/modules/es6.string.fontsize.js"; -import "core-js/modules/es6.string.from-code-point.js"; -import "core-js/modules/es6.string.includes.js"; -import "core-js/modules/es6.string.italics.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.string.link.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es6.string.raw.js"; -import "core-js/modules/es6.string.repeat.js"; -import "core-js/modules/es6.string.small.js"; -import "core-js/modules/es6.string.starts-with.js"; -import "core-js/modules/es6.string.strike.js"; -import "core-js/modules/es6.string.sub.js"; -import "core-js/modules/es6.string.sup.js"; -import "core-js/modules/es6.string.trim.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/es6.typed.array-buffer.js"; -import "core-js/modules/es6.typed.data-view.js"; -import "core-js/modules/es6.typed.int8-array.js"; -import "core-js/modules/es6.typed.uint8-array.js"; -import "core-js/modules/es6.typed.uint8-clamped-array.js"; -import "core-js/modules/es6.typed.int16-array.js"; -import "core-js/modules/es6.typed.uint16-array.js"; -import "core-js/modules/es6.typed.int32-array.js"; -import "core-js/modules/es6.typed.uint32-array.js"; -import "core-js/modules/es6.typed.float32-array.js"; -import "core-js/modules/es6.typed.float64-array.js"; -import "core-js/modules/es6.weak-map.js"; -import "core-js/modules/es6.weak-set.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es6.array.copy-within"; +import "core-js/modules/es6.array.every"; +import "core-js/modules/es6.array.fill"; +import "core-js/modules/es6.array.filter"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es6.array.find-index"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.for-each"; +import "core-js/modules/es6.array.from"; +import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.array.index-of"; +import "core-js/modules/es6.array.is-array"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.array.last-index-of"; +import "core-js/modules/es6.array.map"; +import "core-js/modules/es6.array.of"; +import "core-js/modules/es6.array.reduce"; +import "core-js/modules/es6.array.reduce-right"; +import "core-js/modules/es6.array.some"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.array.species"; +import "core-js/modules/es6.date.now"; +import "core-js/modules/es6.date.to-iso-string"; +import "core-js/modules/es6.date.to-json"; +import "core-js/modules/es6.date.to-primitive"; +import "core-js/modules/es6.date.to-string"; +import "core-js/modules/es6.function.bind"; +import "core-js/modules/es6.function.has-instance"; +import "core-js/modules/es6.function.name"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.math.acosh"; +import "core-js/modules/es6.math.asinh"; +import "core-js/modules/es6.math.atanh"; +import "core-js/modules/es6.math.cbrt"; +import "core-js/modules/es6.math.clz32"; +import "core-js/modules/es6.math.cosh"; +import "core-js/modules/es6.math.expm1"; +import "core-js/modules/es6.math.fround"; +import "core-js/modules/es6.math.hypot"; +import "core-js/modules/es6.math.imul"; +import "core-js/modules/es6.math.log1p"; +import "core-js/modules/es6.math.log10"; +import "core-js/modules/es6.math.log2"; +import "core-js/modules/es6.math.sign"; +import "core-js/modules/es6.math.sinh"; +import "core-js/modules/es6.math.tanh"; +import "core-js/modules/es6.math.trunc"; +import "core-js/modules/es6.number.constructor"; +import "core-js/modules/es6.number.epsilon"; +import "core-js/modules/es6.number.is-finite"; +import "core-js/modules/es6.number.is-integer"; +import "core-js/modules/es6.number.is-nan"; +import "core-js/modules/es6.number.is-safe-integer"; +import "core-js/modules/es6.number.max-safe-integer"; +import "core-js/modules/es6.number.min-safe-integer"; +import "core-js/modules/es6.number.parse-float"; +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/es6.object.create"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es6.object.define-property"; +import "core-js/modules/es6.object.define-properties"; +import "core-js/modules/es7.object.entries"; +import "core-js/modules/es6.object.freeze"; +import "core-js/modules/es6.object.get-own-property-descriptor"; +import "core-js/modules/es7.object.get-own-property-descriptors"; +import "core-js/modules/es6.object.get-own-property-names"; +import "core-js/modules/es6.object.get-prototype-of"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.prevent-extensions"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.object.is"; +import "core-js/modules/es6.object.is-frozen"; +import "core-js/modules/es6.object.is-sealed"; +import "core-js/modules/es6.object.is-extensible"; +import "core-js/modules/es6.object.keys"; +import "core-js/modules/es6.object.seal"; +import "core-js/modules/es6.object.set-prototype-of"; +import "core-js/modules/es7.object.values"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.reflect.apply"; +import "core-js/modules/es6.reflect.construct"; +import "core-js/modules/es6.reflect.define-property"; +import "core-js/modules/es6.reflect.delete-property"; +import "core-js/modules/es6.reflect.get"; +import "core-js/modules/es6.reflect.get-own-property-descriptor"; +import "core-js/modules/es6.reflect.get-prototype-of"; +import "core-js/modules/es6.reflect.has"; +import "core-js/modules/es6.reflect.is-extensible"; +import "core-js/modules/es6.reflect.own-keys"; +import "core-js/modules/es6.reflect.prevent-extensions"; +import "core-js/modules/es6.reflect.set"; +import "core-js/modules/es6.reflect.set-prototype-of"; +import "core-js/modules/es6.regexp.constructor"; +import "core-js/modules/es6.regexp.flags"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.regexp.to-string"; +import "core-js/modules/es6.set"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.string.anchor"; +import "core-js/modules/es6.string.big"; +import "core-js/modules/es6.string.blink"; +import "core-js/modules/es6.string.bold"; +import "core-js/modules/es6.string.code-point-at"; +import "core-js/modules/es6.string.ends-with"; +import "core-js/modules/es6.string.fixed"; +import "core-js/modules/es6.string.fontcolor"; +import "core-js/modules/es6.string.fontsize"; +import "core-js/modules/es6.string.from-code-point"; +import "core-js/modules/es6.string.includes"; +import "core-js/modules/es6.string.italics"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.string.link"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es6.string.raw"; +import "core-js/modules/es6.string.repeat"; +import "core-js/modules/es6.string.small"; +import "core-js/modules/es6.string.starts-with"; +import "core-js/modules/es6.string.strike"; +import "core-js/modules/es6.string.sub"; +import "core-js/modules/es6.string.sup"; +import "core-js/modules/es6.string.trim"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/es6.typed.array-buffer"; +import "core-js/modules/es6.typed.data-view"; +import "core-js/modules/es6.typed.int8-array"; +import "core-js/modules/es6.typed.uint8-array"; +import "core-js/modules/es6.typed.uint8-clamped-array"; +import "core-js/modules/es6.typed.int16-array"; +import "core-js/modules/es6.typed.uint16-array"; +import "core-js/modules/es6.typed.int32-array"; +import "core-js/modules/es6.typed.uint32-array"; +import "core-js/modules/es6.typed.float32-array"; +import "core-js/modules/es6.typed.float64-array"; +import "core-js/modules/es6.weak-map"; +import "core-js/modules/es6.weak-set"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs index 60839e67fabc..3cb3bf4ca5aa 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/force-all-transforms/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; +import "regenerator-runtime/runtime"; var a = 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs index e1954cab2637..cdc603eea1d3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/include-built-ins/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/es7.array.flat-map.js"; -import "core-js/modules/es6.array.sort.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es7.object.define-getter.js"; -import "core-js/modules/es7.object.define-setter.js"; -import "core-js/modules/es7.object.lookup-getter.js"; -import "core-js/modules/es7.object.lookup-setter.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.set.js"; -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.trim-left.js"; -import "core-js/modules/es7.string.trim-right.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.array.flat-map"; +import "core-js/modules/es6.array.sort"; +import "core-js/modules/es6.map"; +import "core-js/modules/es7.object.define-getter"; +import "core-js/modules/es7.object.define-setter"; +import "core-js/modules/es7.object.lookup-getter"; +import "core-js/modules/es7.object.lookup-setter"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.set"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.trim-left"; +import "core-js/modules/es7.string.trim-right"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.dom.iterable"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs index 6512ed99e3c0..ccc11ee5c78d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-all/output.mjs @@ -1,13 +1,13 @@ -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/es6.regexp.match.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/es6.regexp.match"; +import "core-js/modules/es6.promise"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.array.from"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs index 4fe6620a6201..71719adea2ca 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/web.dom.iterable"; var a = new Map(); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs index d3ed9f7ffb41..113f840cdd16 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-class-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es6.object.assign.js"; -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.object.assign"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.object.to-string"; var objectClass = Object; var arrayInstance = []; var assignStr = "assign"; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs index ae45b1ccf195..726b4b40a3b6 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-instance-methods/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es7.array.includes.js"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es7.array.includes"; var arrayInstance = []; var inclidesStr = "includes"; var findStr = "find"; // Allow instance methods be assigned to variables. diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs index 0ac3ed1d7662..8ce9547c189d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es6.array.map.js"; -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es7.object.values.js"; +import "core-js/modules/es6.array.map"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es7.object.values"; Object['values'](); // include []['map'](); // include @@ -10,3 +10,4 @@ Object['values'](); // include Object[keys](); // don't include [][filter](); // don't include + diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs index 5f5557676306..6762f8384120 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-for-of-destructure-with/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.pad-start.js"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.pad-start"; for (const { padStart diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs index 92269937e9c0..98577785b4fe 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods-native-support/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/web.dom.iterable"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs index 250d30f782da..e0f8fc879b64 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-instance-methods/output.mjs @@ -1,24 +1,24 @@ -import "core-js/modules/es6.regexp.split.js"; -import "core-js/modules/es6.regexp.replace.js"; -import "core-js/modules/es6.regexp.search.js"; -import "core-js/modules/es6.array.copy-within.js"; -import "core-js/modules/es6.string.ends-with.js"; -import "core-js/modules/es6.string.code-point-at.js"; -import "core-js/modules/es6.string.starts-with.js"; -import "core-js/modules/es7.string.pad-end.js"; -import "core-js/modules/es7.string.pad-start.js"; -import "core-js/modules/es6.array.fill.js"; -import "core-js/modules/es6.function.bind.js"; -import "core-js/modules/es6.array.find-index.js"; -import "core-js/modules/es6.array.find.js"; -import "core-js/modules/es7.array.includes.js"; -import "core-js/modules/es6.string.includes.js"; -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.object.to-string.js"; -import "core-js/modules/es6.map.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.array.from.js"; +import "core-js/modules/es6.regexp.split"; +import "core-js/modules/es6.regexp.replace"; +import "core-js/modules/es6.regexp.search"; +import "core-js/modules/es6.array.copy-within"; +import "core-js/modules/es6.string.ends-with"; +import "core-js/modules/es6.string.code-point-at"; +import "core-js/modules/es6.string.starts-with"; +import "core-js/modules/es7.string.pad-end"; +import "core-js/modules/es7.string.pad-start"; +import "core-js/modules/es6.array.fill"; +import "core-js/modules/es6.function.bind"; +import "core-js/modules/es6.array.find-index"; +import "core-js/modules/es6.array.find"; +import "core-js/modules/es7.array.includes"; +import "core-js/modules/es6.string.includes"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.object.to-string"; +import "core-js/modules/es6.map"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.array.from"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js index 63fb2491591c..4a62ea9e8164 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-modules-transform/output.js @@ -1,7 +1,7 @@ "use strict"; -require("core-js/modules/es6.promise.js"); +require("core-js/modules/es6.promise"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); Promise; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs index a47c05365d53..845aac57c5c0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-native-support/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/web.dom.iterable"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs index 4706b0b649e3..7e47082d45e4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-number-ie-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.number.parse-int.js"; -import "core-js/modules/es6.number.constructor.js"; -import "core-js/modules/es6.number.parse-float.js"; +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.number.constructor"; +import "core-js/modules/es6.number.parse-float"; Number.parseFloat("3.14"); Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs index 2fdc46576a55..199377053c8a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-all/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es6.object.to-string"; var p = Promise.resolve(0); Promise.all([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs index bd2a053b687b..a2103a5120a2 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-finally/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es7.promise.finally.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es7.promise.finally"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es6.object.to-string"; var p = Promise.resolve(0); p.finally(function () { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs index 530e1fbb1477..b4a03612d049 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-promise-race/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/web.dom.iterable.js"; -import "core-js/modules/es6.array.iterator.js"; -import "core-js/modules/es6.string.iterator.js"; -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.array.iterator"; +import "core-js/modules/es6.string.iterator"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es6.object.to-string"; var p = Promise.resolve(0); Promise.race([p]).then(function (outcome) { alert("OK"); 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 c73c0f569615..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,4 +1,4 @@ -import "regenerator-runtime/runtime.js"; +import "regenerator-runtime/runtime"; function a() { return regeneratorRuntime.async(function a$(_context) { diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs index 571c3d9e614a..ce5acd262e9f 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-regenerator-used-generator/output.mjs @@ -1,4 +1,4 @@ -import "regenerator-runtime/runtime.js"; +import "regenerator-runtime/runtime"; var _marked = /*#__PURE__*/ 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 5dc8847cf692..53afb8206c83 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 @@ -1,32 +1,32 @@ "use strict"; -require("core-js/modules/es6.object.define-properties.js"); +require("core-js/modules/es6.object.define-properties"); -require("core-js/modules/es7.object.get-own-property-descriptors.js"); +require("core-js/modules/es7.object.get-own-property-descriptors"); -require("core-js/modules/es6.array.for-each.js"); +require("core-js/modules/es6.array.for-each"); -require("core-js/modules/es6.array.filter.js"); +require("core-js/modules/es6.array.filter"); -require("core-js/modules/es6.object.define-property.js"); +require("core-js/modules/es6.object.define-property"); -require("core-js/modules/es6.array.index-of.js"); +require("core-js/modules/es6.array.index-of"); -require("core-js/modules/web.dom.iterable.js"); +require("core-js/modules/web.dom.iterable"); -require("core-js/modules/es6.array.iterator.js"); +require("core-js/modules/es6.array.iterator"); -require("core-js/modules/es6.object.keys.js"); +require("core-js/modules/es6.object.keys"); -require("regenerator-runtime/runtime.js"); +require("regenerator-runtime/runtime"); -require("core-js/modules/es7.symbol.async-iterator.js"); +require("core-js/modules/es7.symbol.async-iterator"); -require("core-js/modules/es6.symbol.js"); +require("core-js/modules/es6.symbol"); -require("core-js/modules/es6.promise.js"); +require("core-js/modules/es6.promise"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js index 8532303350ac..6f953a53d427 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script-query/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es7.array.includes.js"); +require("core-js/modules/es7.array.includes"); -require("core-js/modules/es6.promise.js"); +require("core-js/modules/es6.promise"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js index 8532303350ac..6f953a53d427 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-source-type-script/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es7.array.includes.js"); +require("core-js/modules/es7.array.includes"); -require("core-js/modules/es6.promise.js"); +require("core-js/modules/es6.promise"); -require("core-js/modules/es6.object.to-string.js"); +require("core-js/modules/es6.object.to-string"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs index 2849b1a039e6..024e49245f9c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator-in/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/web.dom.iterable"; Symbol.iterator in arr; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs index 07219832983e..a99eae6b7eb3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-symbol-iterator/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es7.symbol.async-iterator.js"; -import "core-js/modules/es6.symbol.js"; -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/es7.symbol.async-iterator"; +import "core-js/modules/es6.symbol"; +import "core-js/modules/web.dom.iterable"; arr[Symbol.iterator](); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs index 7ad87d9bee6e..9f0806068bfb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-timers/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es6.promise.js"; -import "core-js/modules/es6.object.to-string.js"; +import "core-js/modules/es6.promise"; +import "core-js/modules/es6.object.to-string"; Promise.resolve().then(function (it) { setTimeout(foo, 1, 2); setInterval(foo, 1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs index a2f08cc2f4d4..995d901c5ced 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array-static/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.int8-array"; Int8Array.of(); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs index 06fa6ff9568b..5f5982426d2b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-typed-array/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es6.typed.int8-array.js"; +import "core-js/modules/es6.typed.int8-array"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs index 8b71967b061b..25cd531c2235 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-yield-star/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/web.dom.iterable.js"; +import "core-js/modules/web.dom.iterable"; function* a() { yield* 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs index 798a7c828d60..efa4728cac88 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all-chrome-71/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; -import "core-js/modules/web.immediate.js"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/web.immediate"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs index fd39d7a3b317..de6d3f35f1d0 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-all/output.mjs @@ -1,291 +1,291 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.every.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.is-array.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.reduce.js"; -import "core-js/modules/es.array.reduce-right.js"; -import "core-js/modules/es.array.reverse.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.some.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.array-buffer.is-view.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.date.now.js"; -import "core-js/modules/es.date.to-iso-string.js"; -import "core-js/modules/es.date.to-json.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.date.to-string.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.number.to-precision.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-properties.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.parse-float.js"; -import "core-js/modules/es.parse-int.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.global-this.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.is-array"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; +import "core-js/modules/es.array.reverse"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.array-buffer.is-view"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.data-view"; +import "core-js/modules/es.date.now"; +import "core-js/modules/es.date.to-iso-string"; +import "core-js/modules/es.date.to-json"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.date.to-string"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.number.to-precision"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.create"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-properties"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.parse-float"; +import "core-js/modules/es.parse-int"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.global-this"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs index 601127a9745c..064f9d4a4469 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-48/output.mjs @@ -1,97 +1,97 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs index a13a091765f8..add5d817c3ca 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-49/output.mjs @@ -1,78 +1,78 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; Math.pow(1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs index 502e4f373a90..8051a9cde054 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-66/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs index 084a2d1b4ee7..7ff494cd47e4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chrome-71/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/web.immediate.js"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/web.immediate"; const foo = { a: true }; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs index 57993826a43d..929415b8b20e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-chromeandroid/output.mjs @@ -1,26 +1,26 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs index 27fe9ec4c6e3..34a798940e85 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-electron/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; a ** b; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs index 09e8d2f08d22..be5df68026ae 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage-chrome-71/output.mjs @@ -1,85 +1,85 @@ -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs index fe66e4a68403..51a04c11f07a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-es-proposals-stage/output.mjs @@ -1,286 +1,286 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.every.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.is-array.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.reduce.js"; -import "core-js/modules/es.array.reduce-right.js"; -import "core-js/modules/es.array.reverse.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.some.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.array-buffer.is-view.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.date.now.js"; -import "core-js/modules/es.date.to-iso-string.js"; -import "core-js/modules/es.date.to-json.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.date.to-string.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.number.to-precision.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-properties.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.parse-float.js"; -import "core-js/modules/es.parse-int.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.global-this.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.is-array"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; +import "core-js/modules/es.array.reverse"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.array-buffer.is-view"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.data-view"; +import "core-js/modules/es.date.now"; +import "core-js/modules/es.date.to-iso-string"; +import "core-js/modules/es.date.to-json"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.date.to-string"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.number.to-precision"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.create"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-properties"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.parse-float"; +import "core-js/modules/es.parse-int"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.global-this"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs index 71011e6365c3..709c4c46f314 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features-chrome-71/output.mjs @@ -1,20 +1,20 @@ -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.replace-all.js"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.replace-all"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs index 85587d7b4a1f..bd40e3a515d5 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-features/output.mjs @@ -1,26 +1,26 @@ -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/web.dom-collections.iterator"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs index 2473bf6c7026..db5f1173b2fc 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-missed/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; import 'core-js/features/something.new'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs index 7b9b5ef5dbe8..ef5c31db184c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed-chrome-71/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; import 'core-js/something'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs index 885edac26439..24251fba896e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-mixed/output.mjs @@ -1,52 +1,52 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-properties.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.create"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-properties"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; import 'core-js/something'; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs index 397c25c08b26..55d6e9dbd5c4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules-chrome-71/output.mjs @@ -1,2 +1,2 @@ -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.string.replace-all.js"; +import 'core-js/modules/es.object.from-entries'; +import 'core-js/modules/esnext.string.replace-all'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs index 332d84698bac..e761a4ac12c5 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-modules/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/esnext.string.replace-all.js"; +import 'core-js/modules/es.symbol'; +import 'core-js/modules/es.object.from-entries'; +import 'core-js/modules/esnext.string.replace-all'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs index 017c5c10d294..c010a7b5fccb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals-chrome-71/output.mjs @@ -1,81 +1,81 @@ -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs index 4dee28cfd441..d59c98b71768 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-proposals/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.global-this.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.global-this"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs index 047f3181727f..770311665f95 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable-chrome-71/output.mjs @@ -1 +1 @@ -import "core-js/modules/es.object.from-entries.js"; +import "core-js/modules/es.object.from-entries"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs index 013b99c3059e..896c1ad687dd 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stable/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs index 017c5c10d294..c010a7b5fccb 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage-chrome-71/output.mjs @@ -1,81 +1,81 @@ -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs index 4dee28cfd441..d59c98b71768 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-stage/output.mjs @@ -1,86 +1,86 @@ -import "core-js/modules/esnext.aggregate-error.js"; -import "core-js/modules/esnext.array.last-index.js"; -import "core-js/modules/esnext.array.last-item.js"; -import "core-js/modules/esnext.composite-key.js"; -import "core-js/modules/esnext.composite-symbol.js"; -import "core-js/modules/esnext.global-this.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.from.js"; -import "core-js/modules/esnext.map.group-by.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-by.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.of.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.math.clamp.js"; -import "core-js/modules/esnext.math.deg-per-rad.js"; -import "core-js/modules/esnext.math.degrees.js"; -import "core-js/modules/esnext.math.fscale.js"; -import "core-js/modules/esnext.math.iaddh.js"; -import "core-js/modules/esnext.math.imulh.js"; -import "core-js/modules/esnext.math.isubh.js"; -import "core-js/modules/esnext.math.rad-per-deg.js"; -import "core-js/modules/esnext.math.radians.js"; -import "core-js/modules/esnext.math.scale.js"; -import "core-js/modules/esnext.math.seeded-prng.js"; -import "core-js/modules/esnext.math.signbit.js"; -import "core-js/modules/esnext.math.umulh.js"; -import "core-js/modules/esnext.number.from-string.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.promise.all-settled.js"; -import "core-js/modules/esnext.promise.any.js"; -import "core-js/modules/esnext.promise.try.js"; -import "core-js/modules/esnext.reflect.define-metadata.js"; -import "core-js/modules/esnext.reflect.delete-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata.js"; -import "core-js/modules/esnext.reflect.get-metadata-keys.js"; -import "core-js/modules/esnext.reflect.get-own-metadata.js"; -import "core-js/modules/esnext.reflect.get-own-metadata-keys.js"; -import "core-js/modules/esnext.reflect.has-metadata.js"; -import "core-js/modules/esnext.reflect.has-own-metadata.js"; -import "core-js/modules/esnext.reflect.metadata.js"; -import "core-js/modules/esnext.set.add-all.js"; -import "core-js/modules/esnext.set.delete-all.js"; -import "core-js/modules/esnext.set.difference.js"; -import "core-js/modules/esnext.set.every.js"; -import "core-js/modules/esnext.set.filter.js"; -import "core-js/modules/esnext.set.find.js"; -import "core-js/modules/esnext.set.from.js"; -import "core-js/modules/esnext.set.intersection.js"; -import "core-js/modules/esnext.set.is-disjoint-from.js"; -import "core-js/modules/esnext.set.is-subset-of.js"; -import "core-js/modules/esnext.set.is-superset-of.js"; -import "core-js/modules/esnext.set.join.js"; -import "core-js/modules/esnext.set.map.js"; -import "core-js/modules/esnext.set.of.js"; -import "core-js/modules/esnext.set.reduce.js"; -import "core-js/modules/esnext.set.some.js"; -import "core-js/modules/esnext.set.symmetric-difference.js"; -import "core-js/modules/esnext.set.union.js"; -import "core-js/modules/esnext.string.at.js"; -import "core-js/modules/esnext.string.code-points.js"; -import "core-js/modules/esnext.string.match-all.js"; -import "core-js/modules/esnext.string.replace-all.js"; -import "core-js/modules/esnext.symbol.dispose.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/esnext.symbol.pattern-match.js"; -import "core-js/modules/esnext.weak-map.delete-all.js"; -import "core-js/modules/esnext.weak-map.from.js"; -import "core-js/modules/esnext.weak-map.of.js"; -import "core-js/modules/esnext.weak-set.add-all.js"; -import "core-js/modules/esnext.weak-set.delete-all.js"; -import "core-js/modules/esnext.weak-set.from.js"; -import "core-js/modules/esnext.weak-set.of.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/esnext.aggregate-error"; +import "core-js/modules/esnext.array.last-index"; +import "core-js/modules/esnext.array.last-item"; +import "core-js/modules/esnext.composite-key"; +import "core-js/modules/esnext.composite-symbol"; +import "core-js/modules/esnext.global-this"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.from"; +import "core-js/modules/esnext.map.group-by"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-by"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.of"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.math.clamp"; +import "core-js/modules/esnext.math.deg-per-rad"; +import "core-js/modules/esnext.math.degrees"; +import "core-js/modules/esnext.math.fscale"; +import "core-js/modules/esnext.math.iaddh"; +import "core-js/modules/esnext.math.imulh"; +import "core-js/modules/esnext.math.isubh"; +import "core-js/modules/esnext.math.rad-per-deg"; +import "core-js/modules/esnext.math.radians"; +import "core-js/modules/esnext.math.scale"; +import "core-js/modules/esnext.math.seeded-prng"; +import "core-js/modules/esnext.math.signbit"; +import "core-js/modules/esnext.math.umulh"; +import "core-js/modules/esnext.number.from-string"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.promise.all-settled"; +import "core-js/modules/esnext.promise.any"; +import "core-js/modules/esnext.promise.try"; +import "core-js/modules/esnext.reflect.define-metadata"; +import "core-js/modules/esnext.reflect.delete-metadata"; +import "core-js/modules/esnext.reflect.get-metadata"; +import "core-js/modules/esnext.reflect.get-metadata-keys"; +import "core-js/modules/esnext.reflect.get-own-metadata"; +import "core-js/modules/esnext.reflect.get-own-metadata-keys"; +import "core-js/modules/esnext.reflect.has-metadata"; +import "core-js/modules/esnext.reflect.has-own-metadata"; +import "core-js/modules/esnext.reflect.metadata"; +import "core-js/modules/esnext.set.add-all"; +import "core-js/modules/esnext.set.delete-all"; +import "core-js/modules/esnext.set.difference"; +import "core-js/modules/esnext.set.every"; +import "core-js/modules/esnext.set.filter"; +import "core-js/modules/esnext.set.find"; +import "core-js/modules/esnext.set.from"; +import "core-js/modules/esnext.set.intersection"; +import "core-js/modules/esnext.set.is-disjoint-from"; +import "core-js/modules/esnext.set.is-subset-of"; +import "core-js/modules/esnext.set.is-superset-of"; +import "core-js/modules/esnext.set.join"; +import "core-js/modules/esnext.set.map"; +import "core-js/modules/esnext.set.of"; +import "core-js/modules/esnext.set.reduce"; +import "core-js/modules/esnext.set.some"; +import "core-js/modules/esnext.set.symmetric-difference"; +import "core-js/modules/esnext.set.union"; +import "core-js/modules/esnext.string.at"; +import "core-js/modules/esnext.string.code-points"; +import "core-js/modules/esnext.string.match-all"; +import "core-js/modules/esnext.string.replace-all"; +import "core-js/modules/esnext.symbol.dispose"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/esnext.symbol.pattern-match"; +import "core-js/modules/esnext.weak-map.delete-all"; +import "core-js/modules/esnext.weak-map.from"; +import "core-js/modules/esnext.weak-map.of"; +import "core-js/modules/esnext.weak-set.add-all"; +import "core-js/modules/esnext.weak-set.delete-all"; +import "core-js/modules/esnext.weak-set.from"; +import "core-js/modules/esnext.weak-set.of"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs index 5e2ff95b9d6b..6dbf8852bca6 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web-chrome-71/output.mjs @@ -1 +1 @@ -import "core-js/modules/web.immediate.js"; +import "core-js/modules/web.immediate"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs index 385b070eeb42..37348c29d894 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-entries-web/output.mjs @@ -1,9 +1,9 @@ -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs index 1e79fffa55f3..f6b2431273cf 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs @@ -1,181 +1,181 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs index a6aa5d76eae2..80f642659b89 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs @@ -1,187 +1,187 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.array-buffer.is-view.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.array-buffer.is-view"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.data-view"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs index b8b3d8fe4ed8..1332106cce0a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-import/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs index f375ee9a47f2..dd8a2c20f45c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-10.13/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/web.queue-microtask"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs index 2b28997de326..db959e64958b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/web.queue-microtask"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs index 0866f7e7310b..cd01fb3f1a40 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node-web/output.mjs @@ -1,30 +1,30 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs index 845fba0f5b03..a3a45d940508 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-node/output.mjs @@ -1,27 +1,27 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs index c7471c042309..479672b52e8e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-normalization/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.map"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; import 'foo/index.js'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js index 4a5699dac78d..788e39cdfeb8 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-all/output.js @@ -1,223 +1,223 @@ -require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.symbol.description"); -require("core-js/modules/es.symbol.async-iterator.js"); +require("core-js/modules/es.symbol.async-iterator"); -require("core-js/modules/es.array.flat.js"); +require("core-js/modules/es.array.flat"); -require("core-js/modules/es.array.flat-map.js"); +require("core-js/modules/es.array.flat-map"); -require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.array.iterator"); -require("core-js/modules/es.array.sort.js"); +require("core-js/modules/es.array.sort"); -require("core-js/modules/es.array.unscopables.flat.js"); +require("core-js/modules/es.array.unscopables.flat"); -require("core-js/modules/es.array.unscopables.flat-map.js"); +require("core-js/modules/es.array.unscopables.flat-map"); -require("core-js/modules/es.math.hypot.js"); +require("core-js/modules/es.math.hypot"); -require("core-js/modules/es.object.define-getter.js"); +require("core-js/modules/es.object.define-getter"); -require("core-js/modules/es.object.define-setter.js"); +require("core-js/modules/es.object.define-setter"); -require("core-js/modules/es.object.from-entries.js"); +require("core-js/modules/es.object.from-entries"); -require("core-js/modules/es.object.lookup-getter.js"); +require("core-js/modules/es.object.lookup-getter"); -require("core-js/modules/es.object.lookup-setter.js"); +require("core-js/modules/es.object.lookup-setter"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); -require("core-js/modules/es.promise.finally.js"); +require("core-js/modules/es.promise.finally"); -require("core-js/modules/es.string.pad-end.js"); +require("core-js/modules/es.string.pad-end"); -require("core-js/modules/es.string.pad-start.js"); +require("core-js/modules/es.string.pad-start"); -require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.string.replace"); -require("core-js/modules/es.string.trim.js"); +require("core-js/modules/es.string.trim"); -require("core-js/modules/es.string.trim-end.js"); +require("core-js/modules/es.string.trim-end"); -require("core-js/modules/es.string.trim-start.js"); +require("core-js/modules/es.string.trim-start"); -require("core-js/modules/esnext.aggregate-error.js"); +require("core-js/modules/esnext.aggregate-error"); -require("core-js/modules/esnext.array.last-index.js"); +require("core-js/modules/esnext.array.last-index"); -require("core-js/modules/esnext.array.last-item.js"); +require("core-js/modules/esnext.array.last-item"); -require("core-js/modules/esnext.composite-key.js"); +require("core-js/modules/esnext.composite-key"); -require("core-js/modules/esnext.composite-symbol.js"); +require("core-js/modules/esnext.composite-symbol"); -require("core-js/modules/esnext.global-this.js"); +require("core-js/modules/esnext.global-this"); -require("core-js/modules/esnext.map.delete-all.js"); +require("core-js/modules/esnext.map.delete-all"); -require("core-js/modules/esnext.map.every.js"); +require("core-js/modules/esnext.map.every"); -require("core-js/modules/esnext.map.filter.js"); +require("core-js/modules/esnext.map.filter"); -require("core-js/modules/esnext.map.find.js"); +require("core-js/modules/esnext.map.find"); -require("core-js/modules/esnext.map.find-key.js"); +require("core-js/modules/esnext.map.find-key"); -require("core-js/modules/esnext.map.from.js"); +require("core-js/modules/esnext.map.from"); -require("core-js/modules/esnext.map.group-by.js"); +require("core-js/modules/esnext.map.group-by"); -require("core-js/modules/esnext.map.includes.js"); +require("core-js/modules/esnext.map.includes"); -require("core-js/modules/esnext.map.key-by.js"); +require("core-js/modules/esnext.map.key-by"); -require("core-js/modules/esnext.map.key-of.js"); +require("core-js/modules/esnext.map.key-of"); -require("core-js/modules/esnext.map.map-keys.js"); +require("core-js/modules/esnext.map.map-keys"); -require("core-js/modules/esnext.map.map-values.js"); +require("core-js/modules/esnext.map.map-values"); -require("core-js/modules/esnext.map.merge.js"); +require("core-js/modules/esnext.map.merge"); -require("core-js/modules/esnext.map.of.js"); +require("core-js/modules/esnext.map.of"); -require("core-js/modules/esnext.map.reduce.js"); +require("core-js/modules/esnext.map.reduce"); -require("core-js/modules/esnext.map.some.js"); +require("core-js/modules/esnext.map.some"); -require("core-js/modules/esnext.map.update.js"); +require("core-js/modules/esnext.map.update"); -require("core-js/modules/esnext.math.clamp.js"); +require("core-js/modules/esnext.math.clamp"); -require("core-js/modules/esnext.math.deg-per-rad.js"); +require("core-js/modules/esnext.math.deg-per-rad"); -require("core-js/modules/esnext.math.degrees.js"); +require("core-js/modules/esnext.math.degrees"); -require("core-js/modules/esnext.math.fscale.js"); +require("core-js/modules/esnext.math.fscale"); -require("core-js/modules/esnext.math.iaddh.js"); +require("core-js/modules/esnext.math.iaddh"); -require("core-js/modules/esnext.math.imulh.js"); +require("core-js/modules/esnext.math.imulh"); -require("core-js/modules/esnext.math.isubh.js"); +require("core-js/modules/esnext.math.isubh"); -require("core-js/modules/esnext.math.rad-per-deg.js"); +require("core-js/modules/esnext.math.rad-per-deg"); -require("core-js/modules/esnext.math.radians.js"); +require("core-js/modules/esnext.math.radians"); -require("core-js/modules/esnext.math.scale.js"); +require("core-js/modules/esnext.math.scale"); -require("core-js/modules/esnext.math.seeded-prng.js"); +require("core-js/modules/esnext.math.seeded-prng"); -require("core-js/modules/esnext.math.signbit.js"); +require("core-js/modules/esnext.math.signbit"); -require("core-js/modules/esnext.math.umulh.js"); +require("core-js/modules/esnext.math.umulh"); -require("core-js/modules/esnext.number.from-string.js"); +require("core-js/modules/esnext.number.from-string"); -require("core-js/modules/esnext.observable.js"); +require("core-js/modules/esnext.observable"); -require("core-js/modules/esnext.promise.all-settled.js"); +require("core-js/modules/esnext.promise.all-settled"); -require("core-js/modules/esnext.promise.any.js"); +require("core-js/modules/esnext.promise.any"); -require("core-js/modules/esnext.promise.try.js"); +require("core-js/modules/esnext.promise.try"); -require("core-js/modules/esnext.reflect.define-metadata.js"); +require("core-js/modules/esnext.reflect.define-metadata"); -require("core-js/modules/esnext.reflect.delete-metadata.js"); +require("core-js/modules/esnext.reflect.delete-metadata"); -require("core-js/modules/esnext.reflect.get-metadata.js"); +require("core-js/modules/esnext.reflect.get-metadata"); -require("core-js/modules/esnext.reflect.get-metadata-keys.js"); +require("core-js/modules/esnext.reflect.get-metadata-keys"); -require("core-js/modules/esnext.reflect.get-own-metadata.js"); +require("core-js/modules/esnext.reflect.get-own-metadata"); -require("core-js/modules/esnext.reflect.get-own-metadata-keys.js"); +require("core-js/modules/esnext.reflect.get-own-metadata-keys"); -require("core-js/modules/esnext.reflect.has-metadata.js"); +require("core-js/modules/esnext.reflect.has-metadata"); -require("core-js/modules/esnext.reflect.has-own-metadata.js"); +require("core-js/modules/esnext.reflect.has-own-metadata"); -require("core-js/modules/esnext.reflect.metadata.js"); +require("core-js/modules/esnext.reflect.metadata"); -require("core-js/modules/esnext.set.add-all.js"); +require("core-js/modules/esnext.set.add-all"); -require("core-js/modules/esnext.set.delete-all.js"); +require("core-js/modules/esnext.set.delete-all"); -require("core-js/modules/esnext.set.difference.js"); +require("core-js/modules/esnext.set.difference"); -require("core-js/modules/esnext.set.every.js"); +require("core-js/modules/esnext.set.every"); -require("core-js/modules/esnext.set.filter.js"); +require("core-js/modules/esnext.set.filter"); -require("core-js/modules/esnext.set.find.js"); +require("core-js/modules/esnext.set.find"); -require("core-js/modules/esnext.set.from.js"); +require("core-js/modules/esnext.set.from"); -require("core-js/modules/esnext.set.intersection.js"); +require("core-js/modules/esnext.set.intersection"); -require("core-js/modules/esnext.set.is-disjoint-from.js"); +require("core-js/modules/esnext.set.is-disjoint-from"); -require("core-js/modules/esnext.set.is-subset-of.js"); +require("core-js/modules/esnext.set.is-subset-of"); -require("core-js/modules/esnext.set.is-superset-of.js"); +require("core-js/modules/esnext.set.is-superset-of"); -require("core-js/modules/esnext.set.join.js"); +require("core-js/modules/esnext.set.join"); -require("core-js/modules/esnext.set.map.js"); +require("core-js/modules/esnext.set.map"); -require("core-js/modules/esnext.set.of.js"); +require("core-js/modules/esnext.set.of"); -require("core-js/modules/esnext.set.reduce.js"); +require("core-js/modules/esnext.set.reduce"); -require("core-js/modules/esnext.set.some.js"); +require("core-js/modules/esnext.set.some"); -require("core-js/modules/esnext.set.symmetric-difference.js"); +require("core-js/modules/esnext.set.symmetric-difference"); -require("core-js/modules/esnext.set.union.js"); +require("core-js/modules/esnext.set.union"); -require("core-js/modules/esnext.string.at.js"); +require("core-js/modules/esnext.string.at"); -require("core-js/modules/esnext.string.code-points.js"); +require("core-js/modules/esnext.string.code-points"); -require("core-js/modules/esnext.string.match-all.js"); +require("core-js/modules/esnext.string.match-all"); -require("core-js/modules/esnext.string.replace-all.js"); +require("core-js/modules/esnext.string.replace-all"); -require("core-js/modules/esnext.symbol.dispose.js"); +require("core-js/modules/esnext.symbol.dispose"); -require("core-js/modules/esnext.symbol.observable.js"); +require("core-js/modules/esnext.symbol.observable"); -require("core-js/modules/esnext.symbol.pattern-match.js"); +require("core-js/modules/esnext.symbol.pattern-match"); -require("core-js/modules/esnext.weak-map.delete-all.js"); +require("core-js/modules/esnext.weak-map.delete-all"); -require("core-js/modules/esnext.weak-map.from.js"); +require("core-js/modules/esnext.weak-map.from"); -require("core-js/modules/esnext.weak-map.of.js"); +require("core-js/modules/esnext.weak-map.of"); -require("core-js/modules/esnext.weak-set.add-all.js"); +require("core-js/modules/esnext.weak-set.add-all"); -require("core-js/modules/esnext.weak-set.delete-all.js"); +require("core-js/modules/esnext.weak-set.delete-all"); -require("core-js/modules/esnext.weak-set.from.js"); +require("core-js/modules/esnext.weak-set.from"); -require("core-js/modules/esnext.weak-set.of.js"); +require("core-js/modules/esnext.weak-set.of"); -require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/web.dom-collections.for-each"); -require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/web.dom-collections.iterator"); -require("core-js/modules/web.immediate.js"); +require("core-js/modules/web.immediate"); -require("core-js/modules/web.queue-microtask.js"); +require("core-js/modules/web.queue-microtask"); -require("core-js/modules/web.url.js"); +require("core-js/modules/web.url"); -require("core-js/modules/web.url.to-json.js"); +require("core-js/modules/web.url.to-json"); -require("core-js/modules/web.url-search-params.js"); +require("core-js/modules/web.url-search-params"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js index fb095b53d149..ca0c13b8c25b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-chrome-71/output.js @@ -1,9 +1,9 @@ -require("core-js/modules/es.array.unscopables.flat.js"); +require("core-js/modules/es.array.unscopables.flat"); -require("core-js/modules/es.array.unscopables.flat-map.js"); +require("core-js/modules/es.array.unscopables.flat-map"); -require("core-js/modules/es.math.hypot.js"); +require("core-js/modules/es.math.hypot"); -require("core-js/modules/es.object.from-entries.js"); +require("core-js/modules/es.object.from-entries"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js index 11c15bc9e94c..72ba892bc13d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require-es-proposals/output.js @@ -1,215 +1,215 @@ -require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.symbol.description"); -require("core-js/modules/es.symbol.async-iterator.js"); +require("core-js/modules/es.symbol.async-iterator"); -require("core-js/modules/es.array.flat.js"); +require("core-js/modules/es.array.flat"); -require("core-js/modules/es.array.flat-map.js"); +require("core-js/modules/es.array.flat-map"); -require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.array.iterator"); -require("core-js/modules/es.array.sort.js"); +require("core-js/modules/es.array.sort"); -require("core-js/modules/es.array.unscopables.flat.js"); +require("core-js/modules/es.array.unscopables.flat"); -require("core-js/modules/es.array.unscopables.flat-map.js"); +require("core-js/modules/es.array.unscopables.flat-map"); -require("core-js/modules/es.math.hypot.js"); +require("core-js/modules/es.math.hypot"); -require("core-js/modules/es.object.define-getter.js"); +require("core-js/modules/es.object.define-getter"); -require("core-js/modules/es.object.define-setter.js"); +require("core-js/modules/es.object.define-setter"); -require("core-js/modules/es.object.from-entries.js"); +require("core-js/modules/es.object.from-entries"); -require("core-js/modules/es.object.lookup-getter.js"); +require("core-js/modules/es.object.lookup-getter"); -require("core-js/modules/es.object.lookup-setter.js"); +require("core-js/modules/es.object.lookup-setter"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); -require("core-js/modules/es.promise.finally.js"); +require("core-js/modules/es.promise.finally"); -require("core-js/modules/es.string.pad-end.js"); +require("core-js/modules/es.string.pad-end"); -require("core-js/modules/es.string.pad-start.js"); +require("core-js/modules/es.string.pad-start"); -require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.string.replace"); -require("core-js/modules/es.string.trim.js"); +require("core-js/modules/es.string.trim"); -require("core-js/modules/es.string.trim-end.js"); +require("core-js/modules/es.string.trim-end"); -require("core-js/modules/es.string.trim-start.js"); +require("core-js/modules/es.string.trim-start"); -require("core-js/modules/esnext.aggregate-error.js"); +require("core-js/modules/esnext.aggregate-error"); -require("core-js/modules/esnext.array.last-index.js"); +require("core-js/modules/esnext.array.last-index"); -require("core-js/modules/esnext.array.last-item.js"); +require("core-js/modules/esnext.array.last-item"); -require("core-js/modules/esnext.composite-key.js"); +require("core-js/modules/esnext.composite-key"); -require("core-js/modules/esnext.composite-symbol.js"); +require("core-js/modules/esnext.composite-symbol"); -require("core-js/modules/esnext.global-this.js"); +require("core-js/modules/esnext.global-this"); -require("core-js/modules/esnext.map.delete-all.js"); +require("core-js/modules/esnext.map.delete-all"); -require("core-js/modules/esnext.map.every.js"); +require("core-js/modules/esnext.map.every"); -require("core-js/modules/esnext.map.filter.js"); +require("core-js/modules/esnext.map.filter"); -require("core-js/modules/esnext.map.find.js"); +require("core-js/modules/esnext.map.find"); -require("core-js/modules/esnext.map.find-key.js"); +require("core-js/modules/esnext.map.find-key"); -require("core-js/modules/esnext.map.from.js"); +require("core-js/modules/esnext.map.from"); -require("core-js/modules/esnext.map.group-by.js"); +require("core-js/modules/esnext.map.group-by"); -require("core-js/modules/esnext.map.includes.js"); +require("core-js/modules/esnext.map.includes"); -require("core-js/modules/esnext.map.key-by.js"); +require("core-js/modules/esnext.map.key-by"); -require("core-js/modules/esnext.map.key-of.js"); +require("core-js/modules/esnext.map.key-of"); -require("core-js/modules/esnext.map.map-keys.js"); +require("core-js/modules/esnext.map.map-keys"); -require("core-js/modules/esnext.map.map-values.js"); +require("core-js/modules/esnext.map.map-values"); -require("core-js/modules/esnext.map.merge.js"); +require("core-js/modules/esnext.map.merge"); -require("core-js/modules/esnext.map.of.js"); +require("core-js/modules/esnext.map.of"); -require("core-js/modules/esnext.map.reduce.js"); +require("core-js/modules/esnext.map.reduce"); -require("core-js/modules/esnext.map.some.js"); +require("core-js/modules/esnext.map.some"); -require("core-js/modules/esnext.map.update.js"); +require("core-js/modules/esnext.map.update"); -require("core-js/modules/esnext.math.clamp.js"); +require("core-js/modules/esnext.math.clamp"); -require("core-js/modules/esnext.math.deg-per-rad.js"); +require("core-js/modules/esnext.math.deg-per-rad"); -require("core-js/modules/esnext.math.degrees.js"); +require("core-js/modules/esnext.math.degrees"); -require("core-js/modules/esnext.math.fscale.js"); +require("core-js/modules/esnext.math.fscale"); -require("core-js/modules/esnext.math.iaddh.js"); +require("core-js/modules/esnext.math.iaddh"); -require("core-js/modules/esnext.math.imulh.js"); +require("core-js/modules/esnext.math.imulh"); -require("core-js/modules/esnext.math.isubh.js"); +require("core-js/modules/esnext.math.isubh"); -require("core-js/modules/esnext.math.rad-per-deg.js"); +require("core-js/modules/esnext.math.rad-per-deg"); -require("core-js/modules/esnext.math.radians.js"); +require("core-js/modules/esnext.math.radians"); -require("core-js/modules/esnext.math.scale.js"); +require("core-js/modules/esnext.math.scale"); -require("core-js/modules/esnext.math.seeded-prng.js"); +require("core-js/modules/esnext.math.seeded-prng"); -require("core-js/modules/esnext.math.signbit.js"); +require("core-js/modules/esnext.math.signbit"); -require("core-js/modules/esnext.math.umulh.js"); +require("core-js/modules/esnext.math.umulh"); -require("core-js/modules/esnext.number.from-string.js"); +require("core-js/modules/esnext.number.from-string"); -require("core-js/modules/esnext.observable.js"); +require("core-js/modules/esnext.observable"); -require("core-js/modules/esnext.promise.all-settled.js"); +require("core-js/modules/esnext.promise.all-settled"); -require("core-js/modules/esnext.promise.any.js"); +require("core-js/modules/esnext.promise.any"); -require("core-js/modules/esnext.promise.try.js"); +require("core-js/modules/esnext.promise.try"); -require("core-js/modules/esnext.reflect.define-metadata.js"); +require("core-js/modules/esnext.reflect.define-metadata"); -require("core-js/modules/esnext.reflect.delete-metadata.js"); +require("core-js/modules/esnext.reflect.delete-metadata"); -require("core-js/modules/esnext.reflect.get-metadata.js"); +require("core-js/modules/esnext.reflect.get-metadata"); -require("core-js/modules/esnext.reflect.get-metadata-keys.js"); +require("core-js/modules/esnext.reflect.get-metadata-keys"); -require("core-js/modules/esnext.reflect.get-own-metadata.js"); +require("core-js/modules/esnext.reflect.get-own-metadata"); -require("core-js/modules/esnext.reflect.get-own-metadata-keys.js"); +require("core-js/modules/esnext.reflect.get-own-metadata-keys"); -require("core-js/modules/esnext.reflect.has-metadata.js"); +require("core-js/modules/esnext.reflect.has-metadata"); -require("core-js/modules/esnext.reflect.has-own-metadata.js"); +require("core-js/modules/esnext.reflect.has-own-metadata"); -require("core-js/modules/esnext.reflect.metadata.js"); +require("core-js/modules/esnext.reflect.metadata"); -require("core-js/modules/esnext.set.add-all.js"); +require("core-js/modules/esnext.set.add-all"); -require("core-js/modules/esnext.set.delete-all.js"); +require("core-js/modules/esnext.set.delete-all"); -require("core-js/modules/esnext.set.difference.js"); +require("core-js/modules/esnext.set.difference"); -require("core-js/modules/esnext.set.every.js"); +require("core-js/modules/esnext.set.every"); -require("core-js/modules/esnext.set.filter.js"); +require("core-js/modules/esnext.set.filter"); -require("core-js/modules/esnext.set.find.js"); +require("core-js/modules/esnext.set.find"); -require("core-js/modules/esnext.set.from.js"); +require("core-js/modules/esnext.set.from"); -require("core-js/modules/esnext.set.intersection.js"); +require("core-js/modules/esnext.set.intersection"); -require("core-js/modules/esnext.set.is-disjoint-from.js"); +require("core-js/modules/esnext.set.is-disjoint-from"); -require("core-js/modules/esnext.set.is-subset-of.js"); +require("core-js/modules/esnext.set.is-subset-of"); -require("core-js/modules/esnext.set.is-superset-of.js"); +require("core-js/modules/esnext.set.is-superset-of"); -require("core-js/modules/esnext.set.join.js"); +require("core-js/modules/esnext.set.join"); -require("core-js/modules/esnext.set.map.js"); +require("core-js/modules/esnext.set.map"); -require("core-js/modules/esnext.set.of.js"); +require("core-js/modules/esnext.set.of"); -require("core-js/modules/esnext.set.reduce.js"); +require("core-js/modules/esnext.set.reduce"); -require("core-js/modules/esnext.set.some.js"); +require("core-js/modules/esnext.set.some"); -require("core-js/modules/esnext.set.symmetric-difference.js"); +require("core-js/modules/esnext.set.symmetric-difference"); -require("core-js/modules/esnext.set.union.js"); +require("core-js/modules/esnext.set.union"); -require("core-js/modules/esnext.string.at.js"); +require("core-js/modules/esnext.string.at"); -require("core-js/modules/esnext.string.code-points.js"); +require("core-js/modules/esnext.string.code-points"); -require("core-js/modules/esnext.string.match-all.js"); +require("core-js/modules/esnext.string.match-all"); -require("core-js/modules/esnext.string.replace-all.js"); +require("core-js/modules/esnext.string.replace-all"); -require("core-js/modules/esnext.symbol.dispose.js"); +require("core-js/modules/esnext.symbol.dispose"); -require("core-js/modules/esnext.symbol.observable.js"); +require("core-js/modules/esnext.symbol.observable"); -require("core-js/modules/esnext.symbol.pattern-match.js"); +require("core-js/modules/esnext.symbol.pattern-match"); -require("core-js/modules/esnext.weak-map.delete-all.js"); +require("core-js/modules/esnext.weak-map.delete-all"); -require("core-js/modules/esnext.weak-map.from.js"); +require("core-js/modules/esnext.weak-map.from"); -require("core-js/modules/esnext.weak-map.of.js"); +require("core-js/modules/esnext.weak-map.of"); -require("core-js/modules/esnext.weak-set.add-all.js"); +require("core-js/modules/esnext.weak-set.add-all"); -require("core-js/modules/esnext.weak-set.delete-all.js"); +require("core-js/modules/esnext.weak-set.delete-all"); -require("core-js/modules/esnext.weak-set.from.js"); +require("core-js/modules/esnext.weak-set.from"); -require("core-js/modules/esnext.weak-set.of.js"); +require("core-js/modules/esnext.weak-set.of"); -require("core-js/modules/web.url.js"); +require("core-js/modules/web.url"); -require("core-js/modules/web.url.to-json.js"); +require("core-js/modules/web.url.to-json"); -require("core-js/modules/web.url-search-params.js"); +require("core-js/modules/web.url-search-params"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js index 4adcce188e71..974ad1fee63b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-require/output.js @@ -1,59 +1,59 @@ -require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.symbol.description"); -require("core-js/modules/es.symbol.async-iterator.js"); +require("core-js/modules/es.symbol.async-iterator"); -require("core-js/modules/es.array.flat.js"); +require("core-js/modules/es.array.flat"); -require("core-js/modules/es.array.flat-map.js"); +require("core-js/modules/es.array.flat-map"); -require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.array.iterator"); -require("core-js/modules/es.array.sort.js"); +require("core-js/modules/es.array.sort"); -require("core-js/modules/es.array.unscopables.flat.js"); +require("core-js/modules/es.array.unscopables.flat"); -require("core-js/modules/es.array.unscopables.flat-map.js"); +require("core-js/modules/es.array.unscopables.flat-map"); -require("core-js/modules/es.math.hypot.js"); +require("core-js/modules/es.math.hypot"); -require("core-js/modules/es.object.define-getter.js"); +require("core-js/modules/es.object.define-getter"); -require("core-js/modules/es.object.define-setter.js"); +require("core-js/modules/es.object.define-setter"); -require("core-js/modules/es.object.from-entries.js"); +require("core-js/modules/es.object.from-entries"); -require("core-js/modules/es.object.lookup-getter.js"); +require("core-js/modules/es.object.lookup-getter"); -require("core-js/modules/es.object.lookup-setter.js"); +require("core-js/modules/es.object.lookup-setter"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); -require("core-js/modules/es.promise.finally.js"); +require("core-js/modules/es.promise.finally"); -require("core-js/modules/es.string.pad-end.js"); +require("core-js/modules/es.string.pad-end"); -require("core-js/modules/es.string.pad-start.js"); +require("core-js/modules/es.string.pad-start"); -require("core-js/modules/es.string.replace.js"); +require("core-js/modules/es.string.replace"); -require("core-js/modules/es.string.trim.js"); +require("core-js/modules/es.string.trim"); -require("core-js/modules/es.string.trim-end.js"); +require("core-js/modules/es.string.trim-end"); -require("core-js/modules/es.string.trim-start.js"); +require("core-js/modules/es.string.trim-start"); -require("core-js/modules/web.dom-collections.for-each.js"); +require("core-js/modules/web.dom-collections.for-each"); -require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/web.dom-collections.iterator"); -require("core-js/modules/web.immediate.js"); +require("core-js/modules/web.immediate"); -require("core-js/modules/web.queue-microtask.js"); +require("core-js/modules/web.queue-microtask"); -require("core-js/modules/web.url.js"); +require("core-js/modules/web.url"); -require("core-js/modules/web.url.to-json.js"); +require("core-js/modules/web.url.to-json"); -require("core-js/modules/web.url-search-params.js"); +require("core-js/modules/web.url-search-params"); 1 ** 2; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs index d22766766ad8..521c32b6f351 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-chrome-71/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/web.immediate.js"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/web.immediate"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs index 2f14f6361ac9..e99fb491804b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable-samsung-8.2/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs index 0b2a038c3a50..212123a9631a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-stable/output.mjs @@ -1,209 +1,209 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.every.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.is-array.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.reduce.js"; -import "core-js/modules/es.array.reduce-right.js"; -import "core-js/modules/es.array.reverse.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.some.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.array-buffer.is-view.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.date.now.js"; -import "core-js/modules/es.date.to-iso-string.js"; -import "core-js/modules/es.date.to-json.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.date.to-string.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.number.to-precision.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-properties.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.parse-float.js"; -import "core-js/modules/es.parse-int.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.is-array"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; +import "core-js/modules/es.array.reverse"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.array-buffer.is-view"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.data-view"; +import "core-js/modules/es.date.now"; +import "core-js/modules/es.date.to-iso-string"; +import "core-js/modules/es.date.to-json"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.date.to-string"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.number.to-precision"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.create"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-properties"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.parse-float"; +import "core-js/modules/es.parse-int"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs index 77197ebfec0b..cb63c2cc360c 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-built-ins/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs index b407fe959bad..170d86bd7cae 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-include/output.mjs @@ -1,32 +1,32 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs index 280e0c0cefca..93f856aa51c3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude-regenerator/output.mjs @@ -1,208 +1,208 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.symbol.has-instance.js"; -import "core-js/modules/es.symbol.is-concat-spreadable.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.symbol.replace.js"; -import "core-js/modules/es.symbol.search.js"; -import "core-js/modules/es.symbol.species.js"; -import "core-js/modules/es.symbol.split.js"; -import "core-js/modules/es.symbol.to-primitive.js"; -import "core-js/modules/es.symbol.to-string-tag.js"; -import "core-js/modules/es.symbol.unscopables.js"; -import "core-js/modules/es.array.concat.js"; -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.every.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.index-of.js"; -import "core-js/modules/es.array.is-array.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.join.js"; -import "core-js/modules/es.array.last-index-of.js"; -import "core-js/modules/es.array.map.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.array.reduce.js"; -import "core-js/modules/es.array.reduce-right.js"; -import "core-js/modules/es.array.reverse.js"; -import "core-js/modules/es.array.slice.js"; -import "core-js/modules/es.array.some.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.species.js"; -import "core-js/modules/es.array.splice.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.array-buffer.constructor.js"; -import "core-js/modules/es.array-buffer.is-view.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.data-view.js"; -import "core-js/modules/es.date.now.js"; -import "core-js/modules/es.date.to-iso-string.js"; -import "core-js/modules/es.date.to-json.js"; -import "core-js/modules/es.date.to-primitive.js"; -import "core-js/modules/es.date.to-string.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.function.has-instance.js"; -import "core-js/modules/es.function.name.js"; -import "core-js/modules/es.json.to-string-tag.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.acosh.js"; -import "core-js/modules/es.math.asinh.js"; -import "core-js/modules/es.math.atanh.js"; -import "core-js/modules/es.math.cbrt.js"; -import "core-js/modules/es.math.clz32.js"; -import "core-js/modules/es.math.cosh.js"; -import "core-js/modules/es.math.expm1.js"; -import "core-js/modules/es.math.fround.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.math.imul.js"; -import "core-js/modules/es.math.log10.js"; -import "core-js/modules/es.math.log1p.js"; -import "core-js/modules/es.math.log2.js"; -import "core-js/modules/es.math.sign.js"; -import "core-js/modules/es.math.sinh.js"; -import "core-js/modules/es.math.tanh.js"; -import "core-js/modules/es.math.to-string-tag.js"; -import "core-js/modules/es.math.trunc.js"; -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.epsilon.js"; -import "core-js/modules/es.number.is-finite.js"; -import "core-js/modules/es.number.is-integer.js"; -import "core-js/modules/es.number.is-nan.js"; -import "core-js/modules/es.number.is-safe-integer.js"; -import "core-js/modules/es.number.max-safe-integer.js"; -import "core-js/modules/es.number.min-safe-integer.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; -import "core-js/modules/es.number.to-fixed.js"; -import "core-js/modules/es.number.to-precision.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.create.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-properties.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.freeze.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.get-own-property-descriptor.js"; -import "core-js/modules/es.object.get-own-property-descriptors.js"; -import "core-js/modules/es.object.get-own-property-names.js"; -import "core-js/modules/es.object.get-prototype-of.js"; -import "core-js/modules/es.object.is.js"; -import "core-js/modules/es.object.is-extensible.js"; -import "core-js/modules/es.object.is-frozen.js"; -import "core-js/modules/es.object.is-sealed.js"; -import "core-js/modules/es.object.keys.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.object.prevent-extensions.js"; -import "core-js/modules/es.object.seal.js"; -import "core-js/modules/es.object.set-prototype-of.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.object.values.js"; -import "core-js/modules/es.parse-float.js"; -import "core-js/modules/es.parse-int.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.reflect.apply.js"; -import "core-js/modules/es.reflect.construct.js"; -import "core-js/modules/es.reflect.define-property.js"; -import "core-js/modules/es.reflect.delete-property.js"; -import "core-js/modules/es.reflect.get.js"; -import "core-js/modules/es.reflect.get-own-property-descriptor.js"; -import "core-js/modules/es.reflect.get-prototype-of.js"; -import "core-js/modules/es.reflect.has.js"; -import "core-js/modules/es.reflect.is-extensible.js"; -import "core-js/modules/es.reflect.own-keys.js"; -import "core-js/modules/es.reflect.prevent-extensions.js"; -import "core-js/modules/es.reflect.set.js"; -import "core-js/modules/es.reflect.set-prototype-of.js"; -import "core-js/modules/es.regexp.constructor.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.from-code-point.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.raw.js"; -import "core-js/modules/es.string.repeat.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/es.string.anchor.js"; -import "core-js/modules/es.string.big.js"; -import "core-js/modules/es.string.blink.js"; -import "core-js/modules/es.string.bold.js"; -import "core-js/modules/es.string.fixed.js"; -import "core-js/modules/es.string.fontcolor.js"; -import "core-js/modules/es.string.fontsize.js"; -import "core-js/modules/es.string.italics.js"; -import "core-js/modules/es.string.link.js"; -import "core-js/modules/es.string.small.js"; -import "core-js/modules/es.string.strike.js"; -import "core-js/modules/es.string.sub.js"; -import "core-js/modules/es.string.sup.js"; -import "core-js/modules/es.typed-array.float32-array.js"; -import "core-js/modules/es.typed-array.float64-array.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.int16-array.js"; -import "core-js/modules/es.typed-array.int32-array.js"; -import "core-js/modules/es.typed-array.uint8-array.js"; -import "core-js/modules/es.typed-array.uint8-clamped-array.js"; -import "core-js/modules/es.typed-array.uint16-array.js"; -import "core-js/modules/es.typed-array.uint32-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.from.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; -import "core-js/modules/es.weak-map.js"; -import "core-js/modules/es.weak-set.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.timers.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.symbol.has-instance"; +import "core-js/modules/es.symbol.is-concat-spreadable"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.symbol.replace"; +import "core-js/modules/es.symbol.search"; +import "core-js/modules/es.symbol.species"; +import "core-js/modules/es.symbol.split"; +import "core-js/modules/es.symbol.to-primitive"; +import "core-js/modules/es.symbol.to-string-tag"; +import "core-js/modules/es.symbol.unscopables"; +import "core-js/modules/es.array.concat"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; +import "core-js/modules/es.array.is-array"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; +import "core-js/modules/es.array.map"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; +import "core-js/modules/es.array.reverse"; +import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.species"; +import "core-js/modules/es.array.splice"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.array-buffer.constructor"; +import "core-js/modules/es.array-buffer.is-view"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.data-view"; +import "core-js/modules/es.date.now"; +import "core-js/modules/es.date.to-iso-string"; +import "core-js/modules/es.date.to-json"; +import "core-js/modules/es.date.to-primitive"; +import "core-js/modules/es.date.to-string"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.function.has-instance"; +import "core-js/modules/es.function.name"; +import "core-js/modules/es.json.to-string-tag"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.acosh"; +import "core-js/modules/es.math.asinh"; +import "core-js/modules/es.math.atanh"; +import "core-js/modules/es.math.cbrt"; +import "core-js/modules/es.math.clz32"; +import "core-js/modules/es.math.cosh"; +import "core-js/modules/es.math.expm1"; +import "core-js/modules/es.math.fround"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.math.imul"; +import "core-js/modules/es.math.log10"; +import "core-js/modules/es.math.log1p"; +import "core-js/modules/es.math.log2"; +import "core-js/modules/es.math.sign"; +import "core-js/modules/es.math.sinh"; +import "core-js/modules/es.math.tanh"; +import "core-js/modules/es.math.to-string-tag"; +import "core-js/modules/es.math.trunc"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.epsilon"; +import "core-js/modules/es.number.is-finite"; +import "core-js/modules/es.number.is-integer"; +import "core-js/modules/es.number.is-nan"; +import "core-js/modules/es.number.is-safe-integer"; +import "core-js/modules/es.number.max-safe-integer"; +import "core-js/modules/es.number.min-safe-integer"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; +import "core-js/modules/es.number.to-fixed"; +import "core-js/modules/es.number.to-precision"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.create"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-properties"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.freeze"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.get-own-property-descriptor"; +import "core-js/modules/es.object.get-own-property-descriptors"; +import "core-js/modules/es.object.get-own-property-names"; +import "core-js/modules/es.object.get-prototype-of"; +import "core-js/modules/es.object.is"; +import "core-js/modules/es.object.is-extensible"; +import "core-js/modules/es.object.is-frozen"; +import "core-js/modules/es.object.is-sealed"; +import "core-js/modules/es.object.keys"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.object.prevent-extensions"; +import "core-js/modules/es.object.seal"; +import "core-js/modules/es.object.set-prototype-of"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.object.values"; +import "core-js/modules/es.parse-float"; +import "core-js/modules/es.parse-int"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.reflect.apply"; +import "core-js/modules/es.reflect.construct"; +import "core-js/modules/es.reflect.define-property"; +import "core-js/modules/es.reflect.delete-property"; +import "core-js/modules/es.reflect.get"; +import "core-js/modules/es.reflect.get-own-property-descriptor"; +import "core-js/modules/es.reflect.get-prototype-of"; +import "core-js/modules/es.reflect.has"; +import "core-js/modules/es.reflect.is-extensible"; +import "core-js/modules/es.reflect.own-keys"; +import "core-js/modules/es.reflect.prevent-extensions"; +import "core-js/modules/es.reflect.set"; +import "core-js/modules/es.reflect.set-prototype-of"; +import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.from-code-point"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.raw"; +import "core-js/modules/es.string.repeat"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/es.string.anchor"; +import "core-js/modules/es.string.big"; +import "core-js/modules/es.string.blink"; +import "core-js/modules/es.string.bold"; +import "core-js/modules/es.string.fixed"; +import "core-js/modules/es.string.fontcolor"; +import "core-js/modules/es.string.fontsize"; +import "core-js/modules/es.string.italics"; +import "core-js/modules/es.string.link"; +import "core-js/modules/es.string.small"; +import "core-js/modules/es.string.strike"; +import "core-js/modules/es.string.sub"; +import "core-js/modules/es.string.sup"; +import "core-js/modules/es.typed-array.float32-array"; +import "core-js/modules/es.typed-array.float64-array"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.int16-array"; +import "core-js/modules/es.typed-array.int32-array"; +import "core-js/modules/es.typed-array.uint8-array"; +import "core-js/modules/es.typed-array.uint8-clamped-array"; +import "core-js/modules/es.typed-array.uint16-array"; +import "core-js/modules/es.typed-array.uint32-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.from"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; +import "core-js/modules/es.weak-map"; +import "core-js/modules/es.weak-set"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.timers"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs index 19acbcd9864b..8f37a64f243e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/exclude/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; async function a() { await 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs index 3fcb19e0e634..acdf857cf0e3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/force-all-transforms/output.mjs @@ -1,31 +1,31 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; import 'regenerator-runtime/runtime'; var a = 1; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs index 8448c0e3d5a1..49a4b1893150 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/include-built-ins/output.mjs @@ -1,31 +1,31 @@ -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.async-iterator.js"; -import "core-js/modules/es.array.flat.js"; -import "core-js/modules/es.array.flat-map.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.sort.js"; -import "core-js/modules/es.array.unscopables.flat.js"; -import "core-js/modules/es.array.unscopables.flat-map.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.math.hypot.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.define-setter.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.lookup-getter.js"; -import "core-js/modules/es.object.lookup-setter.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/es.string.trim-end.js"; -import "core-js/modules/es.string.trim-start.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.queue-microtask.js"; -import "core-js/modules/web.url.js"; -import "core-js/modules/web.url.to-json.js"; -import "core-js/modules/web.url-search-params.js"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.async-iterator"; +import "core-js/modules/es.array.flat"; +import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.sort"; +import "core-js/modules/es.array.unscopables.flat"; +import "core-js/modules/es.array.unscopables.flat-map"; +import "core-js/modules/es.map"; +import "core-js/modules/es.math.hypot"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.define-setter"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.lookup-getter"; +import "core-js/modules/es.object.lookup-setter"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/es.string.trim-end"; +import "core-js/modules/es.string.trim-start"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.queue-microtask"; +import "core-js/modules/web.url"; +import "core-js/modules/web.url.to-json"; +import "core-js/modules/web.url-search-params"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs index 38f7fe27928b..bf51809e7297 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals-chrome-71/output.mjs @@ -1,18 +1,18 @@ -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.symbol.observable.js"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.symbol.observable"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs index a3b599fbe61b..699c00e7ae82 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all-proposals/output.mjs @@ -1,33 +1,33 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/esnext.global-this.js"; -import "core-js/modules/esnext.map.delete-all.js"; -import "core-js/modules/esnext.map.every.js"; -import "core-js/modules/esnext.map.filter.js"; -import "core-js/modules/esnext.map.find.js"; -import "core-js/modules/esnext.map.find-key.js"; -import "core-js/modules/esnext.map.includes.js"; -import "core-js/modules/esnext.map.key-of.js"; -import "core-js/modules/esnext.map.map-keys.js"; -import "core-js/modules/esnext.map.map-values.js"; -import "core-js/modules/esnext.map.merge.js"; -import "core-js/modules/esnext.map.reduce.js"; -import "core-js/modules/esnext.map.some.js"; -import "core-js/modules/esnext.map.update.js"; -import "core-js/modules/esnext.observable.js"; -import "core-js/modules/esnext.symbol.observable.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.map"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/esnext.global-this"; +import "core-js/modules/esnext.map.delete-all"; +import "core-js/modules/esnext.map.every"; +import "core-js/modules/esnext.map.filter"; +import "core-js/modules/esnext.map.find"; +import "core-js/modules/esnext.map.find-key"; +import "core-js/modules/esnext.map.includes"; +import "core-js/modules/esnext.map.key-of"; +import "core-js/modules/esnext.map.map-keys"; +import "core-js/modules/esnext.map.map-values"; +import "core-js/modules/esnext.map.merge"; +import "core-js/modules/esnext.map.reduce"; +import "core-js/modules/esnext.map.some"; +import "core-js/modules/esnext.map.update"; +import "core-js/modules/esnext.observable"; +import "core-js/modules/esnext.symbol.observable"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.queue-microtask"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs index 793df090786d..320fcf8662c5 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-all/output.mjs @@ -1,17 +1,17 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.symbol.match.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.match.js"; -import "core-js/modules/web.dom-collections.iterator.js"; -import "core-js/modules/web.queue-microtask.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.symbol.match"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.map"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.match"; +import "core-js/modules/web.dom-collections.iterator"; +import "core-js/modules/web.queue-microtask"; Array.from; // static method Map; // built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs index 38658887bc1d..e73421da0ea4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/web.dom-collections.iterator"; var a = new Map(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs index a409508fd7d3..008dade84785 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-built-in-from-global-object/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.set.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.set"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; var Set = window.Set; var Map = something.Map; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs index d30f753148f2..19ec5a3bda5b 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-assignment/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; [a, b] = c; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs index d6ea420672f0..07b47aee452a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-catch/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; try { a(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs index e9fa6896c10d..13575cf7d08e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-for-x/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; for (var [a, b] in c) { ; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs index 05e5c56169a8..096af6abc7d1 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-iife/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; !function (foo, { entries: entries }) {}({}, Object); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs index ae45a17279c2..e2100787e008 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-params/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; function a(_ref) { var [b, c] = _ref; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs index 0651a494f89a..c995f912ab42 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-destructuring-variable-declaration/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; var [a, b] = c; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs index 3bcf00646f83..a748b6c1d722 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-determanated-instance-methods/output.mjs @@ -1,11 +1,11 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.object.define-getter.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.flags.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.replace.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.object.define-getter"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.flags"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.replace"; var a = []; a.values(); ''.replace(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs index 01c8e26378b2..03c0a1be1e86 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-dynamic-import/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; var foo = import('foo'); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs index 4383703ff9c4..0237af3f76ea 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-class-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/web.dom-collections.iterator"; var objectClass = Object; var arrayInstance = []; var assignStr = "assign"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs index 0eee4eb0e4d1..854101328ea4 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-evaluated-instance-methods/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.includes.js"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.includes"; var arrayInstance = []; var inclidesStr = "includes"; var findStr = "find"; // Allow instance methods be assigned to variables. diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs index d004a9f40a38..6637fedce2be 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-fetch/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; var foo = fetch('foo'); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs index 8f6d528ca3e0..2769d6c95b21 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of-destructure-with/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; for (const { padStart diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs index a1b3d7980532..b8da08e913ef 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-for-of/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; for (var a of b) { ; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs index 9c9182420e87..6c58b94f862a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-in/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.from-entries.js"; -import "core-js/modules/es.object.values.js"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.from-entries"; +import "core-js/modules/es.object.values"; 'entries' in Object; 'includes' in [1, 2, 3]; 'va' + 'lues' in Object; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs index 0c859c26ad61..be008261d43e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-instance-methods/output.mjs @@ -1,25 +1,25 @@ -import "core-js/modules/es.array.copy-within.js"; -import "core-js/modules/es.array.fill.js"; -import "core-js/modules/es.array.find.js"; -import "core-js/modules/es.array.find-index.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.includes.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.map.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.string.code-point-at.js"; -import "core-js/modules/es.string.ends-with.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.pad-end.js"; -import "core-js/modules/es.string.pad-start.js"; -import "core-js/modules/es.string.replace.js"; -import "core-js/modules/es.string.search.js"; -import "core-js/modules/es.string.split.js"; -import "core-js/modules/es.string.starts-with.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.fill"; +import "core-js/modules/es.array.find"; +import "core-js/modules/es.array.find-index"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.map"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.string.code-point-at"; +import "core-js/modules/es.string.ends-with"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.pad-end"; +import "core-js/modules/es.string.pad-start"; +import "core-js/modules/es.string.replace"; +import "core-js/modules/es.string.search"; +import "core-js/modules/es.string.split"; +import "core-js/modules/es.string.starts-with"; +import "core-js/modules/web.dom-collections.iterator"; Array.from; // static function Map; // top level built-in diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js index d8afc08612b0..b86b98172305 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-modules-transform/output.js @@ -1,7 +1,7 @@ "use strict"; -require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.object.to-string"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); Promise; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs index 9356b7e4979c..e43b0499157a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-number-ie-11/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.number.constructor.js"; -import "core-js/modules/es.number.parse-float.js"; -import "core-js/modules/es.number.parse-int.js"; +import "core-js/modules/es.number.constructor"; +import "core-js/modules/es.number.parse-float"; +import "core-js/modules/es.number.parse-int"; Number.parseFloat("3.14"); Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs index cbf26aa16703..d220e642b57a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-object-destructuring/output.mjs @@ -1,19 +1,19 @@ -import "core-js/modules/es.array.filter.js"; -import "core-js/modules/es.array.for-each.js"; -import "core-js/modules/es.array.from.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array.of.js"; -import "core-js/modules/es.date.to-string.js"; -import "core-js/modules/es.function.bind.js"; -import "core-js/modules/es.object.entries.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.regexp.exec.js"; -import "core-js/modules/es.regexp.to-string.js"; -import "core-js/modules/es.string.includes.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/es.string.trim.js"; -import "core-js/modules/web.dom-collections.for-each.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.filter"; +import "core-js/modules/es.array.for-each"; +import "core-js/modules/es.array.from"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array.of"; +import "core-js/modules/es.date.to-string"; +import "core-js/modules/es.function.bind"; +import "core-js/modules/es.object.entries"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.regexp.exec"; +import "core-js/modules/es.regexp.to-string"; +import "core-js/modules/es.string.includes"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/es.string.trim"; +import "core-js/modules/web.dom-collections.for-each"; +import "core-js/modules/web.dom-collections.iterator"; var bind, toString; var { bind: bind diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs index 0498cf0db797..a645ea5c4549 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-all/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; var p = Promise.resolve(0); Promise.all([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs index 5860eb9aecfa..d0d487d3454d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-finally/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.promise.finally.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.promise.finally"; var p = Promise.resolve(0); p.finally(function () { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs index e9eeee0d740e..f818ab24bbfc 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-promise-race/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; var p = Promise.resolve(0); Promise.race([p]).then(function (outcome) { alert("OK"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs index 20a7a28e19ce..9e343bd1dfaf 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-async-native-support/output.mjs @@ -1,3 +1,3 @@ -import "core-js/modules/es.promise.js"; +import "core-js/modules/es.promise"; async function a() {} 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 5a7ce6455fa7..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 @@ -1,6 +1,6 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "regenerator-runtime/runtime.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "regenerator-runtime/runtime"; function a() { return regeneratorRuntime.async(function a$(_context) { diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs index 571c3d9e614a..ce5acd262e9f 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-regenerator-used-generator/output.mjs @@ -1,4 +1,4 @@ -import "regenerator-runtime/runtime.js"; +import "regenerator-runtime/runtime"; var _marked = /*#__PURE__*/ diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js index 40d6f0bbbab9..c8fb626d57dd 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-shippedProposals/output.js @@ -1,34 +1,34 @@ "use strict"; -require("core-js/modules/es.symbol.js"); +require("core-js/modules/es.symbol"); -require("core-js/modules/es.symbol.description.js"); +require("core-js/modules/es.symbol.description"); -require("core-js/modules/es.symbol.iterator.js"); +require("core-js/modules/es.symbol.iterator"); -require("core-js/modules/es.symbol.match.js"); +require("core-js/modules/es.symbol.match"); -require("core-js/modules/es.array.from.js"); +require("core-js/modules/es.array.from"); -require("core-js/modules/es.array.iterator.js"); +require("core-js/modules/es.array.iterator"); -require("core-js/modules/es.map.js"); +require("core-js/modules/es.map"); -require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.object.to-string"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); -require("core-js/modules/es.regexp.exec.js"); +require("core-js/modules/es.regexp.exec"); -require("core-js/modules/es.string.iterator.js"); +require("core-js/modules/es.string.iterator"); -require("core-js/modules/es.string.match.js"); +require("core-js/modules/es.string.match"); -require("core-js/modules/web.dom-collections.iterator.js"); +require("core-js/modules/web.dom-collections.iterator"); -require("core-js/modules/web.queue-microtask.js"); +require("core-js/modules/web.queue-microtask"); -require("core-js/modules/esnext.global-this.js"); +require("core-js/modules/esnext.global-this"); Array.from; // static method diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js index f066f71e5a77..b089b3d0a5f3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script-query/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.array.includes"); -require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.object.to-string"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js index f066f71e5a77..b089b3d0a5f3 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-source-type-script/output.js @@ -1,8 +1,8 @@ -require("core-js/modules/es.array.includes.js"); +require("core-js/modules/es.array.includes"); -require("core-js/modules/es.object.to-string.js"); +require("core-js/modules/es.object.to-string"); -require("core-js/modules/es.promise.js"); +require("core-js/modules/es.promise"); require("foo"); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs index f8123ece74b9..a7a87ab7066d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-spread/output.mjs @@ -1,4 +1,4 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; a = [b, ...c]; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs index 81c0f641f16d..ffd45f77578e 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-static-methods/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.object.assign.js"; -import "core-js/modules/es.object.define-property.js"; -import "core-js/modules/es.object.keys.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.object.assign"; +import "core-js/modules/es.object.define-property"; +import "core-js/modules/es.object.keys"; Object.keys(foo); var getOwnPropertySymbols = Object.getOwnPropertySymbols; var { diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs index d2a01e9dfca1..6260f4e1fa77 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator-in/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; Symbol.iterator in arr; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs index 54df03710ee9..01d8ee8fb522 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-symbol-iterator/output.mjs @@ -1,8 +1,8 @@ -import "core-js/modules/es.symbol.js"; -import "core-js/modules/es.symbol.description.js"; -import "core-js/modules/es.symbol.iterator.js"; -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.string.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.symbol"; +import "core-js/modules/es.symbol.description"; +import "core-js/modules/es.symbol.iterator"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.string.iterator"; +import "core-js/modules/web.dom-collections.iterator"; arr[Symbol.iterator](); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs index 74bba776a922..dc5557373e12 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-timers/output.mjs @@ -1,7 +1,7 @@ -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.promise.js"; -import "core-js/modules/web.immediate.js"; -import "core-js/modules/web.timers.js"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.promise"; +import "core-js/modules/web.immediate"; +import "core-js/modules/web.timers"; Promise.resolve().then(function (it) { setTimeout(foo, 1, 2); setInterval(foo, 1, 2); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs index aedb1b6a809e..f2fbbbe4b600 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-edge-13/output.mjs @@ -1,6 +1,6 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.to-locale-string"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs index 33f6402de643..469c6467c34a 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array-static/output.mjs @@ -1,29 +1,29 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.of.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.of"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; Int8Array.of(); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs index 037147d591d8..dcce776d0823 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-typed-array/output.mjs @@ -1,28 +1,28 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/es.array-buffer.slice.js"; -import "core-js/modules/es.object.to-string.js"; -import "core-js/modules/es.typed-array.int8-array.js"; -import "core-js/modules/es.typed-array.copy-within.js"; -import "core-js/modules/es.typed-array.every.js"; -import "core-js/modules/es.typed-array.fill.js"; -import "core-js/modules/es.typed-array.filter.js"; -import "core-js/modules/es.typed-array.find.js"; -import "core-js/modules/es.typed-array.find-index.js"; -import "core-js/modules/es.typed-array.for-each.js"; -import "core-js/modules/es.typed-array.includes.js"; -import "core-js/modules/es.typed-array.index-of.js"; -import "core-js/modules/es.typed-array.iterator.js"; -import "core-js/modules/es.typed-array.join.js"; -import "core-js/modules/es.typed-array.last-index-of.js"; -import "core-js/modules/es.typed-array.map.js"; -import "core-js/modules/es.typed-array.reduce.js"; -import "core-js/modules/es.typed-array.reduce-right.js"; -import "core-js/modules/es.typed-array.reverse.js"; -import "core-js/modules/es.typed-array.set.js"; -import "core-js/modules/es.typed-array.slice.js"; -import "core-js/modules/es.typed-array.some.js"; -import "core-js/modules/es.typed-array.sort.js"; -import "core-js/modules/es.typed-array.subarray.js"; -import "core-js/modules/es.typed-array.to-locale-string.js"; -import "core-js/modules/es.typed-array.to-string.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/es.array-buffer.slice"; +import "core-js/modules/es.object.to-string"; +import "core-js/modules/es.typed-array.int8-array"; +import "core-js/modules/es.typed-array.copy-within"; +import "core-js/modules/es.typed-array.every"; +import "core-js/modules/es.typed-array.fill"; +import "core-js/modules/es.typed-array.filter"; +import "core-js/modules/es.typed-array.find"; +import "core-js/modules/es.typed-array.find-index"; +import "core-js/modules/es.typed-array.for-each"; +import "core-js/modules/es.typed-array.includes"; +import "core-js/modules/es.typed-array.index-of"; +import "core-js/modules/es.typed-array.iterator"; +import "core-js/modules/es.typed-array.join"; +import "core-js/modules/es.typed-array.last-index-of"; +import "core-js/modules/es.typed-array.map"; +import "core-js/modules/es.typed-array.reduce"; +import "core-js/modules/es.typed-array.reduce-right"; +import "core-js/modules/es.typed-array.reverse"; +import "core-js/modules/es.typed-array.set"; +import "core-js/modules/es.typed-array.slice"; +import "core-js/modules/es.typed-array.some"; +import "core-js/modules/es.typed-array.sort"; +import "core-js/modules/es.typed-array.subarray"; +import "core-js/modules/es.typed-array.to-locale-string"; +import "core-js/modules/es.typed-array.to-string"; new Int8Array(1); diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs index 923ee6b8b9ac..be5b5a63a311 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-yield-star/output.mjs @@ -1,5 +1,5 @@ -import "core-js/modules/es.array.iterator.js"; -import "core-js/modules/web.dom-collections.iterator.js"; +import "core-js/modules/es.array.iterator"; +import "core-js/modules/web.dom-collections.iterator"; function* a() { yield* 1; diff --git a/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js b/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js index 0495898ba8f3..9f20ecdbd956 100644 --- a/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js +++ b/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js @@ -1,5 +1,5 @@ -import _Array$from from "../../core-js/array/from.js"; -import _isIterable from "../../core-js/is-iterable.js"; +import _Array$from from "../../core-js/array/from"; +import _isIterable from "../../core-js/is-iterable"; export default function _iterableToArray(iter) { if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); } \ No newline at end of file diff --git a/packages/babel-runtime-corejs2/helpers/iterableToArray.js b/packages/babel-runtime-corejs2/helpers/iterableToArray.js index 0e58c478e900..c7834a312257 100644 --- a/packages/babel-runtime-corejs2/helpers/iterableToArray.js +++ b/packages/babel-runtime-corejs2/helpers/iterableToArray.js @@ -1,6 +1,6 @@ -var _Array$from = require("../core-js/array/from.js"); +var _Array$from = require("../core-js/array/from"); -var _isIterable = require("../core-js/is-iterable.js"); +var _isIterable = require("../core-js/is-iterable"); function _iterableToArray(iter) { if (_isIterable(Object(iter)) || Object.prototype.toString.call(iter) === "[object Arguments]") return _Array$from(iter); From f753c48f74e9556265796806370fdf104e8147eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 8 Dec 2019 00:25:57 +0100 Subject: [PATCH 853/965] v7.7.6 --- lerna.json | 3 ++- packages/babel-plugin-transform-runtime/package.json | 6 +++--- packages/babel-preset-env-standalone/package.json | 6 +++--- packages/babel-preset-env/package.json | 2 +- packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 4 ++-- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lerna.json b/lerna.json index 866f7611113a..80f7b7358916 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.5", + "version": "7.7.6", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", @@ -21,6 +21,7 @@ "*.md", "*.txt", "test/**", + "**/test/**", "codemods/**", "# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.", "@(!(built-in-modules|built-ins|plugins|package)).json", diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index d271ead782b7..4e4123f3cbe3 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.7.5", + "version": "7.7.6", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -25,8 +25,8 @@ "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/helpers": "^7.7.4", "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/preset-env": "^7.7.5", - "@babel/runtime": "^7.7.5", + "@babel/preset-env": "^7.7.6", + "@babel/runtime": "^7.7.6", "@babel/template": "^7.7.4", "@babel/types": "^7.7.4" } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index d23a587aa605..6c36472df7e0 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.5", + "version": "7.7.6", "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -18,8 +18,8 @@ "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/preset-env": "^7.7.5", - "@babel/standalone": "^7.7.5", + "@babel/preset-env": "^7.7.6", + "@babel/standalone": "^7.7.6", "lodash": "^4.17.13" }, "keywords": [ diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 414637eb6167..58e1caaf0c1c 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.5", + "version": "7.7.6", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index cd74fca34b45..67c689a8d9de 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.5", + "version": "7.7.6", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index f99f10fba9a7..07f5880759ba 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.5", + "version": "7.7.6", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index e3c22b8cb825..1af7d8a8d798 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.5", + "version": "7.7.6", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 5fa017758ade..27440fc019ec 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.5", + "version": "7.7.6", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -89,7 +89,7 @@ "@babel/plugin-transform-react-jsx-source": "^7.7.4", "@babel/plugin-transform-regenerator": "^7.7.5", "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-runtime": "^7.7.5", + "@babel/plugin-transform-runtime": "^7.7.6", "@babel/plugin-transform-shorthand-properties": "^7.7.4", "@babel/plugin-transform-spread": "^7.7.4", "@babel/plugin-transform-sticky-regex": "^7.7.4", From b2429fe203b51b6cc80e0220078be21776823441 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Sat, 7 Dec 2019 23:29:56 +0000 Subject: [PATCH 854/965] Add v7.7.6 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd31fe3736d..e26777674ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,14 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.7.6 (2019-12-08) + +#### :house: Internal +* [#10836](https://github.com/babel/babel/pull/10836) chore: add PR Revert labels to changelog [ci-skip] ([@JLHwung](https://github.com/JLHwung)) + +#### :leftwards_arrow_with_hook: Revert +* `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-regenerator`, `babel-plugin-transform-runtime`, `babel-preset-env`, `babel-runtime-corejs2` + * [#10835](https://github.com/babel/babel/pull/10835) Revert "Add ".js" extension to injected polyfill imports" ([@JLHwung](https://github.com/JLHwung)) ## v7.7.5 (2019-12-06) #### :bug: Bug Fix From fb100eee419099783c0408210ba39cde99ad58c9 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sat, 7 Dec 2019 20:59:18 -0500 Subject: [PATCH 855/965] @babel/eslint-parser: fix BigIntLiteral node to match ESTree spec (#10827) * @babel/eslint-parser: fix BigIntLiteral node to match ESTree spec * Move token conversion to @babel/eslint-parser * Add estree plugin tests * Update test helpers to handle BigInt serializing * Update Literal union type to include BigIntLiteral * Add FlowIgnore comment for BigInt --- eslint/babel-eslint-parser/package.json | 1 + .../src/babylon-to-espree/convertAST.js | 1 - .../src/babylon-to-espree/convertToken.js | 3 + .../test/babel-eslint-parser.js | 8 +- .../test/fixtures/config/babel.config.js | 1 + packages/babel-parser/src/plugins/estree.js | 21 +++- packages/babel-parser/src/types.js | 3 +- .../fixtures/estree/bigInt/basic/input.js | 1 + .../fixtures/estree/bigInt/basic/output.json | 102 +++++++++++++++ .../test/fixtures/estree/bigInt/options.json | 6 + .../options.json | 5 +- .../test/helpers/runFixtureTests.js | 118 +++++++++++------- 12 files changed, 215 insertions(+), 55 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/estree/bigInt/basic/input.js create mode 100644 packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json create mode 100644 packages/babel-parser/test/fixtures/estree/bigInt/options.json diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index e24970d36b8c..0205facb646d 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -34,6 +34,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-syntax-bigint": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/plugin-syntax-export-default-from": "^7.0.0", "@babel/plugin-syntax-export-namespace-from": "^7.0.0", diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js index 4acce5fb5036..50d472803a0b 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js @@ -70,7 +70,6 @@ const astTransformVisitor = { } // modules - if (path.isImportDeclaration()) { delete node.isType; } diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js index 46a8656dd0e1..54527136801a 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js @@ -77,6 +77,9 @@ export default function(token, tt, source) { flags: value.flags, }; token.value = `/${value.pattern}/${value.flags}`; + } else if (type === tt.bigint) { + token.type = "Numeric"; + token.value = `${token.value}n`; } return token; diff --git a/eslint/babel-eslint-parser/test/babel-eslint-parser.js b/eslint/babel-eslint-parser/test/babel-eslint-parser.js index 37f15c03d310..d3aa67223b18 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint-parser.js +++ b/eslint/babel-eslint-parser/test/babel-eslint-parser.js @@ -27,7 +27,7 @@ function parseAndAssertSame(code) { loc: true, range: true, comment: true, - ecmaVersion: 2018, + ecmaVersion: 2020, sourceType: "module", }); const babylonAST = parseForESLint(code, { @@ -518,5 +518,11 @@ describe("babylon-to-espree", () => { } `); }); + + it("BigInt", () => { + parseAndAssertSame(` + const a = 1n; + `); + }); }); }); diff --git a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js index 4d49158dba90..56a2f07d9707 100644 --- a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js +++ b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js @@ -17,5 +17,6 @@ module.exports = { "@babel/plugin-syntax-export-namespace-from", ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: false }], ["@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" }], + "@babel/plugin-syntax-bigint", ], }; diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index 60bc1effffa7..9a7ae0cf5918 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -1,5 +1,7 @@ // @flow +/* global BigInt */ + import { types as tt, TokenType } from "../tokenizer/types"; import type Parser from "../parser"; import * as N from "../types"; @@ -31,6 +33,16 @@ export default (superClass: Class): Class => return node; } + estreeParseBigIntLiteral(value: any): N.Node { + // https://github.com/estree/estree/blob/master/es2020.md#bigintliteral + // $FlowIgnore + const bigInt = typeof BigInt !== "undefined" ? BigInt(value) : null; + const node = this.estreeParseLiteral(bigInt); + node.bigint = String(node.value || value); + + return node; + } + estreeParseLiteral(value: any): N.Node { return this.parseLiteral(value, "Literal"); } @@ -244,13 +256,16 @@ export default (superClass: Class): Class => parseExprAtom(refShorthandDefaultPos?: ?Pos): N.Expression { switch (this.state.type) { - case tt.regexp: - return this.estreeParseRegExpLiteral(this.state.value); - case tt.num: case tt.string: return this.estreeParseLiteral(this.state.value); + case tt.regexp: + return this.estreeParseRegExpLiteral(this.state.value); + + case tt.bigint: + return this.estreeParseBigIntLiteral(this.state.value); + case tt._null: return this.estreeParseLiteral(null); diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 82815b1443d6..71e83d142958 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -96,7 +96,8 @@ export type Literal = | NullLiteral | StringLiteral | BooleanLiteral - | NumericLiteral; + | NumericLiteral + | BigIntLiteral; export type RegExpLiteral = NodeBase & { type: "RegExpLiteral", diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/basic/input.js b/packages/babel-parser/test/fixtures/estree/bigInt/basic/input.js new file mode 100644 index 000000000000..b01de9749f99 --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/bigInt/basic/input.js @@ -0,0 +1 @@ +const a = 1n; diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json new file mode 100644 index 000000000000..8723c3f23444 --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json @@ -0,0 +1,102 @@ +{ + "type": "File", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "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": 6, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "Literal", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "value": "1", + "raw": "1n", + "bigint": "1" + } + } + ], + "kind": "const" + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/options.json b/packages/babel-parser/test/fixtures/estree/bigInt/options.json new file mode 100644 index 000000000000..da7e9e174f39 --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/bigInt/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "estree", + "bigInt" + ] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json index c61fa716aeb5..4ee4c944603d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/options.json @@ -1,3 +1,6 @@ { - "plugins": ["classProperties", ["decorators", { "decoratorsBeforeExport": false }]] + "plugins": [ + "classProperties", + ["decorators", { "decoratorsBeforeExport": false }] + ] } diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index f08ed2312101..288ecbb2fe0a 100644 --- a/packages/babel-parser/test/helpers/runFixtureTests.js +++ b/packages/babel-parser/test/helpers/runFixtureTests.js @@ -1,3 +1,5 @@ +/* global BigInt */ + import { multiple as getFixtures } from "@babel/helper-fixtures"; import { codeFrameColumns } from "@babel/code-frame"; import fs from "fs"; @@ -61,7 +63,7 @@ export function runFixtureTests(fixturesPath, parseFunction) { /^.*Got error message: /, "", ); - fs.writeFileSync(fn, JSON.stringify(task.options, null, " ")); + fs.writeFileSync(fn, JSON.stringify(task.options, null, 2)); } } @@ -107,19 +109,33 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) { } function save(test, ast) { - // Ensure that RegExp and Errors are serialized as strings - forceToString(RegExp, () => - forceToString(Error, () => - fs.writeFileSync(test.expect.loc, JSON.stringify(ast, null, " ")), - ), + overrideToJSON(() => + fs.writeFileSync(test.expect.loc, JSON.stringify(ast, null, 2)), ); } -function forceToString(obj, cb) { - const { toJSON } = obj.prototype; - obj.prototype.toJSON = obj.prototype.toString; +// Ensure that RegExp, BigInt, and Errors are serialized as strings +function overrideToJSON(cb) { + const originalToJSONMap = new Map(); + const notJSONparseableObj = [RegExp, Error]; + + if (typeof BigInt !== "undefined") { + notJSONparseableObj.push(BigInt); + } + + for (const obj of notJSONparseableObj) { + const { toJSON } = obj.prototype; + originalToJSONMap.set(obj, toJSON); + obj.prototype.toJSON = function() { + return this.toString(); + }; + } + cb(); - obj.prototype.toJSON = toJSON; + + for (const obj of notJSONparseableObj) { + obj.prototype.toJSON = originalToJSONMap.get(obj); + } } function runTest(test, parseFunction) { @@ -143,7 +159,7 @@ function runTest(test, parseFunction) { const fn = path.dirname(test.expect.loc) + "/options.json"; test.options = test.options || {}; test.options.throws = err.message; - fs.writeFileSync(fn, JSON.stringify(test.options, null, " ")); + fs.writeFileSync(fn, JSON.stringify(test.options, null, 2)); return; } @@ -172,11 +188,11 @@ function runTest(test, parseFunction) { const fn = path.dirname(test.expect.loc) + "/options.json"; test.options = test.options || {}; delete test.options.throws; - const contents = JSON.stringify(test.options, null, " "); + const contents = JSON.stringify(test.options, null, 2); if (contents === "{}") { fs.unlinkSync(fn); } else { - fs.writeFileSync(fn, JSON.stringify(test.options, null, " ")); + fs.writeFileSync(fn, JSON.stringify(test.options, null, 2)); } test.expect.loc += "on"; return save(test, ast); @@ -198,7 +214,6 @@ function runTest(test, parseFunction) { } function ppJSON(v) { - v = v instanceof RegExp || v instanceof Error ? v.toString() : v; return JSON.stringify(v, null, 2); } @@ -211,42 +226,49 @@ function addPath(str, pt) { } function misMatch(exp, act) { - 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; - } else if (Array.isArray(exp)) { - if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); - if (act.length != exp.length) { - return "array length mismatch " + exp.length + " != " + act.length; - } - for (let i = 0; i < act.length; ++i) { - const mis = misMatch(exp[i], act[i]); - if (mis) return addPath(mis, i); - } - } else if (!exp || !act || typeof exp != "object" || typeof act != "object") { - if (exp !== act && typeof exp != "function") { - return ppJSON(exp) + " !== " + ppJSON(act); - } - } else { - for (const prop of Object.keys(exp)) { - const mis = misMatch(exp[prop], act[prop]); - if (mis) return addPath(mis, prop); - } - - for (const prop of Object.keys(act)) { - if (typeof act[prop] === "function") { - continue; + overrideToJSON(() => { + 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; + } else if (Array.isArray(exp)) { + if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); + if (act.length != exp.length) { + return "array length mismatch " + exp.length + " != " + act.length; + } + for (let i = 0; i < act.length; ++i) { + const mis = misMatch(exp[i], act[i]); + if (mis) return addPath(mis, i); + } + } else if ( + !exp || + !act || + typeof exp != "object" || + typeof act != "object" + ) { + if (exp !== act && typeof exp != "function") { + return ppJSON(exp) + " !== " + ppJSON(act); + } + } else { + for (const prop of Object.keys(exp)) { + const mis = misMatch(exp[prop], act[prop]); + if (mis) return addPath(mis, prop); } - if (!(prop in exp) && act[prop] !== undefined) { - return `Did not expect a property '${prop}'`; + for (const prop of Object.keys(act)) { + if (typeof act[prop] === "function") { + continue; + } + + if (!(prop in exp) && act[prop] !== undefined) { + return `Did not expect a property '${prop}'`; + } } } - } + }); } From 01646629441dd178f42595fa3b0a6563870671e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sun, 8 Dec 2019 08:53:28 -0500 Subject: [PATCH 856/965] refactor: rewrite available-plugins to esm (#10837) --- .../babel-preset-env/src/available-plugins.js | 129 ++++++++++++------ 1 file changed, 86 insertions(+), 43 deletions(-) diff --git a/packages/babel-preset-env/src/available-plugins.js b/packages/babel-preset-env/src/available-plugins.js index 8ce0c72f1aa0..ad66e3275b4b 100644 --- a/packages/babel-preset-env/src/available-plugins.js +++ b/packages/babel-preset-env/src/available-plugins.js @@ -1,47 +1,90 @@ // @flow +import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators"; +import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import"; +import syntaxJsonStrings from "@babel/plugin-syntax-json-strings"; +import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread"; +import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding"; +import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await"; +import proposalAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions"; +import proposalDynamicImport from "@babel/plugin-proposal-dynamic-import"; +import proposalJsonStrings from "@babel/plugin-proposal-json-strings"; +import proposalObjectRestSpread from "@babel/plugin-proposal-object-rest-spread"; +import proposalOptionalCatchBinding from "@babel/plugin-proposal-optional-catch-binding"; +import proposalUnicodePropertyRegex from "@babel/plugin-proposal-unicode-property-regex"; +import transformAsyncToGenerator from "@babel/plugin-transform-async-to-generator"; +import transformArrowFunctions from "@babel/plugin-transform-arrow-functions"; +import transformBlockScopedFunctions from "@babel/plugin-transform-block-scoped-functions"; +import transformBlockScoping from "@babel/plugin-transform-block-scoping"; +import transformClasses from "@babel/plugin-transform-classes"; +import transformComputedProperties from "@babel/plugin-transform-computed-properties"; +import transformDestructuring from "@babel/plugin-transform-destructuring"; +import transformDotallRegex from "@babel/plugin-transform-dotall-regex"; +import transformDuplicateKeys from "@babel/plugin-transform-duplicate-keys"; +import transformExponentialOperator from "@babel/plugin-transform-exponentiation-operator"; +import transformForOf from "@babel/plugin-transform-for-of"; +import transformFunctionName from "@babel/plugin-transform-function-name"; +import transformLiterals from "@babel/plugin-transform-literals"; +import transformMemberExpressionLiterals from "@babel/plugin-transform-member-expression-literals"; +import transformModulesAmd from "@babel/plugin-transform-modules-amd"; +import transformModulesCommonjs from "@babel/plugin-transform-modules-commonjs"; +import transformModulesSystemjs from "@babel/plugin-transform-modules-systemjs"; +import transformModulesUmd from "@babel/plugin-transform-modules-umd"; +import transformNamedCapturingGroupsRegex from "@babel/plugin-transform-named-capturing-groups-regex"; +import transformNewTarget from "@babel/plugin-transform-new-target"; +import transformObjectSuper from "@babel/plugin-transform-object-super"; +import transformParameters from "@babel/plugin-transform-parameters"; +import transformPropertyLiterals from "@babel/plugin-transform-property-literals"; +import transformRegenerator from "@babel/plugin-transform-regenerator"; +import transformReservedWords from "@babel/plugin-transform-reserved-words"; +import transformShorthandProperties from "@babel/plugin-transform-shorthand-properties"; +import transformSpread from "@babel/plugin-transform-spread"; +import transformStickyRegex from "@babel/plugin-transform-sticky-regex"; +import transformTemplateLiterals from "@babel/plugin-transform-template-literals"; +import transformTypeofSymbol from "@babel/plugin-transform-typeof-symbol"; +import transformUnicodeRegex from "@babel/plugin-transform-unicode-regex"; export default { - "syntax-async-generators": require("@babel/plugin-syntax-async-generators"), - "syntax-dynamic-import": require("@babel/plugin-syntax-dynamic-import"), - "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"), - "proposal-json-strings": require("@babel/plugin-proposal-json-strings"), - "transform-arrow-functions": require("@babel/plugin-transform-arrow-functions"), - "transform-block-scoped-functions": require("@babel/plugin-transform-block-scoped-functions"), - "transform-block-scoping": require("@babel/plugin-transform-block-scoping"), - "transform-classes": require("@babel/plugin-transform-classes"), - "transform-computed-properties": require("@babel/plugin-transform-computed-properties"), - "transform-destructuring": require("@babel/plugin-transform-destructuring"), - "transform-dotall-regex": require("@babel/plugin-transform-dotall-regex"), - "transform-duplicate-keys": require("@babel/plugin-transform-duplicate-keys"), - "transform-for-of": require("@babel/plugin-transform-for-of"), - "transform-function-name": require("@babel/plugin-transform-function-name"), - "transform-literals": require("@babel/plugin-transform-literals"), - "transform-member-expression-literals": require("@babel/plugin-transform-member-expression-literals"), - "transform-modules-amd": require("@babel/plugin-transform-modules-amd"), - "transform-modules-commonjs": require("@babel/plugin-transform-modules-commonjs"), - "transform-modules-systemjs": require("@babel/plugin-transform-modules-systemjs"), - "transform-modules-umd": require("@babel/plugin-transform-modules-umd"), - "transform-named-capturing-groups-regex": require("@babel/plugin-transform-named-capturing-groups-regex"), - "transform-object-super": require("@babel/plugin-transform-object-super"), - "transform-parameters": require("@babel/plugin-transform-parameters"), - "transform-property-literals": require("@babel/plugin-transform-property-literals"), - "transform-reserved-words": require("@babel/plugin-transform-reserved-words"), - "transform-shorthand-properties": require("@babel/plugin-transform-shorthand-properties"), - "transform-spread": require("@babel/plugin-transform-spread"), - "transform-sticky-regex": require("@babel/plugin-transform-sticky-regex"), - "transform-template-literals": require("@babel/plugin-transform-template-literals"), - "transform-typeof-symbol": require("@babel/plugin-transform-typeof-symbol"), - "transform-unicode-regex": require("@babel/plugin-transform-unicode-regex"), - "transform-exponentiation-operator": require("@babel/plugin-transform-exponentiation-operator"), - "transform-new-target": require("@babel/plugin-transform-new-target"), - "proposal-object-rest-spread": require("@babel/plugin-proposal-object-rest-spread"), - "proposal-optional-catch-binding": require("@babel/plugin-proposal-optional-catch-binding"), - "transform-regenerator": require("@babel/plugin-transform-regenerator"), - "proposal-unicode-property-regex": require("@babel/plugin-proposal-unicode-property-regex"), + "syntax-async-generators": syntaxAsyncGenerators, + "syntax-dynamic-import": syntaxDynamicImport, + "syntax-json-strings": syntaxJsonStrings, + "syntax-object-rest-spread": syntaxObjectRestSpread, + "syntax-optional-catch-binding": syntaxOptionalCatchBinding, + "syntax-top-level-await": syntaxTopLevelAwait, + "transform-async-to-generator": transformAsyncToGenerator, + "proposal-async-generator-functions": proposalAsyncGeneratorFunctions, + "proposal-dynamic-import": proposalDynamicImport, + "proposal-json-strings": proposalJsonStrings, + "transform-arrow-functions": transformArrowFunctions, + "transform-block-scoped-functions": transformBlockScopedFunctions, + "transform-block-scoping": transformBlockScoping, + "transform-classes": transformClasses, + "transform-computed-properties": transformComputedProperties, + "transform-destructuring": transformDestructuring, + "transform-dotall-regex": transformDotallRegex, + "transform-duplicate-keys": transformDuplicateKeys, + "transform-for-of": transformForOf, + "transform-function-name": transformFunctionName, + "transform-literals": transformLiterals, + "transform-member-expression-literals": transformMemberExpressionLiterals, + "transform-modules-amd": transformModulesAmd, + "transform-modules-commonjs": transformModulesCommonjs, + "transform-modules-systemjs": transformModulesSystemjs, + "transform-modules-umd": transformModulesUmd, + "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex, + "transform-object-super": transformObjectSuper, + "transform-parameters": transformParameters, + "transform-property-literals": transformPropertyLiterals, + "transform-reserved-words": transformReservedWords, + "transform-shorthand-properties": transformShorthandProperties, + "transform-spread": transformSpread, + "transform-sticky-regex": transformStickyRegex, + "transform-template-literals": transformTemplateLiterals, + "transform-typeof-symbol": transformTypeofSymbol, + "transform-unicode-regex": transformUnicodeRegex, + "transform-exponentiation-operator": transformExponentialOperator, + "transform-new-target": transformNewTarget, + "proposal-object-rest-spread": proposalObjectRestSpread, + "proposal-optional-catch-binding": proposalOptionalCatchBinding, + "transform-regenerator": transformRegenerator, + "proposal-unicode-property-regex": proposalUnicodePropertyRegex, }; From b7989419c7fcf2fbee25639b860871d3b177dc85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 9 Dec 2019 13:50:34 -0500 Subject: [PATCH 857/965] Update corejs fixtures (#10846) * chore: add update-env-corejs-fixture recipe * chore: update corejs fixtures --- Makefile | 6 ++++++ .../corejs2/usage-evaluated-not-confident/output.mjs | 1 - .../test/fixtures/debug/entry-corejs3-android/stdout.txt | 2 -- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 50ff34f61cba..acd9ed6df669 100644 --- a/Makefile +++ b/Makefile @@ -283,6 +283,12 @@ clean-all: $(MAKE) clean +update-env-corejs-fixture: + rm -rf packages/babel-preset-env/node_modules/core-js-compat + $(YARN) lerna bootstrap + $(MAKE) build-bundle + OVERWRITE=true $(YARN) jest packages/babel-preset-env + define clean-source-lib rm -rf $(1)/*/lib diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs index 8ce9547c189d..dfd826b75852 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-evaluated-not-confident/output.mjs @@ -10,4 +10,3 @@ Object['values'](); // include Object[keys](); // don't include [][filter](); // don't include - 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 684f0ebd9aa1..02329f66f39d 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 @@ -129,8 +129,6 @@ Using polyfills with `entry` option: es.number.to-precision { "android":"4" } es.object.assign { "android":"4" } es.object.define-getter { "android":"4" } - es.object.define-properties { "android":"4" } - es.object.define-property { "android":"4" } es.object.define-setter { "android":"4" } es.object.entries { "android":"4" } es.object.freeze { "android":"4" } From 2884bac44bfcafb28c425f50aadd40f83673f08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 9 Dec 2019 22:54:25 +0100 Subject: [PATCH 858/965] Use `async-to-generator` even when `regenerator` is enabled (#10839) While it isn't technically needed because regenerator already handles async functions, it doesn't play well with the Promise detection logic used by @babel/preset-env's useBuiltIns and @babel/transform-runtime. The plugin exclusion logic isn't removed, because 1) it will be useful when merging @babel/preset-modules into @babel/preset-env 2) if/when regenerator will support injecting a custom promise, we can enable this optimization again --- .../test/fixtures/regression/T6755/output.js | 42 +++++++++++++------ .../test/fixtures/regression/4219/output.js | 35 ++++++++++------ .../data/overlapping-plugins.js | 3 +- .../chrome-49/input.js | 0 .../chrome-49/options.json | 0 .../chrome-49/output.js | 0 .../chrome-50/input.js | 0 .../chrome-50/options.json | 0 .../chrome-50/output.js | 0 .../chrome-54/input.js | 0 .../chrome-54/options.json | 0 .../chrome-54/output.js | 0 .../chrome-55/input.js | 0 .../chrome-55/options.json | 0 .../chrome-55/output.js | 0 .../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 + 72 files changed, 152 insertions(+), 43 deletions(-) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-49/input.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-49/options.json (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-49/output.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-50/input.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-50/options.json (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-50/output.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-54/input.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-54/options.json (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-54/output.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-55/input.js (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-55/options.json (100%) rename packages/babel-preset-env/test/fixtures/{plugins-overlapping => .plugins-overlapping}/chrome-55/output.js (100%) 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 204120c62c82..435ad8c4dfa3 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,3 +1,7 @@ +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 () { @@ -7,21 +11,33 @@ function () { var _proto = Example.prototype; - _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)); + _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); - 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 a3b8fd1f26c4..0b2d02f3770d 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,17 +1,26 @@ +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 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)); + 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)); - 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 index 84c0d416b4ad..e4e9904f90b0 100644 --- a/packages/babel-preset-env/data/overlapping-plugins.js +++ b/packages/babel-preset-env/data/overlapping-plugins.js @@ -4,7 +4,8 @@ module.exports = new Map(); // async -> regenerator is better than async -> generator -> regenerator ifIncluded("transform-regenerator") - .isUnnecessary("transform-async-to-generator"); + // https://github.com/babel/babel/issues/10678 + // .isUnnecessary("transform-async-to-generator"); function ifIncluded(name) { const set = new Set(); 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/input.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-49/input.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/options.json rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-49/options.json 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-49/output.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-49/output.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/input.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-50/input.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/options.json rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-50/options.json 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-50/output.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-50/output.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/input.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-54/input.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/options.json rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-54/options.json 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-54/output.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-54/output.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/input.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-55/input.js 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/options.json rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-55/options.json 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 similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugins-overlapping/chrome-55/output.js rename to packages/babel-preset-env/test/fixtures/.plugins-overlapping/chrome-55/output.js 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 178c426ba53f..db18b8bfe116 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,13 +1,28 @@ 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 regeneratorRuntime.async(function a$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - case "end": - return _context.stop(); + 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(); + } } - } - }); + }, _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 03624378656f..5663fd906a75 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,14 +2,27 @@ 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 regeneratorRuntime.async(function a$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - case "end": - return _context.stop(); + 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(); + } } - } - }); + }, _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 d263c3020966..dd2af17fc22d 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,6 +30,7 @@ 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 b2d6215dfff4..d4cb727787d8 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,6 +30,7 @@ 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 bfc587d621ae..c3c18fa3a051 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,6 +25,7 @@ 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 f5645e48ccb3..32637c13542d 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,6 +30,7 @@ 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 bea5ddcef506..e5a186c32135 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,6 +28,7 @@ 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 bc8c000777a8..cbffdcc578f3 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,6 +28,7 @@ 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 fd3e8b442630..16202760ee72 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,6 +35,7 @@ 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 afe468aa8aba..63ba5e06fce5 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,6 +41,7 @@ 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 c14636d386e1..ae6350c447da 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,6 +32,7 @@ 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 14ad1ce4b6cd..4b45c43d32d2 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,6 +32,7 @@ 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 38e834034f84..0d0f575f70c3 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,6 +28,7 @@ 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 02329f66f39d..fb4267fdd780 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,6 +30,7 @@ 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 e730eb6421ca..a900b4720ab0 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,6 +28,7 @@ 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 32c6a7530002..85026b3df8e2 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,6 +25,7 @@ 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 39b7566a4edc..07743893310e 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,6 +28,7 @@ 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 cf8816e74969..f6c3da52ca39 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,6 +28,7 @@ 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 2733197a3382..dbc3ba935e3e 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,6 +30,7 @@ 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 b400e3b3da64..2d70ebb4d616 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,6 +28,7 @@ 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 9b8ceb81a002..237cf943f7c3 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,6 +28,7 @@ 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 2adaac616ba5..7db11b83525a 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,6 +35,7 @@ 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 223ef746fda9..38e8356a3478 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,6 +28,7 @@ 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 9cee893f2a2e..5380e1c89aa6 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,6 +28,7 @@ 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 ad6cde3c24aa..efcedad873c6 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,6 +41,7 @@ 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 8d8cf7fe2333..af5f0f9ffe87 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,6 +32,7 @@ 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 31c21bace19c..c74e3e37cb55 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,6 +32,7 @@ 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 74c154a2b26d..caff30ef4984 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,6 +32,7 @@ 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 d92ec30279e3..9dea1a0f8905 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,6 +28,7 @@ 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 a35cd149137c..b337515f602d 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,6 +32,7 @@ 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 e28519a1f6ad..621161013483 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,6 +28,7 @@ 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 d051b5019f6b..c773b35d1314 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,6 +33,7 @@ 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 596d823fbcd7..b070fd82ae2c 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,6 +32,7 @@ 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 3a4742537bf8..10a416642303 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,6 +31,7 @@ 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 7337bd97a95e..c6bd456f09c6 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,6 +31,7 @@ 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 f17969a7c09a..83701579d0ee 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,6 +31,7 @@ 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 0c1cce6bfe7d..d0cc380462d3 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,6 +31,7 @@ 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 54f7d2b6892c..f7f567c4c47a 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,6 +31,7 @@ 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 f251da3a1fb9..8f4c5e1df667 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,6 +31,7 @@ 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 65b636097824..f456fc31c325 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,6 +31,7 @@ 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 baea99e275f5..14c735dcba8c 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,6 +31,7 @@ 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 5420011af7ff..ce78b1615fa3 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,6 +31,7 @@ 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 51c71b8b36d6..4545ec9ddac5 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,6 +31,7 @@ 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 0cb836caf43e..5effbeed1198 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,6 +31,7 @@ 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 0ca472fb637f..999084137006 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,6 +31,7 @@ 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 a1c85b5f240b..4f5e93bc1d2a 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,6 +31,7 @@ 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 d21f014f1314..c7b2d3da53a4 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,6 +31,7 @@ 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 56aa662832b0..3186c00e2458 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,6 +31,7 @@ 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 848d033d61be..ed270ec46b29 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,6 +31,7 @@ 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 d7384c46888d..1fcbf70cef28 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,6 +31,7 @@ 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 3897ddf434ae..1b7bf00896fb 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,6 +31,7 @@ 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 31bc70824f26..7df78cdbe879 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,6 +31,7 @@ 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 29b751d07ae8..2dba4464ffa8 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,6 +31,7 @@ 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 eb4cf5b632c2..211854dc7a12 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,6 +31,7 @@ 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 77a2227dde4e..90c9d87ef822 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,6 +31,7 @@ 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 d2f78b1901c6..6afbb5cd98f5 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,6 +31,7 @@ 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 cc7e91a5d56d..5d3445c8f14f 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,6 +31,7 @@ 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" } From f02e5e6d0a269c1cf3f1fd04de355895c8164d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 9 Dec 2019 17:56:22 -0500 Subject: [PATCH 859/965] Add missing dev dependencies (#10847) * chore: declare eslint-import-resolver-node dependency # Conflicts: # yarn.lock * chore: add devDependencies * Add browserify devDep to babel-register # Conflicts: # packages/babel-register/package.json # yarn.lock * chore: resolve eslint-scope to 5.0.0 --- package.json | 4 +- packages/babel-cli/package.json | 3 +- packages/babel-node/package.json | 4 +- packages/babel-register/package.json | 2 + yarn.lock | 2086 +++++++++++++++----------- 5 files changed, 1185 insertions(+), 914 deletions(-) diff --git a/package.json b/package.json index b189fa16925a..545835a1a216 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "enhanced-resolve": "^3.0.0", "eslint": "^6.0.1", "eslint-config-babel": "^9.0.0", + "eslint-import-resolver-node": "^0.3.2", "eslint-plugin-flowtype": "^3.8.2", "eslint-plugin-import": "^2.17.2", "eslint-plugin-prettier": "^3.1.0", @@ -77,7 +78,8 @@ "typescript": "^3.6.3" }, "resolutions": { - "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates" + "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates", + "eslint-scope": "^5.0.0" }, "engines": { "node": ">= 6.9.0 < 14.0.0", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 10da6ba7e9f2..6030926c9a05 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -36,7 +36,8 @@ }, "devDependencies": { "@babel/core": "^7.7.5", - "@babel/helper-fixtures": "^7.6.3" + "@babel/helper-fixtures": "^7.6.3", + "rimraf": "^3.0.0" }, "bin": { "babel": "./bin/babel.js", diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index f21c4734e10a..9813bd1a5e5a 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -33,8 +33,10 @@ "devDependencies": { "@babel/core": "^7.7.4", "@babel/helper-fixtures": "^7.6.3", + "@babel/runtime": "^7.7.4", "fs-readdir-recursive": "^1.0.0", - "make-dir": "^2.1.0" + "make-dir": "^2.1.0", + "rimraf": "^3.0.0" }, "bin": { "babel-node": "./bin/babel-node.js" diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 5f26b90e092c..d0ead91dfc7c 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -24,6 +24,8 @@ }, "devDependencies": { "@babel/core": "^7.7.4", + "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "browserify": "16.5.0", "default-require-extensions": "^2.0.0" } } diff --git a/yarn.lock b/yarn.lock index 5893166beb0e..55268a2a014a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,11 +3,11 @@ "@babel/cli@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.7.0.tgz#8d10c9acb2acb362d7614a9493e1791c69100d89" - integrity sha512-jECEqAq6Ngf3pOhLSg7od9WKyrIacyh1oNNYtRXNn+ummSHCTXBamGywOAtiae34Vk7zKuQNnLvo2BKTMCoV4A== + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.7.5.tgz#25702cc65418efc06989af3727897b9f4c8690b6" + integrity sha512-y2YrMGXM3NUyu1Myg0pxg+Lx6g8XhEyvLHYNRwTBV6fDek3H7Io6b7N/LXscLs4HWn4HxMdy7f2rM1rTMp2mFg== dependencies: - commander "^2.8.1" + commander "^4.0.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.1.0" glob "^7.0.0" @@ -26,17 +26,17 @@ "@babel/highlight" "^7.0.0" "@babel/core@^7.1.0", "@babel/core@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.2.tgz#ea5b99693bcfc058116f42fa1dd54da412b29d91" - integrity sha512-eeD7VEZKfhK1KUXGiyPFettgF3m513f8FoBSWiQ1xTvl1RAopLs42Wp9+Ze911I6H0N9lNqJMDgoZT7gHsipeQ== + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.7.5.tgz#ae1323cd035b5160293307f50647e83f8ba62f7e" + integrity sha512-M42+ScN4+1S9iB6f+TL7QBpoQETxbclx+KNoKJABghnKYE+fMzSGqst0BZJc8CpI625bwPwYgUyRvxZ+0mZzpw== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.2" - "@babel/helpers" "^7.7.0" - "@babel/parser" "^7.7.2" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.7.2" + "@babel/generator" "^7.7.4" + "@babel/helpers" "^7.7.4" + "@babel/parser" "^7.7.5" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" convert-source-map "^1.7.0" debug "^4.1.0" json5 "^2.1.0" @@ -50,132 +50,132 @@ resolved "https://registry.yarnpkg.com/@babel/eslint-plugin-development/-/eslint-plugin-development-1.0.1.tgz#1f5206ae95795db09b65e7dbc2b158d66497a44c" integrity sha512-ioEhN8HgKr4Yx8ef+XryNpKN4FimSFceb0qVVxvoUzpFn3xyq17MlY5AquEqtXObE7Nu7WKq7QL9INzjCrugyw== -"@babel/generator@^7.4.0", "@babel/generator@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.2.tgz#2f4852d04131a5e17ea4f6645488b5da66ebf3af" - integrity sha512-WthSArvAjYLz4TcbKOi88me+KmDJdKSlfwwN8CnUYn9jBkzhq0ZEPuBfkAWIvjJ3AdEV1Cf/+eSQTnp3IDJKlQ== +"@babel/generator@^7.4.0", "@babel/generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.7.4.tgz#db651e2840ca9aa66f327dcec1dc5f5fa9611369" + integrity sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg== dependencies: - "@babel/types" "^7.7.2" + "@babel/types" "^7.7.4" jsesc "^2.5.1" lodash "^4.17.13" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.0.0", "@babel/helper-annotate-as-pure@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.0.tgz#efc54032d43891fe267679e63f6860aa7dbf4a5e" - integrity sha512-k50CQxMlYTYo+GGyUGFwpxKVtxVJi9yh61sXZji3zYHccK9RYliZGSTOgci85T+r+0VFN2nWbGM04PIqwfrpMg== +"@babel/helper-annotate-as-pure@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.7.4.tgz#bb3faf1e74b74bd547e867e48f551fa6b098b6ce" + integrity sha512-2BQmQgECKzYKFPpiycoF9tlb5HA4lrVyAmLLVK177EcQAqjVLciUb2/R+n1boQ9y5ENV3uz2ZqiNw7QMBBw1Og== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz#6b69628dfe4087798e0c4ed98e3d4a6b2fbd2f5f" - integrity sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.7.4.tgz#5f73f2b28580e224b5b9bd03146a4015d6217f5f" + integrity sha512-Biq/d/WtvfftWZ9Uf39hbPBYDUo986m5Bb4zhkeYDGUllF43D+nUe5M6Vuo6/8JDK/0YX/uBdeoQpyaNhNugZQ== dependencies: - "@babel/helper-explode-assignable-expression" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/helper-explode-assignable-expression" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-call-delegate@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz#87c1f8ca19ad552a736a7a27b1c1fcf8b1ff1f43" - integrity sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ== +"@babel/helper-call-delegate@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.7.4.tgz#621b83e596722b50c0066f9dc37d3232e461b801" + integrity sha512-8JH9/B7J7tCYJ2PpWVpw9JhPuEVHztagNVuQAFBVFYluRMlpG7F1CgKEgGeL6KFqcsIa92ZYVj6DSc0XwmN1ZA== dependencies: - "@babel/helper-hoist-variables" "^7.4.4" - "@babel/traverse" "^7.4.4" - "@babel/types" "^7.4.4" + "@babel/helper-hoist-variables" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-create-class-features-plugin@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.0.tgz#bcdc223abbfdd386f94196ae2544987f8df775e8" - integrity sha512-MZiB5qvTWoyiFOgootmRSDV1udjIqJW/8lmxgzKq6oDqxdmHUjeP2ZUOmgHdYjmUVNABqRrHjYAYRvj8Eox/UA== +"@babel/helper-create-class-features-plugin@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.7.4.tgz#fce60939fd50618610942320a8d951b3b639da2d" + integrity sha512-l+OnKACG4uiDHQ/aJT8dwpR+LhCJALxL0mJ6nzjB25e5IPwqV1VOsY7ah6UB1DG+VOXAIMtuC54rFJGiHkxjgA== dependencies: - "@babel/helper-function-name" "^7.7.0" - "@babel/helper-member-expression-to-functions" "^7.7.0" - "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/helper-replace-supers" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" -"@babel/helper-create-regexp-features-plugin@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.0.tgz#2e8badfe201cfafb5d930f46cf1e0b6f1cdcab23" - integrity sha512-ZhagAAVGD3L6MPM9/zZi7RRteonfBFLVUz3kjsnYsMAtr9hOJCKI9BAKIMpqn3NyWicPieoX779UL+7/3BEAOA== +"@babel/helper-create-regexp-features-plugin@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.7.4.tgz#6d5762359fd34f4da1500e4cff9955b5299aaf59" + integrity sha512-Mt+jBKaxL0zfOIWrfQpnfYCN7/rS6GKx6CCCfuoqVVd+17R8zNDlzVYmIi9qyb2wOk002NsmSTDymkIygDUH7A== dependencies: "@babel/helper-regex" "^7.4.4" regexpu-core "^4.6.0" -"@babel/helper-define-map@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.0.tgz#60b0e9fd60def9de5054c38afde8c8ee409c7529" - integrity sha512-kPKWPb0dMpZi+ov1hJiwse9dWweZsz3V9rP4KdytnX1E7z3cTNmFGglwklzFPuqIcHLIY3bgKSs4vkwXXdflQA== +"@babel/helper-define-map@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.7.4.tgz#2841bf92eb8bd9c906851546fe6b9d45e162f176" + integrity sha512-v5LorqOa0nVQUvAUTUF3KPastvUt/HzByXNamKQ6RdJRTV7j8rLL+WB5C/MzzWAwOomxDhYFb1wLLxHqox86lg== dependencies: - "@babel/helper-function-name" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-function-name" "^7.7.4" + "@babel/types" "^7.7.4" lodash "^4.17.13" -"@babel/helper-explode-assignable-expression@^7.1.0": - version "7.1.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" - integrity sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA== +"@babel/helper-explode-assignable-expression@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.7.4.tgz#fa700878e008d85dc51ba43e9fb835cddfe05c84" + integrity sha512-2/SicuFrNSXsZNBxe5UGdLr+HZg+raWBLE9vC98bdYOKX/U6PY0mdGlYUJdtTDPSU0Lw0PNbKKDpwYHJLn2jLg== dependencies: - "@babel/traverse" "^7.1.0" - "@babel/types" "^7.0.0" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-function-name@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.0.tgz#44a5ad151cfff8ed2599c91682dda2ec2c8430a3" - integrity sha512-tDsJgMUAP00Ugv8O2aGEua5I2apkaQO7lBGUq1ocwN3G23JE5Dcq0uh3GvFTChPa4b40AWiAsLvCZOA2rdnQ7Q== +"@babel/helper-function-name@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz#ab6e041e7135d436d8f0a3eca15de5b67a341a2e" + integrity sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ== dependencies: - "@babel/helper-get-function-arity" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-get-function-arity" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/helper-get-function-arity@^7.0.0", "@babel/helper-get-function-arity@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.0.tgz#c604886bc97287a1d1398092bc666bc3d7d7aa2d" - integrity sha512-tLdojOTz4vWcEnHWHCuPN5P85JLZWbm5Fx5ZsMEMPhF3Uoe3O7awrbM2nQ04bDOUToH/2tH/ezKEOR8zEYzqyw== +"@babel/helper-get-function-arity@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz#cb46348d2f8808e632f0ab048172130e636005f0" + integrity sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-hoist-variables@^7.4.4", "@babel/helper-hoist-variables@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.0.tgz#b4552e4cfe5577d7de7b183e193e84e4ec538c81" - integrity sha512-LUe/92NqsDAkJjjCEWkNe+/PcpnisvnqdlRe19FahVapa4jndeuJ+FBiTX1rcAKWKcJGE+C3Q3tuEuxkSmCEiQ== +"@babel/helper-hoist-variables@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.7.4.tgz#612384e3d823fdfaaf9fce31550fe5d4db0f3d12" + integrity sha512-wQC4xyvc1Jo/FnLirL6CEgPgPCa8M74tOdjWpRhQYapz5JC7u3NYU1zCVoVAGCE3EaIP9T1A3iW0WLJ+reZlpQ== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-member-expression-to-functions@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.0.tgz#472b93003a57071f95a541ea6c2b098398bcad8a" - integrity sha512-QaCZLO2RtBcmvO/ekOLp8p7R5X2JriKRizeDpm5ChATAFWrrYDcDxPuCIBXKyBjY+i1vYSdcUTMIb8psfxHDPA== +"@babel/helper-member-expression-to-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.7.4.tgz#356438e2569df7321a8326644d4b790d2122cb74" + integrity sha512-9KcA1X2E3OjXl/ykfMMInBK+uVdfIVakVe7W7Lg3wfXUNyS3Q1HWLFRwZIjhqiCGbslummPDnmb7vIekS0C1vw== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.0.tgz#99c095889466e5f7b6d66d98dffc58baaf42654d" - integrity sha512-Dv3hLKIC1jyfTkClvyEkYP2OlkzNvWs5+Q8WgPbxM5LMeorons7iPP91JM+DU7tRbhqA1ZeooPaMFvQrn23RHw== +"@babel/helper-module-imports@^7.0.0", "@babel/helper-module-imports@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.7.4.tgz#e5a92529f8888bf319a6376abfbd1cebc491ad91" + integrity sha512-dGcrX6K9l8258WFjyDLJwuVKxR4XZfU0/vTUgOQYWEnRD8mgr+p4d6fCUMq/ys0h4CCt/S5JhbvtyErjWouAUQ== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" -"@babel/helper-module-transforms@^7.1.0", "@babel/helper-module-transforms@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.0.tgz#154a69f0c5b8fd4d39e49750ff7ac4faa3f36786" - integrity sha512-rXEefBuheUYQyX4WjV19tuknrJFwyKw0HgzRwbkyTbB+Dshlq7eqkWbyjzToLrMZk/5wKVKdWFluiAsVkHXvuQ== +"@babel/helper-module-transforms@^7.7.4", "@babel/helper-module-transforms@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.7.5.tgz#d044da7ffd91ec967db25cd6748f704b6b244835" + integrity sha512-A7pSxyJf1gN5qXVcidwLWydjftUN878VkalhXX5iQDuGyiGK3sOrrKKHF4/A4fwHtnsotv/NipwAeLzY4KQPvw== dependencies: - "@babel/helper-module-imports" "^7.7.0" - "@babel/helper-simple-access" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/helper-module-imports" "^7.7.4" + "@babel/helper-simple-access" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" lodash "^4.17.13" -"@babel/helper-optimise-call-expression@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.0.tgz#4f66a216116a66164135dc618c5d8b7a959f9365" - integrity sha512-48TeqmbazjNU/65niiiJIJRc5JozB8acui1OS7bSd6PgxfuovWsvjfWSzlgx+gPFdVveNzUdpdIg5l56Pl5jqg== +"@babel/helper-optimise-call-expression@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.7.4.tgz#034af31370d2995242aa4df402c3b7794b2dcdf2" + integrity sha512-VB7gWZ2fDkSuqW6b1AKXkJWO5NyNI3bFL/kK79/30moK57blr6NbH8xcl2XcKCwOmJosftWunZqfO84IGq3ZZg== dependencies: - "@babel/types" "^7.7.0" + "@babel/types" "^7.7.4" "@babel/helper-plugin-utils@^7.0.0": version "7.0.0" @@ -189,60 +189,60 @@ dependencies: lodash "^4.17.13" -"@babel/helper-remap-async-to-generator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.0.tgz#4d69ec653e8bff5bce62f5d33fc1508f223c75a7" - integrity sha512-pHx7RN8X0UNHPB/fnuDnRXVZ316ZigkO8y8D835JlZ2SSdFKb6yH9MIYRU4fy/KPe5sPHDFOPvf8QLdbAGGiyw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.7.0" - "@babel/helper-wrap-function" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - -"@babel/helper-replace-supers@^7.5.5", "@babel/helper-replace-supers@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.0.tgz#d5365c8667fe7cbd13b8ddddceb9bd7f2b387512" - integrity sha512-5ALYEul5V8xNdxEeWvRsBzLMxQksT7MaStpxjJf9KsnLxpAKBtfw5NeMKZJSYDa0lKdOcy0g+JT/f5mPSulUgg== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.7.0" - "@babel/helper-optimise-call-expression" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - -"@babel/helper-simple-access@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.0.tgz#97a8b6c52105d76031b86237dc1852b44837243d" - integrity sha512-AJ7IZD7Eem3zZRuj5JtzFAptBw7pMlS3y8Qv09vaBWoFsle0d1kAn5Wq6Q9MyBXITPOKnxwkZKoAm4bopmv26g== - dependencies: - "@babel/template" "^7.7.0" - "@babel/types" "^7.7.0" - -"@babel/helper-split-export-declaration@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.0.tgz#1365e74ea6c614deeb56ebffabd71006a0eb2300" - integrity sha512-HgYSI8rH08neWlAH3CcdkFg9qX9YsZysZI5GD8LjhQib/mM0jGOZOVkoUiiV2Hu978fRtjtsGsW6w0pKHUWtqA== - dependencies: - "@babel/types" "^7.7.0" - -"@babel/helper-wrap-function@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.0.tgz#15af3d3e98f8417a60554acbb6c14e75e0b33b74" - integrity sha512-sd4QjeMgQqzshSjecZjOp8uKfUtnpmCyQhKQrVJBBgeHAB/0FPi33h3AbVlVp07qQtMD4QgYSzaMI7VwncNK/w== - dependencies: - "@babel/helper-function-name" "^7.7.0" - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" - -"@babel/helpers@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.0.tgz#359bb5ac3b4726f7c1fde0ec75f64b3f4275d60b" - integrity sha512-VnNwL4YOhbejHb7x/b5F39Zdg5vIQpUUNzJwx0ww1EcVRt41bbGRZWhAURrfY32T5zTT3qwNOQFWpn+P0i0a2g== - dependencies: - "@babel/template" "^7.7.0" - "@babel/traverse" "^7.7.0" - "@babel/types" "^7.7.0" +"@babel/helper-remap-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.7.4.tgz#c68c2407350d9af0e061ed6726afb4fff16d0234" + integrity sha512-Sk4xmtVdM9sA/jCI80f+KS+Md+ZHIpjuqmYPk1M7F/upHou5e4ReYmExAiu6PVe65BhJPZA2CY9x9k4BqE5klw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-wrap-function" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-replace-supers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.7.4.tgz#3c881a6a6a7571275a72d82e6107126ec9e2cdd2" + integrity sha512-pP0tfgg9hsZWo5ZboYGuBn/bbYT/hdLPVSS4NMmiRJdwWhP0IznPwN9AE1JwyGsjSPLC364I0Qh5p+EPkGPNpg== + dependencies: + "@babel/helper-member-expression-to-functions" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-simple-access@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.7.4.tgz#a169a0adb1b5f418cfc19f22586b2ebf58a9a294" + integrity sha512-zK7THeEXfan7UlWsG2A6CI/L9jVnI5+xxKZOdej39Y0YtDYKx9raHk5F2EtK9K8DHRTihYwg20ADt9S36GR78A== + dependencies: + "@babel/template" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helper-split-export-declaration@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz#57292af60443c4a3622cf74040ddc28e68336fd8" + integrity sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug== + dependencies: + "@babel/types" "^7.7.4" + +"@babel/helper-wrap-function@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.7.4.tgz#37ab7fed5150e22d9d7266e830072c0cdd8baace" + integrity sha512-VsfzZt6wmsocOaVU0OokwrIytHND55yvyT4BPB9AIIgwr8+x7617hetdJTsuGwygN5RC6mxA9EJztTjuwm2ofg== + dependencies: + "@babel/helper-function-name" "^7.7.4" + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" + +"@babel/helpers@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.7.4.tgz#62c215b9e6c712dadc15a9a0dcab76c92a940302" + integrity sha512-ak5NGZGJ6LV85Q1Zc9gn2n+ayXOizryhjSUBTdu5ih1tlVCJeuQENzc4ItyCVhINVXvIT/ZQ4mheGIsfBkpskg== + dependencies: + "@babel/template" "^7.7.4" + "@babel/traverse" "^7.7.4" + "@babel/types" "^7.7.4" "@babel/highlight@^7.0.0": version "7.5.0" @@ -253,69 +253,69 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.2.tgz#ea8334dc77416bfd9473eb470fd00d8245b3943b" - integrity sha512-DDaR5e0g4ZTb9aP7cpSZLkACEBdoLGwJDWgHtBhrGX7Q1RjhdoMOfexICj5cqTAtpowjGQWfcvfnQG7G2kAB5w== +"@babel/parser@^7.0.0", "@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.7.4", "@babel/parser@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.7.5.tgz#cbf45321619ac12d83363fcf9c94bb67fa646d71" + integrity sha512-KNlOe9+/nk4i29g0VXgl8PEXIRms5xKLJeuZ6UptN0fHv+jDiriG+y94X6qAgWTR0h3KaoM1wK5G5h7MHFRSig== -"@babel/plugin-proposal-async-generator-functions@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.0.tgz#83ef2d6044496b4c15d8b4904e2219e6dccc6971" - integrity sha512-ot/EZVvf3mXtZq0Pd0+tSOfGWMizqmOohXmNZg6LNFjHOV+wOPv7BvVYh8oPR8LhpIP3ye8nNooKL50YRWxpYA== +"@babel/plugin-proposal-async-generator-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.7.4.tgz#0351c5ac0a9e927845fffd5b82af476947b7ce6d" + integrity sha512-1ypyZvGRXriY/QP668+s8sFr2mqinhkRDMPSQLNghCQE+GAkFtp+wkHVvg2+Hdki8gwP+NFzJBJ/N1BfzCCDEw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.7.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" + "@babel/plugin-syntax-async-generators" "^7.7.4" "@babel/plugin-proposal-class-properties@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.0.tgz#ac54e728ecf81d90e8f4d2a9c05a890457107917" - integrity sha512-tufDcFA1Vj+eWvwHN+jvMN6QsV5o+vUlytNKrbMiCeDL0F2j92RURzUsUMWE5EJkLyWxjdUslCsMQa9FWth16A== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.7.4.tgz#2f964f0cb18b948450362742e33e15211e77c2ba" + integrity sha512-EcuXeV4Hv1X3+Q1TsuOmyyxeTRiSqurGJ26+I/FW1WbymmRRapVORm6x1Zl3iDIHyRxEs+VXWp6qnlcfcJSbbw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.7.0" + "@babel/helper-create-class-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-proposal-dynamic-import@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.0.tgz#dc02a8bad8d653fb59daf085516fa416edd2aa7f" - integrity sha512-7poL3Xi+QFPC7sGAzEIbXUyYzGJwbc2+gSD0AkiC5k52kH2cqHdqxm5hNFfLW3cRSTcx9bN0Fl7/6zWcLLnKAQ== +"@babel/plugin-proposal-dynamic-import@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.7.4.tgz#dde64a7f127691758cbfed6cf70de0fa5879d52d" + integrity sha512-StH+nGAdO6qDB1l8sZ5UBV8AC3F2VW2I8Vfld73TMKyptMU9DY5YsJAS8U81+vEtxcH3Y/La0wG0btDrhpnhjQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" + "@babel/plugin-syntax-dynamic-import" "^7.7.4" "@babel/plugin-proposal-export-namespace-from@^7.5.2": - version "7.5.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.5.2.tgz#ccd5ed05b06d700688ff1db01a9dd27155e0d2a0" - integrity sha512-TKUdOL07anjZEbR1iSxb5WFh810KyObdd29XLFLGo1IDsSuGrjH3ouWSbAxHNmrVKzr9X71UYl2dQ7oGGcRp0g== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.7.4.tgz#9b32a9e3538ba4b0e2fa08942f0a8e5f60899dea" + integrity sha512-3whN5U7iZjKdbwRSFwBOjGBgH7apXCzwielljxVH8D/iYcGRqPPw63vlIbG0GqQoT9bO0QYPcIUVkhQG5hcHtg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-export-namespace-from" "^7.2.0" + "@babel/plugin-syntax-export-namespace-from" "^7.7.4" -"@babel/plugin-proposal-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" - integrity sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg== +"@babel/plugin-proposal-json-strings@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.7.4.tgz#7700a6bfda771d8dc81973249eac416c6b4c697d" + integrity sha512-wQvt3akcBTfLU/wYoqm/ws7YOAQKu8EVJEvHip/mzkNtjaclQoCCIqKXFP5/eyfnfbQCDV3OLRIK3mIVyXuZlw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-json-strings" "^7.2.0" + "@babel/plugin-syntax-json-strings" "^7.7.4" "@babel/plugin-proposal-nullish-coalescing-operator@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.4.4.tgz#41c360d59481d88e0ce3a3f837df10121a769b39" - integrity sha512-Amph7Epui1Dh/xxUxS2+K22/MUi6+6JVTvy3P58tja3B6yKTSjwwx0/d83rF7551D6PVSSoplQb8GCwqec7HRw== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.7.4.tgz#7db302c83bc30caa89e38fee935635ef6bd11c28" + integrity sha512-TbYHmr1Gl1UC7Vo2HVuj/Naci5BEGNZ0AJhzqD2Vpr6QPFWpUmBRLrIDjedzx7/CShq0bRDS2gI4FIs77VHLVQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.2.0" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.7.4" "@babel/plugin-proposal-numeric-separator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.2.0.tgz#646854daf4cd22fd6733f6076013a936310443ac" - integrity sha512-DohMOGDrZiMKS7LthjUZNNcWl8TAf5BZDwZAH4wpm55FuJTHgfqPGdibg7rZDmont/8Yg0zA03IgT6XLeP+4sg== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.7.4.tgz#7819a17445f4197bb9575e5750ed349776da858a" + integrity sha512-CG605v7lLpVgVldSY6kxsN9ui1DxFOyepBfuX2AzU2TNriMAYApoU55mrGw9Jr4TlrTzPCG10CL8YXyi+E/iPw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-numeric-separator" "^7.2.0" + "@babel/plugin-syntax-numeric-separator" "^7.7.4" -"@babel/plugin-proposal-object-rest-spread@^7.6.2", "@babel/plugin-proposal-object-rest-spread@^7.7.4": +"@babel/plugin-proposal-object-rest-spread@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.7.4.tgz#cc57849894a5c774214178c8ab64f6334ec8af71" integrity sha512-rnpnZR3/iWKmiQyJ3LKJpSwLDcX/nSXhdLk4Aq/tXOApIvyu7qoabrige0ylsAJffaUC51WiBu209Q0U+86OWQ== @@ -323,48 +323,48 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-object-rest-spread" "^7.7.4" -"@babel/plugin-proposal-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz#135d81edb68a081e55e56ec48541ece8065c38f5" - integrity sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g== +"@babel/plugin-proposal-optional-catch-binding@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.7.4.tgz#ec21e8aeb09ec6711bc0a39ca49520abee1de379" + integrity sha512-DyM7U2bnsQerCQ+sejcTNZh8KQEUuC3ufzdnVnSiUv/qoGJp2Z3hanKL18KDhsBT5Wj6a7CMT5mdyCNJsEaA9w== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-catch-binding" "^7.2.0" + "@babel/plugin-syntax-optional-catch-binding" "^7.7.4" "@babel/plugin-proposal-optional-chaining@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.6.0.tgz#e9bf1f9b9ba10c77c033082da75f068389041af8" - integrity sha512-kj4gkZ6qUggkprRq3Uh5KP8XnE1MdIO0J7MhdDX8+rAbB6dJ2UrensGIS+0NPZAaaJ1Vr0PN6oLUgXMU1uMcSg== + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.7.5.tgz#f0835f044cef85b31071a924010a2a390add11d4" + integrity sha512-sOwFqT8JSchtJeDD+CjmWCaiFoLxY4Ps7NjvwHC/U7l4e9i5pTRNt8nDMIFSOUL+ncFbYSwruHM8WknYItWdXw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-optional-chaining" "^7.2.0" + "@babel/plugin-syntax-optional-chaining" "^7.7.4" -"@babel/plugin-proposal-unicode-property-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.0.tgz#549fe1717a1bd0a2a7e63163841cb37e78179d5d" - integrity sha512-mk34H+hp7kRBWJOOAR0ZMGCydgKMD4iN9TpDRp3IIcbunltxEY89XSimc6WbtSLCDrwcdy/EEw7h5CFCzxTchw== +"@babel/plugin-proposal-unicode-property-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.7.4.tgz#7c239ccaf09470dbe1d453d50057460e84517ebb" + integrity sha512-cHgqHgYvffluZk85dJ02vloErm3Y6xtH+2noOBOJ2kXOJH3aVCDnj5eR/lVNlTnYu4hndAPJD3rTFjW3qee0PA== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-async-generators@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" - integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== +"@babel/plugin-syntax-async-generators@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.7.4.tgz#331aaf310a10c80c44a66b238b6e49132bd3c889" + integrity sha512-Li4+EjSpBgxcsmeEF8IFcfV/+yJGxHXDirDkEoyFjumuwbmfCVHUt0HuowD/iGM7OhIRyXJH9YXxqiH6N815+g== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-dynamic-import@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz#69c159ffaf4998122161ad8ebc5e6d1f55df8612" - integrity sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w== +"@babel/plugin-syntax-dynamic-import@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.7.4.tgz#29ca3b4415abfe4a5ec381e903862ad1a54c3aec" + integrity sha512-jHQW0vbRGvwQNgyVxwDh4yuXu4bH1f5/EICJLAhl1SblLs2CDhrsmCk+v5XLdE9wxtAFRyxx+P//Iw+a5L/tTg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-export-namespace-from@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" - integrity sha512-1zGA3UNch6A+A11nIzBVEaE3DDJbjfB+eLIcf0GGOh/BJr/8NxL3546MGhV/r0RhH4xADFIEso39TKCfEMlsGA== +"@babel/plugin-syntax-export-namespace-from@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.7.4.tgz#116c3e5db0d3e41018665528a468bc0f336044c3" + integrity sha512-YTc2djwMzJjiTTUJxJunRAnK0xW6OrmCSrgBc7QbWtpUo44FCkhZQtNcwZUqVf3sc4JFxhreiJ/P7YkmCTw4rg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" @@ -375,138 +375,138 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-json-strings@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz#72bd13f6ffe1d25938129d2a186b11fd62951470" - integrity sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg== +"@babel/plugin-syntax-json-strings@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.7.4.tgz#86e63f7d2e22f9e27129ac4e83ea989a382e86cc" + integrity sha512-QpGupahTQW1mHRXddMG5srgpHWqRLwJnJZKXTigB9RPFCCGbDGCgBeM/iC82ICXp414WeYx/tD54w7M2qRqTMg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-nullish-coalescing-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.2.0.tgz#f75083dfd5ade73e783db729bbd87e7b9efb7624" - integrity sha512-lRCEaKE+LTxDQtgbYajI04ddt6WW0WJq57xqkAZ+s11h4YgfRHhVA/Y2VhfPzzFD4qeLHWg32DMp9HooY4Kqlg== +"@babel/plugin-syntax-nullish-coalescing-operator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.7.4.tgz#e53b751d0c3061b1ba3089242524b65a7a9da12b" + integrity sha512-XKh/yIRPiQTOeBg0QJjEus5qiSKucKAiApNtO1psqG7D17xmE+X2i5ZqBEuSvo0HRuyPaKaSN/Gy+Ha9KFQolw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-numeric-separator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.2.0.tgz#7470fe070c2944469a756752a69a6963135018be" - integrity sha512-DroeVNkO/BnGpL2R7+ZNZqW+E24aR/4YWxP3Qb15d6lPU8KDzF8HlIUIRCOJRn4X77/oyW4mJY+7FHfY82NLtQ== +"@babel/plugin-syntax-numeric-separator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.7.4.tgz#39818f8042a09d4c6248d85d82555369da4da5c4" + integrity sha512-vmlUUBlLuFnbpaR+1kKIdo62xQEN+THWbtAHSEilo+0rHl2dKKCn6GLUVKpI848wL/T0ZPQgAy8asRJ9yYEjog== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.2.0", "@babel/plugin-syntax-object-rest-spread@^7.7.4": +"@babel/plugin-syntax-object-rest-spread@^7.0.0", "@babel/plugin-syntax-object-rest-spread@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.7.4.tgz#47cf220d19d6d0d7b154304701f468fc1cc6ff46" integrity sha512-mObR+r+KZq0XhRVS2BrBKBpr5jqrqzlPvS9C9vuOf5ilSwzloAl7RPWLrgKdWS6IreaVrjHxTjtyqFiOisaCwg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-catch-binding@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz#a94013d6eda8908dfe6a477e7f9eda85656ecf5c" - integrity sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w== +"@babel/plugin-syntax-optional-catch-binding@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.7.4.tgz#a3e38f59f4b6233867b4a92dcb0ee05b2c334aa6" + integrity sha512-4ZSuzWgFxqHRE31Glu+fEr/MirNZOMYmD/0BhBWyLyOOQz/gTAl7QmWm2hX1QxEIXsr2vkdlwxIzTyiYRC4xcQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-optional-chaining@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz#a59d6ae8c167e7608eaa443fda9fa8fa6bf21dff" - integrity sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA== +"@babel/plugin-syntax-optional-chaining@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.7.4.tgz#c91fdde6de85d2eb8906daea7b21944c3610c901" + integrity sha512-2MqYD5WjZSbJdUagnJvIdSfkb/ucOC9/1fRJxm7GAxY6YQLWlUvkfxoNbUPcPLHJyetKUDQ4+yyuUyAoc0HriA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-top-level-await@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.0.tgz#f5699549f50bbe8d12b1843a4e82f0a37bb65f4d" - integrity sha512-hi8FUNiFIY1fnUI2n1ViB1DR0R4QeK4iHcTlW6aJkrPoTdb8Rf1EMQ6GT3f67DDkYyWgew9DFoOZ6gOoEsdzTA== +"@babel/plugin-syntax-top-level-await@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.7.4.tgz#bd7d8fa7b9fee793a36e4027fd6dd1aa32f946da" + integrity sha512-wdsOw0MvkL1UIgiQ/IFr3ETcfv1xb8RMM0H9wbiDyLaJFyiDg5oZvDLCXosIXmFeIlweML5iOBXAkqddkYNizg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-arrow-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz#9aeafbe4d6ffc6563bf8f8372091628f00779550" - integrity sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg== +"@babel/plugin-transform-arrow-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.7.4.tgz#76309bd578addd8aee3b379d809c802305a98a12" + integrity sha512-zUXy3e8jBNPiffmqkHRNDdZM2r8DWhCB7HhcoyZjiK1TxYEluLHAvQuYnTT+ARqRpabWqy/NHkO6e3MsYB5YfA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-async-to-generator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.0.tgz#e2b84f11952cf5913fe3438b7d2585042772f492" - integrity sha512-vLI2EFLVvRBL3d8roAMqtVY0Bm9C1QzLkdS57hiKrjUBSqsQYrBsMCeOg/0KK7B0eK9V71J5mWcha9yyoI2tZw== +"@babel/plugin-transform-async-to-generator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.7.4.tgz#694cbeae6d613a34ef0292713fa42fb45c4470ba" + integrity sha512-zpUTZphp5nHokuy8yLlyafxCJ0rSlFoSHypTUWgpdwoDXWQcseaect7cJ8Ppk6nunOM6+5rPMkod4OYKPR5MUg== dependencies: - "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-remap-async-to-generator" "^7.7.0" + "@babel/helper-remap-async-to-generator" "^7.7.4" -"@babel/plugin-transform-block-scoped-functions@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz#5d3cc11e8d5ddd752aa64c9148d0db6cb79fd190" - integrity sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w== +"@babel/plugin-transform-block-scoped-functions@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.7.4.tgz#d0d9d5c269c78eaea76227ace214b8d01e4d837b" + integrity sha512-kqtQzwtKcpPclHYjLK//3lH8OFsCDuDJBaFhVwf8kqdnF6MN4l618UDlcA7TfRs3FayrHj+svYnSX8MC9zmUyQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-block-scoping@^7.6.3": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.6.3.tgz#6e854e51fbbaa84351b15d4ddafe342f3a5d542a" - integrity sha512-7hvrg75dubcO3ZI2rjYTzUrEuh1E9IyDEhhB6qfcooxhDA33xx2MasuLVgdxzcP6R/lipAC6n9ub9maNW6RKdw== +"@babel/plugin-transform-block-scoping@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.7.4.tgz#200aad0dcd6bb80372f94d9e628ea062c58bf224" + integrity sha512-2VBe9u0G+fDt9B5OV5DQH4KBf5DoiNkwFKOz0TCvBWvdAN2rOykCTkrL+jTLxfCAm76l9Qo5OqL7HBOx2dWggg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" lodash "^4.17.13" -"@babel/plugin-transform-classes@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.0.tgz#b411ecc1b8822d24b81e5d184f24149136eddd4a" - integrity sha512-/b3cKIZwGeUesZheU9jNYcwrEA7f/Bo4IdPmvp7oHgvks2majB5BoT5byAql44fiNQYOPzhk2w8DbgfuafkMoA== +"@babel/plugin-transform-classes@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.7.4.tgz#c92c14be0a1399e15df72667067a8f510c9400ec" + integrity sha512-sK1mjWat7K+buWRuImEzjNf68qrKcrddtpQo3swi9j7dUcG6y6R6+Di039QN2bD1dykeswlagupEmpOatFHHUg== dependencies: - "@babel/helper-annotate-as-pure" "^7.7.0" - "@babel/helper-define-map" "^7.7.0" - "@babel/helper-function-name" "^7.7.0" - "@babel/helper-optimise-call-expression" "^7.7.0" + "@babel/helper-annotate-as-pure" "^7.7.4" + "@babel/helper-define-map" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-optimise-call-expression" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" + "@babel/helper-replace-supers" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz#83a7df6a658865b1c8f641d510c6f3af220216da" - integrity sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA== +"@babel/plugin-transform-computed-properties@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.7.4.tgz#e856c1628d3238ffe12d668eb42559f79a81910d" + integrity sha512-bSNsOsZnlpLLyQew35rl4Fma3yKWqK3ImWMSC/Nc+6nGjC9s5NFWAer1YQ899/6s9HxO2zQC1WoFNfkOqRkqRQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-destructuring@^7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.6.0.tgz#44bbe08b57f4480094d57d9ffbcd96d309075ba6" - integrity sha512-2bGIS5P1v4+sWTCnKNDZDxbGvEqi0ijeqM/YqHtVGrvG2y0ySgnEEhXErvE9dA0bnIzY9bIzdFK0jFA46ASIIQ== +"@babel/plugin-transform-destructuring@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.7.4.tgz#2b713729e5054a1135097b6a67da1b6fe8789267" + integrity sha512-4jFMXI1Cu2aXbcXXl8Lr6YubCn6Oc7k9lLsu8v61TZh+1jny2BWmdtvY9zSUlLdGUvcy9DMAWyZEOqjsbeg/wA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-dotall-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.0.tgz#c5c9ecacab3a5e0c11db6981610f0c32fd698b3b" - integrity sha512-3QQlF7hSBnSuM1hQ0pS3pmAbWLax/uGNCbPBND9y+oJ4Y776jsyujG2k0Sn2Aj2a0QwVOiOFL5QVPA7spjvzSA== +"@babel/plugin-transform-dotall-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.7.4.tgz#f7ccda61118c5b7a2599a72d5e3210884a021e96" + integrity sha512-mk0cH1zyMa/XHeb6LOTXTbG7uIJ8Rrjlzu91pUx/KS3JpcgaTDwMS8kM+ar8SLOvlL2Lofi4CGBAjCo3a2x+lw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-duplicate-keys@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz#c5dbf5106bf84cdf691222c0974c12b1df931853" - integrity sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ== +"@babel/plugin-transform-duplicate-keys@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.7.4.tgz#3d21731a42e3f598a73835299dd0169c3b90ac91" + integrity sha512-g1y4/G6xGWMD85Tlft5XedGaZBCIVN+/P0bs6eabmcPP9egFleMAo65OOjlhcz1njpwagyY3t0nsQC9oTFegJA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-exponentiation-operator@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz#a63868289e5b4007f7054d46491af51435766008" - integrity sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A== +"@babel/plugin-transform-exponentiation-operator@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.7.4.tgz#dd30c0191e3a1ba19bcc7e389bdfddc0729d5db9" + integrity sha512-MCqiLfCKm6KEA1dglf6Uqq1ElDIZwFuzz1WH5mTf8k2uQSxEJMbOIEh7IZv7uichr7PMfi5YVSrr1vz+ipp7AQ== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.1.0" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-flow-strip-types@^7.0.0", "@babel/plugin-transform-flow-strip-types@^7.7.4": +"@babel/plugin-transform-flow-strip-types@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.7.4.tgz#cc73f85944782df1d77d80977bc097920a8bf31a" integrity sha512-w9dRNlHY5ElNimyMYy0oQowvQpwt/PRHI0QS98ZJCTZU2bvSnKXo5zEiD5u76FBPigTm8TkqzmnUTg16T7qbkA== @@ -514,247 +514,247 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-flow" "^7.7.4" -"@babel/plugin-transform-for-of@^7.4.4", "@babel/plugin-transform-for-of@^7.7.4": +"@babel/plugin-transform-for-of@^7.7.4": version "7.7.4" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.7.4.tgz#248800e3a5e507b1f103d8b4ca998e77c63932bc" integrity sha512-zZ1fD1B8keYtEcKF+M1TROfeHTKnijcVQm0yO/Yu1f7qoDoxEIc/+GX6Go430Bg84eM/xwPFp0+h4EbZg7epAA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-function-name@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.0.tgz#0fa786f1eef52e3b7d4fc02e54b2129de8a04c2a" - integrity sha512-P5HKu0d9+CzZxP5jcrWdpe7ZlFDe24bmqP6a6X8BHEBl/eizAsY8K6LX8LASZL0Jxdjm5eEfzp+FIrxCm/p8bA== +"@babel/plugin-transform-function-name@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.7.4.tgz#75a6d3303d50db638ff8b5385d12451c865025b1" + integrity sha512-E/x09TvjHNhsULs2IusN+aJNRV5zKwxu1cpirZyRPw+FyyIKEHPXTsadj48bVpc1R5Qq1B5ZkzumuFLytnbT6g== dependencies: - "@babel/helper-function-name" "^7.7.0" + "@babel/helper-function-name" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz#690353e81f9267dad4fd8cfd77eafa86aba53ea1" - integrity sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg== +"@babel/plugin-transform-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.7.4.tgz#27fe87d2b5017a2a5a34d1c41a6b9f6a6262643e" + integrity sha512-X2MSV7LfJFm4aZfxd0yLVFrEXAgPqYoDG53Br/tCKiKYfX0MjVjQeWPIhPHHsCqzwQANq+FLN786fF5rgLS+gw== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-member-expression-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.2.0.tgz#fa10aa5c58a2cb6afcf2c9ffa8cb4d8b3d489a2d" - integrity sha512-HiU3zKkSU6scTidmnFJ0bMX8hz5ixC93b4MHMiYebmk2lUVNGOboPsqQvx5LzooihijUoLR/v7Nc1rbBtnc7FA== +"@babel/plugin-transform-member-expression-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.7.4.tgz#aee127f2f3339fc34ce5e3055d7ffbf7aa26f19a" + integrity sha512-9VMwMO7i69LHTesL0RdGy93JU6a+qOPuvB4F4d0kR0zyVjJRVJRaoaGjhtki6SzQUu8yen/vxPKN6CWnCUw6bA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-modules-amd@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz#ef00435d46da0a5961aa728a1d2ecff063e4fb91" - integrity sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg== +"@babel/plugin-transform-modules-amd@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.7.5.tgz#39e0fb717224b59475b306402bb8eedab01e729c" + integrity sha512-CT57FG4A2ZUNU1v+HdvDSDrjNWBrtCmSH6YbbgN3Lrf0Di/q/lWRxZrE72p3+HCCz9UjfZOEBdphgC0nzOS6DQ== dependencies: - "@babel/helper-module-transforms" "^7.1.0" + "@babel/helper-module-transforms" "^7.7.5" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-commonjs@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.0.tgz#3e5ffb4fd8c947feede69cbe24c9554ab4113fe3" - integrity sha512-KEMyWNNWnjOom8vR/1+d+Ocz/mILZG/eyHHO06OuBQ2aNhxT62fr4y6fGOplRx+CxCSp3IFwesL8WdINfY/3kg== +"@babel/plugin-transform-modules-commonjs@^7.7.0", "@babel/plugin-transform-modules-commonjs@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.7.5.tgz#1d27f5eb0bcf7543e774950e5b2fa782e637b345" + integrity sha512-9Cq4zTFExwFhQI6MT1aFxgqhIsMWQWDVwOgLzl7PTWJHsNaqFvklAU+Oz6AQLAS0dJKTwZSOCo20INwktxpi3Q== dependencies: - "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-module-transforms" "^7.7.5" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-simple-access" "^7.7.0" + "@babel/helper-simple-access" "^7.7.4" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-systemjs@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.0.tgz#9baf471213af9761c1617bb12fd278e629041417" - integrity sha512-ZAuFgYjJzDNv77AjXRqzQGlQl4HdUM6j296ee4fwKVZfhDR9LAGxfvXjBkb06gNETPnN0sLqRm9Gxg4wZH6dXg== +"@babel/plugin-transform-modules-systemjs@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.7.4.tgz#cd98152339d3e763dfe838b7d4273edaf520bb30" + integrity sha512-y2c96hmcsUi6LrMqvmNDPBBiGCiQu0aYqpHatVVu6kD4mFEXKjyNxd/drc18XXAf9dv7UXjrZwBVmTTGaGP8iw== dependencies: - "@babel/helper-hoist-variables" "^7.7.0" + "@babel/helper-hoist-variables" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" babel-plugin-dynamic-import-node "^2.3.0" -"@babel/plugin-transform-modules-umd@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.0.tgz#d62c7da16670908e1d8c68ca0b5d4c0097b69966" - integrity sha512-u7eBA03zmUswQ9LQ7Qw0/ieC1pcAkbp5OQatbWUzY1PaBccvuJXUkYzoN1g7cqp7dbTu6Dp9bXyalBvD04AANA== +"@babel/plugin-transform-modules-umd@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.7.4.tgz#1027c355a118de0aae9fee00ad7813c584d9061f" + integrity sha512-u2B8TIi0qZI4j8q4C51ktfO7E3cQ0qnaXFI1/OXITordD40tt17g/sXqgNNCcMTcBFKrUPcGDx+TBJuZxLx7tw== dependencies: - "@babel/helper-module-transforms" "^7.7.0" + "@babel/helper-module-transforms" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-named-capturing-groups-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.0.tgz#358e6fd869b9a4d8f5cbc79e4ed4fc340e60dcaf" - integrity sha512-+SicSJoKouPctL+j1pqktRVCgy+xAch1hWWTMy13j0IflnyNjaoskj+DwRQFimHbLqO3sq2oN2CXMvXq3Bgapg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.7.4.tgz#fb3bcc4ee4198e7385805007373d6b6f42c98220" + integrity sha512-jBUkiqLKvUWpv9GLSuHUFYdmHg0ujC1JEYoZUfeOOfNydZXp1sXObgyPatpcwjWgsdBGsagWW0cdJpX/DO2jMw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" -"@babel/plugin-transform-new-target@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz#18d120438b0cc9ee95a47f2c72bc9768fbed60a5" - integrity sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA== +"@babel/plugin-transform-new-target@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.7.4.tgz#4a0753d2d60639437be07b592a9e58ee00720167" + integrity sha512-CnPRiNtOG1vRodnsyGX37bHQleHE14B9dnnlgSeEs3ek3fHN1A1SScglTCg1sfbe7sRQ2BUcpgpTpWSfMKz3gg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-super@^7.5.5": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.5.5.tgz#c70021df834073c65eb613b8679cc4a381d1a9f9" - integrity sha512-un1zJQAhSosGFBduPgN/YFNvWVpRuHKU7IHBglLoLZsGmruJPOo6pbInneflUdmq7YvSVqhpPs5zdBvLnteltQ== +"@babel/plugin-transform-object-super@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.7.4.tgz#48488937a2d586c0148451bf51af9d7dda567262" + integrity sha512-ho+dAEhC2aRnff2JCA0SAK7V2R62zJd/7dmtoe7MHcso4C2mS+vZjn1Pb1pCVZvJs1mgsvv5+7sT+m3Bysb6eg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/helper-replace-supers" "^7.5.5" + "@babel/helper-replace-supers" "^7.7.4" -"@babel/plugin-transform-parameters@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz#7556cf03f318bd2719fe4c922d2d808be5571e16" - integrity sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw== +"@babel/plugin-transform-parameters@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.7.4.tgz#da4555c97f39b51ac089d31c7380f03bca4075ce" + integrity sha512-VJwhVePWPa0DqE9vcfptaJSzNDKrWU/4FbYCjZERtmqEs05g3UMXnYMZoXja7JAJ7Y7sPZipwm/pGApZt7wHlw== dependencies: - "@babel/helper-call-delegate" "^7.4.4" - "@babel/helper-get-function-arity" "^7.0.0" + "@babel/helper-call-delegate" "^7.7.4" + "@babel/helper-get-function-arity" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-property-literals@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.2.0.tgz#03e33f653f5b25c4eb572c98b9485055b389e905" - integrity sha512-9q7Dbk4RhgcLp8ebduOpCbtjh7C0itoLYHXd9ueASKAG/is5PQtMR5VJGka9NKqGhYEGn5ITahd4h9QeBMylWQ== +"@babel/plugin-transform-property-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.7.4.tgz#2388d6505ef89b266103f450f9167e6bd73f98c2" + integrity sha512-MatJhlC4iHsIskWYyawl53KuHrt+kALSADLQQ/HkhTjX954fkxIEh4q5slL4oRAnsm/eDoZ4q0CIZpcqBuxhJQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-regenerator@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.0.tgz#f1b20b535e7716b622c99e989259d7dd942dd9cc" - integrity sha512-AXmvnC+0wuj/cFkkS/HFHIojxH3ffSXE+ttulrqWjZZRaUOonfJc60e1wSNT4rV8tIunvu/R3wCp71/tLAa9xg== +"@babel/plugin-transform-regenerator@^7.7.5": + version "7.7.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.7.5.tgz#3a8757ee1a2780f390e89f246065ecf59c26fce9" + integrity sha512-/8I8tPvX2FkuEyWbjRCt4qTAgZK0DVy8QRguhA524UH48RfGJy94On2ri+dCuwOpcerPRl9O4ebQkRcVzIaGBw== dependencies: regenerator-transform "^0.14.0" -"@babel/plugin-transform-reserved-words@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.2.0.tgz#4792af87c998a49367597d07fedf02636d2e1634" - integrity sha512-fz43fqW8E1tAB3DKF19/vxbpib1fuyCwSPE418ge5ZxILnBhWyhtPgz8eh1RCGGJlwvksHkyxMxh0eenFi+kFw== +"@babel/plugin-transform-reserved-words@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.7.4.tgz#6a7cf123ad175bb5c69aec8f6f0770387ed3f1eb" + integrity sha512-OrPiUB5s5XvkCO1lS7D8ZtHcswIC57j62acAnJZKqGGnHP+TIc/ljQSrgdX/QyOTdEK5COAhuc820Hi1q2UgLQ== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-transform-runtime@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.2.tgz#2669f67c1fae0ae8d8bf696e4263ad52cb98b6f8" - integrity sha512-cqULw/QB4yl73cS5Y0TZlQSjDvNkzDbu0FurTZyHlJpWE5T3PCMdnyV+xXoH1opr1ldyHODe3QAX3OMAii5NxA== + version "7.7.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.7.6.tgz#4f2b548c88922fb98ec1c242afd4733ee3e12f61" + integrity sha512-tajQY+YmXR7JjTwRvwL4HePqoL3DYxpYXIHKVvrOIvJmeHe2y1w4tz5qz9ObUDC9m76rCzIMPyn4eERuwA4a4A== dependencies: - "@babel/helper-module-imports" "^7.0.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" resolve "^1.8.1" semver "^5.5.1" -"@babel/plugin-transform-shorthand-properties@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz#6333aee2f8d6ee7e28615457298934a3b46198f0" - integrity sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg== +"@babel/plugin-transform-shorthand-properties@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.7.4.tgz#74a0a9b2f6d67a684c6fbfd5f0458eb7ba99891e" + integrity sha512-q+suddWRfIcnyG5YiDP58sT65AJDZSUhXQDZE3r04AuqD6d/XLaQPPXSBzP2zGerkgBivqtQm9XKGLuHqBID6Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-spread@^7.6.2": - version "7.6.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.6.2.tgz#fc77cf798b24b10c46e1b51b1b88c2bf661bb8dd" - integrity sha512-DpSvPFryKdK1x+EDJYCy28nmAaIMdxmhot62jAXF/o99iA33Zj2Lmcp3vDmz+MUh0LNYVPvfj5iC3feb3/+PFg== +"@babel/plugin-transform-spread@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.7.4.tgz#aa673b356fe6b7e70d69b6e33a17fef641008578" + integrity sha512-8OSs0FLe5/80cndziPlg4R0K6HcWSM0zyNhHhLsmw/Nc5MaA49cAsnoJ/t/YZf8qkG7fD+UjTRaApVDB526d7Q== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-sticky-regex@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz#a1e454b5995560a9c1e0d537dfc15061fd2687e1" - integrity sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw== +"@babel/plugin-transform-sticky-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.7.4.tgz#ffb68c05090c30732076b1285dc1401b404a123c" + integrity sha512-Ls2NASyL6qtVe1H1hXts9yuEeONV2TJZmplLONkMPUG158CtmnrzW5Q5teibM5UVOFjG0D3IC5mzXR6pPpUY7A== dependencies: "@babel/helper-plugin-utils" "^7.0.0" "@babel/helper-regex" "^7.0.0" -"@babel/plugin-transform-template-literals@^7.4.4": - version "7.4.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz#9d28fea7bbce637fb7612a0750989d8321d4bcb0" - integrity sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g== +"@babel/plugin-transform-template-literals@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.7.4.tgz#1eb6411736dd3fe87dbd20cc6668e5121c17d604" + integrity sha512-sA+KxLwF3QwGj5abMHkHgshp9+rRz+oY9uoRil4CyLtgEuE/88dpkeWgNk5qKVsJE9iSfly3nvHapdRiIS2wnQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-annotate-as-pure" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-typeof-symbol@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz#117d2bcec2fbf64b4b59d1f9819894682d29f2b2" - integrity sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw== +"@babel/plugin-transform-typeof-symbol@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.7.4.tgz#3174626214f2d6de322882e498a38e8371b2140e" + integrity sha512-KQPUQ/7mqe2m0B8VecdyaW5XcQYaePyl9R7IsKd+irzj6jvbhoGnRE+M0aNkyAzI07VfUQ9266L5xMARitV3wg== dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-unicode-regex@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.0.tgz#743d9bcc44080e3cc7d49259a066efa30f9187a3" - integrity sha512-RrThb0gdrNwFAqEAAx9OWgtx6ICK69x7i9tCnMdVrxQwSDp/Abu9DXFU5Hh16VP33Rmxh04+NGW28NsIkFvFKA== +"@babel/plugin-transform-unicode-regex@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.7.4.tgz#a3c0f65b117c4c81c5b6484f2a5e7b95346b83ae" + integrity sha512-N77UUIV+WCvE+5yHw+oks3m18/umd7y392Zv7mYTpFqHtkpcc+QUz+gLJNTWVlWROIWeLqY0f3OjZxV5TcXnRw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.7.0" + "@babel/helper-create-regexp-features-plugin" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" "@babel/preset-env@^7.7.1": - version "7.7.1" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.1.tgz#04a2ff53552c5885cf1083e291c8dd5490f744bb" - integrity sha512-/93SWhi3PxcVTDpSqC+Dp4YxUu3qZ4m7I76k0w73wYfn7bGVuRIO4QUz95aJksbS+AD1/mT1Ie7rbkT0wSplaA== + version "7.7.6" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.7.6.tgz#39ac600427bbb94eec6b27953f1dfa1d64d457b2" + integrity sha512-k5hO17iF/Q7tR9Jv8PdNBZWYW6RofxhnxKjBMc0nG4JTaWvOTiPoO/RLFwAKcA4FpmuBFm6jkoqaRJLGi0zdaQ== dependencies: - "@babel/helper-module-imports" "^7.7.0" + "@babel/helper-module-imports" "^7.7.4" "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-proposal-async-generator-functions" "^7.7.0" - "@babel/plugin-proposal-dynamic-import" "^7.7.0" - "@babel/plugin-proposal-json-strings" "^7.2.0" - "@babel/plugin-proposal-object-rest-spread" "^7.6.2" - "@babel/plugin-proposal-optional-catch-binding" "^7.2.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.7.0" - "@babel/plugin-syntax-async-generators" "^7.2.0" - "@babel/plugin-syntax-dynamic-import" "^7.2.0" - "@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.7.0" - "@babel/plugin-transform-arrow-functions" "^7.2.0" - "@babel/plugin-transform-async-to-generator" "^7.7.0" - "@babel/plugin-transform-block-scoped-functions" "^7.2.0" - "@babel/plugin-transform-block-scoping" "^7.6.3" - "@babel/plugin-transform-classes" "^7.7.0" - "@babel/plugin-transform-computed-properties" "^7.2.0" - "@babel/plugin-transform-destructuring" "^7.6.0" - "@babel/plugin-transform-dotall-regex" "^7.7.0" - "@babel/plugin-transform-duplicate-keys" "^7.5.0" - "@babel/plugin-transform-exponentiation-operator" "^7.2.0" - "@babel/plugin-transform-for-of" "^7.4.4" - "@babel/plugin-transform-function-name" "^7.7.0" - "@babel/plugin-transform-literals" "^7.2.0" - "@babel/plugin-transform-member-expression-literals" "^7.2.0" - "@babel/plugin-transform-modules-amd" "^7.5.0" - "@babel/plugin-transform-modules-commonjs" "^7.7.0" - "@babel/plugin-transform-modules-systemjs" "^7.7.0" - "@babel/plugin-transform-modules-umd" "^7.7.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.0" - "@babel/plugin-transform-new-target" "^7.4.4" - "@babel/plugin-transform-object-super" "^7.5.5" - "@babel/plugin-transform-parameters" "^7.4.4" - "@babel/plugin-transform-property-literals" "^7.2.0" - "@babel/plugin-transform-regenerator" "^7.7.0" - "@babel/plugin-transform-reserved-words" "^7.2.0" - "@babel/plugin-transform-shorthand-properties" "^7.2.0" - "@babel/plugin-transform-spread" "^7.6.2" - "@babel/plugin-transform-sticky-regex" "^7.2.0" - "@babel/plugin-transform-template-literals" "^7.4.4" - "@babel/plugin-transform-typeof-symbol" "^7.2.0" - "@babel/plugin-transform-unicode-regex" "^7.7.0" - "@babel/types" "^7.7.1" + "@babel/plugin-proposal-async-generator-functions" "^7.7.4" + "@babel/plugin-proposal-dynamic-import" "^7.7.4" + "@babel/plugin-proposal-json-strings" "^7.7.4" + "@babel/plugin-proposal-object-rest-spread" "^7.7.4" + "@babel/plugin-proposal-optional-catch-binding" "^7.7.4" + "@babel/plugin-proposal-unicode-property-regex" "^7.7.4" + "@babel/plugin-syntax-async-generators" "^7.7.4" + "@babel/plugin-syntax-dynamic-import" "^7.7.4" + "@babel/plugin-syntax-json-strings" "^7.7.4" + "@babel/plugin-syntax-object-rest-spread" "^7.7.4" + "@babel/plugin-syntax-optional-catch-binding" "^7.7.4" + "@babel/plugin-syntax-top-level-await" "^7.7.4" + "@babel/plugin-transform-arrow-functions" "^7.7.4" + "@babel/plugin-transform-async-to-generator" "^7.7.4" + "@babel/plugin-transform-block-scoped-functions" "^7.7.4" + "@babel/plugin-transform-block-scoping" "^7.7.4" + "@babel/plugin-transform-classes" "^7.7.4" + "@babel/plugin-transform-computed-properties" "^7.7.4" + "@babel/plugin-transform-destructuring" "^7.7.4" + "@babel/plugin-transform-dotall-regex" "^7.7.4" + "@babel/plugin-transform-duplicate-keys" "^7.7.4" + "@babel/plugin-transform-exponentiation-operator" "^7.7.4" + "@babel/plugin-transform-for-of" "^7.7.4" + "@babel/plugin-transform-function-name" "^7.7.4" + "@babel/plugin-transform-literals" "^7.7.4" + "@babel/plugin-transform-member-expression-literals" "^7.7.4" + "@babel/plugin-transform-modules-amd" "^7.7.5" + "@babel/plugin-transform-modules-commonjs" "^7.7.5" + "@babel/plugin-transform-modules-systemjs" "^7.7.4" + "@babel/plugin-transform-modules-umd" "^7.7.4" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.7.4" + "@babel/plugin-transform-new-target" "^7.7.4" + "@babel/plugin-transform-object-super" "^7.7.4" + "@babel/plugin-transform-parameters" "^7.7.4" + "@babel/plugin-transform-property-literals" "^7.7.4" + "@babel/plugin-transform-regenerator" "^7.7.5" + "@babel/plugin-transform-reserved-words" "^7.7.4" + "@babel/plugin-transform-shorthand-properties" "^7.7.4" + "@babel/plugin-transform-spread" "^7.7.4" + "@babel/plugin-transform-sticky-regex" "^7.7.4" + "@babel/plugin-transform-template-literals" "^7.7.4" + "@babel/plugin-transform-typeof-symbol" "^7.7.4" + "@babel/plugin-transform-unicode-regex" "^7.7.4" + "@babel/types" "^7.7.4" browserslist "^4.6.0" - core-js-compat "^3.1.1" + core-js-compat "^3.4.7" invariant "^2.2.2" js-levenshtein "^1.1.3" semver "^5.5.0" "@babel/preset-flow@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0.tgz#afd764835d9535ec63d8c7d4caf1c06457263da2" - integrity sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.7.4.tgz#99c1349b6fd7132783196de181e6b32d0949427e" + integrity sha512-6LbUqcHD8BcRtXMOp5bc5nJeU8RlKh6q5U8TgZeCrf9ebBdW8Wyy5ujAUnbJfmzQ56Kkq5XtwErC/5+5RHyFYA== dependencies: "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-flow-strip-types" "^7.0.0" + "@babel/plugin-transform-flow-strip-types" "^7.7.4" "@babel/register@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.7.0.tgz#4e23ecf840296ef79c605baaa5c89e1a2426314b" - integrity sha512-HV3GJzTvSoyOMWGYn2TAh6uL6g+gqKTgEZ99Q3+X9UURT1VPT/WcU46R61XftIc5rXytcOHZ4Z0doDlsjPomIg== + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.7.4.tgz#45a4956471a9df3b012b747f5781cc084ee8f128" + integrity sha512-/fmONZqL6ZMl9KJUYajetCrID6m0xmL4odX7v+Xvoxcv0DdbP/oO0TWIeLUCHqczQ6L6njDMqmqHFy2cp3FFsA== dependencies: find-cache-dir "^2.0.0" lodash "^4.17.13" @@ -763,40 +763,40 @@ source-map-support "^0.5.16" "@babel/runtime@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.2.tgz#111a78002a5c25fc8e3361bedc9529c696b85a6a" - integrity sha512-JONRbXbTXc9WQE2mAZd1p0Z3DZ/6vaQIkgYMSTP3KjRCyd7rCZCcfhCyX+YjwcKxcZ82UrxbRD358bpExNgrjw== + version "7.7.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.6.tgz#d18c511121aff1b4f2cd1d452f1bac9601dd830f" + integrity sha512-BWAJxpNVa0QlE5gZdWjSxXtemZyZ9RmrmVozxt3NUXeZhVIJ5ANyqmMc0JDrivBZyxUuQvFxlvH4OWWOogGfUw== dependencies: regenerator-runtime "^0.13.2" -"@babel/template@^7.4.0", "@babel/template@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.0.tgz#4fadc1b8e734d97f56de39c77de76f2562e597d0" - integrity sha512-OKcwSYOW1mhWbnTBgQY5lvg1Fxg+VyfQGjcBduZFljfc044J5iDlnDSfhQ867O17XHiSCxYHUxHg2b7ryitbUQ== +"@babel/template@^7.4.0", "@babel/template@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.7.4.tgz#428a7d9eecffe27deac0a98e23bf8e3675d2a77b" + integrity sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw== dependencies: "@babel/code-frame" "^7.0.0" - "@babel/parser" "^7.7.0" - "@babel/types" "^7.7.0" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.2.tgz#ef0a65e07a2f3c550967366b3d9b62a2dcbeae09" - integrity sha512-TM01cXib2+rgIZrGJOLaHV/iZUAxf4A0dt5auY6KNZ+cm6aschuJGqKJM3ROTt3raPUdIDk9siAufIFEleRwtw== +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.7.4.tgz#9c1e7c60fb679fe4fcfaa42500833333c2058558" + integrity sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw== dependencies: "@babel/code-frame" "^7.5.5" - "@babel/generator" "^7.7.2" - "@babel/helper-function-name" "^7.7.0" - "@babel/helper-split-export-declaration" "^7.7.0" - "@babel/parser" "^7.7.2" - "@babel/types" "^7.7.2" + "@babel/generator" "^7.7.4" + "@babel/helper-function-name" "^7.7.4" + "@babel/helper-split-export-declaration" "^7.7.4" + "@babel/parser" "^7.7.4" + "@babel/types" "^7.7.4" debug "^4.1.0" globals "^11.1.0" lodash "^4.17.13" -"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.1", "@babel/types@^7.7.2": - version "7.7.2" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.2.tgz#550b82e5571dcd174af576e23f0adba7ffc683f7" - integrity sha512-YTf6PXoh3+eZgRCBzzP25Bugd2ngmpQVrk7kXX0i5N9BO7TFBtIgZYs7WtxtOGs8e6A4ZI7ECkbBCEHeXocvOA== +"@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.7.4": + version "7.7.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.7.4.tgz#516570d539e44ddf308c07569c258ff94fde9193" + integrity sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA== dependencies: esutils "^2.0.2" lodash "^4.17.13" @@ -1714,11 +1714,32 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" +"@nodelib/fs.scandir@2.1.3": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" + integrity sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw== + dependencies: + "@nodelib/fs.stat" "2.0.3" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.3", "@nodelib/fs.stat@^2.0.2": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz#34dc5f4cabbc720f4e60f75a747e7ecd6c175bd3" + integrity sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA== + "@nodelib/fs.stat@^1.1.2": version "1.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@nodelib/fs.walk@^1.2.3": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz#011b9202a70a6366e436ca5c065844528ab04976" + integrity sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ== + dependencies: + "@nodelib/fs.scandir" "2.1.3" + fastq "^1.6.0" + "@octokit/endpoint@^5.5.0": version "5.5.1" resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-5.5.1.tgz#2eea81e110ca754ff2de11c79154ccab4ae16b3f" @@ -1803,9 +1824,9 @@ any-observable "^0.3.0" "@types/babel__core@^7.1.0": - version "7.1.2" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" - integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== + version "7.1.3" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.3.tgz#e441ea7df63cd080dfcd02ab199e6d16a735fc30" + integrity sha512-8fBo0UR2CcwWxeX7WIIgJ7lXjasFxoYgRnFHUj+hRvKkpiBJbxhdAPTCY6/ZKM0uxANFVzt4yObSLuTiTnazDA== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1814,9 +1835,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.0.2" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" - integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + version "7.6.0" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.0.tgz#f1ec1c104d1bb463556ecb724018ab788d0c172a" + integrity sha512-c1mZUu4up5cp9KROs/QAw0gTeHrw/x7m52LcnvMxxOZ03DmLwPV0MlGmlgzV3cnSdjhJOZsj7E7FHeioai+egw== dependencies: "@babel/types" "^7.0.0" @@ -1829,13 +1850,18 @@ "@babel/types" "^7.0.0" "@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.0.7" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.7.tgz#2496e9ff56196cc1429c72034e07eab6121b6f3f" - integrity sha512-CeBpmX1J8kWLcDEnI3Cl2Eo6RfbGvzUctA+CjZUhOKDFbLfcr7fc4usEqLNWetrlJd7RhAkyYe2czXop4fICpw== + version "7.0.8" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.8.tgz#479a4ee3e291a403a1096106013ec22cf9b64012" + integrity sha512-yGeB2dHEdvxjP0y4UbRtQaSkXJ9649fYCmIdRoul5kfAoGCwxuCbMhag0k3RPfnuh9kPGm8x89btcfDEXdVWGw== dependencies: "@babel/types" "^7.3.0" -"@types/estree@*", "@types/estree@0.0.39": +"@types/estree@*": + version "0.0.40" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.40.tgz#0e6cb9b9bbd098031fa19e4b4e8131bc70e5de13" + integrity sha512-p3KZgMto/JyxosKGmnLDJ/dG5wf+qTRMUjHJcspC2oQKa4jP7mz+tv0ND56lLBu3ojHlhzY33Ol+khLyNmilkA== + +"@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== @@ -1880,9 +1906,9 @@ integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== "@types/node@*", "@types/node@>= 8": - version "12.12.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.11.tgz#bec2961975888d964196bf0016a2f984d793d3ce" - integrity sha512-O+x6uIpa6oMNTkPuHDa9MhMMehlxLAd5QcOvKRjAFsBVpeFWTOPnXbDvILvFgFFZfQ1xh1EZi1FbXxUix+zpsQ== + version "12.12.15" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.15.tgz#8dfb6ce22fedd469128137640a3aa8f17415422f" + integrity sha512-Pv+vWicyFd07Hw/SmNnTUguqrHgDfMtjabvD9sQyxeqbpCEg8CmViLBaVPHtNsoBgZECrRf5/pgV6FJIBrGSjw== "@types/normalize-package-data@^2.4.0": version "2.4.0" @@ -1931,9 +1957,9 @@ JSONStream@^1.0.3, JSONStream@^1.0.4, JSONStream@^1.3.4: through ">=2.2.7 <3" abab@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" - integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + version "2.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a" + integrity sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg== abbrev@1: version "1.1.1" @@ -1947,39 +1973,38 @@ abstract-leveldown@~0.12.0, abstract-leveldown@~0.12.1: dependencies: xtend "~3.0.0" -acorn-dynamic-import@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz#482210140582a36b83c3e342e1cfebcaa9240948" - integrity sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw== - acorn-globals@^4.1.0: - version "4.3.2" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.2.tgz#4e2c2313a597fd589720395f6354b41cd5ec8006" - integrity sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ== + version "4.3.4" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7" + integrity sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A== dependencies: acorn "^6.0.1" acorn-walk "^6.0.1" -acorn-jsx@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" - integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== +acorn-jsx@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" + integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== acorn-node@^1.2.0, acorn-node@^1.3.0, acorn-node@^1.5.2, acorn-node@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.7.0.tgz#aac6a559d27af6176b076ab6fb13c5974c213e3b" - integrity sha512-XhahLSsCB6X6CJbe+uNu3Mn9sJBNFxtBN9NLgAOQovfS6Kh0lDUtmlclhjn9CvEK7A7YyRU13PXlNcpSiLI9Yw== + version "1.8.2" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.8.2.tgz#114c95d64539e53dede23de8b9d96df7c7ae2af8" + integrity sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A== dependencies: - acorn "^6.1.1" - acorn-dynamic-import "^4.0.0" - acorn-walk "^6.1.1" - xtend "^4.0.1" + acorn "^7.0.0" + acorn-walk "^7.0.0" + xtend "^4.0.2" -acorn-walk@^6.0.1, acorn-walk@^6.1.1: +acorn-walk@^6.0.1: version "6.2.0" resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c" integrity sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA== +acorn-walk@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.0.0.tgz#c8ba6f0f1aac4b0a9e32d1f0af12be769528f36b" + integrity sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg== + acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" @@ -1990,12 +2015,12 @@ acorn@^5.0.0, acorn@^5.5.3, acorn@^5.7.3: resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== -acorn@^6.0.1, acorn@^6.0.7, acorn@^6.1.1: - version "6.2.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.2.0.tgz#67f0da2fc339d6cfb5d6fb244fd449f33cd8bbe3" - integrity sha512-8oe72N3WPMjA+2zVG71Ia0nXZ8DpQH+QyyHO+p06jT8eg8FGG3FbcUIi8KziHlAfheJQZeoqbvq1mQSQHXKYLw== +acorn@^6.0.1: + version "6.4.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.0.tgz#b659d2ffbafa24baf5db1cdbb2c94a983ecd2784" + integrity sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw== -acorn@^7.1.0: +acorn@^7.0.0, acorn@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== @@ -2021,6 +2046,14 @@ agentkeepalive@^3.4.1: dependencies: humanize-ms "^1.2.1" +aggregate-error@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" + integrity sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA== + dependencies: + clean-stack "^2.0.0" + indent-string "^4.0.0" + ajv@^6.10.0, ajv@^6.10.2, ajv@^6.5.5: version "6.10.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" @@ -2055,6 +2088,13 @@ ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== +ansi-escapes@^4.2.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.0.tgz#a4ce2b33d6b214b7950d8595c212f12ac9cc569d" + integrity sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg== + dependencies: + type-fest "^0.8.1" + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -2084,6 +2124,11 @@ ansi-regex@^4.0.0, ansi-regex@^4.1.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== +ansi-regex@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75" + integrity sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg== + ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -2233,11 +2278,6 @@ array-equal@^1.0.0: resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= -array-filter@~0.0.0: - version "0.0.1" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" - integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw= - array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -2271,16 +2311,6 @@ array-last@^1.1.1: dependencies: is-number "^4.0.0" -array-map@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" - integrity sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI= - -array-reduce@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" - integrity sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys= - array-slice@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" @@ -2307,6 +2337,11 @@ array-union@^1.0.1, array-union@^1.0.2: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -2322,6 +2357,15 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.flat@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.2.tgz#8f3c71d245ba349b6b64b4078f76f5576f1fd723" + integrity sha512-VXjh7lAL4KXKF2hY4FnEW9eRW6IhdvFW1sN/JwLbmECbCgACCnBHNyP3lFiYuttr0jxRN9Bsc5+G27dMseSWqQ== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.15.0" + function-bind "^1.1.1" + arrify@^1.0.0, arrify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -2387,9 +2431,9 @@ async-each@^1.0.1: integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" + integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== async-settle@^1.0.0: version "1.0.0" @@ -2419,9 +2463,9 @@ aws-sign2@~0.7.0: integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + version "1.9.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c" + integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A== babel-eslint@^11.0.0-beta.1: version "11.0.0-beta.1" @@ -2453,10 +2497,11 @@ babel-plugin-dynamic-import-node@^2.3.0: object.assign "^4.1.0" babel-plugin-istanbul@^5.1.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" - integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz#df4ade83d897a92df069c4d9a25cf2671293c854" + integrity sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw== dependencies: + "@babel/helper-plugin-utils" "^7.0.0" find-up "^3.0.0" istanbul-lib-instrument "^3.3.0" test-exclude "^5.2.3" @@ -2505,9 +2550,9 @@ balanced-match@^1.0.0: integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= base64-js@^1.0.2: - version "1.3.0" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" - integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== + version "1.3.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" + integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== base@^0.11.1: version "0.11.2" @@ -2547,9 +2592,9 @@ bl@~0.8.1: readable-stream "~1.0.26" bluebird@^3.5.1, bluebird@^3.5.3, bluebird@^3.5.5: - version "3.7.1" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.1.tgz#df70e302b471d7473489acf26a93d63b53f874de" - integrity sha512-DdmyoGCleJnkbp3nkbxTLJ18rjDsE4yCggEwKNXkeV123sPNfOCYeDoeuOY+F2FrSjO1YXcTU+dsy96KMy+gcg== + version "3.7.2" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" + integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.8" @@ -2714,9 +2759,9 @@ browserify-zlib@~0.2.0: pako "~1.0.5" browserify@^16.2.3: - version "16.3.0" - resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.3.0.tgz#4d414466e0b07492fff493a009ea883a9f2db230" - integrity sha512-BWaaD7alyGZVEBBwSTYx4iJF5DswIGzK17o8ai9w4iKRbYpk3EOiprRHMRRA8DCZFmFeOdx7A385w2XdFvxWmg== + version "16.5.0" + resolved "https://registry.yarnpkg.com/browserify/-/browserify-16.5.0.tgz#a1c2bc0431bec11fd29151941582e3f645ede881" + integrity sha512-6bfI3cl76YLAnCZ75AGu/XPOsqUhRyc0F/olGIJeCxtfxF2HvPKEcmjU9M8oAPxl4uBY1U7Nry33Q6koV3f2iw== dependencies: JSONStream "^1.0.3" assert "^1.4.0" @@ -2755,7 +2800,7 @@ browserify@^16.2.3: shasum "^1.0.0" shell-quote "^1.6.1" stream-browserify "^2.0.0" - stream-http "^2.0.0" + stream-http "^3.0.0" string_decoder "^1.1.1" subarg "^1.0.0" syntax-error "^1.1.1" @@ -2767,19 +2812,19 @@ browserify@^16.2.3: vm-browserify "^1.0.0" xtend "^4.0.0" -browserslist@^4.6.0, browserslist@^4.8.0: - version "4.8.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.0.tgz#6f06b0f974a7cc3a84babc2ccc56493668e3c789" - integrity sha512-HYnxc/oLRWvJ3TsGegR0SRL/UDnknGq2s/a8dYYEO+kOQ9m9apKoS5oiathLKZdh/e9uE+/J3j92qPlGD/vTqA== +browserslist@^4.6.0, browserslist@^4.8.2: + version "4.8.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.8.2.tgz#b45720ad5fbc8713b7253c20766f701c9a694289" + integrity sha512-+M4oeaTplPm/f1pXDw84YohEv7B1i/2Aisei8s4s6k3QsoSHa7i5sz8u/cGQkkatCPxMASKxPualR4wwYgVboA== dependencies: - caniuse-lite "^1.0.30001012" - electron-to-chromium "^1.3.317" - node-releases "^1.1.41" + caniuse-lite "^1.0.30001015" + electron-to-chromium "^1.3.322" + node-releases "^1.1.42" -bser@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.0.tgz#65fc784bf7f87c009b973c12db6546902fa9c7b5" - integrity sha512-8zsjWrQkkBoLK6uxASk1nJ2SKv97ltiGDo6A3wA0/yRPz+CwmEyDo0hUrhIuukG2JHpAl3bvFIixw2/3Hi0DOg== +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== dependencies: node-int64 "^0.4.0" @@ -2809,9 +2854,9 @@ buffer-xor@^1.0.3: integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= buffer@^5.0.2: - version "5.2.1" - resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" - integrity sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg== + version "5.4.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.4.3.tgz#3fbc9c69eb713d323e3fc1a895eee0710c072115" + integrity sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A== dependencies: base64-js "^1.0.2" ieee754 "^1.1.4" @@ -2960,10 +3005,10 @@ camelcase@^5.0.0, camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30001012: - version "1.0.30001013" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001013.tgz#da2440d4d266a17d40eb79bd19c0c8cc1d029c72" - integrity sha512-hOAXaWKuq/UVFgYawxIOdPdyMQdYcwOCDOjnZcKn7wCgFUrhP7smuNZjGLuJlPSgE6aRA4cRJ+bGSrhtEt7ZAg== +caniuse-lite@^1.0.30001015: + version "1.0.30001015" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001015.tgz#15a7ddf66aba786a71d99626bc8f2b91c6f0f5f0" + integrity sha512-/xL2AbW/XWHNu1gnIrO8UitBGoFthcsDgU9VLK1/dpsoxbaD5LscHozKze05R6WLsBvLhqv78dAPozMFQBYLbQ== capture-exit@^2.0.0: version "2.0.0" @@ -3054,6 +3099,11 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +clean-stack@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== + cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -3061,6 +3111,13 @@ cli-cursor@^2.0.0, cli-cursor@^2.1.0: dependencies: restore-cursor "^2.0.0" +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + cli-truncate@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/cli-truncate/-/cli-truncate-0.2.1.tgz#9f15cfbb0705005369216c626ac7d05ab90dd574" @@ -3219,15 +3276,15 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^2.20.0, commander@^2.8.1: +commander@^2.20.0, commander@~2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== -commander@~2.19.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" - integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== +commander@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-4.0.1.tgz#b67622721785993182e807f4883633e6401ba53c" + integrity sha512-IPF4ouhCP+qdlcmCedhxX4xiGBPyigb8v5NeUp+0LyhwLgxMqyp3S0vl7TAPfS/hiP7FC3caI/PB9lTmP8r1NA== commondir@^1.0.1: version "1.0.1" @@ -3281,11 +3338,9 @@ config-chain@^1.1.11: proto-list "~1.2.1" console-browserify@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" - integrity sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA= - dependencies: - date-now "^0.1.4" + version "1.2.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" + integrity sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA== console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" @@ -3422,12 +3477,12 @@ copy-props@^2.0.1: each-props "^1.3.0" is-plain-object "^2.0.1" -core-js-compat@^3.1.1: - version "3.4.7" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.4.7.tgz#39f8080b1d92a524d6d90505c42b9c5c1eb90611" - integrity sha512-57+mgz/P/xsGdjwQYkwtBZR3LuISaxD1dEwVDtbk8xJMqAmwqaxLOvnNT7kdJ7jYE/NjNptyzXi+IQFMi/2fCw== +core-js-compat@^3.4.7: + version "3.4.8" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.4.8.tgz#f72e6a4ed76437ea710928f44615f926a81607d5" + integrity sha512-l3WTmnXHV2Sfu5VuD7EHE2w7y+K68+kULKt5RJg8ZJk3YhHF1qLD4O8v8AmNq+8vbOwnPFFDvds25/AoEvMqlQ== dependencies: - browserslist "^4.8.0" + browserslist "^4.8.2" semver "^6.3.0" core-util-is@1.0.2, core-util-is@~1.0.0: @@ -3487,6 +3542,15 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" + integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.0.0, crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -3528,7 +3592,7 @@ cyclist@^1.0.1: resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9" integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk= -d@1: +d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== @@ -3569,11 +3633,6 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -date-now@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" - integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= - dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" @@ -3586,7 +3645,7 @@ debug@3.1.0: dependencies: ms "2.0.0" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.2.0, debug@^2.3.3, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -3705,18 +3764,19 @@ defined@^1.0.0: resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= -del@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4" - integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ== +del@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/del/-/del-5.1.0.tgz#d9487c94e367410e6eff2925ee58c0c84a75b3a7" + integrity sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA== dependencies: - "@types/glob" "^7.1.1" - globby "^6.1.0" - is-path-cwd "^2.0.0" - is-path-in-cwd "^2.0.0" - p-map "^2.0.0" - pify "^4.0.1" - rimraf "^2.6.3" + globby "^10.0.1" + graceful-fs "^4.2.2" + is-glob "^4.0.1" + is-path-cwd "^2.2.0" + is-path-inside "^3.0.1" + p-map "^3.0.0" + rimraf "^3.0.0" + slash "^3.0.0" delayed-stream@~1.0.0: version "1.0.0" @@ -3734,12 +3794,12 @@ deprecation@^2.0.0: integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== deps-sort@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" - integrity sha1-CRckkC6EZYJg65EHSMzNGvbiH7U= + version "2.0.1" + resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.1.tgz#9dfdc876d2bcec3386b6829ac52162cda9fa208d" + integrity sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw== dependencies: JSONStream "^1.0.3" - shasum "^1.0.0" + shasum-object "^1.0.0" subarg "^1.0.0" through2 "^2.0.0" @@ -3755,9 +3815,9 @@ derequire@^2.0.2: yargs "^6.5.0" des.js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" - integrity sha1-wHTS4qpqipoH29YfmhXCzYPsjsw= + version "1.0.1" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.1.tgz#5382142e1bdc53f85d86d53e5f4aa7deb91e0843" + integrity sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA== dependencies: inherits "^2.0.1" minimalistic-assert "^1.0.0" @@ -3820,6 +3880,13 @@ dir-glob@^2.2.2: dependencies: path-type "^3.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -3899,10 +3966,10 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -electron-to-chromium@^1.3.317: - version "1.3.321" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.321.tgz#913869f5ec85daabba0e75c9c314b4bf26cdb01e" - integrity sha512-jJy/BZK2s2eAjMPXVMSaCmo7/pSY2aKkfQ+LoAb5Wk39qAhyP9r8KU74c4qTgr9cD/lPUhJgReZxxqU0n5puog== +electron-to-chromium@^1.3.322: + version "1.3.322" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.322.tgz#a6f7e1c79025c2b05838e8e344f6e89eb83213a8" + integrity sha512-Tc8JQEfGQ1MzfSzI/bTlSr7btJv/FFO7Yh6tanqVmIWOuNCu6/D1MilIEgLtmWqIrsv+o4IjpLAhgMBr/ncNAA== elegant-spinner@^1.0.1: version "1.0.1" @@ -3910,9 +3977,9 @@ elegant-spinner@^1.0.1: integrity sha1-2wQ1IcldfjA/2PNFvtwzSc+wcp4= elliptic@^6.0.0: - version "6.5.0" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.0.tgz#2b8ed4c891b7de3200e14412a5b8248c7af505ca" - integrity sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg== + version "6.5.2" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.2.tgz#05c5678d7173c049d8ca433552224a495d0e3762" + integrity sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw== dependencies: bn.js "^4.4.0" brorand "^1.0.1" @@ -3980,23 +4047,23 @@ error-ex@^1.2.0, error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: - version "1.16.0" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.0.tgz#d3a26dc9c3283ac9750dca569586e976d9dcc06d" - integrity sha512-xdQnfykZ9JMEiasTAJZJdMWCQ1Vm00NBw79/AWi7ELfZuuPCSOMDZbT9mkOfSctVtfhb+sAAzrm+j//GjjLHLg== +es-abstract@^1.12.0, es-abstract@^1.15.0, es-abstract@^1.4.3, es-abstract@^1.5.1, es-abstract@^1.7.0: + version "1.16.3" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.16.3.tgz#52490d978f96ff9f89ec15b5cf244304a5bca161" + integrity sha512-WtY7Fx5LiOnSYgF5eg/1T+GONaGmpvpPdCpSnYij+U2gDTL0UPfWrhDw7b2IYb+9NQJsYpCA0wOQvZfsd6YwRw== dependencies: - es-to-primitive "^1.2.0" + es-to-primitive "^1.2.1" function-bind "^1.1.1" has "^1.0.3" - has-symbols "^1.0.0" + has-symbols "^1.0.1" is-callable "^1.1.4" is-regex "^1.0.4" - object-inspect "^1.6.0" + object-inspect "^1.7.0" object-keys "^1.1.1" string.prototype.trimleft "^2.1.0" string.prototype.trimright "^2.1.0" -es-to-primitive@^1.2.0: +es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== @@ -4006,13 +4073,13 @@ es-to-primitive@^1.2.0: is-symbol "^1.0.2" es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@~0.10.14: - version "0.10.50" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.50.tgz#6d0e23a0abdb27018e5ac4fd09b412bc5517a778" - integrity sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw== + version "0.10.53" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" + integrity sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q== dependencies: es6-iterator "~2.0.3" - es6-symbol "~3.1.1" - next-tick "^1.0.0" + es6-symbol "~3.1.3" + next-tick "~1.0.0" es6-iterator@^2.0.1, es6-iterator@^2.0.3, es6-iterator@~2.0.1, es6-iterator@~2.0.3: version "2.0.3" @@ -4058,7 +4125,7 @@ es6-set@~0.1.5: es6-symbol "3.1.1" event-emitter "~0.3.5" -es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: +es6-symbol@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= @@ -4066,6 +4133,14 @@ es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: d "1" es5-ext "~0.10.14" +es6-symbol@^3.1.1, es6-symbol@~3.1.1, es6-symbol@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + es6-weak-map@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" @@ -4082,9 +4157,9 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= escodegen@^1.9.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" - integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + version "1.12.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.12.0.tgz#f763daf840af172bb3a2b6dd7219c0e17f7ff541" + integrity sha512-TuA+EhsanGcme5T3R0L80u4t8CpbXQjegRmf7+FPTJrtCTErXFeelblRgHQa1FofEzqYYJmJ/OqjTwREp9qgmg== dependencies: esprima "^3.1.3" estraverse "^4.2.0" @@ -4116,77 +4191,70 @@ eslint-import-resolver-node@^0.3.2: debug "^2.6.9" resolve "^1.5.0" -eslint-module-utils@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a" - integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw== +eslint-module-utils@^2.4.1: + version "2.5.0" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.5.0.tgz#cdf0b40d623032274ccd2abd7e64c4e524d6e19c" + integrity sha512-kCo8pZaNz2dsAW7nCUjuVoI11EBXXpIzfNxmaoLhXoRDOnqXLC4iSGVRdZPhOitfbdEfMEfKOiENaK6wDPZEGw== dependencies: - debug "^2.6.8" + debug "^2.6.9" pkg-dir "^2.0.0" eslint-plugin-flowtype@^3.8.2: - version "3.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.11.1.tgz#1aae15a10dbcd5aecc89897f810f2e9fcc18a5e3" - integrity sha512-4NiaaGZuz9iEGRTK8j4lkA/scibOXSYaYoHbsTtgLOxxqQCkbWV3xt8ETqILKg7DAYDqB69z1H5U71UmtdF9hw== + version "3.13.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-3.13.0.tgz#e241ebd39c0ce519345a3f074ec1ebde4cf80f2c" + integrity sha512-bhewp36P+t7cEV0b6OdmoRWJCBYRiHFlqPZAG1oS3SF+Y0LQkeDvFSM4oxoxvczD1OdONCXMlJfQFiWLcV9urw== dependencies: - lodash "^4.17.11" + lodash "^4.17.15" eslint-plugin-import@^2.17.2: - version "2.18.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.0.tgz#7a5ba8d32622fb35eb9c8db195c2090bd18a3678" - integrity sha512-PZpAEC4gj/6DEMMoU2Df01C5c50r7zdGIN52Yfi7CvvWaYssG7Jt5R9nFG5gmqodxNOz9vQS87xk6Izdtpdrig== + version "2.19.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.19.1.tgz#5654e10b7839d064dd0d46cd1b88ec2133a11448" + integrity sha512-x68131aKoCZlCae7rDXKSAQmbT5DQuManyXo2sK6fJJ0aK5CWAkv6A6HJZGgqC8IhjQxYPgo6/IY4Oz8AFsbBw== dependencies: array-includes "^3.0.3" + array.prototype.flat "^1.2.1" contains-path "^0.1.0" debug "^2.6.9" doctrine "1.5.0" eslint-import-resolver-node "^0.3.2" - eslint-module-utils "^2.4.0" + eslint-module-utils "^2.4.1" has "^1.0.3" - lodash "^4.17.11" minimatch "^3.0.4" + object.values "^1.1.0" read-pkg-up "^2.0.0" - resolve "^1.11.0" + resolve "^1.12.0" eslint-plugin-prettier@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.0.tgz#8695188f95daa93b0dc54b249347ca3b79c4686d" - integrity sha512-XWX2yVuwVNLOUhQijAkXz+rMPPoCr7WFiAl8ig6I7Xn+pPVhDhzg4DxHpmbeb0iqjO9UronEA3Tb09ChnFVHHA== + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba" + integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA== dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" - integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= - dependencies: - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-scope@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848" - integrity sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg== +eslint-scope@3.7.1, eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.3.1: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" - integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== dependencies: - eslint-visitor-keys "^1.0.0" + eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0: +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== eslint@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.0.1.tgz#4a32181d72cb999d6f54151df7d337131f81cda7" - integrity sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w== + version "6.7.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.7.2.tgz#c17707ca4ad7b2d8af986a33feba71e18a9fecd1" + integrity sha512-qMlSWJaCSxDFr8fBPvJM9kJwbazrhNcBU3+DszDW1OlEwKBBRWsJc7NJFelvwQpanHCR14cOLD41x8Eqvo3Nng== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -4194,45 +4262,46 @@ eslint@^6.0.1: cross-spawn "^6.0.5" debug "^4.0.1" doctrine "^3.0.0" - eslint-scope "^4.0.3" - eslint-utils "^1.3.1" - eslint-visitor-keys "^1.0.0" - espree "^6.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.3" + eslint-visitor-keys "^1.1.0" + espree "^6.1.2" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" functional-red-black-tree "^1.0.1" - glob-parent "^3.1.0" - globals "^11.7.0" + glob-parent "^5.0.0" + globals "^12.1.0" ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.2.2" + inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.17.11" + lodash "^4.17.14" minimatch "^3.0.4" mkdirp "^0.5.1" natural-compare "^1.4.0" - optionator "^0.8.2" + optionator "^0.8.3" progress "^2.0.0" regexpp "^2.0.1" - semver "^5.5.1" - strip-ansi "^4.0.0" - strip-json-comments "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" table "^5.2.3" text-table "^0.2.0" + v8-compile-cache "^2.0.3" -espree@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.0.0.tgz#716fc1f5a245ef5b9a7fdb1d7b0d3f02322e75f6" - integrity sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q== +espree@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" + integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== dependencies: - acorn "^6.0.7" - acorn-jsx "^5.0.0" - eslint-visitor-keys "^1.0.0" + acorn "^7.1.0" + acorn-jsx "^5.1.0" + eslint-visitor-keys "^1.1.0" esprima@^3.1.3: version "3.1.3" @@ -4259,9 +4328,9 @@ esrecurse@^4.1.0: estraverse "^4.1.0" estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" - integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== estree-walker@^0.5.2: version "0.5.2" @@ -4305,9 +4374,9 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: safe-buffer "^5.1.1" exec-sh@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" - integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + version "0.3.4" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5" + integrity sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A== execa@^1.0.0: version "1.0.0" @@ -4322,12 +4391,12 @@ execa@^1.0.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^2.0.1: - version "2.0.3" - resolved "https://registry.yarnpkg.com/execa/-/execa-2.0.3.tgz#4b84301b33042cfb622771e886ed0b10e5634642" - integrity sha512-iM124nlyGSrXmuyZF1EMe83ESY2chIYVyDRZKgmcDynid2Q2v/+GuE7gNMl6Sy9Niwf4MC0DDxagOxeMPjuLsw== +execa@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-2.1.0.tgz#e5d3ecd837d2a60ec50f3da78fd39767747bbe99" + integrity sha512-Y/URAVapfbYy2Xp/gb6A0E7iR8xeqOCXsuuaoMn7A5PzrXUK84E1gyiEfq0wQd/GHA6GsoHWwhNq8anb0mleIw== dependencies: - cross-spawn "^6.0.5" + cross-spawn "^7.0.0" get-stream "^5.0.0" is-stream "^2.0.0" merge-stream "^2.0.0" @@ -4388,6 +4457,13 @@ expect@^24.9.0: jest-message-util "^24.9.0" jest-regex-util "^24.9.0" +ext@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" + integrity sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A== + dependencies: + type "^2.0.0" + extend-shallow@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" @@ -4445,11 +4521,16 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extsprintf@1.3.0, extsprintf@^1.2.0: +extsprintf@1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + falafel@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-2.1.0.tgz#96bb17761daba94f46d001738b3cedf3a67fe06c" @@ -4501,22 +4582,45 @@ fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" +fast-glob@^3.0.3: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.1.1.tgz#87ee30e9e9f3eb40d6f254a7997655da753d7c82" + integrity sha512-nTCREpBY8w8r+boyFYAx21iL6faSsQynliPHM4Uf56SbkyohCNxpVPEH9xrF5TXKy+IsjkPUHDKiUkzBVRXn9g== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= -fast-levenshtein@~2.0.4: +fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-safe-stringify@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz#124aa885899261f68aedb42a7c080de9da608743" + integrity sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA== + +fastq@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" + integrity sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + dependencies: + reusify "^1.0.0" + fb-watchman@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" - integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + version "2.0.1" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" + integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== dependencies: - bser "^2.0.0" + bser "2.1.1" figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: version "3.5.1" @@ -4538,6 +4642,13 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" +figures@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-3.1.0.tgz#4b198dd07d8d71530642864af2d45dd9e459c4ec" + integrity sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg== + dependencies: + escape-string-regexp "^1.0.5" + file-entry-cache@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" @@ -4844,9 +4955,9 @@ get-caller-file@^2.0.1: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-own-enumerable-property-symbols@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz#b877b49a5c16aefac3655f2ed2ea5b684df8d203" - integrity sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg== + version "3.0.1" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.1.tgz#6f7764f88ea11e0b514bd9bd860a132259992ca4" + integrity sha512-09/VS4iek66Dh2bctjRkowueRJbY1JDGR1L/zRxO1Qk8Uxs6PnqaNSqalpizPT+CDjre3hnEsuzvhgomz9qYrA== get-pkg-repo@^1.0.0: version "1.4.0" @@ -4972,7 +5083,7 @@ glob-parent@^3.0.1, glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-parent@^5.0.0: +glob-parent@^5.0.0, glob-parent@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2" integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw== @@ -5044,21 +5155,31 @@ global-prefix@^1.0.1: is-windows "^1.0.1" which "^1.2.14" -globals@^11.1.0, globals@^11.7.0: +globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -globby@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= +globals@^12.1.0: + version "12.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-12.3.0.tgz#1e564ee5c4dded2ab098b0f88f24702a3c56be13" + integrity sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw== dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" + type-fest "^0.8.1" + +globby@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" + integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" globby@^9.2.0: version "9.2.0" @@ -5081,7 +5202,7 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: +graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" integrity sha512-a30VEBm4PEdx1dRB7MFK7BejejvCvBronbLjht+sHuGYj8PHs7M/5Z+rt5lw551vZ7yfTCj4Vuyy3mSJytDWRQ== @@ -5229,7 +5350,7 @@ has-flag@^3.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= -has-symbols@^1.0.0: +has-symbols@^1.0.0, has-symbols@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== @@ -5369,18 +5490,19 @@ humanize-ms@^1.2.1: ms "^2.0.0" husky@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.0.tgz#de63821a7049dc412b1afd753c259e2f6e227562" - integrity sha512-lKMEn7bRK+7f5eWPNGclDVciYNQt0GIkAQmhKl+uHP1qFzoN0h92kmH9HZ8PCwyVA2EQPD8KHf0FYWqnTxau+Q== + version "3.1.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-3.1.0.tgz#5faad520ab860582ed94f0c1a77f0f04c90b57c0" + integrity sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ== dependencies: + chalk "^2.4.2" + ci-info "^2.0.0" cosmiconfig "^5.2.1" execa "^1.0.0" get-stdin "^7.0.0" - is-ci "^2.0.0" opencollective-postinstall "^2.0.2" pkg-dir "^4.2.0" - please-upgrade-node "^3.1.1" - read-pkg "^5.1.1" + please-upgrade-node "^3.2.0" + read-pkg "^5.2.0" run-node "^1.0.0" slash "^3.0.0" @@ -5418,6 +5540,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.1: + version "5.1.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" + integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + import-fresh@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-2.0.0.tgz#d81355c15612d386c61f9ddd3922d4304822a546" @@ -5427,9 +5554,9 @@ import-fresh@^2.0.0: resolve-from "^3.0.0" import-fresh@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" - integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== + version "3.2.1" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66" + integrity sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ== dependencies: parent-module "^1.0.0" resolve-from "^4.0.0" @@ -5459,6 +5586,11 @@ indent-string@^3.0.0: resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" integrity sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok= +indent-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== + indexof@~0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" @@ -5478,15 +5610,20 @@ inflight@^1.0.4: wrappy "1" inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" integrity sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE= +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + ini@^1.3.2, ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" @@ -5520,7 +5657,7 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@^6.2.0, inquirer@^6.2.2: +inquirer@^6.2.0: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== @@ -5539,6 +5676,25 @@ inquirer@^6.2.0, inquirer@^6.2.2: strip-ansi "^5.1.0" through "^2.3.6" +inquirer@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.0.tgz#9e2b032dde77da1db5db804758b8fea3a970519a" + integrity sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ== + dependencies: + ansi-escapes "^4.2.1" + chalk "^2.4.2" + cli-cursor "^3.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^3.0.0" + lodash "^4.17.15" + mute-stream "0.0.8" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^4.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + insert-module-globals@^7.0.0: version "7.2.0" resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.2.0.tgz#ec87e5b42728479e327bd5c5c71611ddfb4752ba" @@ -5805,24 +5961,15 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" -is-path-cwd@^2.0.0: +is-path-cwd@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb" integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ== -is-path-in-cwd@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb" - integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ== - dependencies: - is-path-inside "^2.1.0" - -is-path-inside@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2" - integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg== - dependencies: - path-is-inside "^1.0.2" +is-path-inside@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" + integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== is-plain-obj@^1.0.0, is-plain-obj@^1.1.0: version "1.1.0" @@ -5902,11 +6049,11 @@ is-stream@^2.0.0: integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== is-symbol@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" - integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.3.tgz#38e1014b9e6329be0de9d24a414fd7441ec61937" + integrity sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ== dependencies: - has-symbols "^1.0.0" + has-symbols "^1.0.1" is-text-path@^1.0.1: version "1.0.1" @@ -6570,7 +6717,7 @@ klaw@^2.1.0: dependencies: graceful-fs "^4.1.9" -kleur@^3.0.2: +kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== @@ -6771,20 +6918,21 @@ lines-and-columns@^1.1.6: integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= lint-staged@^9.2.0: - version "9.2.0" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.2.0.tgz#155e5723dffdaa55d252c47bab05a2962c1e9781" - integrity sha512-K/CQWcxYunc8lGMNTFvtI4+ybJcHW3K4Ghudz2OrJhIWdW/i1WWu9rGiVj4yJ0+D/xh8a08kp5slt89VZC9Eqg== + version "9.5.0" + resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-9.5.0.tgz#290ec605252af646d9b74d73a0fa118362b05a33" + integrity sha512-nawMob9cb/G1J98nb8v3VC/E8rcX1rryUYXVZ69aT9kde6YWX+uvNOEHY5yf2gcWcTJGiD0kqXmCnS3oD75GIA== dependencies: chalk "^2.4.2" commander "^2.20.0" cosmiconfig "^5.2.1" debug "^4.1.1" dedent "^0.7.0" - del "^4.1.1" - execa "^2.0.1" + del "^5.0.0" + execa "^2.0.3" listr "^0.14.3" log-symbols "^3.0.0" micromatch "^4.0.2" + normalize-path "^3.0.0" please-upgrade-node "^3.1.1" string-argv "^0.3.0" stringify-object "^3.3.0" @@ -6953,7 +7101,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1: +lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -7021,9 +7169,9 @@ magic-string@^0.22.5: vlq "^0.2.2" magic-string@^0.25.2: - version "0.25.3" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.3.tgz#34b8d2a2c7fec9d9bdf9929a3fd81d271ef35be9" - integrity sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA== + version "0.25.4" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.4.tgz#325b8a0a79fc423db109b77fd5a19183b7ba5143" + integrity sha512-oycWO9nEVAP2RVPbIoDoA4Y7LFIJ3xRYov93gAyJhZkET1tNuB0u7uWkZS2LpBWTJUWnmau/To8ECWRC+jKNfw== dependencies: sourcemap-codec "^1.4.4" @@ -7178,7 +7326,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.2.3: +merge2@^1.2.3, merge2@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== @@ -7289,7 +7437,7 @@ minimist-options@^3.0.1: arrify "^1.0.1" is-plain-obj "^1.1.0" -minimist@0.0.8, minimist@~0.0.1: +minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= @@ -7299,6 +7447,11 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + minipass@^2.3.5, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" @@ -7425,11 +7578,16 @@ mute-stdout@^1.0.0: resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== -mute-stream@0.0.7, mute-stream@~0.0.4: +mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mute-stream@0.0.8, mute-stream@~0.0.4: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== + mz@^2.5.0: version "2.7.0" resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" @@ -7480,7 +7638,7 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== -next-tick@^1.0.0: +next-tick@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= @@ -7566,10 +7724,10 @@ node-pre-gyp@^0.12.0: semver "^5.3.0" tar "^4" -node-releases@^1.1.41: - version "1.1.41" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.41.tgz#57674a82a37f812d18e3b26118aefaf53a00afed" - integrity sha512-+IctMa7wIs8Cfsa8iYzeaLTFwv5Y4r5jZud+4AnfymzeEXKBCavFX0KBgzVaPVqf0ywa6PrO8/b+bPqdwjGBSg== +node-releases@^1.1.42: + version "1.1.42" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.42.tgz#a999f6a62f8746981f6da90627a8d2fc090bbad7" + integrity sha512-OQ/ESmUqGawI2PRX+XIRao44qWYBBfN54ImQYdWVTQqUckuejOg76ysSqDBK8NG3zwySRVnX36JwDQ6x+9GxzA== dependencies: semver "^6.3.0" @@ -7623,9 +7781,9 @@ now-and-later@^2.0.0: once "^1.3.2" npm-bundled@^1.0.1: - version "1.0.6" - resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" - integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + version "1.1.0" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.0.tgz#2e8fdb7e69eff2df963937b696243316537c284b" + integrity sha512-ez6dcKBFNo4FvlMqscBEFUum6M2FTLW5grqm3DyBKB5XOyKVCeeWvAuoZtbmW/5Cv8EM2bQUOA6ufxa/TKVN0g== npm-lifecycle@^3.1.2: version "3.1.4" @@ -7698,9 +7856,9 @@ number-is-nan@^1.0.0: integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= nwsapi@^2.0.7: - version "2.1.4" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.4.tgz#e006a878db23636f8e8a67d33ca0e4edf61a842f" - integrity sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw== + version "2.2.0" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7" + integrity sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ== oauth-sign@~0.9.0: version "0.9.0" @@ -7721,7 +7879,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.6.0: +object-inspect@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== @@ -7811,6 +7969,16 @@ object.reduce@^1.0.0: for-own "^1.0.0" make-iterator "^1.0.0" +object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + octal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/octal/-/octal-1.0.0.tgz#63e7162a68efbeb9e213588d58e989d1e5c4530b" @@ -7855,17 +8023,17 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.1, optionator@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" - integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= +optionator@^0.8.1, optionator@^0.8.3: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== dependencies: deep-is "~0.1.3" - fast-levenshtein "~2.0.4" + fast-levenshtein "~2.0.6" levn "~0.3.0" prelude-ls "~1.1.2" type-check "~0.3.2" - wordwrap "~1.0.0" + word-wrap "~1.2.3" ordered-read-streams@^1.0.0: version "1.0.1" @@ -7990,6 +8158,13 @@ p-map@^2.0.0, p-map@^2.1.0: resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== +p-map@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" + integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== + dependencies: + aggregate-error "^3.0.0" + p-pipe@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/p-pipe/-/p-pipe-1.2.0.tgz#4b1a11399a11520a67790ee5a0c1d5881d6befe9" @@ -8053,9 +8228,9 @@ parents@^1.0.0, parents@^1.0.1: path-platform "~0.11.15" parse-asn1@^5.0.0: - version "5.1.4" - resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc" - integrity sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw== + version "5.1.5" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.5.tgz#003271343da58dc94cace494faef3d2147ecea0e" + integrity sha512-jkMYn1dcJqF6d5CpU689bq7w/b5ALS9ROVSpQDPrZsqqesUJii9qutvoT5ltGedNXMO2e16YUWIghG9KxaViTQ== dependencies: asn1.js "^4.0.0" browserify-aes "^1.0.0" @@ -8183,20 +8358,15 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" - integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= - path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= -path-key@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.0.tgz#99a10d870a803bdd5ee6f0470e58dfcd2f9a54d3" - integrity sha512-8cChqz0RP6SHJkMt48FW0A7+qUOn+OsnOsVtzI59tZ8m+5bCSk7hzwET0pulwOM2YMn9J1efb07KB9l9f30SGg== +path-key@^3.0.0, path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== path-parse@^1.0.6: version "1.0.6" @@ -8243,6 +8413,11 @@ path-type@^3.0.0: dependencies: pify "^3.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pbkdf2@^3.0.3: version "3.0.17" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.17.tgz#976c206530617b14ebb32114239f7b09336e93a6" @@ -8260,9 +8435,9 @@ performance-now@^2.1.0: integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= picomatch@^2.0.5: - version "2.0.7" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" - integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + version "2.1.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.1.1.tgz#ecdfbea7704adb5fe6fb47f9866c4c0e15e905c5" + integrity sha512-OYMyqkKzK7blWO/+XZYP6w8hH0LDvkBvdvKukti+7kqYFCiEAk+gI3DWnryapc0Dau05ugGTy0foQ6mqn4AHYA== pify@^2.0.0, pify@^2.3.0: version "2.3.0" @@ -8319,10 +8494,10 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -please-upgrade-node@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.1.1.tgz#ed320051dfcc5024fae696712c8288993595e8ac" - integrity sha512-KY1uHnQ2NlQHqIJQpnh/i54rKkuxCEBx+voJIS/Mvb+L2iYd2NMotwduhKTMjfC1uKoX3VXOxLjIYG66dfJTVQ== +please-upgrade-node@^3.1.1, please-upgrade-node@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942" + integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg== dependencies: semver-compare "^1.0.0" @@ -8438,12 +8613,12 @@ promise-retry@^1.1.1: retry "^0.10.0" prompts@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" - integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== + version "2.3.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.3.0.tgz#a444e968fa4cc7e86689a74050685ac8006c4cc4" + integrity sha512-NfbbPPg/74fT7wk2XYQ7hAIp9zJyZp5Fu19iRbORqqy1BhtrkZ0fPafBU+7bmn8ie69DpT0R6QpJIN2oisYjJg== dependencies: - kleur "^3.0.2" - sisteransi "^1.0.0" + kleur "^3.0.3" + sisteransi "^1.0.3" promzard@^0.3.0: version "0.3.0" @@ -8479,10 +8654,10 @@ prr@~1.0.1: resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476" integrity sha1-0/wRS6BplaRexok/SEzrHXj19HY= -psl@^1.1.24: - version "1.4.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.4.0.tgz#5dd26156cdb69fa1fdb8ab1991667d3f80ced7c2" - integrity sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw== +psl@^1.1.24, psl@^1.1.28: + version "1.6.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.6.0.tgz#60557582ee23b6c43719d9890fb4170ecd91e110" + integrity sha512-SYKKmVel98NCOYXpkwUqZqh0ahZeeKfmisiLIcEZdsb+WbLv02g/dI5BUmZnIyOe7RzZtLax81nnb2HbvC2tzA== public-encrypt@^4.0.0: version "4.0.3" @@ -8531,7 +8706,7 @@ punycode@^1.3.2, punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -8596,9 +8771,9 @@ rc@^1.2.7: strip-json-comments "~2.0.1" react-is@^16.8.4: - version "16.8.6" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" - integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + version "16.12.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c" + integrity sha512-rPCkf/mWBtKc97aLL9/txD8DZdemK0vkA3JMLShjlJB3Pj3s+lpf1KaBzMfQrAmhMQB0n1cU/SUGgKKBCe837Q== read-cmd-shim@^1.0.1: version "1.0.5" @@ -8694,7 +8869,7 @@ read-pkg@^3.0.0: normalize-package-data "^2.3.2" path-type "^3.0.0" -read-pkg@^5.1.1: +read-pkg@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-5.2.0.tgz#7bf295438ca5a33e56cd30e053b34ee7250c93cc" integrity sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg== @@ -8724,7 +8899,7 @@ read@1, read@~1.0.1: string_decoder "~1.1.1" util-deprecate "~1.0.1" -"readable-stream@2 || 3", readable-stream@^3.0.2: +"readable-stream@2 || 3", readable-stream@^3.0.2, readable-stream@^3.0.6: version "3.4.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== @@ -8859,9 +9034,9 @@ regexpu-core@^4.6.0: unicode-match-property-value-ecmascript "^1.1.0" regjsgen@^0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.0.tgz#a7634dc08f89209c2049adda3525711fb97265dd" - integrity sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA== + version "0.5.1" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.1.tgz#48f0bf1a5ea205196929c0d9798b42d1ed98443c" + integrity sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg== regjsparser@^0.6.0: version "0.6.0" @@ -8928,19 +9103,19 @@ replace-homedir@^1.0.0: is-absolute "^1.0.0" remove-trailing-separator "^1.1.0" -request-promise-core@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" - integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== +request-promise-core@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9" + integrity sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ== dependencies: - lodash "^4.17.11" + lodash "^4.17.15" request-promise-native@^1.0.5: - version "1.0.7" - resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" - integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + version "1.0.8" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36" + integrity sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ== dependencies: - request-promise-core "1.1.2" + request-promise-core "1.1.3" stealthy-require "^1.1.1" tough-cookie "^2.3.3" @@ -9027,10 +9202,10 @@ resolve@1.1.7: resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= -resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: - version "1.12.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6" - integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w== +resolve@^1.1.4, resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.11.1, resolve@^1.12.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.8.1: + version "1.13.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.13.1.tgz#be0aa4c06acd53083505abb35f4d66932ab35d16" + integrity sha512-CxqObCX8K8YtAhOBRg+lrcdn+LK+WYOS8tSjqSFbjtrI5PnS63QPhZl4+yKfrU9tdsbMu9Anr/amegT87M9Z6w== dependencies: path-parse "^1.0.6" @@ -9042,6 +9217,14 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -9052,13 +9235,32 @@ retry@^0.10.0: resolved "https://registry.yarnpkg.com/retry/-/retry-0.10.1.tgz#e76388d217992c252750241d3d3956fed98d8ff4" integrity sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q= -rimraf@2, rimraf@2.6.3, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: +reusify@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2, rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@2.6.3: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== dependencies: glob "^7.1.3" +rimraf@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.0.tgz#614176d4b3010b75e5c390eb0ee96f6dc0cebb9b" + integrity sha512-NDGVxTsjqfunkds7CqsOiEnxln4Bo7Nddl3XhS4pXg5OzwkLqJ971ZVAAnB+DDLnF76N+VnDEiBHaVV8I06SUg== + dependencies: + glob "^7.1.3" + ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -9138,24 +9340,17 @@ rollup-plugin-terser@^5.1.2: serialize-javascript "^1.7.0" terser "^4.1.0" -rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0: +rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: version "2.8.2" resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== dependencies: estree-walker "^0.6.1" -rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97" - integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg== - dependencies: - estree-walker "^0.6.1" - rollup@^1.27.5: - version "1.27.5" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.27.5.tgz#d100fb0ffd8353575cb2057152547b9abfddfe59" - integrity sha512-8rfVdzuTg2kt8ObD9LNJpEwUN7B6lsl3sHc5fddtgICpLjpYeSf4m2+RftBzcCaBTMi1iYX3Ez8zFT4Gj2nJjg== + version "1.27.9" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-1.27.9.tgz#742f1234c1fa935f35149a433807da675b10f9a6" + integrity sha512-8AfW4cJTPZfG6EXWwT/ujL4owUsDI1Xl8J1t+hvK4wDX81F5I4IbwP9gvGbHzxnV19fnU4rRABZQwZSX9J402Q== dependencies: "@types/estree" "*" "@types/node" "*" @@ -9178,6 +9373,11 @@ run-node@^1.0.0: resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e" integrity sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A== +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -9192,7 +9392,7 @@ rxjs@^6.3.3, rxjs@^6.4.0: dependencies: tslib "^1.9.0" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== @@ -9251,7 +9451,7 @@ semver-greatest-satisfied-range@^1.1.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@^6.0.0, semver@^6.2.0, semver@^6.3.0: +semver@^6.0.0, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== @@ -9301,6 +9501,13 @@ shallow-clone@^3.0.0: dependencies: kind-of "^6.0.2" +shasum-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shasum-object/-/shasum-object-1.0.0.tgz#0b7b74ff5b66ecf9035475522fa05090ac47e29e" + integrity sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg== + dependencies: + fast-safe-stringify "^2.0.7" + shasum@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" @@ -9316,20 +9523,27 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shell-quote@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" - integrity sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c= - dependencies: - array-filter "~0.0.0" - array-map "~0.0.0" - array-reduce "~0.0.0" - jsonify "~0.0.0" + version "1.7.2" + resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.7.2.tgz#67a7d02c76c9da24f99d20808fcaded0e0e04be2" + integrity sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg== shellwords@^0.1.1: version "0.1.1" @@ -9346,10 +9560,10 @@ simple-concat@^1.0.0: resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" integrity sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY= -sisteransi@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.2.tgz#ec57d64b6f25c4f26c0e2c7dd23f2d7f12f7e418" - integrity sha512-ZcYcZcT69nSLAR2oLN2JwNmLkJEKGooFMCdvOkFrToUt/WfcRWqhIg4P4KwY4dmLbuyXIx4o4YmPsvMRJYJd/w== +sisteransi@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.4.tgz#386713f1ef688c7c0304dc4c0632898941cad2e3" + integrity sha512-/ekMoM4NJ59ivGSfKapeG+FWtrmWvA1p6FBZwXrqojw90vJu8lBmrTxCMuBCydKtkaUe2zt4PlxeTKpjwMbyig== slash@^1.0.0: version "1.0.0" @@ -9620,15 +9834,14 @@ stream-exhaust@^1.0.1: resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== -stream-http@^2.0.0: - version "2.8.3" - resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" - integrity sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw== +stream-http@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-3.1.0.tgz#22fb33fe9b4056b4eccf58bd8f400c4b993ffe57" + integrity sha512-cuB6RgO7BqC4FBYzmnvhob5Do3wIdIsXAgGycHJnW+981gHqoYcYz9lqjJrk8WXRddbwPuqPYRl+bag6mYv4lw== dependencies: builtin-status-codes "^3.0.0" inherits "^2.0.1" - readable-stream "^2.3.6" - to-arraybuffer "^1.0.0" + readable-stream "^3.0.6" xtend "^4.0.0" stream-shift@^1.0.0: @@ -9652,9 +9865,9 @@ streamfilter@^1.0.5: readable-stream "^2.0.2" string-argv@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.0.tgz#0ea99e7257fea5e97a1bfcdfc19cf12d68e6ec6a" - integrity sha512-NGZHq3nkSXVtGZXTBjFru3MNfoZyIzN25T7BmvdgnSC0LCJczAGLLMQLyjywSIaAoqSemgLzBRHOsnrHbt60+Q== + version "0.3.1" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" + integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== string-length@^2.0.0: version "2.0.0" @@ -9696,13 +9909,13 @@ string-width@^3.0.0, string-width@^3.1.0: strip-ansi "^5.1.0" string-width@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.1.0.tgz#ba846d1daa97c3c596155308063e075ed1c99aff" - integrity sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ== + version "4.2.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" + integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== dependencies: emoji-regex "^8.0.0" is-fullwidth-code-point "^3.0.0" - strip-ansi "^5.2.0" + strip-ansi "^6.0.0" string.prototype.padend@^3.0.0: version "3.0.0" @@ -9729,18 +9942,25 @@ string.prototype.trimright@^2.1.0: define-properties "^1.1.3" function-bind "^1.1.1" -string_decoder@^1.1.1, string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: - safe-buffer "~5.1.0" + safe-buffer "~5.2.0" string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" integrity sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ= +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -9771,6 +9991,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" +strip-ansi@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532" + integrity sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w== + dependencies: + ansi-regex "^5.0.0" + strip-bom-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-2.0.0.tgz#f87db5ef2613f6968aa545abfe1ec728b6a829ca" @@ -9813,7 +10040,12 @@ strip-indent@^2.0.0: resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-2.0.0.tgz#5ef8db295d01e6ed6cbf7aab96998d7822527b68" integrity sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g= -strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + +strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -9879,14 +10111,14 @@ syntax-error@^1.1.1: acorn-node "^1.2.0" table@^5.2.3: - version "5.4.2" - resolved "https://registry.yarnpkg.com/table/-/table-5.4.2.tgz#e837706859a17b5a9a6352c6695d4c8534543b4d" - integrity sha512-DQqgZw837CvGJ/IDqjHX3ZCY9RWlB3jEpbPURQaTMZPbuYEV+F58RGfPG1WMvghzXKFQyvIShcD4bSLiIkkuUg== + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== dependencies: ajv "^6.10.2" lodash "^4.17.14" slice-ansi "^2.1.0" - string-width "^4.1.0" + string-width "^3.0.0" tapable@^0.2.7: version "0.2.9" @@ -9924,9 +10156,9 @@ temp-write@^3.4.0: uuid "^3.0.1" terser@^4.1.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.0.tgz#22c46b4817cf4c9565434bfe6ad47336af259ac3" - integrity sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA== + version "4.4.2" + resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.2.tgz#448fffad0245f4c8a277ce89788b458bfd7706e8" + integrity sha512-Uufrsvhj9O1ikwgITGsZ5EZS6qPokUOkCegS7fYOdGTv+OA90vndUbU6PEjr5ePqHfNUbGyMO7xyIZv2MhsALQ== dependencies: commander "^2.20.0" source-map "~0.6.1" @@ -10047,11 +10279,6 @@ to-absolute-glob@^2.0.0: is-absolute "^1.0.0" is-negated-glob "^1.0.0" -to-arraybuffer@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" - integrity sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -10096,7 +10323,15 @@ to-through@^2.0.0: dependencies: through2 "^2.0.3" -tough-cookie@^2.3.3, tough-cookie@^2.3.4, tough-cookie@~2.4.3: +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== @@ -10165,10 +10400,20 @@ type-fest@^0.6.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== +type-fest@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" + integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== + type@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61" - integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.0.0.tgz#5f16ff6ef2eb44f260494dae271033b29c09a9c3" + integrity sha512-KBt58xCHry4Cejnc2ISQAF7QY+ORngsWfxezO68+12hKV6lQY8P/psIkcbjeHWn7MqcgciWJyCCevFMJdIXpow== typedarray-to-buffer@~1.0.0: version "1.0.4" @@ -10181,16 +10426,16 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@^3.6.3: - version "3.6.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" - integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== + version "3.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69" + integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== uglify-js@^3.1.4: - version "3.4.10" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f" - integrity sha512-Y2VsbPVs0FIshJztycsO2SfPk7/KAF/T72qzv9u5EpQ4kB2hQoHlhNQTsNyy6ul7lQtqJN/AoWeS23OzEiEFxw== + version "3.7.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.7.2.tgz#cb1a601e67536e9ed094a92dd1e333459643d3f9" + integrity sha512-uhRwZcANNWVLrxLfNFEdltoPNhECUR3lc+UdJoG9CBpMcSnKyWA94tc3eAujB1GcMY5Uwq8ZMp4qWpxWYDQmaA== dependencies: - commander "~2.19.0" + commander "~2.20.3" source-map "~0.6.1" uid-number@0.0.6: @@ -10369,18 +10614,30 @@ util.promisify@^1.0.0: define-properties "^1.1.2" object.getownpropertydescriptors "^2.0.3" -util@0.10.3, util@~0.10.1: +util@0.10.3: version "0.10.3" resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" integrity sha1-evsa/lCAUkZInj23/g7TeTNqwPk= dependencies: inherits "2.0.1" +util@~0.10.1: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + uuid@^3.0.1, uuid@^3.3.2: version "3.3.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866" integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ== +v8-compile-cache@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" + integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + v8flags@^3.0.1: version "3.1.3" resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8" @@ -10499,9 +10756,9 @@ vlq@^0.2.2: integrity sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow== vm-browserify@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" - integrity sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw== + version "1.1.2" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.2.tgz#78641c488b8e6ca91a75f511e7a3b32a86e5dda0" + integrity sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ== w3c-hr-time@^1.0.1: version "1.0.1" @@ -10576,6 +10833,13 @@ which@1, which@^1.2.14, which@^1.2.9, which@^1.3.0, which@^1.3.1: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + wide-align@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" @@ -10590,15 +10854,15 @@ windows-release@^3.1.0: dependencies: execa "^1.0.0" -wordwrap@~0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - integrity sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8= +word-wrap@~1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wordwrap@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" - integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= wrap-ansi@^2.0.0: version "2.1.0" @@ -10699,7 +10963,7 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.0, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== From de1fa902f092222a095f9a005a2e547eae18824b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 9 Dec 2019 19:14:29 -0500 Subject: [PATCH 860/965] Tune eslint packages test configuration (#10848) * Do not load root babel.config.js in esilnt tests * add testcase: sourceType: script + globalReturn: true * chore: remove globalReturn on default test config --- .../babel-eslint-parser/test/integration.js | 2 + .../test/non-regression.js | 37 +++++++++++++------ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/eslint/babel-eslint-parser/test/integration.js b/eslint/babel-eslint-parser/test/integration.js index ecad41bdd0b7..d2df877c562e 100644 --- a/eslint/babel-eslint-parser/test/integration.js +++ b/eslint/babel-eslint-parser/test/integration.js @@ -16,6 +16,8 @@ const baseEslintOpts = { parser: "current-babel-eslint", parserOptions: { sourceType: "script", + requireConfigFile: false, + babelOptions: { configFile: false } }, }; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index b1feb30eabb7..63aadea4b33a 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -18,26 +18,20 @@ function verifyAndAssertMessagesWithSpecificESLint( node: true, es6: true, }, + ...overrideConfig, parserOptions: { sourceType, - ecmaFeatures: { - globalReturn: true, - }, + requireConfigFile: false, babelOptions: { configFile: path.resolve( __dirname, "./fixtures/config/babel.config.js", ), }, + ...overrideConfig?.parserOptions, }, }; - if (overrideConfig) { - for (const key in overrideConfig) { - config[key] = overrideConfig[key]; - } - } - const messages = linter.verify(code, config); if (messages.length !== expectedMessages.length) { @@ -1566,7 +1560,7 @@ describe("verify", () => { ); }); - it("no-implicit-globals in script", () => { + it("no-implicit-globals in script: globalReturn is false", () => { verifyAndAssertMessages( "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, @@ -1576,7 +1570,28 @@ describe("verify", () => { "script", { env: {}, - parserOptions: { ecmaVersion: 6, sourceType: "script" }, + parserOptions: { + ecmaVersion: 6, + sourceType: "script", + ecmaFeatures: { globalReturn: false }, + }, + }, + ); + }); + + it("no-implicit-globals in script: globalReturn is true", () => { + verifyAndAssertMessages( + "var leakedGlobal = 1;", + { "no-implicit-globals": 1 }, + [], + "script", + { + env: {}, + parserOptions: { + ecmaVersion: 6, + sourceType: "script", + ecmaFeatures: { globalReturn: true }, + }, }, ); }); From 20e43ad10300b284c83dd83957cddf27660451eb Mon Sep 17 00:00:00 2001 From: Bowei Han Date: Mon, 9 Dec 2019 20:29:02 -0500 Subject: [PATCH 861/965] validate parentheses in the left-hand side of assignment expressions (#10576) * invalid left-hand assignments based on parenthesis * validate against nested ParenthesizedExpressions --- .../babel-parser/src/parser/expression.js | 26 -- packages/babel-parser/src/parser/lval.js | 20 ++ .../invalid-assignment-pattern-1/input.js | 1 + .../invalid-assignment-pattern-1/options.json | 5 + .../invalid-assignment-pattern-1/output.json | 138 ++++++++++ .../invalid-assignment-pattern-2/input.js | 1 + .../invalid-assignment-pattern-2/options.json | 5 + .../invalid-assignment-pattern-2/output.json | 155 +++++++++++ .../invalid-assignment-pattern-3/input.js | 1 + .../invalid-assignment-pattern-3/options.json | 5 + .../invalid-assignment-pattern-3/output.json | 225 +++++++++++++++ .../invalid-assignment-pattern-4/input.js | 1 + .../invalid-assignment-pattern-4/options.json | 5 + .../invalid-assignment-pattern-4/output.json | 242 +++++++++++++++++ .../invalid-assignment-pattern-5/input.js | 1 + .../invalid-assignment-pattern-5/options.json | 5 + .../invalid-assignment-pattern-5/output.json | 140 ++++++++++ .../valid-assignment-pattern-1/input.js | 1 + .../valid-assignment-pattern-1/output.json | 154 +++++++++++ .../valid-assignment-pattern-2/input.js | 1 + .../valid-assignment-pattern-2/output.json | 121 +++++++++ .../valid-assignment-pattern-3/input.js | 1 + .../valid-assignment-pattern-3/output.json | 121 +++++++++ .../fixtures/core/uncategorised/559/input.js | 1 + .../core/uncategorised/559/options.json | 3 + .../core/uncategorised/559/output.json | 153 +++++++++++ .../fixtures/core/uncategorised/560/input.js | 1 + .../core/uncategorised/560/options.json | 3 + .../core/uncategorised/560/output.json | 170 ++++++++++++ .../fixtures/core/uncategorised/561/input.js | 1 + .../core/uncategorised/561/options.json | 3 + .../core/uncategorised/561/output.json | 239 ++++++++++++++++ .../fixtures/core/uncategorised/562/input.js | 1 + .../core/uncategorised/562/options.json | 3 + .../core/uncategorised/562/output.json | 256 ++++++++++++++++++ .../fixtures/core/uncategorised/563/input.js | 1 + .../core/uncategorised/563/options.json | 3 + .../core/uncategorised/563/output.json | 152 +++++++++++ .../fixtures/core/uncategorised/564/input.js | 1 + .../core/uncategorised/564/options.json | 3 + .../core/uncategorised/564/output.json | 165 +++++++++++ .../fixtures/core/uncategorised/565/input.js | 1 + .../core/uncategorised/565/options.json | 3 + .../core/uncategorised/565/output.json | 132 +++++++++ .../fixtures/core/uncategorised/566/input.js | 1 + .../core/uncategorised/566/options.json | 3 + .../core/uncategorised/566/output.json | 162 +++++++++++ .../es2015/uncategorised/223/input.js | 2 +- 48 files changed, 2811 insertions(+), 27 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/input.js create mode 100644 packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/559/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/559/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/559/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/560/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/560/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/560/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/561/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/561/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/561/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/562/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/562/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/562/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/563/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/563/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/563/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/564/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/564/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/564/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/565/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/565/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/565/output.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/566/input.js create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/566/options.json create mode 100644 packages/babel-parser/test/fixtures/core/uncategorised/566/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 99f0d0977929..8fd00cda91fb 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -41,12 +41,6 @@ import { SCOPE_PROGRAM, } from "../util/scopeflags"; -const unwrapParenthesizedExpression = node => { - return node.type === "ParenthesizedExpression" - ? unwrapParenthesizedExpression(node.expression) - : node; -}; - export default class ExpressionParser extends LValParser { // Forward-declaration: defined in statement.js +parseBlock: ( @@ -213,26 +207,6 @@ export default class ExpressionParser extends LValParser { this.checkLVal(left, undefined, undefined, "assignment expression"); - const maybePattern = unwrapParenthesizedExpression(left); - - let patternErrorMsg; - if (maybePattern.type === "ObjectPattern") { - patternErrorMsg = "`({a}) = 0` use `({a} = 0)`"; - } else if (maybePattern.type === "ArrayPattern") { - patternErrorMsg = "`([a]) = 0` use `([a] = 0)`"; - } - - if ( - patternErrorMsg && - ((left.extra && left.extra.parenthesized) || - left.type === "ParenthesizedExpression") - ) { - this.raise( - maybePattern.start, - `You're trying to assign to a parenthesized expression, eg. instead of ${patternErrorMsg}`, - ); - } - this.next(); node.right = this.parseMaybeAssign(noIn); return this.finishNode(node, "AssignmentExpression"); diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 547441b0ce41..9a726a36dc2f 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -22,6 +22,12 @@ import { import { NodeUtils } from "./node"; import { type BindingTypes, BIND_NONE } from "../util/scopeflags"; +const unwrapParenthesizedExpression = (node: Node) => { + return node.type === "ParenthesizedExpression" + ? unwrapParenthesizedExpression(node.expression) + : node; +}; + export default class LValParser extends NodeUtils { // Forward-declaration: defined in expression.js +parseIdentifier: (liberal?: boolean) => Identifier; @@ -49,6 +55,20 @@ export default class LValParser extends NodeUtils { contextDescription: string, ): Node { if (node) { + if ( + (this.options.createParenthesizedExpressions && + node.type === "ParenthesizedExpression") || + node.extra?.parenthesized + ) { + const parenthesized = unwrapParenthesizedExpression(node); + if ( + parenthesized.type !== "Identifier" && + parenthesized.type !== "MemberExpression" + ) { + this.raise(node.start, "Invalid parenthesized assignment pattern"); + } + } + switch (node.type) { case "Identifier": case "ObjectPattern": diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/input.js b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/input.js new file mode 100644 index 000000000000..0a7f8682331a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/input.js @@ -0,0 +1 @@ +(a = 1) = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json new file mode 100644 index 000000000000..5a02a61446d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json new file mode 100644 index 000000000000..064381b180f6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/output.json @@ -0,0 +1,138 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + ], + "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": "AssignmentPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "value": 1, + "raw": "1" + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/input.js b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/input.js new file mode 100644 index 000000000000..93c05a981b37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/input.js @@ -0,0 +1 @@ +[(a = 1)] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json new file mode 100644 index 000000000000..5a02a61446d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/output.json new file mode 100644 index 000000000000..f606fc8063af --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/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: Invalid parenthesized assignment pattern (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": "AssignmentExpression", + "start": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "value": 1, + "raw": "1" + }, + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/input.js b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/input.js new file mode 100644 index 000000000000..18b5e0796da0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/input.js @@ -0,0 +1 @@ +[({ a: [b = 2]})] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json new file mode 100644 index 000000000000..5a02a61446d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json new file mode 100644 index 000000000000..dc0122606f36 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/output.json @@ -0,0 +1,225 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "AssignmentExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 2, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "Property", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 2, + "raw": "2" + } + } + ] + }, + "kind": "init" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/input.js b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/input.js new file mode 100644 index 000000000000..dff398289765 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/input.js @@ -0,0 +1 @@ +[{b: [([a = 1])]}] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json new file mode 100644 index 000000000000..5a02a61446d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json new file mode 100644 index 000000000000..caf293552bc5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/output.json @@ -0,0 +1,242 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "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": "ArrayPattern", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "Property", + "start": 2, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "Literal", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "value": 1, + "raw": "1" + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 6 + } + } + ] + }, + "kind": "init" + } + ] + } + ] + }, + "right": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/input.js b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/input.js new file mode 100644 index 000000000000..0100e137ff7f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/input.js @@ -0,0 +1 @@ +[([x])] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json new file mode 100644 index 000000000000..5a02a61446d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "estree" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json new file mode 100644 index 000000000000..8eaa162030cd --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/output.json @@ -0,0 +1,140 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "AssignmentExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "ArrayPattern", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + ], + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/input.js b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/input.js new file mode 100644 index 000000000000..821f2c5a3c37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/input.js @@ -0,0 +1 @@ +[(a.x)] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json new file mode 100644 index 000000000000..d0db9dd2f9f2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-1/output.json @@ -0,0 +1,154 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ArrayPattern", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "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": "x" + }, + "name": "x" + }, + "computed": false, + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/input.js b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/input.js new file mode 100644 index 000000000000..d2e8408e783a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/input.js @@ -0,0 +1 @@ +[(x)] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json new file mode 100644 index 000000000000..96d91c3d80d7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json @@ -0,0 +1,121 @@ +{ + "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": "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": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/input.js b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/input.js new file mode 100644 index 000000000000..320748c0282f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/input.js @@ -0,0 +1 @@ +[(((x)))] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json new file mode 100644 index 000000000000..ec252128aaf2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json @@ -0,0 +1,121 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "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": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x", + "extra": { + "parenthesized": true, + "parenStart": 1 + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/559/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/559/input.js new file mode 100644 index 000000000000..0a7f8682331a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/559/input.js @@ -0,0 +1 @@ +(a = 1) = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/559/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/559/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/559/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/559/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/559/output.json new file mode 100644 index 000000000000..2a57774bc903 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/559/output.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "ParenthesizedExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "AssignmentPattern", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "left": { + "type": "Identifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + }, + "identifierName": "a" + }, + "name": "a" + }, + "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 + } + } + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/560/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/560/input.js new file mode 100644 index 000000000000..93c05a981b37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/560/input.js @@ -0,0 +1 @@ +[(a = 1)] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/560/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/560/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/560/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/560/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/560/output.json new file mode 100644 index 000000000000..52e007997957 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/560/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: Invalid parenthesized assignment pattern (1:1)" + ], + "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": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentPattern", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "left": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/561/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/561/input.js new file mode 100644 index 000000000000..18b5e0796da0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/561/input.js @@ -0,0 +1 @@ +[({ a: [b = 2]})] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/561/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/561/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/561/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/561/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/561/output.json new file mode 100644 index 000000000000..6cd38c81eda0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/561/output.json @@ -0,0 +1,239 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:1)" + ], + "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": "AssignmentExpression", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "expression": { + "type": "ObjectPattern", + "start": 2, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 4, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "b" + }, + "name": "b" + }, + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + } + ] + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 20, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 21 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/562/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/562/input.js new file mode 100644 index 000000000000..2181f4c1d572 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/562/input.js @@ -0,0 +1 @@ +[{b: [([a = 1])]}] = t \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/562/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/562/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/562/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/562/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/562/output.json new file mode 100644 index 000000000000..f30a6c123cb2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/562/output.json @@ -0,0 +1,256 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "ArrayPattern", + "start": 0, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "elements": [ + { + "type": "ObjectPattern", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 2, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "ArrayPattern", + "start": 5, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 6, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "expression": { + "type": "ArrayPattern", + "start": 7, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "elements": [ + { + "type": "AssignmentPattern", + "start": 8, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "left": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "a" + }, + "name": "a" + }, + "right": { + "type": "NumericLiteral", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + } + ] + } + } + ] + } + } + ] + } + ] + }, + "right": { + "type": "Identifier", + "start": 21, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 22 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/563/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/563/input.js new file mode 100644 index 000000000000..0100e137ff7f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/563/input.js @@ -0,0 +1 @@ +[([x])] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/563/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/563/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/563/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/563/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/563/output.json new file mode 100644 index 000000000000..a3ddc206db84 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/563/output.json @@ -0,0 +1,152 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (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": "ArrayPattern", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "ArrayPattern", + "start": 2, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "Identifier", + "start": 3, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + ] + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/564/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/564/input.js new file mode 100644 index 000000000000..821f2c5a3c37 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/564/input.js @@ -0,0 +1 @@ +[(a.x)] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/564/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/564/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/564/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/564/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/564/output.json new file mode 100644 index 000000000000..689a18f8031f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/564/output.json @@ -0,0 +1,165 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ArrayPattern", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "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": "x" + }, + "name": "x" + }, + "computed": false + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 10, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/565/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/565/input.js new file mode 100644 index 000000000000..d2e8408e783a --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/565/input.js @@ -0,0 +1 @@ +[(x)] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/565/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/565/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/565/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/565/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/565/output.json new file mode 100644 index 000000000000..19de7b03868d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/565/output.json @@ -0,0 +1,132 @@ +{ + "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": "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": 0, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + }, + "expression": { + "type": "Identifier", + "start": 2, + "end": 3, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 3 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 8, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 9 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/566/input.js b/packages/babel-parser/test/fixtures/core/uncategorised/566/input.js new file mode 100644 index 000000000000..320748c0282f --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/566/input.js @@ -0,0 +1 @@ +[(((x)))] = t; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/566/options.json b/packages/babel-parser/test/fixtures/core/uncategorised/566/options.json new file mode 100644 index 000000000000..0861962d889d --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/566/options.json @@ -0,0 +1,3 @@ +{ + "createParenthesizedExpressions": true +} diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/566/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/566/output.json new file mode 100644 index 000000000000..2e4db8c547f6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/core/uncategorised/566/output.json @@ -0,0 +1,162 @@ +{ + "type": "File", + "start": 0, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "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": 0, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 13 + } + }, + "operator": "=", + "left": { + "type": "ArrayPattern", + "start": 0, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "elements": [ + { + "type": "ParenthesizedExpression", + "start": 1, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "ParenthesizedExpression", + "start": 2, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "expression": { + "type": "ParenthesizedExpression", + "start": 3, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 6 + } + }, + "expression": { + "type": "Identifier", + "start": 4, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + } + } + } + } + ] + }, + "right": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 13 + }, + "identifierName": "t" + }, + "name": "t" + } + } + } + ], + "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 7cf8d0fb9429..040069f16529 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) From 5156d3ea0664330f051faaaa64dfbea56785594d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 11 Dec 2019 11:09:13 +0100 Subject: [PATCH 862/965] Restore `@babel/parser` tests (#10854) * Make parser tests work again * Update failing fixtures * Fix serialization of BigInt * Fix --- .../core/uncategorised/369/output.json | 1 + .../core/uncategorised/374/output.json | 1 + .../core/uncategorised/556/output.json | 2 +- .../core/uncategorised/558/output.json | 2 +- .../parenthesized-lhs-array/output.json | 2 +- .../parenthesized-lhs-object/output.json | 2 +- .../es2015/uncategorised/223/output.json | 62 +++++++++---------- .../invalid-group-assignment/output.json | 1 + .../invalid-syntax/migrated_0047/output.json | 1 + .../invalid-syntax/migrated_0056/output.json | 1 + .../fixtures/estree/bigInt/basic/output.json | 5 +- .../test/helpers/runFixtureTests.js | 34 ++++++++-- 12 files changed, 72 insertions(+), 42 deletions(-) diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json index 42614106f157..ec3792255a15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -13,6 +13,7 @@ } }, "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json index f9e5df01e76a..6cbd0876600e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -13,6 +13,7 @@ } }, "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json index 448578186a0a..fe203d04bcc6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/556/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern (1:0)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json index e2a0d2a8ba52..c59930c19e03 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/558/output.json @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern (1:0)" ], "program": { "type": "Program", 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 index 111c55cd65bd..16f7d7f8e50f 100644 --- 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `([a]) = 0` use `([a] = 0)` (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", 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 index 34adca287e3e..b84a7826945b 100644 --- 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 @@ -13,7 +13,7 @@ } }, "errors": [ - "SyntaxError: You're trying to assign to a parenthesized expression, eg. instead of `({a}) = 0` use `({a} = 0)` (1:1)" + "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json index 426006b7cdfb..d5fe95dd82c4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -1,7 +1,7 @@ { "type": "File", "start": 0, - "end": 22, + "end": 20, "loc": { "start": { "line": 1, @@ -9,16 +9,16 @@ }, "end": { "line": 1, - "column": 22 + "column": 20 } }, "errors": [ - "SyntaxError: Object pattern can't contain getter or setter (1:8)" + "SyntaxError: Object pattern can't contain getter or setter (1:7)" ], "program": { "type": "Program", "start": 0, - "end": 22, + "end": 20, "loc": { "start": { "line": 1, @@ -26,7 +26,7 @@ }, "end": { "line": 1, - "column": 22 + "column": 20 } }, "sourceType": "script", @@ -35,7 +35,7 @@ { "type": "ExpressionStatement", "start": 0, - "end": 22, + "end": 20, "loc": { "start": { "line": 1, @@ -43,66 +43,66 @@ }, "end": { "line": 1, - "column": 22 + "column": 20 } }, "expression": { "type": "AssignmentExpression", - "start": 2, - "end": 20, + "start": 1, + "end": 19, "loc": { "start": { "line": 1, - "column": 2 + "column": 1 }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "operator": "=", "left": { "type": "ObjectPattern", - "start": 2, - "end": 16, + "start": 1, + "end": 15, "loc": { "start": { "line": 1, - "column": 2 + "column": 1 }, "end": { "line": 1, - "column": 16 + "column": 15 } }, "properties": [ { "type": "ObjectMethod", - "start": 4, - "end": 14, + "start": 3, + "end": 13, "loc": { "start": { "line": 1, - "column": 4 + "column": 3 }, "end": { "line": 1, - "column": 14 + "column": 13 } }, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, + "start": 7, + "end": 8, "loc": { "start": { "line": 1, - "column": 8 + "column": 7 }, "end": { "line": 1, - "column": 9 + "column": 8 }, "identifierName": "x" }, @@ -116,16 +116,16 @@ "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 14, + "start": 11, + "end": 13, "loc": { "start": { "line": 1, - "column": 12 + "column": 11 }, "end": { "line": 1, - "column": 14 + "column": 13 } }, "body": [], @@ -136,16 +136,16 @@ }, "right": { "type": "NumericLiteral", - "start": 19, - "end": 20, + "start": 18, + "end": 19, "loc": { "start": { "line": 1, - "column": 19 + "column": 18 }, "end": { "line": 1, - "column": 20 + "column": 19 } }, "extra": { 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 index a6616604e7dd..02c910998853 100644 --- 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 @@ -13,6 +13,7 @@ } }, "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { 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 index 42614106f157..ec3792255a15 100644 --- 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 @@ -13,6 +13,7 @@ } }, "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { 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 index f9e5df01e76a..6cbd0876600e 100644 --- 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 @@ -13,6 +13,7 @@ } }, "errors": [ + "SyntaxError: Invalid parenthesized assignment pattern (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json index 8723c3f23444..ca8e42197417 100644 --- a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json @@ -89,7 +89,10 @@ "column": 12 } }, - "value": "1", + "value": { + "$$ babel internal serialized type": "BigInt", + "value": "1n" + }, "raw": "1n", "bigint": "1" } diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index 288ecbb2fe0a..62efd1fb7f80 100644 --- a/packages/babel-parser/test/helpers/runFixtureTests.js +++ b/packages/babel-parser/test/helpers/runFixtureTests.js @@ -7,6 +7,8 @@ import path from "path"; const rootPath = path.join(__dirname, "../../../.."); +const serialized = "$$ babel internal serialized type"; + class FixtureError extends Error { constructor(previousError, fixturePath, code) { super(previousError.message); @@ -127,15 +129,21 @@ function overrideToJSON(cb) { const { toJSON } = obj.prototype; originalToJSONMap.set(obj, toJSON); obj.prototype.toJSON = function() { + if (typeof this === "bigint") { + return { [serialized]: "BigInt", value: serialize(this) }; + } + return this.toString(); }; } - cb(); + const result = cb(); for (const obj of notJSONparseableObj) { obj.prototype.toJSON = originalToJSONMap.get(obj); } + + return result; } function runTest(test, parseFunction) { @@ -213,8 +221,22 @@ function runTest(test, parseFunction) { } } +function serialize(value) { + if (typeof value === "bigint") { + return value.toString() + "n"; + } + return JSON.stringify(value, null, 2); +} + function ppJSON(v) { - return JSON.stringify(v, null, 2); + if (v && typeof v === "object" && v[serialized]) { + switch (v[serialized]) { + case "BigInt": + return typeof BigInt === "undefined" ? "null" : v.value; + } + } + + return serialize(v); } function addPath(str, pt) { @@ -226,12 +248,12 @@ function addPath(str, pt) { } function misMatch(exp, act) { - overrideToJSON(() => { + return overrideToJSON(() => { if ( - exp instanceof RegExp || act instanceof RegExp || - exp instanceof Error || - act instanceof Error + act instanceof Error || + typeof act === "bigint" || + (exp && typeof exp === "object" && exp[serialized]) ) { const left = ppJSON(exp); const right = ppJSON(act); From 7b54a94389f257e4d92995bb17080618a9cda9a5 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 11 Dec 2019 05:13:57 -0500 Subject: [PATCH 863/965] @babel/eslint-parser: fix ImportExpression node to match ESTree spec (#10828) * @babel/eslint-parser: fix ImportExpression node to match ESTree spec * Update caller name for @babel/core.parseSync * Move logic into estree plugin * Add estree plugin tests * Fix Flow error * Fix flow * Remove extra properties on ImportExpression node * Incorporate review feedback --- eslint/babel-eslint-parser/src/parse.js | 2 +- .../test/babel-eslint-parser.js | 6 + .../babel-parser/src/parser/expression.js | 2 +- packages/babel-parser/src/parser/lval.js | 4 +- packages/babel-parser/src/plugins/estree.js | 28 +++++ packages/babel-parser/src/types.js | 7 +- .../invalid-assignment-pattern-1/options.json | 6 +- .../invalid-assignment-pattern-2/options.json | 6 +- .../invalid-assignment-pattern-3/options.json | 6 +- .../invalid-assignment-pattern-4/options.json | 6 +- .../invalid-assignment-pattern-5/options.json | 6 +- .../test/fixtures/estree/bigInt/options.json | 5 +- .../estree/dynamic-import/basic/input.js | 1 + .../estree/dynamic-import/basic/output.json | 116 ++++++++++++++++++ .../estree/dynamic-import/options.json | 3 + 15 files changed, 174 insertions(+), 30 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/estree/dynamic-import/basic/input.js create mode 100644 packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json create mode 100644 packages/babel-parser/test/fixtures/estree/dynamic-import/options.json diff --git a/eslint/babel-eslint-parser/src/parse.js b/eslint/babel-eslint-parser/src/parse.js index 9c0a9a61d199..fc8a27abd116 100644 --- a/eslint/babel-eslint-parser/src/parse.js +++ b/eslint/babel-eslint-parser/src/parse.js @@ -34,7 +34,7 @@ export default function(code, options) { plugins: ["estree"], }, caller: { - name: "babel-eslint", + name: "@babel/eslint-parser", }, }; diff --git a/eslint/babel-eslint-parser/test/babel-eslint-parser.js b/eslint/babel-eslint-parser/test/babel-eslint-parser.js index d3aa67223b18..fb75112dc966 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint-parser.js +++ b/eslint/babel-eslint-parser/test/babel-eslint-parser.js @@ -524,5 +524,11 @@ describe("babylon-to-espree", () => { const a = 1n; `); }); + + it("Dynamic Import", () => { + parseAndAssertSame(` + const a = import('a'); + `); + }); }); }); diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 8fd00cda91fb..e844bb7f91db 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -758,7 +758,7 @@ export default class ExpressionParser extends LValParser { finishCallExpression( node: T, optional: boolean, - ): T { + ): N.Expression { if (node.callee.type === "Import") { if (node.arguments.length !== 1) { this.raise(node.start, "import() requires exactly one argument"); diff --git a/packages/babel-parser/src/parser/lval.js b/packages/babel-parser/src/parser/lval.js index 9a726a36dc2f..383b5f3edc1a 100644 --- a/packages/babel-parser/src/parser/lval.js +++ b/packages/babel-parser/src/parser/lval.js @@ -228,7 +228,7 @@ export default class LValParser extends NodeUtils { toReferencedListDeep( exprList: $ReadOnlyArray, isParenthesizedExpr?: boolean, - ): $ReadOnlyArray { + ): void { this.toReferencedList(exprList, isParenthesizedExpr); for (const expr of exprList) { @@ -236,8 +236,6 @@ export default class LValParser extends NodeUtils { this.toReferencedListDeep(expr.elements); } } - - return exprList; } // Parses spread element. diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index 9a7ae0cf5918..fc7640de1764 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -411,4 +411,32 @@ export default (superClass: Class): Class => super.toAssignableObjectExpressionProp(prop, isBinding, isLast); } } + + finishCallExpression( + node: T, + optional: boolean, + ): N.Expression { + super.finishCallExpression(node, optional); + + if (node.callee.type === "Import") { + ((node: N.Node): N.EstreeImportExpression).type = "ImportExpression"; + ((node: N.Node): N.EstreeImportExpression).source = node.arguments[0]; + delete node.arguments; + delete node.callee; + } + + return node; + } + + toReferencedListDeep( + exprList: $ReadOnlyArray, + isParenthesizedExpr?: boolean, + ): void { + // ImportExpressions do not have an arguments array. + if (!exprList) { + return; + } + + super.toReferencedListDeep(exprList, isParenthesizedExpr); + } }; diff --git a/packages/babel-parser/src/types.js b/packages/babel-parser/src/types.js index 71e83d142958..597b2f5d674c 100644 --- a/packages/babel-parser/src/types.js +++ b/packages/babel-parser/src/types.js @@ -1013,7 +1013,7 @@ export type FlowInterfaceType = NodeBase & { body: FlowObjectTypeAnnotation, }; -// estree +// ESTree export type EstreeProperty = NodeBase & { type: "Property", @@ -1039,6 +1039,11 @@ export type EstreeMethodDefinition = NodeBase & { variance?: ?FlowVariance, }; +export type EstreeImportExpression = NodeBase & { + type: "ImportExpression", + source: Expression, +}; + // === === === === // TypeScript // === === === === diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json index 5a02a61446d2..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-1/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json index 5a02a61446d2..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-2/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json index 5a02a61446d2..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-3/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json index 5a02a61446d2..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-4/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json index 5a02a61446d2..070d941a7562 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-assignment-pattern-5/options.json @@ -1,5 +1,3 @@ { - "plugins": [ - "estree" - ] -} \ No newline at end of file + "plugins": ["estree"] +} diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/options.json b/packages/babel-parser/test/fixtures/estree/bigInt/options.json index da7e9e174f39..0df9db5c35e7 100644 --- a/packages/babel-parser/test/fixtures/estree/bigInt/options.json +++ b/packages/babel-parser/test/fixtures/estree/bigInt/options.json @@ -1,6 +1,3 @@ { - "plugins": [ - "estree", - "bigInt" - ] + "plugins": ["estree", "bigInt"] } diff --git a/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/input.js b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/input.js new file mode 100644 index 000000000000..7fc63cc0957a --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/input.js @@ -0,0 +1 @@ +const a = import("a"); diff --git a/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json new file mode 100644 index 000000000000..be4caee8d685 --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 22, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 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": 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": "a" + }, + "name": "a" + }, + "init": { + "type": "ImportExpression", + "start": 10, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "source": { + "type": "Literal", + "start": 17, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "value": "a", + "raw": "\"a\"" + } + } + } + ], + "kind": "const" + } + ] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/estree/dynamic-import/options.json b/packages/babel-parser/test/fixtures/estree/dynamic-import/options.json new file mode 100644 index 000000000000..9e48801bb9eb --- /dev/null +++ b/packages/babel-parser/test/fixtures/estree/dynamic-import/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["estree", "dynamicImport"] +} From 25f7e6808e56f4b5de07dd32f1e85ec21b1db951 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Wed, 11 Dec 2019 18:06:37 -0500 Subject: [PATCH 864/965] @babel/eslint-parser: refactor configuration logic (#10860) --- .../babel-eslint-parser/src/configuration.js | 61 +++++++++++++++++++ eslint/babel-eslint-parser/src/index.js | 9 +-- eslint/babel-eslint-parser/src/parse.js | 58 ++---------------- .../test/non-regression.js | 2 +- 4 files changed, 69 insertions(+), 61 deletions(-) create mode 100644 eslint/babel-eslint-parser/src/configuration.js diff --git a/eslint/babel-eslint-parser/src/configuration.js b/eslint/babel-eslint-parser/src/configuration.js new file mode 100644 index 000000000000..e6d036372f12 --- /dev/null +++ b/eslint/babel-eslint-parser/src/configuration.js @@ -0,0 +1,61 @@ +import { loadPartialConfig } from "@babel/core"; + +export function normalizeESLintConfig(options) { + const defaultOptions = { + babelOptions: {}, + ecmaVersion: 2020, + sourceType: "module", + allowImportExportEverywhere: false, + }; + + return Object.assign(defaultOptions, options); +} + +export function normalizeBabelParseConfig(options) { + const parseOptions = { + sourceType: options.sourceType, + filename: options.filePath, + cwd: options.babelOptions.cwd, + root: options.babelOptions.root, + rootMode: options.babelOptions.rootMode, + envName: options.babelOptions.envName, + configFile: options.babelOptions.configFile, + babelrc: options.babelOptions.babelrc, + babelrcRoots: options.babelOptions.babelrcRoots, + extends: options.babelOptions.extends, + env: options.babelOptions.env, + overrides: options.babelOptions.overrides, + test: options.babelOptions.test, + include: options.babelOptions.include, + exclude: options.babelOptions.exclude, + ignore: options.babelOptions.ignore, + only: options.babelOptions.only, + parserOpts: { + allowImportExportEverywhere: options.allowImportExportEverywhere, + allowReturnOutsideFunction: true, + allowSuperOutsideMethod: true, + ranges: true, + tokens: true, + plugins: ["estree"], + }, + caller: { + name: "@babel/eslint-parser", + }, + }; + + if (options.requireConfigFile !== false) { + const config = loadPartialConfig(parseOptions); + + if (config !== null) { + if (!config.hasFilesystemConfig()) { + throw new Error( + `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`, + ); + } + + return config.options; + } + } + + return parseOptions; +} diff --git a/eslint/babel-eslint-parser/src/index.js b/eslint/babel-eslint-parser/src/index.js index cbb9f65abd71..4709fd4aa8d5 100644 --- a/eslint/babel-eslint-parser/src/index.js +++ b/eslint/babel-eslint-parser/src/index.js @@ -1,6 +1,7 @@ import semver from "semver"; import { version as CURRENT_BABEL_VERSION } from "@babel/core"; import parseWithScope from "./parse-with-scope"; +import { normalizeESLintConfig } from "./configuration"; import packageJson from "../package.json"; const SUPPORTED_BABEL_VERSION_RANGE = @@ -21,11 +22,5 @@ export function parseForESLint(code, options = {}) { ); } - options.babelOptions = options.babelOptions || {}; - options.ecmaVersion = options.ecmaVersion || 2018; - options.sourceType = options.sourceType || "module"; - options.allowImportExportEverywhere = - options.allowImportExportEverywhere || false; - - return parseWithScope(code, options); + return parseWithScope(code, normalizeESLintConfig(options)); } diff --git a/eslint/babel-eslint-parser/src/parse.js b/eslint/babel-eslint-parser/src/parse.js index fc8a27abd116..e38e9a94fe68 100644 --- a/eslint/babel-eslint-parser/src/parse.js +++ b/eslint/babel-eslint-parser/src/parse.js @@ -1,61 +1,13 @@ +import { parseSync as babelParse, tokTypes as tt, traverse } from "@babel/core"; import babylonToEspree from "./babylon-to-espree"; -import { - parseSync as parse, - tokTypes as tt, - traverse, - loadPartialConfig, -} from "@babel/core"; - -export default function(code, options) { - let opts = { - sourceType: options.sourceType, - filename: options.filePath, - cwd: options.babelOptions.cwd, - root: options.babelOptions.root, - rootMode: options.babelOptions.rootMode, - envName: options.babelOptions.envName, - configFile: options.babelOptions.configFile, - babelrc: options.babelOptions.babelrc, - babelrcRoots: options.babelOptions.babelrcRoots, - extends: options.babelOptions.extends, - env: options.babelOptions.env, - overrides: options.babelOptions.overrides, - test: options.babelOptions.test, - include: options.babelOptions.include, - exclude: options.babelOptions.exclude, - ignore: options.babelOptions.ignore, - only: options.babelOptions.only, - parserOpts: { - allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree - allowReturnOutsideFunction: true, - allowSuperOutsideMethod: true, - ranges: true, - tokens: true, - plugins: ["estree"], - }, - caller: { - name: "@babel/eslint-parser", - }, - }; - - if (options.requireConfigFile !== false) { - const config = loadPartialConfig(opts); - - if (config !== null) { - if (!config.hasFilesystemConfig()) { - throw new Error( - `No Babel config file detected for ${config.options.filename}. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.`, - ); - } - - opts = config.options; - } - } +import { normalizeBabelParseConfig } from "./configuration"; +export default function parse(code, options) { + const parseOptions = normalizeBabelParseConfig(options); let ast; try { - ast = parse(code, opts); + ast = babelParse(code, parseOptions); } catch (err) { if (err instanceof SyntaxError) { err.lineNumber = err.loc.line; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 63aadea4b33a..dca0b489d9ec 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1614,7 +1614,7 @@ describe("verify", () => { "var leakedGlobal = 1;", { "no-implicit-globals": 1 }, [], - null, + undefined, { env: {}, parserOptions: { ecmaVersion: 6 }, From 0b3f883ed19b4958449f3dbf0f6104b4eeda570b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 12 Dec 2019 10:20:03 +0100 Subject: [PATCH 865/965] Properly serialize non-json values in parser tests (#10858) --- .../fixtures/estree/bigInt/basic/output.json | 2 +- .../estree/literal/regexp/output.json | 6 +- .../test/helpers/runFixtureTests.js | 139 ++++++++---------- 3 files changed, 68 insertions(+), 79 deletions(-) diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json index ca8e42197417..eebbaebd1306 100644 --- a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json @@ -91,7 +91,7 @@ }, "value": { "$$ babel internal serialized type": "BigInt", - "value": "1n" + "value": "1" }, "raw": "1n", "bigint": "1" diff --git a/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json b/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json index cfdf13c59ac9..fccddbd97a80 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json @@ -89,7 +89,11 @@ "column": 13 } }, - "value": "/.*/i", + "value": { + "$$ babel internal serialized type": "RegExp", + "source": ".*", + "flags": "i" + }, "raw": "/.*/i", "regex": { "pattern": ".*", diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index 62efd1fb7f80..0c93f7a7521d 100644 --- a/packages/babel-parser/test/helpers/runFixtureTests.js +++ b/packages/babel-parser/test/helpers/runFixtureTests.js @@ -111,41 +111,12 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) { } function save(test, ast) { - overrideToJSON(() => - fs.writeFileSync(test.expect.loc, JSON.stringify(ast, null, 2)), + fs.writeFileSync( + test.expect.loc, + JSON.stringify(ast, (k, v) => serialize(v), 2), ); } -// Ensure that RegExp, BigInt, and Errors are serialized as strings -function overrideToJSON(cb) { - const originalToJSONMap = new Map(); - const notJSONparseableObj = [RegExp, Error]; - - if (typeof BigInt !== "undefined") { - notJSONparseableObj.push(BigInt); - } - - for (const obj of notJSONparseableObj) { - const { toJSON } = obj.prototype; - originalToJSONMap.set(obj, toJSON); - obj.prototype.toJSON = function() { - if (typeof this === "bigint") { - return { [serialized]: "BigInt", value: serialize(this) }; - } - - return this.toString(); - }; - } - - const result = cb(); - - for (const obj of notJSONparseableObj) { - obj.prototype.toJSON = originalToJSONMap.get(obj); - } - - return result; -} - function runTest(test, parseFunction) { const opts = test.options; @@ -223,20 +194,41 @@ function runTest(test, parseFunction) { function serialize(value) { if (typeof value === "bigint") { - return value.toString() + "n"; + return { + [serialized]: "BigInt", + value: value.toString(), + }; + } else if (value instanceof RegExp) { + return { + [serialized]: "RegExp", + source: value.source, + flags: value.flags, + }; + } else if (value instanceof Error) { + // Errors are serialized to a simple string, because are used frequently + return value.toString(); } - return JSON.stringify(value, null, 2); + return value; } function ppJSON(v) { + if (typeof v === "bigint" || v instanceof Error || v instanceof RegExp) { + return ppJSON(serialize(v)); + } + if (v && typeof v === "object" && v[serialized]) { switch (v[serialized]) { case "BigInt": - return typeof BigInt === "undefined" ? "null" : v.value; + return typeof BigInt === "undefined" ? "null" : v.value + "n"; + case "RegExp": + return `/${v.source}/${v.flags}`; } + } else if (typeof v === "string" && /^[A-Z][a-z]+Error: /.test(v)) { + // Errors are serialized to a simple string, because are used frequently + return v; } - return serialize(v); + return JSON.stringify(v, (k, v) => serialize(v), 2); } function addPath(str, pt) { @@ -248,49 +240,42 @@ function addPath(str, pt) { } function misMatch(exp, act) { - return overrideToJSON(() => { - if ( - act instanceof RegExp || - act instanceof Error || - typeof act === "bigint" || - (exp && typeof exp === "object" && exp[serialized]) - ) { - const left = ppJSON(exp); - const right = ppJSON(act); - if (left !== right) return left + " !== " + right; - } else if (Array.isArray(exp)) { - if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); - if (act.length != exp.length) { - return "array length mismatch " + exp.length + " != " + act.length; - } - for (let i = 0; i < act.length; ++i) { - const mis = misMatch(exp[i], act[i]); - if (mis) return addPath(mis, i); - } - } else if ( - !exp || - !act || - typeof exp != "object" || - typeof act != "object" - ) { - if (exp !== act && typeof exp != "function") { - return ppJSON(exp) + " !== " + ppJSON(act); - } - } else { - for (const prop of Object.keys(exp)) { - const mis = misMatch(exp[prop], act[prop]); - if (mis) return addPath(mis, prop); - } + if ( + act instanceof RegExp || + act instanceof Error || + typeof act === "bigint" || + (exp && typeof exp === "object" && exp[serialized]) + ) { + const left = ppJSON(exp); + const right = ppJSON(act); + if (left !== right) return left + " !== " + right; + } else if (Array.isArray(exp)) { + if (!Array.isArray(act)) return ppJSON(exp) + " != " + ppJSON(act); + if (act.length != exp.length) { + return "array length mismatch " + exp.length + " != " + act.length; + } + for (let i = 0; i < act.length; ++i) { + const mis = misMatch(exp[i], act[i]); + if (mis) return addPath(mis, i); + } + } else if (!exp || !act || typeof exp != "object" || typeof act != "object") { + if (exp !== act && typeof exp != "function") { + return ppJSON(exp) + " !== " + ppJSON(act); + } + } else { + for (const prop of Object.keys(exp)) { + const mis = misMatch(exp[prop], act[prop]); + if (mis) return addPath(mis, prop); + } - for (const prop of Object.keys(act)) { - if (typeof act[prop] === "function") { - continue; - } + for (const prop of Object.keys(act)) { + if (typeof act[prop] === "function") { + continue; + } - if (!(prop in exp) && act[prop] !== undefined) { - return `Did not expect a property '${prop}'`; - } + if (!(prop in exp) && act[prop] !== undefined) { + return `Did not expect a property '${prop}'`; } } - }); + } } From bffa415b83e7cef21cb43b05cc05fc93cf0ac782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 13 Dec 2019 08:39:37 -0500 Subject: [PATCH 866/965] Check shadow variable to identifier in default parameters (#10053) When there is a variable declaration inside the function body, which shares its name to a referenced identifier in default parameter expression, the function body should be wrapped into iife, otherwise the binding in default parameter scope will be shadowed by function body. --- .../babel-plugin-transform-parameters/src/params.js | 6 +++++- .../fixtures/parameters/default-iife-9947/input.js | 6 ++++++ .../fixtures/parameters/default-iife-9947/output.js | 13 +++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/input.js create mode 100644 packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/output.js diff --git a/packages/babel-plugin-transform-parameters/src/params.js b/packages/babel-plugin-transform-parameters/src/params.js index 000a8505a581..4bf346b5be7b 100644 --- a/packages/babel-plugin-transform-parameters/src/params.js +++ b/packages/babel-plugin-transform-parameters/src/params.js @@ -32,7 +32,11 @@ function isSafeBinding(scope, node) { const iifeVisitor = { ReferencedIdentifier(path, state) { const { scope, node } = path; - if (node.name === "eval" || !isSafeBinding(scope, node)) { + if ( + node.name === "eval" || + !isSafeBinding(scope, node) || + !isSafeBinding(state.scope, node) + ) { state.iife = true; path.stop(); } diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/input.js b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/input.js new file mode 100644 index 000000000000..e2ca36c7ddb2 --- /dev/null +++ b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/input.js @@ -0,0 +1,6 @@ +let x = "outside"; +function outer(a = () => x) { + let x = "inside"; + return a(); +} +outer(); diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/output.js b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/output.js new file mode 100644 index 000000000000..74ff50c2df94 --- /dev/null +++ b/packages/babel-plugin-transform-parameters/test/fixtures/parameters/default-iife-9947/output.js @@ -0,0 +1,13 @@ +var x = "outside"; + +function outer() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () { + return x; + }; + return function () { + var x = "inside"; + return a(); + }(); +} + +outer(); From a0d76a8c0e05129c8ddaa94d10fd71a52fc1de57 Mon Sep 17 00:00:00 2001 From: Aziz Khambati Date: Mon, 16 Dec 2019 20:25:08 +0530 Subject: [PATCH 867/965] Fix pragmaFrag spelling in error message (#10868) --- packages/babel-plugin-transform-react-jsx/src/index.js | 2 +- .../options.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-transform-react-jsx/src/index.js b/packages/babel-plugin-transform-react-jsx/src/index.js index 778e5f960b7a..a655b30b6972 100644 --- a/packages/babel-plugin-transform-react-jsx/src/index.js +++ b/packages/babel-plugin-transform-react-jsx/src/index.js @@ -80,7 +80,7 @@ export default declare((api, options) => { ) { throw new Error( "transform-react-jsx: pragma has been set but " + - "pragmafrag has not been set", + "pragmaFrag has not been set", ); } }, diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/throw-if-pragma-set-but-not-pragmafrag-and-frag-used/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/throw-if-pragma-set-but-not-pragmafrag-and-frag-used/options.json index b89035fd105e..1bfb659b3c98 100644 --- a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/throw-if-pragma-set-but-not-pragmafrag-and-frag-used/options.json +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/throw-if-pragma-set-but-not-pragmafrag-and-frag-used/options.json @@ -1,3 +1,3 @@ { - "throws": "transform-react-jsx: pragma has been set but pragmafrag has not been set" + "throws": "transform-react-jsx: pragma has been set but pragmaFrag has not been set" } From 0e9c49606af2425dbf71f77f5f1d22e89c542960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 16 Dec 2019 16:10:29 -0500 Subject: [PATCH 868/965] chore: update babel-eslint to 11.0.0-beta.2 (#10870) --- package.json | 5 ++--- yarn.lock | 16 ++++++++-------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 545835a1a216..078257f7828d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@babel/runtime": "^7.7.2", "@rollup/plugin-alias": "^2.2.0", "@rollup/plugin-json": "^4.0.0", - "babel-eslint": "^11.0.0-beta.1", + "babel-eslint": "^11.0.0-beta.2", "babel-jest": "^24.9.0", "babel-plugin-transform-charcodes": "^0.2.0", "browserify": "^16.2.3", @@ -78,8 +78,7 @@ "typescript": "^3.6.3" }, "resolutions": { - "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates", - "eslint-scope": "^5.0.0" + "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates" }, "engines": { "node": ">= 6.9.0 < 14.0.0", diff --git a/yarn.lock b/yarn.lock index 55268a2a014a..75ea480ede86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2467,13 +2467,13 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.9.0.tgz#24390e6ad61386b0a747265754d2a17219de862c" integrity sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A== -babel-eslint@^11.0.0-beta.1: - version "11.0.0-beta.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-11.0.0-beta.1.tgz#1762faffeaee26877761b9a19af43cef679999a4" - integrity sha512-4xDIJZUn6RDNfSfKmrywNT+e37srxxPP+GdciWakL5U36fde3/K7Y/X8XyEquXGQz02tPvzRuF6SNrR61uZ+fA== +babel-eslint@^11.0.0-beta.2: + version "11.0.0-beta.2" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-11.0.0-beta.2.tgz#de1f06795aa0d8cedcf6ac943e63056f5b4a7048" + integrity sha512-D2tunrOu04XloEdU2XVUminUu25FILlGruZmffqH5OSnLDhCheKNvUoM1ihrexdUvhizlix8bjqRnsss4V/UIQ== dependencies: - eslint-scope "3.7.1" - eslint-visitor-keys "^1.0.0" + eslint-scope "5.0.0" + eslint-visitor-keys "^1.1.0" semver "^6.3.0" babel-jest@^24.9.0: @@ -4231,7 +4231,7 @@ eslint-plugin-prettier@^3.1.0: dependencies: prettier-linter-helpers "^1.0.0" -eslint-scope@3.7.1, eslint-scope@^5.0.0: +eslint-scope@5.0.0, eslint-scope@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== @@ -4246,7 +4246,7 @@ eslint-utils@^1.4.3: dependencies: eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== From 4f77a5aaadc98570e5d96acbf4a3992e01cc0bb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 16 Dec 2019 22:13:23 +0100 Subject: [PATCH 869/965] e2e test: create-react-app (#10704) * e2e test: create-react-app * Fix * Fix * Fix * Fix --- .circleci/config.yml | 11 +++++++ .../integration-tests/e2e-create-react-app.sh | 33 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 scripts/integration-tests/e2e-create-react-app.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 9c953f6d67fa..815244ed2edf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -146,6 +146,14 @@ jobs: at: /tmp/verdaccio-workspace - run: ./scripts/integration-tests/e2e-babel.sh + e2e-create-react-app: + executor: node-executor + steps: + - checkout + - attach_workspace: + at: /tmp/verdaccio-workspace + - run: ./scripts/integration-tests/e2e-create-react-app.sh + workflows: version: 2 test: @@ -179,3 +187,6 @@ workflows: - e2e-babel: requires: - publish-verdaccio + - e2e-create-react-app: + requires: + - publish-verdaccio diff --git a/scripts/integration-tests/e2e-create-react-app.sh b/scripts/integration-tests/e2e-create-react-app.sh new file mode 100755 index 000000000000..e589ec12fe41 --- /dev/null +++ b/scripts/integration-tests/e2e-create-react-app.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#==============================================================================# +# SETUP # +#==============================================================================# + +# Start in scripts/integration-tests/ even if run from root directory +cd "$(dirname "$0")" + +source utils/local-registry.sh +source utils/cleanup.sh + +# Echo every command being executed +set -x + +# Clone create-react-app +git clone https://github.com/facebook/create-react-app.git tmp/create-react-app +cd tmp/create-react-app + +#==============================================================================# +# TEST # +#==============================================================================# + +startLocalRegistry "$PWD"/../../verdaccio-config.yml +yarn install +# "yarn upgrade --scope @babel --latest" doesn't seem to work. +# a means "all", while \n is the enter needed to confirm the selection. +echo "a\n" | yarn upgrade-interactive --scope @babel --latest + +# Test +CI=true yarn test + +cleanup From c35ba3d3abd0b915849be13fc682934c54f41599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 17 Dec 2019 14:36:09 -0500 Subject: [PATCH 870/965] chore: add PR Intent checkbox [ci-skip] (#10880) * chore: add PR Intent checkbox * chore: rephrase [ci-skip] --- .github/ISSUE_TEMPLATE/Bug_report.md | 5 ++++- .github/ISSUE_TEMPLATE/Feature_request.md | 3 +++ .github/ISSUE_TEMPLATE/Regression-v7.md | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index f182520ff80a..63e446c69272 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -9,6 +9,9 @@ assignees: '' ## Bug Report + +- [ ] I would like to work on a fix! + + **Additional context/Screenshots** Add any other context about the problem here. If applicable, add screenshots to help explain. diff --git a/.github/ISSUE_TEMPLATE/Feature_request.md b/.github/ISSUE_TEMPLATE/Feature_request.md index b9c82542ff8c..dd65864dce47 100644 --- a/.github/ISSUE_TEMPLATE/Feature_request.md +++ b/.github/ISSUE_TEMPLATE/Feature_request.md @@ -9,6 +9,9 @@ assignees: '' ## Feature Request + +- [ ] I would like to work on this feature! + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I have an issue when [...] diff --git a/.github/ISSUE_TEMPLATE/Regression-v7.md b/.github/ISSUE_TEMPLATE/Regression-v7.md index b001290cf317..e2d524c4aac7 100644 --- a/.github/ISSUE_TEMPLATE/Regression-v7.md +++ b/.github/ISSUE_TEMPLATE/Regression-v7.md @@ -10,6 +10,9 @@ assignees: '' # v7 Regression + +- [ ] I would like to work on a fix! + > First check out: https://babeljs.io/docs/en/v7-migration > Also a partial upgrade tool: https://github.com/babel/babel-upgrade From ff8a295ea784f3f843aa0b74f613be91ded4b2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 17 Dec 2019 22:12:10 -0500 Subject: [PATCH 871/965] chore: download compat-table when build-data is run (#10873) --- packages/babel-preset-env/.gitignore | 1 + packages/babel-preset-env/.npmignore | 1 + packages/babel-preset-env/CONTRIBUTING.md | 4 ++-- packages/babel-preset-env/package.json | 3 +-- packages/babel-preset-env/scripts/build-data.js | 4 ++-- .../babel-preset-env/scripts/download-compat-table.sh | 8 ++++++++ 6 files changed, 15 insertions(+), 6 deletions(-) create mode 100755 packages/babel-preset-env/scripts/download-compat-table.sh diff --git a/packages/babel-preset-env/.gitignore b/packages/babel-preset-env/.gitignore index b8733fbb9848..8f638248faad 100644 --- a/packages/babel-preset-env/.gitignore +++ b/packages/babel-preset-env/.gitignore @@ -8,3 +8,4 @@ test/tmp .nyc_output tmp babel-preset-env-*.tgz +/build diff --git a/packages/babel-preset-env/.npmignore b/packages/babel-preset-env/.npmignore index 40425577dea0..e843712b4ea6 100644 --- a/packages/babel-preset-env/.npmignore +++ b/packages/babel-preset-env/.npmignore @@ -15,3 +15,4 @@ babel-preset-env-*.tgz flow-typed .github .idea +/build diff --git a/packages/babel-preset-env/CONTRIBUTING.md b/packages/babel-preset-env/CONTRIBUTING.md index de861d996e6d..cd91f35148f6 100644 --- a/packages/babel-preset-env/CONTRIBUTING.md +++ b/packages/babel-preset-env/CONTRIBUTING.md @@ -63,9 +63,9 @@ If you want to mark a new proposal as shipped, add it to [this list](https://git ### Update [`plugins.json`](https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugins.json) -Until `compat-table` is a standalone npm module for data we are using the git url +Until `compat-table` is a standalone npm module for data we are using the git commit in `scripts/download-compat-table.sh` -`"compat-table": "kangax/compat-table#[latest-commit-hash]"`, +`COMPAT_TABLE_COMMIT=[latest-commit-hash]`, So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same. diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 58e1caaf0c1c..15a72e4cb3e3 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -11,7 +11,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env", "main": "lib/index.js", "scripts": { - "build-data": "node ./scripts/build-data.js; node ./scripts/build-modules-support.js" + "build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js" }, "dependencies": { "@babel/helper-module-imports": "^7.7.4", @@ -76,7 +76,6 @@ "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "caniuse-db": "1.0.30000969", - "compat-table": "kangax/compat-table#4195aca631ad904cb0efeb62a9c2d8c8511706f8", "electron-to-chromium": "1.3.113" } } diff --git a/packages/babel-preset-env/scripts/build-data.js b/packages/babel-preset-env/scripts/build-data.js index d4502ddaa91f..e8bb4b1db54f 100644 --- a/packages/babel-preset-env/scripts/build-data.js +++ b/packages/babel-preset-env/scripts/build-data.js @@ -46,7 +46,7 @@ const renameTests = (tests, getName, category) => // environments (node4 and chrome45), as well as familial relationships (edge // and ie11) can be handled properly. -const envs = require("compat-table/environments"); +const envs = require("../build/compat-table/environments"); const byTestSuite = suite => browser => { return Array.isArray(browser.test_suites) @@ -56,7 +56,7 @@ const byTestSuite = suite => browser => { const compatSources = ["es5", "es6", "es2016plus", "esnext"].reduce( (result, source) => { - const data = require(`compat-table/data-${source}`); + const data = require(`../build/compat-table/data-${source}`); data.browsers = pickBy(envs, byTestSuite(source)); result.push(data); return result; diff --git a/packages/babel-preset-env/scripts/download-compat-table.sh b/packages/babel-preset-env/scripts/download-compat-table.sh new file mode 100755 index 000000000000..fd67e9d6d3ff --- /dev/null +++ b/packages/babel-preset-env/scripts/download-compat-table.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +COMPAT_TABLE_COMMIT=4195aca631ad904cb0efeb62a9c2d8c8511706f8 +rm -rf build/compat-table +mkdir -p build +git clone --branch=gh-pages --single-branch --shallow-since=2019-11-14 https://github.com/kangax/compat-table.git build/compat-table +cd build/compat-table && git checkout -qf $COMPAT_TABLE_COMMIT From b3c7df93140b315b131b08920d95eb8c7b57dfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 17 Dec 2019 22:12:55 -0500 Subject: [PATCH 872/965] fix: avoid string copy when processing input source-map (#10885) Co-Authored-By: Justin Ridgewell --- .../src/transformation/normalize-file.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index cc7db60a5478..4bae84306843 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -1,5 +1,6 @@ // @flow +import fs from "fs"; import path from "path"; import buildDebug from "debug"; import cloneDeep from "lodash/cloneDeep"; @@ -64,10 +65,13 @@ export default function normalizeFile( const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); if (typeof options.filename === "string" && lastComment) { try { - inputMap = convertSourceMap.fromMapFileComment( - // fromMapFileComment requires the whole comment block - `//${lastComment}`, - path.dirname(options.filename), + const inputMapFilename = EXTERNAL_SOURCEMAP_REGEX.exec( + lastComment, + )[1]; + inputMap = convertSourceMap.fromJSON( + fs.readFileSync( + path.resolve(path.dirname(options.filename), inputMapFilename), + ), ); } catch (err) { debug("discarding unknown file input sourcemap", err); @@ -157,7 +161,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) { From 2b3590929b4eb955b0e8b287f9749b5af66cc1a0 Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Wed, 18 Dec 2019 04:39:36 +0100 Subject: [PATCH 873/965] Prevent ignored files in out dir (#10831) Co-Authored-By: Brian Ng --- packages/babel-cli/src/babel/dir.js | 12 ++++++++++-- packages/babel-cli/src/babel/options.js | 6 ++++++ .../out-files/lib/foo/.foo.js | 1 - .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src}/foo/bar.js | 0 .../in-files/src}/index.js | 0 .../options.json | 12 ++++++++++++ .../out-files/lib/README.md | 0 .../out-files/lib/foo/bar.js} | 0 .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../--copy-files with only/out-files/lib/index.js | 1 - 13 files changed, 33 insertions(+), 4 deletions(-) delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md rename packages/babel-cli/test/fixtures/babel/{--copy-files with ignore/out-files/lib => --copy-files with ignore with includeIgnored/in-files/src}/foo/bar.js (100%) rename packages/babel-cli/test/fixtures/babel/{--copy-files --include-dotfiles with only/out-files/lib => --copy-files with ignore with includeIgnored/in-files/src}/index.js (100%) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md rename packages/babel-cli/test/fixtures/babel/{--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js => --copy-files with ignore with includeIgnored/out-files/lib/foo/bar.js} (100%) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index 234eb7c8f60b..62ad36ba5832 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -84,8 +84,16 @@ export default async function({ async function handleFile(src: string, base: string): Promise { const written = await write(src, base); - - if (!written && cliOptions.copyFiles) { + const relative = path.relative(base, src); + const isCompilableExtension = util.isCompilableExtension( + relative, + cliOptions.extensions, + ); + if ( + !written && + ((!isCompilableExtension && cliOptions.copyFiles) || + cliOptions.includeIgnored) + ) { const filename = path.relative(base, src); const dest = getDest(filename, base); outputFileSync(dest, fs.readFileSync(src)); diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index fa09d6b64ed3..45590ae9341e 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -161,6 +161,11 @@ commander.option( "Delete the out directory before compilation.", ); +commander.option( + "--include-ignored", + "Include ignored files when copying non-compilable files.", +); + commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); // register an empty action handler so that commander.js can throw on @@ -304,6 +309,7 @@ export default function parseArgv(args: Array): CmdOptions | null { quiet: opts.quiet, deleteDirOnStart: opts.deleteDirOnStart, sourceMapTarget: opts.sourceMapTarget, + includeIgnored: opts.includeIgnored, }, }; } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js deleted file mode 100644 index 31142aabfe70..000000000000 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js +++ /dev/null @@ -1 +0,0 @@ -a; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json new file mode 100644 index 000000000000..36b8f50db7b2 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json @@ -0,0 +1,12 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--ignore", + "src/foo/*", + "--include-ignored", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/foo/bar.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/foo/bar.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js new file mode 100644 index 000000000000..cb5e86b12ef3 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; \ No newline at end of file diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js deleted file mode 100644 index c6788558edcb..000000000000 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js +++ /dev/null @@ -1 +0,0 @@ -index; From 3d7bc435d51740ed4aac3ee59a5539e2c049b890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 18 Dec 2019 06:31:26 +0100 Subject: [PATCH 874/965] Allow -r from node_modules with @babel/node (#10871) --- packages/babel-node/package.json | 1 + packages/babel-node/src/_babel-node.js | 9 ++++----- .../test/fixtures/babel-node/--require/in-files/dep.js | 1 + .../test/fixtures/babel-node/--require/in-files/foo.js | 1 + .../test/fixtures/babel-node/--require/options.json | 3 +++ .../test/fixtures/babel-node/--require/stdout.txt | 2 ++ .../babel-node/--require_node_modules/in-files/foo.js | 1 + .../--require_node_modules/in-files/node_modules/dep.js | 1 + .../babel-node/--require_node_modules/options.json | 3 +++ .../babel-node/--require_node_modules/stdout.txt | 2 ++ 10 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 packages/babel-node/test/fixtures/babel-node/--require/in-files/dep.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--require/in-files/foo.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--require/options.json create mode 100644 packages/babel-node/test/fixtures/babel-node/--require/stdout.txt create mode 100644 packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/foo.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/node_modules/dep.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--require_node_modules/options.json create mode 100644 packages/babel-node/test/fixtures/babel-node/--require_node_modules/stdout.txt diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 9813bd1a5e5a..8559a260d3f7 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -25,6 +25,7 @@ "lodash": "^4.17.13", "node-environment-flags": "^1.0.5", "regenerator-runtime": "^0.13.3", + "resolve": "^1.13.1", "v8flags": "^3.1.1" }, "peerDependencies": { diff --git a/packages/babel-node/src/_babel-node.js b/packages/babel-node/src/_babel-node.js index 6f39bb638529..8e09639a5dd7 100644 --- a/packages/babel-node/src/_babel-node.js +++ b/packages/babel-node/src/_babel-node.js @@ -8,6 +8,7 @@ import vm from "vm"; import "core-js/stable"; import "regenerator-runtime/runtime"; import register from "@babel/register"; +import resolve from "resolve"; import pkg from "../package.json"; @@ -188,11 +189,9 @@ if (program.eval || program.print) { // We have to handle require ourselves, as we want to require it in the context of babel-register if (program.require) { - let requireFileName = program.require; - if (!path.isAbsolute(requireFileName)) { - requireFileName = path.join(process.cwd(), requireFileName); - } - require(requireFileName); + require(resolve.sync(program.require, { + basedir: process.cwd(), + })); } // make the filename absolute diff --git a/packages/babel-node/test/fixtures/babel-node/--require/in-files/dep.js b/packages/babel-node/test/fixtures/babel-node/--require/in-files/dep.js new file mode 100644 index 000000000000..16f81e8b7061 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require/in-files/dep.js @@ -0,0 +1 @@ +console.log("dep"); \ No newline at end of file diff --git a/packages/babel-node/test/fixtures/babel-node/--require/in-files/foo.js b/packages/babel-node/test/fixtures/babel-node/--require/in-files/foo.js new file mode 100644 index 000000000000..85ce559e8f22 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require/in-files/foo.js @@ -0,0 +1 @@ +console.log("foo"); diff --git a/packages/babel-node/test/fixtures/babel-node/--require/options.json b/packages/babel-node/test/fixtures/babel-node/--require/options.json new file mode 100644 index 000000000000..1384a0394841 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require/options.json @@ -0,0 +1,3 @@ +{ + "args": ["foo", "-r", "./dep"] +} diff --git a/packages/babel-node/test/fixtures/babel-node/--require/stdout.txt b/packages/babel-node/test/fixtures/babel-node/--require/stdout.txt new file mode 100644 index 000000000000..4718ef0fa726 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require/stdout.txt @@ -0,0 +1,2 @@ +dep +foo diff --git a/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/foo.js b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/foo.js new file mode 100644 index 000000000000..85ce559e8f22 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/foo.js @@ -0,0 +1 @@ +console.log("foo"); diff --git a/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/node_modules/dep.js b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/node_modules/dep.js new file mode 100644 index 000000000000..16f81e8b7061 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/in-files/node_modules/dep.js @@ -0,0 +1 @@ +console.log("dep"); \ No newline at end of file diff --git a/packages/babel-node/test/fixtures/babel-node/--require_node_modules/options.json b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/options.json new file mode 100644 index 000000000000..473c909f3949 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/options.json @@ -0,0 +1,3 @@ +{ + "args": ["foo", "-r", "dep"] +} diff --git a/packages/babel-node/test/fixtures/babel-node/--require_node_modules/stdout.txt b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/stdout.txt new file mode 100644 index 000000000000..4718ef0fa726 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--require_node_modules/stdout.txt @@ -0,0 +1,2 @@ +dep +foo From 8afeef2d960ccba162ba82b10328bb2e9c8091f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 18 Dec 2019 00:32:05 -0500 Subject: [PATCH 875/965] chore: cache chocolatey install temp (#10874) --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 092a03c33665..cfa5354434b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,10 @@ matrix: - JOB=test # https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288/9 - YARN_GPG=no + cache: + yarn: true + directories: + - $HOME/AppData/Local/Temp/chocolatey # Continue node_js matrix - node_js: "6" - node_js: "10" From aa814073b722fe5d45f8c03a44f8e64e6aaa0c00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 18 Dec 2019 00:53:53 -0500 Subject: [PATCH 876/965] Ignore some files in npm package (#10882) --- packages/babel-generator/.npmignore | 1 + packages/babel-plugin-proposal-pipeline-operator/.npmignore | 3 +++ .../babel-plugin-proposal-unicode-property-regex/.npmignore | 3 +++ packages/babel-plugin-syntax-pipeline-operator/.npmignore | 3 +++ packages/babel-plugin-transform-dotall-regex/.npmignore | 3 +++ packages/babel-preset-env-standalone/package.json | 3 +-- packages/babel-preset-typescript/.npmignore | 3 +++ packages/babel-standalone/package.json | 3 +-- 8 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 packages/babel-plugin-proposal-pipeline-operator/.npmignore create mode 100644 packages/babel-plugin-proposal-unicode-property-regex/.npmignore create mode 100644 packages/babel-plugin-syntax-pipeline-operator/.npmignore create mode 100644 packages/babel-plugin-transform-dotall-regex/.npmignore create mode 100644 packages/babel-preset-typescript/.npmignore diff --git a/packages/babel-generator/.npmignore b/packages/babel-generator/.npmignore index f9806945836e..f3b1e0392a0b 100644 --- a/packages/babel-generator/.npmignore +++ b/packages/babel-generator/.npmignore @@ -1,3 +1,4 @@ src test +scripts *.log diff --git a/packages/babel-plugin-proposal-pipeline-operator/.npmignore b/packages/babel-plugin-proposal-pipeline-operator/.npmignore new file mode 100644 index 000000000000..2b1fceba679b --- /dev/null +++ b/packages/babel-plugin-proposal-pipeline-operator/.npmignore @@ -0,0 +1,3 @@ +*.log +src +test diff --git a/packages/babel-plugin-proposal-unicode-property-regex/.npmignore b/packages/babel-plugin-proposal-unicode-property-regex/.npmignore new file mode 100644 index 000000000000..2b1fceba679b --- /dev/null +++ b/packages/babel-plugin-proposal-unicode-property-regex/.npmignore @@ -0,0 +1,3 @@ +*.log +src +test diff --git a/packages/babel-plugin-syntax-pipeline-operator/.npmignore b/packages/babel-plugin-syntax-pipeline-operator/.npmignore new file mode 100644 index 000000000000..2b1fceba679b --- /dev/null +++ b/packages/babel-plugin-syntax-pipeline-operator/.npmignore @@ -0,0 +1,3 @@ +*.log +src +test diff --git a/packages/babel-plugin-transform-dotall-regex/.npmignore b/packages/babel-plugin-transform-dotall-regex/.npmignore new file mode 100644 index 000000000000..2b1fceba679b --- /dev/null +++ b/packages/babel-plugin-transform-dotall-regex/.npmignore @@ -0,0 +1,3 @@ +*.log +src +test diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 6c36472df7e0..3cea49b70e7f 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -5,8 +5,7 @@ "main": "babel-preset-env.js", "files": [ "babel-preset-env.js", - "babel-preset-env.min.js", - "src" + "babel-preset-env.min.js" ], "scripts": { "prepublishOnly": "cd ../.. && make prepublish-build-preset-env-standalone" diff --git a/packages/babel-preset-typescript/.npmignore b/packages/babel-preset-typescript/.npmignore new file mode 100644 index 000000000000..2b1fceba679b --- /dev/null +++ b/packages/babel-preset-typescript/.npmignore @@ -0,0 +1,3 @@ +*.log +src +test diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 27440fc019ec..327ac7dc1c9e 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -5,8 +5,7 @@ "main": "babel.js", "files": [ "babel.js", - "babel.min.js", - "src" + "babel.min.js" ], "scripts": { "prepublishOnly": "cd ../.. && make prepublish-build-standalone" From dbf3f91f1ec0f63db711ec8b874c9fc5609bdc2e Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Wed, 18 Dec 2019 11:17:35 +0100 Subject: [PATCH 877/965] Revert "Prevent ignored files in out dir (#10831)" (#10886) This reverts commit 2b3590929b4eb955b0e8b287f9749b5af66cc1a0. --- packages/babel-cli/src/babel/dir.js | 12 ++---------- packages/babel-cli/src/babel/options.js | 6 ------ .../out-files/lib/foo/.foo.js | 1 + .../out-files/lib/foo/index.js} | 0 .../out-files/lib}/index.js | 0 .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../options.json | 12 ------------ .../out-files/lib/README.md | 0 .../out-files/lib/index.js | 3 --- .../stdout.txt | 2 -- .../out-files/lib/foo/bar.js | 0 .../--copy-files with only/out-files/lib/index.js | 1 + 13 files changed, 4 insertions(+), 33 deletions(-) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js rename packages/babel-cli/test/fixtures/babel/{--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js => --copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js} (100%) rename packages/babel-cli/test/fixtures/babel/{--copy-files with ignore with includeIgnored/in-files/src => --copy-files --include-dotfiles with only/out-files/lib}/index.js (100%) delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js delete mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt rename packages/babel-cli/test/fixtures/babel/{--copy-files with ignore with includeIgnored => --copy-files with ignore}/out-files/lib/foo/bar.js (100%) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index 62ad36ba5832..234eb7c8f60b 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -84,16 +84,8 @@ export default async function({ async function handleFile(src: string, base: string): Promise { const written = await write(src, base); - const relative = path.relative(base, src); - const isCompilableExtension = util.isCompilableExtension( - relative, - cliOptions.extensions, - ); - if ( - !written && - ((!isCompilableExtension && cliOptions.copyFiles) || - cliOptions.includeIgnored) - ) { + + if (!written && cliOptions.copyFiles) { const filename = path.relative(base, src); const dest = getDest(filename, base); outputFileSync(dest, fs.readFileSync(src)); diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 45590ae9341e..fa09d6b64ed3 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -161,11 +161,6 @@ commander.option( "Delete the out directory before compilation.", ); -commander.option( - "--include-ignored", - "Include ignored files when copying non-compilable files.", -); - commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); // register an empty action handler so that commander.js can throw on @@ -309,7 +304,6 @@ export default function parseArgv(args: Array): CmdOptions | null { quiet: opts.quiet, deleteDirOnStart: opts.deleteDirOnStart, sourceMapTarget: opts.sourceMapTarget, - includeIgnored: opts.includeIgnored, }, }; } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js new file mode 100644 index 000000000000..31142aabfe70 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js @@ -0,0 +1 @@ +a; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/foo/bar.js rename to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/.foorc deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/in-files/src/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json deleted file mode 100644 index 36b8f50db7b2..000000000000 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/options.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "args": [ - "src", - "--out-dir", - "lib", - "--copy-files", - "--ignore", - "src/foo/*", - "--include-ignored", - "--verbose" - ] -} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/README.md deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js deleted file mode 100644 index cb5e86b12ef3..000000000000 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; - -index; \ No newline at end of file diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt deleted file mode 100644 index 84a430432e47..000000000000 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/stdout.txt +++ /dev/null @@ -1,2 +0,0 @@ -src/index.js -> lib/index.js -Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with ignore with includeIgnored/out-files/lib/foo/bar.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js @@ -0,0 +1 @@ +index; From 80e95d0c833d639157579c765b6624cd4c2696d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 18 Dec 2019 14:34:06 +0100 Subject: [PATCH 878/965] Fix flow --- packages/babel-core/src/transformation/normalize-file.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 4bae84306843..8a55d1d8245b 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -65,12 +65,12 @@ export default function normalizeFile( const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); if (typeof options.filename === "string" && lastComment) { try { - const inputMapFilename = EXTERNAL_SOURCEMAP_REGEX.exec( - lastComment, - )[1]; + const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); + if (!match) throw new Error("Invalid source map comment format."); inputMap = convertSourceMap.fromJSON( fs.readFileSync( - path.resolve(path.dirname(options.filename), inputMapFilename), + path.resolve(path.dirname(options.filename), match[1]), + "utf8", ), ); } catch (err) { From e85c9b9ec8c5549d81a2c355d8ddf57bdcd50f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 18 Dec 2019 19:16:20 -0500 Subject: [PATCH 879/965] fix: skip merging large input sourcemaps (#10890) --- lib/third-party-libs.js.flow | 2 +- .../src/transformation/normalize-file.js | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index f2c81c237d72..e4c31f2f42cd 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -178,7 +178,7 @@ declare module "convert-source-map" { SourceMap: SourceMap, Converter: Converter, fromObject(obj: SourceMap | SourceMapGenerator): Converter, - fromJSON(str: string): Converter, + fromJSON(str: string | Buffer): Converter, fromBase64(str: string): Converter, fromComment(str: string): Converter, fromMapFileComment(str: string, dir: string): Converter, diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 8a55d1d8245b..41c1bb99caa0 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -13,6 +13,7 @@ import File from "./file/file"; import generateMissingPluginMessage from "./util/missing-plugin-helper"; const debug = buildDebug("babel:transform:file"); +const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1_000_000; export type NormalizedFile = { code: string, @@ -65,14 +66,18 @@ export default function normalizeFile( const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); if (typeof options.filename === "string" && lastComment) { try { - const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); - if (!match) throw new Error("Invalid source map comment format."); - inputMap = convertSourceMap.fromJSON( - fs.readFileSync( - path.resolve(path.dirname(options.filename), match[1]), - "utf8", - ), + // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches + const match: [string, string] = (EXTERNAL_SOURCEMAP_REGEX.exec( + lastComment, + ): any); + const inputMapContent: Buffer = fs.readFileSync( + path.resolve(path.dirname(options.filename), match[1]), ); + if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) { + debug("skip merging input map > 1 MB"); + } else { + inputMap = convertSourceMap.fromJSON(inputMapContent); + } } catch (err) { debug("discarding unknown file input sourcemap", err); } From c0d0bf2e5eabf8729eb82c4b84a9d2eb0f934fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 19 Dec 2019 01:28:41 +0100 Subject: [PATCH 880/965] Update core-js fixtures --- packages/babel-preset-env/package.json | 2 +- .../test/fixtures/corejs3/entry-ie-11/output.mjs | 1 + .../test/fixtures/corejs3/entry-ie-9/output.mjs | 1 + .../fixtures/debug/entry-corejs3-specific-targets/stdout.txt | 2 +- .../fixtures/debug/entry-corejs3-versions-decimals/stdout.txt | 1 + .../debug/entry-corejs3-versions-strings-minor-3.0/stdout.txt | 1 + .../debug/entry-corejs3-versions-strings-minor-3.1/stdout.txt | 1 + .../fixtures/debug/entry-corejs3-versions-strings/stdout.txt | 1 + .../test/fixtures/debug/entry-corejs3/stdout.txt | 1 + 9 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 15a72e4cb3e3..b9a54adfc310 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -61,7 +61,7 @@ "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/types": "^7.7.4", "browserslist": "^4.6.0", - "core-js-compat": "^3.4.7", + "core-js-compat": "^3.6.0", "invariant": "^2.2.2", "js-levenshtein": "^1.1.3", "semver": "^5.5.0" diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs index f6b2431273cf..26b355d9cb51 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs @@ -103,6 +103,7 @@ import "core-js/modules/es.reflect.prevent-extensions"; import "core-js/modules/es.reflect.set"; import "core-js/modules/es.reflect.set-prototype-of"; import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; import "core-js/modules/es.regexp.flags"; import "core-js/modules/es.regexp.to-string"; import "core-js/modules/es.set"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs index 80f642659b89..6c47ffc5a778 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs @@ -107,6 +107,7 @@ import "core-js/modules/es.reflect.prevent-extensions"; import "core-js/modules/es.reflect.set"; import "core-js/modules/es.reflect.set-prototype-of"; import "core-js/modules/es.regexp.constructor"; +import "core-js/modules/es.regexp.exec"; import "core-js/modules/es.regexp.flags"; import "core-js/modules/es.regexp.to-string"; import "core-js/modules/es.set"; 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 7db11b83525a..548122b74e3f 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 @@ -174,7 +174,7 @@ Using polyfills with `entry` option: es.reflect.set { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.reflect.set-prototype-of { "ie":"10", "ios":"9", "safari":"7" } es.regexp.constructor { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } - es.regexp.exec { "safari":"7" } + es.regexp.exec { "ie":"10", "ios":"9", "safari":"7" } es.regexp.flags { "edge":"13", "ie":"10", "safari":"7" } es.regexp.to-string { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.set { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } 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..3b1bef759082 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 @@ -167,6 +167,7 @@ Using polyfills with `entry` option: es.reflect.set { "electron":"0.36", "ie":"10" } es.reflect.set-prototype-of { "electron":"0.36", "ie":"10" } es.regexp.constructor { "electron":"0.36", "ie":"10", "node":"6.1" } + es.regexp.exec { "ie":"10" } es.regexp.flags { "electron":"0.36", "ie":"10" } es.regexp.to-string { "electron":"0.36", "ie":"10" } es.set { "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..e8694a81fdf2 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 @@ -154,6 +154,7 @@ Using polyfills with `entry` option: es.reflect.set { "ie":"10" } es.reflect.set-prototype-of { "ie":"10" } es.regexp.constructor { "ie":"10" } + es.regexp.exec { "ie":"10" } es.regexp.flags { "ie":"10" } es.regexp.to-string { "ie":"10" } es.set { "ie":"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..e13d536c01a2 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 @@ -155,6 +155,7 @@ Using polyfills with `entry` option: es.reflect.set { "ie":"10" } es.reflect.set-prototype-of { "ie":"10" } es.regexp.constructor { "ie":"10" } + es.regexp.exec { "ie":"10" } es.regexp.flags { "ie":"10" } es.regexp.to-string { "ie":"10" } es.set { "ie":"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..2ea0685394c2 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 @@ -154,6 +154,7 @@ Using polyfills with `entry` option: es.reflect.set { "ie":"10" } es.reflect.set-prototype-of { "ie":"10" } es.regexp.constructor { "ie":"10" } + es.regexp.exec { "ie":"10" } es.regexp.flags { "ie":"10" } es.regexp.to-string { "ie":"10" } es.set { "ie":"10" } 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..e27aade519ec 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 @@ -156,6 +156,7 @@ Using polyfills with `entry` option: es.reflect.set { "ie":"10" } es.reflect.set-prototype-of { "ie":"10" } es.regexp.constructor { "ie":"10", "node":"6" } + es.regexp.exec { "ie":"10" } es.regexp.flags { "ie":"10" } es.regexp.to-string { "ie":"10" } es.set { "ie":"10", "node":"6" } From 9be27bcfea0b6ffb5f968c46a960c99a6229184f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 18 Dec 2019 19:29:46 -0500 Subject: [PATCH 881/965] fix: add computed property support for object Ref (#10863) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: add computed property support for object Ref * Apply suggestions from code review Co-Authored-By: Nicolò Ribaudo * Update output.js --- .../src/index.js | 28 ++++++--- .../object-ref-computed-exec/exec.js | 20 ++++++ .../object-rest/object-ref-computed/input.js | 20 ++++++ .../object-rest/object-ref-computed/output.js | 62 +++++++++++++++++++ 4 files changed, 120 insertions(+), 10 deletions(-) create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed-exec/exec.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/input.js create mode 100644 packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js diff --git a/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/packages/babel-plugin-proposal-object-rest-spread/src/index.js index 9263fbd56d5e..7f0d2525fbed 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/src/index.js +++ b/packages/babel-plugin-proposal-object-rest-spread/src/index.js @@ -102,12 +102,12 @@ export default declare((api, opts) => { // replaces impure computed keys with new identifiers // and returns variable declarators of these new identifiers - function replaceImpureComputedKeys(path) { + function replaceImpureComputedKeys(properties, scope) { const impureComputedPropertyDeclarators = []; - for (const propPath of path.get("properties")) { + for (const propPath of properties) { const key = propPath.get("key"); if (propPath.node.computed && !key.isPure()) { - const name = path.scope.generateUidBasedOnNode(key.node); + const name = scope.generateUidBasedOnNode(key.node); const declarator = t.variableDeclarator(t.identifier(name), key.node); impureComputedPropertyDeclarators.push(declarator); key.replaceWith(t.identifier(name)); @@ -139,7 +139,10 @@ export default declare((api, opts) => { const restElement = t.cloneNode(last.node); last.remove(); - const impureComputedPropertyDeclarators = replaceImpureComputedKeys(path); + const impureComputedPropertyDeclarators = replaceImpureComputedKeys( + path.get("properties"), + path.scope, + ); const { keys, allLiteral } = extractNormalizedKeys(path); if (keys.length === 0) { @@ -265,18 +268,21 @@ export default declare((api, opts) => { path.findParent(path => { if (path.isObjectProperty()) { - refPropertyPath.unshift(path.node.key.name); + refPropertyPath.unshift(path); } else if (path.isVariableDeclarator()) { kind = path.parentPath.node.kind; return true; } }); - if (refPropertyPath.length) { - refPropertyPath.forEach(prop => { - ref = t.memberExpression(ref, t.identifier(prop)); - }); - } + const impureObjRefComputedDeclarators = replaceImpureComputedKeys( + refPropertyPath, + path.scope, + ); + refPropertyPath.forEach(prop => { + const { node } = prop; + ref = t.memberExpression(ref, t.cloneNode(node.key), node.computed); + }); const objectPatternPath = path.findParent(path => path.isObjectPattern(), @@ -296,6 +302,8 @@ export default declare((api, opts) => { insertionPath.insertBefore(impureComputedPropertyDeclarators); + insertionPath.insertBefore(impureObjRefComputedDeclarators); + insertionPath.insertAfter( t.variableDeclarator(argument, callExpression), ); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed-exec/exec.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed-exec/exec.js new file mode 100644 index 000000000000..53012ea3f1af --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed-exec/exec.js @@ -0,0 +1,20 @@ +var key, x, y, z; +// impure +key = 1; +var { [key++]: { y, ...x } } = { 1: { a: 1, y: 1 } }; +expect(x).toEqual({ a: 1 }); +expect(key).toBe(2); +expect(y).toBe(1); + +// takes care of the order + +key = 1; +var { + [++key]: { y, ...rest_y }, + [++key]: { z, ...rest_z } +} = {2: { y: 2, z: 3 }, 3: { y: 2, z: 3 } }; +expect(y).toBe(2); +expect(rest_y).toEqual({z: 3}); +expect(z).toBe(3); +expect(rest_z).toEqual({ y: 2 }); +expect(key).toBe(3); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/input.js new file mode 100644 index 000000000000..53012ea3f1af --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/input.js @@ -0,0 +1,20 @@ +var key, x, y, z; +// impure +key = 1; +var { [key++]: { y, ...x } } = { 1: { a: 1, y: 1 } }; +expect(x).toEqual({ a: 1 }); +expect(key).toBe(2); +expect(y).toBe(1); + +// takes care of the order + +key = 1; +var { + [++key]: { y, ...rest_y }, + [++key]: { z, ...rest_z } +} = {2: { y: 2, z: 3 }, 3: { y: 2, z: 3 } }; +expect(y).toBe(2); +expect(rest_y).toEqual({z: 3}); +expect(z).toBe(3); +expect(rest_z).toEqual({ y: 2 }); +expect(key).toBe(3); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js new file mode 100644 index 000000000000..319a0fe18c55 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/object-ref-computed/output.js @@ -0,0 +1,62 @@ +var key, x, y, z; // impure + +key = 1; + +var _ref = key++, + { + [_ref]: { + y + } +} = { + 1: { + a: 1, + y: 1 + } +}, + x = babelHelpers.objectWithoutProperties({ + 1: { + a: 1, + y: 1 + } +}[_ref], ["y"]); + +expect(x).toEqual({ + a: 1 +}); +expect(key).toBe(2); +expect(y).toBe(1); // takes care of the order + +key = 1; + +var _$ = { + 2: { + y: 2, + z: 3 + }, + 3: { + y: 2, + z: 3 + } +}, + _ref2 = ++key, + _ref3 = ++key, + { + [_ref3]: { + y + }, + [_ref2]: { + z + } +} = _$, + rest_y = babelHelpers.objectWithoutProperties(_$[_ref3], ["y"]), + rest_z = babelHelpers.objectWithoutProperties(_$[_ref2], ["z"]); + +expect(y).toBe(2); +expect(rest_y).toEqual({ + z: 3 +}); +expect(z).toBe(3); +expect(rest_z).toEqual({ + y: 2 +}); +expect(key).toBe(3); From 12da0941c898987ae30045a9da90ed5bf58ecaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 19 Dec 2019 01:33:19 +0100 Subject: [PATCH 882/965] v7.7.7 --- lerna.json | 2 +- packages/babel-cli/package.json | 4 ++-- packages/babel-core/package.json | 6 +++--- packages/babel-generator/package.json | 4 ++-- packages/babel-node/package.json | 8 ++++---- packages/babel-parser/package.json | 2 +- .../package.json | 4 ++-- .../package.json | 6 +++--- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../package.json | 4 ++-- .../babel-preset-env-standalone/package.json | 6 +++--- packages/babel-preset-env/package.json | 14 ++++++------- packages/babel-preset-typescript/package.json | 4 ++-- packages/babel-register/package.json | 4 ++-- packages/babel-runtime-corejs2/package.json | 2 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 2 +- packages/babel-standalone/package.json | 20 +++++++++---------- 21 files changed, 55 insertions(+), 55 deletions(-) diff --git a/lerna.json b/lerna.json index 80f7b7358916..53ee39160e51 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.6", + "version": "7.7.7", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 6030926c9a05..7c5f9748ad57 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.7.5", + "version": "7.7.7", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -35,7 +35,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", + "@babel/core": "^7.7.7", "@babel/helper-fixtures": "^7.6.3", "rimraf": "^3.0.0" }, diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 37f4247175cb..09edf1b13e09 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.7.5", + "version": "7.7.7", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -40,9 +40,9 @@ }, "dependencies": { "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", + "@babel/generator": "^7.7.7", "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.5", + "@babel/parser": "^7.7.7", "@babel/template": "^7.7.4", "@babel/traverse": "^7.7.4", "@babel/types": "^7.7.4", diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 694dd730fef2..fe63c3de96dc 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.7.4", + "version": "7.7.7", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -21,6 +21,6 @@ }, "devDependencies": { "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.7.4" + "@babel/parser": "^7.7.7" } } diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 8559a260d3f7..35a3ed463235 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.7.4", + "version": "7.7.7", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -19,7 +19,7 @@ "compiler" ], "dependencies": { - "@babel/register": "^7.7.4", + "@babel/register": "^7.7.7", "commander": "^2.8.1", "core-js": "^3.2.1", "lodash": "^4.17.13", @@ -32,9 +32,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-fixtures": "^7.6.3", - "@babel/runtime": "^7.7.4", + "@babel/runtime": "^7.7.7", "fs-readdir-recursive": "^1.0.0", "make-dir": "^2.1.0", "rimraf": "^3.0.0" diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 2907032f3a44..95fb3bb736ad 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.5", + "version": "7.7.7", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index 99b78403ddf5..633a93653ae7 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/package.json +++ b/packages/babel-plugin-proposal-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-object-rest-spread", - "version": "7.7.4", + "version": "7.7.7", "description": "Compile object rest and spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", "license": "MIT", @@ -19,7 +19,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-pipeline-operator/package.json b/packages/babel-plugin-proposal-pipeline-operator/package.json index 348d74afedfd..dd452440432e 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/package.json +++ b/packages/babel-plugin-proposal-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-pipeline-operator", - "version": "7.7.4", + "version": "7.7.7", "description": "Transform pipeline operator into call expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", "license": "MIT", @@ -13,13 +13,13 @@ ], "dependencies": { "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-pipeline-operator": "^7.7.4" + "@babel/plugin-syntax-pipeline-operator": "^7.7.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index 58509325b3f5..ae7f2b4cfa5f 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-unicode-property-regex", - "version": "7.7.4", + "version": "7.7.7", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -29,7 +29,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-syntax-pipeline-operator/package.json b/packages/babel-plugin-syntax-pipeline-operator/package.json index 2064600de73e..e1bb74c7f7a6 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/package.json +++ b/packages/babel-plugin-syntax-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-pipeline-operator", - "version": "7.7.4", + "version": "7.7.7", "description": "Allow parsing of the pipeline operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-pipeline-operator", "license": "MIT", @@ -18,6 +18,6 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.7.7" } } diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 8bb1d1506d86..6f9033604026 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-dotall-regex", - "version": "7.7.4", + "version": "7.7.7", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -25,7 +25,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-parameters/package.json b/packages/babel-plugin-transform-parameters/package.json index 94d346458946..9f350b5277f0 100644 --- a/packages/babel-plugin-transform-parameters/package.json +++ b/packages/babel-plugin-transform-parameters/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-parameters", - "version": "7.7.4", + "version": "7.7.7", "description": "Compile ES2015 default and rest parameters to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", "license": "MIT", @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index 05f8d6a09f7e..f88c40d9c582 100644 --- a/packages/babel-plugin-transform-react-jsx/package.json +++ b/packages/babel-plugin-transform-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx", - "version": "7.7.4", + "version": "7.7.7", "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 3cea49b70e7f..0fb979b081fd 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.6", + "version": "7.7.7", "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -17,8 +17,8 @@ "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/preset-env": "^7.7.6", - "@babel/standalone": "^7.7.6", + "@babel/preset-env": "^7.7.7", + "@babel/standalone": "^7.7.7", "lodash": "^4.17.13" }, "keywords": [ diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index b9a54adfc310..efd61c921943 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.6", + "version": "7.7.7", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -19,9 +19,9 @@ "@babel/plugin-proposal-async-generator-functions": "^7.7.4", "@babel/plugin-proposal-dynamic-import": "^7.7.4", "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.7", "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", "@babel/plugin-syntax-async-generators": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.7.4", "@babel/plugin-syntax-json-strings": "^7.7.4", @@ -35,7 +35,7 @@ "@babel/plugin-transform-classes": "^7.7.4", "@babel/plugin-transform-computed-properties": "^7.7.4", "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.7", "@babel/plugin-transform-duplicate-keys": "^7.7.4", "@babel/plugin-transform-exponentiation-operator": "^7.7.4", "@babel/plugin-transform-for-of": "^7.7.4", @@ -49,7 +49,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.7", "@babel/plugin-transform-property-literals": "^7.7.4", "@babel/plugin-transform-regenerator": "^7.7.5", "@babel/plugin-transform-reserved-words": "^7.7.4", @@ -70,8 +70,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.7.5", - "@babel/core": "^7.7.5", + "@babel/cli": "^7.7.7", + "@babel/core": "^7.7.7", "@babel/helper-fixtures": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index 4cad9fd9728f..c9d29c06d7ec 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.7.4", + "version": "7.7.7", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/helper-plugin-test-runner": "^7.7.4" } } diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index d0ead91dfc7c..31566ca6a6d3 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.7.4", + "version": "7.7.7", "description": "babel require hook", "license": "MIT", "publishConfig": { @@ -23,7 +23,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", + "@babel/core": "^7.7.7", "@babel/plugin-transform-modules-commonjs": "^7.7.4", "browserify": "16.5.0", "default-require-extensions": "^2.0.0" diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 67c689a8d9de..68dd2cbca9bf 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.6", + "version": "7.7.7", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 07f5880759ba..64bcdb0f1943 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.6", + "version": "7.7.7", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "publishConfig": { diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 1af7d8a8d798..d222ef46544c 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.6", + "version": "7.7.7", "description": "babel's modular runtime helpers", "license": "MIT", "publishConfig": { diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 327ac7dc1c9e..cc8740729f1e 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.6", + "version": "7.7.7", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -11,7 +11,7 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.7.5", + "@babel/core": "^7.7.7", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-external-helpers": "^7.7.4", "@babel/plugin-proposal-async-generator-functions": "^7.7.4", @@ -26,13 +26,13 @@ "@babel/plugin-proposal-logical-assignment-operators": "^7.7.4", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", "@babel/plugin-proposal-numeric-separator": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.4", + "@babel/plugin-proposal-object-rest-spread": "^7.7.7", "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", "@babel/plugin-proposal-optional-chaining": "^7.7.5", - "@babel/plugin-proposal-pipeline-operator": "^7.7.4", + "@babel/plugin-proposal-pipeline-operator": "^7.7.7", "@babel/plugin-proposal-private-methods": "^7.7.4", "@babel/plugin-proposal-throw-expressions": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.4", + "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", "@babel/plugin-syntax-async-generators": "^7.7.4", "@babel/plugin-syntax-class-properties": "^7.7.4", "@babel/plugin-syntax-decorators": "^7.7.4", @@ -47,7 +47,7 @@ "@babel/plugin-syntax-jsx": "^7.7.4", "@babel/plugin-syntax-object-rest-spread": "^7.7.4", "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", - "@babel/plugin-syntax-pipeline-operator": "^7.7.4", + "@babel/plugin-syntax-pipeline-operator": "^7.7.7", "@babel/plugin-syntax-typescript": "^7.7.4", "@babel/plugin-transform-arrow-functions": "^7.7.4", "@babel/plugin-transform-async-to-generator": "^7.7.4", @@ -56,7 +56,7 @@ "@babel/plugin-transform-classes": "^7.7.4", "@babel/plugin-transform-computed-properties": "^7.7.4", "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.4", + "@babel/plugin-transform-dotall-regex": "^7.7.7", "@babel/plugin-transform-duplicate-keys": "^7.7.4", "@babel/plugin-transform-exponentiation-operator": "^7.7.4", "@babel/plugin-transform-flow-comments": "^7.7.4", @@ -75,14 +75,14 @@ "@babel/plugin-transform-object-assign": "^7.7.4", "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.7.4", "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.4", + "@babel/plugin-transform-parameters": "^7.7.7", "@babel/plugin-transform-property-literals": "^7.7.4", "@babel/plugin-transform-property-mutators": "^7.7.4", "@babel/plugin-transform-proto-to-assign": "^7.7.4", "@babel/plugin-transform-react-constant-elements": "^7.7.4", "@babel/plugin-transform-react-display-name": "^7.7.4", "@babel/plugin-transform-react-inline-elements": "^7.7.4", - "@babel/plugin-transform-react-jsx": "^7.7.4", + "@babel/plugin-transform-react-jsx": "^7.7.7", "@babel/plugin-transform-react-jsx-compat": "^7.7.4", "@babel/plugin-transform-react-jsx-self": "^7.7.4", "@babel/plugin-transform-react-jsx-source": "^7.7.4", @@ -99,7 +99,7 @@ "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/preset-flow": "^7.7.4", "@babel/preset-react": "^7.7.4", - "@babel/preset-typescript": "^7.7.4" + "@babel/preset-typescript": "^7.7.7" }, "keywords": [ "babel", From aaa1b1f4b02d89a62c01ca0166236d670c267607 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Thu, 19 Dec 2019 00:53:52 +0000 Subject: [PATCH 883/965] Add v7.7.7 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e26777674ff3..d43bffda7b24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,56 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.7.7 (2019-12-19) + +#### :eyeglasses: Spec Compliance +* `babel-parser` + * [#10576](https://github.com/babel/babel/pull/10576) [parser] validation for parentheses in the left-hand side of assignment expressions ([@boweihan](https://github.com/boweihan)) + +#### :rocket: New Feature +* `babel-cli` + * [#10831](https://github.com/babel/babel/pull/10831) Prevent ignored files in out dir ([@rajasekarm](https://github.com/rajasekarm)) + +#### :bug: Bug Fix +* `babel-plugin-proposal-object-rest-spread` + * [#10863](https://github.com/babel/babel/pull/10863) fix: add computed property support for object Ref ([@JLHwung](https://github.com/JLHwung)) +* `babel-core` + * [#10890](https://github.com/babel/babel/pull/10890) fix: skip merging large input sourcemaps ([@JLHwung](https://github.com/JLHwung)) + * [#10885](https://github.com/babel/babel/pull/10885) fix: avoid string copy when processing input source-map ([@JLHwung](https://github.com/JLHwung)) +* `babel-node` + * [#10871](https://github.com/babel/babel/pull/10871) Allow -r from node_modules with @babel/node ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-plugin-transform-parameters` + * [#10053](https://github.com/babel/babel/pull/10053) Check shadow variable to identifier in default parameters ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10828](https://github.com/babel/babel/pull/10828) @babel/eslint-parser: fix ImportExpression node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) + * [#10827](https://github.com/babel/babel/pull/10827) @babel/eslint-parser: fix BigIntLiteral node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) + +#### :nail_care: Polish +* `babel-plugin-transform-react-jsx` + * [#10868](https://github.com/babel/babel/pull/10868) Fix pragmaFrag spelling in error message ([@azizhk](https://github.com/azizhk)) + +#### :house: Internal +* `babel-generator`, `babel-plugin-proposal-pipeline-operator`, `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-syntax-pipeline-operator`, `babel-plugin-transform-dotall-regex`, `babel-preset-env-standalone`, `babel-preset-typescript`, `babel-standalone` + * [#10882](https://github.com/babel/babel/pull/10882) Ignore some files in npm package ([@JLHwung](https://github.com/JLHwung)) +* Other + * [#10874](https://github.com/babel/babel/pull/10874) chore: cache chocolatey installation temporary files ([@JLHwung](https://github.com/JLHwung)) + * [#10880](https://github.com/babel/babel/pull/10880) chore: add PR Intent checkbox [ci-skip] ([@JLHwung](https://github.com/JLHwung)) + * [#10870](https://github.com/babel/babel/pull/10870) chore: update babel-eslint to 11.0.0-beta.2 ([@JLHwung](https://github.com/JLHwung)) + * [#10848](https://github.com/babel/babel/pull/10848) Tune eslint packages test configuration ([@JLHwung](https://github.com/JLHwung)) +* `babel-preset-env` + * [#10873](https://github.com/babel/babel/pull/10873) chore: download compat-table when build-data is run ([@JLHwung](https://github.com/JLHwung)) + * [#10846](https://github.com/babel/babel/pull/10846) Update corejs fixtures ([@JLHwung](https://github.com/JLHwung)) + * [#10837](https://github.com/babel/babel/pull/10837) refactor: rewrite available-plugins to esm ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10858](https://github.com/babel/babel/pull/10858) Properly serialize non-json values in parser tests ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-cli`, `babel-node`, `babel-register` + * [#10847](https://github.com/babel/babel/pull/10847) Add missing dev dependencies ([@JLHwung](https://github.com/JLHwung)) + +#### :leftwards_arrow_with_hook: Revert +* `babel-cli` + * [#10886](https://github.com/babel/babel/pull/10886) Revert "Prevent ignored files in out dir" ([@rajasekarm](https://github.com/rajasekarm)) +* `babel-plugin-transform-classes`, `babel-plugin-transform-regenerator`, `babel-preset-env` + * [#10839](https://github.com/babel/babel/pull/10839) Use `async-to-generator` even when `regenerator` is enabled ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.7.6 (2019-12-08) #### :house: Internal From d389b702e65bfb0a3cc8258907db76560491547a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 19 Dec 2019 02:02:08 +0100 Subject: [PATCH 884/965] Remove reverted PR from changelog [skip ci] --- CHANGELOG.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d43bffda7b24..884ce9967f78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,10 +25,6 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * `babel-parser` * [#10576](https://github.com/babel/babel/pull/10576) [parser] validation for parentheses in the left-hand side of assignment expressions ([@boweihan](https://github.com/boweihan)) -#### :rocket: New Feature -* `babel-cli` - * [#10831](https://github.com/babel/babel/pull/10831) Prevent ignored files in out dir ([@rajasekarm](https://github.com/rajasekarm)) - #### :bug: Bug Fix * `babel-plugin-proposal-object-rest-spread` * [#10863](https://github.com/babel/babel/pull/10863) fix: add computed property support for object Ref ([@JLHwung](https://github.com/JLHwung)) @@ -65,8 +61,6 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * [#10847](https://github.com/babel/babel/pull/10847) Add missing dev dependencies ([@JLHwung](https://github.com/JLHwung)) #### :leftwards_arrow_with_hook: Revert -* `babel-cli` - * [#10886](https://github.com/babel/babel/pull/10886) Revert "Prevent ignored files in out dir" ([@rajasekarm](https://github.com/rajasekarm)) * `babel-plugin-transform-classes`, `babel-plugin-transform-regenerator`, `babel-preset-env` * [#10839](https://github.com/babel/babel/pull/10839) Use `async-to-generator` even when `regenerator` is enabled ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.7.6 (2019-12-08) From c5cfc83182a341ae4073c35282f9022d6de59c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 20 Dec 2019 15:32:22 -0500 Subject: [PATCH 885/965] Move coverage to GitHub actions (#10898) * chore: remove Circle CI test config * chore: add GitHub Actions: Report Coverage * chore: polish the step names * chore: remove Circle CI test job definition * chore: remove cache actions as it seems that they are hanging forever --- .circleci/config.yml | 47 ---------------------------------- .github/workflows/coverage.yml | 36 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 815244ed2edf..783d63ca39c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,28 +9,6 @@ aliases: keys: - v1-yarn-cache - - &save-node-modules-cache - paths: - - node_modules - key: v1-yarn-deps-{{ checksum "yarn.lock" }} - - - &save-yarn-cache - paths: - - ~/.yarn-cache - key: v1-yarn-cache - - - &artifact_babel - path: ~/babel/packages/babel-standalone/babel.js - - - &artifact_babel_min - path: ~/babel/packages/babel-standalone/babel.min.js - - - &artifact_env - path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js - - - &artifact_env_min - path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js - - &test262_workdir working_directory: ~/babel/babel-test262-runner @@ -50,28 +28,6 @@ executors: working_directory: ~/babel jobs: - test: - executor: node-executor - steps: - - checkout - - restore_cache: *restore-yarn-cache - - restore_cache: *restore-node-modules-cache - - run: yarn --version - - run: make test-ci-coverage - # Builds babel-standalone with the regular Babel config - - run: IS_PUBLISH=true make build - # test-ci-coverage doesn't test babel-standalone, as trying to gather coverage - # data for a JS file that's several megabytes large is bound to fail. Here, - # we just run the babel-standalone test separately. - - run: ./node_modules/.bin/jest packages/babel-standalone/test/ - - run: ./node_modules/.bin/jest packages/babel-preset-env-standalone/test/ - - store_artifacts: *artifact_babel - - store_artifacts: *artifact_babel_min - - store_artifacts: *artifact_env - - store_artifacts: *artifact_env_min - - save_cache: *save-node-modules-cache - - save_cache: *save-yarn-cache - test262: executor: node-executor steps: @@ -156,9 +112,6 @@ jobs: workflows: version: 2 - test: - jobs: - - test test262-master: jobs: - test262: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000000..430a4c48cd3f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,36 @@ +name: Report Coverage + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [13.x] + steps: + - name: Checkout code + uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Environment log + id: env + run: | + yarn --version + - name: Generate coverage report + run: | + yarn --version + make test-ci-coverage + # Builds babel-standalone with the regular Babel config + # test-ci-coverage doesn't test babel-standalone, as trying to gather coverage + IS_PUBLISH=true make build-standalone + # data for a JS file that's several megabytes large is bound to fail. Here, + # we just run the babel-standalone test separately. + yarn jest "\-standalone/test" + - name: Upload coverage report + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + From 416ce3563877cff5098ac5b665d53947027f589b Mon Sep 17 00:00:00 2001 From: Tsubasa Nakayama Date: Sun, 22 Dec 2019 08:16:51 +0900 Subject: [PATCH 886/965] fix: Object.getOwnPropertySymbols called on non-object (#10902) * fix: Object.getOwnPropertySymbols called on non-object * convert Object --- packages/babel-helpers/src/helpers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index d235cf328569..9212dfb2c28c 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -396,8 +396,8 @@ helpers.objectSpread = helper("7.0.0-beta.0")` export default function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { - var source = (arguments[i] != null) ? arguments[i] : {}; - var ownKeys = Object.keys(Object(source)); + var source = (arguments[i] != null) ? Object(arguments[i]) : {}; + var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; From f651f22f96b2715010cd8a7b65bb12648eba8307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barth=C3=A9l=C3=A9my=20Ledoux?= Date: Sun, 22 Dec 2019 03:22:28 -0600 Subject: [PATCH 887/965] fix: lost leading comment after named import (#10901) * create test for 10892 * update expected output * fixed #10892 * add colon to restart build * remove colon as it makes tests fail --- packages/babel-parser/src/parser/comments.js | 8 +- .../comments/regression/10892/input.js | 7 + .../comments/regression/10892/options.json | 3 + .../comments/regression/10892/output.json | 206 ++++++++++++++++++ 4 files changed, 219 insertions(+), 5 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10892/input.js create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10892/options.json create mode 100644 packages/babel-parser/test/fixtures/comments/regression/10892/output.json diff --git a/packages/babel-parser/src/parser/comments.js b/packages/babel-parser/src/parser/comments.js index 5a50c15c6414..bf936d2dce10 100644 --- a/packages/babel-parser/src/parser/comments.js +++ b/packages/babel-parser/src/parser/comments.js @@ -174,11 +174,9 @@ export default class CommentsParser extends BaseParser { (this.state.commentPreviousNode.type === "ExportSpecifier" && node.type !== "ExportSpecifier")) ) { - this.adjustCommentsAfterTrailingComma( - node, - [this.state.commentPreviousNode], - true, - ); + this.adjustCommentsAfterTrailingComma(node, [ + this.state.commentPreviousNode, + ]); } if (lastChild) { diff --git a/packages/babel-parser/test/fixtures/comments/regression/10892/input.js b/packages/babel-parser/test/fixtures/comments/regression/10892/input.js new file mode 100644 index 000000000000..05a56ffa976c --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10892/input.js @@ -0,0 +1,7 @@ +import { foo } from "bar" + +/** + * lost comment + */ +export default { +} diff --git a/packages/babel-parser/test/fixtures/comments/regression/10892/options.json b/packages/babel-parser/test/fixtures/comments/regression/10892/options.json new file mode 100644 index 000000000000..2104ca43283f --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10892/options.json @@ -0,0 +1,3 @@ +{ + "sourceType": "module" +} diff --git a/packages/babel-parser/test/fixtures/comments/regression/10892/output.json b/packages/babel-parser/test/fixtures/comments/regression/10892/output.json new file mode 100644 index 000000000000..1ca2d06ab94e --- /dev/null +++ b/packages/babel-parser/test/fixtures/comments/regression/10892/output.json @@ -0,0 +1,206 @@ +{ + "type": "File", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 69, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ImportDeclaration", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "imported": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "local": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "foo" + }, + "name": "foo" + } + } + ], + "source": { + "type": "StringLiteral", + "start": 20, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "extra": { + "rawValue": "bar", + "raw": "\"bar\"" + }, + "value": "bar" + }, + "trailingComments": [ + { + "type": "CommentBlock", + "value": "*\n * lost comment\n ", + "start": 27, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + } + } + ] + }, + { + "type": "ExportDefaultDeclaration", + "start": 51, + "end": 69, + "loc": { + "start": { + "line": 6, + "column": 0 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "declaration": { + "type": "ObjectExpression", + "start": 66, + "end": 69, + "loc": { + "start": { + "line": 6, + "column": 15 + }, + "end": { + "line": 7, + "column": 1 + } + }, + "properties": [] + }, + "leadingComments": [ + { + "type": "CommentBlock", + "value": "*\n * lost comment\n ", + "start": 27, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentBlock", + "value": "*\n * lost comment\n ", + "start": 27, + "end": 50, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 5, + "column": 3 + } + } + } + ] +} \ No newline at end of file From 83993b08d5f35649ea66b0816c608fb020922dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 23 Dec 2019 13:03:45 -0500 Subject: [PATCH 888/965] chore: separate build-standalone with coverage (#10905) * chore: separate build-standalone with coverage * style polish --- .circleci/config.yml | 46 ++++++++++++++++++++++++++++++++++ .github/workflows/coverage.yml | 9 +------ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 783d63ca39c2..5d6df0a9428e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,6 +9,28 @@ aliases: keys: - v1-yarn-cache + - &save-node-modules-cache + paths: + - node_modules + key: v1-yarn-deps-{{ checksum "yarn.lock" }} + + - &save-yarn-cache + paths: + - ~/.yarn-cache + key: v1-yarn-cache + + - &artifact_babel + path: ~/babel/packages/babel-standalone/babel.js + + - &artifact_babel_min + path: ~/babel/packages/babel-standalone/babel.min.js + + - &artifact_env + path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.js + + - &artifact_env_min + path: ~/babel/packages/babel-preset-env-standalone/babel-preset-env.min.js + - &test262_workdir working_directory: ~/babel/babel-test262-runner @@ -28,6 +50,25 @@ executors: working_directory: ~/babel jobs: + build-standalone: + executor: node-executor + steps: + - checkout + - restore_cache: *restore-yarn-cache + - restore_cache: *restore-node-modules-cache + # Builds babel-standalone with the regular Babel config + # test-ci-coverage doesn't test babel-standalone, as trying to gather coverage + - run: IS_PUBLISH=true make -j build-standalone-ci + # data for a JS file that's several megabytes large is bound to fail. Here, + # we just run the babel-standalone test separately. + - run: yarn jest "\-standalone/test" + - store_artifacts: *artifact_babel + - store_artifacts: *artifact_babel_min + - store_artifacts: *artifact_env + - store_artifacts: *artifact_env_min + - save_cache: *save-node-modules-cache + - save_cache: *save-yarn-cache + test262: executor: node-executor steps: @@ -81,6 +122,8 @@ jobs: cat ~/diff.tap | $(npm bin)/tap-merge | $(npm bin)/tap-mocha-reporter xunit | tee ~/test-results/test262/results.xml <<: *test262_workdir - store_test_results: *artifact_test262_xunit + - save_cache: *save-node-modules-cache + - save_cache: *save-yarn-cache publish-verdaccio: executor: node-executor @@ -112,6 +155,9 @@ jobs: workflows: version: 2 + build-standalone: + jobs: + - build-standalone test262-master: jobs: - test262: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 430a4c48cd3f..03738da23034 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -22,15 +22,8 @@ jobs: - name: Generate coverage report run: | yarn --version - make test-ci-coverage - # Builds babel-standalone with the regular Babel config - # test-ci-coverage doesn't test babel-standalone, as trying to gather coverage - IS_PUBLISH=true make build-standalone - # data for a JS file that's several megabytes large is bound to fail. Here, - # we just run the babel-standalone test separately. - yarn jest "\-standalone/test" + make -j test-ci-coverage - name: Upload coverage report uses: codecov/codecov-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} - From c09664f35d58088bf5565d01e3589ed327884693 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Mon, 23 Dec 2019 17:12:07 -0500 Subject: [PATCH 889/965] @babel/eslint-parser: Refactor (#10916) --- .../src/babylon-to-espree/convertAST.js | 44 +++++++++---------- .../babylon-to-espree/convertTemplateType.js | 4 +- .../src/babylon-to-espree/convertToken.js | 4 +- .../src/babylon-to-espree/convertTokens.js | 6 +-- .../src/babylon-to-espree/index.js | 6 +-- eslint/babel-eslint-parser/src/index.js | 2 +- eslint/babel-eslint-parser/src/parse.js | 4 +- 7 files changed, 37 insertions(+), 33 deletions(-) diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js index 50d472803a0b..4e048668717b 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertAST.js @@ -1,27 +1,6 @@ -import { types as t } from "@babel/core"; +import { types as t, traverse } from "@babel/core"; import convertProgramNode from "./convertProgramNode"; -module.exports = function(ast, traverse, code) { - const state = { source: code }; - - // Monkey patch visitor keys in order to be able to traverse the estree nodes - t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; - t.VISITOR_KEYS.MethodDefinition = [ - "key", - "value", - "decorators", - "returnType", - "typeParameters", - ]; - - traverse(ast, astTransformVisitor, null, state); - - delete t.VISITOR_KEYS.Property; - delete t.VISITOR_KEYS.MethodDefinition; - - convertProgramNode(ast); -}; - const astTransformVisitor = { noScope: true, enter(path) { @@ -94,3 +73,24 @@ const astTransformVisitor = { } }, }; + +export default function(ast, code) { + const state = { source: code }; + + // Monkey patch visitor keys in order to be able to traverse the estree nodes + t.VISITOR_KEYS.Property = t.VISITOR_KEYS.ObjectProperty; + t.VISITOR_KEYS.MethodDefinition = [ + "key", + "value", + "decorators", + "returnType", + "typeParameters", + ]; + + traverse(ast, astTransformVisitor, null, state); + + delete t.VISITOR_KEYS.Property; + delete t.VISITOR_KEYS.MethodDefinition; + + convertProgramNode(ast); +} diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js index d918417d8038..3b674adae624 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTemplateType.js @@ -1,4 +1,6 @@ -export default function(tokens, tt) { +import { tokTypes as tt } from "@babel/core"; + +export default function(tokens) { let curlyBrace = null; let templateTokens = []; const result = []; diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js index 54527136801a..d8c9f09092f7 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertToken.js @@ -1,4 +1,6 @@ -export default function(token, tt, source) { +import { tokTypes as tt } from "@babel/core"; + +export default function(token, source) { const type = token.type; token.range = [token.start, token.end]; diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js index 41978339a78c..44f4ef41bc3f 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/convertTokens.js @@ -1,8 +1,8 @@ import convertTemplateType from "./convertTemplateType"; import convertToken from "./convertToken"; -export default function(tokens, tt, code) { - return convertTemplateType(tokens, tt) +export default function(tokens, code) { + return convertTemplateType(tokens) .filter(t => t.type !== "CommentLine" && t.type !== "CommentBlock") - .map(t => convertToken(t, tt, code)); + .map(t => convertToken(t, code)); } diff --git a/eslint/babel-eslint-parser/src/babylon-to-espree/index.js b/eslint/babel-eslint-parser/src/babylon-to-espree/index.js index 7112aa8f24ff..7a9de2b4cc0b 100644 --- a/eslint/babel-eslint-parser/src/babylon-to-espree/index.js +++ b/eslint/babel-eslint-parser/src/babylon-to-espree/index.js @@ -2,8 +2,8 @@ import convertTokens from "./convertTokens"; import convertComments from "./convertComments"; import convertAST from "./convertAST"; -export default function(ast, traverse, tt, code) { - ast.tokens = convertTokens(ast.tokens, tt, code); +export default function(ast, code) { + ast.tokens = convertTokens(ast.tokens, code); convertComments(ast.comments); - convertAST(ast, traverse, code); + convertAST(ast, code); } diff --git a/eslint/babel-eslint-parser/src/index.js b/eslint/babel-eslint-parser/src/index.js index 4709fd4aa8d5..2d54014b4468 100644 --- a/eslint/babel-eslint-parser/src/index.js +++ b/eslint/babel-eslint-parser/src/index.js @@ -12,7 +12,7 @@ const IS_RUNNING_SUPPORTED_VERSION = semver.satisfies( ); export function parse(code, options) { - return exports.parseForESLint(code, options).ast; + return parseForESLint(code, options).ast; } export function parseForESLint(code, options = {}) { diff --git a/eslint/babel-eslint-parser/src/parse.js b/eslint/babel-eslint-parser/src/parse.js index e38e9a94fe68..e39f371295d6 100644 --- a/eslint/babel-eslint-parser/src/parse.js +++ b/eslint/babel-eslint-parser/src/parse.js @@ -1,4 +1,4 @@ -import { parseSync as babelParse, tokTypes as tt, traverse } from "@babel/core"; +import { parseSync as babelParse } from "@babel/core"; import babylonToEspree from "./babylon-to-espree"; import { normalizeBabelParseConfig } from "./configuration"; @@ -17,7 +17,7 @@ export default function parse(code, options) { throw err; } - babylonToEspree(ast, traverse, tt, code); + babylonToEspree(ast, code); return ast; } From a18166d2a9a9c5964061f7dae3841fe9b56eb9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 24 Dec 2019 05:43:39 -0500 Subject: [PATCH 890/965] refactor: remove inClassProperty parser state (#10906) --- packages/babel-parser/src/parser/expression.js | 2 +- packages/babel-parser/src/parser/statement.js | 9 --------- packages/babel-parser/src/tokenizer/state.js | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index e844bb7f91db..4660d3cc0797 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1389,7 +1389,7 @@ export default class ExpressionParser extends LValParser { if (this.eat(tt.dot)) { const metaProp = this.parseMetaProperty(node, meta, "target"); - if (!this.scope.inNonArrowFunction && !this.state.inClassProperty) { + if (!this.scope.inNonArrowFunction && !this.scope.inClass) { let error = "new.target can only be used in functions"; if (this.hasPlugin("classProperties")) { diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 9c8d1afb482a..be090db6edf9 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1048,11 +1048,9 @@ export default class StatementParser extends ExpressionParser { } const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; - const oldInClassProperty = this.state.inClassProperty; const oldYieldPos = this.state.yieldPos; const oldAwaitPos = this.state.awaitPos; this.state.maybeInArrowParameters = false; - this.state.inClassProperty = false; this.state.yieldPos = -1; this.state.awaitPos = -1; this.scope.enter(functionFlags(node.async, node.generator)); @@ -1084,7 +1082,6 @@ export default class StatementParser extends ExpressionParser { } this.state.maybeInArrowParameters = oldMaybeInArrowParameters; - this.state.inClassProperty = oldInClassProperty; this.state.yieldPos = oldYieldPos; this.state.awaitPos = oldAwaitPos; @@ -1575,13 +1572,10 @@ export default class StatementParser extends ExpressionParser { parseClassPrivateProperty( node: N.ClassPrivateProperty, ): N.ClassPrivateProperty { - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); node.value = this.eat(tt.eq) ? this.parseMaybeAssign() : null; this.semicolon(); - this.state.inClassProperty = false; this.scope.exit(); @@ -1593,8 +1587,6 @@ export default class StatementParser extends ExpressionParser { this.expectPlugin("classProperties"); } - this.state.inClassProperty = true; - this.scope.enter(SCOPE_CLASS | SCOPE_SUPER); if (this.match(tt.eq)) { @@ -1605,7 +1597,6 @@ export default class StatementParser extends ExpressionParser { node.value = null; } this.semicolon(); - this.state.inClassProperty = false; this.scope.exit(); diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index 6ff711f373c6..d3f370df1473 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -64,7 +64,6 @@ export default class State { inType: boolean = false; noAnonFunctionType: boolean = false; inPropertyName: boolean = false; - inClassProperty: boolean = false; hasFlowComment: boolean = false; isIterator: boolean = false; From 875e9619b753aabc6931cfd76a24803d9561ee72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 24 Dec 2019 12:25:23 -0500 Subject: [PATCH 891/965] chore: refine e2e test scripts (#10918) --- scripts/integration-tests/e2e-babel.sh | 2 +- scripts/integration-tests/e2e-create-react-app.sh | 8 ++++---- scripts/integration-tests/publish-local.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/integration-tests/e2e-babel.sh b/scripts/integration-tests/e2e-babel.sh index d295a9416c55..f73b75f95bd5 100755 --- a/scripts/integration-tests/e2e-babel.sh +++ b/scripts/integration-tests/e2e-babel.sh @@ -5,7 +5,7 @@ #==============================================================================# # Start in scripts/integration-tests/ even if run from root directory -cd "$(dirname "$0")" +cd "$(dirname "$0")" || exit source utils/local-registry.sh source utils/cleanup.sh diff --git a/scripts/integration-tests/e2e-create-react-app.sh b/scripts/integration-tests/e2e-create-react-app.sh index e589ec12fe41..1c956f240cee 100755 --- a/scripts/integration-tests/e2e-create-react-app.sh +++ b/scripts/integration-tests/e2e-create-react-app.sh @@ -5,7 +5,7 @@ #==============================================================================# # Start in scripts/integration-tests/ even if run from root directory -cd "$(dirname "$0")" +cd "$(dirname "$0")" || exit source utils/local-registry.sh source utils/cleanup.sh @@ -14,8 +14,8 @@ source utils/cleanup.sh set -x # Clone create-react-app -git clone https://github.com/facebook/create-react-app.git tmp/create-react-app -cd tmp/create-react-app +git clone --depth=1 https://github.com/facebook/create-react-app.git tmp/create-react-app +cd tmp/create-react-app || exit #==============================================================================# # TEST # @@ -25,7 +25,7 @@ startLocalRegistry "$PWD"/../../verdaccio-config.yml yarn install # "yarn upgrade --scope @babel --latest" doesn't seem to work. # a means "all", while \n is the enter needed to confirm the selection. -echo "a\n" | yarn upgrade-interactive --scope @babel --latest +printf "a\n" | yarn upgrade-interactive --scope @babel --latest # Test CI=true yarn test diff --git a/scripts/integration-tests/publish-local.sh b/scripts/integration-tests/publish-local.sh index 8a77d31cb543..c2e16da37517 100755 --- a/scripts/integration-tests/publish-local.sh +++ b/scripts/integration-tests/publish-local.sh @@ -15,7 +15,7 @@ function publishESLintPkg { cd eslint/$1 yarn version --patch --no-git-tag-version cd ../.. - make publish-eslint PKG=$1 + make -j publish-eslint PKG=$1 } # Echo every command being executed @@ -30,7 +30,7 @@ initializeE2Egit # PUBLISH # #==============================================================================# -make bootstrap-only +make -j bootstrap-only startLocalRegistry "$PWD"/scripts/integration-tests/verdaccio-config.yml loginLocalRegistry From ee5b79d75d34aebc11201ed4ab953741742f1a93 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Tue, 24 Dec 2019 12:28:57 -0500 Subject: [PATCH 892/965] @babel-core: parse should parse only (#10914) * @babel/core: parse methods should parse only * Update Flow types --- packages/babel-core/src/parse.js | 13 ++-- packages/babel-core/src/parser/index.js | 74 +++++++++++++++++++ .../util/missing-plugin-helper.js | 0 .../src/transformation/normalize-file.js | 74 +------------------ 4 files changed, 80 insertions(+), 81 deletions(-) create mode 100644 packages/babel-core/src/parser/index.js rename packages/babel-core/src/{transformation => parser}/util/missing-plugin-helper.js (100%) diff --git a/packages/babel-core/src/parse.js b/packages/babel-core/src/parse.js index b3397a1a2e23..6c82fe75ad5f 100644 --- a/packages/babel-core/src/parse.js +++ b/packages/babel-core/src/parse.js @@ -1,14 +1,11 @@ // @flow import loadConfig, { type InputOptions } from "./config"; -import normalizeFile from "./transformation/normalize-file"; +import parser from "./parser"; +import type { ParseResult } from "./parser"; import normalizeOptions from "./transformation/normalize-opts"; -type AstRoot = BabelNodeFile | BabelNodeProgram; - -export type ParseResult = AstRoot; - -export type FileParseCallback = { +type FileParseCallback = { (Error, null): any, (null, ParseResult | null): any, }; @@ -49,7 +46,7 @@ export const parse: Parse = (function parse(code, opts, callback) { const cfg = loadConfig(opts); if (cfg === null) return cb(null, null); - ast = normalizeFile(cfg.passes, normalizeOptions(cfg), code).ast; + ast = parser(cfg.passes, normalizeOptions(cfg), code); } catch (err) { return cb(err); } @@ -68,7 +65,7 @@ export function parseSync( return null; } - return normalizeFile(config.passes, normalizeOptions(config), code).ast; + return parser(config.passes, normalizeOptions(config), code); } export function parseAsync( diff --git a/packages/babel-core/src/parser/index.js b/packages/babel-core/src/parser/index.js new file mode 100644 index 000000000000..499d465ea585 --- /dev/null +++ b/packages/babel-core/src/parser/index.js @@ -0,0 +1,74 @@ +import { parse } from "@babel/parser"; +import { codeFrameColumns } from "@babel/code-frame"; +import generateMissingPluginMessage from "./util/missing-plugin-helper"; + +type AstRoot = BabelNodeFile | BabelNodeProgram; + +export type ParseResult = AstRoot; + +export default function parser( + pluginPasses: PluginPasses, + { parserOpts, highlightCode = true, filename = "unknown" }: Object, + code: string, +): ParseResult { + try { + const results = []; + for (const plugins of pluginPasses) { + for (const plugin of plugins) { + const { parserOverride } = plugin; + if (parserOverride) { + const ast = parserOverride(code, parserOpts, parse); + + if (ast !== undefined) results.push(ast); + } + } + } + + if (results.length === 0) { + return parse(code, parserOpts); + } else if (results.length === 1) { + if (typeof results[0].then === "function") { + throw new Error( + `You appear to be using an async parser plugin, ` + + `which your current version of Babel does not support. ` + + `If you're using a published plugin, you may need to upgrade ` + + `your @babel/core version.`, + ); + } + return results[0]; + } + throw new Error("More than one plugin attempted to override parsing."); + } catch (err) { + if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") { + err.message += + "\nConsider renaming the file to '.mjs', or setting sourceType:module " + + "or sourceType:unambiguous in your Babel config for this file."; + // err.code will be changed to BABEL_PARSE_ERROR later. + } + + const { loc, missingPlugin } = err; + if (loc) { + const codeFrame = codeFrameColumns( + code, + { + start: { + line: loc.line, + column: loc.column + 1, + }, + }, + { + highlightCode, + }, + ); + if (missingPlugin) { + err.message = + `${filename}: ` + + generateMissingPluginMessage(missingPlugin[0], loc, codeFrame); + } else { + err.message = `${filename}: ${err.message}\n\n` + codeFrame; + } + err.code = "BABEL_PARSE_ERROR"; + } + throw err; + } +} diff --git a/packages/babel-core/src/transformation/util/missing-plugin-helper.js b/packages/babel-core/src/parser/util/missing-plugin-helper.js similarity index 100% rename from packages/babel-core/src/transformation/util/missing-plugin-helper.js rename to packages/babel-core/src/parser/util/missing-plugin-helper.js diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 41c1bb99caa0..baad5de2df50 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -7,10 +7,8 @@ import cloneDeep from "lodash/cloneDeep"; import * as t from "@babel/types"; import type { PluginPasses } from "../config"; import convertSourceMap, { typeof Converter } from "convert-source-map"; -import { parse } from "@babel/parser"; -import { codeFrameColumns } from "@babel/code-frame"; import File from "./file/file"; -import generateMissingPluginMessage from "./util/missing-plugin-helper"; +import parser from "../parser"; const debug = buildDebug("babel:transform:file"); const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1_000_000; @@ -37,9 +35,6 @@ export default function normalizeFile( } ast = cloneDeep(ast); } else { - // The parser's AST types aren't fully compatible with the types generated - // by the logic in babel-types. - // $FlowFixMe ast = parser(pluginPasses, options, code); } @@ -94,73 +89,6 @@ export default function normalizeFile( }); } -function parser( - pluginPasses: PluginPasses, - { parserOpts, highlightCode = true, filename = "unknown" }: Object, - code: string, -) { - try { - const results = []; - for (const plugins of pluginPasses) { - for (const plugin of plugins) { - const { parserOverride } = plugin; - if (parserOverride) { - const ast = parserOverride(code, parserOpts, parse); - - if (ast !== undefined) results.push(ast); - } - } - } - - if (results.length === 0) { - return parse(code, parserOpts); - } else if (results.length === 1) { - if (typeof results[0].then === "function") { - throw new Error( - `You appear to be using an async parser plugin, ` + - `which your current version of Babel does not support. ` + - `If you're using a published plugin, you may need to upgrade ` + - `your @babel/core version.`, - ); - } - return results[0]; - } - throw new Error("More than one plugin attempted to override parsing."); - } catch (err) { - if (err.code === "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED") { - err.message += - "\nConsider renaming the file to '.mjs', or setting sourceType:module " + - "or sourceType:unambiguous in your Babel config for this file."; - // err.code will be changed to BABEL_PARSE_ERROR later. - } - - const { loc, missingPlugin } = err; - if (loc) { - const codeFrame = codeFrameColumns( - code, - { - start: { - line: loc.line, - column: loc.column + 1, - }, - }, - { - highlightCode, - }, - ); - if (missingPlugin) { - err.message = - `${filename}: ` + - generateMissingPluginMessage(missingPlugin[0], loc, codeFrame); - } else { - err.message = `${filename}: ${err.message}\n\n` + codeFrame; - } - err.code = "BABEL_PARSE_ERROR"; - } - throw err; - } -} - // These regexps are copied from the convert-source-map package, // but without // or /* at the beginning of the comment. From fc5365fe4a3b9acf7116d63df6a23193e5a40ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 24 Dec 2019 15:18:46 -0500 Subject: [PATCH 893/965] Fix parameter expression get binding (#10912) * fix: parameter expression closure should not have access to the declaration inside function body * fix: renameVisitor should skip when a pattern is a scope * address review comments --- .../src/path/lib/virtual-types.js | 3 ++- packages/babel-traverse/src/scope/index.js | 19 ++++++++++++++++++- .../rename/parameter-default-1/input.js | 7 +++++++ .../rename/parameter-default-1/options.json | 3 +++ .../rename/parameter-default-1/output.js | 6 ++++++ .../rename/parameter-default-1/plugin.js | 9 +++++++++ .../rename/parameter-default-10/input.js | 5 +++++ .../rename/parameter-default-10/options.json | 3 +++ .../rename/parameter-default-10/output.js | 11 +++++++++++ .../rename/parameter-default-10/plugin.js | 9 +++++++++ .../rename/parameter-default-2/input.js | 5 +++++ .../rename/parameter-default-2/options.json | 3 +++ .../rename/parameter-default-2/output.js | 5 +++++ .../rename/parameter-default-2/plugin.js | 9 +++++++++ .../rename/parameter-default-3/input.js | 6 ++++++ .../rename/parameter-default-3/options.json | 3 +++ .../rename/parameter-default-3/output.js | 6 ++++++ .../rename/parameter-default-3/plugin.js | 9 +++++++++ .../rename/parameter-default-4/input.js | 8 ++++++++ .../rename/parameter-default-4/options.json | 3 +++ .../rename/parameter-default-4/output.js | 8 ++++++++ .../rename/parameter-default-4/plugin.js | 9 +++++++++ .../rename/parameter-default-5/input.js | 8 ++++++++ .../rename/parameter-default-5/options.json | 3 +++ .../rename/parameter-default-5/output.js | 8 ++++++++ .../rename/parameter-default-5/plugin.js | 9 +++++++++ .../rename/parameter-default-6/input.js | 5 +++++ .../rename/parameter-default-6/options.json | 3 +++ .../rename/parameter-default-6/output.js | 5 +++++ .../rename/parameter-default-6/plugin.js | 9 +++++++++ .../rename/parameter-default-7/input.js | 5 +++++ .../rename/parameter-default-7/options.json | 3 +++ .../rename/parameter-default-7/output.js | 5 +++++ .../rename/parameter-default-7/plugin.js | 9 +++++++++ .../rename/parameter-default-8/input.js | 5 +++++ .../rename/parameter-default-8/options.json | 3 +++ .../rename/parameter-default-8/output.js | 5 +++++ .../rename/parameter-default-8/plugin.js | 9 +++++++++ .../rename/parameter-default-9/input.js | 5 +++++ .../rename/parameter-default-9/options.json | 3 +++ .../rename/parameter-default-9/output.js | 5 +++++ .../rename/parameter-default-9/plugin.js | 9 +++++++++ packages/babel-traverse/test/scope.js | 19 +++++++++++++++++++ .../babel-types/src/validators/isScope.js | 7 +++++++ 44 files changed, 289 insertions(+), 2 deletions(-) create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-1/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-1/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-1/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-1/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-10/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-10/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-10/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-10/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-2/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-2/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-2/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-2/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-3/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-3/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-3/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-3/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-4/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-4/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-4/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-4/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-5/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-5/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-5/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-5/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-6/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-6/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-6/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-6/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-7/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-7/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-7/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-7/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-8/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-8/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-8/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-8/plugin.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-9/input.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-9/options.json create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-9/output.js create mode 100644 packages/babel-traverse/test/fixtures/rename/parameter-default-9/plugin.js diff --git a/packages/babel-traverse/src/path/lib/virtual-types.js b/packages/babel-traverse/src/path/lib/virtual-types.js index 97cec0e3af99..d7072d6f6e4a 100644 --- a/packages/babel-traverse/src/path/lib/virtual-types.js +++ b/packages/babel-traverse/src/path/lib/virtual-types.js @@ -64,7 +64,8 @@ export const Expression = { }; export const Scope = { - types: ["Scopable"], + // When pattern is inside the function params, it is a scope + types: ["Scopable", "Pattern"], checkPath(path) { return t.isScope(path.node, path.parent); }, diff --git a/packages/babel-traverse/src/scope/index.js b/packages/babel-traverse/src/scope/index.js index b26b59ce1844..9f9d78667336 100644 --- a/packages/babel-traverse/src/scope/index.js +++ b/packages/babel-traverse/src/scope/index.js @@ -897,10 +897,27 @@ export default class Scope { getBinding(name: string) { let scope = this; + let previousPath; do { const binding = scope.getOwnBinding(name); - if (binding) return binding; + if (binding) { + // Check if a pattern is a part of parameter expressions. + // 9.2.10.28: The closure created by this expression should not have visibility of + // declarations in the function body. If the binding is not a `param`-kind, + // then it must be defined inside the function body, thus it should be skipped + if ( + previousPath && + previousPath.isPattern() && + previousPath.parentPath.isFunction() && + binding.kind !== "param" + ) { + // do nothing + } else { + return binding; + } + } + previousPath = scope.path; } while ((scope = scope.parent)); } diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-1/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/input.js new file mode 100644 index 000000000000..c40f808feb63 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/input.js @@ -0,0 +1,7 @@ +let a = "outside"; + +function f(g = () => a) { + let a = "inside"; + return g(); +} + diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-1/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-1/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/output.js new file mode 100644 index 000000000000..32d258e83c15 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/output.js @@ -0,0 +1,6 @@ +let a = "outside"; + +function f(g = () => a) { + let z = "inside"; + return g(); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-1/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-1/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-10/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/input.js new file mode 100644 index 000000000000..60898eb184b6 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function r({ a: b }, { [a]: { c } = a }) { + g(a); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-10/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-10/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/output.js new file mode 100644 index 000000000000..91af3aed8340 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/output.js @@ -0,0 +1,11 @@ +let z = "outside"; + +function r({ + a: b +}, { + [z]: { + c + } = z +}) { + g(z); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-10/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-10/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-2/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/input.js new file mode 100644 index 000000000000..f80651d80616 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function h(a, g = () => a) { + return g(); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-2/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-2/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/output.js new file mode 100644 index 000000000000..dd64606a5b19 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/output.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function h(z, g = () => z) { + return g(); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-2/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-2/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-3/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/input.js new file mode 100644 index 000000000000..a6a4bdd4c336 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/input.js @@ -0,0 +1,6 @@ +let a = "outside"; + +function j(g = a) { + let a = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-3/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-3/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/output.js new file mode 100644 index 000000000000..a5cb0dab0cc3 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/output.js @@ -0,0 +1,6 @@ +let a = "outside"; + +function j(g = a) { + let z = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-3/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-3/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-4/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/input.js new file mode 100644 index 000000000000..0f7ddb008ef1 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/input.js @@ -0,0 +1,8 @@ +let a = "outside"; + +function k([{ + g = a +}]) { + let a = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-4/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-4/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/output.js new file mode 100644 index 000000000000..65ab1aa82f5f --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/output.js @@ -0,0 +1,8 @@ +let a = "outside"; + +function k([{ + g = a +}]) { + let z = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-4/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-4/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-5/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/input.js new file mode 100644 index 000000000000..9586b93c5fcb --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/input.js @@ -0,0 +1,8 @@ +let a = "outside"; + +function f([{ + [a]: g +}]) { + let a = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-5/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-5/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/output.js new file mode 100644 index 000000000000..f703a83d601b --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/output.js @@ -0,0 +1,8 @@ +let a = "outside"; + +function f([{ + [a]: g +}]) { + let z = "inside"; + return g; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-5/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-5/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-6/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/input.js new file mode 100644 index 000000000000..d33571e9a053 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function n(g = (a = a) => {}) { + let a = "inside"; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-6/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-6/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/output.js new file mode 100644 index 000000000000..917b0bb1c749 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/output.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function n(g = (a = a) => {}) { + let z = "inside"; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-6/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-6/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-7/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/input.js new file mode 100644 index 000000000000..273324bf46df --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function n(a, g = (a = a) => {}) { + a = "inside"; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-7/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-7/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/output.js new file mode 100644 index 000000000000..5d6b37398318 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/output.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function n(z, g = (a = a) => {}) { + z = "inside"; +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-7/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-7/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-8/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/input.js new file mode 100644 index 000000000000..3349776fcb77 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function q(a, g = (b = a) => b) { + g(a); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-8/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-8/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/output.js new file mode 100644 index 000000000000..3894a8a76152 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/output.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function q(z, g = (b = z) => b) { + g(z); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-8/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-8/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-9/input.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/input.js new file mode 100644 index 000000000000..4a57005f1db1 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/input.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function r(a, g = (a, b = a) => a) { + g(a); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-9/options.json b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/options.json new file mode 100644 index 000000000000..14af0e5feac8 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["./plugin"] +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-9/output.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/output.js new file mode 100644 index 000000000000..886bfcd11375 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/output.js @@ -0,0 +1,5 @@ +let a = "outside"; + +function r(z, g = (a, b = a) => a) { + g(z); +} diff --git a/packages/babel-traverse/test/fixtures/rename/parameter-default-9/plugin.js b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/plugin.js new file mode 100644 index 000000000000..830481588123 --- /dev/null +++ b/packages/babel-traverse/test/fixtures/rename/parameter-default-9/plugin.js @@ -0,0 +1,9 @@ +module.exports = function() { + return { + visitor: { + FunctionDeclaration(path) { + path.scope.rename("a", "z"); + } + } + }; +}; diff --git a/packages/babel-traverse/test/scope.js b/packages/babel-traverse/test/scope.js index aa7c0dba2752..b796dbf682f5 100644 --- a/packages/babel-traverse/test/scope.js +++ b/packages/babel-traverse/test/scope.js @@ -73,6 +73,25 @@ describe("scope", () => { ).toBe("Identifier"); }); + describe("function parameter expression", function() { + it("should not have visibility of declarations inside function body", () => { + expect( + getPath( + `var a = "outside"; (function foo(b = a) { let a = "inside" })`, + ) + .get("body.1.expression.params.0") + .scope.getBinding("a").path.node.init.value, + ).toBe("outside"); + }); + it("should have visibility on parameter bindings", () => { + expect( + getPath(`var a = "outside"; (function foo(b = a, a = "inside") {})`) + .get("body.1.expression.params.0") + .scope.getBinding("a").path.node.right.value, + ).toBe("inside"); + }); + }); + it("variable declaration", function() { expect(getPath("var foo = null;").scope.getBinding("foo").path.type).toBe( "VariableDeclarator", diff --git a/packages/babel-types/src/validators/isScope.js b/packages/babel-types/src/validators/isScope.js index 51d6c91924ec..dfd2f5edd96f 100644 --- a/packages/babel-types/src/validators/isScope.js +++ b/packages/babel-types/src/validators/isScope.js @@ -4,6 +4,7 @@ import { isCatchClause, isBlockStatement, isScopable, + isPattern, } from "./generated"; /** @@ -18,5 +19,11 @@ export default function isScope(node: Object, parent: Object): boolean { return false; } + // If a Pattern is an immediate descendent of a Function, it must be in the params. + // Hence we skipped the parentKey === "params" check + if (isPattern(node) && isFunction(parent)) { + return true; + } + return isScopable(node); } From 00758308aefcd8bd4dfc6f593cd25be6e5040da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 25 Dec 2019 01:22:37 +0100 Subject: [PATCH 894/965] Always use forked @lerna/collect-updates --- package.json | 2 +- yarn.lock | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 078257f7828d..235975a0ac67 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "typescript": "^3.6.3" }, "resolutions": { - "@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates" + "@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates" }, "engines": { "node": ">= 6.9.0 < 14.0.0", diff --git a/yarn.lock b/yarn.lock index 75ea480ede86..6f75361bf1c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1139,18 +1139,7 @@ figgy-pudding "^3.5.1" npmlog "^4.1.2" -"@lerna/collect-updates@3.18.0": - version "3.18.0" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-3.18.0.tgz#6086c64df3244993cc0a7f8fc0ddd6a0103008a6" - integrity sha512-LJMKgWsE/var1RSvpKDIxS8eJ7POADEc0HM3FQiTpEczhP6aZfv9x3wlDjaHpZm9MxJyQilqxZcasRANmRcNgw== - dependencies: - "@lerna/child-process" "3.16.5" - "@lerna/describe-ref" "3.16.5" - minimatch "^3.0.4" - npmlog "^4.1.2" - slash "^2.0.0" - -"@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": +"@lerna/collect-updates@3.18.0", "@lerna/collect-updates@https://github.com/babel/lerna.git#babel-collect-updates": version "3.16.0" resolved "https://github.com/babel/lerna.git#ae87fff020c5ad00366878c14b749e8ee0a34145" dependencies: From db3c31a8af0a4c79345df92fc84d4d99b9c4b2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 25 Dec 2019 13:13:23 -0500 Subject: [PATCH 895/965] fix: minified should not accept optional argument (#10923) --- packages/babel-cli/src/babel/options.js | 4 ++-- .../test/fixtures/babel/--minified/in-files/script.js | 1 + .../babel-cli/test/fixtures/babel/--minified/options.json | 3 +++ .../test/fixtures/babel/--minified/out-files/script2.js | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 packages/babel-cli/test/fixtures/babel/--minified/in-files/script.js create mode 100644 packages/babel-cli/test/fixtures/babel/--minified/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--minified/out-files/script2.js diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index fa09d6b64ed3..96b4aa9c2401 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -74,8 +74,8 @@ commander.option( booleanify, ); commander.option( - "--minified [true|false]", - "Save as many bytes when printing.", + "--minified", + "Save as many bytes when printing. (false by default)", ); commander.option( "--auxiliary-comment-before [string]", diff --git a/packages/babel-cli/test/fixtures/babel/--minified/in-files/script.js b/packages/babel-cli/test/fixtures/babel/--minified/in-files/script.js new file mode 100644 index 000000000000..3353ddb752c2 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--minified/in-files/script.js @@ -0,0 +1 @@ +() => 42; diff --git a/packages/babel-cli/test/fixtures/babel/--minified/options.json b/packages/babel-cli/test/fixtures/babel/--minified/options.json new file mode 100644 index 000000000000..2df8c827b826 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--minified/options.json @@ -0,0 +1,3 @@ +{ + "args": ["--out-file", "script2.js", "--no-comments", "--minified", "script.js"] +} diff --git a/packages/babel-cli/test/fixtures/babel/--minified/out-files/script2.js b/packages/babel-cli/test/fixtures/babel/--minified/out-files/script2.js new file mode 100644 index 000000000000..b9260cd4afe8 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--minified/out-files/script2.js @@ -0,0 +1 @@ +"use strict";(function(){return 42}); From 30f3b07ebf48ca116216f425849dd862cc2174ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 26 Dec 2019 00:44:33 +0100 Subject: [PATCH 896/965] Replace custom "findSuggestion" function with "levenary" (#10924) * Replace custom "findSuggestion" function with "levenary" * Update --- lib/third-party-libs.js.flow | 6 ------ packages/babel-preset-env/package.json | 2 +- packages/babel-preset-env/src/normalize-options.js | 2 +- packages/babel-preset-env/src/targets-parser.js | 8 ++------ packages/babel-preset-env/src/utils.js | 13 ------------- packages/babel-preset-env/test/utils.spec.js | 12 +----------- 6 files changed, 5 insertions(+), 38 deletions(-) diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index e4c31f2f42cd..f7314b07027e 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -190,12 +190,6 @@ declare module "convert-source-map" { }; } -declare module "js-levenshtein" { - declare module.exports: { - (string, string): number, - }; -} - declare module "core-js-compat/data" { declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung"; diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index efd61c921943..17bfe8f75f13 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -63,7 +63,7 @@ "browserslist": "^4.6.0", "core-js-compat": "^3.6.0", "invariant": "^2.2.2", - "js-levenshtein": "^1.1.3", + "levenary": "^1.1.0", "semver": "^5.5.0" }, "peerDependencies": { diff --git a/packages/babel-preset-env/src/normalize-options.js b/packages/babel-preset-env/src/normalize-options.js index 523857ea5832..79998befaeb4 100644 --- a/packages/babel-preset-env/src/normalize-options.js +++ b/packages/babel-preset-env/src/normalize-options.js @@ -8,7 +8,7 @@ import moduleTransformations from "./module-transformations"; import { TopLevelOptions, ModulesOption, UseBuiltInsOption } from "./options"; import { defaultWebIncludes } from "./polyfills/corejs2/get-platform-specific-default"; import { isBrowsersQueryValid } from "./targets-parser"; -import { findSuggestion } from "./utils"; +import findSuggestion from "levenary"; import type { BuiltInsOption, diff --git a/packages/babel-preset-env/src/targets-parser.js b/packages/babel-preset-env/src/targets-parser.js index 4c006bf2f073..f2284e715ca4 100644 --- a/packages/babel-preset-env/src/targets-parser.js +++ b/packages/babel-preset-env/src/targets-parser.js @@ -3,12 +3,8 @@ import browserslist from "browserslist"; import invariant from "invariant"; import semver from "semver"; -import { - semverify, - isUnreleasedVersion, - getLowestUnreleased, - findSuggestion, -} from "./utils"; +import findSuggestion from "levenary"; +import { semverify, isUnreleasedVersion, getLowestUnreleased } from "./utils"; import browserModulesData from "../data/built-in-modules.json"; import { TargetNames } from "./options"; import type { Targets } from "./types"; diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index cb35951a8f87..5b5aaae9b6f2 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -4,7 +4,6 @@ import * as t from "@babel/types"; import type { NodePath } from "@babel/traverse"; import invariant from "invariant"; import semver from "semver"; -import levenshtein from "js-levenshtein"; import { addSideEffect } from "@babel/helper-module-imports"; import unreleasedLabels from "../data/unreleased-labels"; import { semverMin } from "./targets-parser"; @@ -53,18 +52,6 @@ export function intersection( return result; } -export function findSuggestion(options: string[], option: string): string { - let levenshteinValue = Infinity; - return options.reduce((suggestion, validOption) => { - const value = levenshtein(validOption, option); - if (value < levenshteinValue) { - levenshteinValue = value; - return validOption; - } - return suggestion; - }, ""); -} - export function prettifyVersion(version: string) { if (typeof version !== "string") { return version; diff --git a/packages/babel-preset-env/test/utils.spec.js b/packages/babel-preset-env/test/utils.spec.js index 6a6bb48d3919..a5ca4256cda5 100644 --- a/packages/babel-preset-env/test/utils.spec.js +++ b/packages/babel-preset-env/test/utils.spec.js @@ -2,7 +2,7 @@ const utils = require("../lib/utils"); -const { prettifyTargets, prettifyVersion, semverify, findSuggestion } = utils; +const { prettifyTargets, prettifyVersion, semverify } = utils; describe("utils", () => { describe("semverify", () => { @@ -50,14 +50,4 @@ describe("utils", () => { }); }); }); - - describe("findSuggestion", () => { - it("returns", () => { - const options = ["one", "two", "three"]; - expect(findSuggestion(options, "onr")).toEqual("one"); - expect(findSuggestion(options, "tree")).toEqual("three"); - expect(findSuggestion(options, "")).toEqual("one"); - expect(findSuggestion(options, "xxx")).toEqual("one"); - }); - }); }); From e9dc74e78768988c51e21741ba982c7240fd30b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 26 Dec 2019 20:29:47 -0500 Subject: [PATCH 897/965] fix: Promise.any requires global.AggregateError (#10930) * fix: promise.any requires global.AggregateError * address review comments --- .../src/polyfills/corejs3/built-in-definitions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js index f3de8ef83733..2ed1915d87c5 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/built-in-definitions.js @@ -358,7 +358,11 @@ export const StaticProperties: ObjectMap> = { "esnext.promise.all-settled", ...PromiseDependenciesWithIterators, ], - any: ["esnext.promise.any", ...PromiseDependenciesWithIterators], + any: [ + "esnext.promise.any", + "esnext.aggregate-error", + ...PromiseDependenciesWithIterators, + ], race: PromiseDependenciesWithIterators, try: ["esnext.promise.try", ...PromiseDependenciesWithIterators], }, From b91720c1ccbfc066cbc6af7e3db6114acefac17a Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Sat, 28 Dec 2019 22:46:20 +0100 Subject: [PATCH 898/965] helper-module-transforms: dereference imported template tag (#10934) * Dereference imported template tag * apply fix for OptionalCallExpression as well --- .../src/rewrite-live-references.js | 4 +++- .../test/fixtures/strict/import/input.mjs | 2 ++ .../test/fixtures/strict/import/output.js | 2 ++ .../test/fixtures/strict/options.json | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) 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 f665926decb2..95f1daadd158 100644 --- a/packages/babel-helper-module-transforms/src/rewrite-live-references.js +++ b/packages/babel-helper-module-transforms/src/rewrite-live-references.js @@ -182,7 +182,9 @@ const rewriteReferencesVisitor = { ref.loc = path.node.loc; if ( - path.parentPath.isCallExpression({ callee: path.node }) && + (path.parentPath.isCallExpression({ callee: path.node }) || + path.parentPath.isOptionalCallExpression({ callee: path.node }) || + path.parentPath.isTaggedTemplateExpression({ tag: path.node })) && t.isMemberExpression(ref) ) { path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref])); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs index 5b84f44e6659..0195246aa49c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs @@ -7,3 +7,5 @@ foo; foo2; foo3; foo3(); +foo3``; +foo3?.(); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/output.js index 1c2bc5f8e059..445e5f55895c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/output.js @@ -5,3 +5,5 @@ foo4.default; foo4.default; foo4.foo3; (0, foo4.foo3)(); +(0, foo4.foo3)``; +(0, foo4.foo3)?.(); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json index caedc022efa4..39f3a7421118 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json @@ -2,6 +2,7 @@ "plugins": [ "external-helpers", "syntax-object-rest-spread", + "syntax-optional-chaining", [ "transform-modules-commonjs", { "strict": true, "mjsStrictNamespace": false } From 314513374de31b719cbd1ac5889ed3fddd4fe570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sun, 29 Dec 2019 21:35:19 -0500 Subject: [PATCH 899/965] chore: update test262 (#10943) * chore: update test262 * chore: ignore untoggleable features --- Makefile | 4 ++-- scripts/parser-tests/test262/index.js | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index acd9ed6df669..f7806f3af7b8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = 8688c4ab79059c3097098605e69f1ee5eda6c409 +TEST262_COMMIT = 157b18d16b5d52501c4d75ac422d3a80bfad1c17 TYPESCRIPT_COMMIT = 038d95144d8b93c2799d1732181c89c3d84362d5 FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" @@ -189,7 +189,7 @@ test-typescript-update-whitelist: bootstrap-test262: rm -rf build/test262 mkdir -p build - git clone --branch=master --single-branch --shallow-since=2019-09-01 https://github.com/tc39/test262.git build/test262 + git clone --branch=master --single-branch --shallow-since=2019-12-01 https://github.com/tc39/test262.git build/test262 cd build/test262 && git checkout $(TEST262_COMMIT) test-test262: diff --git a/scripts/parser-tests/test262/index.js b/scripts/parser-tests/test262/index.js index 0fd8eb229c42..e2f8b08fcae0 100644 --- a/scripts/parser-tests/test262/index.js +++ b/scripts/parser-tests/test262/index.js @@ -3,6 +3,7 @@ const TestStream = require("test262-stream"); const TestRunner = require("../utils/parser-test-runner"); const ignoredFeatures = [ + "AggregateError", "Array.prototype.flat", "Array.prototype.flatMap", "Array.prototype.values", @@ -31,6 +32,7 @@ const ignoredFeatures = [ "FinalizationGroup", "Float32Array", "Float64Array", + "for-in-order", "for-of", "generators", "globalThis", @@ -42,6 +44,7 @@ const ignoredFeatures = [ "Intl.DateTimeFormat-dayPeriod", "Intl.DateTimeFormat-fractionalSecondDigits", "Intl.DateTimeFormat-formatRange", + "Intl.DisplayNames", "Intl.ListFormat", "Intl.Locale", "Intl.NumberFormat-unified", @@ -76,6 +79,7 @@ const ignoredFeatures = [ "String.prototype.endsWith", "String.prototype.includes", "String.prototype.matchAll", + "String.prototype.replaceAll", "String.prototype.trimEnd", "String.prototype.trimStart", "string-trimming", @@ -118,6 +122,7 @@ const featuresToPlugins = { "class-static-fields-public": "classProperties", "class-static-fields-private": "classPrivateProperties", "class-static-methods-private": "classPrivateMethods", + "coalesce-expression": "nullishCoalescingOperator", "dynamic-import": "dynamicImport", "export-star-as-namespace-from-module": "exportNamespaceFrom", "import.meta": "importMeta", From 197a8da04d6ba00dfae82c131816af31fc1af261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Dec 2019 16:09:50 -0500 Subject: [PATCH 900/965] Remove unused parser methods (#10942) * chore: remove unused isStrictBody * chore: remove unused eatRelational --- .../babel-parser/src/parser/expression.js | 14 ------------- packages/babel-parser/src/parser/util.js | 10 ---------- packages/babel-parser/src/plugins/estree.js | 20 ------------------- 3 files changed, 44 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 4660d3cc0797..9eb7a15fa4c5 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1892,20 +1892,6 @@ export default class ExpressionParser extends LValParser { ); } - isStrictBody(node: { body: N.BlockStatement }): boolean { - const isBlockStatement = node.body.type === "BlockStatement"; - - if (isBlockStatement && node.body.directives.length) { - for (const directive of node.body.directives) { - if (directive.value.value === "use strict") { - return true; - } - } - } - - return false; - } - parseFunctionBodyAndFinish( node: N.BodilessFunctionOrMethodBase, type: string, diff --git a/packages/babel-parser/src/parser/util.js b/packages/babel-parser/src/parser/util.js index f1093f31b57f..e37becfa1a73 100644 --- a/packages/babel-parser/src/parser/util.js +++ b/packages/babel-parser/src/parser/util.js @@ -58,16 +58,6 @@ export default class UtilParser extends Tokenizer { } } - // eat() for relational operators. - - eatRelational(op: "<" | ">"): boolean { - if (this.isRelational(op)) { - this.next(); - return true; - } - return false; - } - // Tests whether parsed token is a contextual keyword. isContextual(name: string): boolean { diff --git a/packages/babel-parser/src/plugins/estree.js b/packages/babel-parser/src/plugins/estree.js index fc7640de1764..5fd0ab11350c 100644 --- a/packages/babel-parser/src/plugins/estree.js +++ b/packages/babel-parser/src/plugins/estree.js @@ -174,26 +174,6 @@ export default (superClass: Class): Class => } } - isStrictBody(node: { body: N.BlockStatement }): boolean { - const isBlockStatement = node.body.type === "BlockStatement"; - - if (isBlockStatement && node.body.body.length > 0) { - for (const directive of node.body.body) { - if ( - directive.type === "ExpressionStatement" && - directive.expression.type === "Literal" - ) { - if (directive.expression.value === "use strict") return true; - } else { - // Break for the first non literal expression - break; - } - } - } - - return false; - } - isValidDirective(stmt: N.Statement): boolean { return ( stmt.type === "ExpressionStatement" && From 86245a83a2e58fc0bbbe28b9bf9a4b77a53ea5b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Dec 2019 16:10:19 -0500 Subject: [PATCH 901/965] TSTypeCastExpression should not be inside call parameters (#10939) --- .../src/plugins/typescript/index.js | 6 +- .../cast/parameter-typecast/input.ts | 1 + .../cast/parameter-typecast/output.json | 166 ++++++++++++++++++ 3 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 2b442620a507..0c740b2c9bdd 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -2568,11 +2568,7 @@ export default (superClass: Class): Class => ): $ReadOnlyArray { for (let i = 0; i < exprList.length; i++) { const expr = exprList[i]; - if ( - expr && - expr._exprListItem && - expr.type === "TsTypeCastExpression" - ) { + if (expr && expr.type === "TSTypeCastExpression") { this.raise(expr.start, "Did not expect a type annotation here."); } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/input.ts b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/input.ts new file mode 100644 index 000000000000..c494cc00bc39 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/input.ts @@ -0,0 +1 @@ +func(a: T); diff --git a/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json new file mode 100644 index 000000000000..d815e81603d1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/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: Did not expect a type annotation here. (1:5)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "sourceType": "module", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "expression": { + "type": "CallExpression", + "start": 0, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 4, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 4 + }, + "identifierName": "func" + }, + "name": "func" + }, + "arguments": [ + { + "type": "TSTypeCastExpression", + "start": 5, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "expression": { + "type": "Identifier", + "start": 5, + "end": 6, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 6 + }, + "identifierName": "a" + }, + "name": "a" + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 6, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "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" + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file From 30449fe05d8a3a852adcd8e710ebefd5309e898f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Dec 2019 16:11:39 -0500 Subject: [PATCH 902/965] Refactor parseSubscript (#10937) * refactor: unify optionalMemberExpression generation * test: add optional calls invalid typecasts * fix: do not parse async arrow when call is optional * test: update test fixtures --- .../babel-parser/src/parser/expression.js | 82 ++++----- .../fail-in-async-optional-calls/input.js | 1 + .../fail-in-async-optional-calls/options.json | 8 + .../typecasts/fail-in-optional-calls/input.js | 1 + .../fail-in-optional-calls/options.json | 7 + .../fail-in-optional-calls/output.json | 167 ++++++++++++++++++ 6 files changed, 219 insertions(+), 47 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/input.js create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/options.json create mode 100644 packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9eb7a15fa4c5..4b7a4558426b 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -582,63 +582,46 @@ export default class ExpressionParser extends LValParser { startLoc, noCalls, ); - } else if (this.match(tt.questionDot)) { + } + let optional = false; + if (this.match(tt.questionDot)) { this.expectPlugin("optionalChaining"); - state.optionalChainMember = true; + state.optionalChainMember = optional = true; if (noCalls && this.lookaheadCharCode() === charCodes.leftParenthesis) { state.stop = true; return base; } this.next(); - - const node = this.startNodeAt(startPos, startLoc); - - if (this.eat(tt.bracketL)) { - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - node.optional = true; - this.expect(tt.bracketR); - return this.finishNode(node, "OptionalMemberExpression"); - } else if (this.eat(tt.parenL)) { - node.callee = base; - node.arguments = this.parseCallExpressionArguments(tt.parenR, false); - node.optional = true; - return this.finishCallExpression(node, /* optional */ true); - } else { - node.object = base; - node.property = this.parseIdentifier(true); - node.computed = false; - node.optional = true; - return this.finishNode(node, "OptionalMemberExpression"); - } - } else if (this.eat(tt.dot)) { + } + const computed = this.eat(tt.bracketL); + if ( + (optional && !this.match(tt.parenL) && !this.match(tt.backQuote)) || + computed || + this.eat(tt.dot) + ) { const node = this.startNodeAt(startPos, startLoc); node.object = base; - node.property = this.parseMaybePrivateName(); - node.computed = false; + node.property = computed + ? this.parseExpression() + : optional + ? this.parseIdentifier(true) + : this.parseMaybePrivateName(); + node.computed = computed; if ( node.property.type === "PrivateName" && node.object.type === "Super" ) { this.raise(startPos, "Private fields can't be accessed on super"); } - if (state.optionalChainMember) { - node.optional = false; - return this.finishNode(node, "OptionalMemberExpression"); + if (computed) { + this.expect(tt.bracketR); } - return this.finishNode(node, "MemberExpression"); - } else if (this.eat(tt.bracketL)) { - const node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(tt.bracketR); if (state.optionalChainMember) { - node.optional = false; + node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); + } else { + return this.finishNode(node, "MemberExpression"); } - return this.finishNode(node, "MemberExpression"); } else if (!noCalls && this.match(tt.parenL)) { const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; const oldYieldPos = this.state.yieldPos; @@ -652,16 +635,21 @@ export default class ExpressionParser extends LValParser { let node = this.startNodeAt(startPos, startLoc); node.callee = base; - node.arguments = this.parseCallExpressionArguments( - tt.parenR, - state.maybeAsyncArrow, - base.type === "Import", - base.type !== "Super", - node, - ); + if (optional) { + node.optional = true; + node.arguments = this.parseCallExpressionArguments(tt.parenR, false); + } else { + node.arguments = this.parseCallExpressionArguments( + tt.parenR, + state.maybeAsyncArrow, + base.type === "Import", + base.type !== "Super", + node, + ); + } this.finishCallExpression(node, state.optionalChainMember); - if (state.maybeAsyncArrow && this.shouldParseAsyncArrow()) { + if (state.maybeAsyncArrow && this.shouldParseAsyncArrow() && !optional) { state.stop = true; node = this.parseAsyncArrowFromCallExpression( diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/input.js b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/input.js new file mode 100644 index 000000000000..961846976c7a --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/input.js @@ -0,0 +1 @@ +async?.(bar: string) => {} diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/options.json new file mode 100644 index 000000000000..3c7c9c589b44 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-async-optional-calls/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "plugins": [ + "flow", + "optionalChaining" + ], + "throws": "Unexpected token, expected \";\" (1:21)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/input.js b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/input.js new file mode 100644 index 000000000000..14df4e2b16c7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/input.js @@ -0,0 +1 @@ +funccall?.(a, b: string); diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/options.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/options.json new file mode 100644 index 000000000000..0e7765c73ae7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/options.json @@ -0,0 +1,7 @@ +{ + "sourceType": "module", + "plugins": [ + "flow", + "optionalChaining" + ] +} diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json new file mode 100644 index 000000000000..84fcef591c74 --- /dev/null +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json @@ -0,0 +1,167 @@ +{ + "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: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": "ExpressionStatement", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 25 + } + }, + "expression": { + "type": "OptionalCallExpression", + "start": 0, + "end": 24, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 24 + } + }, + "callee": { + "type": "Identifier", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "funccall" + }, + "name": "funccall" + }, + "optional": true, + "arguments": [ + { + "type": "Identifier", + "start": 11, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + { + "type": "TypeCastExpression", + "start": 14, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "expression": { + "type": "Identifier", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + }, + "identifierName": "b" + }, + "name": "b" + }, + "typeAnnotation": { + "type": "TypeAnnotation", + "start": 15, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "typeAnnotation": { + "type": "StringTypeAnnotation", + "start": 17, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 23 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file From 2f3f77926dc53f6c2447e72d0f1553bed5da4a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Dec 2019 16:11:56 -0500 Subject: [PATCH 903/965] refactor: remove unused invalidTemplateEscapePosition tokenizer state (#10935) * refactor: remove unused invalidTemplateEscapePosition tokenizer state * fix flow error --- packages/babel-parser/src/parser/expression.js | 8 +------- packages/babel-parser/src/tokenizer/index.js | 11 +---------- packages/babel-parser/src/tokenizer/state.js | 2 -- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 4b7a4558426b..1c83e5073bfa 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1430,13 +1430,7 @@ export default class ExpressionParser extends LValParser { const elem = this.startNode(); if (this.state.value === null) { if (!isTagged) { - // TODO: fix this - this.raise( - this.state.invalidTemplateEscapePosition || 0, - "Invalid escape sequence in template", - ); - } else { - this.state.invalidTemplateEscapePosition = null; + this.raise(this.state.start + 1, "Invalid escape sequence in template"); } } elem.value = { diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 32c8a03fc0b9..3e497106ee2d 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1122,14 +1122,10 @@ export default class Tokenizer extends LocationParser { throwOnInvalid, ); ++this.state.pos; - if (code === null) { - // $FlowFixMe (is this always non-null?) - --this.state.invalidTemplateEscapePosition; // to point to the '\'' instead of the 'u' - } else if (code > 0x10ffff) { + if (code !== null && code > 0x10ffff) { if (throwOnInvalid) { this.raise(codePos, "Code point out of bounds"); } else { - this.state.invalidTemplateEscapePosition = codePos - 2; return null; } } @@ -1274,9 +1270,6 @@ export default class Tokenizer extends LocationParser { case charCodes.digit8: case charCodes.digit9: if (inTemplate) { - const codePos = this.state.pos - 1; - - this.state.invalidTemplateEscapePosition = codePos; return null; } default: @@ -1299,7 +1292,6 @@ export default class Tokenizer extends LocationParser { next === charCodes.digit9 ) { if (inTemplate) { - this.state.invalidTemplateEscapePosition = codePos; return null; } else if (this.state.strict) { this.raise(codePos, "Octal literal in strict mode"); @@ -1332,7 +1324,6 @@ export default class Tokenizer extends LocationParser { this.raise(codePos, "Bad character escape sequence"); } else { this.state.pos = codePos - 1; - this.state.invalidTemplateEscapePosition = codePos - 1; } } return n; diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index d3f370df1473..874b5cbdfcad 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -156,8 +156,6 @@ export default class State { // `export default foo;` and `export { foo as default };`. exportedIdentifiers: Array = []; - invalidTemplateEscapePosition: ?number = null; - curPosition(): Position { return new Position(this.curLine, this.pos - this.lineStart); } From 02382442682a1bda66ae900225c878a0325d91e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 30 Dec 2019 16:12:09 -0500 Subject: [PATCH 904/965] refactor: remove unecessary checkYieldAwaitInDefaultParams (#10936) --- packages/babel-parser/src/parser/expression.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 1c83e5073bfa..1ef6fcf82f96 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1821,7 +1821,6 @@ export default class ExpressionParser extends LValParser { (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0), ); this.parseFunctionParams((node: any), allowModifiers); - this.checkYieldAwaitInDefaultParams(); this.parseFunctionBodyAndFinish(node, type, true); this.scope.exit(); From 26eb8918702552c98bbe2dd9f41dd1d6aaeb7a1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 31 Dec 2019 09:36:03 -0500 Subject: [PATCH 905/965] fix: Class Field Initializer should not allow await expression as immediate child (#10946) * fix: scope.inAsync should exclude reference in class property initializers * chore: add test on await in computed class property * fix flow error :( --- packages/babel-parser/src/util/scope.js | 15 +- .../await-inside-class-methods/input.js | 3 + .../await-inside-class-methods/output.json | 210 ++++++++++++++ .../input.js | 3 + .../output.json | 177 +++++++++++ .../input.js | 3 + .../options.json | 3 + .../output.json | 187 ++++++++++++ .../input.js | 6 + .../options.json | 3 + .../output.json | 274 ++++++++++++++++++ .../await-in-async-in-class-property/input.js | 3 + .../options.json | 3 + .../output.json | 190 ++++++++++++ .../await-in-class-property-in-async/input.js | 6 + .../options.json | 3 + .../output.json | 260 +++++++++++++++++ 17 files changed, 1348 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index f367ae5e76b6..bc90be4d03cb 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -55,8 +55,21 @@ export default class ScopeHandler { get inGenerator() { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0; } + // the following loop always exit because SCOPE_PROGRAM is SCOPE_VAR + // $FlowIgnore get inAsync() { - return (this.currentVarScope().flags & SCOPE_ASYNC) > 0; + for (let i = this.scopeStack.length - 1; ; i--) { + const scope = this.scopeStack[i]; + const isVarScope = scope.flags & SCOPE_VAR; + const isClassScope = scope.flags & SCOPE_CLASS; + if (isClassScope && !isVarScope) { + // If it meets a class scope before a var scope, it means it is a class property initializer + // which does not have an [Await] parameter in its grammar + return false; + } else if (isVarScope) { + return (scope.flags & SCOPE_ASYNC) > 0; + } + } } get allowSuper() { return (this.currentThisScope().flags & SCOPE_SUPER) > 0; diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/input.js new file mode 100644 index 000000000000..7a48dfc20087 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/input.js @@ -0,0 +1,3 @@ +() => class { + async m() { await 42 } +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json new file mode 100644 index 000000000000..04024e014271 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json @@ -0,0 +1,210 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "ClassExpression", + "start": 6, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 12, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "m" + }, + "name": "m" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 24 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 28, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "expression": { + "type": "AwaitExpression", + "start": 28, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 2, + "column": 20 + }, + "end": { + "line": 2, + "column": 22 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + ], + "directives": [] + } + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/input.js new file mode 100644 index 000000000000..d18a372142f7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/input.js @@ -0,0 +1,3 @@ +async () => class { + [await 42]() { } +} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json new file mode 100644 index 000000000000..2518cd543d0f --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json @@ -0,0 +1,177 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "ClassExpression", + "start": 12, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "id": null, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 18, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 22, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "static": false, + "computed": true, + "key": { + "type": "AwaitExpression", + "start": 23, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 15 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js new file mode 100644 index 000000000000..f01601af7a3a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/input.js @@ -0,0 +1,3 @@ +class C { + #p = async () => await 42; +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json new file mode 100644 index 000000000000..f26e916957c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json new file mode 100644 index 000000000000..ebac6a0e3b90 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json @@ -0,0 +1,187 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "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": "p" + }, + "name": "p" + } + }, + "value": { + "type": "ArrowFunctionExpression", + "start": 17, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "AwaitExpression", + "start": 29, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "argument": { + "type": "NumericLiteral", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 2, + "column": 25 + }, + "end": { + "line": 2, + "column": 27 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js new file mode 100644 index 000000000000..f2cbab75f49c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/input.js @@ -0,0 +1,6 @@ +async () => { + class C { + // here await is an identifier reference + #p = await + 42; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json new file mode 100644 index 000000000000..f26e916957c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json new file mode 100644 index 000000000000..cc5429e9fce3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json @@ -0,0 +1,274 @@ +{ + "type": "File", + "start": 0, + "end": 97, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 97, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 97, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 97, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 97, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 16, + "end": 95, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 24, + "end": 95, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 75, + "end": 91, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 20 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 75, + "end": 77, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 6 + } + }, + "id": { + "type": "Identifier", + "start": 76, + "end": 77, + "loc": { + "start": { + "line": 4, + "column": 5 + }, + "end": { + "line": 4, + "column": 6 + }, + "identifierName": "p" + }, + "name": "p" + } + }, + "value": { + "type": "BinaryExpression", + "start": 80, + "end": 90, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "left": { + "type": "Identifier", + "start": 80, + "end": 85, + "loc": { + "start": { + "line": 4, + "column": 9 + }, + "end": { + "line": 4, + "column": 14 + }, + "identifierName": "await" + }, + "name": "await" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 88, + "end": 90, + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start": 30, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 44 + } + } + } + ] + } + ] + } + } + ], + "directives": [] + } + } + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start": 30, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 44 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js new file mode 100644 index 000000000000..388ae60d9f00 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/input.js @@ -0,0 +1,3 @@ +class C { + p = async () => await + 42; +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json new file mode 100644 index 000000000000..9c27576d4ad0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json new file mode 100644 index 000000000000..0031d27b4529 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json @@ -0,0 +1,190 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassProperty", + "start": 12, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 29 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 13, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "p" + }, + "name": "p" + }, + "computed": false, + "value": { + "type": "ArrowFunctionExpression", + "start": 16, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "AwaitExpression", + "start": 28, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "argument": { + "type": "UnaryExpression", + "start": 34, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 24 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "operator": "+", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 2, + "column": 26 + }, + "end": { + "line": 2, + "column": 28 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js new file mode 100644 index 000000000000..84a94bd55ed8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/input.js @@ -0,0 +1,6 @@ +async () => { + class C { + // here await is an identifier reference + p = await + 42; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json new file mode 100644 index 000000000000..9c27576d4ad0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json new file mode 100644 index 000000000000..34bc34826eca --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json @@ -0,0 +1,260 @@ +{ + "type": "File", + "start": 0, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [], + "body": { + "type": "BlockStatement", + "start": 12, + "end": 96, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 16, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "id": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 24, + "end": 94, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "ClassProperty", + "start": 75, + "end": 90, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 75, + "end": 76, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + }, + "identifierName": "p" + }, + "name": "p" + }, + "computed": false, + "value": { + "type": "BinaryExpression", + "start": 79, + "end": 89, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "left": { + "type": "Identifier", + "start": 79, + "end": 84, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 13 + }, + "identifierName": "await" + }, + "name": "await" + }, + "operator": "+", + "right": { + "type": "NumericLiteral", + "start": 87, + "end": 89, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + }, + "leadingComments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start": 30, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 44 + } + } + } + ] + } + ] + } + } + ], + "directives": [] + } + } + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " here await is an identifier reference", + "start": 30, + "end": 70, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 3, + "column": 44 + } + } + } + ] +} \ No newline at end of file From daaa2063bb8755249d61bd3f5617336983bf4193 Mon Sep 17 00:00:00 2001 From: Jayen Ashar Date: Thu, 2 Jan 2020 01:36:20 +1100 Subject: [PATCH 906/965] Override toString in case this function is printed (#10949) * Override toString in case this function is printed Related to https://stackoverflow.com/questions/59543968/unexpected-return-value-from-visitor-method * Don't override `toString` if `wrapper` is true Override `toString` immediately before returning a newFn, otherwise it will be overridden if wrapper is true https://github.com/babel/babel/pull/10949#discussion_r362302625 * prettier --- packages/babel-traverse/src/visitors.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/babel-traverse/src/visitors.js b/packages/babel-traverse/src/visitors.js index 77c1488d5d55..eb8516a451fa 100644 --- a/packages/babel-traverse/src/visitors.js +++ b/packages/babel-traverse/src/visitors.js @@ -227,6 +227,11 @@ function wrapWithStateOrWrapper(oldVisitor, state, wrapper: ?Function) { newFn = wrapper(state.key, key, newFn); } + // Override toString in case this function is printed, we want to print the wrapped function, same as we do in `wrapCheck` + if (newFn !== fn) { + newFn.toString = () => fn.toString(); + } + return newFn; }); From 9f832c271647b71a21baf5ba61fd75cb5db6f754 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Thu, 2 Jan 2020 18:36:58 -0500 Subject: [PATCH 907/965] @babel/eslint-parser: Fix ClassPrivateMethods (#10913) --- eslint/babel-eslint-parser/package.json | 1 + .../babel-eslint-parser/src/analyze-scope.js | 25 +++-- .../test/babel-eslint-parser.js | 2 +- .../test/fixtures/config/babel.config.js | 1 + .../test/non-regression.js | 104 ++++++++++++++---- 5 files changed, 103 insertions(+), 30 deletions(-) diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index 0205facb646d..b64d7a051af3 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -34,6 +34,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", "@babel/plugin-proposal-optional-chaining": "^7.0.0", "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-private-methods": "^7.7.4", "@babel/plugin-syntax-bigint": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.0.0", "@babel/plugin-syntax-export-default-from": "^7.0.0", diff --git a/eslint/babel-eslint-parser/src/analyze-scope.js b/eslint/babel-eslint-parser/src/analyze-scope.js index 24a1b5491c12..ffb9eb95ba82 100644 --- a/eslint/babel-eslint-parser/src/analyze-scope.js +++ b/eslint/babel-eslint-parser/src/analyze-scope.js @@ -16,16 +16,16 @@ const flowFlippedAliasKeys = t.FLIPPED_ALIAS_KEYS.Flow.concat([ "ObjectPattern", "RestElement", ]); -const visitorKeysMap = Object.entries(t.VISITOR_KEYS).reduce(function( - acc, - [key, value], -) { - if (flowFlippedAliasKeys.indexOf(value) === -1) { - acc[key] = value; - } - return acc; -}, -{}); + +const visitorKeysMap = Object.entries(t.VISITOR_KEYS).reduce( + (acc, [key, value]) => { + if (!flowFlippedAliasKeys.includes(value)) { + acc[key] = value; + } + return acc; + }, + {}, +); const propertyTypes = { // loops @@ -166,6 +166,11 @@ class Referencer extends OriginalReferencer { this._visitClassProperty(node); } + // TODO: Update to visit type annotations when TypeScript/Flow support this syntax. + ClassPrivateMethod(node) { + super.MethodDefinition(node); + } + DeclareModule(node) { this._visitDeclareX(node); } diff --git a/eslint/babel-eslint-parser/test/babel-eslint-parser.js b/eslint/babel-eslint-parser/test/babel-eslint-parser.js index fb75112dc966..3924875d38d5 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint-parser.js +++ b/eslint/babel-eslint-parser/test/babel-eslint-parser.js @@ -270,7 +270,7 @@ describe("babylon-to-espree", () => { assert.strictEqual(babylonAST.tokens[1].type, "Punctuator"); }); - // Espree doesn't support the private fields yet + // Espree doesn't support private fields yet it("hash (token)", () => { const code = "class A { #x }"; const babylonAST = parseForESLint(code, { diff --git a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js index 56a2f07d9707..b84b8d0b3cca 100644 --- a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js +++ b/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js @@ -18,5 +18,6 @@ module.exports = { ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: false }], ["@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" }], "@babel/plugin-syntax-bigint", + "@babel/plugin-proposal-private-methods", ], }; diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index dca0b489d9ec..418c651d1640 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -1763,27 +1763,77 @@ describe("verify", () => { ); }); - describe("private class properties", () => { - it("should not be undefined", () => { - verifyAndAssertMessages( - ` - class C { - #d = 1; - } - `, - { "no-undef": 1 }, - ); + describe("class field declarations", () => { + describe("field declarations", () => { + it("should not be undefined", () => { + verifyAndAssertMessages( + ` + class C { + d = 1; + } + `, + { "no-undef": 1 }, + ); + }); + + it("should not be unused", () => { + verifyAndAssertMessages( + ` + export class C { + d = 1; + } + `, + { "no-unused-vars": 1 }, + ); + }); }); - it("should not be unused", () => { - verifyAndAssertMessages( - ` - export class C { - #d = 1; - } - `, - { "no-unused-vars": 1 }, - ); + describe("private field declarations", () => { + it("should not be undefined", () => { + verifyAndAssertMessages( + ` + class C { + #d = 1; + } + `, + { "no-undef": 1 }, + ); + }); + + it("should not be unused", () => { + verifyAndAssertMessages( + ` + export class C { + #d = 1; + } + `, + { "no-unused-vars": 1 }, + ); + }); + }); + + describe("private methods", () => { + it("should not be undefined", () => { + verifyAndAssertMessages( + ` + class C { + #d() {}; + } + `, + { "no-undef": 1 }, + ); + }); + + it("should not be unused", () => { + verifyAndAssertMessages( + ` + export class C { + #d() {}; + } + `, + { "no-unused-vars": 1 }, + ); + }); }); }); @@ -1853,6 +1903,22 @@ describe("verify", () => { ); }); + it("works with classPrivateMethods", () => { + verifyAndAssertMessages( + ` + class A { #a(b, c) {} } + `, + ); + }); + + it("works with arrow function classPrivateProperties", () => { + verifyAndAssertMessages( + ` + class A { #a = (a, b) => {}; } + `, + ); + }); + it("works with optionalCatchBinding", () => { verifyAndAssertMessages( ` From e5048053aac37149178b56b969b429cc7d90dab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 17:06:13 -0500 Subject: [PATCH 908/965] Add integration test: e2e-vue-cli (#10919) * chore: add e2e-vue-cli test * chore: add node-browsers-executor * chore: state why node-browsers-executor is required --- .circleci/config.yml | 17 ++++++++++++ scripts/integration-tests/e2e-vue-cli.sh | 33 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100755 scripts/integration-tests/e2e-vue-cli.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d6df0a9428e..edf8c3c68d42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,6 +48,11 @@ executors: docker: - image: circleci/node:13 working_directory: ~/babel + # e2e-vue-cli test requires chromium + node-browsers-executor: + docker: + - image: circleci/node:13-browsers + working_directory: ~/babel jobs: build-standalone: @@ -153,6 +158,14 @@ jobs: at: /tmp/verdaccio-workspace - run: ./scripts/integration-tests/e2e-create-react-app.sh + e2e-vue-cli: + executor: node-browsers-executor + steps: + - checkout + - attach_workspace: + at: /tmp/verdaccio-workspace + - run: ./scripts/integration-tests/e2e-vue-cli.sh + workflows: version: 2 build-standalone: @@ -189,3 +202,7 @@ workflows: - e2e-create-react-app: requires: - publish-verdaccio + - e2e-vue-cli: + requires: + - publish-verdaccio + diff --git a/scripts/integration-tests/e2e-vue-cli.sh b/scripts/integration-tests/e2e-vue-cli.sh new file mode 100755 index 000000000000..c640661652a9 --- /dev/null +++ b/scripts/integration-tests/e2e-vue-cli.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +#==============================================================================# +# SETUP # +#==============================================================================# + +# Start in scripts/integration-tests/ even if run from root directory +cd "$(dirname "$0")" || exit + +source utils/local-registry.sh +source utils/cleanup.sh + +# Echo every command being executed +set -x + +# Clone vue-cli +git clone --depth=1 https://github.com/vuejs/vue-cli tmp/vue-cli +cd tmp/vue-cli || exit + +#==============================================================================# +# TEST # +#==============================================================================# + +startLocalRegistry "$PWD"/../../verdaccio-config.yml +yarn install +# "yarn upgrade --scope @babel --latest" doesn't seem to work. +# a means "all", while \n is the enter needed to confirm the selection. +printf "a\n" | yarn upgrade-interactive --scope @babel --latest + +# Test +CI=true yarn test -p babel + +cleanup From 6ee8c97e6a949fb4b07043a26143a49df37e6ad3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 17:07:11 -0500 Subject: [PATCH 909/965] =?UTF-8?q?Fix:=20TopLevelAwait=20should=20respect?= =?UTF-8?q?=20await=20identifiers=20defined=20in=E2=80=A6=20(#10947)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/babel-parser/src/parser/expression.js | 11 +++++++++-- packages/babel-parser/src/parser/index.js | 8 ++++++-- .../top-level-await/inside-class-property/input.js | 3 +++ .../inside-class-property/options.json | 8 ++++++++ .../module-namespace/top-level-await/input.ts | 3 +++ .../module-namespace/top-level-await/options.json | 8 ++++++++ 6 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json create mode 100644 packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/input.ts create mode 100644 packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/options.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 1ef6fcf82f96..b4f1d89c06c5 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -39,6 +39,7 @@ import { SCOPE_DIRECT_SUPER, SCOPE_SUPER, SCOPE_PROGRAM, + SCOPE_ASYNC, } from "../util/scopeflags"; export default class ExpressionParser extends LValParser { @@ -96,7 +97,11 @@ export default class ExpressionParser extends LValParser { // Convenience method to parse an Expression only getExpression(): N.Expression { - this.scope.enter(SCOPE_PROGRAM); + let scopeFlags = SCOPE_PROGRAM; + if (this.hasPlugin("topLevelAwait") && this.inModule) { + scopeFlags |= SCOPE_ASYNC; + } + this.scope.enter(scopeFlags); this.nextToken(); const expr = this.parseExpression(); if (!this.match(tt.eof)) { @@ -2186,7 +2191,9 @@ 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; + if (this.hasPlugin("topLevelAwait")) { + return this.inModule && this.scope.inAsync; + } return false; } diff --git a/packages/babel-parser/src/parser/index.js b/packages/babel-parser/src/parser/index.js index 2c96336f1c13..681de32d0560 100644 --- a/packages/babel-parser/src/parser/index.js +++ b/packages/babel-parser/src/parser/index.js @@ -5,7 +5,7 @@ import type { File, JSXOpeningElement } from "../types"; import type { PluginList } from "../plugin-utils"; import { getOptions } from "../options"; import StatementParser from "./statement"; -import { SCOPE_PROGRAM } from "../util/scopeflags"; +import { SCOPE_ASYNC, SCOPE_PROGRAM } from "../util/scopeflags"; import ScopeHandler from "../util/scope"; export type PluginsMap = Map; @@ -35,7 +35,11 @@ export default class Parser extends StatementParser { } parse(): File { - this.scope.enter(SCOPE_PROGRAM); + let scopeFlags = SCOPE_PROGRAM; + if (this.hasPlugin("topLevelAwait") && this.inModule) { + scopeFlags |= SCOPE_ASYNC; + } + this.scope.enter(scopeFlags); const file = this.startNode(); const program = this.startNode(); this.nextToken(); diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/input.js b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/input.js new file mode 100644 index 000000000000..d17e57ee1081 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/input.js @@ -0,0 +1,3 @@ +export class C { + p = await 0; +} diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json new file mode 100644 index 000000000000..0688c012b357 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-class-property/options.json @@ -0,0 +1,8 @@ +{ + "plugins": [ + "topLevelAwait", + "classProperties" + ], + "sourceType": "module", + "throws": "Unexpected token, expected \";\" (2:12)" +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/input.ts b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/input.ts new file mode 100644 index 000000000000..9302309c5933 --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/input.ts @@ -0,0 +1,3 @@ +namespace N { + const x = await 42; +} diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/options.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/options.json new file mode 100644 index 000000000000..ba579946562a --- /dev/null +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/top-level-await/options.json @@ -0,0 +1,8 @@ +{ + "sourceType": "module", + "plugins": [ + "typescript", + "topLevelAwait" + ], + "throws": "Unexpected token, expected \";\" (2:20)" +} \ No newline at end of file From 467667af88b16d6eb18877a1c3237356dd7a799f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 17:07:54 -0500 Subject: [PATCH 910/965] =?UTF-8?q?When=20reading=20a=20new=20string,=20U+?= =?UTF-8?q?2028/2029=20should=20correctly=20set=20th=E2=80=A6=20(#10944)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: add test on template * fix: update lineStart when string contains U+2028/U+2029 --- packages/babel-parser/src/tokenizer/index.js | 1 + .../directive-line-separator/output.json | 4 +- .../directive-paragraph-separator/output.json | 4 +- .../string-line-separator/output.json | 4 +- .../string-paragraph-separator/output.json | 4 +- .../template-line-separator/input.js | 2 + .../template-line-separator/output.json | 128 ++++++++++++++++++ .../template-paragraph-separator/input.js | 2 + .../template-paragraph-separator/output.json | 128 ++++++++++++++++++ 9 files changed, 269 insertions(+), 8 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/input.js create mode 100644 packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json create mode 100644 packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/input.js create mode 100644 packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 3e497106ee2d..27f1aaa15f96 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -1155,6 +1155,7 @@ export default class Tokenizer extends LocationParser { ) { ++this.state.pos; ++this.state.curLine; + this.state.lineStart = this.state.pos; } else if (isNewLine(ch)) { throw this.raise(this.state.start, "Unterminated string constant"); } else { diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json index 8bf9f02e8706..503c5e4d17c2 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-line-separator/output.json @@ -41,7 +41,7 @@ }, "end": { "line": 2, - "column": 15 + "column": 7 } }, "value": { @@ -55,7 +55,7 @@ }, "end": { "line": 2, - "column": 14 + "column": 6 } }, "value": "before
after", diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json index f83d867447e7..ac843e7faa2c 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/directive-paragraph-separator/output.json @@ -41,7 +41,7 @@ }, "end": { "line": 2, - "column": 15 + "column": 7 } }, "value": { @@ -55,7 +55,7 @@ }, "end": { "line": 2, - "column": 14 + "column": 6 } }, "value": "before
after", diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json index 388733cc206a..9ac309222fd1 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json @@ -40,7 +40,7 @@ }, "end": { "line": 2, - "column": 17 + "column": 8 } }, "expression": { @@ -54,7 +54,7 @@ }, "end": { "line": 2, - "column": 15 + "column": 6 } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json index a482ccfb266a..edf8712a70d2 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json @@ -40,7 +40,7 @@ }, "end": { "line": 2, - "column": 17 + "column": 8 } }, "expression": { @@ -54,7 +54,7 @@ }, "end": { "line": 2, - "column": 15 + "column": 6 } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/input.js b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/input.js new file mode 100644 index 000000000000..73604d9cd234 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/input.js @@ -0,0 +1,2 @@ +(`before
after`); +// ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after') diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json new file mode 100644 index 000000000000..603b0c53b682 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 101, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 83 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 101, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 83 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 1, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 2, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "value": { + "raw": "before
after", + "cooked": "before
after" + }, + "tail": true + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", + "start": 18, + "end": 101, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 83 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", + "start": 18, + "end": 101, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 83 + } + } + } + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/input.js b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/input.js new file mode 100644 index 000000000000..9272512911d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/input.js @@ -0,0 +1,2 @@ +(`before
after`); +// ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after') diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json new file mode 100644 index 000000000000..d1d7e83639aa --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json @@ -0,0 +1,128 @@ +{ + "type": "File", + "start": 0, + "end": 106, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 88 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 106, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 88 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "expression": { + "type": "TemplateLiteral", + "start": 1, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 2, + "column": 6 + } + }, + "expressions": [], + "quasis": [ + { + "type": "TemplateElement", + "start": 2, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "value": { + "raw": "before
after", + "cooked": "before
after" + }, + "tail": true + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + }, + "trailingComments": [ + { + "type": "CommentLine", + "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", + "start": 18, + "end": 106, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 88 + } + } + } + ] + } + ], + "directives": [] + }, + "comments": [ + { + "type": "CommentLine", + "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", + "start": 18, + "end": 106, + "loc": { + "start": { + "line": 3, + "column": 0 + }, + "end": { + "line": 3, + "column": 88 + } + } + } + ] +} \ No newline at end of file From a28353703fa1b284fa98a981097b37cc1e8d07d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 17:08:28 -0500 Subject: [PATCH 911/965] fix: check await when parsing AsyncArrowBindingIdentifier (#10953) --- .../babel-parser/src/parser/expression.js | 10 ++ .../input.js | 1 + .../output.json | 107 ++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js create mode 100644 packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index b4f1d89c06c5..a2826e139f10 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -960,8 +960,18 @@ export default class ExpressionParser extends LValParser { this.match(tt.name) && !this.canInsertSemicolon() ) { + const oldMaybeInArrowParameters = this.state.maybeInArrowParameters; + const oldYieldPos = this.state.yieldPos; + const oldAwaitPos = this.state.awaitPos; + this.state.maybeInArrowParameters = true; + this.state.yieldPos = -1; + this.state.awaitPos = -1; const params = [this.parseIdentifier()]; this.expect(tt.arrow); + this.checkYieldAwaitInDefaultParams(); + this.state.maybeInArrowParameters = oldMaybeInArrowParameters; + this.state.yieldPos = oldYieldPos; + this.state.awaitPos = oldAwaitPos; // let foo = async bar => {}; this.parseArrowExpression(node, params, true); return node; diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js new file mode 100644 index 000000000000..769cb1594534 --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/input.js @@ -0,0 +1 @@ +async await => {} diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json new file mode 100644 index 000000000000..b264aa447eeb --- /dev/null +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json @@ -0,0 +1,107 @@ +{ + "type": "File", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "errors": [ + "SyntaxError: Await cannot be used as name inside an async function (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": "ExpressionStatement", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "expression": { + "type": "ArrowFunctionExpression", + "start": 0, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "id": null, + "generator": false, + "async": true, + "params": [ + { + "type": "Identifier", + "start": 6, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "await" + }, + "name": "await" + } + ], + "body": { + "type": "BlockStatement", + "start": 15, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "body": [], + "directives": [] + } + } + } + ], + "directives": [] + } +} \ No newline at end of file From 455d782ef0b50a6693969fdbe08869c712d6e4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 17:08:59 -0500 Subject: [PATCH 912/965] test: add invalid-lone-import test (#10950) * test: add lone import test * polish: raise recoverable error --- .../babel-parser/src/parser/expression.js | 5 +- .../invalid-lone-import/input.js | 1 + .../invalid-lone-import/options.json | 3 + .../invalid-lone-import/output.json | 72 +++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index a2826e139f10..202d7cc7e0fc 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -919,7 +919,10 @@ export default class ExpressionParser extends LValParser { this.expectPlugin("dynamicImport", node.start); if (!this.match(tt.parenL)) { - this.unexpected(null, tt.parenL); + this.raise( + this.state.lastTokStart, + "import can only be used in import() or import.meta", + ); } return this.finishNode(node, "Import"); case tt._this: diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/input.js b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/input.js new file mode 100644 index 000000000000..477eec265426 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/input.js @@ -0,0 +1 @@ +(import) diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/options.json new file mode 100644 index 000000000000..1629df1f3678 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["dynamicImport"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json new file mode 100644 index 000000000000..fe56e0811a5a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json @@ -0,0 +1,72 @@ +{ + "type": "File", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "errors": [ + "SyntaxError: import can only be used in import() or import.meta (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": "Import", + "start": 1, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file From 03d163a0d998fd26f4911417e439b40960cb639c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 3 Jan 2020 18:26:27 -0500 Subject: [PATCH 913/965] Use chrome data when android is absent (#10790) * chore: rename test folder * chore: add test case * fix: use chrome support data when android is absent * chore: add type annotation * chore: add testcases last 2 versions not ie * chore: bump browerslist to v4.8.2 * chore: update test fixtures * chore: update test fixtures --- packages/babel-preset-env/package.json | 2 +- packages/babel-preset-env/src/debug.js | 9 +++- packages/babel-preset-env/src/filter-items.js | 14 +++-- packages/babel-preset-env/src/utils.js | 14 ++++- .../debug/browserslists-android-3/input.mjs | 1 + .../browserslists-android-3/options.json | 17 +++++++ .../debug/browserslists-android-3/stdout.txt | 46 +++++++++++++++++ .../browserslists-defaults-not-ie/input.mjs | 1 + .../options.json | 19 +++++++ .../browserslists-defaults-not-ie/stdout.txt | 50 ++++++++++++++++++ .../debug/browserslists-defaults/input.mjs | 1 + .../debug/browserslists-defaults/options.json | 15 ++++++ .../debug/browserslists-defaults/stdout.txt | 51 +++++++++++++++++++ .../input.mjs | 1 + .../options.json | 19 +++++++ .../stdout.txt | 31 +++++++++++ .../input.mjs | 0 .../options.json | 2 +- .../output.js | 0 19 files changed, 284 insertions(+), 9 deletions(-) create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/input.mjs create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/options.json create mode 100644 packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt rename packages/babel-preset-env/test/fixtures/preset-options/{browserslist-defaults-2 => browserslist-defaults-not-ie}/input.mjs (100%) rename packages/babel-preset-env/test/fixtures/preset-options/{browserslist-defaults-2 => browserslist-defaults-not-ie}/options.json (65%) rename packages/babel-preset-env/test/fixtures/preset-options/{browserslist-defaults-2 => browserslist-defaults-not-ie}/output.js (100%) diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 17bfe8f75f13..9d516a5ea441 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -60,7 +60,7 @@ "@babel/plugin-transform-typeof-symbol": "^7.7.4", "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/types": "^7.7.4", - "browserslist": "^4.6.0", + "browserslist": "^4.8.2", "core-js-compat": "^3.6.0", "invariant": "^2.2.2", "levenary": "^1.1.0", diff --git a/packages/babel-preset-env/src/debug.js b/packages/babel-preset-env/src/debug.js index 747b895a1067..58c98e5daedb 100644 --- a/packages/babel-preset-env/src/debug.js +++ b/packages/babel-preset-env/src/debug.js @@ -1,7 +1,12 @@ // @flow /*eslint quotes: ["error", "double", { "avoidEscape": true }]*/ import semver from "semver"; -import { isUnreleasedVersion, prettifyVersion, semverify } from "./utils"; +import { + isUnreleasedVersion, + prettifyVersion, + semverify, + getLowestImplementedVersion, +} from "./utils"; import type { Targets } from "./types"; @@ -19,7 +24,7 @@ export const logPluginOrPolyfill = ( const minVersions = list[item] || {}; const filteredList = Object.keys(targetVersions).reduce((result, env) => { - const minVersion = minVersions[env]; + const minVersion = getLowestImplementedVersion(minVersions, env); const targetVersion = targetVersions[env]; if (!minVersion) { diff --git a/packages/babel-preset-env/src/filter-items.js b/packages/babel-preset-env/src/filter-items.js index 3c5a3297083f..cd1a377f995b 100644 --- a/packages/babel-preset-env/src/filter-items.js +++ b/packages/babel-preset-env/src/filter-items.js @@ -1,6 +1,10 @@ // @flow import semver from "semver"; -import { semverify, isUnreleasedVersion } from "./utils"; +import { + semverify, + isUnreleasedVersion, + getLowestImplementedVersion, +} from "./utils"; import type { Targets } from "./types"; @@ -15,12 +19,14 @@ export function isPluginRequired( } const isRequiredForEnvironments = targetEnvironments.filter(environment => { + const lowestImplementedVersion = getLowestImplementedVersion( + plugin, + environment, + ); // Feature is not implemented in that environment - if (!plugin[environment]) { + if (!lowestImplementedVersion) { return true; } - - const lowestImplementedVersion = plugin[environment]; const lowestTargetedVersion = supportedEnvironments[environment]; // If targets has unreleased value as a lowest version, then don't require a plugin. diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index 5b5aaae9b6f2..e61e4e4d72ce 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -7,7 +7,7 @@ import semver from "semver"; import { addSideEffect } from "@babel/helper-module-imports"; import unreleasedLabels from "../data/unreleased-labels"; import { semverMin } from "./targets-parser"; -import type { Targets } from "./types"; +import type { Target, Targets } from "./types"; export const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty); @@ -105,6 +105,18 @@ export function getLowestUnreleased(a: string, b: string, env: string): string { return semverMin(a, b); } +export function getLowestImplementedVersion( + plugin: Targets, + environment: Target, +): string { + const result = plugin[environment]; + // When Android support data is absent, use Chrome data as fallback + if (!result && environment === "android") { + return plugin.chrome; + } + return result; +} + export function filterStageFromList( list: { [feature: string]: Targets }, stageList: { [feature: string]: boolean }, diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/input.mjs b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/input.mjs new file mode 100644 index 000000000000..c3fee8a17564 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/input.mjs @@ -0,0 +1 @@ +import "core-js"; diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/options.json b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/options.json new file mode 100644 index 000000000000..b8ccf9b2471e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/options.json @@ -0,0 +1,17 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + [ + "env", + { + "debug": true, + "targets": { + "browsers": [ + "android 3" + ] + } + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt new file mode 100644 index 000000000000..b193c75bf464 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt @@ -0,0 +1,46 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "android": "3" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "android":"3" } + transform-literals { "android":"3" } + transform-function-name { "android":"3" } + transform-arrow-functions { "android":"3" } + transform-block-scoped-functions { "android":"3" } + transform-classes { "android":"3" } + transform-object-super { "android":"3" } + transform-shorthand-properties { "android":"3" } + transform-duplicate-keys { "android":"3" } + transform-computed-properties { "android":"3" } + transform-for-of { "android":"3" } + transform-sticky-regex { "android":"3" } + transform-dotall-regex { "android":"3" } + transform-unicode-regex { "android":"3" } + transform-spread { "android":"3" } + transform-parameters { "android":"3" } + transform-destructuring { "android":"3" } + transform-block-scoping { "android":"3" } + transform-typeof-symbol { "android":"3" } + transform-new-target { "android":"3" } + transform-regenerator { "android":"3" } + transform-exponentiation-operator { "android":"3" } + transform-async-to-generator { "android":"3" } + proposal-async-generator-functions { "android":"3" } + proposal-object-rest-spread { "android":"3" } + proposal-unicode-property-regex { "android":"3" } + proposal-json-strings { "android":"3" } + proposal-optional-catch-binding { "android":"3" } + transform-named-capturing-groups-regex { "android":"3" } + transform-member-expression-literals { "android":"3" } + transform-property-literals { "android":"3" } + transform-reserved-words { "android":"3" } + transform-modules-commonjs { "android":"3" } + proposal-dynamic-import { "android":"3" } + +Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/input.mjs b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/input.mjs new file mode 100644 index 000000000000..c3fee8a17564 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/input.mjs @@ -0,0 +1 @@ +import "core-js"; diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/options.json b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/options.json new file mode 100644 index 000000000000..8bbb1c0f23d9 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/options.json @@ -0,0 +1,19 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + [ + "env", + { + "debug": true, + "targets": { + "browsers": [ + "defaults", + "not ie 11", + "not ie_mob 11" + ] + } + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt new file mode 100644 index 000000000000..40ff4ed1eb6c --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt @@ -0,0 +1,50 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "android": "77", + "chrome": "77", + "edge": "17", + "firefox": "68", + "ios": "12.2", + "opera": "63", + "safari": "5.1", + "samsung": "9.2" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ios":"12.2", "safari":"5.1" } + transform-literals { "safari":"5.1" } + transform-function-name { "edge":"17", "safari":"5.1" } + transform-arrow-functions { "safari":"5.1" } + transform-block-scoped-functions { "safari":"5.1" } + transform-classes { "safari":"5.1" } + transform-object-super { "safari":"5.1" } + transform-shorthand-properties { "safari":"5.1" } + transform-duplicate-keys { "safari":"5.1" } + transform-computed-properties { "safari":"5.1" } + transform-for-of { "safari":"5.1" } + transform-sticky-regex { "safari":"5.1" } + transform-dotall-regex { "edge":"17", "firefox":"68", "safari":"5.1" } + transform-unicode-regex { "safari":"5.1" } + transform-spread { "safari":"5.1" } + transform-parameters { "edge":"17", "safari":"5.1" } + transform-destructuring { "safari":"5.1" } + transform-block-scoping { "safari":"5.1" } + transform-typeof-symbol { "safari":"5.1" } + transform-new-target { "safari":"5.1" } + transform-regenerator { "safari":"5.1" } + transform-exponentiation-operator { "safari":"5.1" } + transform-async-to-generator { "safari":"5.1" } + proposal-async-generator-functions { "edge":"17", "safari":"5.1" } + proposal-object-rest-spread { "edge":"17", "safari":"5.1" } + proposal-unicode-property-regex { "edge":"17", "firefox":"68", "safari":"5.1" } + proposal-json-strings { "edge":"17", "safari":"5.1" } + proposal-optional-catch-binding { "edge":"17", "safari":"5.1" } + transform-named-capturing-groups-regex { "edge":"17", "firefox":"68", "safari":"5.1" } + transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + +Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/input.mjs b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/input.mjs new file mode 100644 index 000000000000..c3fee8a17564 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/input.mjs @@ -0,0 +1 @@ +import "core-js"; diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/options.json b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/options.json new file mode 100644 index 000000000000..b4fbce958eac --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/options.json @@ -0,0 +1,15 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + [ + "env", + { + "debug": true, + "targets": { + "browsers": "defaults" + } + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt new file mode 100644 index 000000000000..641ccc714d77 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt @@ -0,0 +1,51 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "android": "77", + "chrome": "77", + "edge": "17", + "firefox": "68", + "ie": "11", + "ios": "12.2", + "opera": "63", + "safari": "5.1", + "samsung": "9.2" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "ie":"11", "ios":"12.2", "safari":"5.1" } + transform-literals { "ie":"11", "safari":"5.1" } + transform-function-name { "edge":"17", "ie":"11", "safari":"5.1" } + transform-arrow-functions { "ie":"11", "safari":"5.1" } + transform-block-scoped-functions { "safari":"5.1" } + transform-classes { "ie":"11", "safari":"5.1" } + transform-object-super { "ie":"11", "safari":"5.1" } + transform-shorthand-properties { "ie":"11", "safari":"5.1" } + transform-duplicate-keys { "ie":"11", "safari":"5.1" } + transform-computed-properties { "ie":"11", "safari":"5.1" } + transform-for-of { "ie":"11", "safari":"5.1" } + transform-sticky-regex { "ie":"11", "safari":"5.1" } + transform-dotall-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + transform-unicode-regex { "ie":"11", "safari":"5.1" } + transform-spread { "ie":"11", "safari":"5.1" } + transform-parameters { "edge":"17", "ie":"11", "safari":"5.1" } + transform-destructuring { "ie":"11", "safari":"5.1" } + transform-block-scoping { "ie":"11", "safari":"5.1" } + transform-typeof-symbol { "ie":"11", "safari":"5.1" } + transform-new-target { "ie":"11", "safari":"5.1" } + transform-regenerator { "ie":"11", "safari":"5.1" } + transform-exponentiation-operator { "ie":"11", "safari":"5.1" } + transform-async-to-generator { "ie":"11", "safari":"5.1" } + proposal-async-generator-functions { "edge":"17", "ie":"11", "safari":"5.1" } + proposal-object-rest-spread { "edge":"17", "ie":"11", "safari":"5.1" } + proposal-unicode-property-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + proposal-json-strings { "edge":"17", "ie":"11", "safari":"5.1" } + proposal-optional-catch-binding { "edge":"17", "ie":"11", "safari":"5.1" } + transform-named-capturing-groups-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + +Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/input.mjs b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/input.mjs new file mode 100644 index 000000000000..c3fee8a17564 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/input.mjs @@ -0,0 +1 @@ +import "core-js"; diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/options.json b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/options.json new file mode 100644 index 000000000000..58797fc7f4e1 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/options.json @@ -0,0 +1,19 @@ +{ + "validateLogs": true, + "ignoreOutput": true, + "presets": [ + [ + "env", + { + "debug": true, + "targets": { + "browsers": [ + "last 2 versions", + "not ie <= 11", + "not ie_mob <= 11" + ] + } + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt new file mode 100644 index 000000000000..589e0f6bc262 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt @@ -0,0 +1,31 @@ +@babel/preset-env: `DEBUG` option + +Using targets: +{ + "android": "77", + "chrome": "77", + "edge": "17", + "firefox": "70", + "ios": "13", + "opera": "63", + "safari": "12.1", + "samsung": "9.2" +} + +Using modules transform: auto + +Using plugins: + transform-template-literals { "safari":"12.1" } + transform-function-name { "edge":"17" } + transform-dotall-regex { "edge":"17", "firefox":"70" } + transform-parameters { "edge":"17" } + proposal-async-generator-functions { "edge":"17" } + proposal-object-rest-spread { "edge":"17" } + proposal-unicode-property-regex { "edge":"17", "firefox":"70" } + proposal-json-strings { "edge":"17" } + proposal-optional-catch-binding { "edge":"17" } + transform-named-capturing-groups-regex { "edge":"17", "firefox":"70" } + transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } + proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } + +Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/input.mjs rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/options.json b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/options.json similarity index 65% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/options.json rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/options.json index 7ee0ee1a8a81..63828ae6c658 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/options.json +++ b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/options.json @@ -5,7 +5,7 @@ { "targets": { "node": "current", - "browsers": ["defaults", "not ie <= 10"] + "browsers": ["defaults", "not ie <= 10", "not ie_mob <= 10"] } } ] diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/output.js similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-2/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-defaults-not-ie/output.js From a7dac495182ef2984ba6fabb9eb7689938b566e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 4 Jan 2020 05:35:24 -0500 Subject: [PATCH 914/965] chore: workaround yarn issue (#10958) --- scripts/integration-tests/e2e-vue-cli.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/integration-tests/e2e-vue-cli.sh b/scripts/integration-tests/e2e-vue-cli.sh index c640661652a9..067594b4d6b1 100755 --- a/scripts/integration-tests/e2e-vue-cli.sh +++ b/scripts/integration-tests/e2e-vue-cli.sh @@ -23,6 +23,8 @@ cd tmp/vue-cli || exit startLocalRegistry "$PWD"/../../verdaccio-config.yml yarn install +# Workaround https://github.com/yarnpkg/yarn/issues/7797 +yarn add --dev -W @babel/core # "yarn upgrade --scope @babel --latest" doesn't seem to work. # a means "all", while \n is the enter needed to confirm the selection. printf "a\n" | yarn upgrade-interactive --scope @babel --latest From 4636321f06ec0a56ed88e35c20912c75e79cb1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 5 Jan 2020 17:28:44 +0100 Subject: [PATCH 915/965] Make @babel/transform-runtime's absoluteRuntime/relative test meaningful (#10963) --- .../test/fixtures/absoluteRuntime/relative/output.js | 2 +- .../subfolder/node_modules/@babel/runtime/package.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/package.json diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js index e783188c9e48..4e7a5218225f 100644 --- a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/output.js @@ -1,4 +1,4 @@ -var _classCallCheck = require("/packages/babel-plugin-transform-runtime/node_modules/@babel/runtime/helpers/classCallCheck"); +var _classCallCheck = require("/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/helpers/classCallCheck"); let Foo = function Foo() { "use strict"; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/package.json b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/package.json new file mode 100644 index 000000000000..652fee89ae19 --- /dev/null +++ b/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/package.json @@ -0,0 +1,4 @@ +{ + "name": "@babel/runtime", + "private": true +} From 3fa37d2da345a7b52608d0d784494951e8be4e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 6 Jan 2020 00:08:50 +0100 Subject: [PATCH 916/965] Bump coverage target from 80% to 90% (#10964) --- codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index ed4545a1bf7d..17d3dfb026d0 100644 --- a/codecov.yml +++ b/codecov.yml @@ -5,7 +5,7 @@ coverage: status: project: default: - target: "80%" + target: "90%" patch: enabled: false ignore: From 8fd532db39e5413b14f7f88c86987c7a47072674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 7 Jan 2020 10:23:50 -0500 Subject: [PATCH 917/965] LiteralPropertyName should allow BigIntLiteral (#10955) * fix: property name should allow BigIntLiteral * test: add non decimal test case * add bigintIndex to whitelist --- .../babel-parser/src/parser/expression.js | 2 +- .../bigint/decimal-as-property-name/input.js | 1 + .../decimal-as-property-name/output.json | 129 ++++++++++++++++++ .../bigint/hex-as-property-name/input.js | 1 + .../bigint/hex-as-property-name/output.json | 129 ++++++++++++++++++ scripts/parser-tests/typescript/whitelist.txt | 1 + 6 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 202d7cc7e0fc..29ef2ceb3c2f 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -1790,7 +1790,7 @@ export default class ExpressionParser extends LValParser { this.state.inPropertyName = true; // We check if it's valid for it to be a private name when we push it. (prop: $FlowFixMe).key = - this.match(tt.num) || this.match(tt.string) + this.match(tt.num) || this.match(tt.string) || this.match(tt.bigint) ? this.parseExprAtom() : this.parseMaybePrivateName(); diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/input.js b/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/input.js new file mode 100644 index 000000000000..f6c9c2b0d01f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/input.js @@ -0,0 +1 @@ +({ 0n: 0 }); diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/output.json new file mode 100644 index 000000000000..0e89977f1977 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/decimal-as-property-name/output.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "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": "ObjectExpression", + "start": 1, + "end": 10, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "method": false, + "key": { + "type": "BigIntLiteral", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "extra": { + "rawValue": "0", + "raw": "0n" + }, + "value": "0" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 7, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "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/experimental/bigint/hex-as-property-name/input.js b/packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/input.js new file mode 100644 index 000000000000..537fddf64fc1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/input.js @@ -0,0 +1 @@ +({ 0xbeefban: 0 }); diff --git a/packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/output.json b/packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/output.json new file mode 100644 index 000000000000..6f4825b89b86 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/bigint/hex-as-property-name/output.json @@ -0,0 +1,129 @@ +{ + "type": "File", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 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": "ExpressionStatement", + "start": 0, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "expression": { + "type": "ObjectExpression", + "start": 1, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 3, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "method": false, + "key": { + "type": "BigIntLiteral", + "start": 3, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "extra": { + "rawValue": "0xbeefba", + "raw": "0xbeefban" + }, + "value": "0xbeefba" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 14, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 14 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 0 + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/parser-tests/typescript/whitelist.txt b/scripts/parser-tests/typescript/whitelist.txt index 41a3182becc5..c8b5bba49209 100644 --- a/scripts/parser-tests/typescript/whitelist.txt +++ b/scripts/parser-tests/typescript/whitelist.txt @@ -61,6 +61,7 @@ augmentedTypesVar.ts awaitInNonAsyncFunction.ts awaitLiteralValues.ts bigIntWithTargetES3.ts +bigintIndex.ts bigintWithLib.ts breakNotInIterationOrSwitchStatement1.ts breakNotInIterationOrSwitchStatement2.ts From 09cb4273bc74e1916db17920f068cad563eefd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 7 Jan 2020 12:43:14 -0500 Subject: [PATCH 918/965] update corejs-compat fixtures (#10967) * update corejs-compat fixtures * chore: bump core-js-compat to 3.6.2 --- packages/babel-preset-env/package.json | 2 +- .../fixtures/corejs3/entry-ie-11/output.mjs | 7 +++++++ .../fixtures/corejs3/entry-ie-9/output.mjs | 7 +++++++ .../debug/entry-corejs3-electron/stdout.txt | 5 +++++ .../entry-corejs3-specific-targets/stdout.txt | 18 +++++++++--------- .../entry-corejs3-versions-decimals/stdout.txt | 9 +++++++-- .../stdout.txt | 7 +++++++ .../stdout.txt | 7 +++++++ .../entry-corejs3-versions-strings/stdout.txt | 7 +++++++ .../fixtures/debug/entry-corejs3/stdout.txt | 9 +++++++-- 10 files changed, 64 insertions(+), 14 deletions(-) diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 9d516a5ea441..32eb9a33e54b 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -61,7 +61,7 @@ "@babel/plugin-transform-unicode-regex": "^7.7.4", "@babel/types": "^7.7.4", "browserslist": "^4.8.2", - "core-js-compat": "^3.6.0", + "core-js-compat": "^3.6.2", "invariant": "^2.2.2", "levenary": "^1.1.0", "semver": "^5.5.0" diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs index 26b355d9cb51..8f5bacb3d250 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-11/output.mjs @@ -14,19 +14,26 @@ import "core-js/modules/es.symbol.to-string-tag"; import "core-js/modules/es.symbol.unscopables"; import "core-js/modules/es.array.concat"; import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; import "core-js/modules/es.array.fill"; import "core-js/modules/es.array.filter"; import "core-js/modules/es.array.find"; import "core-js/modules/es.array.find-index"; import "core-js/modules/es.array.flat"; import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; import "core-js/modules/es.array.from"; import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; import "core-js/modules/es.array.map"; import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; import "core-js/modules/es.array.species"; import "core-js/modules/es.array.splice"; import "core-js/modules/es.array.unscopables.flat"; diff --git a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs index 6c47ffc5a778..4882a3abee1d 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs +++ b/packages/babel-preset-env/test/fixtures/corejs3/entry-ie-9/output.mjs @@ -14,19 +14,26 @@ import "core-js/modules/es.symbol.to-string-tag"; import "core-js/modules/es.symbol.unscopables"; import "core-js/modules/es.array.concat"; import "core-js/modules/es.array.copy-within"; +import "core-js/modules/es.array.every"; import "core-js/modules/es.array.fill"; import "core-js/modules/es.array.filter"; import "core-js/modules/es.array.find"; import "core-js/modules/es.array.find-index"; import "core-js/modules/es.array.flat"; import "core-js/modules/es.array.flat-map"; +import "core-js/modules/es.array.for-each"; import "core-js/modules/es.array.from"; import "core-js/modules/es.array.includes"; +import "core-js/modules/es.array.index-of"; import "core-js/modules/es.array.iterator"; import "core-js/modules/es.array.join"; +import "core-js/modules/es.array.last-index-of"; import "core-js/modules/es.array.map"; import "core-js/modules/es.array.of"; +import "core-js/modules/es.array.reduce"; +import "core-js/modules/es.array.reduce-right"; import "core-js/modules/es.array.slice"; +import "core-js/modules/es.array.some"; import "core-js/modules/es.array.species"; import "core-js/modules/es.array.splice"; import "core-js/modules/es.array.unscopables.flat"; 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..0c8d68fdabce 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 @@ -52,16 +52,21 @@ Using polyfills with `entry` option: es.symbol.split { "electron":"0.36" } es.symbol.to-string-tag { "electron":"0.36" } es.array.concat { "electron":"0.36" } + es.array.every { "electron":"0.36" } es.array.filter { "electron":"0.36" } es.array.flat { "electron":"0.36" } es.array.flat-map { "electron":"0.36" } + es.array.for-each { "electron":"0.36" } es.array.from { "electron":"0.36" } es.array.includes { "electron":"0.36" } es.array.index-of { "electron":"0.36" } es.array.iterator { "electron":"0.36" } es.array.last-index-of { "electron":"0.36" } es.array.map { "electron":"0.36" } + es.array.reduce { "electron":"0.36" } + es.array.reduce-right { "electron":"0.36" } es.array.slice { "electron":"0.36" } + es.array.some { "electron":"0.36" } es.array.sort { "electron":"0.36" } es.array.species { "electron":"0.36" } es.array.splice { "electron":"0.36" } 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 548122b74e3f..894bf780e69a 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 @@ -64,30 +64,30 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10", "safari":"7" } es.array.concat { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.array.copy-within { "ie":"10", "safari":"7" } - es.array.every { "safari":"7" } + es.array.every { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } es.array.fill { "ie":"10", "safari":"7" } es.array.filter { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.array.find { "ie":"10", "safari":"7" } es.array.find-index { "ie":"10", "safari":"7" } es.array.flat { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.flat-map { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } - es.array.for-each { "safari":"7" } + es.array.for-each { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } es.array.from { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } es.array.includes { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } - es.array.index-of { "safari":"7" } + es.array.index-of { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.iterator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.join { "ie":"10", "safari":"7" } - es.array.last-index-of { "safari":"7" } + es.array.last-index-of { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.map { "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.of { "ie":"10", "safari":"7" } - es.array.reduce { "safari":"7" } - es.array.reduce-right { "safari":"7" } + es.array.reduce { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } + es.array.reduce-right { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } es.array.reverse { "ios":"9", "safari":"7" } - es.array.slice { "ie":"10", "ios":"9", "safari":"7" } - es.array.some { "safari":"7" } + es.array.slice { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } + es.array.some { "edge":"13", "firefox":"49", "ie":"10", "safari":"7" } es.array.sort { "chrome":"54", "ios":"9", "safari":"7" } es.array.species { "ie":"10", "ios":"9", "safari":"7" } - es.array.splice { "ie":"10", "ios":"9", "safari":"7" } + es.array.splice { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.array.unscopables.flat { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array.unscopables.flat-map { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.array-buffer.constructor { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } 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 3b1bef759082..1ac6b7eb521c 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 @@ -72,21 +72,26 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10" } es.array.concat { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.copy-within { "ie":"10" } + es.array.every { "electron":"0.36", "ie":"10" } es.array.fill { "ie":"10" } es.array.filter { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.find { "ie":"10" } es.array.find-index { "ie":"10" } es.array.flat { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } es.array.flat-map { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } + es.array.for-each { "electron":"0.36", "ie":"10" } es.array.from { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.includes { "electron":"0.36", "ie":"10", "node":"6.1" } - es.array.index-of { "electron":"0.36", "node":"6.1" } + es.array.index-of { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.iterator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } es.array.join { "ie":"10" } - es.array.last-index-of { "electron":"0.36", "node":"6.1" } + es.array.last-index-of { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.map { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.of { "ie":"10" } + es.array.reduce { "electron":"0.36", "ie":"10" } + es.array.reduce-right { "electron":"0.36", "ie":"10" } es.array.slice { "electron":"0.36", "ie":"10", "node":"6.1" } + es.array.some { "electron":"0.36", "ie":"10" } es.array.sort { "chrome":"54", "electron":"0.36", "node":"6.1" } es.array.species { "electron":"0.36", "ie":"10", "node":"6.1" } es.array.splice { "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 e8694a81fdf2..76ae451dfc87 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 @@ -61,19 +61,26 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10" } es.array.concat { "ie":"10" } es.array.copy-within { "ie":"10" } + es.array.every { "ie":"10" } es.array.fill { "ie":"10" } es.array.filter { "ie":"10" } es.array.find { "ie":"10" } es.array.find-index { "ie":"10" } es.array.flat { "chrome":"54", "ie":"10", "node":"6.10" } es.array.flat-map { "chrome":"54", "ie":"10", "node":"6.10" } + es.array.for-each { "ie":"10" } es.array.from { "ie":"10" } es.array.includes { "ie":"10", "node":"6.10" } + es.array.index-of { "ie":"10" } es.array.iterator { "chrome":"54", "ie":"10", "node":"6.10" } es.array.join { "ie":"10" } + es.array.last-index-of { "ie":"10" } es.array.map { "ie":"10" } es.array.of { "ie":"10" } + es.array.reduce { "ie":"10" } + es.array.reduce-right { "ie":"10" } es.array.slice { "ie":"10" } + es.array.some { "ie":"10" } es.array.sort { "chrome":"54", "node":"6.10" } es.array.species { "ie":"10" } es.array.splice { "ie":"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 e13d536c01a2..b88e08d07803 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 @@ -62,19 +62,26 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10" } es.array.concat { "ie":"10" } es.array.copy-within { "ie":"10" } + es.array.every { "ie":"10" } es.array.fill { "ie":"10" } es.array.filter { "ie":"10" } es.array.find { "ie":"10" } es.array.find-index { "ie":"10" } es.array.flat { "chrome":"54", "ie":"10", "node":"6.10" } es.array.flat-map { "chrome":"54", "ie":"10", "node":"6.10" } + es.array.for-each { "ie":"10" } es.array.from { "ie":"10" } es.array.includes { "ie":"10", "node":"6.10" } + es.array.index-of { "ie":"10" } es.array.iterator { "chrome":"54", "ie":"10", "node":"6.10" } es.array.join { "ie":"10" } + es.array.last-index-of { "ie":"10" } es.array.map { "ie":"10" } es.array.of { "ie":"10" } + es.array.reduce { "ie":"10" } + es.array.reduce-right { "ie":"10" } es.array.slice { "ie":"10" } + es.array.some { "ie":"10" } es.array.sort { "chrome":"54", "node":"6.10" } es.array.species { "ie":"10" } es.array.splice { "ie":"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 2ea0685394c2..c426ae2080e2 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 @@ -61,19 +61,26 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10" } es.array.concat { "ie":"10" } es.array.copy-within { "ie":"10" } + es.array.every { "ie":"10" } es.array.fill { "ie":"10" } es.array.filter { "ie":"10" } es.array.find { "ie":"10" } es.array.find-index { "ie":"10" } es.array.flat { "chrome":"54", "ie":"10", "node":"6.10" } es.array.flat-map { "chrome":"54", "ie":"10", "node":"6.10" } + es.array.for-each { "ie":"10" } es.array.from { "ie":"10" } es.array.includes { "ie":"10", "node":"6.10" } + es.array.index-of { "ie":"10" } es.array.iterator { "chrome":"54", "ie":"10", "node":"6.10" } es.array.join { "ie":"10" } + es.array.last-index-of { "ie":"10" } es.array.map { "ie":"10" } es.array.of { "ie":"10" } + es.array.reduce { "ie":"10" } + es.array.reduce-right { "ie":"10" } es.array.slice { "ie":"10" } + es.array.some { "ie":"10" } es.array.sort { "chrome":"54", "node":"6.10" } es.array.species { "ie":"10" } es.array.splice { "ie":"10" } 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 e27aade519ec..813558de2cad 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 @@ -61,21 +61,26 @@ Using polyfills with `entry` option: es.symbol.unscopables { "ie":"10" } es.array.concat { "ie":"10", "node":"6" } es.array.copy-within { "ie":"10" } + es.array.every { "ie":"10" } es.array.fill { "ie":"10" } es.array.filter { "ie":"10", "node":"6" } es.array.find { "ie":"10" } es.array.find-index { "ie":"10" } es.array.flat { "chrome":"54", "ie":"10", "node":"6" } es.array.flat-map { "chrome":"54", "ie":"10", "node":"6" } + es.array.for-each { "ie":"10" } es.array.from { "ie":"10", "node":"6" } es.array.includes { "ie":"10", "node":"6" } - es.array.index-of { "node":"6" } + es.array.index-of { "ie":"10", "node":"6" } es.array.iterator { "chrome":"54", "ie":"10", "node":"6" } es.array.join { "ie":"10" } - es.array.last-index-of { "node":"6" } + es.array.last-index-of { "ie":"10", "node":"6" } es.array.map { "ie":"10", "node":"6" } es.array.of { "ie":"10" } + es.array.reduce { "ie":"10" } + es.array.reduce-right { "ie":"10" } es.array.slice { "ie":"10", "node":"6" } + es.array.some { "ie":"10" } es.array.sort { "chrome":"54", "node":"6" } es.array.species { "ie":"10", "node":"6" } es.array.splice { "ie":"10", "node":"6" } From 9f148a160313d8dd87c54cffd9a38b153824fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 9 Jan 2020 18:38:22 -0500 Subject: [PATCH 919/965] chore: update caniuse-usage fixtures (#10974) --- .../browserslists-defaults-not-ie/stdout.txt | 34 +++++++++---------- .../debug/browserslists-defaults/stdout.txt | 34 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt index 40ff4ed1eb6c..369d15c80b38 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt @@ -3,7 +3,7 @@ Using targets: { "android": "77", - "chrome": "77", + "chrome": "49", "edge": "17", "firefox": "68", "ios": "12.2", @@ -17,7 +17,7 @@ Using modules transform: auto Using plugins: transform-template-literals { "ios":"12.2", "safari":"5.1" } transform-literals { "safari":"5.1" } - transform-function-name { "edge":"17", "safari":"5.1" } + transform-function-name { "chrome":"49", "edge":"17", "safari":"5.1" } transform-arrow-functions { "safari":"5.1" } transform-block-scoped-functions { "safari":"5.1" } transform-classes { "safari":"5.1" } @@ -25,26 +25,26 @@ Using plugins: transform-shorthand-properties { "safari":"5.1" } transform-duplicate-keys { "safari":"5.1" } transform-computed-properties { "safari":"5.1" } - transform-for-of { "safari":"5.1" } + transform-for-of { "chrome":"49", "safari":"5.1" } transform-sticky-regex { "safari":"5.1" } - transform-dotall-regex { "edge":"17", "firefox":"68", "safari":"5.1" } - transform-unicode-regex { "safari":"5.1" } + transform-dotall-regex { "chrome":"49", "edge":"17", "firefox":"68", "safari":"5.1" } + transform-unicode-regex { "chrome":"49", "safari":"5.1" } transform-spread { "safari":"5.1" } transform-parameters { "edge":"17", "safari":"5.1" } - transform-destructuring { "safari":"5.1" } + transform-destructuring { "chrome":"49", "safari":"5.1" } transform-block-scoping { "safari":"5.1" } transform-typeof-symbol { "safari":"5.1" } transform-new-target { "safari":"5.1" } - transform-regenerator { "safari":"5.1" } - transform-exponentiation-operator { "safari":"5.1" } - transform-async-to-generator { "safari":"5.1" } - proposal-async-generator-functions { "edge":"17", "safari":"5.1" } - proposal-object-rest-spread { "edge":"17", "safari":"5.1" } - proposal-unicode-property-regex { "edge":"17", "firefox":"68", "safari":"5.1" } - proposal-json-strings { "edge":"17", "safari":"5.1" } - proposal-optional-catch-binding { "edge":"17", "safari":"5.1" } - transform-named-capturing-groups-regex { "edge":"17", "firefox":"68", "safari":"5.1" } - transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } - proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + transform-regenerator { "chrome":"49", "safari":"5.1" } + transform-exponentiation-operator { "chrome":"49", "safari":"5.1" } + transform-async-to-generator { "chrome":"49", "safari":"5.1" } + proposal-async-generator-functions { "chrome":"49", "edge":"17", "safari":"5.1" } + proposal-object-rest-spread { "chrome":"49", "edge":"17", "safari":"5.1" } + proposal-unicode-property-regex { "chrome":"49", "edge":"17", "firefox":"68", "safari":"5.1" } + proposal-json-strings { "chrome":"49", "edge":"17", "safari":"5.1" } + proposal-optional-catch-binding { "chrome":"49", "edge":"17", "safari":"5.1" } + transform-named-capturing-groups-regex { "chrome":"49", "edge":"17", "firefox":"68", "safari":"5.1" } + transform-modules-commonjs { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + proposal-dynamic-import { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt index 641ccc714d77..910826ae852e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt @@ -3,7 +3,7 @@ Using targets: { "android": "77", - "chrome": "77", + "chrome": "49", "edge": "17", "firefox": "68", "ie": "11", @@ -18,7 +18,7 @@ Using modules transform: auto Using plugins: transform-template-literals { "ie":"11", "ios":"12.2", "safari":"5.1" } transform-literals { "ie":"11", "safari":"5.1" } - transform-function-name { "edge":"17", "ie":"11", "safari":"5.1" } + transform-function-name { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } transform-arrow-functions { "ie":"11", "safari":"5.1" } transform-block-scoped-functions { "safari":"5.1" } transform-classes { "ie":"11", "safari":"5.1" } @@ -26,26 +26,26 @@ Using plugins: transform-shorthand-properties { "ie":"11", "safari":"5.1" } transform-duplicate-keys { "ie":"11", "safari":"5.1" } transform-computed-properties { "ie":"11", "safari":"5.1" } - transform-for-of { "ie":"11", "safari":"5.1" } + transform-for-of { "chrome":"49", "ie":"11", "safari":"5.1" } transform-sticky-regex { "ie":"11", "safari":"5.1" } - transform-dotall-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } - transform-unicode-regex { "ie":"11", "safari":"5.1" } + transform-dotall-regex { "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + transform-unicode-regex { "chrome":"49", "ie":"11", "safari":"5.1" } transform-spread { "ie":"11", "safari":"5.1" } transform-parameters { "edge":"17", "ie":"11", "safari":"5.1" } - transform-destructuring { "ie":"11", "safari":"5.1" } + transform-destructuring { "chrome":"49", "ie":"11", "safari":"5.1" } transform-block-scoping { "ie":"11", "safari":"5.1" } transform-typeof-symbol { "ie":"11", "safari":"5.1" } transform-new-target { "ie":"11", "safari":"5.1" } - transform-regenerator { "ie":"11", "safari":"5.1" } - transform-exponentiation-operator { "ie":"11", "safari":"5.1" } - transform-async-to-generator { "ie":"11", "safari":"5.1" } - proposal-async-generator-functions { "edge":"17", "ie":"11", "safari":"5.1" } - proposal-object-rest-spread { "edge":"17", "ie":"11", "safari":"5.1" } - proposal-unicode-property-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } - proposal-json-strings { "edge":"17", "ie":"11", "safari":"5.1" } - proposal-optional-catch-binding { "edge":"17", "ie":"11", "safari":"5.1" } - transform-named-capturing-groups-regex { "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } - transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } - proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + transform-regenerator { "chrome":"49", "ie":"11", "safari":"5.1" } + transform-exponentiation-operator { "chrome":"49", "ie":"11", "safari":"5.1" } + transform-async-to-generator { "chrome":"49", "ie":"11", "safari":"5.1" } + proposal-async-generator-functions { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } + proposal-object-rest-spread { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } + proposal-unicode-property-regex { "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + proposal-json-strings { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } + proposal-optional-catch-binding { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } + transform-named-capturing-groups-regex { "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + transform-modules-commonjs { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } + proposal-dynamic-import { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. From 771c730fda6c4ca484ecb01c4de8478713c6975c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2020 02:22:05 +0100 Subject: [PATCH 920/965] [parser] Disallow duplicate and undeclared private names (#10456) * [parser] Add private names tracking to Scope - Disallow duplicate private names - Disallow undeclared private names * Update tests * Test all possible duplications * Test undeclared private names * Better error message for top-level private names * Fix flow * Update test262 whitelist * Update fixtures * Update flow whitelist * Remove old output.json * Move ClassScopeHandler to a separate class * Make the code readable --- .../types/ClassBody-ClassProperty/input.js | 6 +- .../types/ClassBody-ClassProperty/output.js | 8 +- .../types/ClassBody-MethodDefinition/input.js | 26 +- .../ClassBody-MethodDefinition/output.js | 26 +- packages/babel-parser/src/parser/base.js | 2 + .../babel-parser/src/parser/expression.js | 16 +- packages/babel-parser/src/parser/index.js | 2 + packages/babel-parser/src/parser/statement.js | 51 ++- packages/babel-parser/src/tokenizer/index.js | 10 +- packages/babel-parser/src/tokenizer/state.js | 3 - packages/babel-parser/src/util/class-scope.js | 113 ++++++ packages/babel-parser/src/util/scope.js | 1 + packages/babel-parser/src/util/scopeflags.js | 20 + .../class-private-names-duplicated/README.md | 26 ++ .../instance-field-instance-field/input.js | 4 + .../instance-field-instance-field/output.json | 224 +++++++++++ .../instance-field-instance-get/input.js | 4 + .../instance-field-instance-get/options.json | 3 + .../instance-field-instance-get/output.json | 227 +++++++++++ .../instance-field-instance-method/input.js | 4 + .../options.json | 3 + .../output.json | 226 +++++++++++ .../instance-field-instance-set/input.js | 4 + .../instance-field-instance-set/options.json | 3 + .../instance-field-instance-set/output.json | 245 ++++++++++++ .../instance-field-static-field/input.js | 4 + .../instance-field-static-field/options.json | 3 + .../instance-field-static-field/output.json | 224 +++++++++++ .../instance-field-static-get/input.js | 4 + .../instance-field-static-get/options.json | 3 + .../instance-field-static-get/output.json | 227 +++++++++++ .../instance-field-static-method/input.js | 4 + .../instance-field-static-method/options.json | 3 + .../instance-field-static-method/output.json | 226 +++++++++++ .../instance-field-static-set/input.js | 4 + .../instance-field-static-set/options.json | 3 + .../instance-field-static-set/output.json | 245 ++++++++++++ .../instance-get-instance-field/input.js | 4 + .../instance-get-instance-field/options.json | 3 + .../instance-get-instance-field/output.json | 227 +++++++++++ .../instance-get-instance-get/input.js | 4 + .../instance-get-instance-get/options.json | 3 + .../instance-get-instance-get/output.json | 230 ++++++++++++ .../instance-get-instance-method/input.js | 4 + .../instance-get-instance-method/options.json | 3 + .../instance-get-instance-method/output.json | 229 ++++++++++++ .../instance-get-instance-set/input.js | 4 + .../instance-get-instance-set/output.json | 245 ++++++++++++ .../instance-get-static-field/input.js | 4 + .../instance-get-static-field/options.json | 3 + .../instance-get-static-field/output.json | 227 +++++++++++ .../instance-get-static-get/input.js | 4 + .../instance-get-static-get/options.json | 3 + .../instance-get-static-get/output.json | 230 ++++++++++++ .../instance-get-static-method/input.js | 4 + .../instance-get-static-method/options.json | 3 + .../instance-get-static-method/output.json | 229 ++++++++++++ .../instance-get-static-set/input.js | 4 + .../instance-get-static-set/options.json | 3 + .../instance-get-static-set/output.json | 248 ++++++++++++ .../instance-method-instance-field/input.js | 4 + .../options.json | 3 + .../output.json | 226 +++++++++++ .../instance-method-instance-get/input.js | 4 + .../instance-method-instance-get/options.json | 3 + .../instance-method-instance-get/output.json | 229 ++++++++++++ .../instance-method-instance-method/input.js | 4 + .../options.json | 3 + .../output.json | 228 ++++++++++++ .../instance-method-instance-set/input.js | 4 + .../instance-method-instance-set/options.json | 3 + .../instance-method-instance-set/output.json | 247 ++++++++++++ .../instance-method-static-field/input.js | 4 + .../instance-method-static-field/options.json | 3 + .../instance-method-static-field/output.json | 226 +++++++++++ .../instance-method-static-get/input.js | 4 + .../instance-method-static-get/options.json | 3 + .../instance-method-static-get/output.json | 229 ++++++++++++ .../instance-method-static-method/input.js | 4 + .../options.json | 3 + .../instance-method-static-method/output.json | 228 ++++++++++++ .../instance-method-static-set/input.js | 4 + .../instance-method-static-set/options.json | 3 + .../instance-method-static-set/output.json | 247 ++++++++++++ .../instance-set-instance-field/input.js | 4 + .../instance-set-instance-field/options.json | 3 + .../instance-set-instance-field/output.json | 245 ++++++++++++ .../instance-set-instance-get/input.js | 4 + .../instance-set-instance-get/output.json | 245 ++++++++++++ .../instance-set-instance-method/input.js | 4 + .../instance-set-instance-method/options.json | 3 + .../instance-set-instance-method/output.json | 247 ++++++++++++ .../instance-set-instance-set/input.js | 4 + .../instance-set-instance-set/options.json | 3 + .../instance-set-instance-set/output.json | 266 +++++++++++++ .../instance-set-static-field/input.js | 4 + .../instance-set-static-field/options.json | 3 + .../instance-set-static-field/output.json | 245 ++++++++++++ .../instance-set-static-get/input.js | 4 + .../instance-set-static-get/options.json | 3 + .../instance-set-static-get/output.json | 248 ++++++++++++ .../instance-set-static-method/input.js | 4 + .../instance-set-static-method/options.json | 3 + .../instance-set-static-method/output.json | 247 ++++++++++++ .../instance-set-static-set/input.js | 4 + .../instance-set-static-set/options.json | 3 + .../instance-set-static-set/output.json | 266 +++++++++++++ .../options.json | 3 + .../static-field-instance-field/input.js | 4 + .../static-field-instance-field/options.json | 3 + .../static-field-instance-field/output.json | 224 +++++++++++ .../static-field-instance-get/input.js | 4 + .../static-field-instance-get/options.json | 3 + .../static-field-instance-get/output.json | 227 +++++++++++ .../static-field-instance-method/input.js | 4 + .../static-field-instance-method/options.json | 3 + .../static-field-instance-method/output.json | 226 +++++++++++ .../static-field-instance-set/input.js | 4 + .../static-field-instance-set/options.json | 3 + .../static-field-instance-set/output.json | 245 ++++++++++++ .../static-field-static-field/input.js | 4 + .../static-field-static-field/options.json | 3 + .../static-field-static-field/output.json | 224 +++++++++++ .../static-field-static-get/input.js | 4 + .../static-field-static-get/options.json | 3 + .../static-field-static-get/output.json | 227 +++++++++++ .../static-field-static-method/input.js | 4 + .../static-field-static-method/options.json | 3 + .../static-field-static-method/output.json | 226 +++++++++++ .../static-field-static-set/input.js | 4 + .../static-field-static-set/options.json | 3 + .../static-field-static-set/output.json | 245 ++++++++++++ .../static-get-instance-field/input.js | 4 + .../static-get-instance-field/options.json | 3 + .../static-get-instance-field/output.json | 227 +++++++++++ .../static-get-instance-get/input.js | 4 + .../static-get-instance-get/options.json | 3 + .../static-get-instance-get/output.json | 230 ++++++++++++ .../static-get-instance-method/input.js | 4 + .../static-get-instance-method/options.json | 3 + .../static-get-instance-method/output.json | 229 ++++++++++++ .../static-get-instance-set/input.js | 4 + .../static-get-instance-set/options.json | 3 + .../static-get-instance-set/output.json | 248 ++++++++++++ .../static-get-static-field/input.js | 4 + .../static-get-static-field/options.json | 3 + .../static-get-static-field/output.json | 227 +++++++++++ .../static-get-static-get/input.js | 4 + .../static-get-static-get/options.json | 3 + .../static-get-static-get/output.json | 230 ++++++++++++ .../static-get-static-method/input.js | 4 + .../static-get-static-method/options.json | 3 + .../static-get-static-method/output.json | 229 ++++++++++++ .../static-get-static-set/input.js | 4 + .../static-get-static-set/output.json | 245 ++++++++++++ .../static-method-instance-field/input.js | 4 + .../static-method-instance-field/options.json | 3 + .../static-method-instance-field/output.json | 226 +++++++++++ .../static-method-instance-get/input.js | 4 + .../static-method-instance-get/options.json | 3 + .../static-method-instance-get/output.json | 229 ++++++++++++ .../static-method-instance-method/input.js | 4 + .../options.json | 3 + .../static-method-instance-method/output.json | 228 ++++++++++++ .../static-method-instance-set/input.js | 4 + .../static-method-instance-set/options.json | 3 + .../static-method-instance-set/output.json | 247 ++++++++++++ .../static-method-static-field/input.js | 4 + .../static-method-static-field/options.json | 3 + .../static-method-static-field/output.json | 226 +++++++++++ .../static-method-static-get/input.js | 4 + .../static-method-static-get/options.json | 3 + .../static-method-static-get/output.json | 229 ++++++++++++ .../static-method-static-method/input.js | 4 + .../static-method-static-method/options.json | 3 + .../static-method-static-method/output.json | 228 ++++++++++++ .../static-method-static-set/input.js | 4 + .../static-method-static-set/options.json | 3 + .../static-method-static-set/output.json | 247 ++++++++++++ .../static-set-instance-field/input.js | 4 + .../static-set-instance-field/options.json | 3 + .../static-set-instance-field/output.json | 245 ++++++++++++ .../static-set-instance-get/input.js | 4 + .../static-set-instance-get/options.json | 3 + .../static-set-instance-get/output.json | 248 ++++++++++++ .../static-set-instance-method/input.js | 4 + .../static-set-instance-method/options.json | 3 + .../static-set-instance-method/output.json | 247 ++++++++++++ .../static-set-instance-set/input.js | 4 + .../static-set-instance-set/options.json | 3 + .../static-set-instance-set/output.json | 266 +++++++++++++ .../static-set-static-field/input.js | 4 + .../static-set-static-field/options.json | 3 + .../static-set-static-field/output.json | 245 ++++++++++++ .../static-set-static-get/input.js | 4 + .../static-set-static-get/output.json | 245 ++++++++++++ .../static-set-static-method/input.js | 4 + .../static-set-static-method/options.json | 3 + .../static-set-static-method/output.json | 247 ++++++++++++ .../static-set-static-set/input.js | 4 + .../static-set-static-set/options.json | 3 + .../static-set-static-set/output.json | 266 +++++++++++++ .../declared-later-outer-class/input.js | 9 + .../declared-later-outer-class/options.json | 3 + .../declared-later-outer-class/output.json | 352 ++++++++++++++++++ .../declared-later-same-class/input.js | 4 + .../declared-later-same-class/options.json | 3 + .../declared-later-same-class/output.json | 245 ++++++++++++ .../undeclared-nested/input.js | 6 + .../undeclared-nested/options.json | 5 + .../undeclared-nested/output.json | 309 +++++++++++++++ .../undeclared-top-level/input.js | 1 + .../undeclared-top-level/options.json | 5 + .../undeclared-top-level/output.json | 153 ++++++++ .../duplicated-names/get-get/options.json | 2 +- .../duplicated-names/get-method/options.json | 2 +- .../duplicated-names/method-get/options.json | 2 +- .../method-method/options.json | 2 +- .../duplicated-names/method-set/options.json | 2 +- .../duplicated-names/set-method/options.json | 2 +- .../duplicated-names/set-set/options.json | 2 +- scripts/parser-tests/flow/whitelist.txt | 6 - scripts/parser-tests/test262/whitelist.txt | 190 +--------- 223 files changed, 16948 insertions(+), 259 deletions(-) create mode 100644 packages/babel-parser/src/util/class-scope.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json diff --git a/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/input.js b/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/input.js index 6256942ca5c5..87462c83f603 100644 --- a/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/input.js +++ b/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/input.js @@ -28,9 +28,9 @@ class Foo { foo = 0; bar = 1; #foo; - #foo = 1; - static #foo; - static #foo = Foo.#foo; + #foo2 = 1; + static #foo3; + static #foo4 = Foo.#foo; } class A1 { diff --git a/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/output.js b/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/output.js index 905fe31bdbfb..9970811aabad 100644 --- a/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/output.js +++ b/packages/babel-generator/test/fixtures/types/ClassBody-ClassProperty/output.js @@ -27,9 +27,9 @@ class Foo { foo = 0; bar = 1; #foo; - #foo = 1; - static #foo; - static #foo = Foo.#foo; + #foo2 = 1; + static #foo3; + static #foo4 = Foo.#foo; } class A1 { @@ -69,4 +69,4 @@ class A6 { class A7 { static get static() {} -} +} \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/input.js b/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/input.js index ae3f4b33c003..67ccba8fc28b 100644 --- a/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/input.js +++ b/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/input.js @@ -6,13 +6,13 @@ class Foo { set foo(bar) {} async #foo() {} - #foo() {} - get #foo() {} - set #foo(bar) {} - * #foo() {} - async * #foo() {} - get #bar() {} - set #baz(taz) {} + #foo2() {} + get #foo3() {} + set #foo3(bar) {} + * #foo4() {} + async * #foo5() {} + get #bar6() {} + set #baz6(taz) {} static async foo() {} static foo() {} @@ -23,13 +23,13 @@ class Foo { static * foo() {} static async * foo() {} - static #foo() {} - static async #foo() {} + static #foo7() {} + static async #foo8() {} static ["foo"]() {} - static get #foo() {} - static set #foo(taz) {} - static * #foo() {} - static async * #foo() {} + static get #foo9() {} + static set #foo9(taz) {} + static * #foo10() {} + static async * #foo11() {} get () {} diff --git a/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/output.js b/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/output.js index 24f3e9229c84..7f66930a5422 100644 --- a/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/output.js +++ b/packages/babel-generator/test/fixtures/types/ClassBody-MethodDefinition/output.js @@ -11,19 +11,19 @@ class Foo { async #foo() {} - #foo() {} + #foo2() {} - get #foo() {} + get #foo3() {} - set #foo(bar) {} + set #foo3(bar) {} - *#foo() {} + *#foo4() {} - async *#foo() {} + async *#foo5() {} - get #bar() {} + get #bar6() {} - set #baz(taz) {} + set #baz6(taz) {} static async foo() {} @@ -41,19 +41,19 @@ class Foo { static async *foo() {} - static #foo() {} + static #foo7() {} - static async #foo() {} + static async #foo8() {} static ["foo"]() {} - static get #foo() {} + static get #foo9() {} - static set #foo(taz) {} + static set #foo9(taz) {} - static *#foo() {} + static *#foo10() {} - static async *#foo() {} + static async *#foo11() {} get() {} diff --git a/packages/babel-parser/src/parser/base.js b/packages/babel-parser/src/parser/base.js index f4fb9f3b66e0..f02e6778270f 100644 --- a/packages/babel-parser/src/parser/base.js +++ b/packages/babel-parser/src/parser/base.js @@ -4,12 +4,14 @@ import type { Options } from "../options"; import type State from "../tokenizer/state"; import type { PluginsMap } from "./index"; import type ScopeHandler from "../util/scope"; +import type ClassScopeHandler from "../util/class-scope"; export default class BaseParser { // Properties set by constructor in index.js options: Options; inModule: boolean; scope: ScopeHandler<*>; + classScope: ClassScopeHandler; plugins: PluginsMap; filename: ?string; sawUnambiguousESM: boolean = false; diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 29ef2ceb3c2f..9d2b74aaaf63 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -612,15 +612,21 @@ export default class ExpressionParser extends LValParser { ? this.parseIdentifier(true) : this.parseMaybePrivateName(); node.computed = computed; - if ( - node.property.type === "PrivateName" && - node.object.type === "Super" - ) { - this.raise(startPos, "Private fields can't be accessed on super"); + + if (node.property.type === "PrivateName") { + if (node.object.type === "Super") { + this.raise(startPos, "Private fields can't be accessed on super"); + } + this.classScope.usePrivateName( + node.property.id.name, + node.property.start, + ); } + if (computed) { this.expect(tt.bracketR); } + if (state.optionalChainMember) { node.optional = optional; return this.finishNode(node, "OptionalMemberExpression"); diff --git a/packages/babel-parser/src/parser/index.js b/packages/babel-parser/src/parser/index.js index 681de32d0560..d3f5db419c6b 100644 --- a/packages/babel-parser/src/parser/index.js +++ b/packages/babel-parser/src/parser/index.js @@ -7,6 +7,7 @@ import { getOptions } from "../options"; import StatementParser from "./statement"; import { SCOPE_ASYNC, SCOPE_PROGRAM } from "../util/scopeflags"; import ScopeHandler from "../util/scope"; +import ClassScopeHandler from "../util/class-scope"; export type PluginsMap = Map; @@ -25,6 +26,7 @@ export default class Parser extends StatementParser { this.options = options; this.inModule = this.options.sourceType === "module"; this.scope = new ScopeHandler(this.raise.bind(this), this.inModule); + this.classScope = new ClassScopeHandler(this.raise.bind(this)); this.plugins = pluginsMap(this.options.plugins); this.filename = options.sourceFilename; } diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index be090db6edf9..7a5bc33c9541 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -20,6 +20,11 @@ import { SCOPE_OTHER, SCOPE_SIMPLE_CATCH, SCOPE_SUPER, + CLASS_ELEMENT_OTHER, + CLASS_ELEMENT_INSTANCE_GETTER, + CLASS_ELEMENT_INSTANCE_SETTER, + CLASS_ELEMENT_STATIC_GETTER, + CLASS_ELEMENT_STATIC_SETTER, type BindingTypes, } from "../util/scopeflags"; @@ -1171,7 +1176,7 @@ export default class StatementParser extends ExpressionParser { } parseClassBody(constructorAllowsSuper: boolean): N.ClassBody { - this.state.classLevel++; + this.classScope.enter(); const state = { hadConstructor: false }; let decorators: N.Decorator[] = []; @@ -1231,7 +1236,7 @@ export default class StatementParser extends ExpressionParser { ); } - this.state.classLevel--; + this.classScope.exit(); return this.finishNode(classBody, "ClassBody"); } @@ -1514,7 +1519,15 @@ export default class StatementParser extends ExpressionParser { prop: N.ClassPrivateProperty, ) { this.expectPlugin("classPrivateProperties", prop.key.start); - classBody.body.push(this.parseClassPrivateProperty(prop)); + + const node = this.parseClassPrivateProperty(prop); + classBody.body.push(node); + + this.classScope.declarePrivateName( + node.key.id.name, + CLASS_ELEMENT_OTHER, + node.key.start, + ); } pushClassMethod( @@ -1545,17 +1558,29 @@ export default class StatementParser extends ExpressionParser { isAsync: boolean, ): void { this.expectPlugin("classPrivateMethods", method.key.start); - classBody.body.push( - this.parseMethod( - method, - isGenerator, - isAsync, - /* isConstructor */ false, - false, - "ClassPrivateMethod", - true, - ), + + const node = this.parseMethod( + method, + isGenerator, + isAsync, + /* isConstructor */ false, + false, + "ClassPrivateMethod", + true, ); + classBody.body.push(node); + + const kind = + node.kind === "get" + ? node.static + ? CLASS_ELEMENT_STATIC_GETTER + : CLASS_ELEMENT_INSTANCE_GETTER + : node.kind === "set" + ? node.static + ? CLASS_ELEMENT_STATIC_SETTER + : CLASS_ELEMENT_INSTANCE_SETTER + : CLASS_ELEMENT_OTHER; + this.classScope.declarePrivateName(node.key.id.name, kind, node.key.start); } // Overridden in typescript.js diff --git a/packages/babel-parser/src/tokenizer/index.js b/packages/babel-parser/src/tokenizer/index.js index 27f1aaa15f96..a4e2de67a242 100644 --- a/packages/babel-parser/src/tokenizer/index.js +++ b/packages/babel-parser/src/tokenizer/index.js @@ -391,14 +391,8 @@ export default class Tokenizer extends LocationParser { } if ( - (this.hasPlugin("classPrivateProperties") || - this.hasPlugin("classPrivateMethods")) && - this.state.classLevel > 0 - ) { - ++this.state.pos; - this.finishToken(tt.hash); - return; - } else if ( + this.hasPlugin("classPrivateProperties") || + this.hasPlugin("classPrivateMethods") || this.getPluginOption("pipelineOperator", "proposal") === "smart" ) { this.finishOp(tt.hash, 1); diff --git a/packages/babel-parser/src/tokenizer/state.js b/packages/babel-parser/src/tokenizer/state.js index 874b5cbdfcad..ff0e704b8f00 100644 --- a/packages/babel-parser/src/tokenizer/state.js +++ b/packages/babel-parser/src/tokenizer/state.js @@ -77,9 +77,6 @@ export default class State { soloAwait: boolean = false; inFSharpPipelineDirectBody: boolean = false; - // Check whether we are in a (nested) class or not. - classLevel: number = 0; - // Labels in scope. labels: Array<{ kind: ?("loop" | "switch"), diff --git a/packages/babel-parser/src/util/class-scope.js b/packages/babel-parser/src/util/class-scope.js new file mode 100644 index 000000000000..0d1332160a62 --- /dev/null +++ b/packages/babel-parser/src/util/class-scope.js @@ -0,0 +1,113 @@ +// @flow + +import { + CLASS_ELEMENT_KIND_ACCESSOR, + CLASS_ELEMENT_FLAG_STATIC, + type ClassElementTypes, +} from "./scopeflags"; + +export class ClassScope { + // A list of private named declared in the current class + privateNames: Set = new Set(); + + // A list of private getters of setters without their counterpart + loneAccessors: Map = new Map(); + + // A list of private names used before being defined, mapping to + // their position. + undefinedPrivateNames: Map = new Map(); +} + +type raiseFunction = (number, string) => void; + +export default class ClassScopeHandler { + stack: Array = []; + raise: raiseFunction; + undefinedPrivateNames: Map = new Map(); + + constructor(raise: raiseFunction) { + this.raise = raise; + } + + current(): ClassScope { + return this.stack[this.stack.length - 1]; + } + + enter() { + this.stack.push(new ClassScope()); + } + + exit() { + const oldClassScope = this.stack.pop(); + + // Migrate the usage of not yet defined private names to the outer + // class scope, or raise an error if we reached the top-level scope. + + const current = this.current(); + + // Array.from is needed because this is compiled to an array-like for loop + for (const [name, pos] of Array.from(oldClassScope.undefinedPrivateNames)) { + if (current) { + if (!current.undefinedPrivateNames.has(name)) { + current.undefinedPrivateNames.set(name, pos); + } + } else { + this.raiseUndeclaredPrivateName(name, pos); + } + } + } + + declarePrivateName( + name: string, + elementType: ClassElementTypes, + pos: number, + ) { + const classScope = this.current(); + let redefined = classScope.privateNames.has(name); + + if (elementType & CLASS_ELEMENT_KIND_ACCESSOR) { + const accessor = redefined && classScope.loneAccessors.get(name); + if (accessor) { + const oldStatic = accessor & CLASS_ELEMENT_FLAG_STATIC; + const newStatic = elementType & CLASS_ELEMENT_FLAG_STATIC; + + const oldKind = accessor & CLASS_ELEMENT_KIND_ACCESSOR; + const newKind = elementType & CLASS_ELEMENT_KIND_ACCESSOR; + + // The private name can be duplicated only if it is used by + // two accessors with different kind (get and set), and if + // they have the same placement (static or not). + redefined = oldKind === newKind || oldStatic !== newStatic; + + if (!redefined) classScope.loneAccessors.delete(name); + } else if (!redefined) { + classScope.loneAccessors.set(name, elementType); + } + } + + if (redefined) { + this.raise(pos, `Duplicate private name #${name}`); + } + + classScope.privateNames.add(name); + classScope.undefinedPrivateNames.delete(name); + } + + usePrivateName(name: string, pos: number) { + let classScope; + for (classScope of this.stack) { + if (classScope.privateNames.has(name)) return; + } + + if (classScope) { + classScope.undefinedPrivateNames.set(name, pos); + } else { + // top-level + this.raiseUndeclaredPrivateName(name, pos); + } + } + + raiseUndeclaredPrivateName(name: string, pos: number) { + this.raise(pos, `Private name #${name} is not defined`); + } +} diff --git a/packages/babel-parser/src/util/scope.js b/packages/babel-parser/src/util/scope.js index bc90be4d03cb..1cbf06fb671f 100644 --- a/packages/babel-parser/src/util/scope.js +++ b/packages/babel-parser/src/util/scope.js @@ -43,6 +43,7 @@ export default class ScopeHandler { raise: raiseFunction; inModule: boolean; undefinedExports: Map = new Map(); + undefinedPrivateNames: Map = new Map(); constructor(raise: raiseFunction, inModule: boolean) { this.raise = raise; diff --git a/packages/babel-parser/src/util/scopeflags.js b/packages/babel-parser/src/util/scopeflags.js index d926998835b6..e49359cf615c 100644 --- a/packages/babel-parser/src/util/scopeflags.js +++ b/packages/babel-parser/src/util/scopeflags.js @@ -84,3 +84,23 @@ export type BindingTypes = | typeof BIND_TS_ENUM | typeof BIND_TS_AMBIENT | typeof BIND_TS_NAMESPACE; + +// prettier-ignore +export const CLASS_ELEMENT_FLAG_STATIC = 0b1_00, + CLASS_ELEMENT_KIND_GETTER = 0b0_10, + CLASS_ELEMENT_KIND_SETTER = 0b0_01, + CLASS_ELEMENT_KIND_ACCESSOR = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_KIND_SETTER; + +// prettier-ignore +export const CLASS_ELEMENT_STATIC_GETTER = CLASS_ELEMENT_KIND_GETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_STATIC_SETTER = CLASS_ELEMENT_KIND_SETTER | CLASS_ELEMENT_FLAG_STATIC, + CLASS_ELEMENT_INSTANCE_GETTER = CLASS_ELEMENT_KIND_GETTER, + CLASS_ELEMENT_INSTANCE_SETTER = CLASS_ELEMENT_KIND_SETTER, + CLASS_ELEMENT_OTHER = 0; + +export type ClassElementTypes = + | typeof CLASS_ELEMENT_STATIC_GETTER + | typeof CLASS_ELEMENT_STATIC_SETTER + | typeof CLASS_ELEMENT_INSTANCE_GETTER + | typeof CLASS_ELEMENT_INSTANCE_SETTER + | typeof CLASS_ELEMENT_OTHER; diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md new file mode 100644 index 000000000000..d8f726880604 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/README.md @@ -0,0 +1,26 @@ +These tests have been generated using the following script: + +```js +var feat = { + "field": "#x = 0;", + "method": "#x() {}", + "get": "get #x() {}", + "set": "set #x(_) {}", +}; +var placement = { + "static": "static ", + "instance": "" +} + +for (var f1 in feat) for (var f2 in feat) for (var p1 in placement) for (var p2 in placement) { + var code = `class A { + ${placement[p1]}${feat[f1]} + ${placement[p2]}${feat[f2]} +}`; + var name = `${p1}-${f1}-${p2}-${f2}`; + var folder = "packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/" + name; + + if (!fs.existsSync(folder)) fs.mkdirSync(folder); + fs.writeFileSync(folder + "/input.js", code); +} +``` \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js new file mode 100644 index 000000000000..bb68229716d6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json new file mode 100644 index 000000000000..b69a455a0f53 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "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": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/instance-field-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/input.js new file mode 100644 index 000000000000..95514f1d83fd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json new file mode 100644 index 000000000000..62a6d3a10f71 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "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": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js new file mode 100644 index 000000000000..82fa3236ab43 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json new file mode 100644 index 000000000000..0d301cbb847c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "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": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js new file mode 100644 index 000000000000..4bb80c110229 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json new file mode 100644 index 000000000000..99af2b8a69a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (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": "ClassDeclaration", + "start": 0, + "end": 36, + "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": 36, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js new file mode 100644 index 000000000000..67c3cc794ef3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json new file mode 100644 index 000000000000..45ed934caa5d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js new file mode 100644 index 000000000000..1f53201d6970 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json new file mode 100644 index 000000000000..d4e1a7d1e628 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js new file mode 100644 index 000000000000..a1229c8992f1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json new file mode 100644 index 000000000000..3fa0178df710 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js new file mode 100644 index 000000000000..4221a39406f9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/input.js @@ -0,0 +1,4 @@ +class A { + #x = 0; + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json new file mode 100644 index 000000000000..3e3d50633689 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js new file mode 100644 index 000000000000..45adc3907e0a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json new file mode 100644 index 000000000000..e7c6f5e6bb2e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "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": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/instance-get-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/input.js new file mode 100644 index 000000000000..7818246e3fd0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json new file mode 100644 index 000000000000..c63e32cca838 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json @@ -0,0 +1,230 @@ +{ + "type": "File", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 39, + "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": 39, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 35, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js new file mode 100644 index 000000000000..00d50846e973 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json new file mode 100644 index 000000000000..9fa1c2917097 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "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": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js new file mode 100644 index 000000000000..f5b4f4bb8764 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json new file mode 100644 index 000000000000..109fbb70bafe --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 40, + "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": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 33, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js new file mode 100644 index 000000000000..c915535f827c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json new file mode 100644 index 000000000000..5c6ec686f516 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 26, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js new file mode 100644 index 000000000000..88136bae1fe0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json new file mode 100644 index 000000000000..65ec3150bbea --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json @@ -0,0 +1,230 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js new file mode 100644 index 000000000000..73288616ed47 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json new file mode 100644 index 000000000000..68c3ff18b28b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js new file mode 100644 index 000000000000..bce8d6c24669 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/input.js @@ -0,0 +1,4 @@ +class A { + get #x() {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json new file mode 100644 index 000000000000..470062c22b80 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 2, + "column": 11 + }, + "end": { + "line": 2, + "column": 13 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 26, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js new file mode 100644 index 000000000000..48e8c322691f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json new file mode 100644 index 000000000000..d32285dc3ae0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "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": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/instance-method-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/input.js new file mode 100644 index 000000000000..b1d19924d288 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json new file mode 100644 index 000000000000..8dbf70cdb04b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 35, + "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": 35, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js new file mode 100644 index 000000000000..c1a8a11a361a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json new file mode 100644 index 000000000000..7fe8d83f31e1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 31, + "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": 31, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js new file mode 100644 index 000000000000..3ac461db7a73 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json new file mode 100644 index 000000000000..35d6a2f29be3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (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": "ClassDeclaration", + "start": 0, + "end": 36, + "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": 36, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 26, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 27, + "end": 28, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js new file mode 100644 index 000000000000..f9f1b1015567 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json new file mode 100644 index 000000000000..8e3500892679 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js new file mode 100644 index 000000000000..fdf3bef6984c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json new file mode 100644 index 000000000000..1d94cf85460b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js new file mode 100644 index 000000000000..a1aa1d542441 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json new file mode 100644 index 000000000000..fd8bc97f5bbd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js new file mode 100644 index 000000000000..3b2e1e37704a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/input.js @@ -0,0 +1,4 @@ +class A { + #x() {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json new file mode 100644 index 000000000000..b984451082ec --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 22, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js new file mode 100644 index 000000000000..095f191f877b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json new file mode 100644 index 000000000000..83b198523bad --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 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": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/instance-set-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/input.js new file mode 100644 index 000000000000..8e7e5544b96e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json new file mode 100644 index 000000000000..08513a3011e8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 40, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 40, + "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": 40, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js new file mode 100644 index 000000000000..f0d912243eef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json new file mode 100644 index 000000000000..dceb3bd390a6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 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": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 28, + "end": 29, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 32, + "end": 34, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js new file mode 100644 index 000000000000..d4e2624635cb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json new file mode 100644 index 000000000000..7add5089ff95 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json @@ -0,0 +1,266 @@ +{ + "type": "File", + "start": 0, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 31, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 32, + "end": 33, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js new file mode 100644 index 000000000000..3e3b25f208b6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json new file mode 100644 index 000000000000..06e380aea7f2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js new file mode 100644 index 000000000000..3c0764dfad45 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json new file mode 100644 index 000000000000..339ca0c0d546 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js new file mode 100644 index 000000000000..ce3a89c61108 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json new file mode 100644 index 000000000000..184125273236 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js new file mode 100644 index 000000000000..7a5e410fdd91 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/input.js @@ -0,0 +1,4 @@ +class A { + set #x(_) {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json new file mode 100644 index 000000000000..128468f9659f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json @@ -0,0 +1,266 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 48, + "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": 48, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 2, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 12 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 27, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js new file mode 100644 index 000000000000..3de944035833 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json new file mode 100644 index 000000000000..0724b9e565a2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateProperty", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/static-field-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/input.js new file mode 100644 index 000000000000..dd34390358ee --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json new file mode 100644 index 000000000000..1a3e576e3b80 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js new file mode 100644 index 000000000000..ae2b2f980b8a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json new file mode 100644 index 000000000000..d1c2347cb125 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js new file mode 100644 index 000000000000..8962661873c3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json new file mode 100644 index 000000000000..0a638b426ae2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js new file mode 100644 index 000000000000..f30eaf46a76c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json new file mode 100644 index 000000000000..7cf03fd42bb7 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json @@ -0,0 +1,224 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateProperty", + "start": 29, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js new file mode 100644 index 000000000000..27598cc9b1ef --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json new file mode 100644 index 000000000000..98d454b78c67 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js new file mode 100644 index 000000000000..3530aef207c1 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json new file mode 100644 index 000000000000..74c7d35d4fa3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js new file mode 100644 index 000000000000..705e02850f9c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/input.js @@ -0,0 +1,4 @@ +class A { + static #x = 0; + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json new file mode 100644 index 000000000000..379ee84d2d94 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, + "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": 50, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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": { + "type": "NumericLiteral", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js new file mode 100644 index 000000000000..5063908de961 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json new file mode 100644 index 000000000000..113e8bbbbeeb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 33, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/static-get-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/input.js new file mode 100644 index 000000000000..819cf9b38c3c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json new file mode 100644 index 000000000000..c7fd9652e864 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json @@ -0,0 +1,230 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js new file mode 100644 index 000000000000..e22778f87886 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json new file mode 100644 index 000000000000..67e2f41f4ca2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js new file mode 100644 index 000000000000..21bab2d3e874 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json new file mode 100644 index 000000000000..ef06223a73fb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js new file mode 100644 index 000000000000..70ab10f5eafd --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json new file mode 100644 index 000000000000..e0271651aae5 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json @@ -0,0 +1,227 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js new file mode 100644 index 000000000000..dcb23a94a7fa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json new file mode 100644 index 000000000000..dd680abb9878 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json @@ -0,0 +1,230 @@ +{ + "type": "File", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 53, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 53, + "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": 53, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 49, + "end": 51, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js new file mode 100644 index 000000000000..5cf7a3e6524f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json new file mode 100644 index 000000000000..297ceb941b4b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js new file mode 100644 index 000000000000..f13a22c0b724 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/input.js @@ -0,0 +1,4 @@ +class A { + static get #x() {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json new file mode 100644 index 000000000000..cb14ff5bd58b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 54, + "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": 54, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 18 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 33, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 47, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js new file mode 100644 index 000000000000..2e87605b197c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json new file mode 100644 index 000000000000..e34c853586a9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/static-method-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/input.js new file mode 100644 index 000000000000..d714c04e0f50 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json new file mode 100644 index 000000000000..c6b5cb7b3f5b --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 42, + "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": 42, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js new file mode 100644 index 000000000000..520c9088d109 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json new file mode 100644 index 000000000000..56572b56584e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3: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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 30, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js new file mode 100644 index 000000000000..b2c76dfa77f4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json new file mode 100644 index 000000000000..b8a0773cf4d6 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 33, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 36, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js new file mode 100644 index 000000000000..24d63ae53646 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json new file mode 100644 index 000000000000..dfaf6f688e1e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 29, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js new file mode 100644 index 000000000000..8a3c3ff6a962 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json new file mode 100644 index 000000000000..e019b3c9aaaa --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json @@ -0,0 +1,229 @@ +{ + "type": "File", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 49, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js new file mode 100644 index 000000000000..316f6d89f48f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json new file mode 100644 index 000000000000..029d9cd6f8a3 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json @@ -0,0 +1,228 @@ +{ + "type": "File", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 36, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 37, + "end": 38, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js new file mode 100644 index 000000000000..590b70f3987e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/input.js @@ -0,0 +1,4 @@ +class A { + static #x() {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json new file mode 100644 index 000000000000..d788eda7fd02 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, + "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": 50, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "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" + } + }, + "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": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 29, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 40, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js new file mode 100644 index 000000000000..315703f68bce --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json new file mode 100644 index 000000000000..b50939f38415 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "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/class-private-names-duplicated/static-set-instance-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/input.js new file mode 100644 index 000000000000..b2515ac17405 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json new file mode 100644 index 000000000000..ddea1a756790 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json @@ -0,0 +1,248 @@ +{ + "type": "File", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 47, + "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": 47, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 43, + "end": 45, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js new file mode 100644 index 000000000000..8249487ab52e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json new file mode 100644 index 000000000000..3b9334d91225 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:2)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 43, + "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": 43, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 34, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 9 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js new file mode 100644 index 000000000000..3b7d8653ee40 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json new file mode 100644 index 000000000000..b56cf90f93db --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json @@ -0,0 +1,266 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:6)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 48, + "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": 48, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 38, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 39, + "end": 40, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 41, + "end": 42, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 10 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 44, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 3, + "column": 14 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js new file mode 100644 index 000000000000..3dfbfe2861d4 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + static #x = 0; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json new file mode 100644 index 000000000000..c063c6722c93 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, + "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": 50, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 34, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js new file mode 100644 index 000000000000..5ac842d7dc2f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + static get #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json new file mode 100644 index 000000000000..06b5a7c528b0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 54, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 54, + "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": 54, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "get", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 50, + "end": 52, + "loc": { + "start": { + "line": 3, + "column": 18 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js new file mode 100644 index 000000000000..3f3537bcb0a0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + static #x() {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json new file mode 100644 index 000000000000..78b17369506f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json @@ -0,0 +1,247 @@ +{ + "type": "File", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:9)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 50, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 50, + "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": 50, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 3, + "column": 11 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 46, + "end": 48, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 16 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js new file mode 100644 index 000000000000..d6337e16b74f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/input.js @@ -0,0 +1,4 @@ +class A { + static set #x(_) {} + static set #x(_) {} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json new file mode 100644 index 000000000000..af02072af9d9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "classPrivateMethods"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json new file mode 100644 index 000000000000..146f1c39f34d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json @@ -0,0 +1,266 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Duplicate private name #x (3:13)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 55, + "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": 55, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateMethod", + "start": 12, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 23, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 13 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 24, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 26, + "end": 27, + "loc": { + "start": { + "line": 2, + "column": 16 + }, + "end": { + "line": 2, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 29, + "end": 31, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "body": [], + "directives": [] + } + }, + { + "type": "ClassPrivateMethod", + "start": 34, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "static": true, + "key": { + "type": "PrivateName", + "start": 45, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 13 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "id": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "computed": false, + "kind": "set", + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "Identifier", + "start": 48, + "end": 49, + "loc": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + }, + "identifierName": "_" + }, + "name": "_" + } + ], + "body": { + "type": "BlockStatement", + "start": 51, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 21 + } + }, + "body": [], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js new file mode 100644 index 000000000000..e4e3ae4c3870 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/input.js @@ -0,0 +1,9 @@ +class B { + meth() { + class A { + #x = this.#y; + } + } + + #y; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json new file mode 100644 index 000000000000..25819769bb20 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json new file mode 100644 index 000000000000..1bd1092fae92 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json @@ -0,0 +1,352 @@ +{ + "type": "File", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "id": { + "type": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "B" + }, + "name": "B" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 73, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 9, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 12, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 12, + "end": 16, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 6 + }, + "identifierName": "meth" + }, + "name": "meth" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 19, + "end": 64, + "loc": { + "start": { + "line": 2, + "column": 9 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ClassDeclaration", + "start": 25, + "end": 60, + "loc": { + "start": { + "line": 3, + "column": 4 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 11 + }, + "identifierName": "A" + }, + "name": "A" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 33, + "end": 60, + "loc": { + "start": { + "line": 3, + "column": 12 + }, + "end": { + "line": 5, + "column": 5 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 41, + "end": 54, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 19 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 41, + "end": 43, + "loc": { + "start": { + "line": 4, + "column": 6 + }, + "end": { + "line": 4, + "column": 8 + } + }, + "id": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 8 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "value": { + "type": "MemberExpression", + "start": 46, + "end": 53, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "object": { + "type": "ThisExpression", + "start": 46, + "end": 50, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 15 + } + } + }, + "property": { + "type": "PrivateName", + "start": 51, + "end": 53, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 18 + } + }, + "id": { + "type": "Identifier", + "start": 52, + "end": 53, + "loc": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 4, + "column": 18 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "computed": false + } + } + ] + } + } + ], + "directives": [] + } + }, + { + "type": "ClassPrivateProperty", + "start": 68, + "end": 71, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 5 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 68, + "end": 70, + "loc": { + "start": { + "line": 8, + "column": 2 + }, + "end": { + "line": 8, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 69, + "end": 70, + "loc": { + "start": { + "line": 8, + "column": 3 + }, + "end": { + "line": 8, + "column": 4 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js new file mode 100644 index 000000000000..bd7c6a515696 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/input.js @@ -0,0 +1,4 @@ +class A { + #x = this.#y; + #y; +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json new file mode 100644 index 000000000000..25819769bb20 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json new file mode 100644 index 000000000000..3c7ad5de9321 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json @@ -0,0 +1,245 @@ +{ + "type": "File", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 33, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 33, + "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": 33, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 25, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 15 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "MemberExpression", + "start": 17, + "end": 24, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 14 + } + }, + "object": { + "type": "ThisExpression", + "start": 17, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 11 + } + } + }, + "property": { + "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": "y" + }, + "name": "y" + } + }, + "computed": false + } + }, + { + "type": "ClassPrivateProperty", + "start": 28, + "end": 31, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 5 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 28, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 29, + "end": 30, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "y" + }, + "name": "y" + } + }, + "value": null + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js new file mode 100644 index 000000000000..3177068d7eb0 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/input.js @@ -0,0 +1,6 @@ +class A { + #x; + meth() { + var prop = foo.#priv; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json new file mode 100644 index 000000000000..1ca5069a3a2f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "classPrivateProperties" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json new file mode 100644 index 000000000000..f13ed5f0567c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json @@ -0,0 +1,309 @@ +{ + "type": "File", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private name #priv is not defined (4:19)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 58, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "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": 58, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": null + }, + { + "type": "ClassMethod", + "start": 18, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 18, + "end": 22, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 6 + }, + "identifierName": "meth" + }, + "name": "meth" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 25, + "end": 56, + "loc": { + "start": { + "line": 3, + "column": 9 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 31, + "end": 52, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 35, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 35, + "end": 39, + "loc": { + "start": { + "line": 4, + "column": 8 + }, + "end": { + "line": 4, + "column": 12 + }, + "identifierName": "prop" + }, + "name": "prop" + }, + "init": { + "type": "MemberExpression", + "start": 42, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "object": { + "type": "Identifier", + "start": 42, + "end": 45, + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 18 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "property": { + "type": "PrivateName", + "start": 46, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 19 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 51, + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 24 + }, + "identifierName": "priv" + }, + "name": "priv" + } + }, + "computed": false + } + } + ], + "kind": "var" + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js new file mode 100644 index 000000000000..10607b89b6db --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/input.js @@ -0,0 +1 @@ +var prop = foo.#priv; \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json new file mode 100644 index 000000000000..1ca5069a3a2f --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + "classPrivateProperties" + ] +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json new file mode 100644 index 000000000000..88c45d101fa8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json @@ -0,0 +1,153 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "errors": [ + "SyntaxError: Private name #priv is not defined (1:15)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 21 + } + }, + "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": 8, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 8 + }, + "identifierName": "prop" + }, + "name": "prop" + }, + "init": { + "type": "MemberExpression", + "start": 11, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "object": { + "type": "Identifier", + "start": 11, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 14 + }, + "identifierName": "foo" + }, + "name": "foo" + }, + "property": { + "type": "PrivateName", + "start": 15, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 15 + }, + "end": { + "line": 1, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 16, + "end": 20, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + }, + "identifierName": "priv" + }, + "name": "priv" + } + }, + "computed": false + } + } + ], + "kind": "var" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-get/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-get/options.json index 9c0ba0e4b46a..49dcfc816842 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-get/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-get/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #getSet" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-method/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-method/options.json index 9c0ba0e4b46a..1edb048c1285 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-method/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/get-method/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #foo" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-get/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-get/options.json index 9c0ba0e4b46a..1edb048c1285 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-get/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-get/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #foo" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-method/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-method/options.json index 9c0ba0e4b46a..b3e2e5dade0d 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-method/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-method/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #dank" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-set/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-set/options.json index 9c0ba0e4b46a..1edb048c1285 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-set/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/method-set/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #foo" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-method/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-method/options.json index 9c0ba0e4b46a..1edb048c1285 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-method/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-method/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #foo" } diff --git a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-set/options.json b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-set/options.json index 9c0ba0e4b46a..49dcfc816842 100644 --- a/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-set/options.json +++ b/packages/babel-plugin-proposal-private-methods/test/fixtures/duplicated-names/set-set/options.json @@ -1,3 +1,3 @@ { - "throws": "Duplicate private field" + "throws": "Duplicate private name #getSet" } diff --git a/scripts/parser-tests/flow/whitelist.txt b/scripts/parser-tests/flow/whitelist.txt index 8e24ebf0a28d..668fb625d47d 100644 --- a/scripts/parser-tests/flow/whitelist.txt +++ b/scripts/parser-tests/flow/whitelist.txt @@ -14,10 +14,4 @@ export_import_reserved_words/migrated_0003.js export_statements/export_trailing_comma.js nullish_coalescing/precedence_and.js nullish_coalescing/precedence_or.js -private_class_properties/getter_and_field.js -private_class_properties/getter_duplicate.js -private_class_properties/multiple.js -private_class_properties/multiple.js -private_class_properties/setter_and_field.js -private_class_properties/setter_duplicate.js types/member/reserved_words.js diff --git a/scripts/parser-tests/test262/whitelist.txt b/scripts/parser-tests/test262/whitelist.txt index 512bee9a2ca8..d7a38c2104cf 100644 --- a/scripts/parser-tests/test262/whitelist.txt +++ b/scripts/parser-tests/test262/whitelist.txt @@ -1,194 +1,16 @@ -language/expressions/class/elements/fields-duplicate-privatenames.js(default) -language/expressions/class/elements/fields-duplicate-privatenames.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(strict mode) language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(strict mode) -language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) -language/expressions/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(strict mode) +language/expressions/object/method-definition/private-name-early-error-async-gen.js(default) +language/expressions/object/method-definition/private-name-early-error-async-gen.js(strict mode) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) +language/expressions/object/method-definition/private-name-early-error-gen.js(default) +language/expressions/object/method-definition/private-name-early-error-gen.js(strict mode) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/module-code/privatename-not-valid-earlyerr-module-1.js(default) -language/module-code/privatename-not-valid-earlyerr-module-1.js(strict mode) -language/module-code/privatename-not-valid-earlyerr-module-2.js(default) -language/module-code/privatename-not-valid-earlyerr-module-2.js(strict mode) -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/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) -language/statements/class/elements/privatename-not-valid-earlyerr-script-1.js(strict mode) -language/statements/class/elements/privatename-not-valid-earlyerr-script-2.js(default) -language/statements/class/elements/privatename-not-valid-earlyerr-script-2.js(strict mode) -language/statements/class/elements/privatename-not-valid-earlyerr-script-3.js(default) -language/statements/class/elements/privatename-not-valid-earlyerr-script-3.js(strict mode) -language/statements/class/elements/privatename-not-valid-earlyerr-script-4.js(default) -language/statements/class/elements/privatename-not-valid-earlyerr-script-4.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(default) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-chained-usage.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(default) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage-recursive.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(default) -language/statements/class/elements/syntax/early-errors/grammar-private-environment-on-class-heritage.js(strict mode) +language/expressions/object/method-definition/private-name-early-error-method.js(default) +language/expressions/object/method-definition/private-name-early-error-method.js(strict mode) language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async-gen.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-async.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-gen.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-field.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-get-get.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-field.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-get.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-meth.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-set.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticmeth.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-set.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(default) -language/statements/class/elements/syntax/early-errors/grammar-privatename-in-computed-property-missing.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-fn-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/field-init-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-fn-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-heritage-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-member-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-call-expression-this.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-bad-reference.js(strict mode) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(default) -language/statements/class/elements/syntax/early-errors/invalid-names/method-outter-member-expression-this.js(strict mode) From 7bc22e42f563596a59e3c6c9825322d6cbba6a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 9 Jan 2020 20:28:16 -0500 Subject: [PATCH 921/965] StringNumericLiteral does not include NumericLiteralSeparator (#10938) --- .../src/index.js | 16 ---------------- .../test/fixtures/number/exec.js | 19 ------------------- .../test/fixtures/number/options.json | 3 --- 3 files changed, 38 deletions(-) delete mode 100644 packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/exec.js delete mode 100644 packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/options.json diff --git a/packages/babel-plugin-proposal-numeric-separator/src/index.js b/packages/babel-plugin-proposal-numeric-separator/src/index.js index 99c29d700e1b..915088dffe4b 100644 --- a/packages/babel-plugin-proposal-numeric-separator/src/index.js +++ b/packages/babel-plugin-proposal-numeric-separator/src/index.js @@ -1,30 +1,14 @@ import { declare } from "@babel/helper-plugin-utils"; import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator"; -import { types as t } from "@babel/core"; export default declare(api => { api.assertVersion(7); - function replaceNumberArg({ node }) { - if (node.callee.name !== "Number") { - return; - } - - const arg = node.arguments[0]; - if (!t.isStringLiteral(arg)) { - return; - } - - arg.value = arg.value.replace(/_/g, ""); - } - return { name: "proposal-numeric-separator", inherits: syntaxNumericSeparator, visitor: { - CallExpression: replaceNumberArg, - NewExpression: replaceNumberArg, NumericLiteral({ node }) { const { extra } = node; if (extra && /_/.test(extra.raw)) { diff --git a/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/exec.js b/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/exec.js deleted file mode 100644 index 238c64241af4..000000000000 --- a/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/exec.js +++ /dev/null @@ -1,19 +0,0 @@ -expect(Number("1_000")).toBe(Number("1000")); -expect(Number("0xAE_BE_CE")).toBe(Number("0xAEBECE")); -expect(Number("0b1010_0001_1000_0101")).toBe(Number("0b1010000110000101")); -expect(Number("0o0_6_6_6")).toBe(Number("0o0666")); - -expect(new Number("1_000").valueOf()).toBe(new Number("1000").valueOf()); -expect(new Number("0xAE_BE_CE").valueOf()).toBe(new Number("0xAEBECE").valueOf()); -expect(new Number("0b1010_0001_1000_0101").valueOf()).toBe(new Number("0b1010000110000101").valueOf()); -expect(new Number("0o0_6_6_6").valueOf()).toBe(new Number("0o0666").valueOf()); - -expect(Number(1_000)).toBe(Number("1000")); -expect(Number(0xAE_BE_CE)).toBe(Number("0xAEBECE")); -expect(Number(0b1010_0001_1000_0101)).toBe(Number("0b1010000110000101")); -expect(Number(0o0_6_6_6)).toBe(Number("0o0666")); - -expect(new Number(1_000).valueOf()).toBe(new Number("1000").valueOf()); -expect(new Number(0xAE_BE_CE).valueOf()).toBe(new Number("0xAEBECE").valueOf()); -expect(new Number(0b1010_0001_1000_0101).valueOf()).toBe(new Number("0b1010000110000101").valueOf()); -expect(new Number(0o0_6_6_6).valueOf()).toBe(new Number("0o0666").valueOf()); diff --git a/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/options.json b/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/options.json deleted file mode 100644 index db4bf9f50d93..000000000000 --- a/packages/babel-plugin-proposal-numeric-separator/test/fixtures/number/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["proposal-numeric-separator"] -} From 5b907e9bb7e356fe869aaa9e3f8aed8c4991f1b5 Mon Sep 17 00:00:00 2001 From: Abdul Ali Date: Thu, 9 Jan 2020 19:28:52 -0600 Subject: [PATCH 922/965] [parser] enable dynamic import by default (#10843) * [parser] enable dynamic import by default * chore: add back babel-core api test --- packages/babel-core/test/api.js | 6 +++--- .../test/fixtures/api/parsing-errors/only-syntax/file.js | 2 +- packages/babel-parser/src/parser/expression.js | 2 -- .../dynamic-import/direct-calls-only/input.js | 0 .../dynamic-import/direct-calls-only/output.json | 0 .../dynamic-import/generator/input.js | 0 .../dynamic-import/generator/output.json | 0 .../dynamic-import/inside-function/input.js | 0 .../dynamic-import/inside-function/output.json | 0 .../dynamic-import/invalid-arguments-spread/input.js | 0 .../dynamic-import/invalid-arguments-spread/output.json | 0 .../dynamic-import/invalid-new/input.js | 0 .../dynamic-import/invalid-new/output.json | 0 .../dynamic-import/invalid-trailing-comma/input.js | 0 .../dynamic-import/invalid-trailing-comma/output.json | 0 .../dynamic-import/multiple-args/input.js | 0 .../dynamic-import/multiple-args/output.json | 0 .../dynamic-import/no-args/input.js | 0 .../dynamic-import/no-args/output.json | 0 .../dynamic-import/parses-module}/input.js | 0 .../dynamic-import/parses-module/options.json | 0 .../dynamic-import/parses-module/output.json | 0 .../dynamic-import/parses-strict/input.js | 0 .../dynamic-import/parses-strict/output.json | 0 .../dynamic-import/return-value/input.js | 0 .../dynamic-import/return-value/output.json | 0 .../dynamic-import/top-level/input.js | 0 .../dynamic-import/top-level/output.json | 0 .../dynamic-import/variable-arguments/input.js | 0 .../dynamic-import/variable-arguments/output.json | 0 .../experimental/_no-plugin/dynamic-import/input.js | 1 - .../experimental/_no-plugin/dynamic-import/options.json | 4 ---- .../dynamic-import/direct-calls-only/options.json | 3 --- .../dynamic-import/invalid-arguments-spread/options.json | 3 --- .../experimental/dynamic-import/invalid-new/options.json | 3 --- .../dynamic-import/invalid-trailing-comma/options.json | 3 --- .../experimental/dynamic-import/multiple-args/options.json | 3 --- .../experimental/dynamic-import/no-args/options.json | 3 --- .../experimental/dynamic-import/no-plugin/options.json | 4 ---- .../test/fixtures/experimental/dynamic-import/options.json | 3 --- .../experimental/dynamic-import/parses-module/input.js | 1 - .../experimental/import-meta/error-in-script/options.json | 2 +- .../import-meta/no-other-prop-names/options.json | 2 +- .../experimental/import-meta/not-assignable/options.json | 2 +- .../experimental/import-meta/valid-in-module/options.json | 2 +- 45 files changed, 8 insertions(+), 41 deletions(-) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/direct-calls-only/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/direct-calls-only/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/generator/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/generator/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/inside-function/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/inside-function/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-arguments-spread/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-arguments-spread/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-new/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-new/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-trailing-comma/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/invalid-trailing-comma/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/multiple-args/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/multiple-args/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/no-args/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/no-args/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental/dynamic-import/no-plugin => es2020/dynamic-import/parses-module}/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/parses-module/options.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/parses-module/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/parses-strict/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/parses-strict/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/return-value/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/return-value/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/top-level/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/top-level/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/variable-arguments/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/dynamic-import/variable-arguments/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/input.js diff --git a/packages/babel-core/test/api.js b/packages/babel-core/test/api.js index 9f2f955f1d7e..5ce9a364c36f 100644 --- a/packages/babel-core/test/api.js +++ b/packages/babel-core/test/api.js @@ -760,11 +760,11 @@ describe("api", function() { options, function(err) { expect(err.message).toMatch( - "Support for the experimental syntax 'dynamicImport' isn't currently enabled (1:9)", + "Support for the experimental syntax 'pipelineOperator' isn't currently enabled (1:3):", ); expect(err.message).toMatch( - "Add @babel/plugin-syntax-dynamic-import (https://git.io/vb4Sv) to the " + - "'plugins' section of your Babel config to enable parsing.", + "Add @babel/plugin-proposal-pipeline-operator (https://git.io/vb4SU) to the " + + "'plugins' section of your Babel config to enable transformation.", ); done(); }, diff --git a/packages/babel-core/test/fixtures/api/parsing-errors/only-syntax/file.js b/packages/babel-core/test/fixtures/api/parsing-errors/only-syntax/file.js index 55194f0636b3..c6c1a3ba7cd2 100644 --- a/packages/babel-core/test/fixtures/api/parsing-errors/only-syntax/file.js +++ b/packages/babel-core/test/fixtures/api/parsing-errors/only-syntax/file.js @@ -1 +1 @@ -var $ = import("jquery"); \ No newline at end of file +a |> b \ No newline at end of file diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 9d2b74aaaf63..b0669d9f46ec 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -922,8 +922,6 @@ export default class ExpressionParser extends LValParser { return this.parseImportMetaProperty(node); } - this.expectPlugin("dynamicImport", node.start); - if (!this.match(tt.parenL)) { this.raise( this.state.lastTokStart, diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/generator/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/generator/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/generator/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/generator/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/inside-function/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/inside-function/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/inside-function/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/inside-function/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-trailing-comma/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/options.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/options.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/options.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/options.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-strict/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-strict/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-strict/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-strict/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-strict/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/return-value/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/return-value/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/return-value/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/return-value/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/top-level/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/top-level/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/top-level/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/top-level/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/top-level/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/variable-arguments/input.js b/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/variable-arguments/input.js rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/variable-arguments/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/dynamic-import/variable-arguments/output.json rename to packages/babel-parser/test/fixtures/es2020/dynamic-import/variable-arguments/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/input.js deleted file mode 100644 index f0038a3c11fd..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/input.js +++ /dev/null @@ -1 +0,0 @@ -var $ = import("jquery"); diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/options.json deleted file mode 100644 index 90bbfd5623c9..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/dynamic-import/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'dynamicImport' (1:8)", - "plugins": [] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/direct-calls-only/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-arguments-spread/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-new/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-trailing-comma/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/multiple-args/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} 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 deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-args/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/options.json deleted file mode 100644 index 8036724beed2..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/no-plugin/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'dynamicImport' (1:0)", - "plugins": [] -} diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/options.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/options.json deleted file mode 100644 index 1629df1f3678..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["dynamicImport"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/input.js b/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/input.js deleted file mode 100644 index b49ee994b11f..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/parses-module/input.js +++ /dev/null @@ -1 +0,0 @@ -import('test.js'); 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 566380d4fdeb..7442e09e1f56 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,4 +1,4 @@ { - "plugins": ["dynamicImport", "importMeta"], + "plugins": ["importMeta"], "sourceType": "script" } 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 be1070ffed9d..a6638b6528c1 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,4 +1,4 @@ { "sourceType": "module", - "plugins": ["dynamicImport", "importMeta"] + "plugins": ["importMeta"] } 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 be1070ffed9d..a6638b6528c1 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,4 +1,4 @@ { "sourceType": "module", - "plugins": ["dynamicImport", "importMeta"] + "plugins": ["importMeta"] } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/options.json b/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/options.json index be1070ffed9d..a6638b6528c1 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/options.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/options.json @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["dynamicImport", "importMeta"] + "plugins": ["importMeta"] } From c3388ea42f3ec2d9614503fd0eff81b679ba12a7 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Fri, 10 Jan 2020 02:52:53 +0100 Subject: [PATCH 923/965] Enable nullish coalescing by default in @babel/parser (#10819) * move files, remove hasPlugin() & expectPlugin() * restore permissions --- .../src/parser/util/missing-plugin-helper.js | 20 +++++++++---------- .../types/LogicalExpression/options.json | 3 --- .../babel-parser/src/parser/expression.js | 3 --- .../and-nullish/input.js | 0 .../and-nullish/output.json | 0 .../associativity/input.js | 0 .../associativity/output.json | 0 .../expression/input.js | 0 .../expression/output.json | 0 .../multiline/input.js | 0 .../multiline/output.json | 0 .../no-paren-and-nullish/input.js | 0 .../no-paren-and-nullish/options.json | 2 +- .../no-paren-nullish-and/input.js | 0 .../no-paren-nullish-and/options.json | 1 - .../no-paren-nullish-or/input.js | 0 .../no-paren-nullish-or/options.json | 1 - .../no-paren-or-nullish/input.js | 0 .../no-paren-or-nullish/options.json | 2 +- .../nullish-and/input.js | 0 .../nullish-and/output.json | 0 .../nullish-or/input.js | 0 .../nullish-or/output.json | 0 .../or-nullish/input.js | 0 .../or-nullish/output.json | 0 .../with-pipeline/input.js | 0 .../with-pipeline/options.json | 1 - .../with-pipeline/output.json | 0 .../input.js | 2 -- .../options.json | 4 ---- .../qq-equals-no-plugin/options.json | 1 - .../qq-equals/options.json | 2 +- .../and-nullish/options.json | 3 --- .../associativity/options.json | 3 --- .../expression/options.json | 3 --- .../multiline/options.json | 3 --- .../no-plugin-error/input.js | 1 - .../no-plugin-error/options.json | 3 --- .../nullish-and/options.json | 3 --- .../nullish-or/options.json | 3 --- .../or-nullish/options.json | 3 --- 41 files changed, 13 insertions(+), 54 deletions(-) delete mode 100644 packages/babel-generator/test/fixtures/types/LogicalExpression/options.json rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/and-nullish/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/and-nullish/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/associativity/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/associativity/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/expression/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/expression/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/multiline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/multiline/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-and-nullish/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-and-nullish/options.json (66%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-nullish-and/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-nullish-and/options.json (70%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-nullish-or/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-nullish-or/options.json (71%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-or-nullish/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/no-paren-or-nullish/options.json (66%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/nullish-and/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/nullish-and/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/nullish-or/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/nullish-or/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/or-nullish/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/or-nullish/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/with-pipeline/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/with-pipeline/options.json (69%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/nullish-coalescing-operator/with-pipeline/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/options.json diff --git a/packages/babel-core/src/parser/util/missing-plugin-helper.js b/packages/babel-core/src/parser/util/missing-plugin-helper.js index b0642c50c3cf..2560f3ea94bc 100644 --- a/packages/babel-core/src/parser/util/missing-plugin-helper.js +++ b/packages/babel-core/src/parser/util/missing-plugin-helper.js @@ -113,16 +113,6 @@ const pluginNameMap = { url: "https://git.io/vAlRe", }, }, - nullishCoalescingOperator: { - syntax: { - name: "@babel/plugin-syntax-nullish-coalescing-operator", - url: "https://git.io/vb4yx", - }, - transform: { - name: "@babel/plugin-proposal-nullish-coalescing-operator", - url: "https://git.io/vb4Se", - }, - }, numericSeparator: { syntax: { name: "@babel/plugin-syntax-numeric-separator", @@ -188,6 +178,16 @@ const pluginNameMap = { url: "https://git.io/vb4yp", }, }, + nullishCoalescingOperator: { + syntax: { + name: "@babel/plugin-syntax-nullish-coalescing-operator", + url: "https://git.io/vb4yx", + }, + transform: { + name: "@babel/plugin-proposal-nullish-coalescing-operator", + url: "https://git.io/vb4Se", + }, + }, objectRestSpread: { syntax: { name: "@babel/plugin-syntax-object-rest-spread", diff --git a/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json b/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-generator/test/fixtures/types/LogicalExpression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index b0669d9f46ec..69bfbbec0aab 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -196,7 +196,6 @@ export default class ExpressionParser extends LValParser { node.operator = operator; if (operator === "??=") { - this.expectPlugin("nullishCoalescingOperator"); this.expectPlugin("logicalAssignment"); } if (operator === "||=" || operator === "&&=") { @@ -333,8 +332,6 @@ export default class ExpressionParser extends LValParser { this.expectPlugin("pipelineOperator"); this.state.inPipeline = true; this.checkPipelineAtInfixOperator(left, leftStartPos); - } else if (op === tt.nullishCoalescing) { - this.expectPlugin("nullishCoalescingOperator"); } this.next(); diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json similarity index 66% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json index 7fe297276880..8adc3b6ed3e7 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-and-nullish/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-and-nullish/options.json @@ -1,4 +1,4 @@ { - "plugins": ["nullishCoalescingOperator", "estree"], + "plugins": ["estree"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json similarity index 70% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json index f66091fd9574..b4d06207ab24 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-and/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-and/options.json @@ -1,4 +1,3 @@ { - "plugins": ["nullishCoalescingOperator"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:5)" } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json similarity index 71% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json index d386ce1edb21..7905b902574e 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-nullish-or/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-nullish-or/options.json @@ -1,4 +1,3 @@ { - "plugins": ["nullishCoalescingOperator"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:10)" } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json similarity index 66% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json index 7fe297276880..8adc3b6ed3e7 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-paren-or-nullish/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/no-paren-or-nullish/options.json @@ -1,4 +1,4 @@ { - "plugins": ["nullishCoalescingOperator", "estree"], + "plugins": ["estree"], "throws": "Nullish coalescing operator(??) requires parens when mixing with logical operators (1:0)" } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/input.js b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/input.js rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/options.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/options.json similarity index 69% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/options.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/options.json index 790c3f234b5c..f96a57c74821 100644 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/options.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/options.json @@ -1,6 +1,5 @@ { "plugins": [ - "nullishCoalescingOperator", ["pipelineOperator", { "proposal": "minimal" }] ] } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/with-pipeline/output.json rename to packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/input.js b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/input.js deleted file mode 100644 index dcf876b17411..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/input.js +++ /dev/null @@ -1,2 +0,0 @@ -a ??= b; -obj.a ??= b; diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/options.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/options.json deleted file mode 100644 index 3cb238ee4af0..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-null-coalesce-plugin/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": ["logicalAssignment"], - "throws": "This experimental syntax requires enabling the parser plugin: 'nullishCoalescingOperator' (1:2)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-plugin/options.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-plugin/options.json index f5e977775daf..64389a45889e 100644 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-plugin/options.json +++ b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals-no-plugin/options.json @@ -1,4 +1,3 @@ { - "plugins": ["nullishCoalescingOperator"], "throws": "This experimental syntax requires enabling the parser plugin: 'logicalAssignment' (1:2)" } diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/options.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/options.json index 6b07062568e2..5041dbb19f81 100644 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/options.json +++ b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/options.json @@ -1,3 +1,3 @@ { - "plugins": ["logicalAssignment", "nullishCoalescingOperator"] + "plugins": ["logicalAssignment"] } diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/and-nullish/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/associativity/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/multiline/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/input.js b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/input.js deleted file mode 100644 index ea99cb192c79..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/input.js +++ /dev/null @@ -1 +0,0 @@ -foo ?? 1; diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/options.json deleted file mode 100644 index 9ae9a3d8a5d1..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/no-plugin-error/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'nullishCoalescingOperator' (1:4)" -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-and/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/nullish-or/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/options.json b/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/options.json deleted file mode 100644 index 1bb4736991a4..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/nullish-coalescing-operator/or-nullish/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["nullishCoalescingOperator"] -} From 3af02f63dec773e340bdaea31d98489eef8aae73 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Fri, 10 Jan 2020 03:02:52 +0100 Subject: [PATCH 924/965] Add --out-file-extension option to babel-cli (#9144) * Add --use-file-extension option to babel-cli * refactor file extension logic use existing methods from path module * Rename use-file-extension -> out-file-extension * add error message if bot keep- and out-file-extension is used * add test for error when mixing --keep- and --out-file-extension * poke travis --- packages/babel-cli/src/babel/dir.js | 8 ++++++-- packages/babel-cli/src/babel/options.js | 11 +++++++++++ packages/babel-cli/src/babel/util.js | 11 +++-------- .../in-files/src/bar.mjs | 1 + .../in-files/src/foo.jsx | 1 + .../dir --out-dir --out-file-extension/options.json | 12 ++++++++++++ .../out-files/lib/bar.mjs | 5 +++++ .../out-files/lib/foo.mjs | 5 +++++ .../dir --out-dir --out-file-extension/stdout.txt | 3 +++ .../options.json | 4 ++++ .../stderr.txt | 1 + 11 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/bar.mjs create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/foo.jsx create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/bar.mjs create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/foo.mjs create mode 100644 packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/stderr.txt diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index 234eb7c8f60b..4e8a48daa6fa 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -27,8 +27,12 @@ export default async function({ return false; } - // remove extension and then append back on .js - relative = util.adjustRelative(relative, cliOptions.keepFileExtension); + relative = util.withExtension( + relative, + cliOptions.keepFileExtension + ? path.extname(relative) + : cliOptions.outFileExtension, + ); const dest = getDest(relative, base); diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index 96b4aa9c2401..e32144c678ca 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -160,6 +160,10 @@ commander.option( "--delete-dir-on-start", "Delete the out directory before compilation.", ); +commander.option( + "--out-file-extension [string]", + "Use a specific extension for the output files", +); commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); @@ -237,6 +241,12 @@ export default function parseArgv(args: Array): CmdOptions | null { ); } + if (commander.keepFileExtension && commander.outFileExtension) { + errors.push( + "--out-file-extension cannot be used with --keep-file-extension", + ); + } + if (errors.length) { console.error("babel:"); errors.forEach(function(e) { @@ -293,6 +303,7 @@ export default function parseArgv(args: Array): CmdOptions | null { filenames, extensions: opts.extensions, keepFileExtension: opts.keepFileExtension, + outFileExtension: opts.outFileExtension, watch: opts.watch, skipInitialBuild: opts.skipInitialBuild, outFile: opts.outFile, diff --git a/packages/babel-cli/src/babel/util.js b/packages/babel-cli/src/babel/util.js index 9355c0ff85a4..3cdfe4927982 100644 --- a/packages/babel-cli/src/babel/util.js +++ b/packages/babel-cli/src/babel/util.js @@ -127,12 +127,7 @@ export function requireChokidar(): Object { } } -export function adjustRelative( - relative: string, - keepFileExtension: boolean, -): string { - if (keepFileExtension) { - return relative; - } - return relative.replace(/\.(\w*?)$/, "") + ".js"; +export function withExtension(filename: string, ext: string = ".js") { + const newBasename = path.basename(filename, path.extname(filename)) + ext; + return path.join(path.dirname(filename), newBasename); } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/bar.mjs b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/bar.mjs new file mode 100644 index 000000000000..7c1178b8d64f --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/bar.mjs @@ -0,0 +1 @@ +arr.map(x => x / DIVIDER); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/foo.jsx b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/foo.jsx new file mode 100644 index 000000000000..4bc9539528d4 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/in-files/src/foo.jsx @@ -0,0 +1 @@ +arr.map(x => x * MULTIPLIER); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/options.json new file mode 100644 index 000000000000..5150f4941a1f --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/options.json @@ -0,0 +1,12 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--out-file-extension", + ".mjs", + "--extensions", + ".jsx,.mjs", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/bar.mjs b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/bar.mjs new file mode 100644 index 000000000000..5d02843681e4 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/bar.mjs @@ -0,0 +1,5 @@ +"use strict"; + +arr.map(function (x) { + return x / DIVIDER; +}); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/foo.mjs b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/foo.mjs new file mode 100644 index 000000000000..ae4557e57bc3 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/out-files/lib/foo.mjs @@ -0,0 +1,5 @@ +"use strict"; + +arr.map(function (x) { + return x * MULTIPLIER; +}); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/stdout.txt new file mode 100644 index 000000000000..24ba955afb2b --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --out-file-extension/stdout.txt @@ -0,0 +1,3 @@ +src/bar.mjs -> lib/bar.mjs +src/foo.jsx -> lib/foo.mjs +Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/options.json b/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/options.json new file mode 100644 index 000000000000..8ad9743c9dbc --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/options.json @@ -0,0 +1,4 @@ +{ + "args": ["--keep-file-extension", "--out-file-extension", ".mjs"], + "stderrContains": true +} diff --git a/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/stderr.txt b/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/stderr.txt new file mode 100644 index 000000000000..acc6f8edb8bb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/error --keep-file-extension --out-file-extension/stderr.txt @@ -0,0 +1 @@ +--out-file-extension cannot be used with --keep-file-extension From 8415065d9904f3e9619793b2ebbd3bb4bd75b937 Mon Sep 17 00:00:00 2001 From: Raja Sekar Date: Fri, 10 Jan 2020 03:03:37 +0100 Subject: [PATCH 925/965] --copy-ignored flag added to CLI (#10887) * prevent ignored files in out dir * added includeIgnore cli option * Help text change * Update packages/babel-cli/src/babel/options.js Copy review. Co-Authored-By: Brian Ng * review comments * throw error if copyIgnored is used without ignore flag * check for ignored files * duplicate pathToPattern fn in babel/cli * change implementation * removed ignore option from cliOption * added test case with ignore in config * added test case with ignore in config * review Co-authored-by: Brian Ng --- packages/babel-cli/src/babel/dir.js | 27 ++++++++++++++----- packages/babel-cli/src/babel/options.js | 6 +++++ .../.babelrc | 3 +++ .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src}/foo/.foo.js | 0 .../in-files/src}/foo/index.js | 0 .../in-files/src}/index.js | 0 .../options.json | 10 +++++++ .../out-files/lib/.foorc | 0 .../out-files/lib/README.md | 0 .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../.babelignore | 1 + .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src}/foo/bar.js | 0 .../in-files/src}/index.js | 0 .../options.json | 10 +++++++ .../out-files/lib/README.md | 0 .../out-files/lib/foo/bar.js | 1 + .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../.babelrc | 3 +++ .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src/foo/bar.js | 1 + .../in-files/src/index.js | 1 + .../options.json | 10 +++++++ .../out-files/lib/README.md | 0 .../out-files/lib/foo/bar.js | 1 + .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../.babelignore | 1 + .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src/foo/bar.js | 1 + .../in-files/src/index.js | 1 + .../options.json | 9 +++++++ .../out-files/lib/README.md | 0 .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../.babelrc | 3 +++ .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src/foo/bar.js | 1 + .../in-files/src/index.js | 1 + .../options.json | 9 +++++++ .../out-files/lib/README.md | 0 .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src/foo/bar.js | 1 + .../in-files/src/index.js | 1 + .../options.json | 12 +++++++++ .../out-files/lib/README.md | 0 .../out-files/lib/foo/bar.js | 1 + .../out-files/lib/index.js | 3 +++ .../stdout.txt | 2 ++ .../in-files/src/.foorc | 0 .../in-files/src/README.md | 0 .../in-files/src/foo/bar.js | 1 + .../in-files/src/index.js | 1 + .../options.json | 12 +++++++++ .../out-files/lib/README.md | 0 .../out-files/lib/foo/bar.js | 3 +++ .../out-files/lib/index.js | 1 + .../stdout.txt | 2 ++ packages/babel-cli/test/index.js | 7 +++++ 70 files changed, 165 insertions(+), 7 deletions(-) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/.babelrc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/README.md rename packages/babel-cli/test/fixtures/babel/{--copy-files --include-dotfiles with ignore/out-files/lib => --copy-files --include-dotfiles with ignore in babelrc/in-files/src}/foo/.foo.js (100%) rename packages/babel-cli/test/fixtures/babel/{--copy-files --include-dotfiles with ignore/out-files/lib => --copy-files --include-dotfiles with ignore in babelrc/in-files/src}/foo/index.js (100%) rename packages/babel-cli/test/fixtures/babel/{--copy-files --include-dotfiles with only/out-files/lib => --copy-files --include-dotfiles with ignore in babelrc/in-files/src}/index.js (100%) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/.babelignore create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/README.md rename packages/babel-cli/test/fixtures/babel/{--copy-files with ignore/out-files/lib => --copy-files with ignore and copyIgnored in babelignore/in-files/src}/foo/bar.js (100%) rename packages/babel-cli/test/fixtures/babel/{--copy-files with only/out-files/lib => --copy-files with ignore and copyIgnored in babelignore/in-files/src}/index.js (100%) create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/.babelrc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/.babelignore create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/.babelrc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/stdout.txt create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/.foorc create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/options.json create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/README.md create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/foo/bar.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/index.js create mode 100644 packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/stdout.txt diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index 4e8a48daa6fa..9b199b98a4e2 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -9,6 +9,13 @@ import fs from "fs"; import * as util from "./util"; import { type CmdOptions } from "./options"; +const FILE_TYPE = Object.freeze({ + NON_COMPILABLE: "NON_COMPILABLE", + COMPILED: "COMPILED", + IGNORED: "IGNORED", + ERR_COMPILATION: "ERR_COMPILATION", +}); + function outputFileSync(filePath: string, data: string | Buffer): void { makeDirSync(path.dirname(filePath)); fs.writeFileSync(filePath, data); @@ -20,11 +27,14 @@ export default async function({ }: CmdOptions): Promise { const filenames = cliOptions.filenames; - async function write(src: string, base: string): Promise { + async function write( + src: string, + base: string, + ): Promise<$Keys> { let relative = path.relative(base, src); if (!util.isCompilableExtension(relative, cliOptions.extensions)) { - return false; + return FILE_TYPE.NON_COMPILABLE; } relative = util.withExtension( @@ -47,7 +57,7 @@ export default async function({ ), ); - if (!res) return false; + if (!res) return FILE_TYPE.IGNORED; // we've requested explicit sourcemaps to be written to disk if ( @@ -68,11 +78,11 @@ export default async function({ console.log(src + " -> " + dest); } - return true; + return FILE_TYPE.COMPILED; } catch (err) { if (cliOptions.watch) { console.error(err); - return false; + return FILE_TYPE.ERR_COMPILATION; } throw err; @@ -89,13 +99,16 @@ export default async function({ async function handleFile(src: string, base: string): Promise { const written = await write(src, base); - if (!written && cliOptions.copyFiles) { + if ( + (cliOptions.copyFiles && written === FILE_TYPE.NON_COMPILABLE) || + (cliOptions.copyIgnored && written === FILE_TYPE.IGNORED) + ) { const filename = path.relative(base, src); const dest = getDest(filename, base); outputFileSync(dest, fs.readFileSync(src)); util.chmod(src, dest); } - return written; + return written === FILE_TYPE.COMPILED; } async function handle(filenameOrDir: string): Promise { diff --git a/packages/babel-cli/src/babel/options.js b/packages/babel-cli/src/babel/options.js index e32144c678ca..6e4dfeaed2d4 100644 --- a/packages/babel-cli/src/babel/options.js +++ b/packages/babel-cli/src/babel/options.js @@ -165,6 +165,11 @@ commander.option( "Use a specific extension for the output files", ); +commander.option( + "--copy-ignored", + "Include ignored files when copying non-compilable files.", +); + commander.version(pkg.version + " (@babel/core " + version + ")"); commander.usage("[options] "); // register an empty action handler so that commander.js can throw on @@ -315,6 +320,7 @@ export default function parseArgv(args: Array): CmdOptions | null { quiet: opts.quiet, deleteDirOnStart: opts.deleteDirOnStart, sourceMapTarget: opts.sourceMapTarget, + copyIgnored: opts.copyIgnored, }, }; } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/.babelrc b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/.babelrc new file mode 100644 index 000000000000..b1fb07ff865b --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/.babelrc @@ -0,0 +1,3 @@ +{ + "ignore": ["src/foo"] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/foo/.foo.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/.foo.js rename to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/foo/.foo.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/foo/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/out-files/lib/foo/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/foo/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/out-files/lib/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/in-files/src/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/options.json new file mode 100644 index 000000000000..bb94e945f80e --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/options.json @@ -0,0 +1,10 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--include-dotfiles", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/index.js new file mode 100644 index 000000000000..1073b618d0dd --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/.babelignore b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/.babelignore new file mode 100644 index 000000000000..8b4ba6ce4d35 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/.babelignore @@ -0,0 +1 @@ +src/foo diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/foo/bar.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with ignore/out-files/lib/foo/bar.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/foo/bar.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/index.js similarity index 100% rename from packages/babel-cli/test/fixtures/babel/--copy-files with only/out-files/lib/index.js rename to packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/in-files/src/index.js diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/options.json new file mode 100644 index 000000000000..d16d70e6ffec --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/options.json @@ -0,0 +1,10 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--copy-ignored", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/index.js new file mode 100644 index 000000000000..1073b618d0dd --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/.babelrc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/.babelrc new file mode 100644 index 000000000000..b1fb07ff865b --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/.babelrc @@ -0,0 +1,3 @@ +{ + "ignore": ["src/foo"] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/options.json new file mode 100644 index 000000000000..d16d70e6ffec --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/options.json @@ -0,0 +1,10 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--copy-ignored", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/index.js new file mode 100644 index 000000000000..1073b618d0dd --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/.babelignore b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/.babelignore new file mode 100644 index 000000000000..8b4ba6ce4d35 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/.babelignore @@ -0,0 +1 @@ +src/foo diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/options.json new file mode 100644 index 000000000000..39e3d0dc2606 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/options.json @@ -0,0 +1,9 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/index.js new file mode 100644 index 000000000000..1073b618d0dd --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/.babelrc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/.babelrc new file mode 100644 index 000000000000..b1fb07ff865b --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/.babelrc @@ -0,0 +1,3 @@ +{ + "ignore": ["src/foo"] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/options.json new file mode 100644 index 000000000000..39e3d0dc2606 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/options.json @@ -0,0 +1,9 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/index.js new file mode 100644 index 000000000000..1073b618d0dd --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/options.json new file mode 100644 index 000000000000..f49a79c08fe5 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/options.json @@ -0,0 +1,12 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--ignore", + "src/foo", + "--copy-ignored", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/index.js new file mode 100644 index 000000000000..cb5e86b12ef3 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/index.js @@ -0,0 +1,3 @@ +"use strict"; + +index; \ No newline at end of file diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/stdout.txt new file mode 100644 index 000000000000..84a430432e47 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/stdout.txt @@ -0,0 +1,2 @@ +src/index.js -> lib/index.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/.foorc b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/.foorc new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/foo/bar.js new file mode 100644 index 000000000000..e46160df1c7a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/foo/bar.js @@ -0,0 +1 @@ +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/options.json new file mode 100644 index 000000000000..f3adb3c91b91 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/options.json @@ -0,0 +1,12 @@ +{ + "args": [ + "src", + "--out-dir", + "lib", + "--copy-files", + "--only", + "src/foo/*", + "--copy-ignored", + "--verbose" + ] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/README.md b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/foo/bar.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/foo/bar.js new file mode 100644 index 000000000000..0ed075a19327 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/foo/bar.js @@ -0,0 +1,3 @@ +"use strict"; + +bar; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/index.js b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/index.js new file mode 100644 index 000000000000..c6788558edcb --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/index.js @@ -0,0 +1 @@ +index; diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/stdout.txt new file mode 100644 index 000000000000..673dafc7483e --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/stdout.txt @@ -0,0 +1,2 @@ +src/foo/bar.js -> lib/foo/bar.js +Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 88d596740133..e7ee2cbb6f40 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -97,6 +97,7 @@ const assertTest = function(stdout, stderr, opts, cwd) { if ( // saveInFiles always creates an empty .babelrc, so lets exclude for now filename !== ".babelrc" && + filename !== ".babelignore" && !Object.prototype.hasOwnProperty.call(opts.inFiles, filename) ) { const expected = opts.outFiles[filename]; @@ -239,9 +240,15 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { opts.inFiles = readDir(path.join(testLoc, "in-files"), fileFilter); const babelrcLoc = path.join(testLoc, ".babelrc"); + const babelIgnoreLoc = path.join(testLoc, ".babelignore"); if (fs.existsSync(babelrcLoc)) { // copy .babelrc file to tmp directory opts.inFiles[".babelrc"] = helper.readFile(babelrcLoc); + opts.inFiles[".babelignore"] = helper.readFile(babelIgnoreLoc); + } + if (fs.existsSync(babelIgnoreLoc)) { + // copy .babelignore file to tmp directory + opts.inFiles[".babelignore"] = helper.readFile(babelIgnoreLoc); } it(testName, buildTest(binName, testName, opts), 20000); From 646409b23e9300590fa38c5b0e54b122f412e115 Mon Sep 17 00:00:00 2001 From: ZYSzys Date: Fri, 10 Jan 2020 10:04:02 +0800 Subject: [PATCH 926/965] Use `babel >` as prompt in babel-node (#9695) --- packages/babel-node/src/_babel-node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-node/src/_babel-node.js b/packages/babel-node/src/_babel-node.js index 8e09639a5dd7..3189e7adec92 100644 --- a/packages/babel-node/src/_babel-node.js +++ b/packages/babel-node/src/_babel-node.js @@ -212,7 +212,7 @@ if (program.eval || program.print) { function replStart() { repl.start({ - prompt: "> ", + prompt: "babel > ", input: process.stdin, output: process.stdout, eval: replEval, From 5f807ae45b625a7c2f3f49a90e263562bc560c0f Mon Sep 17 00:00:00 2001 From: jack Date: Wed, 4 Dec 2019 19:10:42 -0800 Subject: [PATCH 927/965] Enable optional chaining by default in @babel/parser (#10817) --- packages/babel-parser/src/parser/expression.js | 1 - packages/babel-parser/src/plugins/flow.js | 1 - .../optional-chaining/class-contructor-call/input.js | 0 .../optional-chaining/class-contructor-call/output.json | 0 .../optional-chaining/conditional-decimal/input.js | 0 .../optional-chaining/conditional-decimal/output.json | 0 .../optional-chaining/function-call/input.js | 0 .../optional-chaining/function-call/output.json | 0 .../optional-chaining/member-access-bracket/input.js | 0 .../optional-chaining/member-access-bracket/output.json | 0 .../optional-chaining/member-access/input.js | 0 .../optional-chaining/member-access/output.json | 0 .../optional-chaining/optioanl-chain-expression/input.js | 0 .../optional-chaining/optioanl-chain-expression/output.json | 0 .../optional-chaining/optional-constructor/input.js | 0 .../optional-chaining/optional-constructor/output.json | 0 .../optional-chaining/optional-super-property-class/input.js | 0 .../optional-super-property-class/output.json | 0 .../optional-chaining/optional-super-property/input.js | 0 .../optional-chaining/optional-super-property/output.json | 0 .../optional-tagged-template-literals/input.js | 0 .../optional-tagged-template-literals/output.json | 0 .../optional-chaining/parenthised-chain/input.js | 0 .../optional-chaining/parenthised-chain/output.json | 0 .../optional-chaining/separated-chaining/input.js | 0 .../optional-chaining/separated-chaining/output.json | 0 .../optional-chaining/super-method-class/input.js | 0 .../optional-chaining/super-method-class/output.json | 0 .../experimental/_no-plugin/optional-chaining/input.js | 1 - .../experimental/_no-plugin/optional-chaining/options.json | 3 --- .../optional-chaining/class-contructor-call/options.json | 3 --- .../optional-chaining/conditional-decimal/options.json | 3 --- .../experimental/optional-chaining/function-call/options.json | 3 --- .../optional-chaining/member-access-bracket/options.json | 3 --- .../experimental/optional-chaining/member-access/options.json | 3 --- .../optional-chaining/optioanl-chain-expression/options.json | 3 --- .../optional-chaining/optional-constructor/options.json | 3 --- .../optional-super-property-class/options.json | 3 --- .../optional-chaining/optional-super-property/options.json | 3 --- .../optional-tagged-template-literals/options.json | 3 --- .../optional-chaining/parenthised-chain/options.json | 3 --- .../optional-chaining/separated-chaining/options.json | 3 --- .../optional-chaining/super-method-class/options.json | 3 --- .../flow/typeapp-call/function-call-optional/options.json | 2 +- .../flow/typeapp-call/method-call-optional/options.json | 2 +- .../flow/typeapp-call/method-call-optional2/options.json | 2 +- .../typescript/optional-chaining/type-arguments/options.json | 2 +- .../v8intrinsic/_errors/optional-call-expression/options.json | 2 +- 48 files changed, 5 insertions(+), 50 deletions(-) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/class-contructor-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/class-contructor-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/conditional-decimal/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/conditional-decimal/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/function-call/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/function-call/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/member-access-bracket/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/member-access-bracket/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/member-access/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/member-access/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optioanl-chain-expression/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optioanl-chain-expression/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-constructor/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-constructor/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-super-property-class/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-super-property-class/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-super-property/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-super-property/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-tagged-template-literals/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/optional-tagged-template-literals/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/parenthised-chain/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/parenthised-chain/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/separated-chaining/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/separated-chaining/output.json (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/super-method-class/input.js (100%) rename packages/babel-parser/test/fixtures/{experimental => es2020}/optional-chaining/super-method-class/output.json (100%) delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/input.js delete mode 100644 packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/options.json delete mode 100644 packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/options.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index 69bfbbec0aab..e3b6eae99a0b 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -587,7 +587,6 @@ export default class ExpressionParser extends LValParser { } let optional = false; if (this.match(tt.questionDot)) { - this.expectPlugin("optionalChaining"); state.optionalChainMember = optional = true; if (noCalls && this.lookaheadCharCode() === charCodes.leftParenthesis) { state.stop = true; diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 96a5feac5d37..72ed92b6c276 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2801,7 +2801,6 @@ export default (superClass: Class): Class => subscriptState: N.ParseSubscriptState, ): N.Expression { if (this.match(tt.questionDot) && this.isLookaheadRelational("<")) { - this.expectPlugin("optionalChaining"); subscriptState.optionalChainMember = true; if (noCalls) { subscriptState.stop = true; diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/function-call/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access-bracket/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/member-access/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optioanl-chain-expression/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/parenthised-chain/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/separated-chaining/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js b/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/input.js similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/input.js rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/input.js diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json similarity index 100% rename from packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/output.json rename to packages/babel-parser/test/fixtures/es2020/optional-chaining/super-method-class/output.json diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/input.js b/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/input.js deleted file mode 100644 index 280754611364..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/input.js +++ /dev/null @@ -1 +0,0 @@ -a?.b diff --git a/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/options.json b/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/options.json deleted file mode 100644 index b8e170c94adb..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/_no-plugin/optional-chaining/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "throws": "This experimental syntax requires enabling the parser plugin: 'optionalChaining' (1:1)" -} 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 deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/class-contructor-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/conditional-decimal/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/function-call/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access-bracket/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/member-access/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optioanl-chain-expression/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} 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 deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-constructor/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} 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 deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} 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 deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-super-property/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} 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 deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/optional-tagged-template-literals/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/parenthised-chain/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/separated-chaining/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/options.json b/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/options.json deleted file mode 100644 index fd201c1bdb02..000000000000 --- a/packages/babel-parser/test/fixtures/experimental/optional-chaining/super-method-class/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": ["optionalChaining"] -} diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/options.json index 05e42d81055f..698e7668500f 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/options.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/options.json @@ -1,3 +1,3 @@ { - "plugins": ["jsx", "flow", "optionalChaining"] + "plugins": ["jsx", "flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/options.json index 05e42d81055f..698e7668500f 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/options.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional/options.json @@ -1,3 +1,3 @@ { - "plugins": ["jsx", "flow", "optionalChaining"] + "plugins": ["jsx", "flow"] } diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/options.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/options.json index 05e42d81055f..698e7668500f 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/options.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/method-call-optional2/options.json @@ -1,3 +1,3 @@ { - "plugins": ["jsx", "flow", "optionalChaining"] + "plugins": ["jsx", "flow"] } 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 index ccc6341666b4..fe9bffaa5e1a 100644 --- 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 @@ -1,4 +1,4 @@ { "sourceType": "module", - "plugins": ["typescript", "optionalChaining"] + "plugins": ["typescript"] } diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json index cd2dad552c15..f388c1ba2b25 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/_errors/optional-call-expression/options.json @@ -1,4 +1,4 @@ { - "plugins": ["optionalChaining", "v8intrinsic"], + "plugins": ["v8intrinsic"], "throws": "Unexpected token (1:0)" } From 04354d155689405ba688d4b400702710f9cccc97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2020 03:15:20 +0100 Subject: [PATCH 928/965] Extract targets parser and compat data from preset-env (#10899) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Extract targets parser and compat data from preset-env * Review by Jùnliàng * isItemRequired -> targetsSupported * Export isRequired --- .gitignore | 2 + .prettierignore | 2 + Gulpfile.js | 7 +- babel.config.js | 12 +- packages/babel-compat-data/.npmignore | 4 + .../babel-compat-data/corejs2-built-ins.js | 4 + .../data/built-in-modules.json | 12 + .../data/corejs2-built-ins.json | 0 .../data/native-modules.json} | 0 .../data/overlapping-plugins.json | 3 + .../data/plugins.json | 0 packages/babel-compat-data/native-modules.js | 4 + .../babel-compat-data/overlapping-plugins.js | 4 + packages/babel-compat-data/package.json | 36 +++ packages/babel-compat-data/plugins.js | 4 + .../scripts/build-data.js | 4 +- .../scripts/build-modules-support.js | 0 .../scripts/build-overlapping-plugins.js | 15 + .../data/corejs2-built-in-features.js | 79 ++++-- .../scripts}/data/overlapping-plugins.js | 4 +- .../scripts}/data/plugin-features.js | 17 +- .../scripts/download-compat-table.sh | 0 .../.npmignore | 3 + .../package.json | 32 +++ .../src/debug.js | 40 +++ .../src/filter-items.js | 111 ++++++++ .../src/index.js | 256 +++++++++++++++++ .../src/options.js | 20 ++ .../src/pretty.js | 36 +++ .../src/targets.js | 20 ++ .../src/types.js | 19 ++ .../src/utils.js | 64 +++++ .../test/pretty.spec.js} | 25 +- .../test/targets-parser.spec.js | 2 +- .../test/targets-supported.js | 82 ++++++ .../test/utils.spec.js | 20 ++ .../babel-preset-env/data/built-in-modules.js | 3 + .../data/built-in-modules.json.js | 3 + packages/babel-preset-env/data/built-ins.js | 4 + .../data/corejs2-built-ins.js | 3 + .../data/corejs2-built-ins.json.js | 3 + packages/babel-preset-env/data/plugins.js | 3 + .../babel-preset-env/data/plugins.json.js | 3 + .../data/unreleased-labels.js | 6 +- packages/babel-preset-env/package.json | 9 +- packages/babel-preset-env/src/debug.js | 37 +-- packages/babel-preset-env/src/filter-items.js | 98 +------ packages/babel-preset-env/src/index.js | 24 +- .../babel-preset-env/src/normalize-options.js | 11 +- packages/babel-preset-env/src/options.js | 19 -- .../src/polyfills/corejs2/entry-plugin.js | 4 +- .../corejs2/get-platform-specific-default.js | 2 +- .../src/polyfills/corejs2/usage-plugin.js | 4 +- .../src/polyfills/corejs3/entry-plugin.js | 2 +- .../src/polyfills/corejs3/usage-plugin.js | 2 +- .../babel-preset-env/src/targets-parser.js | 266 +----------------- packages/babel-preset-env/src/types.js | 19 +- packages/babel-preset-env/src/utils.js | 93 +----- .../test/is-plugin-required.js | 82 ------ 59 files changed, 936 insertions(+), 707 deletions(-) create mode 100644 packages/babel-compat-data/.npmignore create mode 100644 packages/babel-compat-data/corejs2-built-ins.js create mode 100644 packages/babel-compat-data/data/built-in-modules.json rename packages/{babel-preset-env => babel-compat-data}/data/corejs2-built-ins.json (100%) rename packages/{babel-preset-env/data/built-in-modules.json => babel-compat-data/data/native-modules.json} (100%) create mode 100644 packages/babel-compat-data/data/overlapping-plugins.json rename packages/{babel-preset-env => babel-compat-data}/data/plugins.json (100%) create mode 100644 packages/babel-compat-data/native-modules.js create mode 100644 packages/babel-compat-data/overlapping-plugins.js create mode 100644 packages/babel-compat-data/package.json create mode 100644 packages/babel-compat-data/plugins.js rename packages/{babel-preset-env => babel-compat-data}/scripts/build-data.js (98%) rename packages/{babel-preset-env => babel-compat-data}/scripts/build-modules-support.js (100%) create mode 100644 packages/babel-compat-data/scripts/build-overlapping-plugins.js rename packages/{babel-preset-env => babel-compat-data/scripts}/data/corejs2-built-in-features.js (85%) rename packages/{babel-preset-env => babel-compat-data/scripts}/data/overlapping-plugins.js (71%) rename packages/{babel-preset-env => babel-compat-data/scripts}/data/plugin-features.js (86%) rename packages/{babel-preset-env => babel-compat-data}/scripts/download-compat-table.sh (100%) create mode 100644 packages/babel-helper-compilation-targets/.npmignore create mode 100644 packages/babel-helper-compilation-targets/package.json create mode 100644 packages/babel-helper-compilation-targets/src/debug.js create mode 100644 packages/babel-helper-compilation-targets/src/filter-items.js create mode 100644 packages/babel-helper-compilation-targets/src/index.js create mode 100644 packages/babel-helper-compilation-targets/src/options.js create mode 100644 packages/babel-helper-compilation-targets/src/pretty.js create mode 100644 packages/babel-helper-compilation-targets/src/targets.js create mode 100644 packages/babel-helper-compilation-targets/src/types.js create mode 100644 packages/babel-helper-compilation-targets/src/utils.js rename packages/{babel-preset-env/test/utils.spec.js => babel-helper-compilation-targets/test/pretty.spec.js} (56%) rename packages/{babel-preset-env => babel-helper-compilation-targets}/test/targets-parser.spec.js (99%) create mode 100644 packages/babel-helper-compilation-targets/test/targets-supported.js create mode 100644 packages/babel-helper-compilation-targets/test/utils.spec.js create mode 100644 packages/babel-preset-env/data/built-in-modules.js create mode 100644 packages/babel-preset-env/data/built-in-modules.json.js create mode 100644 packages/babel-preset-env/data/built-ins.js create mode 100644 packages/babel-preset-env/data/corejs2-built-ins.js create mode 100644 packages/babel-preset-env/data/corejs2-built-ins.json.js create mode 100644 packages/babel-preset-env/data/plugins.js create mode 100644 packages/babel-preset-env/data/plugins.json.js delete mode 100644 packages/babel-preset-env/test/is-plugin-required.js diff --git a/.gitignore b/.gitignore index 0c202a1dbd18..e66e4456b432 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ dist package-lock.json !/.github/actions/*/package-lock.json +/packages/babel-compat-data/build + /packages/babel-runtime/helpers/*.js !/packages/babel-runtime/helpers/toArray.js !/packages/babel-runtime/helpers/iterableToArray.js diff --git a/.prettierignore b/.prettierignore index e86c7aa505d3..19e8316f03eb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,7 @@ package.json packages/babel-preset-env/data +packages/babel-compat-data/data +packages/babel-compat-data/scripts/data/overlapping-plugins.js packages/*/test/fixtures/**/input.* packages/*/test/fixtures/**/exec.* packages/*/test/fixtures/**/output.* diff --git a/Gulpfile.js b/Gulpfile.js index a91d4e54b84d..9af1c2a79478 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -181,7 +181,12 @@ function buildRollup(packages) { }, }), rollupCommonJs({ - include: [/node_modules/, "packages/babel-preset-env/data/**"], + include: [ + /node_modules/, + "packages/babel-preset-env/data/*.js", + // Rollup doesn't read export maps, so it loads the cjs fallback + "packages/babel-compat-data/*.js", + ], namedExports: { "babel-plugin-dynamic-import-node/utils.js": [ "createDynamicImportTransform", diff --git a/babel.config.js b/babel.config.js index 367b87d714da..5102c9141d9d 100644 --- a/babel.config.js +++ b/babel.config.js @@ -30,24 +30,16 @@ module.exports = function(api) { switch (env) { // Configs used during bundling builds. case "rollup": - convertESM = false; - ignoreLib = false; - // rollup-commonjs will converts node_modules to ESM - unambiguousSources.push( - "**/node_modules", - // todo: remove this after it is rewritten into ESM - "packages/babel-preset-env/data" - ); envOpts.targets = { node: nodeVersion, }; - break; case "standalone": convertESM = false; ignoreLib = false; unambiguousSources.push( "**/node_modules", - "packages/babel-preset-env/data" + "packages/babel-preset-env/data", + "packages/babel-compat-data" ); // targets to browserslists: defaults break; diff --git a/packages/babel-compat-data/.npmignore b/packages/babel-compat-data/.npmignore new file mode 100644 index 000000000000..57e1671459aa --- /dev/null +++ b/packages/babel-compat-data/.npmignore @@ -0,0 +1,4 @@ +scripts +src +test +*.log diff --git a/packages/babel-compat-data/corejs2-built-ins.js b/packages/babel-compat-data/corejs2-built-ins.js new file mode 100644 index 000000000000..ccbe72f0d58b --- /dev/null +++ b/packages/babel-compat-data/corejs2-built-ins.js @@ -0,0 +1,4 @@ +// Node < 13.3 doesn't support export maps in package.json. +// Use this proxy file as a fallback. + +module.exports = require("./data/corejs2-built-ins.json"); diff --git a/packages/babel-compat-data/data/built-in-modules.json b/packages/babel-compat-data/data/built-in-modules.json new file mode 100644 index 000000000000..7e33f27eb290 --- /dev/null +++ b/packages/babel-compat-data/data/built-in-modules.json @@ -0,0 +1,12 @@ +{ + "es6.module": { + "edge": "16", + "firefox": "60", + "chrome": "61", + "safari": "10.1", + "opera": "48", + "ios_saf": "10.3", + "and_chr": "74", + "and_ff": "66" + } +} diff --git a/packages/babel-preset-env/data/corejs2-built-ins.json b/packages/babel-compat-data/data/corejs2-built-ins.json similarity index 100% rename from packages/babel-preset-env/data/corejs2-built-ins.json rename to packages/babel-compat-data/data/corejs2-built-ins.json diff --git a/packages/babel-preset-env/data/built-in-modules.json b/packages/babel-compat-data/data/native-modules.json similarity index 100% rename from packages/babel-preset-env/data/built-in-modules.json rename to packages/babel-compat-data/data/native-modules.json diff --git a/packages/babel-compat-data/data/overlapping-plugins.json b/packages/babel-compat-data/data/overlapping-plugins.json new file mode 100644 index 000000000000..2cd7597e6081 --- /dev/null +++ b/packages/babel-compat-data/data/overlapping-plugins.json @@ -0,0 +1,3 @@ +{ + "transform-regenerator": [] +} \ No newline at end of file diff --git a/packages/babel-preset-env/data/plugins.json b/packages/babel-compat-data/data/plugins.json similarity index 100% rename from packages/babel-preset-env/data/plugins.json rename to packages/babel-compat-data/data/plugins.json diff --git a/packages/babel-compat-data/native-modules.js b/packages/babel-compat-data/native-modules.js new file mode 100644 index 000000000000..efa3031c0a53 --- /dev/null +++ b/packages/babel-compat-data/native-modules.js @@ -0,0 +1,4 @@ +// Node < 13.3 doesn't support export maps in package.json. +// Use this proxy file as a fallback. + +module.exports = require("./data/native-modules.json"); diff --git a/packages/babel-compat-data/overlapping-plugins.js b/packages/babel-compat-data/overlapping-plugins.js new file mode 100644 index 000000000000..9f7d8efde56f --- /dev/null +++ b/packages/babel-compat-data/overlapping-plugins.js @@ -0,0 +1,4 @@ +// Node < 13.3 doesn't support export maps in package.json. +// Use this proxy file as a fallback. + +module.exports = require("./data/overlapping-plugins.json"); diff --git a/packages/babel-compat-data/package.json b/packages/babel-compat-data/package.json new file mode 100644 index 000000000000..112e1058cfdf --- /dev/null +++ b/packages/babel-compat-data/package.json @@ -0,0 +1,36 @@ +{ + "name": "@babel/compat-data", + "version": "0.0.0", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", + "description": "", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-compat-data", + "publishConfig": { + "access": "public" + }, + "exports": { + "./plugins": "./data/plugins.json", + "./native-modules": "./data/native-modules.json", + "./corejs2-built-ins": "./data/corejs2-built-ins.json", + "./overlapping-plugins": "./data/overlapping-plugins.json" + }, + "scripts": { + "build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js; node ./scripts/build-overlapping-plugins.js" + }, + "keywords": [ + "babel", + "compat-table", + "compat-data" + ], + "dependencies": { + "browserslist": "^4.8.2", + "invariant": "^2.2.4", + "semver": "^7.1.1" + }, + "devDependencies": { + "caniuse-db": "1.0.30000969", + "electron-to-chromium": "1.3.113", + "lodash": "^4.17.15", + "@babel/helper-compilation-targets": "^0.0.0" + } +} diff --git a/packages/babel-compat-data/plugins.js b/packages/babel-compat-data/plugins.js new file mode 100644 index 000000000000..74a9d60f2310 --- /dev/null +++ b/packages/babel-compat-data/plugins.js @@ -0,0 +1,4 @@ +// Node < 13.3 doesn't support export maps in package.json. +// Use this proxy file as a fallback. + +module.exports = require("./data/plugins.json"); diff --git a/packages/babel-preset-env/scripts/build-data.js b/packages/babel-compat-data/scripts/build-data.js similarity index 98% rename from packages/babel-preset-env/scripts/build-data.js rename to packages/babel-compat-data/scripts/build-data.js index e8bb4b1db54f..b4ac76c25c4e 100644 --- a/packages/babel-preset-env/scripts/build-data.js +++ b/packages/babel-compat-data/scripts/build-data.js @@ -7,7 +7,7 @@ const flattenDeep = require("lodash/flattenDeep"); const isEqual = require("lodash/isEqual"); const mapValues = require("lodash/mapValues"); const pickBy = require("lodash/pickBy"); -const unreleasedLabels = require("../data/unreleased-labels"); +const { unreleasedLabels } = require("babel/helper-compilation-targets"); const electronToChromiumVersions = require("electron-to-chromium").versions; const electronToChromiumKeys = Object.keys( @@ -293,7 +293,7 @@ const generateData = (environments, features) => { ["plugin", "corejs2-built-in"].forEach(target => { const newData = generateData( environments, - require(`../data/${target}-features`) + require(`./data/${target}-features`) ); const dataPath = path.join(__dirname, `../data/${target}s.json`); diff --git a/packages/babel-preset-env/scripts/build-modules-support.js b/packages/babel-compat-data/scripts/build-modules-support.js similarity index 100% rename from packages/babel-preset-env/scripts/build-modules-support.js rename to packages/babel-compat-data/scripts/build-modules-support.js diff --git a/packages/babel-compat-data/scripts/build-overlapping-plugins.js b/packages/babel-compat-data/scripts/build-overlapping-plugins.js new file mode 100644 index 000000000000..24e34cfeb92e --- /dev/null +++ b/packages/babel-compat-data/scripts/build-overlapping-plugins.js @@ -0,0 +1,15 @@ +"use strict"; + +const fs = require("fs"); +const overlappingPlugins = require("./data/overlapping-plugins"); + +fs.writeFileSync( + __dirname + "/../data/overlapping-plugins.json", + JSON.stringify(overlappingPlugins, replacer, 2) +); + +function replacer(key, val) { + if (val instanceof Set) return Array.from(val); + if (val instanceof Map) return Object.fromEntries(val); + return val; +} diff --git a/packages/babel-preset-env/data/corejs2-built-in-features.js b/packages/babel-compat-data/scripts/data/corejs2-built-in-features.js similarity index 85% rename from packages/babel-preset-env/data/corejs2-built-in-features.js rename to packages/babel-compat-data/scripts/data/corejs2-built-in-features.js index df73164fb6a7..2beb9bbed4c8 100644 --- a/packages/babel-preset-env/data/corejs2-built-in-features.js +++ b/packages/babel-compat-data/scripts/data/corejs2-built-in-features.js @@ -26,7 +26,7 @@ const typedArrayMethods = [ "typed arrays / %TypedArray%[Symbol.species]", ]; -const es = { +module.exports = { // compat-table missing babel6 mapping // "es6.array.concat": { // features: [ @@ -34,7 +34,8 @@ const es = { // "well-known symbols / Symbol.species, Array.prototype.concat", // ] // }, - "es6.array.copy-within": "Array.prototype methods / Array.prototype.copyWithin", + "es6.array.copy-within": + "Array.prototype methods / Array.prototype.copyWithin", "es6.array.every": "Array methods / Array.prototype.every", "es6.array.fill": "Array.prototype methods / Array.prototype.fill", "es6.array.filter": { @@ -46,7 +47,8 @@ const es = { }, "es6.array.find": "Array.prototype methods / Array.prototype.find", "es6.array.find-index": "Array.prototype methods / Array.prototype.findIndex", - "es7.array.flat-map": "Array.prototype.{flat, flatMap} / Array.prototype.flatMap", + "es7.array.flat-map": + "Array.prototype.{flat, flatMap} / Array.prototype.flatMap", "es6.array.for-each": "Array methods / Array.prototype.forEach", "es6.array.from": "Array static methods / Array.from", "es7.array.includes": "Array.prototype.includes", @@ -90,8 +92,8 @@ const es = { "es6.function.has-instance": "well-known symbols / Symbol.hasInstance", "es6.function.name": { features: [ - "function \"name\" property / function statements", - "function \"name\" property / function expressions", + 'function "name" property / function statements', + 'function "name" property / function expressions', ], }, @@ -174,13 +176,19 @@ const es = { ], }, "es6.object.define-property": "Object static methods / Object.defineProperty", - "es6.object.define-properties": "Object static methods / Object.defineProperties", + "es6.object.define-properties": + "Object static methods / Object.defineProperties", "es7.object.entries": "Object static methods / Object.entries", - "es6.object.freeze": "Object static methods accept primitives / Object.freeze", - "es6.object.get-own-property-descriptor": "Object static methods accept primitives / Object.getOwnPropertyDescriptor", - "es7.object.get-own-property-descriptors": "Object static methods / Object.getOwnPropertyDescriptors", - "es6.object.get-own-property-names": "Object static methods accept primitives / Object.getOwnPropertyNames", - "es6.object.get-prototype-of": "Object static methods accept primitives / Object.getPrototypeOf", + "es6.object.freeze": + "Object static methods accept primitives / Object.freeze", + "es6.object.get-own-property-descriptor": + "Object static methods accept primitives / Object.getOwnPropertyDescriptor", + "es7.object.get-own-property-descriptors": + "Object static methods / Object.getOwnPropertyDescriptors", + "es6.object.get-own-property-names": + "Object static methods accept primitives / Object.getOwnPropertyNames", + "es6.object.get-prototype-of": + "Object static methods accept primitives / Object.getPrototypeOf", "es7.object.lookup-getter": { features: [ "Object.prototype getter/setter methods / __lookupGetter__", @@ -199,15 +207,20 @@ const es = { "Object.prototype getter/setter methods / __lookupSetter__, data properties can shadow accessors", ], }, - "es6.object.prevent-extensions": "Object static methods accept primitives / Object.preventExtensions", + "es6.object.prevent-extensions": + "Object static methods accept primitives / Object.preventExtensions", "es6.object.to-string": "well-known symbols / Symbol.toStringTag", "es6.object.is": "Object static methods / Object.is", - "es6.object.is-frozen": "Object static methods accept primitives / Object.isFrozen", - "es6.object.is-sealed": "Object static methods accept primitives / Object.isSealed", - "es6.object.is-extensible": "Object static methods accept primitives / Object.isExtensible", + "es6.object.is-frozen": + "Object static methods accept primitives / Object.isFrozen", + "es6.object.is-sealed": + "Object static methods accept primitives / Object.isSealed", + "es6.object.is-extensible": + "Object static methods accept primitives / Object.isExtensible", "es6.object.keys": "Object static methods accept primitives / Object.keys", "es6.object.seal": "Object static methods accept primitives / Object.seal", - "es6.object.set-prototype-of": "Object static methods / Object.setPrototypeOf", + "es6.object.set-prototype-of": + "Object static methods / Object.setPrototypeOf", "es7.object.values": "Object static methods / Object.values", "es6.promise": { @@ -224,7 +237,8 @@ const es = { "es6.reflect.define-property": "Reflect / Reflect.defineProperty", "es6.reflect.delete-property": "Reflect / Reflect.deleteProperty", "es6.reflect.get": "Reflect / Reflect.get", - "es6.reflect.get-own-property-descriptor": "Reflect / Reflect.getOwnPropertyDescriptor", + "es6.reflect.get-own-property-descriptor": + "Reflect / Reflect.getOwnPropertyDescriptor", "es6.reflect.get-prototype-of": "Reflect / Reflect.getPrototypeOf", "es6.reflect.has": "Reflect / Reflect.has", "es6.reflect.is-extensible": "Reflect / Reflect.isExtensible", @@ -240,11 +254,16 @@ const es = { ], }, "es6.regexp.flags": "RegExp.prototype properties / RegExp.prototype.flags", - "es6.regexp.match": "RegExp.prototype properties / RegExp.prototype[Symbol.match]", - "es6.regexp.replace": "RegExp.prototype properties / RegExp.prototype[Symbol.replace]", - "es6.regexp.split": "RegExp.prototype properties / RegExp.prototype[Symbol.split]", - "es6.regexp.search": "RegExp.prototype properties / RegExp.prototype[Symbol.search]", - "es6.regexp.to-string": "miscellaneous / RegExp.prototype.toString generic and uses \"flags\" property", + "es6.regexp.match": + "RegExp.prototype properties / RegExp.prototype[Symbol.match]", + "es6.regexp.replace": + "RegExp.prototype properties / RegExp.prototype[Symbol.replace]", + "es6.regexp.split": + "RegExp.prototype properties / RegExp.prototype[Symbol.split]", + "es6.regexp.search": + "RegExp.prototype properties / RegExp.prototype[Symbol.search]", + "es6.regexp.to-string": + 'miscellaneous / RegExp.prototype.toString generic and uses "flags" property', // This is explicit due to prevent the stage-1 Set proposals under the // category "Set methods" from being included. @@ -295,15 +314,18 @@ const es = { "es6.string.big": "String.prototype HTML methods", "es6.string.blink": "String.prototype HTML methods", "es6.string.bold": "String.prototype HTML methods", - "es6.string.code-point-at": "String.prototype methods / String.prototype.codePointAt", - "es6.string.ends-with": "String.prototype methods / String.prototype.endsWith", + "es6.string.code-point-at": + "String.prototype methods / String.prototype.codePointAt", + "es6.string.ends-with": + "String.prototype methods / String.prototype.endsWith", "es6.string.fixed": "String.prototype HTML methods", "es6.string.fontcolor": "String.prototype HTML methods", "es6.string.fontsize": "String.prototype HTML methods", "es6.string.from-code-point": "String static methods / String.fromCodePoint", "es6.string.includes": "String.prototype methods / String.prototype.includes", "es6.string.italics": "String.prototype HTML methods", - "es6.string.iterator": "String.prototype methods / String.prototype[Symbol.iterator]", + "es6.string.iterator": + "String.prototype methods / String.prototype[Symbol.iterator]", "es6.string.link": "String.prototype HTML methods", // "String.prototype methods / String.prototype.normalize" not implemented "es7.string.pad-start": "String padding / String.prototype.padStart", @@ -311,7 +333,8 @@ const es = { "es6.string.raw": "String static methods / String.raw", "es6.string.repeat": "String.prototype methods / String.prototype.repeat", "es6.string.small": "String.prototype HTML methods", - "es6.string.starts-with": "String.prototype methods / String.prototype.startsWith", + "es6.string.starts-with": + "String.prototype methods / String.prototype.startsWith", "es6.string.strike": "String.prototype HTML methods", "es6.string.sub": "String.prototype HTML methods", "es6.string.sup": "String.prototype HTML methods", @@ -353,7 +376,3 @@ const es = { "es6.weak-set": "WeakSet", }; - -const proposals = require("./shipped-proposals").builtIns; - -module.exports = Object.assign({}, es, proposals); diff --git a/packages/babel-preset-env/data/overlapping-plugins.js b/packages/babel-compat-data/scripts/data/overlapping-plugins.js similarity index 71% rename from packages/babel-preset-env/data/overlapping-plugins.js rename to packages/babel-compat-data/scripts/data/overlapping-plugins.js index e4e9904f90b0..56cb8d896d6f 100644 --- a/packages/babel-preset-env/data/overlapping-plugins.js +++ b/packages/babel-compat-data/scripts/data/overlapping-plugins.js @@ -4,13 +4,13 @@ module.exports = new Map(); // async -> regenerator is better than async -> generator -> regenerator ifIncluded("transform-regenerator") - // https://github.com/babel/babel/issues/10678 + // Temporarly disabled: https://github.com/babel/babel/issues/10678 // .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; } + isUnnecessary(name) { set.add(name); return this; }, }; } diff --git a/packages/babel-preset-env/data/plugin-features.js b/packages/babel-compat-data/scripts/data/plugin-features.js similarity index 86% rename from packages/babel-preset-env/data/plugin-features.js rename to packages/babel-compat-data/scripts/data/plugin-features.js index 3a84be381683..df9a0f174dd4 100644 --- a/packages/babel-preset-env/data/plugin-features.js +++ b/packages/babel-compat-data/scripts/data/plugin-features.js @@ -1,4 +1,4 @@ -const es = { +module.exports = { "transform-template-literals": { features: ["template literals"], }, @@ -65,10 +65,7 @@ const es = { ], }, "transform-destructuring": { - features: [ - "destructuring, assignment", - "destructuring, declarations", - ], + features: ["destructuring, assignment", "destructuring, declarations"], }, "transform-block-scoping": { features: ["const", "let"], @@ -98,11 +95,9 @@ const es = { "proposal-json-strings": "JSON superset", "proposal-optional-catch-binding": "optional catch binding", "transform-named-capturing-groups-regex": "RegExp named capture groups", - "transform-member-expression-literals": "Object/array literal extensions / Reserved words as property names", - "transform-property-literals": "Object/array literal extensions / Reserved words as property names", + "transform-member-expression-literals": + "Object/array literal extensions / Reserved words as property names", + "transform-property-literals": + "Object/array literal extensions / Reserved words as property names", "transform-reserved-words": "Miscellaneous / Unreserved words", }; - -const proposals = require("./shipped-proposals").features; - -module.exports = Object.assign({}, es, proposals); diff --git a/packages/babel-preset-env/scripts/download-compat-table.sh b/packages/babel-compat-data/scripts/download-compat-table.sh similarity index 100% rename from packages/babel-preset-env/scripts/download-compat-table.sh rename to packages/babel-compat-data/scripts/download-compat-table.sh diff --git a/packages/babel-helper-compilation-targets/.npmignore b/packages/babel-helper-compilation-targets/.npmignore new file mode 100644 index 000000000000..f9806945836e --- /dev/null +++ b/packages/babel-helper-compilation-targets/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-helper-compilation-targets/package.json b/packages/babel-helper-compilation-targets/package.json new file mode 100644 index 000000000000..251a902a20aa --- /dev/null +++ b/packages/babel-helper-compilation-targets/package.json @@ -0,0 +1,32 @@ +{ + "name": "@babel/helper-compilation-targets", + "version": "0.0.0", + "author": "The Babel Team (https://babeljs.io/team)", + "license": "MIT", + "description": "Engine compat data used in @babel/preset-env", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-compilation-targets", + "main": "lib/index.js", + "type": "commonjs", + "exports": false, + "publishConfig": { + "access": "public" + }, + "keywords": [ + "babel", + "babel-plugin" + ], + "dependencies": { + "@babel/compat-data": "^0.0.0", + "browserslist": "^4.8.2", + "levenary": "^1.1.0", + "invariant": "^2.2.4", + "semver": "^7.1.1" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + }, + "devDependencies": { + "@babel/core": "^7.7.5", + "@babel/helper-plugin-test-runner": "^7.7.4" + } +} diff --git a/packages/babel-helper-compilation-targets/src/debug.js b/packages/babel-helper-compilation-targets/src/debug.js new file mode 100644 index 000000000000..aec840d2eba2 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/debug.js @@ -0,0 +1,40 @@ +// @flow + +import semver from "semver"; +import { prettifyVersion } from "./pretty"; +import { + semverify, + isUnreleasedVersion, + getLowestImplementedVersion, +} from "./utils"; +import type { Targets } from "./types"; + +export function getInclusionReasons( + item: string, + targetVersions: Targets, + list: { [key: string]: Targets }, +) { + const minVersions = list[item] || {}; + + return Object.keys(targetVersions).reduce((result, env) => { + const minVersion = getLowestImplementedVersion(minVersions, env); + const targetVersion = targetVersions[env]; + + if (!minVersion) { + result[env] = prettifyVersion(targetVersion); + } else { + const minIsUnreleased = isUnreleasedVersion(minVersion, env); + const targetIsUnreleased = isUnreleasedVersion(targetVersion, env); + + if ( + !targetIsUnreleased && + (minIsUnreleased || + semver.lt(targetVersion.toString(), semverify(minVersion))) + ) { + result[env] = prettifyVersion(targetVersion); + } + } + + return result; + }, {}); +} diff --git a/packages/babel-helper-compilation-targets/src/filter-items.js b/packages/babel-helper-compilation-targets/src/filter-items.js new file mode 100644 index 000000000000..ac8809433bb9 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/filter-items.js @@ -0,0 +1,111 @@ +// @flow + +import semver from "semver"; + +import pluginsCompatData from "@babel/compat-data/plugins"; + +import type { Targets } from "./types"; +import { + getLowestImplementedVersion, + isUnreleasedVersion, + semverify, +} from "./utils"; + +export function targetsSupported(target: Targets, support: Targets) { + const targetEnvironments = Object.keys(target); + + if (targetEnvironments.length === 0) { + return false; + } + + const unsupportedEnvironments = targetEnvironments.filter(environment => { + const lowestImplementedVersion = getLowestImplementedVersion( + support, + environment, + ); + + // Feature is not implemented in that environment + if (!lowestImplementedVersion) { + return true; + } + + const lowestTargetedVersion = target[environment]; + + // If targets has unreleased value as a lowest version, then don't require a plugin. + if (isUnreleasedVersion(lowestTargetedVersion, environment)) { + return false; + } + + // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets + if (isUnreleasedVersion(lowestImplementedVersion, environment)) { + return true; + } + + if (!semver.valid(lowestTargetedVersion.toString())) { + throw new Error( + `Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + + "Versions must be in semver format (major.minor.patch)", + ); + } + + return semver.gt( + semverify(lowestImplementedVersion), + lowestTargetedVersion.toString(), + ); + }); + + return unsupportedEnvironments.length === 0; +} + +export function isRequired( + name: string, + targets: Targets, + { + compatData = pluginsCompatData, + includes, + excludes, + }: { + compatData?: { [feature: string]: Targets }, + includes?: Set, + excludes?: Set, + } = {}, +) { + if (excludes && excludes.has(name)) return false; + if (includes && includes.has(name)) return true; + return !targetsSupported(targets, compatData[name]); +} + +export default function filterItems( + list: { [feature: string]: Targets }, + includes: Set, + excludes: Set, + targets: Targets, + defaultIncludes: Array | null, + defaultExcludes?: Array | null, + pluginSyntaxMap?: Map, +) { + const result = new Set(); + const options = { compatData: list, includes, excludes }; + + for (const item in list) { + if (isRequired(item, targets, options)) { + result.add(item); + } else if (pluginSyntaxMap) { + const shippedProposalsSyntax = pluginSyntaxMap.get(item); + + if (shippedProposalsSyntax) { + result.add(shippedProposalsSyntax); + } + } + } + + if (defaultIncludes) { + defaultIncludes.forEach(item => !excludes.has(item) && result.add(item)); + } + + if (defaultExcludes) { + defaultExcludes.forEach(item => !includes.has(item) && result.delete(item)); + } + + return result; +} diff --git a/packages/babel-helper-compilation-targets/src/index.js b/packages/babel-helper-compilation-targets/src/index.js new file mode 100644 index 000000000000..747eb431211c --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/index.js @@ -0,0 +1,256 @@ +// @flow + +import browserslist from "browserslist"; +import findSuggestion from "levenary"; +import invariant from "invariant"; +import browserModulesData from "@babel/compat-data/native-modules"; + +import { + semverify, + semverMin, + isUnreleasedVersion, + getLowestUnreleased, +} from "./utils"; +import { browserNameMap } from "./targets"; +import { TargetNames } from "./options"; +import type { Targets } from "./types"; + +export type { Targets }; + +export { prettifyTargets } from "./pretty"; +export { getInclusionReasons } from "./debug"; +export { default as filterItems, isRequired } from "./filter-items"; +export { unreleasedLabels } from "./targets"; + +const browserslistDefaults = browserslist.defaults; + +const validBrowserslistTargets = [ + ...Object.keys(browserslist.data), + ...Object.keys(browserslist.aliases), +]; + +function objectToBrowserslist(object: Targets): Array { + return Object.keys(object).reduce((list, targetName) => { + if (validBrowserslistTargets.indexOf(targetName) >= 0) { + const targetVersion = object[targetName]; + return list.concat(`${targetName} ${targetVersion}`); + } + return list; + }, []); +} + +function validateTargetNames(targets: Targets): void { + const validTargets = Object.keys(TargetNames); + for (const target in targets) { + if (!TargetNames[target]) { + throw new Error( + `Invalid Option: '${target}' is not a valid target + Maybe you meant to use '${findSuggestion(target, validTargets)}'?`, + ); + } + } +} + +export function isBrowsersQueryValid( + browsers: string | Array | Targets, +): boolean { + return typeof browsers === "string" || Array.isArray(browsers); +} + +function validateBrowsers(browsers) { + invariant( + typeof browsers === "undefined" || isBrowsersQueryValid(browsers), + `Invalid Option: '${browsers}' is not a valid browserslist query`, + ); + + return browsers; +} + +function mergeBrowsers(fromQuery: Targets, fromTarget: Targets) { + return Object.keys(fromTarget).reduce((queryObj, targKey) => { + if (targKey !== TargetNames.browsers) { + queryObj[targKey] = fromTarget[targKey]; + } + return queryObj; + }, fromQuery); +} + +function getLowestVersions(browsers: Array): Targets { + return browsers.reduce((all: Object, browser: string): Object => { + const [browserName, browserVersion] = browser.split(" "); + const normalizedBrowserName = browserNameMap[browserName]; + + if (!normalizedBrowserName) { + return all; + } + + try { + // Browser version can return as "10.0-10.2" + const splitVersion = browserVersion.split("-")[0].toLowerCase(); + const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName); + + if (!all[normalizedBrowserName]) { + all[normalizedBrowserName] = isSplitUnreleased + ? splitVersion + : semverify(splitVersion); + return all; + } + + const version = all[normalizedBrowserName]; + const isUnreleased = isUnreleasedVersion(version, browserName); + + if (isUnreleased && isSplitUnreleased) { + all[normalizedBrowserName] = getLowestUnreleased( + version, + splitVersion, + browserName, + ); + } else if (isUnreleased) { + all[normalizedBrowserName] = semverify(splitVersion); + } else if (!isUnreleased && !isSplitUnreleased) { + const parsedBrowserVersion = semverify(splitVersion); + + all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion); + } + } catch (e) {} + + return all; + }, {}); +} + +function outputDecimalWarning(decimalTargets: Array): void { + if (!decimalTargets || !decimalTargets.length) { + return; + } + + console.log("Warning, the following targets are using a decimal version:"); + console.log(""); + decimalTargets.forEach(({ target, value }) => + console.log(` ${target}: ${value}`), + ); + console.log(""); + console.log( + "We recommend using a string for minor/patch versions to avoid numbers like 6.10", + ); + console.log("getting parsed as 6.1, which can lead to unexpected behavior."); + console.log(""); +} + +function semverifyTarget(target, value) { + try { + return semverify(value); + } catch (error) { + throw new Error( + `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`, + ); + } +} + +const targetParserMap = { + __default(target, value) { + const version = isUnreleasedVersion(value, target) + ? value.toLowerCase() + : semverifyTarget(target, value); + return [target, version]; + }, + + // Parse `node: true` and `node: "current"` to version + node(target, value) { + const parsed = + value === true || value === "current" + ? process.versions.node + : semverifyTarget(target, value); + return [target, parsed]; + }, +}; + +type ParsedResult = { + targets: Targets, + decimalWarnings: Array, +}; + +export default function getTargets( + targets: Object = {}, + options: Object = {}, +): Targets { + const targetOpts: Targets = {}; + + validateTargetNames(targets); + + // `esmodules` as a target indicates the specific set of browsers supporting ES Modules. + // These values OVERRIDE the `browsers` field. + if (targets.esmodules) { + const supportsESModules = browserModulesData["es6.module"]; + targets.browsers = Object.keys(supportsESModules) + .map(browser => `${browser} ${supportsESModules[browser]}`) + .join(", "); + } + + // Parse browsers target via browserslist + const browsersquery = validateBrowsers(targets.browsers); + + const hasTargets = Object.keys(targets).length > 0; + const shouldParseBrowsers = !!targets.browsers; + const shouldSearchForConfig = + !options.ignoreBrowserslistConfig && !hasTargets; + + if (shouldParseBrowsers || shouldSearchForConfig) { + // If no targets are passed, we need to overwrite browserslist's defaults + // so that we enable all transforms (acting like the now deprecated + // preset-latest). + // + // Note, if browserslist resolves the config (ex. package.json), then usage + // of `defaults` in queries will be different since we don't want to break + // the behavior of "no targets is the same as preset-latest". + if (!hasTargets) { + browserslist.defaults = objectToBrowserslist(targets); + } + + const browsers = browserslist(browsersquery, { + path: options.configPath, + mobileToDesktop: true, + }); + + const queryBrowsers = getLowestVersions(browsers); + targets = mergeBrowsers(queryBrowsers, targets); + + // Reset browserslist defaults + browserslist.defaults = browserslistDefaults; + } + + // Parse remaining targets + const parsed = Object.keys(targets) + .filter(value => value !== TargetNames.esmodules) + .sort() + .reduce( + (results: ParsedResult, target: string): ParsedResult => { + if (target !== TargetNames.browsers) { + const value = targets[target]; + + // Warn when specifying minor/patch as a decimal + if (typeof value === "number" && value % 1 !== 0) { + results.decimalWarnings.push({ target, value }); + } + + // Check if we have a target parser? + const parser = targetParserMap[target] || targetParserMap.__default; + const [parsedTarget, parsedValue] = parser(target, value); + + if (parsedValue) { + // Merge (lowest wins) + results.targets[parsedTarget] = parsedValue; + } + } + + return results; + }, + { + targets: targetOpts, + decimalWarnings: [], + }, + ); + + outputDecimalWarning(parsed.decimalWarnings); + + return parsed.targets; +} diff --git a/packages/babel-helper-compilation-targets/src/options.js b/packages/babel-helper-compilation-targets/src/options.js new file mode 100644 index 000000000000..eadc8dbd43c2 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/options.js @@ -0,0 +1,20 @@ +// @flow + +export const TargetNames = { + esmodules: "esmodules", + node: "node", + browsers: "browsers", + chrome: "chrome", + opera: "opera", + edge: "edge", + firefox: "firefox", + safari: "safari", + ie: "ie", + ios: "ios", + android: "android", + electron: "electron", + samsung: "samsung", + + // deprecated + uglify: "uglify", +}; diff --git a/packages/babel-helper-compilation-targets/src/pretty.js b/packages/babel-helper-compilation-targets/src/pretty.js new file mode 100644 index 000000000000..bc8bdd96c148 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/pretty.js @@ -0,0 +1,36 @@ +import semver from "semver"; +import { unreleasedLabels } from "./targets"; + +export function prettifyVersion(version: string) { + if (typeof version !== "string") { + return version; + } + + const parts = [semver.major(version)]; + const minor = semver.minor(version); + const patch = semver.patch(version); + + if (minor || patch) { + parts.push(minor); + } + + if (patch) { + parts.push(patch); + } + + return parts.join("."); +} + +export function prettifyTargets(targets: Targets): Targets { + return Object.keys(targets).reduce((results, target) => { + let value = targets[target]; + + const unreleasedLabel = unreleasedLabels[target]; + if (typeof value === "string" && unreleasedLabel !== value) { + value = prettifyVersion(value); + } + + results[target] = value; + return results; + }, {}); +} diff --git a/packages/babel-helper-compilation-targets/src/targets.js b/packages/babel-helper-compilation-targets/src/targets.js new file mode 100644 index 000000000000..401d7904a995 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/targets.js @@ -0,0 +1,20 @@ +export const unreleasedLabels = { + safari: "tp", +}; + +export const browserNameMap = { + and_chr: "chrome", + and_ff: "firefox", + android: "android", + chrome: "chrome", + edge: "edge", + firefox: "firefox", + ie: "ie", + ie_mob: "ie", + ios_saf: "ios", + node: "node", + op_mob: "opera", + opera: "opera", + safari: "safari", + samsung: "samsung", +}; diff --git a/packages/babel-helper-compilation-targets/src/types.js b/packages/babel-helper-compilation-targets/src/types.js new file mode 100644 index 000000000000..28b4c2b3f34d --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/types.js @@ -0,0 +1,19 @@ +// @flow + +// Targets +export type Target = + | "node" + | "chrome" + | "opera" + | "edge" + | "firefox" + | "safari" + | "ie" + | "ios" + | "android" + | "electron" + | "samsung"; + +export type Targets = { + [target: Target]: string, +}; diff --git a/packages/babel-helper-compilation-targets/src/utils.js b/packages/babel-helper-compilation-targets/src/utils.js new file mode 100644 index 000000000000..31eeae8c8e23 --- /dev/null +++ b/packages/babel-helper-compilation-targets/src/utils.js @@ -0,0 +1,64 @@ +// @flow + +import invariant from "invariant"; +import semver from "semver"; + +import { unreleasedLabels } from "./targets"; +import type { Target, Targets } from "./types"; + +const versionRegExp = /^(\d+|\d+.\d+)$/; + +export function semverMin(first: ?string, second: string): string { + return first && semver.lt(first, second) ? first : second; +} + +// Convert version to a semver value. +// 2.5 -> 2.5.0; 1 -> 1.0.0; +export function semverify(version: number | string): string { + if (typeof version === "string" && semver.valid(version)) { + return version; + } + + invariant( + typeof version === "number" || + (typeof version === "string" && versionRegExp.test(version)), + `'${version}' is not a valid version`, + ); + + const split = version.toString().split("."); + while (split.length < 3) { + split.push("0"); + } + return split.join("."); +} + +export function isUnreleasedVersion( + version: string | number, + env: string, +): boolean { + const unreleasedLabel = unreleasedLabels[env]; + return ( + !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase() + ); +} + +export function getLowestUnreleased(a: string, b: string, env: string): string { + const unreleasedLabel = unreleasedLabels[env]; + const hasUnreleased = [a, b].some(item => item === unreleasedLabel); + if (hasUnreleased) { + return a === hasUnreleased ? b : a || b; + } + return semverMin(a, b); +} + +export function getLowestImplementedVersion( + plugin: Targets, + environment: Target, +): string { + const result = plugin[environment]; + // When Android support data is absent, use Chrome data as fallback + if (!result && environment === "android") { + return plugin.chrome; + } + return result; +} diff --git a/packages/babel-preset-env/test/utils.spec.js b/packages/babel-helper-compilation-targets/test/pretty.spec.js similarity index 56% rename from packages/babel-preset-env/test/utils.spec.js rename to packages/babel-helper-compilation-targets/test/pretty.spec.js index a5ca4256cda5..6164cde8e918 100644 --- a/packages/babel-preset-env/test/utils.spec.js +++ b/packages/babel-helper-compilation-targets/test/pretty.spec.js @@ -1,27 +1,6 @@ -"use strict"; - -const utils = require("../lib/utils"); - -const { prettifyTargets, prettifyVersion, semverify } = utils; - -describe("utils", () => { - describe("semverify", () => { - it("returns", () => { - expect(semverify("1")).toBe("1.0.0"); - expect(semverify("1.0")).toBe("1.0.0"); - expect(semverify("1.0.0")).toBe("1.0.0"); - expect(semverify(1)).toBe("1.0.0"); - expect(semverify(1.2)).toBe("1.2.0"); - }); - - it("throws", () => { - const invalidSemver = () => { - semverify("invalid"); - }; - expect(invalidSemver).toThrow(); - }); - }); +import { prettifyTargets, prettifyVersion } from "../lib/pretty"; +describe("pretty", () => { describe("prettifyVersion", () => { it("returns", () => { expect(prettifyVersion(true)).toBe(true); diff --git a/packages/babel-preset-env/test/targets-parser.spec.js b/packages/babel-helper-compilation-targets/test/targets-parser.spec.js similarity index 99% rename from packages/babel-preset-env/test/targets-parser.spec.js rename to packages/babel-helper-compilation-targets/test/targets-parser.spec.js index 7b9f669d2d01..adc0aa647e80 100644 --- a/packages/babel-preset-env/test/targets-parser.spec.js +++ b/packages/babel-helper-compilation-targets/test/targets-parser.spec.js @@ -1,5 +1,5 @@ import browserslist from "browserslist"; -import getTargets from "../lib/targets-parser"; +import getTargets from ".."; describe("getTargets", () => { it("parses", () => { diff --git a/packages/babel-helper-compilation-targets/test/targets-supported.js b/packages/babel-helper-compilation-targets/test/targets-supported.js new file mode 100644 index 000000000000..fd018172ef29 --- /dev/null +++ b/packages/babel-helper-compilation-targets/test/targets-supported.js @@ -0,0 +1,82 @@ +"use strict"; + +const { targetsSupported } = require("../lib/filter-items"); + +describe("targetsSupported", () => { + const MAX_VERSION = `${Number.MAX_SAFE_INTEGER}.0.0`; + + it("returns false if no targets are specified", () => { + expect(targetsSupported({}, {})).toBe(false); + }); + + it("returns false if plugin feature is not implemented in one or more targets", () => { + let targets; + const plugin = { + edge: false, + firefox: 45, + chrome: 49, + }; + + targets = { + chrome: MAX_VERSION, + firefox: MAX_VERSION, + }; + expect(targetsSupported(targets, plugin)).toBe(true); + + targets = { + edge: "12", + }; + expect(targetsSupported(targets, plugin)).toBe(false); + }); + + it("returns true if plugin feature is implemented by lower than target", () => { + const plugin = { + chrome: 49, + }; + const targets = { + chrome: MAX_VERSION, + }; + + expect(targetsSupported(targets, plugin)).toBe(true); + }); + + it("returns true if plugin feature is implemented is equal to target", () => { + const plugin = { + chrome: 49, + }; + const targets = { + chrome: "49.0.0", + }; + expect(targetsSupported(targets, plugin)).toBe(true); + }); + + it("returns false if plugin feature is implemented is greater than target", () => { + const plugin = { + chrome: 50, + }; + const targets = { + chrome: "49.0.0", + }; + expect(targetsSupported(targets, plugin)).toBe(false); + }); + + it("returns when target is a decimal", () => { + const plugin = { + node: 6.9, + }; + const targets = { + node: "6.10.0", + }; + expect(targetsSupported(targets, plugin)).toBe(true); + }); + + it("throws an error if target version is invalid", () => { + const plugin = { + chrome: 50, + }; + const targets = { + chrome: 55, + }; + expect(() => targetsSupported(targets, plugin)).toThrow(); + }); +}); diff --git a/packages/babel-helper-compilation-targets/test/utils.spec.js b/packages/babel-helper-compilation-targets/test/utils.spec.js new file mode 100644 index 000000000000..77068400663d --- /dev/null +++ b/packages/babel-helper-compilation-targets/test/utils.spec.js @@ -0,0 +1,20 @@ +import { semverify } from "../lib/utils"; + +describe("utils", () => { + describe("semverify", () => { + it("returns", () => { + expect(semverify("1")).toBe("1.0.0"); + expect(semverify("1.0")).toBe("1.0.0"); + expect(semverify("1.0.0")).toBe("1.0.0"); + expect(semverify(1)).toBe("1.0.0"); + expect(semverify(1.2)).toBe("1.2.0"); + }); + + it("throws", () => { + const invalidSemver = () => { + semverify("invalid"); + }; + expect(invalidSemver).toThrow(); + }); + }); +}); diff --git a/packages/babel-preset-env/data/built-in-modules.js b/packages/babel-preset-env/data/built-in-modules.js new file mode 100644 index 000000000000..161ddb8ea7ab --- /dev/null +++ b/packages/babel-preset-env/data/built-in-modules.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/native-modules"); diff --git a/packages/babel-preset-env/data/built-in-modules.json.js b/packages/babel-preset-env/data/built-in-modules.json.js new file mode 100644 index 000000000000..161ddb8ea7ab --- /dev/null +++ b/packages/babel-preset-env/data/built-in-modules.json.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/native-modules"); diff --git a/packages/babel-preset-env/data/built-ins.js b/packages/babel-preset-env/data/built-ins.js new file mode 100644 index 000000000000..38f8a09add7a --- /dev/null +++ b/packages/babel-preset-env/data/built-ins.js @@ -0,0 +1,4 @@ +// TODO: Remove in Babel 8 +// https://github.com/vuejs/vue-cli/issues/3671 + +module.exports = require("./corejs2-built-ins.json"); diff --git a/packages/babel-preset-env/data/corejs2-built-ins.js b/packages/babel-preset-env/data/corejs2-built-ins.js new file mode 100644 index 000000000000..486f3b1e1b2a --- /dev/null +++ b/packages/babel-preset-env/data/corejs2-built-ins.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/corejs2-built-ins"); diff --git a/packages/babel-preset-env/data/corejs2-built-ins.json.js b/packages/babel-preset-env/data/corejs2-built-ins.json.js new file mode 100644 index 000000000000..486f3b1e1b2a --- /dev/null +++ b/packages/babel-preset-env/data/corejs2-built-ins.json.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/corejs2-built-ins"); diff --git a/packages/babel-preset-env/data/plugins.js b/packages/babel-preset-env/data/plugins.js new file mode 100644 index 000000000000..b5d6b4361f10 --- /dev/null +++ b/packages/babel-preset-env/data/plugins.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/plugins"); diff --git a/packages/babel-preset-env/data/plugins.json.js b/packages/babel-preset-env/data/plugins.json.js new file mode 100644 index 000000000000..b5d6b4361f10 --- /dev/null +++ b/packages/babel-preset-env/data/plugins.json.js @@ -0,0 +1,3 @@ +// TODO: Remove in Babel 8 + +module.exports = require("@babel/compat-data/plugins"); diff --git a/packages/babel-preset-env/data/unreleased-labels.js b/packages/babel-preset-env/data/unreleased-labels.js index bc5130567d2f..112d859930d8 100644 --- a/packages/babel-preset-env/data/unreleased-labels.js +++ b/packages/babel-preset-env/data/unreleased-labels.js @@ -1,3 +1,3 @@ -module.exports = { - safari: "tp", -}; +// TODO: Remove in Babel 8 + +module.exports = require("@babel/helper-compilation-targets").unreleasedLabels; diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 32eb9a33e54b..3b335e702e14 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -10,10 +10,9 @@ }, "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env", "main": "lib/index.js", - "scripts": { - "build-data": "./scripts/download-compat-table.sh; node ./scripts/build-data.js; node ./scripts/build-modules-support.js" - }, "dependencies": { + "@babel/compat-data": "^0.0.0", + "@babel/helper-compilation-targets": "^0.0.0", "@babel/helper-module-imports": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "@babel/plugin-proposal-async-generator-functions": "^7.7.4", @@ -74,8 +73,6 @@ "@babel/core": "^7.7.7", "@babel/helper-fixtures": "^7.6.3", "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.2.0", - "caniuse-db": "1.0.30000969", - "electron-to-chromium": "1.3.113" + "@babel/plugin-syntax-dynamic-import": "^7.2.0" } } diff --git a/packages/babel-preset-env/src/debug.js b/packages/babel-preset-env/src/debug.js index 58c98e5daedb..b91499e72275 100644 --- a/packages/babel-preset-env/src/debug.js +++ b/packages/babel-preset-env/src/debug.js @@ -1,14 +1,9 @@ // @flow -/*eslint quotes: ["error", "double", { "avoidEscape": true }]*/ -import semver from "semver"; -import { - isUnreleasedVersion, - prettifyVersion, - semverify, - getLowestImplementedVersion, -} from "./utils"; -import type { Targets } from "./types"; +import { + getInclusionReasons, + type Targets, +} from "@babel/helper-compilation-targets"; const wordEnds = (size: number) => { return size > 1 ? "s" : ""; @@ -21,29 +16,7 @@ export const logPluginOrPolyfill = ( targetVersions: Targets, list: { [key: string]: Targets }, ) => { - const minVersions = list[item] || {}; - - const filteredList = Object.keys(targetVersions).reduce((result, env) => { - const minVersion = getLowestImplementedVersion(minVersions, env); - const targetVersion = targetVersions[env]; - - if (!minVersion) { - result[env] = prettifyVersion(targetVersion); - } else { - const minIsUnreleased = isUnreleasedVersion(minVersion, env); - const targetIsUnreleased = isUnreleasedVersion(targetVersion, env); - - if ( - !targetIsUnreleased && - (minIsUnreleased || - semver.lt(targetVersion.toString(), semverify(minVersion))) - ) { - result[env] = prettifyVersion(targetVersion); - } - } - - return result; - }, {}); + const filteredList = getInclusionReasons(item, targetVersions, list); const formattedTargets = JSON.stringify(filteredList) .replace(/,/g, ", ") diff --git a/packages/babel-preset-env/src/filter-items.js b/packages/babel-preset-env/src/filter-items.js index cd1a377f995b..a0041b3f082b 100644 --- a/packages/babel-preset-env/src/filter-items.js +++ b/packages/babel-preset-env/src/filter-items.js @@ -1,103 +1,11 @@ // @flow -import semver from "semver"; -import { - semverify, - isUnreleasedVersion, - getLowestImplementedVersion, -} from "./utils"; - -import type { Targets } from "./types"; - -export function isPluginRequired( - supportedEnvironments: Targets, - plugin: Targets, -) { - const targetEnvironments = Object.keys(supportedEnvironments); - - if (targetEnvironments.length === 0) { - return true; - } - - const isRequiredForEnvironments = targetEnvironments.filter(environment => { - const lowestImplementedVersion = getLowestImplementedVersion( - plugin, - environment, - ); - // Feature is not implemented in that environment - if (!lowestImplementedVersion) { - return true; - } - const lowestTargetedVersion = supportedEnvironments[environment]; - - // If targets has unreleased value as a lowest version, then don't require a plugin. - if (isUnreleasedVersion(lowestTargetedVersion, environment)) { - return false; - } - - // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets - if (isUnreleasedVersion(lowestImplementedVersion, environment)) { - return true; - } - - if (!semver.valid(lowestTargetedVersion.toString())) { - throw new Error( - `Invalid version passed for target "${environment}": "${lowestTargetedVersion}". ` + - "Versions must be in semver format (major.minor.patch)", - ); - } - - return semver.gt( - semverify(lowestImplementedVersion), - lowestTargetedVersion.toString(), - ); - }); - - return isRequiredForEnvironments.length > 0; -} - -export default function( - list: { [feature: string]: Targets }, - includes: Set, - excludes: Set, - targets: Targets, - defaultIncludes: Array | null, - defaultExcludes?: Array | null, - pluginSyntaxMap?: Map, -) { - const result = new Set(); - - for (const item in list) { - if ( - !excludes.has(item) && - (isPluginRequired(targets, list[item]) || includes.has(item)) - ) { - result.add(item); - } else if (pluginSyntaxMap) { - const shippedProposalsSyntax = pluginSyntaxMap.get(item); - - if (shippedProposalsSyntax) { - result.add(shippedProposalsSyntax); - } - } - } - - if (defaultIncludes) { - defaultIncludes.forEach(item => !excludes.has(item) && result.add(item)); - } - - if (defaultExcludes) { - defaultExcludes.forEach(item => !includes.has(item) && result.delete(item)); - } - - return result; -} export function removeUnnecessaryItems( items: Set, - overlapping: Map>, + overlapping: { [name: string]: string[] }, ) { items.forEach(item => { - const names = overlapping.get(item); - if (names) names.forEach(name => items.delete(name)); + // $FlowIgnore Flow doesn't support calls in optional chains + overlapping[item]?.forEach(name => items.delete(name)); }); } diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js index 17740c4c3586..19cc41121464 100644 --- a/packages/babel-preset-env/src/index.js +++ b/packages/babel-preset-env/src/index.js @@ -3,12 +3,12 @@ import { SemVer } from "semver"; import { logPluginOrPolyfill } from "./debug"; import getOptionSpecificExcludesFor from "./get-option-specific-excludes"; -import filterItems, { removeUnnecessaryItems } from "./filter-items"; +import { removeUnnecessaryItems } from "./filter-items"; import moduleTransformations from "./module-transformations"; import normalizeOptions from "./normalize-options"; -import pluginList from "../data/plugins.json"; +import pluginList from "@babel/compat-data/plugins"; import { proposalPlugins, pluginSyntaxMap } from "../data/shipped-proposals"; -import overlappingPlugins from "../data/overlapping-plugins"; +import overlappingPlugins from "@babel/compat-data/overlapping-plugins"; import addCoreJS2UsagePlugin from "./polyfills/corejs2/usage-plugin"; import addCoreJS3UsagePlugin from "./polyfills/corejs3/usage-plugin"; @@ -17,15 +17,25 @@ import replaceCoreJS2EntryPlugin from "./polyfills/corejs2/entry-plugin"; import replaceCoreJS3EntryPlugin from "./polyfills/corejs3/entry-plugin"; import removeRegeneratorEntryPlugin from "./polyfills/regenerator/entry-plugin"; -import getTargets from "./targets-parser"; +import getTargets, { + prettifyTargets, + filterItems, + isRequired, + type Targets, +} from "@babel/helper-compilation-targets"; import availablePlugins from "./available-plugins"; -import { filterStageFromList, prettifyTargets } from "./utils"; +import { filterStageFromList } from "./utils"; import { declare } from "@babel/helper-plugin-utils"; import typeof ModuleTransformationsType from "./module-transformations"; -import type { BuiltInsOption, Targets, ModuleOption } from "./types"; +import type { BuiltInsOption, ModuleOption } from "./types"; -export { isPluginRequired } from "./filter-items"; +// TODO: Remove in Babel 8 +export function isPluginRequired(targets: Targets, support: Targets) { + return !isRequired("fake-name", targets, { + compatData: { "fake-name": support }, + }); +} const pluginListWithoutProposals = filterStageFromList( pluginList, diff --git a/packages/babel-preset-env/src/normalize-options.js b/packages/babel-preset-env/src/normalize-options.js index 79998befaeb4..667805bb5703 100644 --- a/packages/babel-preset-env/src/normalize-options.js +++ b/packages/babel-preset-env/src/normalize-options.js @@ -1,14 +1,13 @@ // @flow import corejs3Polyfills from "core-js-compat/data"; +import findSuggestion from "levenary"; import invariant from "invariant"; import { coerce, SemVer } from "semver"; -import corejs2Polyfills from "../data/corejs2-built-ins.json"; -import pluginsList from "../data/plugins.json"; +import corejs2Polyfills from "@babel/compat-data/corejs2-built-ins"; +import pluginsList from "@babel/compat-data/plugins"; import moduleTransformations from "./module-transformations"; import { TopLevelOptions, ModulesOption, UseBuiltInsOption } from "./options"; import { defaultWebIncludes } from "./polyfills/corejs2/get-platform-specific-default"; -import { isBrowsersQueryValid } from "./targets-parser"; -import findSuggestion from "levenary"; import type { BuiltInsOption, @@ -26,7 +25,7 @@ const validateTopLevelOptions = (options: Options) => { if (!TopLevelOptions[option]) { throw new Error( `Invalid Option: ${option} is not a valid top-level option. - Maybe you meant to use '${findSuggestion(validOptions, option)}'?`, + Maybe you meant to use '${findSuggestion(option, validOptions)}'?`, ); } } @@ -121,7 +120,7 @@ export const checkDuplicateIncludeExcludes = ( const normalizeTargets = targets => { // TODO: Allow to use only query or strings as a targets from next breaking change. - if (isBrowsersQueryValid(targets)) { + if (typeof targets === "string" || Array.isArray(targets)) { return { browsers: targets }; } return { diff --git a/packages/babel-preset-env/src/options.js b/packages/babel-preset-env/src/options.js index f8bf5d0bba6c..b84423eca7d1 100644 --- a/packages/babel-preset-env/src/options.js +++ b/packages/babel-preset-env/src/options.js @@ -31,22 +31,3 @@ export const UseBuiltInsOption = { entry: "entry", usage: "usage", }; - -export const TargetNames = { - esmodules: "esmodules", - node: "node", - browsers: "browsers", - chrome: "chrome", - opera: "opera", - edge: "edge", - firefox: "firefox", - safari: "safari", - ie: "ie", - ios: "ios", - android: "android", - electron: "electron", - samsung: "samsung", - - // deprecated - uglify: "uglify", -}; diff --git a/packages/babel-preset-env/src/polyfills/corejs2/entry-plugin.js b/packages/babel-preset-env/src/polyfills/corejs2/entry-plugin.js index 82fa4dd9f237..da8010e2c731 100644 --- a/packages/babel-preset-env/src/polyfills/corejs2/entry-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs2/entry-plugin.js @@ -1,8 +1,8 @@ // @flow -import corejs2Polyfills from "../../../data/corejs2-built-ins.json"; +import corejs2Polyfills from "@babel/compat-data/corejs2-built-ins"; +import { filterItems } from "@babel/helper-compilation-targets"; import getPlatformSpecificDefaultFor from "./get-platform-specific-default"; -import filterItems from "../../filter-items"; import { createImport, isPolyfillSource, diff --git a/packages/babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js b/packages/babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js index aa89ebfb1900..3674a2be8d4e 100644 --- a/packages/babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js +++ b/packages/babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js @@ -1,6 +1,6 @@ // @flow -import type { Targets } from "../../types"; +import type { Targets } from "@babel/helper-compilation-targets"; export const defaultWebIncludes = [ "web.timers", diff --git a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js index ffe73bf8d59b..a9269237e5ae 100644 --- a/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs2/usage-plugin.js @@ -1,8 +1,8 @@ // @flow -import corejs2Polyfills from "../../../data/corejs2-built-ins.json"; +import corejs2Polyfills from "@babel/compat-data/corejs2-built-ins"; +import { filterItems } from "@babel/helper-compilation-targets"; import getPlatformSpecificDefaultFor from "./get-platform-specific-default"; -import filterItems from "../../filter-items"; import { BuiltIns, StaticProperties, diff --git a/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js b/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js index e30b284d8ac2..3ec5875d2b85 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js @@ -3,7 +3,7 @@ import corejs3Polyfills from "core-js-compat/data"; import corejsEntries from "core-js-compat/entries"; import getModulesListForTargetVersion from "core-js-compat/get-modules-list-for-target-version"; -import filterItems from "../../filter-items"; +import { filterItems } from "@babel/helper-compilation-targets"; import { has, intersection, diff --git a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js index 687a07c4367d..11eabb97b642 100644 --- a/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js +++ b/packages/babel-preset-env/src/polyfills/corejs3/usage-plugin.js @@ -3,7 +3,7 @@ import corejs3Polyfills from "core-js-compat/data"; import corejs3ShippedProposalsList from "./shipped-proposals"; import getModulesListForTargetVersion from "core-js-compat/get-modules-list-for-target-version"; -import filterItems from "../../filter-items"; +import { filterItems } from "@babel/helper-compilation-targets"; import { BuiltIns, StaticProperties, diff --git a/packages/babel-preset-env/src/targets-parser.js b/packages/babel-preset-env/src/targets-parser.js index f2284e715ca4..3697cb58f26f 100644 --- a/packages/babel-preset-env/src/targets-parser.js +++ b/packages/babel-preset-env/src/targets-parser.js @@ -1,261 +1,7 @@ -// @flow +// TODO: Remove in Babel 8 -import browserslist from "browserslist"; -import invariant from "invariant"; -import semver from "semver"; -import findSuggestion from "levenary"; -import { semverify, isUnreleasedVersion, getLowestUnreleased } from "./utils"; -import browserModulesData from "../data/built-in-modules.json"; -import { TargetNames } from "./options"; -import type { Targets } from "./types"; - -const browserslistDefaults = browserslist.defaults; - -const validBrowserslistTargets = [ - ...Object.keys(browserslist.data), - ...Object.keys(browserslist.aliases), -]; - -const objectToBrowserslist = (object: Targets): Array => { - return Object.keys(object).reduce((list, targetName) => { - if (validBrowserslistTargets.indexOf(targetName) >= 0) { - const targetVersion = object[targetName]; - return list.concat(`${targetName} ${targetVersion}`); - } - return list; - }, []); -}; - -const validateTargetNames = (targets: Targets): void => { - const validTargets = Object.keys(TargetNames); - for (const target in targets) { - if (!TargetNames[target]) { - throw new Error( - `Invalid Option: '${target}' is not a valid target - Maybe you meant to use '${findSuggestion(validTargets, target)}'?`, - ); - } - } -}; - -const browserNameMap = { - and_chr: "chrome", - and_ff: "firefox", - android: "android", - chrome: "chrome", - edge: "edge", - firefox: "firefox", - ie: "ie", - ie_mob: "ie", - ios_saf: "ios", - node: "node", - op_mob: "opera", - opera: "opera", - safari: "safari", - samsung: "samsung", -}; - -export const isBrowsersQueryValid = ( - browsers: string | Array | Targets, -): boolean => typeof browsers === "string" || Array.isArray(browsers); - -const validateBrowsers = browsers => { - invariant( - typeof browsers === "undefined" || isBrowsersQueryValid(browsers), - `Invalid Option: '${browsers}' is not a valid browserslist query`, - ); - - return browsers; -}; - -export const semverMin = (first: ?string, second: string): string => { - return first && semver.lt(first, second) ? first : second; -}; - -const mergeBrowsers = (fromQuery: Targets, fromTarget: Targets) => { - return Object.keys(fromTarget).reduce((queryObj, targKey) => { - if (targKey !== TargetNames.browsers) { - queryObj[targKey] = fromTarget[targKey]; - } - return queryObj; - }, fromQuery); -}; - -const getLowestVersions = (browsers: Array): Targets => { - return browsers.reduce((all: Object, browser: string): Object => { - const [browserName, browserVersion] = browser.split(" "); - const normalizedBrowserName = browserNameMap[browserName]; - - if (!normalizedBrowserName) { - return all; - } - - try { - // Browser version can return as "10.0-10.2" - const splitVersion = browserVersion.split("-")[0].toLowerCase(); - const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName); - - if (!all[normalizedBrowserName]) { - all[normalizedBrowserName] = isSplitUnreleased - ? splitVersion - : semverify(splitVersion); - return all; - } - - const version = all[normalizedBrowserName]; - const isUnreleased = isUnreleasedVersion(version, browserName); - - if (isUnreleased && isSplitUnreleased) { - all[normalizedBrowserName] = getLowestUnreleased( - version, - splitVersion, - browserName, - ); - } else if (isUnreleased) { - all[normalizedBrowserName] = semverify(splitVersion); - } else if (!isUnreleased && !isSplitUnreleased) { - const parsedBrowserVersion = semverify(splitVersion); - - all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion); - } - } catch (e) {} - - return all; - }, {}); -}; - -const outputDecimalWarning = (decimalTargets: Array): void => { - if (!decimalTargets || !decimalTargets.length) { - return; - } - - console.log("Warning, the following targets are using a decimal version:"); - console.log(""); - decimalTargets.forEach(({ target, value }) => - console.log(` ${target}: ${value}`), - ); - console.log(""); - console.log( - "We recommend using a string for minor/patch versions to avoid numbers like 6.10", - ); - console.log("getting parsed as 6.1, which can lead to unexpected behavior."); - console.log(""); -}; - -const semverifyTarget = (target, value) => { - try { - return semverify(value); - } catch (error) { - throw new Error( - `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`, - ); - } -}; - -const targetParserMap = { - __default: (target, value) => { - const version = isUnreleasedVersion(value, target) - ? value.toLowerCase() - : semverifyTarget(target, value); - return [target, version]; - }, - - // Parse `node: true` and `node: "current"` to version - node: (target, value) => { - const parsed = - value === true || value === "current" - ? process.versions.node - : semverifyTarget(target, value); - return [target, parsed]; - }, -}; - -type ParsedResult = { - targets: Targets, - decimalWarnings: Array, -}; - -const getTargets = (targets: Object = {}, options: Object = {}): Targets => { - const targetOpts: Targets = {}; - - validateTargetNames(targets); - - // `esmodules` as a target indicates the specific set of browsers supporting ES Modules. - // These values OVERRIDE the `browsers` field. - if (targets.esmodules) { - const supportsESModules = browserModulesData["es6.module"]; - targets.browsers = Object.keys(supportsESModules) - .map(browser => `${browser} ${supportsESModules[browser]}`) - .join(", "); - } - - // Parse browsers target via browserslist - const browsersquery = validateBrowsers(targets.browsers); - - const hasTargets = Object.keys(targets).length > 0; - const shouldParseBrowsers = !!targets.browsers; - const shouldSearchForConfig = - !options.ignoreBrowserslistConfig && !hasTargets; - - if (shouldParseBrowsers || shouldSearchForConfig) { - // If no targets are passed, we need to overwrite browserslist's defaults - // so that we enable all transforms (acting like the now deprecated - // preset-latest). - // - // Note, if browserslist resolves the config (ex. package.json), then usage - // of `defaults` in queries will be different since we don't want to break - // the behavior of "no targets is the same as preset-latest". - if (!hasTargets) { - browserslist.defaults = objectToBrowserslist(targets); - } - - const browsers = browserslist(browsersquery, { - path: options.configPath, - mobileToDesktop: true, - }); - - const queryBrowsers = getLowestVersions(browsers); - targets = mergeBrowsers(queryBrowsers, targets); - - // Reset browserslist defaults - browserslist.defaults = browserslistDefaults; - } - - // Parse remaining targets - const parsed = Object.keys(targets) - .filter(value => value !== TargetNames.esmodules) - .sort() - .reduce( - (results: ParsedResult, target: string): ParsedResult => { - if (target !== TargetNames.browsers) { - const value = targets[target]; - - // Warn when specifying minor/patch as a decimal - if (typeof value === "number" && value % 1 !== 0) { - results.decimalWarnings.push({ target, value }); - } - - // Check if we have a target parser? - const parser = targetParserMap[target] || targetParserMap.__default; - const [parsedTarget, parsedValue] = parser(target, value); - - if (parsedValue) { - // Merge (lowest wins) - results.targets[parsedTarget] = parsedValue; - } - } - - return results; - }, - { - targets: targetOpts, - decimalWarnings: [], - }, - ); - - outputDecimalWarning(parsed.decimalWarnings); - - return parsed.targets; -}; - -export default getTargets; +export { + default, + isBrowsersQueryValid, + semverMin, +} from "@babel/helper-compilation-targets"; diff --git a/packages/babel-preset-env/src/types.js b/packages/babel-preset-env/src/types.js index c1c3157eb27d..1066c665f1a6 100644 --- a/packages/babel-preset-env/src/types.js +++ b/packages/babel-preset-env/src/types.js @@ -2,24 +2,7 @@ import { ModulesOption, UseBuiltInsOption } from "./options"; import type { NormalizedCorejsOption } from "./normalize-options"; - -// Targets -export type Target = - | "node" - | "chrome" - | "opera" - | "edge" - | "firefox" - | "safari" - | "ie" - | "ios" - | "android" - | "electron" - | "samsung"; - -export type Targets = { - [target: Target]: string, -}; +import type { Targets } from "@babel/helper-compilation-targets"; // Options // Use explicit modules to prevent typo errors. diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index e61e4e4d72ce..c7a330fe9f51 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -2,12 +2,8 @@ import * as t from "@babel/types"; import type { NodePath } from "@babel/traverse"; -import invariant from "invariant"; -import semver from "semver"; import { addSideEffect } from "@babel/helper-module-imports"; -import unreleasedLabels from "../data/unreleased-labels"; -import { semverMin } from "./targets-parser"; -import type { Target, Targets } from "./types"; +import type { Targets } from "@babel/helper-compilation-targets"; export const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty); @@ -18,28 +14,6 @@ export function getType(target: any): string { .toLowerCase(); } -const versionRegExp = /^(\d+|\d+.\d+)$/; - -// Convert version to a semver value. -// 2.5 -> 2.5.0; 1 -> 1.0.0; -export function semverify(version: number | string): string { - if (typeof version === "string" && semver.valid(version)) { - return version; - } - - invariant( - typeof version === "number" || - (typeof version === "string" && versionRegExp.test(version)), - `'${version}' is not a valid version`, - ); - - const split = version.toString().split("."); - while (split.length < 3) { - split.push("0"); - } - return split.join("."); -} - export function intersection( first: Set, second: Set, @@ -52,71 +26,6 @@ export function intersection( return result; } -export function prettifyVersion(version: string) { - if (typeof version !== "string") { - return version; - } - - const parts = [semver.major(version)]; - const minor = semver.minor(version); - const patch = semver.patch(version); - - if (minor || patch) { - parts.push(minor); - } - - if (patch) { - parts.push(patch); - } - - return parts.join("."); -} - -export function prettifyTargets(targets: Targets): Targets { - return Object.keys(targets).reduce((results, target) => { - let value = targets[target]; - - const unreleasedLabel = unreleasedLabels[target]; - if (typeof value === "string" && unreleasedLabel !== value) { - value = prettifyVersion(value); - } - - results[target] = value; - return results; - }, {}); -} - -export function isUnreleasedVersion( - version: string | number, - env: string, -): boolean { - const unreleasedLabel = unreleasedLabels[env]; - return ( - !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase() - ); -} - -export function getLowestUnreleased(a: string, b: string, env: string): string { - const unreleasedLabel = unreleasedLabels[env]; - const hasUnreleased = [a, b].some(item => item === unreleasedLabel); - if (hasUnreleased) { - return a === hasUnreleased ? b : a || b; - } - return semverMin(a, b); -} - -export function getLowestImplementedVersion( - plugin: Targets, - environment: Target, -): string { - const result = plugin[environment]; - // When Android support data is absent, use Chrome data as fallback - if (!result && environment === "android") { - return plugin.chrome; - } - return result; -} - export function filterStageFromList( list: { [feature: string]: Targets }, stageList: { [feature: string]: boolean }, diff --git a/packages/babel-preset-env/test/is-plugin-required.js b/packages/babel-preset-env/test/is-plugin-required.js deleted file mode 100644 index be999b7c9828..000000000000 --- a/packages/babel-preset-env/test/is-plugin-required.js +++ /dev/null @@ -1,82 +0,0 @@ -"use strict"; - -const presetEnv = require("../"); - -describe("isPluginRequired", () => { - const MAX_VERSION = `${Number.MAX_SAFE_INTEGER}.0.0`; - - it("returns true if no targets are specified", () => { - expect(presetEnv.isPluginRequired({}, {})).toBe(true); - }); - - it("returns true if plugin feature is not implemented in one or more targets", () => { - let targets; - const plugin = { - edge: false, - firefox: 45, - chrome: 49, - }; - - targets = { - chrome: MAX_VERSION, - firefox: MAX_VERSION, - }; - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(false); - - targets = { - edge: "12", - }; - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(true); - }); - - it("returns false if plugin feature is implemented by lower than target", () => { - const plugin = { - chrome: 49, - }; - const targets = { - chrome: MAX_VERSION, - }; - - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(false); - }); - - it("returns false if plugin feature is implemented is equal to target", () => { - const plugin = { - chrome: 49, - }; - const targets = { - chrome: "49.0.0", - }; - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(false); - }); - - it("returns true if plugin feature is implemented is greater than target", () => { - const plugin = { - chrome: 50, - }; - const targets = { - chrome: "49.0.0", - }; - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(true); - }); - - it("returns when target is a decimal", () => { - const plugin = { - node: 6.9, - }; - const targets = { - node: "6.10.0", - }; - expect(presetEnv.isPluginRequired(targets, plugin)).toBe(false); - }); - - it("throws an error if target version is invalid", () => { - const plugin = { - chrome: 50, - }; - const targets = { - chrome: 55, - }; - expect(() => presetEnv.isPluginRequired(targets, plugin)).toThrow(); - }); -}); From 44f9d85904f589c3a9d05dd605734757ad93b9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 9 Jan 2020 21:16:26 -0500 Subject: [PATCH 929/965] add `allowTopLevelThis` option to `transform-modules-systemjs` (#10780) * feat: expose rewriteThis method * feat: add allowTopLevelThis option to transform-modules-systemjs --- packages/babel-helper-module-transforms/src/index.js | 2 +- .../package.json | 1 + .../src/index.js | 6 +++++- .../fixtures/allow-top-level-this/false/input.mjs | 1 + .../fixtures/allow-top-level-this/false/options.json | 7 +++++++ .../fixtures/allow-top-level-this/false/output.mjs | 11 +++++++++++ .../test/fixtures/allow-top-level-this/true/input.mjs | 1 + .../fixtures/allow-top-level-this/true/options.json | 7 +++++++ .../fixtures/allow-top-level-this/true/output.mjs | 11 +++++++++++ 9 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/input.mjs create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/options.json create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/output.mjs create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/input.mjs create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/options.json create mode 100644 packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/output.mjs diff --git a/packages/babel-helper-module-transforms/src/index.js b/packages/babel-helper-module-transforms/src/index.js index 5735ad951e8d..fdc4359614e7 100644 --- a/packages/babel-helper-module-transforms/src/index.js +++ b/packages/babel-helper-module-transforms/src/index.js @@ -12,7 +12,7 @@ import normalizeAndLoadModuleMetadata, { isSideEffectImport, } from "./normalize-and-load-metadata"; -export { hasExports, isSideEffectImport, isModule }; +export { hasExports, isSideEffectImport, isModule, rewriteThis }; /** * Perform all of the generic ES6 module rewriting needed to handle initial diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index e00b97eec6aa..0ab4deee2d9f 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -10,6 +10,7 @@ "main": "lib/index.js", "dependencies": { "@babel/helper-hoist-variables": "^7.7.4", + "@babel/helper-module-transforms": "^7.7.4", "@babel/helper-plugin-utils": "^7.0.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, diff --git a/packages/babel-plugin-transform-modules-systemjs/src/index.js b/packages/babel-plugin-transform-modules-systemjs/src/index.js index c09a438262bc..fa322f434cc2 100644 --- a/packages/babel-plugin-transform-modules-systemjs/src/index.js +++ b/packages/babel-plugin-transform-modules-systemjs/src/index.js @@ -2,6 +2,7 @@ import { declare } from "@babel/helper-plugin-utils"; import hoistVariables from "@babel/helper-hoist-variables"; import { template, types as t } from "@babel/core"; import { getImportSource } from "babel-plugin-dynamic-import-node/utils"; +import { rewriteThis } from "@babel/helper-module-transforms"; const buildTemplate = template(` SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) { @@ -106,7 +107,7 @@ function constructExportCall( export default declare((api, options) => { api.assertVersion(7); - const { systemGlobal = "System" } = options; + const { systemGlobal = "System", allowTopLevelThis = false } = options; const IGNORE_REASSIGNMENT_SYMBOL = Symbol(); const reassignmentVisitor = { @@ -227,6 +228,9 @@ export default declare((api, options) => { Program: { enter(path, state) { state.contextIdent = path.scope.generateUid("context"); + if (!allowTopLevelThis) { + rewriteThis(path); + } }, exit(path, state) { const undefinedIdent = path.scope.buildUndefinedNode(); diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/input.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/input.mjs new file mode 100644 index 000000000000..91f171590120 --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/input.mjs @@ -0,0 +1 @@ +export var v = this; diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/options.json b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/options.json new file mode 100644 index 000000000000..51c1aaefdc1d --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + ["transform-modules-systemjs", { + "allowTopLevelThis": false + }] + ] +} diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/output.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/output.mjs new file mode 100644 index 000000000000..de6449909d41 --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/false/output.mjs @@ -0,0 +1,11 @@ +System.register([], function (_export, _context) { + "use strict"; + + var v; + return { + setters: [], + execute: function () { + _export("v", v = void 0); + } + }; +}); diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/input.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/input.mjs new file mode 100644 index 000000000000..91f171590120 --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/input.mjs @@ -0,0 +1 @@ +export var v = this; diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/options.json b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/options.json new file mode 100644 index 000000000000..066522d40d09 --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + ["transform-modules-systemjs", { + "allowTopLevelThis": true + }] + ] +} diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/output.mjs b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/output.mjs new file mode 100644 index 000000000000..032cb659bdc2 --- /dev/null +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/allow-top-level-this/true/output.mjs @@ -0,0 +1,11 @@ +System.register([], function (_export, _context) { + "use strict"; + + var v; + return { + setters: [], + execute: function () { + _export("v", v = this); + } + }; +}); From e8dac621de9dba27b47646169562c0a0c2e02c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 9 Jan 2020 21:40:15 -0500 Subject: [PATCH 930/965] chore: specify package type (#10849) --- .../package.json | 1 + .../babel-plugin-codemod-optional-catch-binding/package.json | 1 + eslint/babel-eslint-config-internal/package.json | 1 + eslint/babel-eslint-parser/package.json | 1 + eslint/babel-eslint-plugin-development/package.json | 1 + eslint/babel-eslint-plugin/package.json | 1 + package.json | 1 + packages/babel-cli/package.json | 1 + packages/babel-code-frame/package.json | 1 + packages/babel-core/package.json | 1 + packages/babel-generator/package.json | 1 + packages/babel-helper-annotate-as-pure/package.json | 1 + packages/babel-helper-bindify-decorators/package.json | 1 + .../package.json | 1 + packages/babel-helper-builder-react-jsx/package.json | 1 + packages/babel-helper-call-delegate/package.json | 1 + packages/babel-helper-create-class-features-plugin/package.json | 1 + packages/babel-helper-create-regexp-features-plugin/package.json | 1 + packages/babel-helper-define-map/package.json | 1 + packages/babel-helper-explode-assignable-expression/package.json | 1 + packages/babel-helper-explode-class/package.json | 1 + packages/babel-helper-fixtures/package.json | 1 + packages/babel-helper-function-name/package.json | 1 + packages/babel-helper-get-function-arity/package.json | 1 + packages/babel-helper-hoist-variables/package.json | 1 + .../babel-helper-member-expression-to-functions/package.json | 1 + packages/babel-helper-module-imports/package.json | 1 + packages/babel-helper-module-transforms/package.json | 1 + packages/babel-helper-optimise-call-expression/package.json | 1 + packages/babel-helper-plugin-test-runner/package.json | 1 + packages/babel-helper-plugin-utils/package.json | 1 + packages/babel-helper-regex/package.json | 1 + packages/babel-helper-remap-async-to-generator/package.json | 1 + packages/babel-helper-replace-supers/package.json | 1 + packages/babel-helper-simple-access/package.json | 1 + packages/babel-helper-split-export-declaration/package.json | 1 + packages/babel-helper-transform-fixture-test-runner/package.json | 1 + packages/babel-helper-wrap-function/package.json | 1 + packages/babel-helpers/package.json | 1 + packages/babel-highlight/package.json | 1 + packages/babel-node/package.json | 1 + packages/babel-parser/package.json | 1 + packages/babel-plugin-external-helpers/package.json | 1 + .../babel-plugin-proposal-async-generator-functions/package.json | 1 + packages/babel-plugin-proposal-class-properties/package.json | 1 + packages/babel-plugin-proposal-decorators/package.json | 1 + packages/babel-plugin-proposal-do-expressions/package.json | 1 + packages/babel-plugin-proposal-dynamic-import/package.json | 1 + packages/babel-plugin-proposal-export-default-from/package.json | 1 + .../babel-plugin-proposal-export-namespace-from/package.json | 1 + packages/babel-plugin-proposal-function-bind/package.json | 1 + packages/babel-plugin-proposal-function-sent/package.json | 1 + packages/babel-plugin-proposal-json-strings/package.json | 1 + .../package.json | 1 + .../package.json | 1 + packages/babel-plugin-proposal-numeric-separator/package.json | 1 + packages/babel-plugin-proposal-object-rest-spread/package.json | 1 + .../babel-plugin-proposal-optional-catch-binding/package.json | 1 + packages/babel-plugin-proposal-optional-chaining/package.json | 1 + packages/babel-plugin-proposal-partial-application/package.json | 1 + packages/babel-plugin-proposal-pipeline-operator/package.json | 1 + packages/babel-plugin-proposal-private-methods/package.json | 1 + packages/babel-plugin-proposal-throw-expressions/package.json | 1 + .../babel-plugin-proposal-unicode-property-regex/package.json | 1 + packages/babel-plugin-syntax-async-generators/package.json | 1 + packages/babel-plugin-syntax-bigint/package.json | 1 + packages/babel-plugin-syntax-class-properties/package.json | 1 + packages/babel-plugin-syntax-decorators/package.json | 1 + packages/babel-plugin-syntax-do-expressions/package.json | 1 + packages/babel-plugin-syntax-dynamic-import/package.json | 1 + packages/babel-plugin-syntax-export-default-from/package.json | 1 + packages/babel-plugin-syntax-export-namespace-from/package.json | 1 + packages/babel-plugin-syntax-flow/package.json | 1 + packages/babel-plugin-syntax-function-bind/package.json | 1 + packages/babel-plugin-syntax-function-sent/package.json | 1 + packages/babel-plugin-syntax-import-meta/package.json | 1 + packages/babel-plugin-syntax-json-strings/package.json | 1 + packages/babel-plugin-syntax-jsx/package.json | 1 + .../package.json | 1 + .../babel-plugin-syntax-nullish-coalescing-operator/package.json | 1 + packages/babel-plugin-syntax-numeric-separator/package.json | 1 + packages/babel-plugin-syntax-object-rest-spread/package.json | 1 + packages/babel-plugin-syntax-optional-catch-binding/package.json | 1 + packages/babel-plugin-syntax-optional-chaining/package.json | 1 + packages/babel-plugin-syntax-partial-application/package.json | 1 + packages/babel-plugin-syntax-pipeline-operator/package.json | 1 + packages/babel-plugin-syntax-throw-expressions/package.json | 1 + packages/babel-plugin-syntax-top-level-await/package.json | 1 + packages/babel-plugin-syntax-typescript/package.json | 1 + packages/babel-plugin-transform-arrow-functions/package.json | 1 + packages/babel-plugin-transform-async-to-generator/package.json | 1 + .../babel-plugin-transform-block-scoped-functions/package.json | 1 + packages/babel-plugin-transform-block-scoping/package.json | 1 + packages/babel-plugin-transform-classes/package.json | 1 + packages/babel-plugin-transform-computed-properties/package.json | 1 + packages/babel-plugin-transform-destructuring/package.json | 1 + packages/babel-plugin-transform-dotall-regex/package.json | 1 + packages/babel-plugin-transform-duplicate-keys/package.json | 1 + .../babel-plugin-transform-exponentiation-operator/package.json | 1 + packages/babel-plugin-transform-flow-comments/package.json | 1 + packages/babel-plugin-transform-flow-strip-types/package.json | 1 + packages/babel-plugin-transform-for-of/package.json | 1 + packages/babel-plugin-transform-function-name/package.json | 1 + packages/babel-plugin-transform-instanceof/package.json | 1 + packages/babel-plugin-transform-jscript/package.json | 1 + packages/babel-plugin-transform-literals/package.json | 1 + .../package.json | 1 + packages/babel-plugin-transform-modules-amd/package.json | 1 + packages/babel-plugin-transform-modules-commonjs/package.json | 1 + packages/babel-plugin-transform-modules-systemjs/package.json | 1 + packages/babel-plugin-transform-modules-umd/package.json | 1 + .../package.json | 1 + packages/babel-plugin-transform-new-target/package.json | 1 + packages/babel-plugin-transform-object-assign/package.json | 1 + .../package.json | 1 + packages/babel-plugin-transform-object-super/package.json | 1 + packages/babel-plugin-transform-parameters/package.json | 1 + packages/babel-plugin-transform-property-literals/package.json | 1 + packages/babel-plugin-transform-property-mutators/package.json | 1 + packages/babel-plugin-transform-proto-to-assign/package.json | 1 + .../babel-plugin-transform-react-constant-elements/package.json | 1 + packages/babel-plugin-transform-react-display-name/package.json | 1 + .../babel-plugin-transform-react-inline-elements/package.json | 1 + packages/babel-plugin-transform-react-jsx-compat/package.json | 1 + packages/babel-plugin-transform-react-jsx-self/package.json | 1 + packages/babel-plugin-transform-react-jsx-source/package.json | 1 + packages/babel-plugin-transform-react-jsx/package.json | 1 + packages/babel-plugin-transform-regenerator/package.json | 1 + packages/babel-plugin-transform-reserved-words/package.json | 1 + packages/babel-plugin-transform-runtime/package.json | 1 + .../babel-plugin-transform-shorthand-properties/package.json | 1 + packages/babel-plugin-transform-spread/package.json | 1 + packages/babel-plugin-transform-sticky-regex/package.json | 1 + packages/babel-plugin-transform-strict-mode/package.json | 1 + packages/babel-plugin-transform-template-literals/package.json | 1 + packages/babel-plugin-transform-typeof-symbol/package.json | 1 + packages/babel-plugin-transform-typescript/package.json | 1 + packages/babel-plugin-transform-unicode-regex/package.json | 1 + packages/babel-polyfill/package.json | 1 + packages/babel-preset-env/package.json | 1 + packages/babel-preset-flow/package.json | 1 + packages/babel-preset-react/package.json | 1 + packages/babel-preset-stage-0/package.json | 1 + packages/babel-preset-stage-1/package.json | 1 + packages/babel-preset-stage-2/package.json | 1 + packages/babel-preset-stage-3/package.json | 1 + packages/babel-preset-typescript/package.json | 1 + packages/babel-register/package.json | 1 + packages/babel-runtime-corejs2/package.json | 1 + packages/babel-runtime-corejs3/package.json | 1 + packages/babel-runtime/package.json | 1 + packages/babel-template/package.json | 1 + packages/babel-traverse/package.json | 1 + packages/babel-types/package.json | 1 + 154 files changed, 154 insertions(+) diff --git a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json index e432a89a4486..dd52c287dc8c 100644 --- a/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json +++ b/codemods/babel-plugin-codemod-object-assign-to-object-spread/package.json @@ -4,6 +4,7 @@ "description": "Transforms Object.assign into object spread syntax", "repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/package.json b/codemods/babel-plugin-codemod-optional-catch-binding/package.json index 68196e27c1ba..79538cfa3258 100644 --- a/codemods/babel-plugin-codemod-optional-catch-binding/package.json +++ b/codemods/babel-plugin-codemod-optional-catch-binding/package.json @@ -4,6 +4,7 @@ "description": "Remove unused catch bindings", "repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/eslint/babel-eslint-config-internal/package.json b/eslint/babel-eslint-config-internal/package.json index 37a02b8826ab..ab0dcea69039 100644 --- a/eslint/babel-eslint-config-internal/package.json +++ b/eslint/babel-eslint-config-internal/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "private": true, "repository": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-config-internal", "main": "lib/index.js", diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index b64d7a051af3..c7b4300bec50 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -4,6 +4,7 @@ "description": "ESLint parser that allows for linting of experimental syntax transformed by Babel", "author": "Sebastian McKenzie ", "license": "MIT", + "type": "commonjs", "private": true, "repository": { "type": "git", diff --git a/eslint/babel-eslint-plugin-development/package.json b/eslint/babel-eslint-plugin-development/package.json index 609022429995..cdafc1231c23 100644 --- a/eslint/babel-eslint-plugin-development/package.json +++ b/eslint/babel-eslint-plugin-development/package.json @@ -24,6 +24,7 @@ "access": "public" }, "license": "MIT", + "type": "commonjs", "repository": { "type": "git", "url": "https://github.com/babel/babel.git", diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index 442670ee8ccb..c035493b7c3b 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -17,6 +17,7 @@ ], "author": "Jason Quense @monasticpanic", "license": "MIT", + "type": "commonjs", "private": true, "engines": { "node": ">=10.9" diff --git a/package.json b/package.json index 235975a0ac67..f8910a4d8bf2 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "babel", "private": true, "license": "MIT", + "type": "commonjs", "scripts": { "bootstrap": "make bootstrap", "build": "make build", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 7c5f9748ad57..90b9991c5385 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index 0b753eb11230..6eb8a55443ab 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 09edf1b13e09..e6a5ae1b655a 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -6,6 +6,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index fe63c3de96dc..306fa5d00f9f 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index e28c0bff8aa3..dfde03584b51 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -4,6 +4,7 @@ "description": "Helper function to annotate paths and nodes with #__PURE__ comment", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index 57b88972de02..ca33fa6488d1 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -4,6 +4,7 @@ "description": "Helper function to bindify decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json index d1151c905101..1e27b557d7ad 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -4,6 +4,7 @@ "description": "Helper function to build binary assignment operator visitors", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index aadb3e870390..67d3c00c4bf2 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -4,6 +4,7 @@ "description": "Helper function to build react jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index 7065592a71b8..a9137a0131c7 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -4,6 +4,7 @@ "description": "Helper function to call delegate", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-create-class-features-plugin/package.json b/packages/babel-helper-create-class-features-plugin/package.json index 88e7cf113ce7..fabc6a8102a0 100644 --- a/packages/babel-helper-create-class-features-plugin/package.json +++ b/packages/babel-helper-create-class-features-plugin/package.json @@ -3,6 +3,7 @@ "version": "7.7.4", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", + "type": "commonjs", "description": "Compile class public and private fields, private methods and decorators to ES6", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-create-class-features-plugin", "main": "lib/index.js", diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index 7053e7805c03..694cda7c9e5b 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -3,6 +3,7 @@ "version": "7.7.4", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", + "type": "commonjs", "description": "Compile ESNext Regular Expressions to ES5", "repository": { "type": "git", diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index 954759ed9582..2a43a7344f72 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -4,6 +4,7 @@ "description": "Helper function to define a map", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index 092b7e2ed25a..43c811430033 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -4,6 +4,7 @@ "description": "Helper function to explode an assignable expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index f8458f7a63bd..9d2b1867d448 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -4,6 +4,7 @@ "description": "Helper function to explode class", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index 2f30f7c53d22..6e09ce01bcc8 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -4,6 +4,7 @@ "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index 17c14039a8a8..1d0f2b20930a 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -4,6 +4,7 @@ "description": "Helper function to change the property 'name' of every function", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index 2c6e46bb663e..fb57100f5bf4 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -4,6 +4,7 @@ "description": "Helper function to get function arity", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index 3d5b44afdfb5..e1963d8b3c45 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -4,6 +4,7 @@ "description": "Helper function to hoist variables", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-member-expression-to-functions/package.json b/packages/babel-helper-member-expression-to-functions/package.json index 427ac1719aa5..1fe57249d823 100644 --- a/packages/babel-helper-member-expression-to-functions/package.json +++ b/packages/babel-helper-member-expression-to-functions/package.json @@ -4,6 +4,7 @@ "description": "Helper function to replace certain member expressions with function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index 4388b3afefa8..c2233db1d98f 100644 --- a/packages/babel-helper-module-imports/package.json +++ b/packages/babel-helper-module-imports/package.json @@ -5,6 +5,7 @@ "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 8ec8978cc149..831e46545cc6 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -5,6 +5,7 @@ "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index 4d840e51cfdc..31bf72d0a9a9 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -4,6 +4,7 @@ "description": "Helper function to optimise call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-plugin-test-runner/package.json b/packages/babel-helper-plugin-test-runner/package.json index 9b61aa4c327f..e921e208a386 100644 --- a/packages/babel-helper-plugin-test-runner/package.json +++ b/packages/babel-helper-plugin-test-runner/package.json @@ -4,6 +4,7 @@ "description": "Helper function to support test runner", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-plugin-utils/package.json b/packages/babel-helper-plugin-utils/package.json index b35e4dbd1139..198ed3c13077 100644 --- a/packages/babel-helper-plugin-utils/package.json +++ b/packages/babel-helper-plugin-utils/package.json @@ -5,6 +5,7 @@ "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-regex/package.json b/packages/babel-helper-regex/package.json index 0fdf8c0aee80..808fe8e5e9e9 100644 --- a/packages/babel-helper-regex/package.json +++ b/packages/babel-helper-regex/package.json @@ -4,6 +4,7 @@ "description": "Helper function to check for literal RegEx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-remap-async-to-generator/package.json b/packages/babel-helper-remap-async-to-generator/package.json index d77739260844..3545cdd622b7 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -4,6 +4,7 @@ "description": "Helper function to remap async functions to generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index 6be7468c0e26..f0c01d8514e2 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -4,6 +4,7 @@ "description": "Helper function to replace supers", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index a2f07b051591..8b33edb352fc 100644 --- a/packages/babel-helper-simple-access/package.json +++ b/packages/babel-helper-simple-access/package.json @@ -5,6 +5,7 @@ "author": "Logan Smyth ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json index b5c73e2b1d82..30e26ea2f17d 100644 --- a/packages/babel-helper-split-export-declaration/package.json +++ b/packages/babel-helper-split-export-declaration/package.json @@ -4,6 +4,7 @@ "description": "", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 51522ee32c70..234faf602dd2 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index f347da77b22a..f71836605c20 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -4,6 +4,7 @@ "description": "Helper to wrap functions inside a function call.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 46b496e2e4a4..d89e6c11ff88 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index 66fcb3c2db0f..f78d5c52b4b9 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -5,6 +5,7 @@ "author": "suchipi ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 35a3ed463235..7d244110e9ba 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 95fb3bb736ad..891793614029 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-external-helpers/package.json b/packages/babel-plugin-external-helpers/package.json index bca1c2aa3162..2fea68604714 100644 --- a/packages/babel-plugin-external-helpers/package.json +++ b/packages/babel-plugin-external-helpers/package.json @@ -4,6 +4,7 @@ "description": "This plugin contains helper functions that’ll be placed at the top of the generated code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-async-generator-functions/package.json b/packages/babel-plugin-proposal-async-generator-functions/package.json index fff4bbb5eb32..b653ad495381 100644 --- a/packages/babel-plugin-proposal-async-generator-functions/package.json +++ b/packages/babel-plugin-proposal-async-generator-functions/package.json @@ -4,6 +4,7 @@ "description": "Turn async generator functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-class-properties/package.json b/packages/babel-plugin-proposal-class-properties/package.json index 806cb9b77677..b20fde33ea94 100644 --- a/packages/babel-plugin-proposal-class-properties/package.json +++ b/packages/babel-plugin-proposal-class-properties/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index 260dfcdde5bf..40a54e62a55b 100644 --- a/packages/babel-plugin-proposal-decorators/package.json +++ b/packages/babel-plugin-proposal-decorators/package.json @@ -3,6 +3,7 @@ "version": "7.7.4", "author": "Logan Smyth ", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-do-expressions/package.json b/packages/babel-plugin-proposal-do-expressions/package.json index 25e90b2120b0..e07a2f44f059 100644 --- a/packages/babel-plugin-proposal-do-expressions/package.json +++ b/packages/babel-plugin-proposal-do-expressions/package.json @@ -4,6 +4,7 @@ "description": "Compile do expressions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-do-expressions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-dynamic-import/package.json b/packages/babel-plugin-proposal-dynamic-import/package.json index baf2c7f87520..77cc55dbf944 100644 --- a/packages/babel-plugin-proposal-dynamic-import/package.json +++ b/packages/babel-plugin-proposal-dynamic-import/package.json @@ -4,6 +4,7 @@ "description": "Transform import() expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-export-default-from/package.json b/packages/babel-plugin-proposal-export-default-from/package.json index f1534e5c4912..28968a34d700 100644 --- a/packages/babel-plugin-proposal-export-default-from/package.json +++ b/packages/babel-plugin-proposal-export-default-from/package.json @@ -4,6 +4,7 @@ "description": "Compile export default to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-export-namespace-from/package.json b/packages/babel-plugin-proposal-export-namespace-from/package.json index 62a1e8d95340..7d875e83d8d4 100644 --- a/packages/babel-plugin-proposal-export-namespace-from/package.json +++ b/packages/babel-plugin-proposal-export-namespace-from/package.json @@ -4,6 +4,7 @@ "description": "Compile export namespace to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-namespace-from", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-function-bind/package.json b/packages/babel-plugin-proposal-function-bind/package.json index dbbc3f274edd..bd39b2dcda8b 100644 --- a/packages/babel-plugin-proposal-function-bind/package.json +++ b/packages/babel-plugin-proposal-function-bind/package.json @@ -4,6 +4,7 @@ "description": "Compile function bind operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-bind", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-function-sent/package.json b/packages/babel-plugin-proposal-function-sent/package.json index 91bf98f85e97..23903d43772b 100644 --- a/packages/babel-plugin-proposal-function-sent/package.json +++ b/packages/babel-plugin-proposal-function-sent/package.json @@ -4,6 +4,7 @@ "description": "Compile the function.sent meta property to valid ES2015 code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-sent", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-json-strings/package.json b/packages/babel-plugin-proposal-json-strings/package.json index 90e0d9d7011a..111ff9c3cd48 100644 --- a/packages/babel-plugin-proposal-json-strings/package.json +++ b/packages/babel-plugin-proposal-json-strings/package.json @@ -4,6 +4,7 @@ "description": "Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/package.json b/packages/babel-plugin-proposal-logical-assignment-operators/package.json index a5942961f7ce..2c657e96864e 100644 --- a/packages/babel-plugin-proposal-logical-assignment-operators/package.json +++ b/packages/babel-plugin-proposal-logical-assignment-operators/package.json @@ -4,6 +4,7 @@ "description": "Transforms logical assignment operators into short-circuited assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-logical-assignment-operators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json index 5f17a0642723..eb877ec4de08 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json @@ -4,6 +4,7 @@ "description": "Remove nullish coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-nullish-coalescing-operator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-numeric-separator/package.json b/packages/babel-plugin-proposal-numeric-separator/package.json index deae174debd3..ba2f6ef84189 100644 --- a/packages/babel-plugin-proposal-numeric-separator/package.json +++ b/packages/babel-plugin-proposal-numeric-separator/package.json @@ -4,6 +4,7 @@ "description": "Remove numeric separators from Decimal, Binary, Hex and Octal literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-numeric-separator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index 633a93653ae7..d2b69edd511f 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/package.json +++ b/packages/babel-plugin-proposal-object-rest-spread/package.json @@ -4,6 +4,7 @@ "description": "Compile object rest and spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-optional-catch-binding/package.json b/packages/babel-plugin-proposal-optional-catch-binding/package.json index a25265df7aff..d0ac5095e8d9 100644 --- a/packages/babel-plugin-proposal-optional-catch-binding/package.json +++ b/packages/babel-plugin-proposal-optional-catch-binding/package.json @@ -4,6 +4,7 @@ "description": "Compile optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index 43da0deec0db..1d8cc310eb03 100644 --- a/packages/babel-plugin-proposal-optional-chaining/package.json +++ b/packages/babel-plugin-proposal-optional-chaining/package.json @@ -4,6 +4,7 @@ "description": "Transform optional chaining operators into a series of nil checks", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-partial-application/package.json b/packages/babel-plugin-proposal-partial-application/package.json index 8b1ccefb0859..438794408bae 100644 --- a/packages/babel-plugin-proposal-partial-application/package.json +++ b/packages/babel-plugin-proposal-partial-application/package.json @@ -4,6 +4,7 @@ "description": "Introduces a new ? token in an argument list which allows for partially applying an argument list to a call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-partial-application", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-pipeline-operator/package.json b/packages/babel-plugin-proposal-pipeline-operator/package.json index dd452440432e..1d3659d3f2f0 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/package.json +++ b/packages/babel-plugin-proposal-pipeline-operator/package.json @@ -4,6 +4,7 @@ "description": "Transform pipeline operator into call expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-private-methods/package.json b/packages/babel-plugin-proposal-private-methods/package.json index ef25c513e368..43987665df15 100644 --- a/packages/babel-plugin-proposal-private-methods/package.json +++ b/packages/babel-plugin-proposal-private-methods/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms private class methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-private-methods", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-throw-expressions/package.json b/packages/babel-plugin-proposal-throw-expressions/package.json index 7a649b3ccf7a..1336eb43fd67 100644 --- a/packages/babel-plugin-proposal-throw-expressions/package.json +++ b/packages/babel-plugin-proposal-throw-expressions/package.json @@ -4,6 +4,7 @@ "description": "Wraps Throw Expressions in an IIFE", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-throw-expressions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index ae7f2b4cfa5f..c506443796b1 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -4,6 +4,7 @@ "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-async-generators/package.json b/packages/babel-plugin-syntax-async-generators/package.json index 9bda12487b03..8b73a168a369 100644 --- a/packages/babel-plugin-syntax-async-generators/package.json +++ b/packages/babel-plugin-syntax-async-generators/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of async generator functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-bigint/package.json b/packages/babel-plugin-syntax-bigint/package.json index a2ec1ae96ca9..3f4384496a3c 100644 --- a/packages/babel-plugin-syntax-bigint/package.json +++ b/packages/babel-plugin-syntax-bigint/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of BigInt literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-bigint", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-class-properties/package.json b/packages/babel-plugin-syntax-class-properties/package.json index 2231253bad40..dc3baa374311 100644 --- a/packages/babel-plugin-syntax-class-properties/package.json +++ b/packages/babel-plugin-syntax-class-properties/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of class properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-decorators/package.json b/packages/babel-plugin-syntax-decorators/package.json index 91177eecd70b..118ca5ed56a6 100644 --- a/packages/babel-plugin-syntax-decorators/package.json +++ b/packages/babel-plugin-syntax-decorators/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-do-expressions/package.json b/packages/babel-plugin-syntax-do-expressions/package.json index 2ab86a23d6a7..de21eabceaff 100644 --- a/packages/babel-plugin-syntax-do-expressions/package.json +++ b/packages/babel-plugin-syntax-do-expressions/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of do expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-do-expressions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-dynamic-import/package.json b/packages/babel-plugin-syntax-dynamic-import/package.json index 9f74cc9e7fc9..aa06c10acfca 100644 --- a/packages/babel-plugin-syntax-dynamic-import/package.json +++ b/packages/babel-plugin-syntax-dynamic-import/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of import()", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-export-default-from/package.json b/packages/babel-plugin-syntax-export-default-from/package.json index eca0d9983344..01c143f9c423 100644 --- a/packages/babel-plugin-syntax-export-default-from/package.json +++ b/packages/babel-plugin-syntax-export-default-from/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of export default from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-export-namespace-from/package.json b/packages/babel-plugin-syntax-export-namespace-from/package.json index 81a13ede4603..35997173a08e 100644 --- a/packages/babel-plugin-syntax-export-namespace-from/package.json +++ b/packages/babel-plugin-syntax-export-namespace-from/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of export namespace from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-namespace-from", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-flow/package.json b/packages/babel-plugin-syntax-flow/package.json index 1b7a83c059e4..36984d35cd40 100644 --- a/packages/babel-plugin-syntax-flow/package.json +++ b/packages/babel-plugin-syntax-flow/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the flow syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-function-bind/package.json b/packages/babel-plugin-syntax-function-bind/package.json index 980eec9a5b70..e38f0eae6fac 100644 --- a/packages/babel-plugin-syntax-function-bind/package.json +++ b/packages/babel-plugin-syntax-function-bind/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of function bind", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-bind", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-function-sent/package.json b/packages/babel-plugin-syntax-function-sent/package.json index e01cb2111f14..dfc1760f3f6f 100644 --- a/packages/babel-plugin-syntax-function-sent/package.json +++ b/packages/babel-plugin-syntax-function-sent/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the function.sent meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-sent", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-import-meta/package.json b/packages/babel-plugin-syntax-import-meta/package.json index e2147ed79359..1b63c6a5ea48 100644 --- a/packages/babel-plugin-syntax-import-meta/package.json +++ b/packages/babel-plugin-syntax-import-meta/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of import.meta", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-import-meta", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-json-strings/package.json b/packages/babel-plugin-syntax-json-strings/package.json index 6aa7913d8a1b..7832e25f142b 100644 --- a/packages/babel-plugin-syntax-json-strings/package.json +++ b/packages/babel-plugin-syntax-json-strings/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-jsx/package.json b/packages/babel-plugin-syntax-jsx/package.json index 9bdc4f010b05..c51a4afe27e5 100644 --- a/packages/babel-plugin-syntax-jsx/package.json +++ b/packages/babel-plugin-syntax-jsx/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/package.json b/packages/babel-plugin-syntax-logical-assignment-operators/package.json index f2363a94805b..79cbfed5e1cd 100644 --- a/packages/babel-plugin-syntax-logical-assignment-operators/package.json +++ b/packages/babel-plugin-syntax-logical-assignment-operators/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the logical assignment operators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-logical-assignment-operators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json index 48c06414a9dc..2efdc6e19563 100644 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the nullish-coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-numeric-separator/package.json b/packages/babel-plugin-syntax-numeric-separator/package.json index 6196086522c0..fdaa64bc19db 100644 --- a/packages/babel-plugin-syntax-numeric-separator/package.json +++ b/packages/babel-plugin-syntax-numeric-separator/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of Decimal, Binary, Hex and Octal literals that contain a Numeric Literal Separator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-numeric-separator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-object-rest-spread/package.json b/packages/babel-plugin-syntax-object-rest-spread/package.json index d350831d1050..c4146bda8913 100644 --- a/packages/babel-plugin-syntax-object-rest-spread/package.json +++ b/packages/babel-plugin-syntax-object-rest-spread/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of object rest/spread", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-optional-catch-binding/package.json b/packages/babel-plugin-syntax-optional-catch-binding/package.json index 3811d3081647..2c6c290688d1 100644 --- a/packages/babel-plugin-syntax-optional-catch-binding/package.json +++ b/packages/babel-plugin-syntax-optional-catch-binding/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-optional-chaining/package.json b/packages/babel-plugin-syntax-optional-chaining/package.json index f4c1c17f42d0..d82d56edc478 100644 --- a/packages/babel-plugin-syntax-optional-chaining/package.json +++ b/packages/babel-plugin-syntax-optional-chaining/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of optional properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-partial-application/package.json b/packages/babel-plugin-syntax-partial-application/package.json index f5cb98d4af43..c16bf87311cc 100644 --- a/packages/babel-plugin-syntax-partial-application/package.json +++ b/packages/babel-plugin-syntax-partial-application/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of partial application syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-partial-application", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-pipeline-operator/package.json b/packages/babel-plugin-syntax-pipeline-operator/package.json index e1bb74c7f7a6..3aba8d0e4e11 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/package.json +++ b/packages/babel-plugin-syntax-pipeline-operator/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of the pipeline operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-pipeline-operator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-throw-expressions/package.json b/packages/babel-plugin-syntax-throw-expressions/package.json index 25d83e9a543e..3a98bdf794aa 100644 --- a/packages/babel-plugin-syntax-throw-expressions/package.json +++ b/packages/babel-plugin-syntax-throw-expressions/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of Throw Expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-throw-expressions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-top-level-await/package.json b/packages/babel-plugin-syntax-top-level-await/package.json index a2005f8995a7..68060722d8d5 100644 --- a/packages/babel-plugin-syntax-top-level-await/package.json +++ b/packages/babel-plugin-syntax-top-level-await/package.json @@ -4,6 +4,7 @@ "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", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-syntax-typescript/package.json b/packages/babel-plugin-syntax-typescript/package.json index 817423c55d81..887a819f999e 100644 --- a/packages/babel-plugin-syntax-typescript/package.json +++ b/packages/babel-plugin-syntax-typescript/package.json @@ -4,6 +4,7 @@ "description": "Allow parsing of TypeScript syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-arrow-functions/package.json b/packages/babel-plugin-transform-arrow-functions/package.json index 2edcb84f3cef..70150045f77f 100644 --- a/packages/babel-plugin-transform-arrow-functions/package.json +++ b/packages/babel-plugin-transform-arrow-functions/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 arrow functions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-async-to-generator/package.json b/packages/babel-plugin-transform-async-to-generator/package.json index 0eb48c81b85e..112f750b69fa 100644 --- a/packages/babel-plugin-transform-async-to-generator/package.json +++ b/packages/babel-plugin-transform-async-to-generator/package.json @@ -4,6 +4,7 @@ "description": "Turn async functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-block-scoped-functions/package.json b/packages/babel-plugin-transform-block-scoped-functions/package.json index c52956f9a862..f435fef60dc3 100644 --- a/packages/babel-plugin-transform-block-scoped-functions/package.json +++ b/packages/babel-plugin-transform-block-scoped-functions/package.json @@ -4,6 +4,7 @@ "description": "Babel plugin to ensure function declarations at the block level are block scoped", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index 221bcdba0fc8..bb895e5b3f3b 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-classes/package.json b/packages/babel-plugin-transform-classes/package.json index accd40160c82..6fd532a881e1 100644 --- a/packages/babel-plugin-transform-classes/package.json +++ b/packages/babel-plugin-transform-classes/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 classes to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-computed-properties/package.json b/packages/babel-plugin-transform-computed-properties/package.json index 07c60ccae34c..bf1680e79bfd 100644 --- a/packages/babel-plugin-transform-computed-properties/package.json +++ b/packages/babel-plugin-transform-computed-properties/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 computed properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-destructuring/package.json b/packages/babel-plugin-transform-destructuring/package.json index 46b4da5a92a7..7a442a819c00 100644 --- a/packages/babel-plugin-transform-destructuring/package.json +++ b/packages/babel-plugin-transform-destructuring/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 destructuring to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 6f9033604026..0225f28d168a 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -4,6 +4,7 @@ "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-duplicate-keys/package.json b/packages/babel-plugin-transform-duplicate-keys/package.json index 81511155271d..5d4b2026b7e6 100644 --- a/packages/babel-plugin-transform-duplicate-keys/package.json +++ b/packages/babel-plugin-transform-duplicate-keys/package.json @@ -4,6 +4,7 @@ "description": "Compile objects with duplicate keys to valid strict ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-duplicate-keys", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-exponentiation-operator/package.json b/packages/babel-plugin-transform-exponentiation-operator/package.json index 538bd8355db4..8fb5e21710d9 100644 --- a/packages/babel-plugin-transform-exponentiation-operator/package.json +++ b/packages/babel-plugin-transform-exponentiation-operator/package.json @@ -4,6 +4,7 @@ "description": "Compile exponentiation operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index c8d728525adf..ec05f8149cfd 100644 --- a/packages/babel-plugin-transform-flow-comments/package.json +++ b/packages/babel-plugin-transform-flow-comments/package.json @@ -4,6 +4,7 @@ "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-flow-strip-types/package.json b/packages/babel-plugin-transform-flow-strip-types/package.json index 47810c636b4d..bc430c38d7cb 100644 --- a/packages/babel-plugin-transform-flow-strip-types/package.json +++ b/packages/babel-plugin-transform-flow-strip-types/package.json @@ -4,6 +4,7 @@ "description": "Strip flow type annotations from your output code.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-for-of/package.json b/packages/babel-plugin-transform-for-of/package.json index fee89eaa0d74..6e4794e40540 100644 --- a/packages/babel-plugin-transform-for-of/package.json +++ b/packages/babel-plugin-transform-for-of/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 for...of to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-function-name/package.json b/packages/babel-plugin-transform-function-name/package.json index 1fdf6e7259ab..34e1f16e212a 100644 --- a/packages/babel-plugin-transform-function-name/package.json +++ b/packages/babel-plugin-transform-function-name/package.json @@ -4,6 +4,7 @@ "description": "Apply ES2015 function.name semantics to all functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-instanceof/package.json b/packages/babel-plugin-transform-instanceof/package.json index b6f8e9770235..e0c436402d23 100644 --- a/packages/babel-plugin-transform-instanceof/package.json +++ b/packages/babel-plugin-transform-instanceof/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms all the ES2015 'instanceof' methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-instanceof", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-jscript/package.json b/packages/babel-plugin-transform-jscript/package.json index 635f3f5bfe33..fd5547b91c0e 100644 --- a/packages/babel-plugin-transform-jscript/package.json +++ b/packages/babel-plugin-transform-jscript/package.json @@ -4,6 +4,7 @@ "description": "Babel plugin to fix buggy JScript named function expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-jscript", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-literals/package.json b/packages/babel-plugin-transform-literals/package.json index 0c25a118b762..e9123046fe55 100644 --- a/packages/babel-plugin-transform-literals/package.json +++ b/packages/babel-plugin-transform-literals/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 unicode string and number literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-literals", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-member-expression-literals/package.json b/packages/babel-plugin-transform-member-expression-literals/package.json index 22f042a2a7b4..cca252b888d5 100644 --- a/packages/babel-plugin-transform-member-expression-literals/package.json +++ b/packages/babel-plugin-transform-member-expression-literals/package.json @@ -4,6 +4,7 @@ "description": "Ensure that reserved words are quoted in property accesses", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-member-expression-literals", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-modules-amd/package.json b/packages/babel-plugin-transform-modules-amd/package.json index e0ceb66bcb5e..6cc94d7878ea 100644 --- a/packages/babel-plugin-transform-modules-amd/package.json +++ b/packages/babel-plugin-transform-modules-amd/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms ES2015 modules to AMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index 4b9ae9bff564..33be21373278 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index 0ab4deee2d9f..596c79bcaee1 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms ES2015 modules to SystemJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-modules-umd/package.json b/packages/babel-plugin-transform-modules-umd/package.json index 8ba30be09fa7..94c1bfad4035 100644 --- a/packages/babel-plugin-transform-modules-umd/package.json +++ b/packages/babel-plugin-transform-modules-umd/package.json @@ -4,6 +4,7 @@ "description": "This plugin transforms ES2015 modules to UMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, 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 e861e3695003..f8dec6007df9 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -4,6 +4,7 @@ "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-new-target/package.json b/packages/babel-plugin-transform-new-target/package.json index d92a9bba46cb..2e3ece2bb359 100644 --- a/packages/babel-plugin-transform-new-target/package.json +++ b/packages/babel-plugin-transform-new-target/package.json @@ -4,6 +4,7 @@ "description": "Transforms new.target meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-object-assign/package.json b/packages/babel-plugin-transform-object-assign/package.json index 19032ac21818..e3cafb627a61 100644 --- a/packages/babel-plugin-transform-object-assign/package.json +++ b/packages/babel-plugin-transform-object-assign/package.json @@ -5,6 +5,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-assign", "author": "Jed Watson", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json index a8206199b6d8..e96d9cee38f7 100644 --- a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json +++ b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json @@ -4,6 +4,7 @@ "description": "Turn Object.setPrototypeOf to assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-set-prototype-of-to-assign", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-object-super/package.json b/packages/babel-plugin-transform-object-super/package.json index 9cfaa7d129c4..f9575d759a78 100644 --- a/packages/babel-plugin-transform-object-super/package.json +++ b/packages/babel-plugin-transform-object-super/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 object super to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-parameters/package.json b/packages/babel-plugin-transform-parameters/package.json index 9f350b5277f0..415781c39ce3 100644 --- a/packages/babel-plugin-transform-parameters/package.json +++ b/packages/babel-plugin-transform-parameters/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 default and rest parameters to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-property-literals/package.json b/packages/babel-plugin-transform-property-literals/package.json index b2765963a1a2..7dee396801c8 100644 --- a/packages/babel-plugin-transform-property-literals/package.json +++ b/packages/babel-plugin-transform-property-literals/package.json @@ -4,6 +4,7 @@ "description": "Ensure that reserved words are quoted in object property keys", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-literals", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-property-mutators/package.json b/packages/babel-plugin-transform-property-mutators/package.json index 447459e94a65..f790b51898d7 100644 --- a/packages/babel-plugin-transform-property-mutators/package.json +++ b/packages/babel-plugin-transform-property-mutators/package.json @@ -4,6 +4,7 @@ "description": "Compile ES5 property mutator shorthand syntax to Object.defineProperty", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-mutators", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-proto-to-assign/package.json b/packages/babel-plugin-transform-proto-to-assign/package.json index 9d299ace3cc7..3e2591f75579 100644 --- a/packages/babel-plugin-transform-proto-to-assign/package.json +++ b/packages/babel-plugin-transform-proto-to-assign/package.json @@ -4,6 +4,7 @@ "description": "Babel plugin for turning __proto__ into a shallow property clone", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-proto-to-assign", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index 5db0453a5d35..465b32f9bd9f 100644 --- a/packages/babel-plugin-transform-react-constant-elements/package.json +++ b/packages/babel-plugin-transform-react-constant-elements/package.json @@ -4,6 +4,7 @@ "description": "Treat React JSX elements as value types and hoist them to the highest scope", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-display-name/package.json b/packages/babel-plugin-transform-react-display-name/package.json index 93b5cfad77c4..989f89776aab 100644 --- a/packages/babel-plugin-transform-react-display-name/package.json +++ b/packages/babel-plugin-transform-react-display-name/package.json @@ -4,6 +4,7 @@ "description": "Add displayName to React.createClass calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-inline-elements/package.json b/packages/babel-plugin-transform-react-inline-elements/package.json index d4cf5aadd9ab..ed011f78d7b5 100644 --- a/packages/babel-plugin-transform-react-inline-elements/package.json +++ b/packages/babel-plugin-transform-react-inline-elements/package.json @@ -4,6 +4,7 @@ "description": "Turn JSX elements into exploded React objects", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-jsx-compat/package.json b/packages/babel-plugin-transform-react-jsx-compat/package.json index 5e5d54534d33..cec02c2c9c34 100644 --- a/packages/babel-plugin-transform-react-jsx-compat/package.json +++ b/packages/babel-plugin-transform-react-jsx-compat/package.json @@ -4,6 +4,7 @@ "description": "Turn JSX into React Pre-0.12 function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-compat", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-jsx-self/package.json b/packages/babel-plugin-transform-react-jsx-self/package.json index 798b3f52c8bc..581cdbf66a6e 100644 --- a/packages/babel-plugin-transform-react-jsx-self/package.json +++ b/packages/babel-plugin-transform-react-jsx-self/package.json @@ -4,6 +4,7 @@ "description": "Add a __self prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-jsx-source/package.json b/packages/babel-plugin-transform-react-jsx-source/package.json index 9b9593f73be9..8b0e0dd17605 100644 --- a/packages/babel-plugin-transform-react-jsx-source/package.json +++ b/packages/babel-plugin-transform-react-jsx-source/package.json @@ -4,6 +4,7 @@ "description": "Add a __source prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index f88c40d9c582..393bd98aa61b 100644 --- a/packages/babel-plugin-transform-react-jsx/package.json +++ b/packages/babel-plugin-transform-react-jsx/package.json @@ -4,6 +4,7 @@ "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index b1d2ff187eae..786c675c5a2f 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -10,6 +10,7 @@ "regenerator-transform": "^0.14.0" }, "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-reserved-words/package.json b/packages/babel-plugin-transform-reserved-words/package.json index 4773bb09029b..2fcec4a64709 100644 --- a/packages/babel-plugin-transform-reserved-words/package.json +++ b/packages/babel-plugin-transform-reserved-words/package.json @@ -4,6 +4,7 @@ "description": "Ensure that no reserved words are used.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 4e4123f3cbe3..9e5d72dd9678 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -4,6 +4,7 @@ "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-shorthand-properties/package.json b/packages/babel-plugin-transform-shorthand-properties/package.json index 883951e6a7b8..6358cbe96c0f 100644 --- a/packages/babel-plugin-transform-shorthand-properties/package.json +++ b/packages/babel-plugin-transform-shorthand-properties/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 shorthand properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-spread/package.json b/packages/babel-plugin-transform-spread/package.json index f68feab9e44a..f1084a953e37 100644 --- a/packages/babel-plugin-transform-spread/package.json +++ b/packages/babel-plugin-transform-spread/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-sticky-regex/package.json b/packages/babel-plugin-transform-sticky-regex/package.json index d11aab37675b..9b72f700ccf5 100644 --- a/packages/babel-plugin-transform-sticky-regex/package.json +++ b/packages/babel-plugin-transform-sticky-regex/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 sticky regex to an ES5 RegExp constructor", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-strict-mode/package.json b/packages/babel-plugin-transform-strict-mode/package.json index d846e76d96f9..8cd46bcfb58b 100644 --- a/packages/babel-plugin-transform-strict-mode/package.json +++ b/packages/babel-plugin-transform-strict-mode/package.json @@ -4,6 +4,7 @@ "description": "This plugin places a 'use strict'; directive at the top of all files to enable strict mode", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-template-literals/package.json b/packages/babel-plugin-transform-template-literals/package.json index e57b5b1ae326..a4392760edfc 100644 --- a/packages/babel-plugin-transform-template-literals/package.json +++ b/packages/babel-plugin-transform-template-literals/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 template literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-typeof-symbol/package.json b/packages/babel-plugin-transform-typeof-symbol/package.json index df9e97cd526f..e336f9d4a3f0 100644 --- a/packages/babel-plugin-transform-typeof-symbol/package.json +++ b/packages/babel-plugin-transform-typeof-symbol/package.json @@ -4,6 +4,7 @@ "description": "This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index c58f50f108c3..56b43eb78a2d 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -4,6 +4,7 @@ "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index daaf3701ec24..fd903a966bc4 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -4,6 +4,7 @@ "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index 013e949556e3..6c7727ac3608 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 3b335e702e14..a438ccc320ef 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -5,6 +5,7 @@ "author": "Henry Zhu ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-flow/package.json b/packages/babel-preset-flow/package.json index 500bdad7a86f..187a3e9d0d25 100644 --- a/packages/babel-preset-flow/package.json +++ b/packages/babel-preset-flow/package.json @@ -5,6 +5,7 @@ "author": "James Kyle ", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-flow", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index 0fffaa4ccf6a..f0c1394437b0 100644 --- a/packages/babel-preset-react/package.json +++ b/packages/babel-preset-react/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-stage-0/package.json b/packages/babel-preset-stage-0/package.json index dc2ea43dc886..0ecff050472e 100644 --- a/packages/babel-preset-stage-0/package.json +++ b/packages/babel-preset-stage-0/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-stage-1/package.json b/packages/babel-preset-stage-1/package.json index 377959f83400..65e776b3e94e 100644 --- a/packages/babel-preset-stage-1/package.json +++ b/packages/babel-preset-stage-1/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-stage-2/package.json b/packages/babel-preset-stage-2/package.json index af2594050681..ac6458862919 100644 --- a/packages/babel-preset-stage-2/package.json +++ b/packages/babel-preset-stage-2/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-stage-3/package.json b/packages/babel-preset-stage-3/package.json index 2bb6507112e9..f49fae806ff4 100644 --- a/packages/babel-preset-stage-3/package.json +++ b/packages/babel-preset-stage-3/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index c9d29c06d7ec..cf369a725d48 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -4,6 +4,7 @@ "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 31566ca6a6d3..6d9f68023f11 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -3,6 +3,7 @@ "version": "7.7.7", "description": "babel require hook", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 68dd2cbca9bf..e79006f76f10 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -3,6 +3,7 @@ "version": "7.7.7", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 64bcdb0f1943..5065cce5a117 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -3,6 +3,7 @@ "version": "7.7.7", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index d222ef46544c..d96a7b2a8327 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -3,6 +3,7 @@ "version": "7.7.7", "description": "babel's modular runtime helpers", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index 3be2e36d3413..30dd8b8a57bf 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 662699e7cd78..9e1c2a200fd2 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index f9f6036ac775..33b0b4f81512 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -5,6 +5,7 @@ "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", "license": "MIT", + "type": "commonjs", "publishConfig": { "access": "public" }, From bfc56ebbabf23c689c025f6103b556d8a3737c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2020 15:50:11 +0100 Subject: [PATCH 931/965] Update Test262, Flow and TS parser tests (#10976) * Update Test262, Flow and TS parser tests * Updates --- Makefile | 6 +++--- scripts/parser-tests/flow/index.js | 6 +++++- scripts/parser-tests/flow/whitelist.txt | 10 +++++++--- scripts/parser-tests/typescript/whitelist.txt | 7 +++++++ 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f7806f3af7b8..7a99ee30a162 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9 -TEST262_COMMIT = 157b18d16b5d52501c4d75ac422d3a80bfad1c17 -TYPESCRIPT_COMMIT = 038d95144d8b93c2799d1732181c89c3d84362d5 +FLOW_COMMIT = a1f9a4c709dcebb27a5084acf47755fbae699c25 +TEST262_COMMIT = 28b4fcca4b1b1d278dfe0cc0e69c7d9d59b31aab +TYPESCRIPT_COMMIT = 5fc917be2e4dd64c8e9504d36615cd7fbfdd4cd3 FORCE_PUBLISH = "@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone" diff --git a/scripts/parser-tests/flow/index.js b/scripts/parser-tests/flow/index.js index 9b12bf07053e..1a18471ded03 100644 --- a/scripts/parser-tests/flow/index.js +++ b/scripts/parser-tests/flow/index.js @@ -15,9 +15,11 @@ const flowOptionsMapping = { }; function getPlugins(test) { + const flowOptions = { all: true }; + const plugins = [ "dynamicImport", - ["flow", { all: true }], + ["flow", flowOptions], "flowComments", "jsx", "classProperties", @@ -33,6 +35,8 @@ function getPlugins(test) { if (!enabled) { const idx = plugins.indexOf(flowOptionsMapping[option]); if (idx !== -1) plugins.splice(idx, 1); + } else if (option === "enums") { + flowOptions.enums = true; } else if (!(option in flowOptionsMapping)) { throw new Error("Parser options not mapped " + option); } else if (flowOptionsMapping[option]) { diff --git a/scripts/parser-tests/flow/whitelist.txt b/scripts/parser-tests/flow/whitelist.txt index 668fb625d47d..b2f98acd0b89 100644 --- a/scripts/parser-tests/flow/whitelist.txt +++ b/scripts/parser-tests/flow/whitelist.txt @@ -1,17 +1,21 @@ +ES6/modules/export_default_class_implements.js ES6/modules/migrated_0020.js +JSX/invalid_unpaired_gt.js +JSX/invalid_unpaired_rcurly.js JSX_invalid/migrated_0000.js +arrow_function/object_return_type.js arrow_function_invalid/migrated_0002.js -async_await/migrated_0007.js async_await/migrated_0020.js async_await/migrated_0024.js async_await/migrated_0027.js async_generators/migrated_0007.js +class_expression/anonymous_implements.js class_method_kinds/polymorphic_getter.js class_properties/migrated_0021.js class_properties/migrated_0026.js decorators/migrated_0003.js export_import_reserved_words/migrated_0003.js export_statements/export_trailing_comma.js -nullish_coalescing/precedence_and.js -nullish_coalescing/precedence_or.js +nullish_coalescing/missing-plugin.js +optional_chaining/missing-plugin.js types/member/reserved_words.js diff --git a/scripts/parser-tests/typescript/whitelist.txt b/scripts/parser-tests/typescript/whitelist.txt index c8b5bba49209..a69318cb0174 100644 --- a/scripts/parser-tests/typescript/whitelist.txt +++ b/scripts/parser-tests/typescript/whitelist.txt @@ -30,6 +30,7 @@ ambientWithStatements.ts amdDeclarationEmitNoExtraDeclare.ts amdModuleConstEnumUsage.ts amdModuleName2.ts +anonClassDeclarationEmitIsAnon.ts anyDeclare.ts argumentsBindsToFunctionScopeArgumentList.ts arrayOfExportedClass.ts @@ -58,6 +59,7 @@ augmentedTypesEnum2.ts augmentedTypesFunction.ts augmentedTypesInterface.ts augmentedTypesVar.ts +awaitInClassInAsyncFunction.ts awaitInNonAsyncFunction.ts awaitLiteralValues.ts bigIntWithTargetES3.ts @@ -103,6 +105,7 @@ constDeclarationShadowedByVarDeclaration.ts constDeclarations-invalidContexts.ts constDeclarations-scopes.ts constDeclarations-validContexts.ts +constEnumNoEmitReexport.ts constEnumNoPreserveDeclarationReexport.ts constEnumPreserveEmitReexport.ts constInClassExpression.ts @@ -136,6 +139,7 @@ declarationEmitInterfaceWithNonEntityNameExpressionHeritage.ts declarationEmitPrefersPathKindBasedOnBundling.ts declarationEmitPrefersPathKindBasedOnBundling2.ts declarationEmitPrivateSymbolCausesVarDeclarationEmit2.ts +declarationImportTypeAliasInferredAndEmittable.ts declarationMapsMultifile.ts declarationMapsOutFile.ts declarationsForInferredTypeFromOtherFile.ts @@ -319,6 +323,7 @@ jsFileCompilationExternalPackageError.ts jsNoImplicitAnyNoCascadingReferenceErrors.ts jsdocAccessEnumType.ts jsxAttributeWithoutExpressionReact.tsx +jsxIntrinsicElementsExtendsRecord.tsx letAndVarRedeclaration.ts letAsIdentifier.ts letAsIdentifierInStrictMode.ts @@ -385,6 +390,7 @@ multipleClassPropertyModifiers.ts multipleClassPropertyModifiersErrors.ts multipleInheritance.ts nameCollisions.ts +namespacesWithTypeAliasOnlyExportsMerge.ts narrowedImports.ts newNamesInGlobalAugmentations1.ts noBundledEmitFromNodeModules.ts @@ -414,6 +420,7 @@ parameterPropertyOutsideConstructor.ts parseGenericArrowRatherThanLeftShift.ts pathMappingBasedModuleResolution3_classic.ts pathMappingBasedModuleResolution3_node.ts +preserveUnusedImports.ts privacyCheckExternalModuleExportAssignmentOfGenericClass.ts privacyImportParseErrors.ts privacyTopLevelAmbientExternalModuleImportWithExport.ts From 3dcb8ca99e434f6c2ddd6a0a374a27dd482f8caf Mon Sep 17 00:00:00 2001 From: Siddhant N Trivedi Date: Sat, 11 Jan 2020 00:35:58 +0530 Subject: [PATCH 932/965] Added instructions to fork the repo in order to setup. (#10973) * Added instructions to fork the repo to setup * Capitalized Github and Indented the guidelines [skip ci] --- CONTRIBUTING.md | 46 ++++++++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a33b52621a88..d7bfa3d7a463 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ ----- +---

Setup @@ -12,8 +12,7 @@ Internals

----- - +--- # Contributing @@ -24,13 +23,13 @@ contributing, please read the ## Not sure where to start? - If you aren't just making a documentation change, you'll probably want to learn a bit about a few topics. - - [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://babeljs.io/docs/en/next/babel-parser.html#output). - - Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals - - Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin! - - Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser + - [ASTs](https://en.wikipedia.org/wiki/Abstract_syntax_tree) (Abstract Syntax Tree): The Babel AST [spec](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md) is a bit different from [ESTree](https://github.com/estree/estree). The differences are listed [here](https://babeljs.io/docs/en/next/babel-parser.html#output). + - Check out [`/doc`](https://github.com/babel/babel/tree/master/doc) for information about Babel's internals + - Check out [the Babel Plugin Handbook](https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-plugin-handbook) - core plugins are written the same way as any other plugin! + - Check out [AST Explorer](http://astexplorer.net/#/scUfOmVOG5) to learn more about ASTs or make your own plugin in the browser - When you feel ready to jump into the Babel source code, a good place to start is to look for issues tagged with [help wanted](https://github.com/babel/babel/labels/help%20wanted) and/or [good first issue](https://github.com/babel/babel/labels/good%20first%20issue). - Follow along with what we are working on by joining our [Slack](https://babeljs.slack.com) (you can sign-up [here](https://slack.babeljs.io/) - for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes). + for an invite), following our announcements on [Twitter](https://twitter.com/babeljs), and reading (or participating!) in our [meeting notes](https://github.com/babel/notes). - Check out our [website](http://babeljs.io/) and the [repo](https://github.com/babel/website) - You can contribute by triaging issues which may include reproducing bug reports or asking for vital information, such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to [subscribe to babel on CodeTriage](https://www.codetriage.com/babel/babel). [![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel) @@ -49,8 +48,12 @@ Installation instructions can be found here: https://yarnpkg.com/en/docs/install ### Setup +Fork the `babel` repository to your GitHub Account. + +Then, run: + ```sh -$ git clone https://github.com/babel/babel +$ git clone https://github.com//babel $ cd babel $ make bootstrap ``` @@ -158,12 +161,12 @@ $ ./scripts/test-cov.sh In case you're not able to reproduce an error on CI locally, it may be due to - - Node Version: Travis CI runs the tests against all major node versions. If your tests use JavaScript features unsupported by lower versions of node, then use [minNodeVersion option](#writing-tests) in options.json. - - Timeout: Check the CI log and if the only errors are timeout errors and you are sure that it's not related to the changes you made, ask someone in the slack channel to trigger rebuild on the CI build and it might be resolved +- Node Version: Travis CI runs the tests against all major node versions. If your tests use JavaScript features unsupported by lower versions of node, then use [minNodeVersion option](#writing-tests) in options.json. +- Timeout: Check the CI log and if the only errors are timeout errors and you are sure that it's not related to the changes you made, ask someone in the slack channel to trigger rebuild on the CI build and it might be resolved In case you're locally getting errors which are not on the CI, it may be due to - - Updates in Dependencies: Make sure you run `make bootstrap` before you run `make build` or `make watch` before you run the tests. +- Updates in Dependencies: Make sure you run `make bootstrap` before you run `make build` or `make watch` before you run the tests. ### Writing tests @@ -177,15 +180,16 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/ - There is an `index.js` file. It imports our [test helper](https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner). (You don't have to worry about this). - There can be multiple folders under [`/fixtures`](https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures) - - There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests. - - For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`. - - If necessary, you can have an `options.json` with different options in each subfolder. + + - There is an [`options.json`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/options.json) file whose function is similar to a `.babelrc` file, allowing you to pass in the plugins and settings you need for your tests. + - For this test, we only need the relevant plugin, so it's just `{ "plugins": ["@babel/plugin-transform-exponentiation-operator"] }`. + - If necessary, you can have an `options.json` with different options in each subfolder. - In each subfolder, you can organize your directory structure by categories of tests. (Example: these folders can be named after the feature you are testing or can reference the issue number they fix) - Generally, there are two kinds of tests for plugins -   - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`. - - If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created. - - The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file. +   - The first is a simple test of the input and output produced by running Babel on some code. We do this by creating an [`input.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/input.js) file and an [`output.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/binary/output.js) file. This kind of test only works in sub-subdirectories of `/fixtures`, i.e. `/fixtures/exponentian-operator/binary/input.js` and **not** `/fixtures/exponentian-operator/input.js`. + - If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created. + - The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file. In a fixture test, you simply write out the code you want to transform in `input.js`. @@ -200,6 +204,7 @@ and the expected output after transforming it with your `options.json` in `outpu // output.js Math.pow(2, 2); ``` + In an `exec.js` test, we run or check that the code actually does what it's supposed to do rather than just check the static output. ```js @@ -235,9 +240,9 @@ Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings etc.). To add a test, create a folder under one of these groupings (or create a new one) with a descriptive name, and add the following: -* Create an `input.js` file that contains the code you want the babel parser to parse. +- Create an `input.js` file that contains the code you want the babel parser to parse. -* Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you. +- Add an `output.json` file with the expected parser output. For added convenience, if there is no `output.json` present, the test runner will generate one for you. After writing tests for @babel/parser, just build it by running: @@ -317,6 +322,7 @@ Note that the code shown in Chrome DevTools is compiled code and therefore diffe - Start working about the Babel transform itself! ## Internals + - AST spec ([babel-parser/ast/spec.md](https://github.com/babel/babel/blob/master/packages/babel-parser/ast/spec.md)) - Versioning ([doc/design/versioning.md](https://github.com/babel/babel/blob/master/doc/design/versioning.md)) - Monorepo ([doc/design/monorepo.md](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)) From 4cb214827319738bcf6f54812af1398f1aac44c7 Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Fri, 10 Jan 2020 14:22:39 -0500 Subject: [PATCH 933/965] @babel/eslint-plugin: remove deprecated rules (#10975) --- eslint/babel-eslint-plugin/README.md | 24 +- eslint/babel-eslint-plugin/src/index.js | 29 +- .../src/rules/array-bracket-spacing.js | 45 -- .../src/rules/arrow-parens.js | 30 -- .../src/rules/flow-object-type.js | 33 -- .../src/rules/func-params-comma-dangle.js | 30 -- .../src/rules/generator-star-spacing.js | 42 -- .../src/rules/no-await-in-loop.js | 26 - .../src/rules/object-shorthand.js | 30 -- .../babel-eslint-plugin/src/rules/quotes.js | 14 - .../src/rules/valid-typeof.js | 8 - .../babel-eslint-plugin/test/rules/quotes.js | 481 ------------------ .../test/rules/valid-typeof.js | 256 ---------- 13 files changed, 5 insertions(+), 1043 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/arrow-parens.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/flow-object-type.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/object-shorthand.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/quotes.js delete mode 100644 eslint/babel-eslint-plugin/src/rules/valid-typeof.js delete mode 100644 eslint/babel-eslint-plugin/test/rules/quotes.js delete mode 100644 eslint/babel-eslint-plugin/test/rules/valid-typeof.js diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 1ea757adac1e..2d1e11c45860 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -26,14 +26,12 @@ original ones as well!). ```json { "rules": { - "babel/new-cap": "error", "babel/camelcase": "error", + "babel/new-cap": "error", "babel/no-invalid-this": "error", + "babel/no-unused-expressions": "error", "babel/object-curly-spacing": "error", - "babel/quotes": "error", "babel/semi": "error", - "babel/no-unused-expressions": "error", - "babel/valid-typeof": "error" } } ``` @@ -43,23 +41,9 @@ Each rule corresponds to a core `eslint` rule, and has the same options. 🛠: means it's autofixable with `--fix`. -- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/camelcase: doesn't complain about optional chaining (`var foo = bar?.a_b;`) +- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) - `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) +- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). - `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) -- `babel/quotes`: doesn't complain about JSX fragment shorthand syntax (`<>foo;`) - `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) -- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). -- `babel/valid-typeof`: doesn't complain when used with [BigInt](https://github.com/tc39/proposal-bigint) (`typeof BigInt(9007199254740991) === 'bigint'`). - -#### Deprecated - -| Rule | Notes | -|:---------------------------------|:-----------------------------------| -| `babel/generator-star-spacing` | Use [`generator-star-spacing`](http://eslint.org/docs/rules/generator-star-spacing) since eslint@3.6.0 | -| `babel/object-shorthand` | Use [`object-shorthand`](http://eslint.org/docs/rules/object-shorthand) since eslint@0.20.0 | -| `babel/arrow-parens` | Use [`arrow-parens`](http://eslint.org/docs/rules/arrow-parens) since eslint@3.10.0 | -| `babel/func-params-comma-dangle` | Use [`comma-dangle`](http://eslint.org/docs/rules/comma-dangle) since eslint@3.8.0 | -| `babel/array-bracket-spacing` | Use [`array-bracket-spacing`](http://eslint.org/docs/rules/array-bracket-spacing) since eslint@3.9.0 | -| `babel/flow-object-type` | Use [`flowtype/object-type-delimiter`](https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter) since eslint-plugin-flowtype@2.23.0 | -| `babel/no-await-in-loop` | Use [`no-await-in-loop`](http://eslint.org/docs/rules/no-await-in-loop) since eslint@3.12.0 | diff --git a/eslint/babel-eslint-plugin/src/index.js b/eslint/babel-eslint-plugin/src/index.js index 2e8a37bad182..8b8c0fbf37d7 100644 --- a/eslint/babel-eslint-plugin/src/index.js +++ b/eslint/babel-eslint-plugin/src/index.js @@ -1,52 +1,25 @@ -import arrayBracketSpacing from "./rules/array-bracket-spacing"; -import arrowParens from "./rules/arrow-parens"; -import flowObjectType from "./rules/flow-object-type"; -import funcParamsCommaDangle from "./rules/func-params-comma-dangle"; -import generatorStarSpacing from "./rules/generator-star-spacing"; import newCap from "./rules/new-cap"; import camelcase from "./rules/camelcase"; -import noAwaitInLoop from "./rules/no-await-in-loop"; import noInvalidThis from "./rules/no-invalid-this"; import noUnusedExpressions from "./rules/no-unused-expressions"; import objectCurlySpacing from "./rules/object-curly-spacing"; -import objectShorthand from "./rules/object-shorthand"; -import quotes from "./rules/quotes"; import semi from "./rules/semi"; -import validTypeof from "./rules/valid-typeof"; module.exports = { rules: { - "array-bracket-spacing": arrayBracketSpacing, - "arrow-parens": arrowParens, - "flow-object-type": flowObjectType, - "func-params-comma-dangle": funcParamsCommaDangle, - "generator-star-spacing": generatorStarSpacing, - "new-cap": newCap, camelcase, - "no-await-in-loop": noAwaitInLoop, + "new-cap": newCap, "no-invalid-this": noInvalidThis, "no-unused-expressions": noUnusedExpressions, "object-curly-spacing": objectCurlySpacing, - "object-shorthand": objectShorthand, - quotes, semi, - "valid-typeof": validTypeof, }, rulesConfig: { - "array-bracket-spacing": "off", - "arrow-parens": "off", camelcase: "off", - "flow-object-type": "off", - "func-params-comma-dangle": "off", - "generator-star-spacing": "off", "new-cap": "off", - "no-await-in-loop": "off", "no-invalid-this": "off", "no-unused-expressions": "off", "object-curly-spacing": "off", - "object-shorthand": "off", - quotes: "off", semi: "off", - "valid-typeof": "off", }, }; diff --git a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js b/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js deleted file mode 100644 index b071db8ec8ad..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/array-bracket-spacing.js +++ /dev/null @@ -1,45 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - enum: ["always", "never"], - }, - { - type: "object", - properties: { - singleValue: { - type: "boolean", - }, - objectsInArrays: { - type: "boolean", - }, - arraysInArrays: { - type: "boolean", - }, - }, - additionalProperties: false, - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/array-bracket-spacing rule is deprecated. Please " + - "use the built in array-bracket-spacing rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js b/eslint/babel-eslint-plugin/src/rules/arrow-parens.js deleted file mode 100644 index c5ac81a29045..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/arrow-parens.js +++ /dev/null @@ -1,30 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - enum: ["always", "as-needed"], - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/arrow-parens rule is deprecated. Please " + - "use the built in arrow-parens rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/flow-object-type.js b/eslint/babel-eslint-plugin/src/rules/flow-object-type.js deleted file mode 100644 index 2834b19f11c1..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/flow-object-type.js +++ /dev/null @@ -1,33 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - enum: ["semicolon", "comma"], - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/flow-object-type rule is deprecated. Please " + - "use the flowtype/object-type-delimiter rule instead.\n" + - // eslint-disable-next-line - "Check out https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype-rules-object-type-delimiter", - ); - - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js b/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js deleted file mode 100644 index 00d8006f85e6..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/func-params-comma-dangle.js +++ /dev/null @@ -1,30 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - enum: ["always", "always-multiline", "only-multiline", "never"], - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/func-params-comma-dangle rule is deprecated. Please " + - "use the built in comma-dangle rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js b/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js deleted file mode 100644 index 108c29951326..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/generator-star-spacing.js +++ /dev/null @@ -1,42 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - oneOf: [ - { - enum: ["before", "after", "both", "neither"], - }, - { - type: "object", - properties: { - before: { type: "boolean" }, - after: { type: "boolean" }, - }, - additionalProperties: false, - }, - ], - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/generator-star-spacing rule is deprecated. Please " + - "use the built in generator-star-spacing rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js b/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js deleted file mode 100644 index 05470be35bca..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/no-await-in-loop.js +++ /dev/null @@ -1,26 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/no-await-in-loop rule is deprecated. Please " + - "use the built in no-await-in-loop rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js b/eslint/babel-eslint-plugin/src/rules/object-shorthand.js deleted file mode 100644 index 47b865f1e309..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/object-shorthand.js +++ /dev/null @@ -1,30 +0,0 @@ -let isWarnedForDeprecation = false; - -export default { - meta: { - deprecated: true, - schema: [ - { - enum: ["always", "methods", "properties", "never"], - }, - ], - }, - create() { - return { - Program() { - if ( - isWarnedForDeprecation || - /=-(f|-format)=/.test(process.argv.join("=")) - ) { - return; - } - - console.log( - "The babel/object-shorthand rule is deprecated. Please " + - "use the built in object-shorthand rule instead.", - ); - isWarnedForDeprecation = true; - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/quotes.js b/eslint/babel-eslint-plugin/src/rules/quotes.js deleted file mode 100644 index 5b38352658f3..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/quotes.js +++ /dev/null @@ -1,14 +0,0 @@ -import ruleComposer from "eslint-rule-composer"; -import eslint from "eslint"; - -const quotesRule = new eslint.Linter().getRules().get("quotes"); - -export default ruleComposer.filterReports(quotesRule, problem => { - // Workaround for JSX fragment syntax until - // https://github.com/eslint/eslint/issues/9662 - if (problem.node.parent.type === "JSXFragment") { - return false; - } - - return true; -}); diff --git a/eslint/babel-eslint-plugin/src/rules/valid-typeof.js b/eslint/babel-eslint-plugin/src/rules/valid-typeof.js deleted file mode 100644 index ebdd7a33f1e9..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/valid-typeof.js +++ /dev/null @@ -1,8 +0,0 @@ -import ruleComposer from "eslint-rule-composer"; -import eslint from "eslint"; - -const validTypeOf = new eslint.Linter().getRules().get("valid-typeof"); - -export default ruleComposer.filterReports(validTypeOf, problem => { - return problem.node.value !== "bigint"; -}); diff --git a/eslint/babel-eslint-plugin/test/rules/quotes.js b/eslint/babel-eslint-plugin/test/rules/quotes.js deleted file mode 100644 index 7bd4e7ea34ad..000000000000 --- a/eslint/babel-eslint-plugin/test/rules/quotes.js +++ /dev/null @@ -1,481 +0,0 @@ -import rule from "../../src/rules/quotes"; -import RuleTester from "../helpers/RuleTester"; - -const ruleTester = new RuleTester(); -ruleTester.run("babel/quotes", rule, { - valid: [ - 'var foo = "bar";', - { code: "var foo = 'bar';", options: ["single"] }, - { code: 'var foo = "bar";', options: ["double"] }, - { code: "var foo = 1;", options: ["single"] }, - { code: "var foo = 1;", options: ["double"] }, - { code: 'var foo = "\'";', options: ["single", { avoidEscape: true }] }, - { code: "var foo = '\"';", options: ["double", { avoidEscape: true }] }, - { - code: "var foo =
Hello world
;", - options: ["single"], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - { - code: 'var foo =
;', - options: ["single"], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - { - code: "var foo =
Hello world
;", - options: ["double"], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - { - code: "var foo =
Hello world
;", - options: ["double", { avoidEscape: true }], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - { - code: "var foo = `bar`;", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `bar 'baz'`;", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: 'var foo = `bar "baz"`;', - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { code: "var foo = 1;", options: ["backtick"] }, - { - code: 'var foo = "a string containing `backtick` quotes";', - options: ["backtick", { avoidEscape: true }], - }, - { - code: 'var foo =
;', - options: ["backtick"], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - { - code: "var foo =
Hello world
;", - options: ["backtick"], - parserOptions: { ecmaVersion: 6, ecmaFeatures: { jsx: true } }, - }, - - // Backticks are only okay if they have substitutions, contain a line break, or are tagged - { - code: "var foo = `back\ntick`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back\rtick`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back\u2028tick`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back\u2029tick`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back\\\\\ntick`;", // 2 backslashes followed by a newline - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back\\\\\\\\\ntick`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `\n`;", - options: ["single"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `back${x}tick`;", - options: ["double"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = tag`backtick`;", - options: ["double"], - parserOptions: { ecmaVersion: 6 }, - }, - - // Backticks are also okay if allowTemplateLiterals - { - code: "var foo = `bar 'foo' baz` + 'bar';", - options: ["single", { allowTemplateLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `bar 'foo' baz` + \"bar\";", - options: ["double", { allowTemplateLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var foo = `bar 'foo' baz` + `bar`;", - options: ["backtick", { allowTemplateLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - }, - - // `backtick` should not warn the directive prologues. - { - code: '"use strict"; var foo = `backtick`;', - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: '"use strict"; \'use strong\'; "use asm"; var foo = `backtick`;', - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: - 'function foo() { "use strict"; "use strong"; "use asm"; var foo = `backtick`; }', - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: - "(function() { 'use strict'; 'use strong'; 'use asm'; var foo = `backtick`; })();", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: - '(() => { "use strict"; "use strong"; "use asm"; var foo = `backtick`; })();', - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - - // `backtick` should not warn import/export sources. - { - code: "import \"a\"; import 'b';", - options: ["backtick"], - parserOptions: { sourceType: "module" }, - }, - { - code: "import a from \"a\"; import b from 'b';", - options: ["backtick"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export * from \"a\"; export * from 'b';", - options: ["backtick"], - parserOptions: { sourceType: "module" }, - }, - - // `backtick` should not warn property/method names (not computed). - { - code: "var obj = {\"key0\": 0, 'key1': 1};", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "class Foo { 'bar'(){} }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "class Foo { static ''(){} }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - }, - - // Babel - "<>foo;", - { code: "<>foo;", options: ["single"] }, - { code: "<>foo;", options: ["double"] }, - "<>
;", - { code: "<>
;", options: ["single"] }, - { code: "<>
;", options: ["double"] }, - ], - invalid: [ - { - code: "var foo = 'bar';", - output: 'var foo = "bar";', - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: 'var foo = "bar";', - output: "var foo = 'bar';", - options: ["single"], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }], - }, - { - code: "var foo = `bar`;", - output: "var foo = 'bar';", - options: ["single"], - parserOptions: { - ecmaVersion: 6, - }, - errors: [ - { message: "Strings must use singlequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "var foo = 'don\\'t';", - output: 'var foo = "don\'t";', - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: 'var msg = "Plugin \'" + name + "\' not found"', - output: "var msg = 'Plugin \\'' + name + '\\' not found'", - options: ["single"], - errors: [ - { - message: "Strings must use singlequote.", - type: "Literal", - column: 11, - }, - { - message: "Strings must use singlequote.", - type: "Literal", - column: 31, - }, - ], - }, - { - code: "var foo = 'bar';", - output: 'var foo = "bar";', - options: ["double"], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: "var foo = `bar`;", - output: 'var foo = "bar";', - options: ["double"], - parserOptions: { - ecmaVersion: 6, - }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: 'var foo = "bar";', - output: "var foo = 'bar';", - options: ["single", { avoidEscape: true }], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }], - }, - { - code: "var foo = 'bar';", - output: 'var foo = "bar";', - options: ["double", { avoidEscape: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: "var foo = '\\\\';", - output: 'var foo = "\\\\";', - options: ["double", { avoidEscape: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: 'var foo = "bar";', - output: "var foo = 'bar';", - options: ["single", { allowTemplateLiterals: true }], - errors: [{ message: "Strings must use singlequote.", type: "Literal" }], - }, - { - code: "var foo = 'bar';", - output: 'var foo = "bar";', - options: ["double", { allowTemplateLiterals: true }], - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: "var foo = 'bar';", - output: "var foo = `bar`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: "var foo = 'b${x}a$r';", - output: "var foo = `b\\${x}a$r`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: 'var foo = "bar";', - output: "var foo = `bar`;", - options: ["backtick"], - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: 'var foo = "bar";', - output: "var foo = `bar`;", - options: ["backtick", { avoidEscape: true }], - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: "var foo = 'bar';", - output: "var foo = `bar`;", - options: ["backtick", { avoidEscape: true }], - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - - // "use strict" is *not* a directive prologue in these statements so is subject to the rule - { - code: 'var foo = `backtick`; "use strict";', - output: "var foo = `backtick`; `use strict`;", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: '{ "use strict"; var foo = `backtick`; }', - output: "{ `use strict`; var foo = `backtick`; }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - { - code: 'if (1) { "use strict"; var foo = `backtick`; }', - output: "if (1) { `use strict`; var foo = `backtick`; }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - - // `backtick` should warn computed property names. - { - code: "var obj = {[\"key0\"]: 0, ['key1']: 1};", - output: "var obj = {[`key0`]: 0, [`key1`]: 1};", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use backtick.", type: "Literal" }, - { message: "Strings must use backtick.", type: "Literal" }, - ], - }, - { - code: "class Foo { ['a'](){} static ['b'](){} }", - output: "class Foo { [`a`](){} static [`b`](){} }", - options: ["backtick"], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use backtick.", type: "Literal" }, - { message: "Strings must use backtick.", type: "Literal" }, - ], - }, - - // https://github.com/eslint/eslint/issues/7084 - { - code: '
', - output: "
", - options: ["single"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [{ message: "Strings must use singlequote.", type: "Literal" }], - }, - { - code: "
", - output: '
', - options: ["double"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [{ message: "Strings must use doublequote.", type: "Literal" }], - }, - { - code: "
", - output: "
", - options: ["backtick"], - parserOptions: { ecmaFeatures: { jsx: true } }, - errors: [{ message: "Strings must use backtick.", type: "Literal" }], - }, - - // https://github.com/eslint/eslint/issues/7610 - { - code: "`use strict`;", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "function foo() { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "foo = function() { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "() => { `use strict`; foo(); }", - output: null, - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "() => { foo(); `use strict`; }", - output: '() => { foo(); "use strict"; }', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "foo(); `use strict`;", - output: 'foo(); "use strict";', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - - // https://github.com/eslint/eslint/issues/7646 - { - code: "var foo = `foo\\nbar`;", - output: 'var foo = "foo\\nbar";', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "var foo = `foo\\\nbar`;", // 1 backslash followed by a newline - output: 'var foo = "foo\\\nbar";', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "var foo = `foo\\\\\\\nbar`;", // 3 backslashes followed by a newline - output: 'var foo = "foo\\\\\\\nbar";', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { message: "Strings must use doublequote.", type: "TemplateLiteral" }, - ], - }, - { - code: "````", - output: '""``', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Strings must use doublequote.", - type: "TemplateLiteral", - line: 1, - column: 1, - }, - ], - }, - ], -}); diff --git a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js b/eslint/babel-eslint-plugin/test/rules/valid-typeof.js deleted file mode 100644 index ee23bd5291ce..000000000000 --- a/eslint/babel-eslint-plugin/test/rules/valid-typeof.js +++ /dev/null @@ -1,256 +0,0 @@ -/** - * @fileoverview Ensures that the results of typeof are compared against a valid string - * @author Ian Christian Myers - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -import rule from "../../src/rules/valid-typeof"; -import RuleTester from "../helpers/RuleTester"; - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -const ruleTester = new RuleTester(); - -ruleTester.run("valid-typeof", rule, { - valid: [ - // Original test cases. - "typeof foo === 'string'", - "typeof foo === 'object'", - "typeof foo === 'function'", - "typeof foo === 'undefined'", - "typeof foo === 'boolean'", - "typeof foo === 'number'", - "'string' === typeof foo", - "'object' === typeof foo", - "'function' === typeof foo", - "'undefined' === typeof foo", - "'boolean' === typeof foo", - "'number' === typeof foo", - "typeof foo === typeof bar", - "typeof foo === baz", - "typeof foo !== someType", - "typeof bar != someType", - "someType === typeof bar", - "someType == typeof bar", - "typeof foo == 'string'", - "typeof(foo) === 'string'", - "typeof(foo) !== 'string'", - "typeof(foo) == 'string'", - "typeof(foo) != 'string'", - "var oddUse = typeof foo + 'thing'", - { - code: "typeof foo === 'number'", - options: [{ requireStringLiterals: true }], - }, - { - code: 'typeof foo === "number"', - options: [{ requireStringLiterals: true }], - }, - { - code: "var baz = typeof foo + 'thing'", - options: [{ requireStringLiterals: true }], - }, - { - code: "typeof foo === typeof bar", - options: [{ requireStringLiterals: true }], - }, - { - code: "typeof foo === `string`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "`object` === typeof foo", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "typeof foo === `str${somethingElse}`", - parserOptions: { ecmaVersion: 6 }, - }, - - // Babel-specific test cases. - { - code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", - }, - { - code: "'bigint' === typeof BigInt(Number.MAX_SAFE_INTEGER)", - }, - { - code: "typeof BigInt(Number.MAX_SAFE_INTEGER) === 'bigint'", - options: [{ requireStringLiterals: true }], - }, - ], - invalid: [ - { - code: "typeof foo === 'strnig'", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "'strnig' === typeof foo", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "if (typeof bar === 'umdefined') {}", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "typeof foo !== 'strnig'", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "'strnig' !== typeof foo", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "if (typeof bar !== 'umdefined') {}", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "typeof foo != 'strnig'", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "'strnig' != typeof foo", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "if (typeof bar != 'umdefined') {}", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "typeof foo == 'strnig'", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "'strnig' == typeof foo", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "if (typeof bar == 'umdefined') {}", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "if (typeof bar === `umdefined`) {}", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Invalid typeof comparison value.", - type: "TemplateLiteral", - }, - ], - }, - { - code: "typeof foo == 'invalid string'", - options: [{ requireStringLiterals: true }], - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "typeof foo == Object", - options: [{ requireStringLiterals: true }], - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "Identifier", - }, - ], - }, - { - code: "typeof foo === undefined", - options: [{ requireStringLiterals: true }], - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "Identifier", - }, - ], - }, - { - code: "undefined === typeof foo", - options: [{ requireStringLiterals: true }], - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "Identifier", - }, - ], - }, - { - code: "undefined == typeof foo", - options: [{ requireStringLiterals: true }], - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "Identifier", - }, - ], - }, - { - code: "typeof foo === `undefined${foo}`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "TemplateLiteral", - }, - ], - }, - { - code: "typeof foo === `${string}`", - options: [{ requireStringLiterals: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Typeof comparisons should be to string literals.", - type: "TemplateLiteral", - }, - ], - }, - - // Babel-specific test cases. - { - code: "typeof foo === 'bgiint'", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - { - code: "'bignit' === typeof foo", - errors: [ - { message: "Invalid typeof comparison value.", type: "Literal" }, - ], - }, - ], -}); From 80aa7dc3c6972c0b107dd8b4ed88663141cf8583 Mon Sep 17 00:00:00 2001 From: James Beavers Date: Fri, 10 Jan 2020 16:07:43 -0500 Subject: [PATCH 934/965] Add optional-chaining and nullish-coalescing to preset-env (#10811) * Add support for optional-chaining (stage 4) in present-env * revert babel-preset-env built-in-modules.json * add shipped proposal syntax map entry, optional chaining * update remaining syntax plugin references, proposal description * Add support for nullish coalescing operator in preset-env * selectively enable sort-keys rule * enforce sort-keys on shipped-proposals * don't use Object.entries() * Update fixtures --- .eslintignore | 2 +- .../data/built-in-modules.json | 4 +- .../data/native-modules.json | 4 +- packages/babel-compat-data/data/plugins.json | 9 ++ .../scripts/data/plugin-features.js | 132 +++++++++--------- .../babel-preset-env-standalone/package.json | 4 + .../src/available-plugins.js | 10 ++ .../data/shipped-proposals.js | 26 ++-- packages/babel-preset-env/package.json | 4 + .../babel-preset-env/src/available-plugins.js | 30 ++-- .../stdout.txt | 2 + .../stdout.txt | 2 + .../debug/browserslists-android-3/stdout.txt | 2 + .../browserslists-defaults-not-ie/stdout.txt | 2 + .../debug/browserslists-defaults/stdout.txt | 2 + .../stdout.txt | 2 + .../corejs-without-usebuiltins/stdout.txt | 2 + .../debug/entry-corejs2-android/stdout.txt | 2 + .../debug/entry-corejs2-electron/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-corejs2-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-corejs2-proposals/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs2-shippedProposals/stdout.txt | 2 + .../entry-corejs2-specific-targets/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs2-versions-strings/stdout.txt | 2 + .../fixtures/debug/entry-corejs2/stdout.txt | 2 + .../entry-corejs3-all-chrome-71/stdout.txt | 2 + .../debug/entry-corejs3-all/stdout.txt | 2 + .../debug/entry-corejs3-android/stdout.txt | 2 + .../entry-corejs3-babel-polyfill/stdout.txt | 2 + .../debug/entry-corejs3-electron/stdout.txt | 2 + .../entry-corejs3-es-chrome-71/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-es-proposals/stdout.txt | 2 + .../debug/entry-corejs3-es/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-corejs3-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-corejs3-proposals/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-runtime-only/stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-specific-entries/stdout.txt | 2 + .../entry-corejs3-specific-targets/stdout.txt | 2 + .../entry-corejs3-stable-chrome-71/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-corejs3-stable/stdout.txt | 2 + .../entry-corejs3-stage-chrome-71/stdout.txt | 2 + .../debug/entry-corejs3-stage/stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../entry-corejs3-versions-strings/stdout.txt | 2 + .../entry-corejs3-web-chrome-71/stdout.txt | 2 + .../debug/entry-corejs3-web/stdout.txt | 2 + .../fixtures/debug/entry-corejs3/stdout.txt | 2 + .../entry-no-corejs-no-import/stdout.txt | 2 + .../stdout.txt | 2 + .../debug/entry-no-corejs-uglify/stdout.txt | 2 + .../fixtures/debug/entry-no-corejs/stdout.txt | 2 + .../fixtures/debug/plugins-only/stdout.txt | 2 + .../fixtures/debug/usage-corejs2-1/stdout.txt | 2 + .../fixtures/debug/usage-corejs2-2/stdout.txt | 2 + .../usage-corejs2-chrome-71-1/stdout.txt | 2 + .../usage-corejs2-chrome-71-2/stdout.txt | 2 + .../debug/usage-corejs2-none-1/stdout.txt | 2 + .../debug/usage-corejs2-none-2/stdout.txt | 2 + .../usage-corejs2-proposals-1/stdout.txt | 2 + .../usage-corejs2-proposals-2/stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../usage-corejs2-with-import/stdout.txt | 2 + .../fixtures/debug/usage-corejs3-1/stdout.txt | 2 + .../fixtures/debug/usage-corejs3-2/stdout.txt | 2 + .../usage-corejs3-chrome-71-1/stdout.txt | 2 + .../usage-corejs3-chrome-71-2/stdout.txt | 2 + .../debug/usage-corejs3-none-1/stdout.txt | 2 + .../debug/usage-corejs3-none-2/stdout.txt | 2 + .../usage-corejs3-proposals-1/stdout.txt | 2 + .../usage-corejs3-proposals-2/stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../stdout.txt | 2 + .../usage-corejs3-with-import/stdout.txt | 2 + .../debug/usage-no-corejs-1/stdout.txt | 2 + .../debug/usage-no-corejs-2/stdout.txt | 2 + .../debug/usage-no-corejs-none-1/stdout.txt | 2 + .../debug/usage-no-corejs-none-2/stdout.txt | 2 + .../safari-10_3-block-scoped/stdout.txt | 2 + 99 files changed, 315 insertions(+), 88 deletions(-) diff --git a/.eslintignore b/.eslintignore index 4f633742561e..a94d6e6b5aff 100644 --- a/.eslintignore +++ b/.eslintignore @@ -17,7 +17,7 @@ codemods/*/lib codemods/*/dist codemods/*/test/fixtures codemods/*/test/tmp -packages/babel-preset-env/data +packages/babel-preset-env/data/[^(plugin-features|shipped-proposals).js] packages/babel-preset-env/test/debug-fixtures packages/babel-preset-env-standalone/babel-preset-env.js packages/babel-preset-env-standalone/babel-preset-env.min.js diff --git a/packages/babel-compat-data/data/built-in-modules.json b/packages/babel-compat-data/data/built-in-modules.json index 7e33f27eb290..5bada5f51b38 100644 --- a/packages/babel-compat-data/data/built-in-modules.json +++ b/packages/babel-compat-data/data/built-in-modules.json @@ -6,7 +6,7 @@ "safari": "10.1", "opera": "48", "ios_saf": "10.3", - "and_chr": "74", - "and_ff": "66" + "and_chr": "71", + "and_ff": "64" } } diff --git a/packages/babel-compat-data/data/native-modules.json b/packages/babel-compat-data/data/native-modules.json index 5bada5f51b38..7e33f27eb290 100644 --- a/packages/babel-compat-data/data/native-modules.json +++ b/packages/babel-compat-data/data/native-modules.json @@ -6,7 +6,7 @@ "safari": "10.1", "opera": "48", "ios_saf": "10.3", - "and_chr": "71", - "and_ff": "64" + "and_chr": "74", + "and_ff": "66" } } diff --git a/packages/babel-compat-data/data/plugins.json b/packages/babel-compat-data/data/plugins.json index f4a5771b01c3..cc4902eaa9c0 100644 --- a/packages/babel-compat-data/data/plugins.json +++ b/packages/babel-compat-data/data/plugins.json @@ -299,6 +299,10 @@ "opera": "53", "electron": "3.1" }, + "proposal-optional-chaining": { + "chrome": "80", + "opera": "67" + }, "transform-named-capturing-groups-regex": { "chrome": "64", "safari": "11.1", @@ -349,5 +353,10 @@ "phantom": "2", "samsung": "2.1", "electron": "0.2" + }, + "proposal-nullish-coalescing-operator": { + "chrome": "80", + "firefox": "72", + "opera": "67" } } diff --git a/packages/babel-compat-data/scripts/data/plugin-features.js b/packages/babel-compat-data/scripts/data/plugin-features.js index df9a0f174dd4..e0f20c7d1acf 100644 --- a/packages/babel-compat-data/scripts/data/plugin-features.js +++ b/packages/babel-compat-data/scripts/data/plugin-features.js @@ -1,42 +1,36 @@ +/* eslint sort-keys: "error" */ + module.exports = { - "transform-template-literals": { - features: ["template literals"], - }, - "transform-literals": { - features: ["Unicode code point escapes"], - }, - "transform-function-name": { - features: ['function "name" property'], - }, + "proposal-async-generator-functions": "Asynchronous Iterators", + "proposal-json-strings": "JSON superset", + "proposal-nullish-coalescing-operator": "nullish coalescing operator (??)", + "proposal-object-rest-spread": "object rest/spread properties", + "proposal-optional-catch-binding": "optional catch binding", + "proposal-optional-chaining": "optional chaining operator (?.)", + "proposal-unicode-property-regex": "RegExp Unicode Property Escapes", + "transform-arrow-functions": { features: ["arrow functions"], }, + + "transform-async-to-generator": { + features: ["async functions"], + }, + "transform-block-scoped-functions": { features: ["block-level function declaration"], }, + "transform-block-scoping": { + features: ["const", "let"], + }, "transform-classes": { features: ["class", "super"], }, - "transform-object-super": { - features: ["super"], - }, - "transform-shorthand-properties": { - features: ["object literal extensions / shorthand properties"], - }, - "transform-duplicate-keys": { - features: ["miscellaneous / duplicate property names in strict mode"], - }, "transform-computed-properties": { features: ["object literal extensions / computed properties"], }, - "transform-for-of": { - features: ["for..of loops"], - }, - "transform-sticky-regex": { - features: [ - 'RegExp "y" and "u" flags / "y" flag, lastIndex', - 'RegExp "y" and "u" flags / "y" flag', - ], + "transform-destructuring": { + features: ["destructuring, assignment", "destructuring, declarations"], }, // We want to apply this prior to unicode regex so that "." and "u" @@ -45,17 +39,29 @@ module.exports = { // Ref: https://github.com/babel/babel/pull/7065#issuecomment-395959112 "transform-dotall-regex": "s (dotAll) flag for regular expressions", - "transform-unicode-regex": { - features: [ - 'RegExp "y" and "u" flags / "u" flag, case folding', - 'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes', - 'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters', - 'RegExp "y" and "u" flags / "u" flag', - ], + "transform-duplicate-keys": { + features: ["miscellaneous / duplicate property names in strict mode"], }, - - "transform-spread": { - features: "spread syntax for iterable objects", + "transform-exponentiation-operator": { + features: ["exponentiation (**) operator"], + }, + "transform-for-of": { + features: ["for..of loops"], + }, + "transform-function-name": { + features: ['function "name" property'], + }, + "transform-literals": { + features: ["Unicode code point escapes"], + }, + "transform-member-expression-literals": + "Object/array literal extensions / Reserved words as property names", + "transform-named-capturing-groups-regex": "RegExp named capture groups", + "transform-new-target": { + features: ["new.target"], + }, + "transform-object-super": { + features: ["super"], }, "transform-parameters": { features: [ @@ -64,40 +70,36 @@ module.exports = { "destructuring, parameters / defaults, arrow function", ], }, - "transform-destructuring": { - features: ["destructuring, assignment", "destructuring, declarations"], + "transform-property-literals": + "Object/array literal extensions / Reserved words as property names", + "transform-regenerator": { + features: ["generators"], }, - "transform-block-scoping": { - features: ["const", "let"], + "transform-reserved-words": "Miscellaneous / Unreserved words", + "transform-shorthand-properties": { + features: ["object literal extensions / shorthand properties"], }, - "transform-typeof-symbol": { - features: ["Symbol / typeof support"], + "transform-spread": { + features: "spread syntax for iterable objects", }, - "transform-new-target": { - features: ["new.target"], + "transform-sticky-regex": { + features: [ + 'RegExp "y" and "u" flags / "y" flag, lastIndex', + 'RegExp "y" and "u" flags / "y" flag', + ], }, - "transform-regenerator": { - features: ["generators"], + "transform-template-literals": { + features: ["template literals"], }, - - "transform-exponentiation-operator": { - features: ["exponentiation (**) operator"], + "transform-typeof-symbol": { + features: ["Symbol / typeof support"], }, - - "transform-async-to-generator": { - features: ["async functions"], + "transform-unicode-regex": { + features: [ + 'RegExp "y" and "u" flags / "u" flag, case folding', + 'RegExp "y" and "u" flags / "u" flag, Unicode code point escapes', + 'RegExp "y" and "u" flags / "u" flag, non-BMP Unicode characters', + 'RegExp "y" and "u" flags / "u" flag', + ], }, - - "proposal-async-generator-functions": "Asynchronous Iterators", - "proposal-object-rest-spread": "object rest/spread properties", - "proposal-unicode-property-regex": "RegExp Unicode Property Escapes", - - "proposal-json-strings": "JSON superset", - "proposal-optional-catch-binding": "optional catch binding", - "transform-named-capturing-groups-regex": "RegExp named capture groups", - "transform-member-expression-literals": - "Object/array literal extensions / Reserved words as property names", - "transform-property-literals": - "Object/array literal extensions / Reserved words as property names", - "transform-reserved-words": "Miscellaneous / Unreserved words", }; diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 0fb979b081fd..264a2f579bb8 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -13,7 +13,11 @@ "devDependencies": { "@babel/plugin-proposal-dynamic-import": "^7.7.4", "@babel/plugin-proposal-json-strings": "^7.7.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", + "@babel/plugin-proposal-optional-chaining": "^7.7.4", "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4", + "@babel/plugin-syntax-optional-chaining": "^7.7.4", "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", diff --git a/packages/babel-preset-env-standalone/src/available-plugins.js b/packages/babel-preset-env-standalone/src/available-plugins.js index 4262018f7c98..bb66ed7777ec 100644 --- a/packages/babel-preset-env-standalone/src/available-plugins.js +++ b/packages/babel-preset-env-standalone/src/available-plugins.js @@ -1,7 +1,13 @@ +/* eslint sort-keys: "error" */ + import { availablePlugins, registerPlugin } from "@babel/standalone"; import proposalJsonStrings from "@babel/plugin-proposal-json-strings"; import proposalDynamicImport from "@babel/plugin-proposal-dynamic-import"; +import proposalNullishCoalescingOperator from "@babel/plugin-proposal-nullish-coalescing-operator"; +import proposalOptionalChaining from "@babel/plugin-proposal-optional-chaining"; import syntaxJsonStrings from "@babel/plugin-syntax-json-strings"; +import syntaxNullishCoalescingOperator from "@babel/plugin-syntax-nullish-coalescing-operator"; +import syntaxOptionalChaining from "@babel/plugin-syntax-nullish-coalescing-operator"; import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await"; import transformNamedCapturingGroupsRegex from "@babel/plugin-transform-named-capturing-groups-regex"; import transformNewTarget from "@babel/plugin-transform-new-target"; @@ -9,7 +15,11 @@ import transformNewTarget from "@babel/plugin-transform-new-target"; const notIncludedPlugins = { "proposal-dynamic-import": proposalDynamicImport, "proposal-json-strings": proposalJsonStrings, + "proposal-nullish-coalescing-operator": proposalNullishCoalescingOperator, + "proposal-optional-chaining": proposalOptionalChaining, "syntax-json-strings": syntaxJsonStrings, + "syntax-nullish-coalescing-operator": syntaxNullishCoalescingOperator, + "syntax-optional-chaining": syntaxOptionalChaining, "syntax-top-level-await": syntaxTopLevelAwait, "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex, "transform-new-target": transformNewTarget, diff --git a/packages/babel-preset-env/data/shipped-proposals.js b/packages/babel-preset-env/data/shipped-proposals.js index 90864b6c94b6..c2dff4cb96ec 100644 --- a/packages/babel-preset-env/data/shipped-proposals.js +++ b/packages/babel-preset-env/data/shipped-proposals.js @@ -1,14 +1,24 @@ +/* eslint sort-keys: "error" */ // These mappings represent the syntax proposals that have been // shipped by browsers, and are enabled by the `shippedProposals` option. const proposalPlugins = {}; -const pluginSyntaxMap = new Map([ - ["proposal-async-generator-functions", "syntax-async-generators"], - ["proposal-object-rest-spread", "syntax-object-rest-spread"], - ["proposal-optional-catch-binding", "syntax-optional-catch-binding"], - ["proposal-unicode-property-regex", null], - ["proposal-json-strings", "syntax-json-strings"], -]); +// use intermediary object to enforce alphabetical key order +const pluginSyntaxObject = { + "proposal-async-generator-functions": "syntax-async-generators", + "proposal-json-strings": "syntax-json-strings", + "proposal-nullish-coalescing-operator": "syntax-nullish-coalescing-operator", + "proposal-object-rest-spread": "syntax-object-rest-spread", + "proposal-optional-catch-binding": "syntax-optional-catch-binding", + "proposal-optional-chaining": "syntax-optional-chaining", + "proposal-unicode-property-regex": null, +}; -module.exports = { proposalPlugins, pluginSyntaxMap }; +const pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) { + return [key, pluginSyntaxObject[key]]; +}); + +const pluginSyntaxMap = new Map(pluginSyntaxEntries); + +module.exports = { pluginSyntaxMap, proposalPlugins }; diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index a438ccc320ef..5cc8426ebcf1 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -20,13 +20,17 @@ "@babel/plugin-proposal-dynamic-import": "^7.7.4", "@babel/plugin-proposal-json-strings": "^7.7.4", "@babel/plugin-proposal-object-rest-spread": "^7.7.7", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", + "@babel/plugin-proposal-optional-chaining": "^7.7.5", "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", "@babel/plugin-syntax-async-generators": "^7.7.4", "@babel/plugin-syntax-dynamic-import": "^7.7.4", "@babel/plugin-syntax-json-strings": "^7.7.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4", "@babel/plugin-syntax-object-rest-spread": "^7.7.4", "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", + "@babel/plugin-syntax-optional-chaining": "^7.7.4", "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-transform-arrow-functions": "^7.7.4", "@babel/plugin-transform-async-to-generator": "^7.7.4", diff --git a/packages/babel-preset-env/src/available-plugins.js b/packages/babel-preset-env/src/available-plugins.js index ad66e3275b4b..d9a2a3da9608 100644 --- a/packages/babel-preset-env/src/available-plugins.js +++ b/packages/babel-preset-env/src/available-plugins.js @@ -1,15 +1,21 @@ // @flow +/* eslint sort-keys: "error" */ + import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators"; import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import"; import syntaxJsonStrings from "@babel/plugin-syntax-json-strings"; +import syntaxNullishCoalescingOperator from "@babel/plugin-syntax-nullish-coalescing-operator"; import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread"; import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding"; +import syntaxOptionalChaining from "@babel/plugin-syntax-optional-chaining"; import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await"; import proposalAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions"; import proposalDynamicImport from "@babel/plugin-proposal-dynamic-import"; import proposalJsonStrings from "@babel/plugin-proposal-json-strings"; +import proposalNullishCoalescingOperator from "@babel/plugin-proposal-nullish-coalescing-operator"; import proposalObjectRestSpread from "@babel/plugin-proposal-object-rest-spread"; import proposalOptionalCatchBinding from "@babel/plugin-proposal-optional-catch-binding"; +import proposalOptionalChaining from "@babel/plugin-proposal-optional-chaining"; import proposalUnicodePropertyRegex from "@babel/plugin-proposal-unicode-property-regex"; import transformAsyncToGenerator from "@babel/plugin-transform-async-to-generator"; import transformArrowFunctions from "@babel/plugin-transform-arrow-functions"; @@ -44,17 +50,24 @@ import transformTypeofSymbol from "@babel/plugin-transform-typeof-symbol"; import transformUnicodeRegex from "@babel/plugin-transform-unicode-regex"; export default { + "proposal-async-generator-functions": proposalAsyncGeneratorFunctions, + "proposal-dynamic-import": proposalDynamicImport, + "proposal-json-strings": proposalJsonStrings, + "proposal-nullish-coalescing-operator": proposalNullishCoalescingOperator, + "proposal-object-rest-spread": proposalObjectRestSpread, + "proposal-optional-catch-binding": proposalOptionalCatchBinding, + "proposal-optional-chaining": proposalOptionalChaining, + "proposal-unicode-property-regex": proposalUnicodePropertyRegex, "syntax-async-generators": syntaxAsyncGenerators, "syntax-dynamic-import": syntaxDynamicImport, "syntax-json-strings": syntaxJsonStrings, + "syntax-nullish-coalescing-operator": syntaxNullishCoalescingOperator, "syntax-object-rest-spread": syntaxObjectRestSpread, "syntax-optional-catch-binding": syntaxOptionalCatchBinding, + "syntax-optional-chaining": syntaxOptionalChaining, "syntax-top-level-await": syntaxTopLevelAwait, - "transform-async-to-generator": transformAsyncToGenerator, - "proposal-async-generator-functions": proposalAsyncGeneratorFunctions, - "proposal-dynamic-import": proposalDynamicImport, - "proposal-json-strings": proposalJsonStrings, "transform-arrow-functions": transformArrowFunctions, + "transform-async-to-generator": transformAsyncToGenerator, "transform-block-scoped-functions": transformBlockScopedFunctions, "transform-block-scoping": transformBlockScoping, "transform-classes": transformClasses, @@ -62,6 +75,7 @@ export default { "transform-destructuring": transformDestructuring, "transform-dotall-regex": transformDotallRegex, "transform-duplicate-keys": transformDuplicateKeys, + "transform-exponentiation-operator": transformExponentialOperator, "transform-for-of": transformForOf, "transform-function-name": transformFunctionName, "transform-literals": transformLiterals, @@ -71,9 +85,11 @@ export default { "transform-modules-systemjs": transformModulesSystemjs, "transform-modules-umd": transformModulesUmd, "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex, + "transform-new-target": transformNewTarget, "transform-object-super": transformObjectSuper, "transform-parameters": transformParameters, "transform-property-literals": transformPropertyLiterals, + "transform-regenerator": transformRegenerator, "transform-reserved-words": transformReservedWords, "transform-shorthand-properties": transformShorthandProperties, "transform-spread": transformSpread, @@ -81,10 +97,4 @@ export default { "transform-template-literals": transformTemplateLiterals, "transform-typeof-symbol": transformTypeofSymbol, "transform-unicode-regex": transformUnicodeRegex, - "transform-exponentiation-operator": transformExponentialOperator, - "transform-new-target": transformNewTarget, - "proposal-object-rest-spread": proposalObjectRestSpread, - "proposal-optional-catch-binding": proposalOptionalCatchBinding, - "transform-regenerator": transformRegenerator, - "proposal-unicode-property-regex": proposalUnicodePropertyRegex, }; diff --git a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt index 3489d7294e09..1177233c1854 100644 --- a/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/corejs2/usage-browserslist-config-ignore/stdout.txt @@ -25,7 +25,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-optional-chaining { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-nullish-coalescing-operator { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } syntax-dynamic-import { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt index 5b3c33fd0b12..1988ed515d68 100644 --- a/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/corejs3/usage-browserslist-config-ignore/stdout.txt @@ -25,7 +25,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-json-strings { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } proposal-optional-catch-binding { "chrome":"61", "edge":"16", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-optional-chaining { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } transform-named-capturing-groups-regex { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } + proposal-nullish-coalescing-operator { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } syntax-dynamic-import { "chrome":"61", "edge":"16", "firefox":"60", "ios":"10.3", "opera":"48", "safari":"10.1" } Using polyfills with `usage` option: diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt index b193c75bf464..d079d9b7f0bb 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-android-3/stdout.txt @@ -36,10 +36,12 @@ Using plugins: proposal-unicode-property-regex { "android":"3" } proposal-json-strings { "android":"3" } proposal-optional-catch-binding { "android":"3" } + proposal-optional-chaining { "android":"3" } transform-named-capturing-groups-regex { "android":"3" } transform-member-expression-literals { "android":"3" } transform-property-literals { "android":"3" } transform-reserved-words { "android":"3" } + proposal-nullish-coalescing-operator { "android":"3" } transform-modules-commonjs { "android":"3" } proposal-dynamic-import { "android":"3" } diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt index 369d15c80b38..fa83ff03bb10 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie/stdout.txt @@ -43,7 +43,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"49", "edge":"17", "firefox":"68", "safari":"5.1" } proposal-json-strings { "chrome":"49", "edge":"17", "safari":"5.1" } proposal-optional-catch-binding { "chrome":"49", "edge":"17", "safari":"5.1" } + proposal-optional-chaining { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } transform-named-capturing-groups-regex { "chrome":"49", "edge":"17", "firefox":"68", "safari":"5.1" } + proposal-nullish-coalescing-operator { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } transform-modules-commonjs { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } proposal-dynamic-import { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt index 910826ae852e..fd2bde77e63a 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-defaults/stdout.txt @@ -44,7 +44,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } proposal-json-strings { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } proposal-optional-catch-binding { "chrome":"49", "edge":"17", "ie":"11", "safari":"5.1" } + proposal-optional-chaining { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } transform-named-capturing-groups-regex { "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "safari":"5.1" } + proposal-nullish-coalescing-operator { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } transform-modules-commonjs { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } proposal-dynamic-import { "android":"77", "chrome":"49", "edge":"17", "firefox":"68", "ie":"11", "ios":"12.2", "opera":"63", "safari":"5.1", "samsung":"9.2" } diff --git a/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt index 589e0f6bc262..a643d3d2c96f 100644 --- a/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/browserslists-last-2-versions-not-ie/stdout.txt @@ -24,7 +24,9 @@ Using plugins: proposal-unicode-property-regex { "edge":"17", "firefox":"70" } proposal-json-strings { "edge":"17" } proposal-optional-catch-binding { "edge":"17" } + proposal-optional-chaining { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } transform-named-capturing-groups-regex { "edge":"17", "firefox":"70" } + proposal-nullish-coalescing-operator { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } transform-modules-commonjs { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } proposal-dynamic-import { "android":"77", "chrome":"77", "edge":"17", "firefox":"70", "ios":"13", "opera":"63", "safari":"12.1", "samsung":"9.2" } 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..90cb09a7618b 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 @@ -36,10 +36,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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..5fed38cd6add 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 @@ -36,8 +36,10 @@ Using plugins: proposal-unicode-property-regex { "android":"4" } proposal-json-strings { "android":"4" } proposal-optional-catch-binding { "android":"4" } + proposal-optional-chaining { "android":"4" } transform-named-capturing-groups-regex { "android":"4" } transform-reserved-words { "android":"4" } + proposal-nullish-coalescing-operator { "android":"4" } transform-modules-commonjs { "android":"4" } proposal-dynamic-import { "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..b97398e635fc 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 @@ -31,9 +31,11 @@ Using plugins: proposal-unicode-property-regex { "electron":"0.36" } proposal-json-strings { "electron":"0.36" } proposal-optional-catch-binding { "electron":"0.36" } + proposal-optional-chaining { "electron":"0.36" } transform-named-capturing-groups-regex { "electron":"0.36" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + proposal-nullish-coalescing-operator { "electron":"0.36" } transform-modules-commonjs { "electron":"0.36" } proposal-dynamic-import { "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..86eb78a01155 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 @@ -36,10 +36,12 @@ Using plugins: proposal-unicode-property-regex { "chrome":"55" } proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } + proposal-optional-chaining { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator { "chrome":"55" } syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt index fc924a413e56..2df247258e0e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-no-import/stdout.txt @@ -19,7 +19,9 @@ Using plugins: proposal-unicode-property-regex { "node":"6" } proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } + proposal-optional-chaining { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + proposal-nullish-coalescing-operator { "node":"6" } transform-modules-commonjs { "node":"6" } proposal-dynamic-import { "node":"6" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt index 632adbae014a..cabc2e89b1db 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..a43849e003a7 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt index 583e108fd4cf..1587cd42c1f0 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs2-shippedProposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..ede20c21f527 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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..9c1a297d0331 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 @@ -41,7 +41,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-json-strings { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-optional-catch-binding { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-optional-chaining { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-named-capturing-groups-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-nullish-coalescing-operator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-modules-commonjs { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-dynamic-import { "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..e19313854516 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 @@ -47,9 +47,11 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-json-strings { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-optional-catch-binding { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } + proposal-optional-chaining { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-named-capturing-groups-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + proposal-nullish-coalescing-operator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-modules-commonjs { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-dynamic-import { "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..2d8d7d79f36f 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6.10" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } proposal-dynamic-import { "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..68c9b3ce7d22 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt index 6b47f470f6aa..1c4911d57fa8 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-all-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..3af17db4ff02 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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 fb4267fdd780..f0bfb709749d 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 @@ -36,8 +36,10 @@ Using plugins: proposal-unicode-property-regex { "android":"4" } proposal-json-strings { "android":"4" } proposal-optional-catch-binding { "android":"4" } + proposal-optional-chaining { "android":"4" } transform-named-capturing-groups-regex { "android":"4" } transform-reserved-words { "android":"4" } + proposal-nullish-coalescing-operator { "android":"4" } transform-modules-commonjs { "android":"4" } proposal-dynamic-import { "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..1dd62898e898 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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 0c8d68fdabce..bbbb95df3388 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 @@ -31,9 +31,11 @@ Using plugins: proposal-unicode-property-regex { "electron":"0.36" } proposal-json-strings { "electron":"0.36" } proposal-optional-catch-binding { "electron":"0.36" } + proposal-optional-chaining { "electron":"0.36" } transform-named-capturing-groups-regex { "electron":"0.36" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + proposal-nullish-coalescing-operator { "electron":"0.36" } transform-modules-commonjs { "electron":"0.36" } proposal-dynamic-import { "electron":"0.36" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt index b3751d6de895..4b22e928d343 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt index 179cbc24c06f..ace678c1f962 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-es-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..c59a2c298fd5 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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..be247fafa3e2 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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..182501549bcd 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 @@ -36,10 +36,12 @@ Using plugins: proposal-unicode-property-regex { "chrome":"55" } proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } + proposal-optional-chaining { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator { "chrome":"55" } syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt index 7dd81bf8bd49..efc3f53ab6e0 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-no-import/stdout.txt @@ -19,7 +19,9 @@ Using plugins: proposal-unicode-property-regex { "node":"6" } proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } + proposal-optional-chaining { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + proposal-nullish-coalescing-operator { "node":"6" } transform-modules-commonjs { "node":"6" } proposal-dynamic-import { "node":"6" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt index 3efcd119e087..742d4d311e30 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-proposals-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..fc866a9de007 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt index b964de442cc5..c0caa6231b38 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt index e7986cb8ca44..7df51ffb6178 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-runtime-only/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt index 9b068053e50e..1264913107eb 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-specific-entries-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..71a8cab89def 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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 894bf780e69a..9cbf285f8e6c 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 @@ -41,7 +41,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-json-strings { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-optional-catch-binding { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-optional-chaining { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-named-capturing-groups-regex { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } + proposal-nullish-coalescing-operator { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } transform-modules-commonjs { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } proposal-dynamic-import { "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-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt index e1ad31ad13ab..7a36f94d588d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt index 7cff00543450..33591eb05224 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stable-samsung-8.2/stdout.txt @@ -13,7 +13,9 @@ Using plugins: proposal-unicode-property-regex { "samsung":"8.2" } proposal-json-strings { "samsung":"8.2" } proposal-optional-catch-binding { "samsung":"8.2" } + proposal-optional-chaining { "samsung":"8.2" } transform-named-capturing-groups-regex { "samsung":"8.2" } + proposal-nullish-coalescing-operator { "samsung":"8.2" } transform-modules-commonjs { "samsung":"8.2" } proposal-dynamic-import { "samsung":"8.2" } 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..4efa1c978e46 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt index b6011886e4d9..071a02b7b2b6 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-stage-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..07104b5a7818 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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 1ac6b7eb521c..f038b106a7dd 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 @@ -47,9 +47,11 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-json-strings { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-optional-catch-binding { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } + proposal-optional-chaining { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-named-capturing-groups-regex { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-member-expression-literals { "electron":"0.36" } transform-property-literals { "electron":"0.36" } + proposal-nullish-coalescing-operator { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } transform-modules-commonjs { "chrome":"54", "electron":"0.36", "ie":"10", "node":"6.1" } proposal-dynamic-import { "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 76ae451dfc87..9a906cc80f6f 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6.10" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } proposal-dynamic-import { "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 b88e08d07803..1aa4bce2300c 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6.10" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } proposal-dynamic-import { "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 c426ae2080e2..9a09c03b6d27 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6.10" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6.10" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6.10" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6.10" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6.10" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6.10" } proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6.10" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt index edbc01bf1056..19dfd0af2181 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-corejs3-web-chrome-71/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..3948c4b7acab 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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 813558de2cad..9706b3e7699f 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt index 55a1471d55d2..24105671f15c 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stdout.txt @@ -19,7 +19,9 @@ Using plugins: proposal-unicode-property-regex { "node":"6" } proposal-json-strings { "node":"6" } proposal-optional-catch-binding { "node":"6" } + proposal-optional-chaining { "node":"6" } transform-named-capturing-groups-regex { "node":"6" } + proposal-nullish-coalescing-operator { "node":"6" } transform-modules-commonjs { "node":"6" } proposal-dynamic-import { "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..6c02b20b8c27 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 @@ -34,10 +34,12 @@ Using plugins: proposal-unicode-property-regex {} proposal-json-strings {} proposal-optional-catch-binding {} + proposal-optional-chaining {} transform-named-capturing-groups-regex {} transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator {} transform-modules-commonjs {} proposal-dynamic-import {} 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..10ac0e1fb2e3 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 @@ -39,10 +39,12 @@ Using plugins: proposal-unicode-property-regex { "chrome":"55" } proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } + proposal-optional-chaining { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } transform-member-expression-literals {} transform-property-literals {} transform-reserved-words {} + proposal-nullish-coalescing-operator { "chrome":"55" } syntax-dynamic-import { "chrome":"55" } Using polyfills with `entry` option: 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..1efd0e079c59 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 @@ -38,7 +38,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"54", "ie":"10", "node":"6" } proposal-json-strings { "chrome":"54", "ie":"10", "node":"6" } proposal-optional-catch-binding { "chrome":"54", "ie":"10", "node":"6" } + proposal-optional-chaining { "chrome":"54", "ie":"10", "node":"6" } transform-named-capturing-groups-regex { "chrome":"54", "ie":"10", "node":"6" } + proposal-nullish-coalescing-operator { "chrome":"54", "ie":"10", "node":"6" } transform-modules-commonjs { "chrome":"54", "ie":"10", "node":"6" } proposal-dynamic-import { "chrome":"54", "ie":"10", "node":"6" } diff --git a/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt index 58781f6b2ec1..91fa70d3ccaa 100644 --- a/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/plugins-only/stdout.txt @@ -26,7 +26,9 @@ Using plugins: proposal-unicode-property-regex { "firefox":"52", "node":"7.4" } proposal-json-strings { "firefox":"52", "node":"7.4" } proposal-optional-catch-binding { "firefox":"52", "node":"7.4" } + proposal-optional-chaining { "firefox":"52", "node":"7.4" } transform-named-capturing-groups-regex { "firefox":"52", "node":"7.4" } + proposal-nullish-coalescing-operator { "firefox":"52", "node":"7.4" } transform-modules-commonjs { "firefox":"52", "node":"7.4" } proposal-dynamic-import { "firefox":"52", "node":"7.4" } 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..aa7dfa881f18 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..499f51879c15 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt index 19256d92e761..0290b11fbcd5 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-1/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt index c03ef9bbeaf2..8ab471d3fc50 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-chrome-71-2/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..df82af414b8b 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..6b0a947867aa 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..31f05aa5a3a2 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..64914fe44383 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt index aabc7e867e83..5b846ecf9295 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-1/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt index 9154f4f3ace6..28e1952f4c35 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-proposals-chrome-71-2/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..a937819d69c5 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..8fdaecacb2dd 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt index c5f336bc2da2..81f3687e8dac 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs2-with-import/stdout.txt @@ -14,7 +14,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"55" } proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } + proposal-optional-chaining { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } + proposal-nullish-coalescing-operator { "chrome":"55" } transform-modules-commonjs { "chrome":"55" } proposal-dynamic-import { "chrome":"55" } 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..22d4c56a3256 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..4cce46fe4c30 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt index 7e9cc063c496..2cbcabd835b9 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-1/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt index 9aaf62342062..722599c9cb68 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-chrome-71-2/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..c75552f22ea2 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..dc523ad918ee 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..15abd57b6a9d 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..d59dec1f9b70 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt index 6000e5d705cd..ecb943009f2d 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-1/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt index c12a9314e829..4a7b2514c4f4 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-proposals-chrome-71-2/stdout.txt @@ -12,6 +12,8 @@ Using plugins: syntax-object-rest-spread { "chrome":"71" } syntax-json-strings { "chrome":"71" } syntax-optional-catch-binding { "chrome":"71" } + proposal-optional-chaining { "chrome":"71" } + proposal-nullish-coalescing-operator { "chrome":"71" } transform-modules-commonjs { "chrome":"71" } proposal-dynamic-import { "chrome":"71" } 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..e5b75a9a1c5a 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..eb190794737f 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..0c7ee55a05b0 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..f27eb55333ca 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..c5bdcb00878c 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..911a19104672 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt index b6e9e3ab1f49..45066fccbc34 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-corejs3-with-import/stdout.txt @@ -14,7 +14,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"55" } proposal-json-strings { "chrome":"55" } proposal-optional-catch-binding { "chrome":"55" } + proposal-optional-chaining { "chrome":"55" } transform-named-capturing-groups-regex { "chrome":"55" } + proposal-nullish-coalescing-operator { "chrome":"55" } transform-modules-commonjs { "chrome":"55" } proposal-dynamic-import { "chrome":"55" } 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..c26bff7708e0 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..0f3308e0a98c 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..a6ab295bf699 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "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..09bb267f456e 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 @@ -37,7 +37,9 @@ Using plugins: proposal-unicode-property-regex { "chrome":"52", "firefox":"50", "ie":"11" } proposal-json-strings { "chrome":"52", "firefox":"50", "ie":"11" } proposal-optional-catch-binding { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-optional-chaining { "chrome":"52", "firefox":"50", "ie":"11" } transform-named-capturing-groups-regex { "chrome":"52", "firefox":"50", "ie":"11" } + proposal-nullish-coalescing-operator { "chrome":"52", "firefox":"50", "ie":"11" } transform-modules-commonjs { "chrome":"52", "firefox":"50", "ie":"11" } proposal-dynamic-import { "chrome":"52", "firefox":"50", "ie":"11" } diff --git a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt index ba01385d275e..3d7c5bed33ce 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/preset-options/safari-10_3-block-scoped/stdout.txt @@ -19,7 +19,9 @@ Using plugins: proposal-unicode-property-regex { "safari":"10" } proposal-json-strings { "safari":"10" } proposal-optional-catch-binding { "safari":"10" } + proposal-optional-chaining { "safari":"10" } transform-named-capturing-groups-regex { "safari":"10" } + proposal-nullish-coalescing-operator { "safari":"10" } transform-modules-commonjs { "safari":"10" } proposal-dynamic-import { "safari":"10" } From 9fec528016e1a9b8773bde5fd08f2174139e8ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 10 Jan 2020 16:11:10 -0500 Subject: [PATCH 935/965] Reduce false negative cases of typescript parser tests (#10979) * tests: read baesline errors for typescript parsing error * chore: add error codes * chore: tune the regex --- .../parser-tests/typescript/error-codes.js | 71 +++++++++++ scripts/parser-tests/typescript/index.js | 35 +++++- scripts/parser-tests/typescript/whitelist.txt | 110 ------------------ 3 files changed, 100 insertions(+), 116 deletions(-) create mode 100644 scripts/parser-tests/typescript/error-codes.js diff --git a/scripts/parser-tests/typescript/error-codes.js b/scripts/parser-tests/typescript/error-codes.js new file mode 100644 index 000000000000..2a2580dfb8a2 --- /dev/null +++ b/scripts/parser-tests/typescript/error-codes.js @@ -0,0 +1,71 @@ +/* +This file includes the code of TS Diagnostics error that should also be thrown from babel-parser. +The TypeScript parser is highly tolerant on errors so these error would not produce parseDiagnostics which can be checked +in the parser test runner. We check these error codes against the stderr log in the build/typescript/tests/baselines/reference + +Note that babel-parser should not throw for the TypeChecking Diagnostics + +The commented out diagnostic codes will introduce false positive cases that should be addressed in separate PRs. +*/ + +module.exports = [ + // "TS1005", // '{0}' expected. + "TS1009", // Trailing comma not allowed. + "TS1014", // A rest parameter must be last in a parameter list. + "TS1019", // An index signature parameter cannot have a question mark. + "TS1028", // Accessibility modifier already seen. + "TS1029", // '{0}' modifier must precede '{1}' modifier. + "TS1030", // '{0}' modifier already seen. + "TS1031", // '{0}' modifier cannot appear on a class element. + "TS1042", // '{0}' modifier cannot be used here. + "TS1048", // A rest parameter cannot have an initializer. + "TS1053", // A 'set' accessor cannot have rest parameter. + "TS1054", // A 'get' accessor cannot have parameters. + // "TS1071", // '{0}' modifier cannot appear on an index signature. + "TS1089", // '{0}' modifier cannot appear on a constructor declaration. + "TS1090", // '{0}' modifier cannot appear on a parameter. + "TS1100", // Invalid use of 'arguments' in strict mode. + "TS1101", // 'with' statements are not allowed in strict mode. + "TS1104", // A 'continue' statement can only be used within an enclosing iteration statement. + "TS1105", // A 'break' statement can only be used within an enclosing iteration or switch statement. + "TS1107", // Jump target cannot cross function boundary. + "TS1108", // A 'return' statement can only be used within a function body. + "TS1113", // A 'default' clause cannot appear more than once in a 'switch' statement. + "TS1115", // A 'continue' statement can only jump to a label of an enclosing iteration statement. + "TS1116", // A 'break' statement can only jump to a label of an enclosing statement. + "TS1123", // Variable declaration list cannot be empty. + "TS1141", // String literal expected. + "TS1142", // Line break not permitted here. + "TS1162", // An object member cannot be declared optional. + "TS1163", // A 'yield' expression is only allowed in a generator body. + "TS1184", // Modifiers cannot appear here. + "TS1191", // An import declaration cannot have modifiers. + "TS1196", // Catch clause variable cannot have a type annotation. + "TS1197", // Catch clause variable cannot have an initializer. + "TS1200", // Line terminator not permitted before arrow. + "TS1312", // '=' can only be used in an object literal property inside a destructuring assignment. + // "TS1212", // Identifier expected. '{0}' is a reserved word in strict mode." + // "TS1213", // Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode. + // "TS1214", // Identifier expected. '{0}' is a reserved word in strict mode. Modules are automatically in strict mode. + "TS1246", // An interface property cannot have an initializer. + "TS1247", // A type literal property cannot have an initializer. + "TS1248", // A class member cannot have the 'const' keyword. + "TS1308", // 'await' expression is only allowed within an async function. + "TS2337", // Super calls are not permitted outside constructors or in nested functions inside constructors. + // "TS2300", // Duplicate identifier '{0}'. + "TS2364", // The left-hand side of an assignment expression must be a variable or a property access. + // "TS2371", // A parameter initializer is only allowed in a function or constructor implementation. + // "TS2393", // Duplicate function implementation. + "TS2396", // Duplicate identifier 'arguments'. Compiler uses 'arguments' to initialize rest parameters. + // "TS2440", // Import declaration conflicts with local declaration of '{0}'. + // "TS2451", // Cannot redeclare block-scoped variable '{0}'. + "TS2452", // An enum member cannot have a numeric name. + "TS2566", // A rest element cannot have a property name. + "TS2481", // Cannot initialize outer scoped variable '{0}' in the same scope as block scoped declaration '{0}'. + // "TS2567", // Enum declarations can only merge with namespace or other enum declarations. + "TS2659", // 'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher. + "TS2660", // 'super' can only be referenced in members of derived classes or object literal expressions. + "TS2699", // Static property '{0}' conflicts with built-in property 'Function.{0}' of constructor function '{1}'. + "TS8018", // Octal literals are not allowed in enums members initializer. + // "TS17012", // '{0}' is not a valid meta-property for keyword '{1}'. Did you mean '{2}'? +]; diff --git a/scripts/parser-tests/typescript/index.js b/scripts/parser-tests/typescript/index.js index 0de0384529c7..5e3e4b2a9d63 100644 --- a/scripts/parser-tests/typescript/index.js +++ b/scripts/parser-tests/typescript/index.js @@ -1,7 +1,8 @@ const path = require("path"); const fs = require("fs").promises; -const ts = require("typescript"); +const ts = require("../../../build/typescript"); const TestRunner = require("../utils/parser-test-runner"); +const parsingErrorCodes = require("./error-codes"); async function* loadTests(dir) { const names = await fs.readdir(dir); @@ -20,11 +21,30 @@ const plugins = [ "dynamicImport", ]; +const TSTestsPath = path.join(__dirname, "../../../build/typescript/tests"); + +// Check if the baseline errors contain the codes that should also be thrown from babel-parser +async function baselineContainsParserErrorCodes(testName) { + try { + const baselineErrors = await fs.readFile( + path.join( + TSTestsPath, + "baselines/reference", + testName.replace(/\.tsx?$/, ".errors.txt") + ), + "utf8" + ); + return parsingErrorCodes.some(code => baselineErrors.includes(code)); + } catch (e) { + if (e.code !== "ENOENT") { + throw e; + } + return false; + } +} + const runner = new TestRunner({ - testDir: path.join( - __dirname, - "../../../build/typescript/tests/cases/compiler" - ), + testDir: path.join(TSTestsPath, "./cases/compiler"), whitelist: path.join(__dirname, "whitelist.txt"), logInterval: 50, shouldUpdate: process.argv.includes("--update-whitelist"), @@ -32,6 +52,7 @@ const runner = new TestRunner({ async *getTests() { for await (const test of loadTests(this.testDir)) { const isTSX = test.name.slice(-4) === ".tsx"; + const ast = ts.createSourceFile( test.name, test.contents, @@ -44,7 +65,9 @@ const runner = new TestRunner({ contents: test.contents, fileName: test.name, id: test.name, - expectedError: ast.parseDiagnostics.length > 0, + expectedError: + ast.parseDiagnostics.length > 0 || + (await baselineContainsParserErrorCodes(test.name)), sourceType: "module", plugins: isTSX ? plugins.concat("jsx") : plugins, }; diff --git a/scripts/parser-tests/typescript/whitelist.txt b/scripts/parser-tests/typescript/whitelist.txt index a69318cb0174..36d525c171eb 100644 --- a/scripts/parser-tests/typescript/whitelist.txt +++ b/scripts/parser-tests/typescript/whitelist.txt @@ -1,12 +1,10 @@ ArrowFunctionExpression1.ts -ClassDeclarationWithInvalidConstOnPropertyDeclaration.ts MemberAccessorDeclaration15.ts ParameterList13.ts ParameterList4.ts ParameterList5.ts ParameterList6.ts accessorParameterAccessibilityModifier.ts -accessorWithRestParam.ts accessorWithoutBody1.ts accessorWithoutBody2.ts aliasUsageInAccessorsOfClass.ts @@ -21,12 +19,6 @@ aliasUsageInVarAssignment.ts aliasUsedAsNameValue.ts allowImportClausesToMergeWithTypes.ts allowJscheckJsTypeParameterNoCrash.ts -alwaysStrict.ts -alwaysStrictES6.ts -alwaysStrictModule.ts -alwaysStrictModule2.ts -alwaysStrictNoImplicitUseStrict.ts -ambientWithStatements.ts amdDeclarationEmitNoExtraDeclare.ts amdModuleConstEnumUsage.ts amdModuleName2.ts @@ -34,10 +26,6 @@ anonClassDeclarationEmitIsAnon.ts anyDeclare.ts argumentsBindsToFunctionScopeArgumentList.ts arrayOfExportedClass.ts -arrowFunctionErrorSpan.ts -asiReturn.ts -assignToInvalidLHS.ts -assignmentToParenthesizedExpression1.ts asyncFunctionsAcrossFiles.ts augmentExportEquals1.ts augmentExportEquals1_1.ts @@ -59,16 +47,9 @@ augmentedTypesEnum2.ts augmentedTypesFunction.ts augmentedTypesInterface.ts augmentedTypesVar.ts -awaitInClassInAsyncFunction.ts -awaitInNonAsyncFunction.ts -awaitLiteralValues.ts bigIntWithTargetES3.ts bigintIndex.ts bigintWithLib.ts -breakNotInIterationOrSwitchStatement1.ts -breakNotInIterationOrSwitchStatement2.ts -breakTarget5.ts -breakTarget6.ts cacheResolutions.ts cachedModuleResolution1.ts cachedModuleResolution2.ts @@ -80,47 +61,23 @@ cachedModuleResolution7.ts cachedModuleResolution8.ts cachedModuleResolution9.ts callOverloads2.ts -catchClauseWithInitializer1.ts -catchClauseWithTypeAnnotation.ts checkSuperCallBeforeThisAccessing9.ts classCannotExtendVar.ts -classExpressionPropertyModifiers.ts classExpressionWithDecorator1.ts classExtendsAcrossFiles.ts classExtendsMultipleBaseClasses.ts -classHeritageWithTrailingSeparator.ts classOverloadForFunction.ts -collisionArgumentsArrowFunctions.ts -collisionArgumentsClassConstructor.ts -collisionArgumentsClassMethod.ts -collisionArgumentsFunction.ts -collisionArgumentsFunctionExpressions.ts collisionExportsRequireAndClass.ts commonSourceDir5.ts commonSourceDir6.ts commonjsSafeImport.ts -complicatedPrivacy.ts conflictingTypeAnnotatedVar.ts -constDeclarationShadowedByVarDeclaration.ts constDeclarations-invalidContexts.ts constDeclarations-scopes.ts constDeclarations-validContexts.ts constEnumNoEmitReexport.ts constEnumNoPreserveDeclarationReexport.ts constEnumPreserveEmitReexport.ts -constInClassExpression.ts -constructorArgsErrors1.ts -constructorArgsErrors2.ts -constructorArgsErrors3.ts -constructorArgsErrors4.ts -constructorArgsErrors5.ts -continueNotInIterationStatement1.ts -continueNotInIterationStatement2.ts -continueNotInIterationStatement3.ts -continueNotInIterationStatement4.ts -continueTarget1.ts -continueTarget5.ts -continueTarget6.ts convertKeywordsYes.ts declarationEmitAmdModuleNameDirective.ts declarationEmitComputedNameCausesImportToBePainted.ts @@ -143,7 +100,6 @@ declarationImportTypeAliasInferredAndEmittable.ts declarationMapsMultifile.ts declarationMapsOutFile.ts declarationsForInferredTypeFromOtherFile.ts -declareAlreadySeen.ts declareModifierOnImport1.ts decoratorMetadataRestParameterWithImportedType.ts decoratorMetadataWithImportDeclarationNameCollision.ts @@ -165,7 +121,6 @@ dependencyViaImportAlias.ts destructureOptionalParameter.ts destructuredDeclarationEmit.ts doubleUnderscoreExportStarConflict.ts -downlevelLetConst1.ts duplicateIdentifierBindingElementInParameterDeclaration1.ts duplicateIdentifierBindingElementInParameterDeclaration2.ts duplicateIdentifierEnum.ts @@ -178,7 +133,6 @@ duplicateLabel2.ts duplicateVarAndImport.ts duplicateVarAndImport2.ts duplicateVarsAcrossFileBoundaries.ts -dynamicImportTrailingComma.ts dynamicNames.ts elidedEmbeddedStatementsReplacedWithSemicolon.ts emitClassMergedWithConstNamespaceNotElided.ts @@ -186,12 +140,7 @@ emitSuperCallBeforeEmitParameterPropertyDeclaration1.ts emitSuperCallBeforeEmitParameterPropertyDeclaration1ES6.ts emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.ts emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1ES6.ts -emitThisInSuperMethodCall.ts enumGenericTypeClash.ts -enumIdentifierLiterals.ts -errorOnInitializerInInterfaceProperty.ts -errorOnInitializerInObjectTypeLiteralProperty.ts -es3-oldStyleOctalLiteralInEnums.ts es3-oldStyleOctalLiteralTypes.ts es3defaultAliasIsQuoted.ts es5-asyncFunctionWithStatements.ts @@ -203,20 +152,14 @@ es6ExportAssignment3.ts es6ImportDefaultBindingFollowedWithNamedImport.ts es6ImportDefaultBindingFollowedWithNamedImport1.ts es6ImportDefaultBindingFollowedWithNamedImport1InEs5.ts -es6ImportDefaultBindingFollowedWithNamedImport1WithExport.ts es6ImportDefaultBindingFollowedWithNamedImportDts.ts es6ImportDefaultBindingFollowedWithNamedImportDts1.ts es6ImportDefaultBindingFollowedWithNamedImportInEs5.ts -es6ImportDefaultBindingFollowedWithNamedImportWithExport.ts -es6ImportDefaultBindingFollowedWithNamespaceBinding1WithExport.ts -es6ImportDefaultBindingFollowedWithNamespaceBindingWithExport.ts es6ImportDefaultBindingMergeErrors.ts -es6ImportDefaultBindingWithExport.ts es6ImportEqualsDeclaration.ts es6ImportEqualsExportModuleCommonJsError.ts es6ImportEqualsExportModuleEs2015Error.ts es6ImportNameSpaceImportMergeErrors.ts -es6ImportNameSpaceImportWithExport.ts es6ImportNamedImport.ts es6ImportNamedImportAmd.ts es6ImportNamedImportDts.ts @@ -225,9 +168,7 @@ es6ImportNamedImportInExportAssignment.ts es6ImportNamedImportMergeErrors.ts es6ImportNamedImportNoExportMember.ts es6ImportNamedImportNoNamedExports.ts -es6ImportNamedImportWithExport.ts es6ImportNamedImportWithTypesAndValues.ts -es6ImportWithoutFromClauseWithExport.ts es6ModuleInternalNamedImports.ts es6ModuleInternalNamedImports2.ts es6UseOfTopLevelRequire.ts @@ -235,7 +176,6 @@ esModuleInterop.ts esModuleInteropImportTSLibHasImport.ts esModuleInteropNamedDefaultImports.ts esModuleInteropTslibHelpers.ts -exportAlreadySeen.ts exportAssignClassAndModule.ts exportAssignmentImportMergeNoCrash.ts exportAssignmentMembersVisibleInAugmentation.ts @@ -245,7 +185,6 @@ exportAssignmentWithExportModifier.ts exportAssignmentWithoutAllowSyntheticDefaultImportsError.ts exportClassExtendingIntersection.ts exportClassWithoutName.ts -exportDeclarationInInternalModule.ts exportDeclarationsInAmbientNamespaces.ts exportDefaultAbstractClass.ts exportDefaultAsyncFunction2.ts @@ -263,20 +202,15 @@ extendingClassFromAliasAndUsageInIndexer.ts extendsClauseAlreadySeen.ts extendsClauseAlreadySeen2.ts externalModuleAssignToVar.ts -fatarrowfunctionsOptionalArgsErrors1.ts fileWithNextLine2.ts -fileWithNextLine3.ts funClodule.ts functionAndImportNameConflict.ts functionCall15.ts functionDeclarationWithResolutionOfTypeNamedArguments01.ts functionExpressionInWithBlock.ts functionExpressionWithResolutionOfTypeNamedArguments01.ts -functionsWithModifiersInBlocks1.ts gettersAndSettersErrors.ts giant.ts -illegalModifiersOnClassElements.ts -illegalSuperCallsInConstructor.ts implementClausePrecedingExtends.ts implementsClauseAlreadySeen.ts importAndVariableDeclarationConflict1.ts @@ -285,7 +219,6 @@ importAndVariableDeclarationConflict4.ts importAsBaseClass.ts importDecl.ts importDeclWithClassModifiers.ts -importDeclWithDeclareModifier.ts importDeclWithDeclareModifierInAmbientContext.ts importHelpers.ts importHelpersAmd.ts @@ -298,25 +231,20 @@ importHelpersOutFile.ts importHelpersSystem.ts importWithTrailingSlash.ts importedModuleClassNameClash.ts -indexSignatureTypeCheck.ts -indexSignatureTypeCheck2.ts indexSignatureWithAccessibilityModifier.ts indexSignatureWithInitializer1.ts indexTypeCheck.ts indexWithoutParamType.ts -indexerAsOptional.ts indexerSignatureWithRestParam.ts initializedParameterBeforeNonoptionalNotOptional.ts interfaceMayNotBeExtendedWitACall.ts interfaceWithImplements1.ts -invalidContinueInDownlevelAsync.ts invalidReferenceSyntax1.ts isLiteral1.ts isLiteral2.ts isolatedModulesReExportType.ts jsEnumTagOnObjectFrozen.ts jsFileCompilationBindDuplicateIdentifier.ts -jsFileCompilationBindErrors.ts jsFileCompilationDuplicateFunctionImplementation.ts jsFileCompilationDuplicateFunctionImplementationFileOrderReversed.ts jsFileCompilationExternalPackageError.ts @@ -337,7 +265,6 @@ letDeclarations-scopes-duplicates6.ts letDeclarations-scopes-duplicates7.ts letDeclarations-scopes.ts letDeclarations-validContexts.ts -literalsInComputedProperties1.ts mergeWithImportedType.ts mergedDeclarations6.ts metadataOfClassFromAlias.ts @@ -346,8 +273,6 @@ metadataReferencedWithinFilteredUnion.ts mismatchedClassConstructorVariable.ts missingSemicolonInModuleSpecifier.ts misspelledNewMetaProperty.ts -modifierOnParameter1.ts -modifiersInObjectLiterals.ts modifiersOnInterfaceIndexSignature1.ts moduleAugmentationCollidingNamesInAugmentation1.ts moduleAugmentationDeclarationEmit1.ts @@ -374,9 +299,6 @@ moduleAugmentationsImports2.ts moduleAugmentationsImports3.ts moduleAugmentationsImports4.ts moduleDuplicateIdentifiers.ts -moduleElementsInWrongContext.ts -moduleElementsInWrongContext2.ts -moduleElementsInWrongContext3.ts moduleResolutionNoTs.ts moduleResolutionWithSymlinks.ts moduleResolutionWithSymlinks_withOutDir.ts @@ -385,9 +307,6 @@ moduleSharesNameWithImportDeclarationInsideIt3.ts moduleSharesNameWithImportDeclarationInsideIt5.ts module_augmentUninstantiatedModule2.ts multiImportExport.ts -multiLinePropertyAccessAndArrowFunctionIndent1.ts -multipleClassPropertyModifiers.ts -multipleClassPropertyModifiersErrors.ts multipleInheritance.ts nameCollisions.ts namespacesWithTypeAliasOnlyExportsMerge.ts @@ -402,12 +321,7 @@ nodeResolution6.ts nodeResolution8.ts nonMergedOverloads.ts numberVsBigIntOperations.ts -objectBindingPattern_restElementWithPropertyName.ts -objectLiteralMemberWithModifiers1.ts -objectLiteralMemberWithModifiers2.ts -objectLiteralMemberWithQuestionMark1.ts objectLiteralMemberWithoutBlock1.ts -objectTypeWithOptionalProperty1.ts outModuleConcatAmd.ts outModuleConcatCommonjs.ts outModuleConcatCommonjsDeclarationOnly.ts @@ -422,7 +336,6 @@ pathMappingBasedModuleResolution3_classic.ts pathMappingBasedModuleResolution3_node.ts preserveUnusedImports.ts privacyCheckExternalModuleExportAssignmentOfGenericClass.ts -privacyImportParseErrors.ts privacyTopLevelAmbientExternalModuleImportWithExport.ts privacyTopLevelAmbientExternalModuleImportWithoutExport.ts reExportGlobalDeclaration1.ts @@ -440,35 +353,16 @@ redeclareParameterInCatchBlock.ts reexportedMissingAlias.ts relativeNamesInClassicResolution.ts requireAsFunctionInExternalModule.ts -restParamAsOptional.ts restParamModifier2.ts -restParameterNotLast.ts -restParameterWithBindingPattern3.ts shadowedReservedCompilerDeclarationsWithNoEmit.ts -shadowingViaLocalValue.ts -shadowingViaLocalValueOrBindingElement.ts shorthandPropertyAssignmentInES6Module.ts -shorthandPropertyAssignmentsInDestructuring.ts -shorthandPropertyAssignmentsInDestructuring_ES6.ts sourceMap-LineBreaks.ts sourceMapValidationDecorators.ts sourceMapValidationStatements.ts -spaceBeforeQuestionMarkInPropertyAssignment.ts -standaloneBreak.ts staticIndexer.ts -staticModifierAlreadySeen.ts -staticMustPrecedePublic.ts -staticPrototypeProperty.ts strictModeReservedWord.ts strictModeReservedWordInClassDeclaration.ts superCallFromClassThatHasNoBaseType1.ts -superCallFromFunction1.ts -superCallOutsideConstructor.ts -superCallsInConstructor.ts -superInObjectLiterals_ES5.ts -superInObjectLiterals_ES6.ts -super_inside-object-literal-getters-and-setters.ts -switchStatementsWithMultipleDefaults1.ts symbolLinkDeclarationEmitModuleNames.ts symbolMergeValueAndImportedType.ts systemExportAssignment.ts @@ -480,7 +374,6 @@ systemModuleWithSuperClass.ts systemObjectShorthandRename.ts targetEs6DecoratorMetadataImportNotElided.ts targetTypeCastTest.ts -throwWithoutNewLine2.ts tsxDeepAttributeAssignabilityError.tsx typeReferenceDirectives10.ts typeReferenceDirectives11.ts @@ -490,7 +383,6 @@ typeReferenceDirectives5.ts typeReferenceDirectives7.ts typeReferenceDirectives8.ts typeReferenceDirectives9.ts -unaryOperatorsInStrictMode.ts unusedImports1.ts unusedImports11.ts unusedImports12.ts @@ -501,9 +393,7 @@ unusedImports5.ts unusedInvalidTypeArguments.ts varAndFunctionShareName.ts varArgConstructorMemberParameter.ts -variableDeclarationInStrictMode1.ts withStatement.ts withStatementErrors.ts withStatementInternalComments.ts withStatementNestedScope.ts -yieldStringLiteral.ts From 282f81bd676d09c1d8c48b08a7254b961eb41bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2020 22:44:13 +0100 Subject: [PATCH 936/965] Prepare @babel/core for asynchronicity (#10507) * Prepare @babel/core for asynchronicity * Include regenerator-runtime in standalone build * Fix rollup build --- Gulpfile.js | 1 + babel.config.js | 28 +- lib/third-party-libs.js.flow | 1 + packages/babel-core/package.json | 1 + packages/babel-core/src/config/caching.js | 329 ++++++++++++++---- .../babel-core/src/config/config-chain.js | 144 ++++---- .../src/config/config-descriptors.js | 14 +- .../src/config/files/configuration.js | 192 +++++----- .../src/config/files/index-browser.js | 25 +- .../babel-core/src/config/files/package.js | 5 +- packages/babel-core/src/config/files/utils.js | 24 +- packages/babel-core/src/config/full.js | 213 ++++++------ packages/babel-core/src/config/index.js | 30 +- packages/babel-core/src/config/partial.js | 32 +- packages/babel-core/src/config/util.js | 11 + .../babel-core/src/gensync-utils/async.js | 110 ++++++ packages/babel-core/src/gensync-utils/fs.js | 21 ++ .../babel-core/src/gensync-utils/resolve.js | 9 + packages/babel-core/src/index.js | 9 +- packages/babel-core/src/parse.js | 67 +--- packages/babel-core/src/parser/index.js | 6 +- packages/babel-core/src/transform-ast.js | 69 ++-- packages/babel-core/src/transform-file.js | 95 ++--- packages/babel-core/src/transform.js | 59 +--- .../src/transformation/block-hoist-plugin.js | 2 +- .../babel-core/src/transformation/index.js | 31 +- .../src/transformation/normalize-file.js | 7 +- packages/babel-core/test/async.js | 214 ++++++++++++ packages/babel-core/test/caching-api.js | 98 ++++-- packages/babel-core/test/config-loading.js | 4 +- .../async/config-cache/babel.config.js | 12 + .../fixtures/async/config-cache/plugin.js | 9 + .../babel.config.js | 11 + .../config-file-async-function/plugin.js | 9 + .../async/config-file-promise/babel.config.js | 5 + .../async/config-file-promise/plugin.js | 9 + .../async/plugin-inherits/babel.config.js | 3 + .../fixtures/async/plugin-inherits/plugin.js | 10 + .../fixtures/async/plugin-inherits/plugin2.js | 13 + .../async/plugin-post/babel.config.js | 3 + .../test/fixtures/async/plugin-post/plugin.js | 15 + .../fixtures/async/plugin-pre/babel.config.js | 3 + .../test/fixtures/async/plugin-pre/plugin.js | 15 + .../fixtures/async/plugin/babel.config.js | 3 + .../test/fixtures/async/plugin/plugin.js | 13 + scripts/rollup-plugin-babel-source.js | 15 +- 46 files changed, 1357 insertions(+), 642 deletions(-) create mode 100644 packages/babel-core/src/gensync-utils/async.js create mode 100644 packages/babel-core/src/gensync-utils/fs.js create mode 100644 packages/babel-core/src/gensync-utils/resolve.js create mode 100644 packages/babel-core/test/async.js create mode 100644 packages/babel-core/test/fixtures/async/config-cache/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/config-cache/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/config-file-async-function/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/config-file-async-function/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/config-file-promise/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/config-file-promise/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-inherits/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-inherits/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-inherits/plugin2.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-post/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-post/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-pre/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/plugin-pre/plugin.js create mode 100644 packages/babel-core/test/fixtures/async/plugin/babel.config.js create mode 100644 packages/babel-core/test/fixtures/async/plugin/plugin.js diff --git a/Gulpfile.js b/Gulpfile.js index 9af1c2a79478..a78f68ea4914 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -183,6 +183,7 @@ function buildRollup(packages) { rollupCommonJs({ include: [ /node_modules/, + "packages/babel-runtime/regenerator/**", "packages/babel-preset-env/data/*.js", // Rollup doesn't read export maps, so it loads the cjs fallback "packages/babel-compat-data/*.js", diff --git a/babel.config.js b/babel.config.js index 5102c9141d9d..8fa932136dfd 100644 --- a/babel.config.js +++ b/babel.config.js @@ -14,6 +14,10 @@ module.exports = function(api) { let convertESM = true; let ignoreLib = true; + let includeRegeneratorRuntime = false; + + let transformRuntimeOptions; + const nodeVersion = "6.9"; // The vast majority of our src files are modules, but we use // unambiguous to keep things simple until we get around to renaming @@ -29,19 +33,19 @@ module.exports = function(api) { switch (env) { // Configs used during bundling builds. - case "rollup": - envOpts.targets = { - node: nodeVersion, - }; case "standalone": + includeRegeneratorRuntime = true; + unambiguousSources.push("packages/babel-runtime/regenerator"); + case "rollup": convertESM = false; ignoreLib = false; + // rollup-commonjs will converts node_modules to ESM unambiguousSources.push( "**/node_modules", "packages/babel-preset-env/data", "packages/babel-compat-data" ); - // targets to browserslists: defaults + if (env === "rollup") envOpts.targets = { node: nodeVersion }; break; case "production": // Config during builds before publish. @@ -62,6 +66,16 @@ module.exports = function(api) { break; } + if (includeRegeneratorRuntime) { + const babelRuntimePkgPath = require.resolve("@babel/runtime/package.json"); + + transformRuntimeOptions = { + helpers: false, // Helpers are handled by rollup when needed + regenerator: true, + version: require(babelRuntimePkgPath).version, + }; + } + const config = { // Our dependencies are all standard CommonJS, along with all sorts of // other random files in Babel's codebase, so we use script as the default, @@ -119,6 +133,10 @@ module.exports = function(api) { test: unambiguousSources, sourceType: "unambiguous", }, + includeRegeneratorRuntime && { + exclude: /regenerator-runtime/, + plugins: [["@babel/transform-runtime", transformRuntimeOptions]], + }, ].filter(Boolean), }; diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index f7314b07027e..b41fbe725b4e 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -4,6 +4,7 @@ declare module "resolve" { declare export default { + (string, {| basedir: string |}, (err: ?Error, res: string) => void): void; sync: (string, {| basedir: string |}) => string; }; } diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index e6a5ae1b655a..2b0684495b50 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -49,6 +49,7 @@ "@babel/types": "^7.7.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", "json5": "^2.1.0", "lodash": "^4.17.13", "resolve": "^1.3.2", diff --git a/packages/babel-core/src/config/caching.js b/packages/babel-core/src/config/caching.js index 5b915e7f7767..fcad6e8fccbe 100644 --- a/packages/babel-core/src/config/caching.js +++ b/packages/babel-core/src/config/caching.js @@ -1,5 +1,17 @@ // @flow +import gensync, { type Handler } from "gensync"; +import { + maybeAsync, + isAsync, + onFirstPause, + waitFor, + isThenable, +} from "../gensync-utils/async"; +import { isIterableIterator } from "./util"; + +export type { CacheConfigurator }; + export type SimpleCacheConfigurator = SimpleCacheConfiguratorFn & SimpleCacheConfiguratorObj; @@ -14,91 +26,223 @@ type SimpleCacheConfiguratorObj = { invalidate: (handler: () => T) => T, }; -type CacheEntry = Array<{ +export type CacheEntry = Array<{ value: ResultT, - valid: SideChannel => boolean, + valid: SideChannel => Handler, }>; -export type { CacheConfigurator }; +const synchronize = ( + gen: (...ArgsT) => Handler, + // $FlowIssue https://github.com/facebook/flow/issues/7279 +): ((...args: ArgsT) => ResultT) => { + return gensync(gen).sync; +}; -/** - * Given a function with a single argument, cache its results based on its argument and how it - * configures its caching behavior. Cached values are stored strongly. - */ -export function makeStrongCache( +// eslint-disable-next-line require-yield, no-unused-vars +function* genTrue(data: any) { + return true; +} + +export function makeWeakCache( + handler: (ArgT, CacheConfigurator) => Handler | ResultT, +): (ArgT, SideChannel) => Handler { + return makeCachedFunction(WeakMap, handler); +} + +export function makeWeakCacheSync( handler: (ArgT, CacheConfigurator) => ResultT, ): (ArgT, SideChannel) => ResultT { - return makeCachedFunction(new Map(), handler); + return synchronize<[ArgT, SideChannel], ResultT>( + makeWeakCache(handler), + ); } -/** - * Given a function with a single argument, cache its results based on its argument and how it - * configures its caching behavior. Cached values are stored weakly and the function argument must be - * an object type. - */ -export function makeWeakCache< - ArgT: {} | Array<*> | $ReadOnlyArray<*>, - ResultT, - SideChannel, ->( +export function makeStrongCache( + handler: (ArgT, CacheConfigurator) => Handler | ResultT, +): (ArgT, SideChannel) => Handler { + return makeCachedFunction(Map, handler); +} + +export function makeStrongCacheSync( handler: (ArgT, CacheConfigurator) => ResultT, ): (ArgT, SideChannel) => ResultT { - return makeCachedFunction(new WeakMap(), handler); + return synchronize<[ArgT, SideChannel], ResultT>( + makeStrongCache(handler), + ); +} + +/* NOTE: Part of the logic explained in this comment is explained in the + * getCachedValueOrWait and setupAsyncLocks functions. + * + * > There are only two hard things in Computer Science: cache invalidation and naming things. + * > -- Phil Karlton + * + * I don't know if Phil was also thinking about handling a cache whose invalidation function is + * defined asynchronously is considered, but it is REALLY hard to do correctly. + * + * The implemented logic (only when gensync is run asynchronously) is the following: + * 1. If there is a valid cache associated to the current "arg" parameter, + * a. RETURN the cached value + * 3. If there is a FinishLock associated to the current "arg" parameter representing a valid cache, + * a. Wait for that lock to be released + * b. RETURN the value associated with that lock + * 5. Start executing the function to be cached + * a. If it pauses on a promise, then + * i. Let FinishLock be a new lock + * ii. Store FinishLock as associated to the current "arg" parameter + * iii. Wait for the function to finish executing + * iv. Release FinishLock + * v. Send the function result to anyone waiting on FinishLock + * 6. Store the result in the cache + * 7. RETURN the result + */ +function makeCachedFunction( + CallCache: Class, + handler: (ArgT, CacheConfigurator) => Handler | ResultT, +): (ArgT, SideChannel) => Handler { + const callCacheSync = new CallCache(); + const callCacheAsync = new CallCache(); + const futureCache = new CallCache(); + + return function* cachedFunction(arg: ArgT, data: SideChannel) { + const asyncContext = yield* isAsync(); + const callCache = asyncContext ? callCacheAsync : callCacheSync; + + const cached = yield* getCachedValueOrWait( + asyncContext, + callCache, + futureCache, + arg, + data, + ); + if (cached.valid) return cached.value; + + const cache = new CacheConfigurator(data); + + const handlerResult = handler(arg, cache); + + let finishLock: ?Lock; + let value: ResultT; + + if (isIterableIterator(handlerResult)) { + // Flow refines handlerResult to Generator + const gen = (handlerResult: Generator<*, ResultT, *>); + + value = yield* onFirstPause(gen, () => { + finishLock = setupAsyncLocks(cache, futureCache, arg); + }); + } else { + // $FlowIgnore doesn't refine handlerResult to ResultT + value = (handlerResult: ResultT); + } + + updateFunctionCache(callCache, cache, arg, value); + + if (finishLock) { + futureCache.delete(arg); + finishLock.release(value); + } + + return value; + }; } type CacheMap = | Map> | WeakMap>; -function makeCachedFunction< +function* getCachedValue< ArgT, ResultT, SideChannel, // $FlowIssue https://github.com/facebook/flow/issues/4528 Cache: CacheMap, >( - callCache: Cache, - handler: (ArgT, CacheConfigurator) => ResultT, -): (ArgT, SideChannel) => ResultT { - return function cachedFunction(arg, data) { - let cachedValue: CacheEntry | void = callCache.get( - arg, - ); - - if (cachedValue) { - for (const { value, valid } of cachedValue) { - if (valid(data)) return value; - } + cache: Cache, + arg: ArgT, + data: SideChannel, +): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> { + const cachedValue: CacheEntry | void = cache.get(arg); + + if (cachedValue) { + for (const { value, valid } of cachedValue) { + if (yield* valid(data)) return { valid: true, value }; } + } - const cache = new CacheConfigurator(data); + return { valid: false, value: null }; +} + +function* getCachedValueOrWait( + asyncContext: boolean, + callCache: CacheMap, + futureCache: CacheMap, SideChannel>, + arg: ArgT, + data: SideChannel, +): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> { + const cached = yield* getCachedValue(callCache, arg, data); + if (cached.valid) { + return cached; + } - const value = handler(arg, cache); - - if (!cache.configured()) cache.forever(); - - cache.deactivate(); - - switch (cache.mode()) { - case "forever": - cachedValue = [{ value, valid: () => true }]; - callCache.set(arg, cachedValue); - break; - case "invalidate": - cachedValue = [{ value, valid: cache.validator() }]; - callCache.set(arg, cachedValue); - break; - case "valid": - if (cachedValue) { - cachedValue.push({ value, valid: cache.validator() }); - } else { - cachedValue = [{ value, valid: cache.validator() }]; - callCache.set(arg, cachedValue); - } + if (asyncContext) { + const cached = yield* getCachedValue(futureCache, arg, data); + if (cached.valid) { + const value = yield* waitFor(cached.value.promise); + return { valid: true, value }; } + } - return value; - }; + return { valid: false, value: null }; +} + +function setupAsyncLocks( + config: CacheConfigurator, + futureCache: CacheMap, SideChannel>, + arg: ArgT, +): Lock { + const finishLock = new Lock(); + + updateFunctionCache(futureCache, config, arg, finishLock); + + return finishLock; +} + +function updateFunctionCache< + ArgT, + ResultT, + SideChannel, + // $FlowIssue https://github.com/facebook/flow/issues/4528 + Cache: CacheMap, +>( + cache: Cache, + config: CacheConfigurator, + arg: ArgT, + value: ResultT, +) { + if (!config.configured()) config.forever(); + + let cachedValue: CacheEntry | void = cache.get(arg); + + config.deactivate(); + + switch (config.mode()) { + case "forever": + cachedValue = [{ value, valid: genTrue }]; + cache.set(arg, cachedValue); + break; + case "invalidate": + cachedValue = [{ value, valid: config.validator() }]; + cache.set(arg, cachedValue); + break; + case "valid": + if (cachedValue) { + cachedValue.push({ value, valid: config.validator() }); + } else { + cachedValue = [{ value, valid: config.validator() }]; + cache.set(arg, cachedValue); + } + } } class CacheConfigurator { @@ -109,7 +253,7 @@ class CacheConfigurator { _configured: boolean = false; - _pairs: Array<[mixed, (SideChannel) => mixed]> = []; + _pairs: Array<[mixed, (SideChannel) => Handler]> = []; _data: SideChannel; @@ -162,30 +306,36 @@ class CacheConfigurator { this._configured = true; const key = handler(this._data); - this._pairs.push([key, handler]); + + const fn = maybeAsync( + handler, + `You appear to be using an async cache handler, but Babel has been called synchronously`, + ); + + if (isThenable(key)) { + return key.then(key => { + this._pairs.push([key, fn]); + return key; + }); + } + + this._pairs.push([key, fn]); return key; } invalidate(handler: SideChannel => T): T { - if (!this._active) { - throw new Error("Cannot change caching after evaluation has completed."); - } - if (this._never || this._forever) { - throw new Error( - "Caching has already been configured with .never or .forever()", - ); - } this._invalidate = true; - this._configured = true; - - const key = handler(this._data); - this._pairs.push([key, handler]); - return key; + return this.using(handler); } - validator(): SideChannel => boolean { + validator(): SideChannel => Handler { const pairs = this._pairs; - return (data: SideChannel) => pairs.every(([key, fn]) => key === fn(data)); + return function*(data: SideChannel) { + for (const [key, fn] of pairs) { + if (key !== (yield* fn(data))) return false; + } + return true; + }; } deactivate() { @@ -219,8 +369,18 @@ function makeSimpleConfigurator( // Types are limited here so that in the future these values can be used // as part of Babel's caching logic. -type SimpleType = string | boolean | number | null | void; +type SimpleType = string | boolean | number | null | void | Promise; export function assertSimpleType(value: mixed): SimpleType { + if (isThenable(value)) { + throw new Error( + `You appear to be using an async cache handler, ` + + `which your current version of Babel does not support. ` + + `We may add support for this in the future, ` + + `but if you're on the most recent version of @babel/core and still ` + + `seeing this error, then you'll need to synchronously handle your caching logic.`, + ); + } + if ( value != null && typeof value !== "string" && @@ -233,3 +393,20 @@ export function assertSimpleType(value: mixed): SimpleType { } return value; } + +class Lock { + released: boolean = false; + promise: Promise; + _resolve: (value: T) => void; + + constructor() { + this.promise = new Promise(resolve => { + this._resolve = resolve; + }); + } + + release(value: T) { + this.released = true; + this._resolve(value); + } +} diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js index cb0fd1e1a4ac..1af3f35d2371 100644 --- a/packages/babel-core/src/config/config-chain.js +++ b/packages/babel-core/src/config/config-chain.js @@ -2,6 +2,7 @@ import path from "path"; import buildDebug from "debug"; +import type { Handler } from "gensync"; import { validate, type ValidatedOptions, @@ -24,7 +25,7 @@ import { type FilePackageData, } from "./files"; -import { makeWeakCache, makeStrongCache } from "./caching"; +import { makeWeakCacheSync, makeStrongCacheSync } from "./caching"; import { createCachedDescriptors, @@ -57,11 +58,11 @@ export type ConfigContext = { /** * Build a config chain for a given preset. */ -export function buildPresetChain( +export function* buildPresetChain( arg: PresetInstance, context: *, -): ConfigChain | null { - const chain = buildPresetChainWalker(arg, context); +): Handler { + const chain = yield* buildPresetChainWalker(arg, context); if (!chain) return null; return { @@ -82,11 +83,11 @@ export const buildPresetChainWalker: ( overridesEnv: (preset, index, envName) => loadPresetOverridesEnvDescriptors(preset)(index)(envName), }); -const loadPresetDescriptors = makeWeakCache((preset: PresetInstance) => +const loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) => buildRootDescriptors(preset, preset.alias, createUncachedDescriptors), ); -const loadPresetEnvDescriptors = makeWeakCache((preset: PresetInstance) => - makeStrongCache((envName: string) => +const loadPresetEnvDescriptors = makeWeakCacheSync((preset: PresetInstance) => + makeStrongCacheSync((envName: string) => buildEnvDescriptors( preset, preset.alias, @@ -95,20 +96,21 @@ const loadPresetEnvDescriptors = makeWeakCache((preset: PresetInstance) => ), ), ); -const loadPresetOverridesDescriptors = makeWeakCache((preset: PresetInstance) => - makeStrongCache((index: number) => - buildOverrideDescriptors( - preset, - preset.alias, - createUncachedDescriptors, - index, +const loadPresetOverridesDescriptors = makeWeakCacheSync( + (preset: PresetInstance) => + makeStrongCacheSync((index: number) => + buildOverrideDescriptors( + preset, + preset.alias, + createUncachedDescriptors, + index, + ), ), - ), ); -const loadPresetOverridesEnvDescriptors = makeWeakCache( +const loadPresetOverridesEnvDescriptors = makeWeakCacheSync( (preset: PresetInstance) => - makeStrongCache((index: number) => - makeStrongCache((envName: string) => + makeStrongCacheSync((index: number) => + makeStrongCacheSync((envName: string) => buildOverrideEnvDescriptors( preset, preset.alias, @@ -129,11 +131,11 @@ export type RootConfigChain = ConfigChain & { /** * Build a config chain for Babel's full root configuration. */ -export function buildRootChain( +export function* buildRootChain( opts: ValidatedOptions, context: ConfigContext, -): RootConfigChain | null { - const programmaticChain = loadProgrammaticChain( +): Handler { + const programmaticChain = yield* loadProgrammaticChain( { options: opts, dirname: context.cwd, @@ -144,14 +146,18 @@ export function buildRootChain( let configFile; if (typeof opts.configFile === "string") { - configFile = loadConfig( + configFile = yield* loadConfig( opts.configFile, context.cwd, context.envName, context.caller, ); } else if (opts.configFile !== false) { - configFile = findRootConfig(context.root, context.envName, context.caller); + configFile = yield* findRootConfig( + context.root, + context.envName, + context.caller, + ); } let { babelrc, babelrcRoots } = opts; @@ -160,7 +166,7 @@ export function buildRootChain( const configFileChain = emptyChain(); if (configFile) { const validatedFile = validateConfigFile(configFile); - const result = loadFileChain(validatedFile, context); + const result = yield* loadFileChain(validatedFile, context); if (!result) return null; // Allow config files to toggle `.babelrc` resolution on and off and @@ -178,7 +184,7 @@ export function buildRootChain( const pkgData = typeof context.filename === "string" - ? findPackageData(context.filename) + ? yield* findPackageData(context.filename) : null; let ignoreFile, babelrcFile; @@ -189,7 +195,7 @@ export function buildRootChain( pkgData && babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory) ) { - ({ ignore: ignoreFile, config: babelrcFile } = findRelativeConfig( + ({ ignore: ignoreFile, config: babelrcFile } = yield* findRelativeConfig( pkgData, context.envName, context.caller, @@ -203,7 +209,10 @@ export function buildRootChain( } if (babelrcFile) { - const result = loadFileChain(validateBabelrcFile(babelrcFile), context); + const result = yield* loadFileChain( + validateBabelrcFile(babelrcFile), + context, + ); if (!result) return null; mergeChain(fileChain, result); @@ -268,13 +277,15 @@ function babelrcLoadEnabled( }); } -const validateConfigFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("configfile", file.options), -})); +const validateConfigFile = makeWeakCacheSync( + (file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("configfile", file.options), + }), +); -const validateBabelrcFile = makeWeakCache( +const validateBabelrcFile = makeWeakCacheSync( (file: ConfigFile): ValidatedFile => ({ filepath: file.filepath, dirname: file.dirname, @@ -282,11 +293,13 @@ const validateBabelrcFile = makeWeakCache( }), ); -const validateExtendFile = makeWeakCache((file: ConfigFile): ValidatedFile => ({ - filepath: file.filepath, - dirname: file.dirname, - options: validate("extendsfile", file.options), -})); +const validateExtendFile = makeWeakCacheSync( + (file: ConfigFile): ValidatedFile => ({ + filepath: file.filepath, + dirname: file.dirname, + options: validate("extendsfile", file.options), + }), +); /** * Build a config chain for just the programmatic options passed into Babel. @@ -317,11 +330,11 @@ const loadFileChain = makeChainWalker({ overridesEnv: (file, index, envName) => loadFileOverridesEnvDescriptors(file)(index)(envName), }); -const loadFileDescriptors = makeWeakCache((file: ValidatedFile) => +const loadFileDescriptors = makeWeakCacheSync((file: ValidatedFile) => buildRootDescriptors(file, file.filepath, createUncachedDescriptors), ); -const loadFileEnvDescriptors = makeWeakCache((file: ValidatedFile) => - makeStrongCache((envName: string) => +const loadFileEnvDescriptors = makeWeakCacheSync((file: ValidatedFile) => + makeStrongCacheSync((envName: string) => buildEnvDescriptors( file, file.filepath, @@ -330,8 +343,8 @@ const loadFileEnvDescriptors = makeWeakCache((file: ValidatedFile) => ), ), ); -const loadFileOverridesDescriptors = makeWeakCache((file: ValidatedFile) => - makeStrongCache((index: number) => +const loadFileOverridesDescriptors = makeWeakCacheSync((file: ValidatedFile) => + makeStrongCacheSync((index: number) => buildOverrideDescriptors( file, file.filepath, @@ -340,18 +353,19 @@ const loadFileOverridesDescriptors = makeWeakCache((file: ValidatedFile) => ), ), ); -const loadFileOverridesEnvDescriptors = makeWeakCache((file: ValidatedFile) => - makeStrongCache((index: number) => - makeStrongCache((envName: string) => - buildOverrideEnvDescriptors( - file, - file.filepath, - createUncachedDescriptors, - index, - envName, +const loadFileOverridesEnvDescriptors = makeWeakCacheSync( + (file: ValidatedFile) => + makeStrongCacheSync((index: number) => + makeStrongCacheSync((envName: string) => + buildOverrideEnvDescriptors( + file, + file.filepath, + createUncachedDescriptors, + index, + envName, + ), ), ), - ), ); function buildRootDescriptors({ dirname, options }, alias, descriptors) { @@ -410,8 +424,12 @@ function makeChainWalker({ env: (ArgT, string) => OptionsAndDescriptors | null, overrides: (ArgT, number) => OptionsAndDescriptors, overridesEnv: (ArgT, number, string) => OptionsAndDescriptors | null, -}): (ArgT, ConfigContext, Set | void) => ConfigChain | null { - return (input, context, files = new Set()) => { +}): ( + ArgT, + ConfigContext, + Set | void, +) => Handler { + return function*(input, context, files = new Set()) { const { dirname } = input; const flattenedConfigs = []; @@ -455,7 +473,9 @@ function makeChainWalker({ const chain = emptyChain(); for (const op of flattenedConfigs) { - if (!mergeExtendsChain(chain, op.options, dirname, context, files)) { + if ( + !(yield* mergeExtendsChain(chain, op.options, dirname, context, files)) + ) { return null; } @@ -465,16 +485,16 @@ function makeChainWalker({ }; } -function mergeExtendsChain( +function* mergeExtendsChain( chain: ConfigChain, opts: ValidatedOptions, dirname: string, context: ConfigContext, files: Set, -): boolean { +): Handler { if (opts.extends === undefined) return true; - const file = loadConfig( + const file = yield* loadConfig( opts.extends, dirname, context.envName, @@ -490,7 +510,11 @@ function mergeExtendsChain( } files.add(file); - const fileChain = loadFileChain(validateExtendFile(file), context, files); + const fileChain = yield* loadFileChain( + validateExtendFile(file), + context, + files, + ); files.delete(file); if (!fileChain) return false; diff --git a/packages/babel-core/src/config/config-descriptors.js b/packages/babel-core/src/config/config-descriptors.js index d9218a87c020..fa60d47d7139 100644 --- a/packages/babel-core/src/config/config-descriptors.js +++ b/packages/babel-core/src/config/config-descriptors.js @@ -5,8 +5,8 @@ import { loadPlugin, loadPreset } from "./files"; import { getItemDescriptor } from "./item"; import { - makeWeakCache, - makeStrongCache, + makeWeakCacheSync, + makeStrongCacheSync, type CacheConfigurator, } from "./caching"; @@ -130,11 +130,11 @@ export function createUncachedDescriptors( } const PRESET_DESCRIPTOR_CACHE = new WeakMap(); -const createCachedPresetDescriptors = makeWeakCache( +const createCachedPresetDescriptors = makeWeakCacheSync( (items: PluginList, cache: CacheConfigurator) => { const dirname = cache.using(dir => dir); - return makeStrongCache((alias: string) => - makeStrongCache((passPerPreset: boolean) => + return makeStrongCacheSync((alias: string) => + makeStrongCacheSync((passPerPreset: boolean) => createPresetDescriptors(items, dirname, alias, passPerPreset).map( // Items are cached using the overall preset array identity when // possibly, but individual descriptors are also cached if a match @@ -147,10 +147,10 @@ const createCachedPresetDescriptors = makeWeakCache( ); const PLUGIN_DESCRIPTOR_CACHE = new WeakMap(); -const createCachedPluginDescriptors = makeWeakCache( +const createCachedPluginDescriptors = makeWeakCacheSync( (items: PluginList, cache: CacheConfigurator) => { const dirname = cache.using(dir => dir); - return makeStrongCache((alias: string) => + return makeStrongCacheSync((alias: string) => createPluginDescriptors(items, dirname, alias).map( // Items are cached using the overall plugin array identity when // possibly, but individual descriptors are also cached if a match diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js index 06c304d6b79e..035da8eb3681 100644 --- a/packages/babel-core/src/config/files/configuration.js +++ b/packages/babel-core/src/config/files/configuration.js @@ -2,12 +2,11 @@ import buildDebug from "debug"; import path from "path"; -import fs from "fs"; import json5 from "json5"; -import resolve from "resolve"; +import gensync, { type Handler } from "gensync"; import { makeStrongCache, - makeWeakCache, + makeWeakCacheSync, type CacheConfigurator, } from "../caching"; import makeAPI, { type PluginAPI } from "../helpers/config-api"; @@ -16,6 +15,9 @@ import pathPatternToRegex from "../pattern-to-regex"; import type { FilePackageData, RelativeConfig, ConfigFile } from "./types"; import type { CallerMetadata } from "../validation/options"; +import * as fs from "../../gensync-utils/fs"; +import resolve from "../../gensync-utils/resolve"; + const debug = buildDebug("babel:config:loading:files:configuration"); export const ROOT_CONFIG_FILENAMES = [ @@ -27,13 +29,14 @@ const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs"]; const BABELIGNORE_FILENAME = ".babelignore"; -export function findConfigUpwards(rootDir: string): string | null { +export function* findConfigUpwards(rootDir: string): Handler { let dirname = rootDir; while (true) { - const configFileFound = ROOT_CONFIG_FILENAMES.some(filename => - fs.existsSync(path.join(dirname, filename)), - ); - if (configFileFound) return dirname; + for (const filename of ROOT_CONFIG_FILENAMES) { + if (yield* fs.exists(path.join(dirname, filename))) { + return dirname; + } + } const nextDir = path.dirname(dirname); if (dirname === nextDir) break; @@ -43,11 +46,11 @@ export function findConfigUpwards(rootDir: string): string | null { return null; } -export function findRelativeConfig( +export function* findRelativeConfig( packageData: FilePackageData, envName: string, caller: CallerMetadata | void, -): RelativeConfig { +): Handler { let config = null; let ignore = null; @@ -55,7 +58,7 @@ export function findRelativeConfig( for (const loc of packageData.directories) { if (!config) { - config = loadOneConfig( + config = yield* loadOneConfig( RELATIVE_CONFIG_FILENAMES, loc, envName, @@ -68,7 +71,7 @@ export function findRelativeConfig( if (!ignore) { const ignoreLoc = path.join(loc, BABELIGNORE_FILENAME); - ignore = readIgnoreConfig(ignoreLoc); + ignore = yield* readIgnoreConfig(ignoreLoc); if (ignore) { debug("Found ignore %o from %o.", ignore.filepath, dirname); @@ -83,26 +86,28 @@ export function findRootConfig( dirname: string, envName: string, caller: CallerMetadata | void, -): ConfigFile | null { +): Handler { return loadOneConfig(ROOT_CONFIG_FILENAMES, dirname, envName, caller); } -function loadOneConfig( +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); - +): Handler { + const configs = yield* gensync.all( + names.map(filename => + readConfig(path.join(dirname, filename), envName, caller), + ), + ); + const config = configs.reduce((previousConfig: ConfigFile | null, config) => { if (config && previousConfig) { throw new Error( `Multiple configuration files found. Please remove one:\n` + ` - ${path.basename(previousConfig.filepath)}\n` + - ` - ${name}\n` + + ` - ${config.filepath}\n` + `from ${dirname}`, ); } @@ -116,15 +121,15 @@ function loadOneConfig( return config; } -export function loadConfig( +export function* loadConfig( name: string, dirname: string, envName: string, caller: CallerMetadata | void, -): ConfigFile { - const filepath = resolve.sync(name, { basedir: dirname }); +): Handler { + const filepath = yield* resolve(name, { basedir: dirname }); - const conf = readConfig(filepath, envName, caller); + const conf = yield* readConfig(filepath, envName, caller); if (!conf) { throw new Error(`Config file ${filepath} contains no configuration data`); } @@ -137,7 +142,7 @@ export function loadConfig( * Read the given config file, returning the result. Returns null if no config was found, but will * throw if there are parsing errors while loading a config. */ -function readConfig(filepath, envName, caller): ConfigFile | null { +function readConfig(filepath, envName, caller) { const ext = path.extname(filepath); return ext === ".js" || ext === ".cjs" ? readConfigJS(filepath, { envName, caller }) @@ -146,81 +151,84 @@ function readConfig(filepath, envName, caller): ConfigFile | null { const LOADING_CONFIGS = new Set(); -const readConfigJS = makeStrongCache( - ( - filepath: string, - cache: CacheConfigurator<{ - envName: string, - caller: CallerMetadata | void, - }>, - ) => { - if (!fs.existsSync(filepath)) { - cache.forever(); - return null; - } +const readConfigJS = makeStrongCache(function* readConfigJS( + filepath: string, + cache: CacheConfigurator<{ + envName: string, + caller: CallerMetadata | void, + }>, +): Handler { + if (!fs.exists.sync(filepath)) { + cache.forever(); + return null; + } - // The `require()` call below can make this code reentrant if a require hook like @babel/register has been - // loaded into the system. That would cause Babel to attempt to compile the `.babelrc.js` file as it loads - // below. To cover this case, we auto-ignore re-entrant config processing. - if (LOADING_CONFIGS.has(filepath)) { - cache.never(); - - debug("Auto-ignoring usage of config %o.", filepath); - return { - filepath, - dirname: path.dirname(filepath), - options: {}, - }; - } + // The `require()` call below can make this code reentrant if a require hook like @babel/register has been + // loaded into the system. That would cause Babel to attempt to compile the `.babelrc.js` file as it loads + // below. To cover this case, we auto-ignore re-entrant config processing. + if (LOADING_CONFIGS.has(filepath)) { + cache.never(); - let options; - try { - LOADING_CONFIGS.add(filepath); - - // $FlowIssue - const configModule = (require(filepath): mixed); - options = - configModule && configModule.__esModule - ? configModule.default || undefined - : configModule; - } catch (err) { - err.message = `${filepath}: Error while loading config - ${err.message}`; - throw err; - } finally { - LOADING_CONFIGS.delete(filepath); - } + debug("Auto-ignoring usage of config %o.", filepath); + return { + filepath, + dirname: path.dirname(filepath), + options: {}, + }; + } - if (typeof options === "function") { - options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache)); + let options; + try { + LOADING_CONFIGS.add(filepath); + + yield* []; // If we want to allow mjs configs imported using `import()` + // $FlowIssue + const configModule = (require(filepath): mixed); + options = + configModule && configModule.__esModule + ? configModule.default || undefined + : configModule; + } catch (err) { + err.message = `${filepath}: Error while loading config - ${err.message}`; + throw err; + } finally { + LOADING_CONFIGS.delete(filepath); + } - if (!cache.configured()) throwConfigError(); - } + let assertCache = false; + if (typeof options === "function") { + yield* []; // if we want to make it possible to use async configs + options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache)); - if (!options || typeof options !== "object" || Array.isArray(options)) { - throw new Error( - `${filepath}: Configuration should be an exported JavaScript object.`, - ); - } + assertCache = true; + } - if (typeof options.then === "function") { - throw new Error( - `You appear to be using an async configuration, ` + - `which your current version of Babel does not support. ` + - `We may add support for this in the future, ` + - `but if you're on the most recent version of @babel/core and still ` + - `seeing this error, then you'll need to synchronously return your config.`, - ); - } + if (!options || typeof options !== "object" || Array.isArray(options)) { + throw new Error( + `${filepath}: Configuration should be an exported JavaScript object.`, + ); + } - return { - filepath, - dirname: path.dirname(filepath), - options, - }; - }, -); + if (typeof options.then === "function") { + throw new Error( + `You appear to be using an async configuration, ` + + `which your current version of Babel does not support. ` + + `We may add support for this in the future, ` + + `but if you're on the most recent version of @babel/core and still ` + + `seeing this error, then you'll need to synchronously return your config.`, + ); + } + + if (assertCache && !cache.configured()) throwConfigError(); + + return { + filepath, + dirname: path.dirname(filepath), + options, + }; +}); -const packageToBabelConfig = makeWeakCache( +const packageToBabelConfig = makeWeakCacheSync( (file: ConfigFile): ConfigFile | null => { const babel = file.options[("babel": string)]; diff --git a/packages/babel-core/src/config/files/index-browser.js b/packages/babel-core/src/config/files/index-browser.js index b21b43e7778d..8e3a8cf26ce2 100644 --- a/packages/babel-core/src/config/files/index-browser.js +++ b/packages/babel-core/src/config/files/index-browser.js @@ -1,5 +1,7 @@ // @flow +import type { Handler } from "gensync"; + import type { ConfigFile, IgnoreFile, @@ -11,13 +13,15 @@ import type { CallerMetadata } from "../validation/options"; export type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData }; -export function findConfigUpwards( +// eslint-disable-next-line require-yield +export function* findConfigUpwards( rootDir: string, // eslint-disable-line no-unused-vars -): string | null { +): Handler { return null; } -export function findPackageData(filepath: string): FilePackageData { +// eslint-disable-next-line require-yield +export function* findPackageData(filepath: string): Handler { return { filepath, directories: [], @@ -26,28 +30,31 @@ export function findPackageData(filepath: string): FilePackageData { }; } -export function findRelativeConfig( +// eslint-disable-next-line require-yield +export function* findRelativeConfig( pkgData: FilePackageData, // eslint-disable-line no-unused-vars envName: string, // eslint-disable-line no-unused-vars caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): RelativeConfig { +): Handler { return { pkg: null, config: null, ignore: null }; } -export function findRootConfig( +// eslint-disable-next-line require-yield +export function* findRootConfig( dirname: string, // eslint-disable-line no-unused-vars envName: string, // eslint-disable-line no-unused-vars caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): ConfigFile | null { +): Handler { return null; } -export function loadConfig( +// eslint-disable-next-line require-yield +export function* loadConfig( name: string, dirname: string, envName: string, // eslint-disable-line no-unused-vars caller: CallerMetadata | void, // eslint-disable-line no-unused-vars -): ConfigFile { +): Handler { throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`); } diff --git a/packages/babel-core/src/config/files/package.js b/packages/babel-core/src/config/files/package.js index 8e370a472d56..278ddfb852f5 100644 --- a/packages/babel-core/src/config/files/package.js +++ b/packages/babel-core/src/config/files/package.js @@ -1,6 +1,7 @@ // @flow import path from "path"; +import type { Handler } from "gensync"; import { makeStaticFileCache } from "./utils"; import type { ConfigFile, FilePackageData } from "./types"; @@ -12,7 +13,7 @@ const PACKAGE_FILENAME = "package.json"; * of Babel's config requires general package information to decide when to * search for .babelrc files */ -export function findPackageData(filepath: string): FilePackageData { +export function* findPackageData(filepath: string): Handler { let pkg = null; const directories = []; let isPackage = true; @@ -21,7 +22,7 @@ export function findPackageData(filepath: string): FilePackageData { while (!pkg && path.basename(dirname) !== "node_modules") { directories.push(dirname); - pkg = readConfigPackage(path.join(dirname, PACKAGE_FILENAME)); + pkg = yield* readConfigPackage(path.join(dirname, PACKAGE_FILENAME)); const nextLoc = path.dirname(dirname); if (dirname === nextLoc) { diff --git a/packages/babel-core/src/config/files/utils.js b/packages/babel-core/src/config/files/utils.js index db202259d5e8..61c3b24a7a4a 100644 --- a/packages/babel-core/src/config/files/utils.js +++ b/packages/babel-core/src/config/files/utils.js @@ -1,24 +1,32 @@ // @flow -import fs from "fs"; -import { makeStrongCache } from "../caching"; +import type { Gensync, Handler } from "gensync"; + +import { makeStrongCache, type CacheConfigurator } from "../caching"; +import * as fs from "../../gensync-utils/fs"; +import nodeFs from "fs"; export function makeStaticFileCache( fn: (string, string) => T, -): string => T | null { - return makeStrongCache((filepath, cache) => { - if (cache.invalidate(() => fileMtime(filepath)) === null) { +): Gensync<[string], T | null> { + return (makeStrongCache(function*( + filepath: string, + cache: CacheConfigurator, + ): Handler { + const cached = cache.invalidate(() => fileMtime(filepath)); + + if (cached === null) { cache.forever(); return null; } - return fn(filepath, fs.readFileSync(filepath, "utf8")); - }); + return fn(filepath, yield* fs.readFile(filepath, "utf8")); + }): Gensync); } function fileMtime(filepath: string): number | null { try { - return +fs.statSync(filepath).mtime; + return +nodeFs.statSync(filepath).mtime; } catch (e) { if (e.code !== "ENOENT" && e.code !== "ENOTDIR") throw e; } diff --git a/packages/babel-core/src/config/full.js b/packages/babel-core/src/config/full.js index d38aec4ba698..ab24a1936b87 100644 --- a/packages/babel-core/src/config/full.js +++ b/packages/babel-core/src/config/full.js @@ -1,5 +1,8 @@ // @flow +import gensync, { type Handler } from "gensync"; +import { forwardAsync } from "../gensync-utils/async"; + import { mergeOptions } from "./util"; import * as context from "../index"; import Plugin from "./plugin"; @@ -12,7 +15,11 @@ import { } from "./config-chain"; import type { UnloadedDescriptor } from "./config-descriptors"; import traverse from "@babel/traverse"; -import { makeWeakCache, type CacheConfigurator } from "./caching"; +import { + makeWeakCache, + makeWeakCacheSync, + type CacheConfigurator, +} from "./caching"; import { validate, type CallerMetadata } from "./validation/options"; import { validatePluginObject } from "./validation/plugins"; import makeAPI from "./helpers/config-api"; @@ -45,10 +52,10 @@ type SimpleContext = { caller: CallerMetadata | void, }; -export default function loadFullConfig( +export default gensync<[any], ResolvedConfig | null>(function* loadFullConfig( inputOpts: mixed, -): ResolvedConfig | null { - const result = loadPrivatePartialConfig(inputOpts); +): Handler { + const result = yield* loadPrivatePartialConfig(inputOpts); if (!result) { return null; } @@ -63,28 +70,29 @@ export default function loadFullConfig( throw new Error("Assertion failure - plugins and presets exist"); } - const ignored = (function recurseDescriptors( + const ignored = yield* (function* recurseDescriptors( config: { plugins: Array, presets: Array, }, pass: Array, ) { - const plugins = config.plugins.reduce((acc, descriptor) => { + const plugins = []; + for (const descriptor of config.plugins) { if (descriptor.options !== false) { - acc.push(loadPluginDescriptor(descriptor, context)); + plugins.push(yield* loadPluginDescriptor(descriptor, context)); } - return acc; - }, []); - const presets = config.presets.reduce((acc, descriptor) => { + } + + const presets = []; + for (const descriptor of config.presets) { if (descriptor.options !== false) { - acc.push({ - preset: loadPresetDescriptor(descriptor, context), + presets.push({ + preset: yield* loadPresetDescriptor(descriptor, context), pass: descriptor.ownPass ? [] : pass, }); } - return acc; - }, []); + } // resolve presets if (presets.length > 0) { @@ -99,7 +107,7 @@ export default function loadFullConfig( for (const { preset, pass } of presets) { if (!preset) return true; - const ignored = recurseDescriptors( + const ignored = yield* recurseDescriptors( { plugins: preset.plugins, presets: preset.presets, @@ -165,61 +173,61 @@ export default function loadFullConfig( options: opts, passes: passes, }; -} +}); /** * Load a generic plugin/preset from the given descriptor loaded from the config object. */ -const loadDescriptor = makeWeakCache( - ( - { value, options, dirname, alias }: UnloadedDescriptor, - cache: CacheConfigurator, - ): LoadedDescriptor => { - // Disabled presets should already have been filtered out - if (options === false) throw new Error("Assertion failure"); - - options = options || {}; - - let item = value; - if (typeof value === "function") { - const api = { - ...context, - ...makeAPI(cache), - }; - try { - item = value(api, options, dirname); - } catch (e) { - if (alias) { - e.message += ` (While processing: ${JSON.stringify(alias)})`; - } - throw e; +const loadDescriptor = makeWeakCache(function*( + { value, options, dirname, alias }: UnloadedDescriptor, + cache: CacheConfigurator, +): Handler { + // Disabled presets should already have been filtered out + if (options === false) throw new Error("Assertion failure"); + + options = options || {}; + + let item = value; + if (typeof value === "function") { + const api = { + ...context, + ...makeAPI(cache), + }; + try { + item = value(api, options, dirname); + } catch (e) { + if (alias) { + e.message += ` (While processing: ${JSON.stringify(alias)})`; } + throw e; } + } - if (!item || typeof item !== "object") { - throw new Error("Plugin/Preset did not return an object."); - } + if (!item || typeof item !== "object") { + throw new Error("Plugin/Preset did not return an object."); + } - if (typeof item.then === "function") { - throw new Error( - `You appear to be using an async plugin, ` + - `which your current version of Babel does not support. ` + - `If you're using a published plugin, ` + - `you may need to upgrade your @babel/core version.`, - ); - } + if (typeof item.then === "function") { + yield* []; // if we want to support async plugins - return { value: item, options, dirname, alias }; - }, -); + throw new Error( + `You appear to be using an async plugin, ` + + `which your current version of Babel does not support. ` + + `If you're using a published plugin, ` + + `you may need to upgrade your @babel/core version.`, + ); + } + + return { value: item, options, dirname, alias }; +}); /** * Instantiate a plugin for the given descriptor, returning the plugin/options pair. */ -function loadPluginDescriptor( +function* loadPluginDescriptor( descriptor: UnloadedDescriptor, context: SimpleContext, -): Plugin { +): Handler { if (descriptor.value instanceof Plugin) { if (descriptor.options) { throw new Error( @@ -230,54 +238,55 @@ function loadPluginDescriptor( return descriptor.value; } - return instantiatePlugin(loadDescriptor(descriptor, context), context); + return yield* instantiatePlugin( + yield* loadDescriptor(descriptor, context), + context, + ); } -const instantiatePlugin = makeWeakCache( - ( - { value, options, dirname, alias }: LoadedDescriptor, - cache: CacheConfigurator, - ): Plugin => { - const pluginObj = validatePluginObject(value); +const instantiatePlugin = makeWeakCache(function*( + { value, options, dirname, alias }: LoadedDescriptor, + cache: CacheConfigurator, +): Handler { + const pluginObj = validatePluginObject(value); - const plugin = { - ...pluginObj, - }; - if (plugin.visitor) { - plugin.visitor = traverse.explode({ - ...plugin.visitor, - }); - } + const plugin = { + ...pluginObj, + }; + if (plugin.visitor) { + plugin.visitor = traverse.explode({ + ...plugin.visitor, + }); + } - if (plugin.inherits) { - const inheritsDescriptor = { - name: undefined, - alias: `${alias}$inherits`, - value: plugin.inherits, - options, - dirname, - }; + if (plugin.inherits) { + const inheritsDescriptor = { + name: undefined, + alias: `${alias}$inherits`, + value: plugin.inherits, + options, + dirname, + }; + const inherits = yield* forwardAsync(loadPluginDescriptor, run => { // If the inherited plugin changes, reinstantiate this plugin. - const inherits = cache.invalidate(data => - loadPluginDescriptor(inheritsDescriptor, data), - ); + return cache.invalidate(data => run(inheritsDescriptor, data)); + }); + + plugin.pre = chain(inherits.pre, plugin.pre); + plugin.post = chain(inherits.post, plugin.post); + plugin.manipulateOptions = chain( + inherits.manipulateOptions, + plugin.manipulateOptions, + ); + plugin.visitor = traverse.visitors.merge([ + inherits.visitor || {}, + plugin.visitor || {}, + ]); + } - plugin.pre = chain(inherits.pre, plugin.pre); - plugin.post = chain(inherits.post, plugin.post); - plugin.manipulateOptions = chain( - inherits.manipulateOptions, - plugin.manipulateOptions, - ); - plugin.visitor = traverse.visitors.merge([ - inherits.visitor || {}, - plugin.visitor || {}, - ]); - } - - return new Plugin(plugin, options, alias); - }, -); + return new Plugin(plugin, options, alias); +}); const validateIfOptionNeedsFilename = ( options: ValidatedOptions, @@ -318,16 +327,16 @@ const validatePreset = ( /** * Generate a config object that will act as the root of a new nested config. */ -const loadPresetDescriptor = ( +function* loadPresetDescriptor( descriptor: UnloadedDescriptor, context: ConfigContext, -): ConfigChain | null => { - const preset = instantiatePreset(loadDescriptor(descriptor, context)); +): Handler { + const preset = instantiatePreset(yield* loadDescriptor(descriptor, context)); validatePreset(preset, context, descriptor); - return buildPresetChain(preset, context); -}; + return yield* buildPresetChain(preset, context); +} -const instantiatePreset = makeWeakCache( +const instantiatePreset = makeWeakCacheSync( ({ value, dirname, alias }: LoadedDescriptor): PresetInstance => { return { options: validate("preset", value), diff --git a/packages/babel-core/src/config/index.js b/packages/babel-core/src/config/index.js index 51016d34c757..11888a48ec7c 100644 --- a/packages/babel-core/src/config/index.js +++ b/packages/babel-core/src/config/index.js @@ -1,6 +1,7 @@ // @flow -import loadFullConfig from "./full"; +import gensync from "gensync"; + export type { ResolvedConfig, InputOptions, @@ -8,12 +9,29 @@ export type { Plugin, } from "./full"; +import loadFullConfig from "./full"; +import { loadPartialConfig as loadPartialConfigRunner } from "./partial"; + export { loadFullConfig as default }; -export { loadPartialConfig } from "./partial"; export type { PartialConfig } from "./partial"; -export function loadOptions(opts: {}): Object | null { - const config = loadFullConfig(opts); - +const loadOptionsRunner = gensync<[mixed], Object | null>(function*(opts) { + const config = yield* loadFullConfig(opts); return config ? config.options : null; -} +}); + +const maybeErrback = runner => (opts: mixed, callback: Function) => { + if (callback === undefined && typeof opts === "function") { + callback = opts; + opts = undefined; + } + return callback ? runner.errback(opts, callback) : runner.sync(opts); +}; + +export const loadPartialConfig = maybeErrback(loadPartialConfigRunner); +export const loadPartialConfigSync = loadPartialConfigRunner.sync; +export const loadPartialConfigAsync = loadPartialConfigRunner.async; + +export const loadOptions = maybeErrback(loadOptionsRunner); +export const loadOptionsSync = loadOptionsRunner.sync; +export const loadOptionsAsync = loadOptionsRunner.async; diff --git a/packages/babel-core/src/config/partial.js b/packages/babel-core/src/config/partial.js index 2cf96e8653ed..615f3dc08b73 100644 --- a/packages/babel-core/src/config/partial.js +++ b/packages/babel-core/src/config/partial.js @@ -1,6 +1,7 @@ // @flow import path from "path"; +import gensync, { type Handler } from "gensync"; import Plugin from "./plugin"; import { mergeOptions } from "./util"; import { createItemFromDescriptor } from "./item"; @@ -19,18 +20,21 @@ import { type IgnoreFile, } from "./files"; -function resolveRootMode(rootDir: string, rootMode: RootMode): string { +function* resolveRootMode( + rootDir: string, + rootMode: RootMode, +): Handler { switch (rootMode) { case "root": return rootDir; case "upward-optional": { - const upwardRootDir = findConfigUpwards(rootDir); + const upwardRootDir = yield* findConfigUpwards(rootDir); return upwardRootDir === null ? rootDir : upwardRootDir; } case "upward": { - const upwardRootDir = findConfigUpwards(rootDir); + const upwardRootDir = yield* findConfigUpwards(rootDir); if (upwardRootDir !== null) return upwardRootDir; throw Object.assign( @@ -51,15 +55,17 @@ function resolveRootMode(rootDir: string, rootMode: RootMode): string { } } -export default function loadPrivatePartialConfig( - inputOpts: mixed, -): { +type PrivPartialConfig = { options: ValidatedOptions, context: ConfigContext, ignore: IgnoreFile | void, babelrc: ConfigFile | void, config: ConfigFile | void, -} | null { +}; + +export default function* loadPrivatePartialConfig( + inputOpts: mixed, +): Handler { if ( inputOpts != null && (typeof inputOpts !== "object" || Array.isArray(inputOpts)) @@ -77,7 +83,7 @@ export default function loadPrivatePartialConfig( caller, } = args; const absoluteCwd = path.resolve(cwd); - const absoluteRootDir = resolveRootMode( + const absoluteRootDir = yield* resolveRootMode( path.resolve(absoluteCwd, rootDir), rootMode, ); @@ -93,7 +99,7 @@ export default function loadPrivatePartialConfig( caller, }; - const configChain = buildRootChain(args, context); + const configChain = yield* buildRootChain(args, context); if (!configChain) return null; const options = {}; @@ -129,8 +135,10 @@ export default function loadPrivatePartialConfig( }; } -export function loadPartialConfig(inputOpts: mixed): PartialConfig | null { - const result = loadPrivatePartialConfig(inputOpts); +export const loadPartialConfig = gensync<[any], PartialConfig | null>(function*( + inputOpts: mixed, +): Handler { + const result: ?PrivPartialConfig = yield* loadPrivatePartialConfig(inputOpts); if (!result) return null; const { options, babelrc, ignore, config } = result; @@ -150,7 +158,7 @@ export function loadPartialConfig(inputOpts: mixed): PartialConfig | null { ignore ? ignore.filepath : undefined, config ? config.filepath : undefined, ); -} +}); export type { PartialConfig }; diff --git a/packages/babel-core/src/config/util.js b/packages/babel-core/src/config/util.js index f64975216db3..b9d3af143dd3 100644 --- a/packages/babel-core/src/config/util.js +++ b/packages/babel-core/src/config/util.js @@ -28,3 +28,14 @@ function mergeDefaultFields(target: T, source: T) { if (val !== undefined) target[k] = (val: any); } } + +export function isIterableIterator(value: mixed): boolean %checks { + return ( + /*:: value instanceof Generator && */ + // /*:: "@@iterator" in value && */ + !!value && + typeof value.next === "function" && + // $FlowIgnore + typeof value[Symbol.iterator] === "function" + ); +} diff --git a/packages/babel-core/src/gensync-utils/async.js b/packages/babel-core/src/gensync-utils/async.js new file mode 100644 index 000000000000..84edcc394135 --- /dev/null +++ b/packages/babel-core/src/gensync-utils/async.js @@ -0,0 +1,110 @@ +// @flow + +import gensync, { type Gensync, type Handler } from "gensync"; + +type MaybePromise = T | Promise; + +const id = x => x; + +const runGenerator = gensync(function*(item) { + return yield* item; +}); + +// This Gensync returns true if the current execution contect is +// asynchronous, otherwise it returns false. +export const isAsync = gensync<[], boolean>({ + sync: () => false, + errback: cb => cb(null, true), +}); + +// This function wraps any functions (which could be either synchronous or +// asynchronous) with a Gensync. If the wrapped function returns a promise +// but the current execution context is synchronous, it will throw the +// provided error. +// This is used to handle user-provided functions which could be asynchronous. +export function maybeAsync( + fn: (...args: Args) => T, + message: string, +): Gensync { + return gensync({ + sync(...args) { + const result = fn.apply(this, args); + if (isThenable(result)) throw new Error(message); + return result; + }, + async(...args) { + return Promise.resolve(fn.apply(this, args)); + }, + }); +} + +const withKind = (gensync<[any], any>({ + sync: cb => cb("sync"), + async: cb => cb("async"), +}): (cb: (kind: "sync" | "async") => MaybePromise) => Handler); + +// This function wraps a generator (or a Gensync) into another function which, +// when called, will run the provided generator in a sync or async way, depending +// on the execution context where this forwardAsync function is called. +// This is useful, for example, when passing a callback to a function which isn't +// aware of gensync, but it only knows about synchronous and asynchronous functions. +// An example is cache.using, which being exposed to the user must be as simple as +// possible: +// yield* forwardAsync(gensyncFn, wrappedFn => +// cache.using(x => { +// // Here we don't know about gensync. wrappedFn is a +// // normal sync or async function +// return wrappedFn(x); +// }) +// ) +export function forwardAsync( + action: (...args: ActionArgs) => Handler, + cb: ( + adapted: (...args: ActionArgs) => MaybePromise, + ) => MaybePromise, +): Handler { + const g = gensync(action); + return withKind(kind => { + const adapted = g[kind]; + return cb(adapted); + }); +} + +// If the given generator is executed asynchronously, the first time that it +// is paused (i.e. When it yields a gensync generator which can't be run +// synchronously), call the "firstPause" callback. +export const onFirstPause = (gensync<[any, any], any>({ + name: "onFirstPause", + arity: 2, + sync: function(item) { + return runGenerator.sync(item); + }, + errback: function(item, firstPause, cb) { + let completed = false; + + runGenerator.errback(item, (err, value) => { + completed = true; + cb(err, value); + }); + + if (!completed) { + firstPause(); + } + }, +}): (gen: Generator<*, T, *>, cb: Function) => Handler); + +// Wait for the given promise to be resolved +export const waitFor = (gensync<[any], any>({ + sync: id, + async: id, +}): (p: T | Promise) => Handler); + +export function isThenable(val: mixed): boolean %checks { + return ( + /*:: val instanceof Promise && */ + !!val && + (typeof val === "object" || typeof val === "function") && + !!val.then && + typeof val.then === "function" + ); +} diff --git a/packages/babel-core/src/gensync-utils/fs.js b/packages/babel-core/src/gensync-utils/fs.js new file mode 100644 index 000000000000..6b8f60c7b145 --- /dev/null +++ b/packages/babel-core/src/gensync-utils/fs.js @@ -0,0 +1,21 @@ +// @flow + +import fs from "fs"; +import gensync from "gensync"; + +export const readFile = gensync<[string, "utf8"], string>({ + sync: fs.readFileSync, + errback: fs.readFile, +}); + +export const exists = gensync<[string], boolean>({ + sync(path) { + try { + fs.accessSync(path); + return true; + } catch { + return false; + } + }, + errback: (path, cb) => fs.access(path, undefined, err => cb(null, !err)), +}); diff --git a/packages/babel-core/src/gensync-utils/resolve.js b/packages/babel-core/src/gensync-utils/resolve.js new file mode 100644 index 000000000000..d16f6e7c4b2c --- /dev/null +++ b/packages/babel-core/src/gensync-utils/resolve.js @@ -0,0 +1,9 @@ +// @flow + +import resolve from "resolve"; +import gensync from "gensync"; + +export default gensync<[string, {| basedir: string |}], string>({ + sync: resolve.sync, + errback: resolve, +}); diff --git a/packages/babel-core/src/index.js b/packages/babel-core/src/index.js index 888a8096d5cc..23d023b5cabd 100644 --- a/packages/babel-core/src/index.js +++ b/packages/babel-core/src/index.js @@ -15,7 +15,14 @@ export { default as template } from "@babel/template"; export { createConfigItem } from "./config/item"; -export { loadPartialConfig, loadOptions } from "./config"; +export { + loadPartialConfig, + loadPartialConfigSync, + loadPartialConfigAsync, + loadOptions, + loadOptionsSync, + loadOptionsAsync, +} from "./config"; export { transform, transformSync, transformAsync } from "./transform"; export { diff --git a/packages/babel-core/src/parse.js b/packages/babel-core/src/parse.js index 6c82fe75ad5f..3609df763530 100644 --- a/packages/babel-core/src/parse.js +++ b/packages/babel-core/src/parse.js @@ -1,5 +1,7 @@ // @flow +import gensync from "gensync"; + import loadConfig, { type InputOptions } from "./config"; import parser from "./parser"; import type { ParseResult } from "./parser"; @@ -19,6 +21,18 @@ type Parse = { (code: string, opts: ?InputOptions): ParseResult | null, }; +const parseRunner = gensync<[string, ?InputOptions], ParseResult | null>( + function* parse(code, opts) { + const config = yield* loadConfig(opts); + + if (config === null) { + return null; + } + + return yield* parser(config.passes, normalizeOptions(config), code); + }, +); + export const parse: Parse = (function parse(code, opts, callback) { if (typeof opts === "function") { callback = opts; @@ -27,55 +41,10 @@ export const parse: Parse = (function parse(code, opts, callback) { // For backward-compat with Babel 7's early betas, we allow sync parsing when // no callback is given. Will be dropped in some future Babel major version. - if (callback === undefined) return parseSync(code, opts); - - const config = loadConfig(opts); - - if (config === null) { - return null; - } + if (callback === undefined) return parseRunner.sync(code, opts); - // Reassign to keep Flowtype happy. - const cb = callback; - - // Just delaying the transform one tick for now to simulate async behavior - // but more async logic may land here eventually. - process.nextTick(() => { - let ast = null; - try { - const cfg = loadConfig(opts); - if (cfg === null) return cb(null, null); - - ast = parser(cfg.passes, normalizeOptions(cfg), code); - } catch (err) { - return cb(err); - } - - cb(null, ast); - }); + parseRunner.errback(code, opts, callback); }: Function); -export function parseSync( - code: string, - opts?: InputOptions, -): ParseResult | null { - const config = loadConfig(opts); - - if (config === null) { - return null; - } - - return parser(config.passes, normalizeOptions(config), code); -} - -export function parseAsync( - code: string, - opts?: InputOptions, -): Promise { - return new Promise((res, rej) => { - parse(code, opts, (err, result) => { - if (err == null) res(result); - else rej(err); - }); - }); -} +export const parseSync = parseRunner.sync; +export const parseAsync = parseRunner.async; diff --git a/packages/babel-core/src/parser/index.js b/packages/babel-core/src/parser/index.js index 499d465ea585..3ddf5ca4b64d 100644 --- a/packages/babel-core/src/parser/index.js +++ b/packages/babel-core/src/parser/index.js @@ -1,3 +1,4 @@ +import type { Handler } from "gensync"; import { parse } from "@babel/parser"; import { codeFrameColumns } from "@babel/code-frame"; import generateMissingPluginMessage from "./util/missing-plugin-helper"; @@ -6,11 +7,11 @@ type AstRoot = BabelNodeFile | BabelNodeProgram; export type ParseResult = AstRoot; -export default function parser( +export default function* parser( pluginPasses: PluginPasses, { parserOpts, highlightCode = true, filename = "unknown" }: Object, code: string, -): ParseResult { +): Handler { try { const results = []; for (const plugins of pluginPasses) { @@ -27,6 +28,7 @@ export default function parser( if (results.length === 0) { return parse(code, parserOpts); } else if (results.length === 1) { + yield* []; // If we want to allow async parsers if (typeof results[0].then === "function") { throw new Error( `You appear to be using an async parser plugin, ` + diff --git a/packages/babel-core/src/transform-ast.js b/packages/babel-core/src/transform-ast.js index 101177dcece9..9a40bda90d3a 100644 --- a/packages/babel-core/src/transform-ast.js +++ b/packages/babel-core/src/transform-ast.js @@ -1,9 +1,10 @@ // @flow -import loadConfig, { type InputOptions } from "./config"; +import gensync from "gensync"; + +import loadConfig, { type InputOptions, type ResolvedConfig } from "./config"; import { - runSync, - runAsync, + run, type FileResult, type FileResultCallback, } from "./transformation"; @@ -24,6 +25,18 @@ type TransformFromAst = { (ast: AstRoot, code: string, opts: ?InputOptions): FileResult | null, }; +const transformFromAstRunner = gensync< + [AstRoot, string, ?InputOptions], + FileResult | null, +>(function*(ast, code, opts) { + const config: ResolvedConfig | null = yield* loadConfig(opts); + if (config === null) return null; + + if (!ast) throw new Error("No AST given"); + + return yield* run(config, code, ast); +}); + export const transformFromAst: TransformFromAst = (function transformFromAst( ast, code, @@ -37,50 +50,12 @@ export const transformFromAst: TransformFromAst = (function transformFromAst( // For backward-compat with Babel 6, we allow sync transformation when // no callback is given. Will be dropped in some future Babel major version. - if (callback === undefined) return transformFromAstSync(ast, code, opts); - - // Reassign to keep Flowtype happy. - const cb = callback; - - // Just delaying the transform one tick for now to simulate async behavior - // but more async logic may land here eventually. - process.nextTick(() => { - let cfg; - try { - cfg = loadConfig(opts); - if (cfg === null) return cb(null, null); - } catch (err) { - return cb(err); - } - - if (!ast) return cb(new Error("No AST given")); + if (callback === undefined) { + return transformFromAstRunner.sync(ast, code, opts); + } - runAsync(cfg, code, ast, cb); - }); + transformFromAstRunner.errback(ast, code, opts, callback); }: Function); -export function transformFromAstSync( - ast: AstRoot, - code: string, - opts: ?InputOptions, -): FileResult | null { - const config = loadConfig(opts); - if (config === null) return null; - - if (!ast) throw new Error("No AST given"); - - return runSync(config, code, ast); -} - -export function transformFromAstAsync( - ast: AstRoot, - code: string, - opts: ?InputOptions, -): Promise { - return new Promise((res, rej) => { - transformFromAst(ast, code, opts, (err, result) => { - if (err == null) res(result); - else rej(err); - }); - }); -} +export const transformFromAstSync = transformFromAstRunner.sync; +export const transformFromAstAsync = transformFromAstRunner.async; diff --git a/packages/babel-core/src/transform-file.js b/packages/babel-core/src/transform-file.js index d3c9ab640fc3..9d2c3e6ae406 100644 --- a/packages/babel-core/src/transform-file.js +++ b/packages/babel-core/src/transform-file.js @@ -1,13 +1,14 @@ // @flow -import fs from "fs"; -import loadConfig, { type InputOptions } from "./config"; +import gensync from "gensync"; + +import loadConfig, { type InputOptions, type ResolvedConfig } from "./config"; import { - runSync, - runAsync, + run, type FileResult, type FileResultCallback, } from "./transformation"; +import * as fs from "./gensync-utils/fs"; import typeof * as transformFileBrowserType from "./transform-file-browser"; import typeof * as transformFileType from "./transform-file"; @@ -22,74 +23,26 @@ type TransformFile = { (filename: string, opts: ?InputOptions, callback: FileResultCallback): void, }; -export const transformFile: TransformFile = (function transformFile( - filename, - opts, - callback, -) { - let options; - if (typeof opts === "function") { - callback = opts; - opts = undefined; - } - - if (opts == null) { - options = { filename }; - } else if (opts && typeof opts === "object") { - options = { - ...opts, - filename, - }; - } - - process.nextTick(() => { - let cfg; - try { - cfg = loadConfig(options); - if (cfg === null) return callback(null, null); - } catch (err) { - return callback(err); +const transformFileRunner = gensync<[string, ?InputOptions], FileResult | null>( + function*(filename, opts) { + let options; + if (opts == null) { + options = { filename }; + } else if (opts && typeof opts === "object") { + options = { + ...opts, + filename, + }; } - // Reassignment to keep Flow happy. - const config = cfg; - - fs.readFile(filename, "utf8", function(err, code: string) { - if (err) return callback(err, null); - - runAsync(config, code, null, callback); - }); - }); -}: Function); - -export function transformFileSync( - filename: string, - opts: ?InputOptions, -): FileResult | null { - let options; - if (opts == null) { - options = { filename }; - } else if (opts && typeof opts === "object") { - options = { - ...opts, - filename, - }; - } - - const config = loadConfig(options); - if (config === null) return null; + const config: ResolvedConfig | null = yield* loadConfig(options); + if (config === null) return null; - return runSync(config, fs.readFileSync(filename, "utf8")); -} + const code = yield* fs.readFile(filename, "utf8"); + return yield* run(config, code); + }, +); -export function transformFileAsync( - filename: string, - opts: ?InputOptions, -): Promise { - return new Promise((res, rej) => { - transformFile(filename, opts, (err, result) => { - if (err == null) res(result); - else rej(err); - }); - }); -} +export const transformFile: TransformFile = transformFileRunner.errback; +export const transformFileSync = transformFileRunner.sync; +export const transformFileAsync = transformFileRunner.async; diff --git a/packages/babel-core/src/transform.js b/packages/babel-core/src/transform.js index 4a2f0e5c1691..0ace438c29fa 100644 --- a/packages/babel-core/src/transform.js +++ b/packages/babel-core/src/transform.js @@ -1,8 +1,10 @@ // @flow -import loadConfig, { type InputOptions } from "./config"; + +import gensync from "gensync"; + +import loadConfig, { type InputOptions, type ResolvedConfig } from "./config"; import { - runSync, - runAsync, + run, type FileResult, type FileResultCallback, } from "./transformation"; @@ -16,6 +18,15 @@ type Transform = { (code: string, opts: ?InputOptions): FileResult | null, }; +const transformRunner = gensync<[string, ?InputOptions], FileResult | null>( + function* transform(code, opts) { + const config: ResolvedConfig | null = yield* loadConfig(opts); + if (config === null) return null; + + return yield* run(config, code); + }, +); + export const transform: Transform = (function transform(code, opts, callback) { if (typeof opts === "function") { callback = opts; @@ -24,44 +35,10 @@ export const transform: Transform = (function transform(code, opts, callback) { // For backward-compat with Babel 6, we allow sync transformation when // no callback is given. Will be dropped in some future Babel major version. - if (callback === undefined) return transformSync(code, opts); + if (callback === undefined) return transformRunner.sync(code, opts); - // Reassign to keep Flowtype happy. - const cb = callback; - - // Just delaying the transform one tick for now to simulate async behavior - // but more async logic may land here eventually. - process.nextTick(() => { - let cfg; - try { - cfg = loadConfig(opts); - if (cfg === null) return cb(null, null); - } catch (err) { - return cb(err); - } - - runAsync(cfg, code, null, cb); - }); + transformRunner.errback(code, opts, callback); }: Function); -export function transformSync( - code: string, - opts: ?InputOptions, -): FileResult | null { - const config = loadConfig(opts); - if (config === null) return null; - - return runSync(config, code); -} - -export function transformAsync( - code: string, - opts: ?InputOptions, -): Promise { - return new Promise((res, rej) => { - transform(code, opts, (err, result) => { - if (err == null) res(result); - else rej(err); - }); - }); -} +export const transformSync = transformRunner.sync; +export const transformAsync = transformRunner.async; diff --git a/packages/babel-core/src/transformation/block-hoist-plugin.js b/packages/babel-core/src/transformation/block-hoist-plugin.js index 8e8fe69699f0..49ecf5a18556 100644 --- a/packages/babel-core/src/transformation/block-hoist-plugin.js +++ b/packages/babel-core/src/transformation/block-hoist-plugin.js @@ -11,7 +11,7 @@ export default function loadBlockHoistPlugin(): Plugin { // Lazy-init the internal plugin to remove the init-time circular // dependency between plugins being passed @babel/core's export object, // which loads this file, and this 'loadConfig' loading plugins. - const config = loadConfig({ + const config = loadConfig.sync({ babelrc: false, configFile: false, plugins: [blockHoistPlugin], diff --git a/packages/babel-core/src/transformation/index.js b/packages/babel-core/src/transformation/index.js index e2eccd894537..970549f9d94e 100644 --- a/packages/babel-core/src/transformation/index.js +++ b/packages/babel-core/src/transformation/index.js @@ -1,6 +1,7 @@ // @flow import traverse from "@babel/traverse"; import typeof { SourceMap } from "convert-source-map"; +import type { Handler } from "gensync"; import type { ResolvedConfig, PluginPasses } from "../config"; @@ -25,30 +26,12 @@ export type FileResult = { map: SourceMap | null, }; -export function runAsync( +export function* run( config: ResolvedConfig, code: string, ast: ?(BabelNodeFile | BabelNodeProgram), - callback: Function, -) { - let result; - try { - result = runSync(config, code, ast); - } catch (err) { - return callback(err); - } - - // We don't actually care about calling this synchronously here because it is - // already running within a .nextTick handler from the transform calls above. - return callback(null, result); -} - -export function runSync( - config: ResolvedConfig, - code: string, - ast: ?(BabelNodeFile | BabelNodeProgram), -): FileResult { - const file = normalizeFile( +): Handler { + const file = yield* normalizeFile( config.passes, normalizeOptions(config), code, @@ -57,7 +40,7 @@ export function runSync( const opts = file.opts; try { - transformFile(file, config.passes); + yield* transformFile(file, config.passes); } catch (e) { e.message = `${opts.filename ?? "unknown"}: ${e.message}`; if (!e.code) { @@ -89,7 +72,7 @@ export function runSync( }; } -function transformFile(file: File, pluginPasses: PluginPasses): void { +function* transformFile(file: File, pluginPasses: PluginPasses): Handler { for (const pluginPairs of pluginPasses) { const passPairs = []; const passes = []; @@ -108,6 +91,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void { if (fn) { const result = fn.call(pass, file); + yield* []; if (isThenable(result)) { throw new Error( `You appear to be using an plugin with an async .pre, ` + @@ -132,6 +116,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void { if (fn) { const result = fn.call(pass, file); + yield* []; if (isThenable(result)) { throw new Error( `You appear to be using an plugin with an async .post, ` + diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index baad5de2df50..69afea4f9fd6 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -4,6 +4,7 @@ import fs from "fs"; import path from "path"; import buildDebug from "debug"; import cloneDeep from "lodash/cloneDeep"; +import type { Handler } from "gensync"; import * as t from "@babel/types"; import type { PluginPasses } from "../config"; import convertSourceMap, { typeof Converter } from "convert-source-map"; @@ -19,12 +20,12 @@ export type NormalizedFile = { inputMap: Converter | null, }; -export default function normalizeFile( +export default function* normalizeFile( pluginPasses: PluginPasses, options: Object, code: string, ast: ?(BabelNodeFile | BabelNodeProgram), -): File { +): Handler { code = `${code || ""}`; if (ast) { @@ -35,7 +36,7 @@ export default function normalizeFile( } ast = cloneDeep(ast); } else { - ast = parser(pluginPasses, options, code); + ast = yield* parser(pluginPasses, options, code); } let inputMap = null; diff --git a/packages/babel-core/test/async.js b/packages/babel-core/test/async.js new file mode 100644 index 000000000000..3d834c9e637d --- /dev/null +++ b/packages/babel-core/test/async.js @@ -0,0 +1,214 @@ +import path from "path"; +import * as babel from ".."; + +const nodeGte8 = (...args) => { + // "minNodeVersion": "8.0.0" <-- For Ctrl+F when dropping node 6 + const testFn = process.version.slice(0, 3) === "v6." ? it.skip : it; + testFn(...args); +}; + +describe("asynchronicity", () => { + const base = path.join(__dirname, "fixtures", "async"); + let cwd; + + beforeEach(function() { + cwd = process.cwd(); + process.chdir(base); + }); + + afterEach(function() { + process.chdir(cwd); + }); + + describe("config file", () => { + describe("async function", () => { + nodeGte8("called synchronously", () => { + process.chdir("config-file-async-function"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async configuration, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` return your config."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("config-file-async-function"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async configuration, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` return your config."`, + ); + }); + }); + + describe("promise", () => { + it("called synchronously", () => { + process.chdir("config-file-promise"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async configuration, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` return your config."`, + ); + }); + + it("called asynchronously", async () => { + process.chdir("config-file-promise"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async configuration, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` return your config."`, + ); + }); + }); + + describe("cache.using", () => { + nodeGte8("called synchronously", () => { + process.chdir("config-cache"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async cache handler, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` handle your caching logic."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("config-cache"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"You appear to be using an async cache handler, which your current version of Babel does` + + ` not support. We may add support for this in the future, but if you're on the most recent` + + ` version of @babel/core and still seeing this error, then you'll need to synchronously` + + ` handle your caching logic."`, + ); + }); + }); + }); + + describe("plugin", () => { + describe("factory function", () => { + nodeGte8("called synchronously", () => { + process.chdir("plugin"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"[BABEL] unknown: You appear to be using an async plugin, which your current version of Babel` + + ` does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("plugin"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"[BABEL] unknown: You appear to be using an async plugin, which your current version of Babel` + + ` does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + }); + + describe(".pre", () => { + nodeGte8("called synchronously", () => { + process.chdir("plugin-pre"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"unknown: You appear to be using an plugin with an async .pre, which your current version` + + ` of Babel does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("plugin-pre"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"unknown: You appear to be using an plugin with an async .pre, which your current version` + + ` of Babel does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + }); + + describe(".post", () => { + nodeGte8("called synchronously", () => { + process.chdir("plugin-post"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"unknown: You appear to be using an plugin with an async .post, which your current version` + + ` of Babel does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("plugin-post"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"unknown: You appear to be using an plugin with an async .post, which your current version` + + ` of Babel does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + }); + + describe("inherits", () => { + nodeGte8("called synchronously", () => { + process.chdir("plugin-inherits"); + + expect(() => + babel.transformSync(""), + ).toThrowErrorMatchingInlineSnapshot( + `"[BABEL] unknown: You appear to be using an async plugin, which your current version of Babel` + + ` does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + + nodeGte8("called asynchronously", async () => { + process.chdir("plugin-inherits"); + + await expect( + babel.transformAsync(""), + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"[BABEL] unknown: You appear to be using an async plugin, which your current version of Babel` + + ` does not support. If you're using a published plugin, you may need to upgrade your` + + ` @babel/core version."`, + ); + }); + }); + }); +}); diff --git a/packages/babel-core/test/caching-api.js b/packages/babel-core/test/caching-api.js index 0318759fe861..f8d442c150b4 100644 --- a/packages/babel-core/test/caching-api.js +++ b/packages/babel-core/test/caching-api.js @@ -1,10 +1,12 @@ -import { makeStrongCache } from "../lib/config/caching"; +import gensync from "gensync"; +import { makeStrongCacheSync, makeStrongCache } from "../lib/config/caching"; +import { waitFor } from "../lib/gensync-utils/async"; describe("caching API", () => { it("should allow permacaching with .forever()", () => { let count = 0; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.forever(); return { arg, count: count++ }; }); @@ -21,7 +23,7 @@ describe("caching API", () => { it("should allow disabling caching with .never()", () => { let count = 0; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.never(); return { arg, count: count++ }; }); @@ -41,7 +43,7 @@ describe("caching API", () => { let count = 0; let other = "default"; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { const val = cache.using(() => other); return { arg, val, count: count++ }; @@ -82,7 +84,7 @@ describe("caching API", () => { let count = 0; let other = "default"; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { const val = cache.invalidate(() => other); return { arg, val, count: count++ }; @@ -124,7 +126,7 @@ describe("caching API", () => { let other = "default"; let another = "another"; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { const val = cache.using(() => other); const val2 = cache.invalidate(() => another); @@ -223,7 +225,7 @@ describe("caching API", () => { it("should auto-permacache by default", () => { let count = 0; - const fn = makeStrongCache(arg => ({ arg, count: count++ })); + const fn = makeStrongCacheSync(arg => ({ arg, count: count++ })); expect(fn("one")).toEqual({ arg: "one", count: 0 }); expect(fn("one")).toBe(fn("one")); @@ -235,7 +237,7 @@ describe("caching API", () => { }); it("should throw if you set permacaching and use .using", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.forever(); cache.using(() => null); @@ -245,7 +247,7 @@ describe("caching API", () => { }); it("should throw if you set permacaching and use .invalidate", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.forever(); cache.invalidate(() => null); @@ -255,7 +257,7 @@ describe("caching API", () => { }); it("should throw if you set permacaching and use .never", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.forever(); cache.never(); @@ -265,7 +267,7 @@ describe("caching API", () => { }); it("should throw if you set no caching and use .using", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.never(); cache.using(() => null); @@ -275,7 +277,7 @@ describe("caching API", () => { }); it("should throw if you set no caching and use .invalidate", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.never(); cache.invalidate(() => null); @@ -285,7 +287,7 @@ describe("caching API", () => { }); it("should throw if you set no caching and use .never", () => { - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache.never(); cache.using(() => null); @@ -295,7 +297,7 @@ describe("caching API", () => { }); it("should throw if you configure .forever after exiting", () => { - const fn = makeStrongCache((arg, cache) => cache); + const fn = makeStrongCacheSync((arg, cache) => cache); expect(() => fn().forever()).toThrow( /Cannot change caching after evaluation/, @@ -303,7 +305,7 @@ describe("caching API", () => { }); it("should throw if you configure .never after exiting", () => { - const fn = makeStrongCache((arg, cache) => cache); + const fn = makeStrongCacheSync((arg, cache) => cache); expect(() => fn().never()).toThrow( /Cannot change caching after evaluation/, @@ -311,7 +313,7 @@ describe("caching API", () => { }); it("should throw if you configure .using after exiting", () => { - const fn = makeStrongCache((arg, cache) => cache); + const fn = makeStrongCacheSync((arg, cache) => cache); expect(() => fn().using(() => null)).toThrow( /Cannot change caching after evaluation/, @@ -319,7 +321,7 @@ describe("caching API", () => { }); it("should throw if you configure .invalidate after exiting", () => { - const fn = makeStrongCache((arg, cache) => cache); + const fn = makeStrongCacheSync((arg, cache) => cache); expect(() => fn().invalidate(() => null)).toThrow( /Cannot change caching after evaluation/, @@ -330,7 +332,7 @@ describe("caching API", () => { it("should allow permacaching with cache(true)", () => { let count = 0; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache = cache.simple(); cache(true); @@ -349,7 +351,7 @@ describe("caching API", () => { it("should allow disabling caching with cache(false)", () => { let count = 0; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache = cache.simple(); cache(false); @@ -371,7 +373,7 @@ describe("caching API", () => { let count = 0; let other = "default"; - const fn = makeStrongCache((arg, cache) => { + const fn = makeStrongCacheSync((arg, cache) => { cache = cache.simple(); const val = cache(() => other); @@ -410,4 +412,60 @@ describe("caching API", () => { expect(fn("two")).toBe(fn("two")); }); }); + + describe("async", () => { + const wait = gensync({ + sync: () => {}, + errback: (t, cb) => setTimeout(cb, t), + }); + + it("should throw if the cache is configured asynchronously", async () => { + const fn = gensync( + makeStrongCache(function*(arg, cache) { + yield* wait(1000); + cache.never(); + return { arg }; + }), + ).async; + + await expect(fn("bar")).rejects.toThrowErrorMatchingInlineSnapshot( + `"Cannot change caching after evaluation has completed."`, + ); + }); + + it("should allow asynchronous cache invalidation functions", async () => { + const fn = gensync( + makeStrongCache(function*(arg, cache) { + yield* waitFor( + cache.using(async () => { + await wait.async(50); + return "x"; + }), + ); + return { arg }; + }), + ).async; + + const [res1, res2] = await Promise.all([fn("foo"), fn("foo")]); + + expect(res1).toBe(res2); + }); + + it("should allow synchronous yield before cache configuration", async () => { + const fn = gensync( + makeStrongCache(function*(arg, cache) { + yield* gensync({ + sync: () => 2, + errback: cb => cb(null, 2), + })(); + cache.forever(); + return { arg }; + }), + ).async; + + const [res1, res2] = await Promise.all([fn("foo"), fn("foo")]); + + expect(res1).toBe(res2); + }); + }); }); diff --git a/packages/babel-core/test/config-loading.js b/packages/babel-core/test/config-loading.js index 1014a10f8e71..4f61315404e4 100644 --- a/packages/babel-core/test/config-loading.js +++ b/packages/babel-core/test/config-loading.js @@ -1,6 +1,8 @@ -import loadConfig, { loadPartialConfig } from "../lib/config"; +import loadConfigRunner, { loadPartialConfig } from "../lib/config"; import path from "path"; +const loadConfig = loadConfigRunner.sync; + describe("@babel/core config loading", () => { const FILEPATH = path.join( __dirname, diff --git a/packages/babel-core/test/fixtures/async/config-cache/babel.config.js b/packages/babel-core/test/fixtures/async/config-cache/babel.config.js new file mode 100644 index 000000000000..f17724435869 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-cache/babel.config.js @@ -0,0 +1,12 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = function(api) { + api.cache.using(async () => { + await wait(50); + return 2; + }) + + return { + plugins: ["./plugin"], + }; +}; diff --git a/packages/babel-core/test/fixtures/async/config-cache/plugin.js b/packages/babel-core/test/fixtures/async/config-cache/plugin.js new file mode 100644 index 000000000000..f3164a2364f9 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-cache/plugin.js @@ -0,0 +1,9 @@ +module.exports = function plugin({ types: t }) { + return { + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/config-file-async-function/babel.config.js b/packages/babel-core/test/fixtures/async/config-file-async-function/babel.config.js new file mode 100644 index 000000000000..14e85e8e700f --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-file-async-function/babel.config.js @@ -0,0 +1,11 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = async function(api) { + await wait(50); + + api.cache.never(); + + return { + plugins: ["./plugin"], + }; +}; diff --git a/packages/babel-core/test/fixtures/async/config-file-async-function/plugin.js b/packages/babel-core/test/fixtures/async/config-file-async-function/plugin.js new file mode 100644 index 000000000000..f3164a2364f9 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-file-async-function/plugin.js @@ -0,0 +1,9 @@ +module.exports = function plugin({ types: t }) { + return { + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/config-file-promise/babel.config.js b/packages/babel-core/test/fixtures/async/config-file-promise/babel.config.js new file mode 100644 index 000000000000..dffa9f6fdbe1 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-file-promise/babel.config.js @@ -0,0 +1,5 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = wait(50).then(() => ({ + plugins: ["./plugin"], +})); diff --git a/packages/babel-core/test/fixtures/async/config-file-promise/plugin.js b/packages/babel-core/test/fixtures/async/config-file-promise/plugin.js new file mode 100644 index 000000000000..f3164a2364f9 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/config-file-promise/plugin.js @@ -0,0 +1,9 @@ +module.exports = function plugin({ types: t }) { + return { + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-inherits/babel.config.js b/packages/babel-core/test/fixtures/async/plugin-inherits/babel.config.js new file mode 100644 index 000000000000..8b5df0db23c0 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-inherits/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: ["./plugin"], +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-inherits/plugin.js b/packages/babel-core/test/fixtures/async/plugin-inherits/plugin.js new file mode 100644 index 000000000000..6f7f0b197f46 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-inherits/plugin.js @@ -0,0 +1,10 @@ +module.exports = function plugin({ types: t }) { + return { + inherits: require("./plugin2"), + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-inherits/plugin2.js b/packages/babel-core/test/fixtures/async/plugin-inherits/plugin2.js new file mode 100644 index 000000000000..f881463f9814 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-inherits/plugin2.js @@ -0,0 +1,13 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = async function plugin({ types: t }) { + await wait(50); + + return { + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success 2")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-post/babel.config.js b/packages/babel-core/test/fixtures/async/plugin-post/babel.config.js new file mode 100644 index 000000000000..8b5df0db23c0 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-post/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: ["./plugin"], +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-post/plugin.js b/packages/babel-core/test/fixtures/async/plugin-post/plugin.js new file mode 100644 index 000000000000..8ceebfd644d4 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-post/plugin.js @@ -0,0 +1,15 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = function plugin({ types: t }) { + return { + async post() { + await wait(50); + }, + + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-pre/babel.config.js b/packages/babel-core/test/fixtures/async/plugin-pre/babel.config.js new file mode 100644 index 000000000000..8b5df0db23c0 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-pre/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: ["./plugin"], +}; diff --git a/packages/babel-core/test/fixtures/async/plugin-pre/plugin.js b/packages/babel-core/test/fixtures/async/plugin-pre/plugin.js new file mode 100644 index 000000000000..d354a0a60fb7 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin-pre/plugin.js @@ -0,0 +1,15 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = function plugin({ types: t }) { + return { + async pre() { + await wait(50); + }, + + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/packages/babel-core/test/fixtures/async/plugin/babel.config.js b/packages/babel-core/test/fixtures/async/plugin/babel.config.js new file mode 100644 index 000000000000..8b5df0db23c0 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + plugins: ["./plugin"], +}; diff --git a/packages/babel-core/test/fixtures/async/plugin/plugin.js b/packages/babel-core/test/fixtures/async/plugin/plugin.js new file mode 100644 index 000000000000..9777dd80ae42 --- /dev/null +++ b/packages/babel-core/test/fixtures/async/plugin/plugin.js @@ -0,0 +1,13 @@ +const wait = t => new Promise(r => setTimeout(r, t)); + +module.exports = async function plugin({ types: t }) { + await wait(50); + + return { + visitor: { + Program(path) { + path.pushContainer("body", t.stringLiteral("success")); + }, + }, + }; +}; diff --git a/scripts/rollup-plugin-babel-source.js b/scripts/rollup-plugin-babel-source.js index 79f1a6c4101b..54f71f34e050 100644 --- a/scripts/rollup-plugin-babel-source.js +++ b/scripts/rollup-plugin-babel-source.js @@ -37,13 +37,20 @@ module.exports = function() { return null; }, resolveId(importee) { - let packageFolderName; + if (importee === "@babel/runtime/regenerator") { + return path.join( + dirname, + "packages", + "babel-runtime", + "regenerator", + "index.js" + ); + } + const matches = importee.match(/^@babel\/([^/]+)$/); if (matches) { - packageFolderName = `babel-${matches[1]}`; - } + const packageFolderName = `babel-${matches[1]}`; - if (packageFolderName) { // resolve babel package names to their src index file const packageFolder = path.join(dirname, "packages", packageFolderName); const packageJson = require(path.join(packageFolder, "package.json")); From ae06baf22f4c7533be69e70a002661aba7160619 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2020 23:14:29 +0100 Subject: [PATCH 937/965] Add support for babel.config.mjs and .babelrc.mjs (#10903) * Add support for babel.config.mjs and .babelrc.mjs * Use path.extname --- babel.config.js | 4 + .../src/config/files/configuration.js | 26 ++-- .../babel-core/src/config/files/import.js | 7 + .../src/config/files/module-types.js | 59 ++++++++ packages/babel-core/test/config-chain.js | 138 ++++++++++++++---- .../config-files-templates/.babelrc.mjs | 8 + .../config-files-templates/babel.config.mjs | 8 + .../babelrc-mjs-error/.babelrc.mjs | 8 + 8 files changed, 215 insertions(+), 43 deletions(-) create mode 100644 packages/babel-core/src/config/files/import.js create mode 100644 packages/babel-core/src/config/files/module-types.js create mode 100644 packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.mjs create mode 100644 packages/babel-core/test/fixtures/config/config-files-templates/babel.config.mjs create mode 100644 packages/babel-core/test/fixtures/config/config-files/babelrc-mjs-error/.babelrc.mjs diff --git a/babel.config.js b/babel.config.js index 8fa932136dfd..ae2cb5a99cb3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -107,6 +107,10 @@ module.exports = function(api) { ["@babel/plugin-proposal-nullish-coalescing-operator", { loose: true }], convertESM ? "@babel/transform-modules-commonjs" : null, + // Until Jest supports native mjs, we must simulate it 🤷 + env === "test" || env === "development" + ? "@babel/plugin-proposal-dynamic-import" + : null, ].filter(Boolean), overrides: [ { diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js index 035da8eb3681..d9eed80d2960 100644 --- a/packages/babel-core/src/config/files/configuration.js +++ b/packages/babel-core/src/config/files/configuration.js @@ -11,6 +11,7 @@ import { } from "../caching"; import makeAPI, { type PluginAPI } from "../helpers/config-api"; import { makeStaticFileCache } from "./utils"; +import loadCjsOrMjsDefault from "./module-types"; import pathPatternToRegex from "../pattern-to-regex"; import type { FilePackageData, RelativeConfig, ConfigFile } from "./types"; import type { CallerMetadata } from "../validation/options"; @@ -23,9 +24,15 @@ const debug = buildDebug("babel:config:loading:files:configuration"); export const ROOT_CONFIG_FILENAMES = [ "babel.config.js", "babel.config.cjs", + "babel.config.mjs", "babel.config.json", ]; -const RELATIVE_CONFIG_FILENAMES = [".babelrc", ".babelrc.js", ".babelrc.cjs"]; +const RELATIVE_CONFIG_FILENAMES = [ + ".babelrc", + ".babelrc.js", + ".babelrc.cjs", + ".babelrc.mjs", +]; const BABELIGNORE_FILENAME = ".babelignore"; @@ -144,7 +151,7 @@ export function* loadConfig( */ function readConfig(filepath, envName, caller) { const ext = path.extname(filepath); - return ext === ".js" || ext === ".cjs" + return ext === ".js" || ext === ".cjs" || ext === ".mjs" ? readConfigJS(filepath, { envName, caller }) : readConfigJSON5(filepath); } @@ -177,17 +184,14 @@ const readConfigJS = makeStrongCache(function* readConfigJS( }; } - let options; + let options: mixed; try { LOADING_CONFIGS.add(filepath); - - yield* []; // If we want to allow mjs configs imported using `import()` - // $FlowIssue - const configModule = (require(filepath): mixed); - options = - configModule && configModule.__esModule - ? configModule.default || undefined - : configModule; + options = (yield* loadCjsOrMjsDefault( + filepath, + "You appear to be using a native ECMAScript module configuration " + + "file, which is only supported when running Babel asynchronously.", + ): mixed); } catch (err) { err.message = `${filepath}: Error while loading config - ${err.message}`; throw err; diff --git a/packages/babel-core/src/config/files/import.js b/packages/babel-core/src/config/files/import.js new file mode 100644 index 000000000000..e16bc29752a9 --- /dev/null +++ b/packages/babel-core/src/config/files/import.js @@ -0,0 +1,7 @@ +// We keep this in a seprate file so that in older node versions, where +// import() isn't supported, we can try/catch around the require() call +// when loading this file. + +export default function import_(filepath: string) { + return import(filepath); +} diff --git a/packages/babel-core/src/config/files/module-types.js b/packages/babel-core/src/config/files/module-types.js new file mode 100644 index 000000000000..f90fb40b516d --- /dev/null +++ b/packages/babel-core/src/config/files/module-types.js @@ -0,0 +1,59 @@ +import { isAsync, waitFor } from "../../gensync-utils/async"; +import type { Handler } from "gensync"; +import path from "path"; + +let import_; +try { + // Node < 13.3 doesn't support import() syntax. + import_ = require("./import").default; +} catch {} + +export default function* loadCjsOrMjsDefault( + filepath: string, + asyncError: string, +): Handler { + switch (guessJSModuleType(filepath)) { + case "cjs": + return loadCjsDefault(filepath); + case "unknown": + try { + return loadCjsDefault(filepath); + } catch (e) { + if (e.code !== "ERR_REQUIRE_ESM") throw e; + } + case "mjs": + if (yield* isAsync()) { + return yield* waitFor(loadMjsDefault(filepath)); + } + throw new Error(asyncError); + } +} + +function guessJSModuleType(filename: string): "cjs" | "mjs" | "unknown" { + switch (path.extname(filename)) { + case ".cjs": + return "cjs"; + case ".mjs": + return "mjs"; + default: + return "unknown"; + } +} + +function loadCjsDefault(filepath: string) { + const module = (require(filepath): mixed); + // TODO (Babel 8): Remove "undefined" fallback + return module?.__esModule ? module.default || undefined : module; +} + +async function loadMjsDefault(filepath: string) { + if (!import_) { + throw new Error( + "Internal error: Native ECMAScript modules aren't supported" + + " by this platform.\n", + ); + } + + const module = await import_(filepath); + return module.default; +} diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js index 078cd91dce97..ecaf066f1656 100644 --- a/packages/babel-core/test/config-chain.js +++ b/packages/babel-core/test/config-chain.js @@ -2,7 +2,7 @@ import fs from "fs"; import os from "os"; import path from "path"; import escapeRegExp from "lodash/escapeRegExp"; -import { loadOptions as loadOptionsOrig } from "../lib"; +import * as babel from "../lib"; // TODO: In Babel 8, we can directly uses fs.promises which is supported by // node 8+ @@ -44,10 +44,11 @@ function fixture(...args) { } function loadOptions(opts) { - return loadOptionsOrig({ - cwd: __dirname, - ...opts, - }); + return babel.loadOptions({ cwd: __dirname, ...opts }); +} + +function loadOptionsAsync(opts) { + return babel.loadOptionsAsync({ cwd: __dirname, ...opts }); } function pairs(items) { @@ -1000,21 +1001,16 @@ describe("buildConfigChain", function() { describe("root", () => { test.each(["babel.config.json", "babel.config.js", "babel.config.cjs"])( - "should load %s", + "should load %s synchronously", async name => { const { cwd, tmp, config } = await getTemp( - `babel-test-load-config-${name}`, + `babel-test-load-config-sync-${name}`, ); const filename = tmp("src.js"); await config(name); - expect( - loadOptions({ - filename, - cwd, - }), - ).toEqual({ + expect(loadOptions({ filename, cwd })).toEqual({ ...getDefaults(), filename, cwd, @@ -1024,8 +1020,48 @@ describe("buildConfigChain", function() { }, ); + test("should not load babel.config.mjs synchronously", async () => { + const { cwd, tmp, config } = await getTemp( + "babel-test-load-config-sync-babel.config.mjs", + ); + const filename = tmp("src.js"); + + await config("babel.config.mjs"); + + expect(() => loadOptions({ filename, cwd })).toThrow( + /is only supported when running Babel asynchronously/, + ); + }); + + test.each([ + "babel.config.json", + "babel.config.js", + "babel.config.cjs", + "babel.config.mjs", + ])("should load %s asynchronously", async name => { + const { cwd, tmp, config } = await getTemp( + `babel-test-load-config-async-${name}`, + ); + const filename = tmp("src.js"); + + await config(name); + + expect(await loadOptionsAsync({ filename, cwd })).toEqual({ + ...getDefaults(), + filename, + cwd, + root: cwd, + comments: true, + }); + }); + test.each( - pairs(["babel.config.json", "babel.config.js", "babel.config.cjs"]), + pairs([ + "babel.config.json", + "babel.config.js", + "babel.config.cjs", + "babel.config.mjs", + ]), )("should throw if both %s and %s are used", async (name1, name2) => { const { cwd, tmp, config } = await getTemp( `babel-test-dup-config-${name1}-${name2}`, @@ -1033,15 +1069,15 @@ describe("buildConfigChain", function() { await Promise.all([config(name1), config(name2)]); - expect(() => loadOptions({ filename: tmp("src.js"), cwd })).toThrow( - /Multiple configuration files found/, - ); + await expect( + loadOptionsAsync({ filename: tmp("src.js"), cwd }), + ).rejects.toThrow(/Multiple configuration files found/); }); }); describe("relative", () => { test.each(["package.json", ".babelrc", ".babelrc.js", ".babelrc.cjs"])( - "should load %s", + "should load %s synchronously", async name => { const { cwd, tmp, config } = await getTemp( `babel-test-load-config-${name}`, @@ -1050,12 +1086,7 @@ describe("buildConfigChain", function() { await config(name); - expect( - loadOptions({ - filename, - cwd, - }), - ).toEqual({ + expect(loadOptions({ filename, cwd })).toEqual({ ...getDefaults(), filename, cwd, @@ -1065,6 +1096,42 @@ describe("buildConfigChain", function() { }, ); + test("should not load .babelrc.mjs synchronously", async () => { + const { cwd, tmp, config } = await getTemp( + "babel-test-load-config-sync-.babelrc.mjs", + ); + const filename = tmp("src.js"); + + await config(".babelrc.mjs"); + + expect(() => loadOptions({ filename, cwd })).toThrow( + /is only supported when running Babel asynchronously/, + ); + }); + + test.each([ + "package.json", + ".babelrc", + ".babelrc.js", + ".babelrc.cjs", + ".babelrc.mjs", + ])("should load %s asynchronously", async name => { + const { cwd, tmp, config } = await getTemp( + `babel-test-load-config-${name}`, + ); + const filename = tmp("src.js"); + + await config(name); + + expect(await loadOptionsAsync({ filename, cwd })).toEqual({ + ...getDefaults(), + filename, + cwd, + root: cwd, + comments: true, + }); + }); + it("should load .babelignore", () => { const filename = fixture("config-files", "babelignore", "src.js"); @@ -1074,7 +1141,13 @@ describe("buildConfigChain", function() { }); test.each( - pairs(["package.json", ".babelrc", ".babelrc.js", ".babelrc.cjs"]), + pairs([ + "package.json", + ".babelrc", + ".babelrc.js", + ".babelrc.cjs", + ".babelrc.mjs", + ]), )("should throw if both %s and %s are used", async (name1, name2) => { const { cwd, tmp, config } = await getTemp( `babel-test-dup-config-${name1}-${name2}`, @@ -1082,9 +1155,9 @@ describe("buildConfigChain", function() { await Promise.all([config(name1), config(name2)]); - expect(() => loadOptions({ filename: tmp("src.js"), cwd })).toThrow( - /Multiple configuration files found/, - ); + await expect( + loadOptionsAsync({ filename: tmp("src.js"), cwd }), + ).rejects.toThrow(/Multiple configuration files found/); }); it("should ignore package.json without a 'babel' property", () => { @@ -1104,13 +1177,14 @@ describe("buildConfigChain", function() { ${".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/} + ${".babelrc.mjs"} | ${"babelrc-mjs-error"} | ${/Babelrc threw an error/} ${"package.json"} | ${"pkg-error"} | ${/Error while parsing JSON - /} - `("should show helpful errors for $config", ({ dir, error }) => { + `("should show helpful errors for $config", async ({ dir, error }) => { const filename = fixture("config-files", dir, "src.js"); - expect(() => - loadOptions({ filename, cwd: path.dirname(filename) }), - ).toThrow(error); + await expect( + loadOptionsAsync({ filename, cwd: path.dirname(filename) }), + ).rejects.toThrow(error); }); }); diff --git a/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.mjs b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.mjs new file mode 100644 index 000000000000..7fc8bbfea752 --- /dev/null +++ b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.mjs @@ -0,0 +1,8 @@ +// Until Jest supports native mjs, we must simulate it 🤷 + +module.exports = new Promise(resolve => resolve({ + default: { + comments: true + } +})); +module.exports.__esModule = true; diff --git a/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.mjs b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.mjs new file mode 100644 index 000000000000..7fc8bbfea752 --- /dev/null +++ b/packages/babel-core/test/fixtures/config/config-files-templates/babel.config.mjs @@ -0,0 +1,8 @@ +// Until Jest supports native mjs, we must simulate it 🤷 + +module.exports = new Promise(resolve => resolve({ + default: { + comments: true + } +})); +module.exports.__esModule = true; diff --git a/packages/babel-core/test/fixtures/config/config-files/babelrc-mjs-error/.babelrc.mjs b/packages/babel-core/test/fixtures/config/config-files/babelrc-mjs-error/.babelrc.mjs new file mode 100644 index 000000000000..5a4fdd06a352 --- /dev/null +++ b/packages/babel-core/test/fixtures/config/config-files/babelrc-mjs-error/.babelrc.mjs @@ -0,0 +1,8 @@ +// Until Jest supports native mjs, we must simulate it 🤷 + +module.exports = new Promise(resolve => resolve({ + default: function () { + throw new Error("Babelrc threw an error"); + } +})); +module.exports.__esModule = true; From 4c28f54152fe17d0db664d8a6d3a21edc3ef8077 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Fri, 10 Jan 2020 14:41:42 -0800 Subject: [PATCH 938/965] Add babelrc.json support (#10783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add babelrc.json support * Add tests Co-authored-by: Nicolò Ribaudo --- .../src/config/files/configuration.js | 1 + packages/babel-core/test/config-chain.js | 51 ++++++++++--------- .../config-files-templates/.babelrc.json | 3 ++ .../config-files/babelrc-json-error/.babelrc | 1 + 4 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.json create mode 100644 packages/babel-core/test/fixtures/config/config-files/babelrc-json-error/.babelrc diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js index d9eed80d2960..611cd49223e2 100644 --- a/packages/babel-core/src/config/files/configuration.js +++ b/packages/babel-core/src/config/files/configuration.js @@ -32,6 +32,7 @@ const RELATIVE_CONFIG_FILENAMES = [ ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", + ".babelrc.json", ]; const BABELIGNORE_FILENAME = ".babelignore"; diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js index ecaf066f1656..08e69aee3ee3 100644 --- a/packages/babel-core/test/config-chain.js +++ b/packages/babel-core/test/config-chain.js @@ -1076,25 +1076,28 @@ describe("buildConfigChain", function() { }); describe("relative", () => { - test.each(["package.json", ".babelrc", ".babelrc.js", ".babelrc.cjs"])( - "should load %s synchronously", - async name => { - const { cwd, tmp, config } = await getTemp( - `babel-test-load-config-${name}`, - ); - const filename = tmp("src.js"); + test.each([ + "package.json", + ".babelrc", + ".babelrc.js", + ".babelrc.cjs", + ".babelrc.json", + ])("should load %s synchronously", async name => { + const { cwd, tmp, config } = await getTemp( + `babel-test-load-config-${name}`, + ); + const filename = tmp("src.js"); - await config(name); + await config(name); - expect(loadOptions({ filename, cwd })).toEqual({ - ...getDefaults(), - filename, - cwd, - root: cwd, - comments: true, - }); - }, - ); + expect(loadOptions({ filename, cwd })).toEqual({ + ...getDefaults(), + filename, + cwd, + root: cwd, + comments: true, + }); + }); test("should not load .babelrc.mjs synchronously", async () => { const { cwd, tmp, config } = await getTemp( @@ -1147,6 +1150,7 @@ describe("buildConfigChain", function() { ".babelrc.js", ".babelrc.cjs", ".babelrc.mjs", + ".babelrc.json", ]), )("should throw if both %s and %s are used", async (name1, name2) => { const { cwd, tmp, config } = await getTemp( @@ -1173,12 +1177,13 @@ describe("buildConfigChain", function() { }); 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/} - ${".babelrc.mjs"} | ${"babelrc-mjs-error"} | ${/Babelrc threw an error/} - ${"package.json"} | ${"pkg-error"} | ${/Error while parsing JSON - /} + config | dir | error + ${".babelrc"} | ${"babelrc-error"} | ${/Error while parsing config - /} + ${".babelrc.json"} | ${"babelrc-json-error"} | ${/Error while parsing config - /} + ${".babelrc.js"} | ${"babelrc-js-error"} | ${/Babelrc threw an error/} + ${".babelrc.cjs"} | ${"babelrc-cjs-error"} | ${/Babelrc threw an error/} + ${".babelrc.mjs"} | ${"babelrc-mjs-error"} | ${/Babelrc threw an error/} + ${"package.json"} | ${"pkg-error"} | ${/Error while parsing JSON - /} `("should show helpful errors for $config", async ({ dir, error }) => { const filename = fixture("config-files", dir, "src.js"); diff --git a/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.json b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.json new file mode 100644 index 000000000000..b445e5d66381 --- /dev/null +++ b/packages/babel-core/test/fixtures/config/config-files-templates/.babelrc.json @@ -0,0 +1,3 @@ +{ + "comments": true +} diff --git a/packages/babel-core/test/fixtures/config/config-files/babelrc-json-error/.babelrc b/packages/babel-core/test/fixtures/config/config-files/babelrc-json-error/.babelrc new file mode 100644 index 000000000000..1d936d04a4e4 --- /dev/null +++ b/packages/babel-core/test/fixtures/config/config-files/babelrc-json-error/.babelrc @@ -0,0 +1 @@ +{45 From 5a3e97073e7f94c32037a321a7825e8c04c6ae0f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 10 Jan 2020 17:43:10 -0800 Subject: [PATCH 939/965] CONTRIBUTING: Update link to plugin-features.js [skip ci] (#10982) It was moved in #10899. Signed-off-by: Anders Kaseorg --- packages/babel-preset-env/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env/CONTRIBUTING.md b/packages/babel-preset-env/CONTRIBUTING.md index cd91f35148f6..64cce1dfe1d5 100644 --- a/packages/babel-preset-env/CONTRIBUTING.md +++ b/packages/babel-preset-env/CONTRIBUTING.md @@ -2,7 +2,7 @@ ## Adding a new plugin or polyfill to support (when approved in the next ECMAScript version) -### Update [`plugin-features.js`](https://github.com/babel/babel/blob/master/packages/babel-preset-env/data/plugin-features.js) +### Update [`plugin-features.js`](https://github.com/babel/babel/blob/master/packages/babel-compat-data/scripts/data/plugin-features.js) *Example:* From 903ad6160dcd82f2bcfe601aa959a7961b274d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 10 Jan 2020 20:46:19 -0500 Subject: [PATCH 940/965] Filename detection should respect short flags (#10763) * chore: add test files # Conflicts: # packages/babel-node/package.json * fix: respect short flags when finding filename index * fix: use attributeName for kebab-case --- packages/babel-node/package.json | 2 +- packages/babel-node/src/_babel-node.js | 18 +++++++++--------- .../babel-node/--presets/in-files/index.js | 1 + .../--presets/in-files/presetFile.js | 4 ++++ .../fixtures/babel-node/--presets/options.json | 3 +++ .../fixtures/babel-node/--presets/stdout.txt | 2 ++ .../fixtures/babel-node/-b/in-files/index.js | 1 + .../babel-node/-b/in-files/presetFile.js | 4 ++++ .../test/fixtures/babel-node/-b/options.json | 3 +++ .../test/fixtures/babel-node/-b/stdout.txt | 2 ++ 10 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 packages/babel-node/test/fixtures/babel-node/--presets/in-files/index.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--presets/in-files/presetFile.js create mode 100644 packages/babel-node/test/fixtures/babel-node/--presets/options.json create mode 100644 packages/babel-node/test/fixtures/babel-node/--presets/stdout.txt create mode 100644 packages/babel-node/test/fixtures/babel-node/-b/in-files/index.js create mode 100644 packages/babel-node/test/fixtures/babel-node/-b/in-files/presetFile.js create mode 100644 packages/babel-node/test/fixtures/babel-node/-b/options.json create mode 100644 packages/babel-node/test/fixtures/babel-node/-b/stdout.txt diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index 7d244110e9ba..d482aecbebba 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -21,7 +21,7 @@ ], "dependencies": { "@babel/register": "^7.7.7", - "commander": "^2.8.1", + "commander": "^4.0.1", "core-js": "^3.2.1", "lodash": "^4.17.13", "node-environment-flags": "^1.0.5", diff --git a/packages/babel-node/src/_babel-node.js b/packages/babel-node/src/_babel-node.js index 3189e7adec92..22b8e00b779c 100644 --- a/packages/babel-node/src/_babel-node.js +++ b/packages/babel-node/src/_babel-node.js @@ -169,15 +169,15 @@ if (program.eval || program.print) { } if (arg[0] === "-") { - const camelArg = arg - .slice(2) - .replace(/-(\w)/, (s, c) => c.toUpperCase()); - const parsedArg = program[camelArg]; - if ( - arg === "-r" || - arg === "--require" || - (parsedArg && parsedArg !== true) - ) { + const parsedOption = program.options.find(option => { + return option.long === arg || option.short === arg; + }); + if (parsedOption === undefined) { + return; + } + const optionName = parsedOption.attributeName(); + const parsedArg = program[optionName]; + if (optionName === "require" || (parsedArg && parsedArg !== true)) { ignoreNext = true; } } else { diff --git a/packages/babel-node/test/fixtures/babel-node/--presets/in-files/index.js b/packages/babel-node/test/fixtures/babel-node/--presets/in-files/index.js new file mode 100644 index 000000000000..85ce559e8f22 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--presets/in-files/index.js @@ -0,0 +1 @@ +console.log("foo"); diff --git a/packages/babel-node/test/fixtures/babel-node/--presets/in-files/presetFile.js b/packages/babel-node/test/fixtures/babel-node/--presets/in-files/presetFile.js new file mode 100644 index 000000000000..b2d0556f1398 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--presets/in-files/presetFile.js @@ -0,0 +1,4 @@ +module.exports = function () { + console.log("Preset was loaded, so --presets was used."); + return {}; +}; diff --git a/packages/babel-node/test/fixtures/babel-node/--presets/options.json b/packages/babel-node/test/fixtures/babel-node/--presets/options.json new file mode 100644 index 000000000000..bd14d5f365b2 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--presets/options.json @@ -0,0 +1,3 @@ +{ + "args": ["--presets", "./presetFile.js", "index"] +} diff --git a/packages/babel-node/test/fixtures/babel-node/--presets/stdout.txt b/packages/babel-node/test/fixtures/babel-node/--presets/stdout.txt new file mode 100644 index 000000000000..69ccc409d020 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/--presets/stdout.txt @@ -0,0 +1,2 @@ +Preset was loaded, so --presets was used. +foo diff --git a/packages/babel-node/test/fixtures/babel-node/-b/in-files/index.js b/packages/babel-node/test/fixtures/babel-node/-b/in-files/index.js new file mode 100644 index 000000000000..85ce559e8f22 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/-b/in-files/index.js @@ -0,0 +1 @@ +console.log("foo"); diff --git a/packages/babel-node/test/fixtures/babel-node/-b/in-files/presetFile.js b/packages/babel-node/test/fixtures/babel-node/-b/in-files/presetFile.js new file mode 100644 index 000000000000..6e064ea108f2 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/-b/in-files/presetFile.js @@ -0,0 +1,4 @@ +module.exports = function () { + console.log("Preset was loaded, so -b was used."); + return {}; +}; diff --git a/packages/babel-node/test/fixtures/babel-node/-b/options.json b/packages/babel-node/test/fixtures/babel-node/-b/options.json new file mode 100644 index 000000000000..19044775d5e6 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/-b/options.json @@ -0,0 +1,3 @@ +{ + "args": ["-b", "./presetFile.js", "index"] +} diff --git a/packages/babel-node/test/fixtures/babel-node/-b/stdout.txt b/packages/babel-node/test/fixtures/babel-node/-b/stdout.txt new file mode 100644 index 000000000000..29cee3ef1391 --- /dev/null +++ b/packages/babel-node/test/fixtures/babel-node/-b/stdout.txt @@ -0,0 +1,2 @@ +Preset was loaded, so -b was used. +foo From a1310333f7210f6a35f95622d04ba3b00e307d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 11 Jan 2020 03:23:58 -0500 Subject: [PATCH 941/965] chore: update corejs fixtures (#10983) --- .../debug/entry-corejs3-android/stdout.txt | 16 ---------- .../entry-corejs3-specific-targets/stdout.txt | 31 +++++++++---------- 2 files changed, 14 insertions(+), 33 deletions(-) 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 f0bfb709749d..a19089b32198 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 @@ -80,7 +80,6 @@ Using polyfills with `entry` option: es.array.of { "android":"4" } es.array.reduce { "android":"4" } es.array.reduce-right { "android":"4" } - es.array.reverse { "android":"4" } es.array.slice { "android":"4" } es.array.some { "android":"4" } es.array.sort { "android":"4" } @@ -95,9 +94,7 @@ Using polyfills with `entry` option: es.date.to-iso-string { "android":"4" } es.date.to-json { "android":"4" } es.date.to-primitive { "android":"4" } - es.date.to-string { "android":"4" } es.function.has-instance { "android":"4" } - es.function.name { "android":"4" } es.json.to-string-tag { "android":"4" } es.map { "android":"4" } es.math.acosh { "android":"4" } @@ -191,19 +188,6 @@ Using polyfills with `entry` option: es.string.trim { "android":"4" } es.string.trim-end { "android":"4" } es.string.trim-start { "android":"4" } - es.string.anchor { "android":"4" } - es.string.big { "android":"4" } - es.string.blink { "android":"4" } - es.string.bold { "android":"4" } - es.string.fixed { "android":"4" } - es.string.fontcolor { "android":"4" } - es.string.fontsize { "android":"4" } - es.string.italics { "android":"4" } - es.string.link { "android":"4" } - es.string.small { "android":"4" } - es.string.strike { "android":"4" } - es.string.sub { "android":"4" } - es.string.sup { "android":"4" } es.typed-array.float32-array { "android":"4" } es.typed-array.float64-array { "android":"4" } es.typed-array.int8-array { "android":"4" } 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 9cbf285f8e6c..81931d9a365f 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 @@ -99,9 +99,8 @@ Using polyfills with `entry` option: es.date.to-iso-string { "safari":"7" } es.date.to-json { "ios":"9", "safari":"7" } es.date.to-primitive { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } - es.date.to-string { "safari":"7" } es.function.has-instance { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } - es.function.name { "edge":"13", "ie":"10", "safari":"7" } + es.function.name { "ie":"10" } es.json.to-string-tag { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.map { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.math.acosh { "ie":"10", "safari":"7" } @@ -136,8 +135,6 @@ Using polyfills with `entry` option: es.number.to-precision { "safari":"7" } es.object.assign { "edge":"13", "ie":"10", "safari":"7" } es.object.define-getter { "chrome":"54", "edge":"13", "ie":"10", "safari":"7" } - es.object.define-properties { "safari":"7" } - es.object.define-property { "safari":"7" } es.object.define-setter { "chrome":"54", "edge":"13", "ie":"10", "safari":"7" } es.object.entries { "edge":"13", "ie":"10", "ios":"9", "safari":"7" } es.object.freeze { "ie":"10", "safari":"7" } @@ -197,19 +194,19 @@ Using polyfills with `entry` option: es.string.trim { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.string.trim-end { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.string.trim-start { "chrome":"54", "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } - es.string.anchor { "ie":"10", "safari":"7" } - es.string.big { "ie":"10", "safari":"7" } - es.string.blink { "ie":"10", "safari":"7" } - es.string.bold { "ie":"10", "safari":"7" } - es.string.fixed { "ie":"10", "safari":"7" } - es.string.fontcolor { "ie":"10", "safari":"7" } - es.string.fontsize { "ie":"10", "safari":"7" } - es.string.italics { "ie":"10", "safari":"7" } - es.string.link { "ie":"10", "safari":"7" } - es.string.small { "ie":"10", "safari":"7" } - es.string.strike { "ie":"10", "safari":"7" } - es.string.sub { "ie":"10", "safari":"7" } - es.string.sup { "ie":"10", "safari":"7" } + es.string.anchor { "ie":"10" } + es.string.big { "ie":"10" } + es.string.blink { "ie":"10" } + es.string.bold { "ie":"10" } + es.string.fixed { "ie":"10" } + es.string.fontcolor { "ie":"10" } + es.string.fontsize { "ie":"10" } + es.string.italics { "ie":"10" } + es.string.link { "ie":"10" } + es.string.small { "ie":"10" } + es.string.strike { "ie":"10" } + es.string.sub { "ie":"10" } + es.string.sup { "ie":"10" } es.typed-array.float32-array { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.typed-array.float64-array { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } es.typed-array.int8-array { "edge":"13", "firefox":"49", "ie":"10", "ios":"9", "safari":"7" } From 405c1aaad8fdd64cbde33db684a5a39a496e239b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 11 Jan 2020 04:31:29 -0500 Subject: [PATCH 942/965] Merge env-standalone to babel-standalone (#10821) * feat: add babel-preset-env to babel-standalone * chore: copy preset-env-standalone test * polish: tune warning message when babel-preset-env-standalone is loaded --- packages/babel-standalone/package.json | 4 ++ .../scripts/pluginConfig.json | 3 + .../babel-standalone/src/generated/plugins.js | 9 +++ packages/babel-standalone/src/index.js | 16 ++++-- packages/babel-standalone/test/babel.js | 55 +++++++++++++++++++ 5 files changed, 83 insertions(+), 4 deletions(-) diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index cc8740729f1e..4229bfcfb0ce 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -18,6 +18,7 @@ "@babel/plugin-proposal-class-properties": "^7.7.4", "@babel/plugin-proposal-decorators": "^7.7.4", "@babel/plugin-proposal-do-expressions": "^7.7.4", + "@babel/plugin-proposal-dynamic-import": "^7.7.4", "@babel/plugin-proposal-export-default-from": "^7.7.4", "@babel/plugin-proposal-export-namespace-from": "^7.7.4", "@babel/plugin-proposal-function-bind": "^7.7.4", @@ -48,6 +49,7 @@ "@babel/plugin-syntax-object-rest-spread": "^7.7.4", "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", "@babel/plugin-syntax-pipeline-operator": "^7.7.7", + "@babel/plugin-syntax-top-level-await": "^7.7.4", "@babel/plugin-syntax-typescript": "^7.7.4", "@babel/plugin-transform-arrow-functions": "^7.7.4", "@babel/plugin-transform-async-to-generator": "^7.7.4", @@ -71,6 +73,7 @@ "@babel/plugin-transform-modules-commonjs": "^7.7.5", "@babel/plugin-transform-modules-systemjs": "^7.7.4", "@babel/plugin-transform-modules-umd": "^7.7.4", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", "@babel/plugin-transform-new-target": "^7.7.4", "@babel/plugin-transform-object-assign": "^7.7.4", "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.7.4", @@ -97,6 +100,7 @@ "@babel/plugin-transform-typeof-symbol": "^7.7.4", "@babel/plugin-transform-typescript": "^7.7.4", "@babel/plugin-transform-unicode-regex": "^7.7.4", + "@babel/preset-env": "^7.7.4", "@babel/preset-flow": "^7.7.4", "@babel/preset-react": "^7.7.4", "@babel/preset-typescript": "^7.7.7" diff --git a/packages/babel-standalone/scripts/pluginConfig.json b/packages/babel-standalone/scripts/pluginConfig.json index 338d1d1f1bc9..9d58160962ee 100644 --- a/packages/babel-standalone/scripts/pluginConfig.json +++ b/packages/babel-standalone/scripts/pluginConfig.json @@ -15,11 +15,13 @@ "syntax-object-rest-spread", "syntax-optional-catch-binding", "syntax-pipeline-operator", + "syntax-top-level-await", "syntax-typescript", "proposal-async-generator-functions", "proposal-class-properties", "proposal-decorators", "proposal-do-expressions", + "proposal-dynamic-import", "proposal-export-default-from", "proposal-export-namespace-from", "proposal-function-bind", @@ -57,6 +59,7 @@ "transform-modules-commonjs", "transform-modules-systemjs", "transform-modules-umd", + "transform-named-capturing-groups-regex", "transform-new-target", "transform-object-assign", "transform-object-super", diff --git a/packages/babel-standalone/src/generated/plugins.js b/packages/babel-standalone/src/generated/plugins.js index 3967a839565c..313ccd07bbc0 100644 --- a/packages/babel-standalone/src/generated/plugins.js +++ b/packages/babel-standalone/src/generated/plugins.js @@ -19,11 +19,13 @@ import syntaxJsx from "@babel/plugin-syntax-jsx"; import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread"; import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding"; import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator"; +import syntaxTopLevelAwait from "@babel/plugin-syntax-top-level-await"; import syntaxTypescript from "@babel/plugin-syntax-typescript"; import proposalAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions"; import proposalClassProperties from "@babel/plugin-proposal-class-properties"; import proposalDecorators from "@babel/plugin-proposal-decorators"; import proposalDoExpressions from "@babel/plugin-proposal-do-expressions"; +import proposalDynamicImport from "@babel/plugin-proposal-dynamic-import"; import proposalExportDefaultFrom from "@babel/plugin-proposal-export-default-from"; import proposalExportNamespaceFrom from "@babel/plugin-proposal-export-namespace-from"; import proposalFunctionBind from "@babel/plugin-proposal-function-bind"; @@ -61,6 +63,7 @@ import transformModulesAmd from "@babel/plugin-transform-modules-amd"; import transformModulesCommonjs from "@babel/plugin-transform-modules-commonjs"; import transformModulesSystemjs from "@babel/plugin-transform-modules-systemjs"; import transformModulesUmd from "@babel/plugin-transform-modules-umd"; +import transformNamedCapturingGroupsRegex from "@babel/plugin-transform-named-capturing-groups-regex"; import transformNewTarget from "@babel/plugin-transform-new-target"; import transformObjectAssign from "@babel/plugin-transform-object-assign"; import transformObjectSuper from "@babel/plugin-transform-object-super"; @@ -105,11 +108,13 @@ export { syntaxObjectRestSpread, syntaxOptionalCatchBinding, syntaxPipelineOperator, + syntaxTopLevelAwait, syntaxTypescript, proposalAsyncGeneratorFunctions, proposalClassProperties, proposalDecorators, proposalDoExpressions, + proposalDynamicImport, proposalExportDefaultFrom, proposalExportNamespaceFrom, proposalFunctionBind, @@ -147,6 +152,7 @@ export { transformModulesCommonjs, transformModulesSystemjs, transformModulesUmd, + transformNamedCapturingGroupsRegex, transformNewTarget, transformObjectAssign, transformObjectSuper, @@ -192,11 +198,13 @@ export const all = { "syntax-object-rest-spread": syntaxObjectRestSpread, "syntax-optional-catch-binding": syntaxOptionalCatchBinding, "syntax-pipeline-operator": syntaxPipelineOperator, + "syntax-top-level-await": syntaxTopLevelAwait, "syntax-typescript": syntaxTypescript, "proposal-async-generator-functions": proposalAsyncGeneratorFunctions, "proposal-class-properties": proposalClassProperties, "proposal-decorators": proposalDecorators, "proposal-do-expressions": proposalDoExpressions, + "proposal-dynamic-import": proposalDynamicImport, "proposal-export-default-from": proposalExportDefaultFrom, "proposal-export-namespace-from": proposalExportNamespaceFrom, "proposal-function-bind": proposalFunctionBind, @@ -234,6 +242,7 @@ export const all = { "transform-modules-commonjs": transformModulesCommonjs, "transform-modules-systemjs": transformModulesSystemjs, "transform-modules-umd": transformModulesUmd, + "transform-named-capturing-groups-regex": transformNamedCapturingGroupsRegex, "transform-new-target": transformNewTarget, "transform-object-assign": transformObjectAssign, "transform-object-super": transformObjectSuper, diff --git a/packages/babel-standalone/src/index.js b/packages/babel-standalone/src/index.js index cdd68b31bf6b..cc7870028095 100644 --- a/packages/babel-standalone/src/index.js +++ b/packages/babel-standalone/src/index.js @@ -21,8 +21,9 @@ import presetStage0 from "./preset-stage-0"; import presetStage1 from "./preset-stage-1"; import presetStage2 from "./preset-stage-2"; import presetStage3 from "./preset-stage-3"; -import presetReact from "@babel/preset-react"; +import presetEnv from "@babel/preset-env"; import presetFlow from "@babel/preset-flow"; +import presetReact from "@babel/preset-react"; import presetTypescript from "@babel/preset-typescript"; import { runScripts } from "./transformScriptTags"; @@ -136,9 +137,15 @@ export function registerPlugins(newPlugins: { */ export function registerPreset(name: string, preset: Object | Function): void { if (Object.prototype.hasOwnProperty.call(availablePresets, name)) { - console.warn( - `A preset named "${name}" is already registered, it will be overridden`, - ); + if (name === "env") { + console.warn( + "@babel/preset-env is now included in @babel/standalone, please remove @babel/preset-env-standalone", + ); + } else { + console.warn( + `A preset named "${name}" is already registered, it will be overridden`, + ); + } } availablePresets[name] = preset; } @@ -163,6 +170,7 @@ registerPlugins(all); // Want to get rid of this whitelist of presets? // Wait! Please read https://github.com/babel/babel/pull/6177 first. registerPresets({ + env: presetEnv, es2015: preset2015, es2016: () => { return { diff --git a/packages/babel-standalone/test/babel.js b/packages/babel-standalone/test/babel.js index 056bfafca847..8fd2b8a60d56 100644 --- a/packages/babel-standalone/test/babel.js +++ b/packages/babel-standalone/test/babel.js @@ -110,6 +110,61 @@ ).toThrow(/Invalid plugin specified in Babel options: "lolfail"/); }); + describe("env preset", () => { + it("works w/o targets", () => { + const output = Babel.transform("const a = 1;", { + sourceType: "script", + presets: ["env"], + }).code; + expect(output).toBe("var a = 1;"); + }); + + it("doesn't transpile `const` with chrome 60", () => { + const output = Babel.transform("const a = 1;", { + sourceType: "script", + presets: [ + [ + "env", + { + targets: { + chrome: 60, + }, + }, + ], + ], + }).code; + expect(output).toBe("const a = 1;"); + }); + + it("transpiles `const` with chrome 60 and preset-es2015", () => { + const output = Babel.transform("const a = 1;", { + sourceType: "script", + presets: [ + [ + "env", + { + targets: { + chrome: 60, + }, + }, + ], + "es2015", + ], + }).code; + expect(output).toBe("var a = 1;"); + }); + + it("uses transform-new-targets plugin", () => { + const output = Babel.transform("function Foo() {new.target}", { + sourceType: "script", + presets: ["env"], + }).code; + expect(output).toBe( + "function Foo() {\n this instanceof Foo ? this.constructor : void 0;\n}", + ); + }); + }); + describe("custom plugins and presets", () => { const lolizer = () => ({ visitor: { From e7b80a2cb93cf28010207fc3cdd19b4568ca35b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sat, 11 Jan 2020 10:34:30 +0100 Subject: [PATCH 943/965] Improve @babel/types with env.BABEL_TYPES_8_BREAKING (#10917) Co-authored-by: Justin Ridgewell --- .../babel-types/scripts/generators/docs.js | 6 +- .../src/asserts/generated/index.js | 6 +- .../src/builders/generated/index.js | 8 +- packages/babel-types/src/constants/index.js | 6 + packages/babel-types/src/definitions/core.js | 258 +++++++++++++++--- .../babel-types/src/definitions/es2015.js | 248 +++++++++++------ .../src/definitions/experimental.js | 13 +- packages/babel-types/src/definitions/flow.js | 2 +- packages/babel-types/src/definitions/index.js | 2 + packages/babel-types/src/definitions/jsx.js | 1 - packages/babel-types/src/definitions/utils.js | 101 ++++--- .../src/validators/generated/index.js | 17 +- .../src/validators/isValidIdentifier.js | 26 +- .../babel-types/src/validators/validate.js | 10 +- 14 files changed, 512 insertions(+), 192 deletions(-) diff --git a/packages/babel-types/scripts/generators/docs.js b/packages/babel-types/scripts/generators/docs.js index 3bbb52362400..340dbbc11315 100644 --- a/packages/babel-types/scripts/generators/docs.js +++ b/packages/babel-types/scripts/generators/docs.js @@ -101,8 +101,12 @@ Object.keys(types.BUILDER_KEYS) } if (defaultValue !== null || types.NODE_FIELDS[key][field].optional) { fieldDescription.push( - " (default: `" + util.inspect(defaultValue) + "`)" + " (default: `" + util.inspect(defaultValue) + "`" ); + if (types.BUILDER_KEYS[key].indexOf(field) < 0) { + fieldDescription.push(", excluded from builder function"); + } + fieldDescription.push(")"); } else { fieldDescription.push(" (required)"); } diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index 4fb0fd754a15..9f2ebce70e4a 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -224,12 +224,12 @@ export function assertArrowFunctionExpression( export function assertClassBody(node: Object, opts?: Object = {}): void { assert("ClassBody", node, opts); } -export function assertClassDeclaration(node: Object, opts?: Object = {}): void { - assert("ClassDeclaration", node, opts); -} export function assertClassExpression(node: Object, opts?: Object = {}): void { assert("ClassExpression", node, opts); } +export function assertClassDeclaration(node: Object, opts?: Object = {}): void { + assert("ClassDeclaration", node, opts); +} export function assertExportAllDeclaration( node: Object, opts?: Object = {}, diff --git a/packages/babel-types/src/builders/generated/index.js b/packages/babel-types/src/builders/generated/index.js index fe7f320d028a..8aebb3a8d830 100644 --- a/packages/babel-types/src/builders/generated/index.js +++ b/packages/babel-types/src/builders/generated/index.js @@ -225,14 +225,14 @@ export function ClassBody(...args: Array): Object { return builder("ClassBody", ...args); } export { ClassBody as classBody }; -export function ClassDeclaration(...args: Array): Object { - return builder("ClassDeclaration", ...args); -} -export { ClassDeclaration as classDeclaration }; export function ClassExpression(...args: Array): Object { return builder("ClassExpression", ...args); } export { ClassExpression as classExpression }; +export function ClassDeclaration(...args: Array): Object { + return builder("ClassDeclaration", ...args); +} +export { ClassDeclaration as classDeclaration }; export function ExportAllDeclaration(...args: Array): Object { return builder("ExportAllDeclaration", ...args); } diff --git a/packages/babel-types/src/constants/index.js b/packages/babel-types/src/constants/index.js index b777caa0f11e..4dfe13d65adb 100644 --- a/packages/babel-types/src/constants/index.js +++ b/packages/babel-types/src/constants/index.js @@ -41,6 +41,12 @@ export const BINARY_OPERATORS = [ ...BOOLEAN_BINARY_OPERATORS, ]; +export const ASSIGNMENT_OPERATORS = [ + "=", + "+=", + ...NUMBER_BINARY_OPERATORS.map(op => op + "="), +]; + export const BOOLEAN_UNARY_OPERATORS = ["delete", "!"]; export const NUMBER_UNARY_OPERATORS = ["+", "-", "~"]; export const STRING_UNARY_OPERATORS = ["typeof"]; diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js index 973c3bfa67c8..9461e36d3cc2 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -1,9 +1,13 @@ // @flow -import isValidIdentifier from "../validators/isValidIdentifier"; + +import esutils from "esutils"; + +import is from "../validators/is"; import { BINARY_OPERATORS, LOGICAL_OPERATORS, + ASSIGNMENT_OPERATORS, UNARY_OPERATORS, UPDATE_OPERATORS, } from "../constants"; @@ -26,7 +30,7 @@ defineType("ArrayExpression", { assertNodeOrValueType("null", "Expression", "SpreadElement"), ), ), - default: [], + default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined, }, }, visitor: ["elements"], @@ -36,10 +40,29 @@ defineType("ArrayExpression", { defineType("AssignmentExpression", { fields: { operator: { - validate: assertValueType("string"), + validate: (function() { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return assertValueType("string"); + } + + const identifier = assertOneOf(...ASSIGNMENT_OPERATORS); + const pattern = assertOneOf("="); + + return function(node, key, val) { + const validator = is("Pattern", node.left) ? pattern : identifier; + validator(node, key, val); + }; + })(), }, left: { - validate: assertNodeType("LVal"), + validate: !process.env.BABEL_TYPES_8_BREAKING + ? assertNodeType("LVal") + : assertNodeType( + "Identifier", + "MemberExpression", + "ArrayPattern", + "ObjectPattern", + ), }, right: { validate: assertNodeType("Expression"), @@ -147,10 +170,14 @@ defineType("CallExpression", { ), ), }, - optional: { - validate: assertOneOf(true, false), - optional: true, - }, + ...(!process.env.BABEL_TYPES_8_BREAKING + ? { + optional: { + validate: assertOneOf(true, false), + optional: true, + }, + } + : {}), typeArguments: { validate: assertNodeType("TypeParameterInstantiation"), optional: true, @@ -166,7 +193,7 @@ defineType("CatchClause", { visitor: ["param", "body"], fields: { param: { - validate: assertNodeType("Identifier"), + validate: assertNodeType("Identifier", "ArrayPattern", "ObjectPattern"), optional: true, }, body: { @@ -256,7 +283,15 @@ defineType("ForInStatement", { ], fields: { left: { - validate: assertNodeType("VariableDeclaration", "LVal"), + validate: !process.env.BABEL_TYPES_8_BREAKING + ? assertNodeType("VariableDeclaration", "LVal") + : assertNodeType( + "VariableDeclaration", + "Identifier", + "MemberExpression", + "ArrayPattern", + "ObjectPattern", + ), }, right: { validate: assertNodeType("Expression"), @@ -305,10 +340,8 @@ export const functionCommon = { }, generator: { default: false, - validate: assertValueType("boolean"), }, async: { - validate: assertValueType("boolean"), default: false, }, }; @@ -359,6 +392,17 @@ defineType("FunctionDeclaration", { "Pureish", "Declaration", ], + validate: (function() { + if (!process.env.BABEL_TYPES_8_BREAKING) return () => {}; + + const identifier = assertNodeType("Identifier"); + + return function(parent, key, node) { + if (!is("ExportDefaultDeclaration", parent)) { + identifier(node, "id", node.id); + } + }; + })(), }); defineType("FunctionExpression", { @@ -405,17 +449,55 @@ defineType("Identifier", { fields: { ...patternLikeCommon, name: { - validate: chain(function(node, key, val) { - if (!isValidIdentifier(val)) { - // throw new TypeError(`"${val}" is not a valid identifier name`); + validate: chain(assertValueType("string"), function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!esutils.keyword.isIdentifierNameES6(val)) { + throw new TypeError(`"${val}" is not a valid identifier name`); } - }, assertValueType("string")), + }), }, optional: { validate: assertValueType("boolean"), optional: true, }, }, + validate(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + const match = /\.(\w+)$/.exec(key); + if (!match) return; + + const [, parentKey] = match; + const nonComp = { computed: false }; + + // We can't check if `parent.property === node`, because nodes are validated + // before replacing them in the AST. + if (parentKey === "property") { + if (is("MemberExpression", parent, nonComp)) return; + if (is("OptionalMemberExpression", parent, nonComp)) return; + } else if (parentKey === "key") { + if (is("Property", parent, nonComp)) return; + if (is("Method", parent, nonComp)) return; + } else if (parentKey === "exported") { + if (is("ExportSpecifier", parent)) return; + } else if (parentKey === "imported") { + if (is("ImportSpecifier", parent, { imported: node })) return; + } else if (parentKey === "meta") { + if (is("MetaProperty", parent, { meta: node })) return; + } + + if ( + // Ideally this should be strict if this node is a descendant of a block + // in strict mode. Also, we should disallow "await" in modules. + esutils.keyword.isReservedWordES6(node.name, /* strict */ false) && + // Even if "this" is a keyword, we are using the Identifier + // node to represent it. + node.name !== "this" + ) { + throw new TypeError(`"${node.name}" is not a valid identifer`); + } + }, }); defineType("IfStatement", { @@ -492,7 +574,14 @@ defineType("RegExpLiteral", { validate: assertValueType("string"), }, flags: { - validate: assertValueType("string"), + validate: chain(assertValueType("string"), function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + const invalid = /[^gimsuy]/.exec(val); + if (invalid) { + throw new TypeError(`"${invalid[0]}" is not a valid RegExp flag`); + } + }), default: "", }, }, @@ -537,10 +626,14 @@ defineType("MemberExpression", { computed: { default: false, }, - optional: { - validate: assertOneOf(true, false), - optional: true, - }, + ...(!process.env.BABEL_TYPES_8_BREAKING + ? { + optional: { + validate: assertOneOf(true, false), + optional: true, + }, + } + : {}), }, }); @@ -597,19 +690,15 @@ defineType("ObjectExpression", { }); defineType("ObjectMethod", { - builder: ["kind", "key", "params", "body", "computed"], + builder: ["kind", "key", "params", "body", "computed", "generator", "async"], fields: { ...functionCommon, ...functionTypeAnnotationCommon, kind: { - validate: chain( - assertValueType("string"), - assertOneOf("method", "get", "set"), - ), - default: "method", + validate: assertOneOf("method", "get", "set"), + ...(!process.env.BABEL_TYPES_8_BREAKING ? { default: "method" } : {}), }, computed: { - validate: assertValueType("boolean"), default: false, }, key: { @@ -632,6 +721,7 @@ defineType("ObjectMethod", { assertValueType("array"), assertEach(assertNodeType("Decorator")), ), + optional: true, }, body: { validate: assertNodeType("BlockStatement"), @@ -657,10 +747,15 @@ defineType("ObjectMethod", { }); defineType("ObjectProperty", { - builder: ["key", "value", "computed", "shorthand", "decorators"], + builder: [ + "key", + "value", + "computed", + "shorthand", + ...(!process.env.BABEL_TYPES_8_BREAKING ? ["decorators"] : []), + ], fields: { computed: { - validate: assertValueType("boolean"), default: false, }, key: { @@ -684,7 +779,27 @@ defineType("ObjectProperty", { validate: assertNodeType("Expression", "PatternLike"), }, shorthand: { - validate: assertValueType("boolean"), + validate: chain( + assertValueType("boolean"), + function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && node.computed) { + throw new TypeError( + "Property shorthand of ObjectProperty cannot be true if computed is true", + ); + } + }, + function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && !is("Identifier", node.key)) { + throw new TypeError( + "Property shorthand of ObjectProperty cannot be true if key is not an Identifier", + ); + } + }, + ), default: false, }, decorators: { @@ -697,6 +812,17 @@ defineType("ObjectProperty", { }, visitor: ["key", "value", "decorators"], aliases: ["UserWhitespacable", "Property", "ObjectMember"], + validate: (function() { + const pattern = assertNodeType("Identifier", "Pattern"); + const expression = assertNodeType("Expression"); + + return function(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + const validator = is("ObjectPattern", parent) ? pattern : expression; + validator(node, "value", node.value); + }; + })(), }); defineType("RestElement", { @@ -707,9 +833,22 @@ defineType("RestElement", { fields: { ...patternLikeCommon, argument: { - validate: assertNodeType("LVal"), + validate: !process.env.BABEL_TYPES_8_BREAKING + ? assertNodeType("LVal") + : assertNodeType("Identifier", "Pattern", "MemberExpression"), }, }, + validate(parent, key) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + const match = /(\w+)\[(\d+)\]/.exec(key); + if (!match) throw new Error("Internal Babel error: malformed key."); + + const [, listKey, index] = match; + if (parent[listKey].length > index + 1) { + throw new TypeError(`RestElement must be last element of ${listKey}`); + } + }, }); defineType("ReturnStatement", { @@ -792,13 +931,23 @@ defineType("ThrowStatement", { }, }); -// todo: at least handler or finalizer should be set to be valid defineType("TryStatement", { visitor: ["block", "handler", "finalizer"], aliases: ["Statement"], fields: { block: { - validate: assertNodeType("BlockStatement"), + validate: chain(assertNodeType("BlockStatement"), function(node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + // This validator isn't put at the top level because we can run it + // even if this node doesn't have a parent. + + if (!node.handler && !node.finalizer) { + throw new TypeError( + "TryStatement expects either a handler or finalizer, or both", + ); + } + }), }, handler: { optional: true, @@ -835,7 +984,9 @@ defineType("UpdateExpression", { default: false, }, argument: { - validate: assertNodeType("Expression"), + validate: !process.env.BABEL_TYPES_8_BREAKING + ? assertNodeType("Expression") + : assertNodeType("Identifier", "MemberExpression"), }, operator: { validate: assertOneOf(...UPDATE_OPERATORS), @@ -855,10 +1006,7 @@ defineType("VariableDeclaration", { optional: true, }, kind: { - validate: chain( - assertValueType("string"), - assertOneOf("var", "let", "const"), - ), + validate: assertOneOf("var", "let", "const"), }, declarations: { validate: chain( @@ -867,13 +1015,39 @@ defineType("VariableDeclaration", { ), }, }, + validate(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!is("ForXStatement", parent, { left: node })) return; + if (node.declarations.length !== 1) { + throw new TypeError( + `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`, + ); + } + }, }); defineType("VariableDeclarator", { visitor: ["id", "init"], fields: { id: { - validate: assertNodeType("LVal"), + validate: (function() { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return assertNodeType("LVal"); + } + + const normal = assertNodeType( + "Identifier", + "ArrayPattern", + "ObjectPattern", + ); + const without = assertNodeType("Identifier"); + + return function(node, key, val) { + const validator = node.init ? normal : without; + validator(node, key, val); + }; + })(), }, definite: { optional: true, @@ -894,7 +1068,7 @@ defineType("WhileStatement", { validate: assertNodeType("Expression"), }, body: { - validate: assertNodeType("BlockStatement", "Statement"), + validate: assertNodeType("Statement"), }, }, }); @@ -907,7 +1081,7 @@ defineType("WithStatement", { validate: assertNodeType("Expression"), }, body: { - validate: assertNodeType("BlockStatement", "Statement"), + validate: assertNodeType("Statement"), }, }, }); diff --git a/packages/babel-types/src/definitions/es2015.js b/packages/babel-types/src/definitions/es2015.js index 53f3c1f3df7d..853af1b12e65 100644 --- a/packages/babel-types/src/definitions/es2015.js +++ b/packages/babel-types/src/definitions/es2015.js @@ -3,6 +3,7 @@ import defineType, { assertShape, assertNodeType, assertValueType, + assertNodeOrValueType, chain, assertEach, assertOneOf, @@ -13,6 +14,7 @@ import { functionTypeAnnotationCommon, patternLikeCommon, } from "./core"; +import is from "../validators/is"; defineType("AssignmentPattern", { visitor: ["left", "right", "decorators" /* for legacy param decorators */], @@ -31,11 +33,13 @@ defineType("AssignmentPattern", { right: { validate: assertNodeType("Expression"), }, + // For TypeScript decorators: { validate: chain( assertValueType("array"), assertEach(assertNodeType("Decorator")), ), + optional: true, }, }, }); @@ -49,14 +53,16 @@ defineType("ArrayPattern", { elements: { validate: chain( assertValueType("array"), - assertEach(assertNodeType("PatternLike")), + assertEach(assertNodeOrValueType("null", "PatternLike")), ), }, + // For TypeScript decorators: { validate: chain( assertValueType("array"), assertEach(assertNodeType("Decorator")), ), + optional: true, }, }, }); @@ -106,41 +112,7 @@ defineType("ClassBody", { }, }); -const classCommon = { - typeParameters: { - validate: assertNodeType( - "TypeParameterDeclaration", - "TSTypeParameterDeclaration", - "Noop", - ), - optional: true, - }, - body: { - validate: assertNodeType("ClassBody"), - }, - superClass: { - optional: true, - validate: assertNodeType("Expression"), - }, - superTypeParameters: { - validate: assertNodeType( - "TypeParameterInstantiation", - "TSTypeParameterInstantiation", - ), - optional: true, - }, - implements: { - validate: chain( - assertValueType("array"), - assertEach( - assertNodeType("TSExpressionWithTypeArguments", "ClassImplements"), - ), - ), - optional: true, - }, -}; - -defineType("ClassDeclaration", { +defineType("ClassExpression", { builder: ["id", "superClass", "body", "decorators"], visitor: [ "id", @@ -152,40 +124,22 @@ defineType("ClassDeclaration", { "implements", "decorators", ], - aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], + aliases: ["Scopable", "Class", "Expression", "Pureish"], fields: { - ...classCommon, - declare: { - validate: assertValueType("boolean"), - optional: true, - }, - abstract: { - validate: assertValueType("boolean"), - optional: true, - }, id: { validate: assertNodeType("Identifier"), - optional: true, // Missing if this is the child of an ExportDefaultDeclaration. + // In declarations, this is missing if this is the + // child of an ExportDefaultDeclaration. + optional: true, }, - decorators: { - validate: chain( - assertValueType("array"), - assertEach(assertNodeType("Decorator")), + typeParameters: { + validate: assertNodeType( + "TypeParameterDeclaration", + "TSTypeParameterDeclaration", + "Noop", ), optional: true, }, - }, -}); - -defineType("ClassExpression", { - inherits: "ClassDeclaration", - aliases: ["Scopable", "Class", "Expression", "Pureish"], - fields: { - ...classCommon, - id: { - optional: true, - validate: assertNodeType("Identifier"), - }, body: { validate: assertNodeType("ClassBody"), }, @@ -193,6 +147,22 @@ defineType("ClassExpression", { optional: true, validate: assertNodeType("Expression"), }, + superTypeParameters: { + validate: assertNodeType( + "TypeParameterInstantiation", + "TSTypeParameterInstantiation", + ), + optional: true, + }, + implements: { + validate: chain( + assertValueType("array"), + assertEach( + assertNodeType("TSExpressionWithTypeArguments", "ClassImplements"), + ), + ), + optional: true, + }, decorators: { validate: chain( assertValueType("array"), @@ -203,6 +173,32 @@ defineType("ClassExpression", { }, }); +defineType("ClassDeclaration", { + inherits: "ClassExpression", + aliases: ["Scopable", "Class", "Statement", "Declaration", "Pureish"], + fields: { + declare: { + validate: assertValueType("boolean"), + optional: true, + }, + abstract: { + validate: assertValueType("boolean"), + optional: true, + }, + }, + validate: (function() { + const identifier = assertNodeType("Identifier"); + + return function(parent, key, node) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (!is("ExportDefaultDeclaration", parent)) { + identifier(node, "id", node.id); + } + }; + })(), +}); + defineType("ExportAllDeclaration", { visitor: ["source"], aliases: [ @@ -248,18 +244,53 @@ defineType("ExportNamedDeclaration", { ], fields: { declaration: { - validate: assertNodeType("Declaration"), optional: true, + validate: chain( + assertNodeType("Declaration"), + function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + // This validator isn't put at the top level because we can run it + // even if this node doesn't have a parent. + + if (val && node.specifiers.length) { + throw new TypeError( + "Only declaration or specifiers is allowed on ExportNamedDeclaration", + ); + } + }, + function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + // This validator isn't put at the top level because we can run it + // even if this node doesn't have a parent. + + if (val && node.source) { + throw new TypeError("Cannot export a declaration from a source"); + } + }, + ), }, specifiers: { + default: [], validate: chain( assertValueType("array"), assertEach( - assertNodeType( - "ExportSpecifier", - "ExportDefaultSpecifier", - "ExportNamespaceSpecifier", - ), + (function() { + const sourced = assertNodeType( + "ExportSpecifier", + "ExportDefaultSpecifier", + "ExportNamespaceSpecifier", + ); + const sourceless = assertNodeType("ExportSpecifier"); + + if (!process.env.BABEL_TYPES_8_BREAKING) return sourced; + + return function(node, key, val) { + const validator = node.source ? sourced : sourceless; + validator(node, key, val); + }; + })(), ), ), }, @@ -286,6 +317,7 @@ defineType("ExportSpecifier", { defineType("ForOfStatement", { visitor: ["left", "right", "body"], + builder: ["left", "right", "body", "await"], aliases: [ "Scopable", "Statement", @@ -296,7 +328,27 @@ defineType("ForOfStatement", { ], fields: { left: { - validate: assertNodeType("VariableDeclaration", "LVal"), + validate: (function() { + if (!process.env.BABEL_TYPES_8_BREAKING) { + return assertNodeType("VariableDeclaration", "LVal"); + } + + const declaration = assertNodeType("VariableDeclaration"); + const lval = assertNodeType( + "Identifier", + "MemberExpression", + "ArrayPattern", + "ObjectPattern", + ); + + return function(node, key, val) { + if (is("VariableDeclaration", val)) { + declaration(node, key, val); + } else { + lval(node, key, val); + } + }; + })(), }, right: { validate: assertNodeType("Expression"), @@ -306,7 +358,6 @@ defineType("ForOfStatement", { }, await: { default: false, - validate: assertValueType("boolean"), }, }, }); @@ -380,9 +431,26 @@ defineType("MetaProperty", { visitor: ["meta", "property"], aliases: ["Expression"], fields: { - // todo: limit to new.target meta: { - validate: assertNodeType("Identifier"), + validate: chain(assertNodeType("Identifier"), function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + let property; + switch (val.name) { + case "function": + property = "sent"; + break; + case "new": + property = "target"; + break; + case "import": + property = "meta"; + break; + } + if (!is("Identifier", node.property, { name: property })) { + throw new TypeError("Unrecognised MetaProperty"); + } + }), }, property: { validate: assertNodeType("Identifier"), @@ -396,19 +464,14 @@ export const classMethodOrPropertyCommon = { optional: true, }, accessibility: { - validate: chain( - assertValueType("string"), - assertOneOf("public", "private", "protected"), - ), + validate: assertOneOf("public", "private", "protected"), optional: true, }, static: { default: false, - validate: assertValueType("boolean"), }, computed: { default: false, - validate: assertValueType("boolean"), }, optional: { validate: assertValueType("boolean"), @@ -443,10 +506,7 @@ export const classMethodOrDeclareMethodCommon = { ...functionCommon, ...classMethodOrPropertyCommon, kind: { - validate: chain( - assertValueType("string"), - assertOneOf("get", "set", "method", "constructor"), - ), + validate: assertOneOf("get", "set", "method", "constructor"), default: "method", }, access: { @@ -467,7 +527,16 @@ export const classMethodOrDeclareMethodCommon = { defineType("ClassMethod", { aliases: ["Function", "Scopable", "BlockParent", "FunctionParent", "Method"], - builder: ["kind", "key", "params", "body", "computed", "static"], + builder: [ + "kind", + "key", + "params", + "body", + "computed", + "static", + "generator", + "async", + ], visitor: [ "key", "params", @@ -554,7 +623,6 @@ defineType("TemplateElement", { }), }, tail: { - validate: assertValueType("boolean"), default: false, }, }, @@ -595,7 +663,15 @@ defineType("YieldExpression", { aliases: ["Expression", "Terminatorless"], fields: { delegate: { - validate: assertValueType("boolean"), + validate: chain(assertValueType("boolean"), function(node, key, val) { + if (!process.env.BABEL_TYPES_8_BREAKING) return; + + if (val && !node.argument) { + throw new TypeError( + "Property delegate of YieldExpression cannot be true if there is no argument", + ); + } + }), default: false, }, argument: { diff --git a/packages/babel-types/src/definitions/experimental.js b/packages/babel-types/src/definitions/experimental.js index f4e110e1002f..a77350105a5b 100644 --- a/packages/babel-types/src/definitions/experimental.js +++ b/packages/babel-types/src/definitions/experimental.js @@ -26,9 +26,16 @@ defineType("AwaitExpression", { defineType("BindExpression", { visitor: ["object", "callee"], aliases: ["Expression"], - fields: { - // todo - }, + fields: !process.env.BABEL_TYPES_8_BREAKING + ? {} + : { + object: { + validate: assertNodeType("Expression"), + }, + callee: { + validate: assertNodeType("Expression"), + }, + }, }); defineType("ClassProperty", { diff --git a/packages/babel-types/src/definitions/flow.js b/packages/babel-types/src/definitions/flow.js index 68560582605f..e04d16886d07 100644 --- a/packages/babel-types/src/definitions/flow.js +++ b/packages/babel-types/src/definitions/flow.js @@ -468,7 +468,7 @@ defineType("VoidTypeAnnotation", { // Enums defineType("EnumDeclaration", { - alises: ["Declaration"], + aliases: ["Declaration"], visitor: ["id", "body"], fields: { id: validateType("Identifier"), diff --git a/packages/babel-types/src/definitions/index.js b/packages/babel-types/src/definitions/index.js index d6e1763ebdf0..7341c67369a9 100644 --- a/packages/babel-types/src/definitions/index.js +++ b/packages/babel-types/src/definitions/index.js @@ -14,6 +14,7 @@ import { NODE_FIELDS, BUILDER_KEYS, DEPRECATED_KEYS, + NODE_PARENT_VALIDATIONS, } from "./utils"; import { PLACEHOLDERS, @@ -43,6 +44,7 @@ export { NODE_FIELDS, BUILDER_KEYS, DEPRECATED_KEYS, + NODE_PARENT_VALIDATIONS, PLACEHOLDERS, PLACEHOLDERS_ALIAS, PLACEHOLDERS_FLIPPED_ALIAS, diff --git a/packages/babel-types/src/definitions/jsx.js b/packages/babel-types/src/definitions/jsx.js index a088f03c1929..9b74dd52f488 100644 --- a/packages/babel-types/src/definitions/jsx.js +++ b/packages/babel-types/src/definitions/jsx.js @@ -142,7 +142,6 @@ defineType("JSXOpeningElement", { }, selfClosing: { default: false, - validate: assertValueType("boolean"), }, attributes: { validate: chain( diff --git a/packages/babel-types/src/definitions/utils.js b/packages/babel-types/src/definitions/utils.js index 3f7225bd50b2..cc3a347cca4a 100644 --- a/packages/babel-types/src/definitions/utils.js +++ b/packages/babel-types/src/definitions/utils.js @@ -1,6 +1,6 @@ // @flow import is from "../validators/is"; -import { validateField } from "../validators/validate"; +import { validateField, validateChild } from "../validators/validate"; export const VISITOR_KEYS: { [string]: Array } = {}; export const ALIAS_KEYS: { [string]: Array } = {}; @@ -8,14 +8,13 @@ export const FLIPPED_ALIAS_KEYS: { [string]: Array } = {}; export const NODE_FIELDS: { [string]: {} } = {}; export const BUILDER_KEYS: { [string]: Array } = {}; export const DEPRECATED_KEYS: { [string]: string } = {}; +export const NODE_PARENT_VALIDATIONS = {}; function getType(val) { if (Array.isArray(val)) { return "array"; } else if (val === null) { return "null"; - } else if (val === undefined) { - return "undefined"; } else { return typeof val; } @@ -71,7 +70,10 @@ export function assertEach(callback: Validator): Validator { if (!Array.isArray(val)) return; for (let i = 0; i < val.length; i++) { - callback(node, `${key}[${i}]`, val[i]); + const subkey = `${key}[${i}]`; + const v = val[i]; + callback(node, subkey, v); + if (process.env.BABEL_TYPES_8_BREAKING) validateChild(node, subkey, v); } } validator.each = callback; @@ -96,23 +98,20 @@ export function assertOneOf(...values: Array): Validator { export function assertNodeType(...types: Array): Validator { function validate(node, key, val) { - let valid = false; - for (const type of types) { if (is(type, val)) { - valid = true; - break; + validateChild(node, key, val); + return; } } - if (!valid) { - throw new TypeError( - `Property ${key} of ${ - node.type - } expected node to be of a type ${JSON.stringify(types)} ` + - `but instead got ${JSON.stringify(val && val.type)}`, - ); - } + throw new TypeError( + `Property ${key} of ${ + node.type + } expected node to be of a type ${JSON.stringify( + types, + )} but instead got ${JSON.stringify(val && val.type)}`, + ); } validate.oneOfNodeTypes = types; @@ -122,23 +121,20 @@ export function assertNodeType(...types: Array): Validator { export function assertNodeOrValueType(...types: Array): Validator { function validate(node, key, val) { - let valid = false; - for (const type of types) { if (getType(val) === type || is(type, val)) { - valid = true; - break; + validateChild(node, key, val); + return; } } - if (!valid) { - throw new TypeError( - `Property ${key} of ${ - node.type - } expected node to be of a type ${JSON.stringify(types)} ` + - `but instead got ${JSON.stringify(val && val.type)}`, - ); - } + throw new TypeError( + `Property ${key} of ${ + node.type + } expected node to be of a type ${JSON.stringify( + types, + )} but instead got ${JSON.stringify(val && val.type)}`, + ); } validate.oneOfNodeOrValueTypes = types; @@ -200,6 +196,17 @@ export function chain(...fns: Array): Validator { return validate; } +const validTypeOpts = [ + "aliases", + "builder", + "deprecatedAlias", + "fields", + "inherits", + "visitor", + "validate", +]; +const validFieldKeys = ["default", "optional", "validate"]; + export default function defineType( type: string, opts: { @@ -211,16 +218,38 @@ export default function defineType( builder?: Array, inherits?: string, deprecatedAlias?: string, + validate?: Validator, } = {}, ) { const inherits = (opts.inherits && store[opts.inherits]) || {}; - const fields: Object = opts.fields || inherits.fields || {}; + let fields = opts.fields; + if (!fields) { + fields = {}; + if (inherits.fields) { + const keys = Object.getOwnPropertyNames(inherits.fields); + for (const key of (keys: Array)) { + const field = inherits.fields[key]; + fields[key] = { + default: field.default, + optional: field.optional, + validate: field.validate, + }; + } + } + } + const visitor: Array = opts.visitor || inherits.visitor || []; const aliases: Array = opts.aliases || inherits.aliases || []; const builder: Array = opts.builder || inherits.builder || opts.visitor || []; + for (const k of (Object.keys(opts): Array)) { + if (validTypeOpts.indexOf(k) === -1) { + throw new Error(`Unknown type option "${k}" on ${type}`); + } + } + if (opts.deprecatedAlias) { DEPRECATED_KEYS[opts.deprecatedAlias] = type; } @@ -233,14 +262,20 @@ export default function defineType( for (const key of Object.keys(fields)) { const field = fields[key]; - if (builder.indexOf(key) === -1) { + if (field.default !== undefined && builder.indexOf(key) === -1) { field.optional = true; } if (field.default === undefined) { field.default = null; - } else if (!field.validate) { + } else if (!field.validate && field.default != null) { field.validate = assertValueType(getType(field.default)); } + + for (const k of (Object.keys(field): Array)) { + if (validFieldKeys.indexOf(k) === -1) { + throw new Error(`Unknown field key "${k}" on ${type}.${key}`); + } + } } VISITOR_KEYS[type] = opts.visitor = visitor; @@ -252,6 +287,10 @@ export default function defineType( FLIPPED_ALIAS_KEYS[alias].push(type); }); + if (opts.validate) { + NODE_PARENT_VALIDATIONS[type] = opts.validate; + } + store[type] = opts; } diff --git a/packages/babel-types/src/validators/generated/index.js b/packages/babel-types/src/validators/generated/index.js index 13ac0be73ac4..7c78934dfe8c 100644 --- a/packages/babel-types/src/validators/generated/index.js +++ b/packages/babel-types/src/validators/generated/index.js @@ -781,11 +781,11 @@ export function isClassBody(node: ?Object, opts?: Object): boolean { return false; } -export function isClassDeclaration(node: ?Object, opts?: Object): boolean { +export function isClassExpression(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassDeclaration") { + if (nodeType === "ClassExpression") { if (typeof opts === "undefined") { return true; } else { @@ -795,11 +795,11 @@ export function isClassDeclaration(node: ?Object, opts?: Object): boolean { return false; } -export function isClassExpression(node: ?Object, opts?: Object): boolean { +export function isClassDeclaration(node: ?Object, opts?: Object): boolean { if (!node) return false; const nodeType = node.type; - if (nodeType === "ClassExpression") { + if (nodeType === "ClassDeclaration") { if (typeof opts === "undefined") { return true; } else { @@ -3499,8 +3499,8 @@ export function isScopable(node: ?Object, opts?: Object): boolean { "SwitchStatement" === nodeType || "WhileStatement" === nodeType || "ArrowFunctionExpression" === nodeType || - "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || + "ClassDeclaration" === nodeType || "ForOfStatement" === nodeType || "ClassMethod" === nodeType || "ClassPrivateMethod" === nodeType || @@ -3847,8 +3847,8 @@ export function isPureish(node: ?Object, opts?: Object): boolean { "NullLiteral" === nodeType || "BooleanLiteral" === nodeType || "ArrowFunctionExpression" === nodeType || - "ClassDeclaration" === nodeType || "ClassExpression" === nodeType || + "ClassDeclaration" === nodeType || "BigIntLiteral" === nodeType || (nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) ) { @@ -3887,6 +3887,7 @@ export function isDeclaration(node: ?Object, opts?: Object): boolean { "InterfaceDeclaration" === nodeType || "OpaqueType" === nodeType || "TypeAlias" === nodeType || + "EnumDeclaration" === nodeType || "TSDeclareFunction" === nodeType || "TSInterfaceDeclaration" === nodeType || "TSTypeAliasDeclaration" === nodeType || @@ -4149,8 +4150,8 @@ export function isClass(node: ?Object, opts?: Object): boolean { const nodeType = node.type; if ( nodeType === "Class" || - "ClassDeclaration" === nodeType || - "ClassExpression" === nodeType + "ClassExpression" === nodeType || + "ClassDeclaration" === nodeType ) { if (typeof opts === "undefined") { return true; diff --git a/packages/babel-types/src/validators/isValidIdentifier.js b/packages/babel-types/src/validators/isValidIdentifier.js index 6dbbb7c32cd0..d8aaf8c36372 100644 --- a/packages/babel-types/src/validators/isValidIdentifier.js +++ b/packages/babel-types/src/validators/isValidIdentifier.js @@ -5,16 +5,20 @@ import esutils from "esutils"; * Check if the input `name` is a valid identifier name * and isn't a reserved word. */ -export default function isValidIdentifier(name: string): boolean { - if ( - typeof name !== "string" || - esutils.keyword.isReservedWordES6(name, true) - ) { - return false; - } else if (name === "await") { - // invalid in module, valid in script; better be safe (see #4952) - return false; - } else { - return esutils.keyword.isIdentifierNameES6(name); +export default function isValidIdentifier( + name: string, + reserved: boolean = true, +): boolean { + if (typeof name !== "string") return false; + + if (reserved) { + if (esutils.keyword.isReservedWordES6(name, true)) { + return false; + } else if (name === "await") { + // invalid in module, valid in script; better be safe (see #4952) + return false; + } } + + return esutils.keyword.isIdentifierNameES6(name); } diff --git a/packages/babel-types/src/validators/validate.js b/packages/babel-types/src/validators/validate.js index 738683849927..0ec35b684a0f 100644 --- a/packages/babel-types/src/validators/validate.js +++ b/packages/babel-types/src/validators/validate.js @@ -1,5 +1,5 @@ // @flow -import { NODE_FIELDS } from "../definitions"; +import { NODE_FIELDS, NODE_PARENT_VALIDATIONS } from "../definitions"; export default function validate(node?: Object, key: string, val: any): void { if (!node) return; @@ -9,6 +9,7 @@ export default function validate(node?: Object, key: string, val: any): void { const field = fields[key]; validateField(node, key, val, field); + validateChild(node, key, val); } export function validateField( @@ -22,3 +23,10 @@ export function validateField( field.validate(node, key, val); } + +export function validateChild(node?: Object, key: string, val?: Object) { + if (val == null) return; + const validate = NODE_PARENT_VALIDATIONS[val.type]; + if (!validate) return; + validate(node, key, val); +} From 81c5f1f22df1bbb2425b8c9d4a524cf459c16353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Sat, 11 Jan 2020 11:26:10 -0500 Subject: [PATCH 944/965] Disallow private name in object elements and TS type elements (#10980) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: disallow private name in object member and TS type elements * chore: update test262 whitelist * chore: make flow happy * Update packages/babel-parser/src/parser/expression.js Co-Authored-By: Nicolò Ribaudo * chore: update test fixtures * Update packages/babel-parser/src/parser/expression.js Co-Authored-By: Brian Ng * chore: update test fixtures Co-authored-by: Nicolò Ribaudo Co-authored-by: Brian Ng --- .../babel-parser/src/parser/expression.js | 21 +- packages/babel-parser/src/parser/statement.js | 2 +- packages/babel-parser/src/plugins/flow.js | 3 +- .../src/plugins/typescript/index.js | 2 +- .../invalid-destructuring-arguments/input.js | 4 + .../options.json | 3 + .../output.json | 324 +++++++++++++++++ .../invalid-destructuring/input.js | 6 + .../invalid-destructuring/options.json | 3 + .../invalid-destructuring/output.json | 344 ++++++++++++++++++ .../invalid-object-method/input.js | 3 + .../invalid-object-method/options.json | 3 + .../invalid-object-method/output.json | 226 ++++++++++++ .../invalid-ts-type-literal/input.js | 3 + .../invalid-ts-type-literal/options.json | 3 + .../invalid-ts-type-literal/output.json | 164 +++++++++ scripts/parser-tests/test262/whitelist.txt | 17 +- 17 files changed, 1106 insertions(+), 25 deletions(-) create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json create mode 100644 packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json diff --git a/packages/babel-parser/src/parser/expression.js b/packages/babel-parser/src/parser/expression.js index e3b6eae99a0b..d88bf86266d0 100644 --- a/packages/babel-parser/src/parser/expression.js +++ b/packages/babel-parser/src/parser/expression.js @@ -606,7 +606,7 @@ export default class ExpressionParser extends LValParser { ? this.parseExpression() : optional ? this.parseIdentifier(true) - : this.parseMaybePrivateName(); + : this.parseMaybePrivateName(true); node.computed = computed; if (node.property.type === "PrivateName") { @@ -1131,11 +1131,19 @@ export default class ExpressionParser extends LValParser { return this.finishNode(node, "BooleanLiteral"); } - parseMaybePrivateName(): N.PrivateName | N.Identifier { + parseMaybePrivateName( + isPrivateNameAllowed: boolean, + ): N.PrivateName | N.Identifier { const isPrivate = this.match(tt.hash); if (isPrivate) { this.expectOnePlugin(["classPrivateProperties", "classPrivateMethods"]); + if (!isPrivateNameAllowed) { + this.raise( + this.state.pos, + "Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p).", + ); + } const node = this.startNode(); this.next(); this.assertNoSpace("Unexpected space between # and identifier"); @@ -1596,12 +1604,12 @@ export default class ExpressionParser extends LValParser { } const containsEsc = this.state.containsEsc; - this.parsePropertyName(prop); + this.parsePropertyName(prop, /* isPrivateNameAllowed */ false); if (!isPattern && !containsEsc && !isGenerator && this.isAsyncProp(prop)) { isAsync = true; isGenerator = this.eat(tt.star); - this.parsePropertyName(prop); + this.parsePropertyName(prop, /* isPrivateNameAllowed */ false); } else { isAsync = false; } @@ -1688,7 +1696,7 @@ export default class ExpressionParser extends LValParser { if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) { if (isGenerator || isAsync) this.unexpected(); prop.kind = prop.key.name; - this.parsePropertyName(prop); + this.parsePropertyName(prop, /* isPrivateNameAllowed */ false); this.parseMethod( prop, /* isGenerator */ false, @@ -1780,6 +1788,7 @@ export default class ExpressionParser extends LValParser { parsePropertyName( prop: N.ObjectOrClassMember | N.ClassMember | N.TsNamedTypeElementBase, + isPrivateNameAllowed: boolean, ): N.Expression | N.Identifier { if (this.eat(tt.bracketL)) { (prop: $FlowSubtype).computed = true; @@ -1792,7 +1801,7 @@ export default class ExpressionParser extends LValParser { (prop: $FlowFixMe).key = this.match(tt.num) || this.match(tt.string) || this.match(tt.bigint) ? this.parseExprAtom() - : this.parseMaybePrivateName(); + : this.parseMaybePrivateName(isPrivateNameAllowed); if (prop.key.type !== "PrivateName") { // ClassPrivateProperty is never computed, so we don't assign in that case. diff --git a/packages/babel-parser/src/parser/statement.js b/packages/babel-parser/src/parser/statement.js index 7a5bc33c9541..85e177564676 100644 --- a/packages/babel-parser/src/parser/statement.js +++ b/packages/babel-parser/src/parser/statement.js @@ -1474,7 +1474,7 @@ export default class StatementParser extends ExpressionParser { } parseClassPropertyName(member: N.ClassMember): N.Expression | N.Identifier { - const key = this.parsePropertyName(member); + const key = this.parsePropertyName(member, /* isPrivateNameAllowed */ true); if ( !member.computed && diff --git a/packages/babel-parser/src/plugins/flow.js b/packages/babel-parser/src/plugins/flow.js index 72ed92b6c276..42f864a2069d 100644 --- a/packages/babel-parser/src/plugins/flow.js +++ b/packages/babel-parser/src/plugins/flow.js @@ -2266,9 +2266,10 @@ export default (superClass: Class): Class => parsePropertyName( node: N.ObjectOrClassMember | N.ClassMember | N.TsNamedTypeElementBase, + isPrivateNameAllowed: boolean, ): N.Identifier { const variance = this.flowParseVariance(); - const key = super.parsePropertyName(node); + const key = super.parsePropertyName(node, isPrivateNameAllowed); // $FlowIgnore ("variance" not defined on TsNamedTypeElementBase) node.variance = variance; return key; diff --git a/packages/babel-parser/src/plugins/typescript/index.js b/packages/babel-parser/src/plugins/typescript/index.js index 0c740b2c9bdd..b53dca72d61c 100644 --- a/packages/babel-parser/src/plugins/typescript/index.js +++ b/packages/babel-parser/src/plugins/typescript/index.js @@ -507,7 +507,7 @@ export default (superClass: Class): Class => return idx; } - this.parsePropertyName(node); + this.parsePropertyName(node, /* isPrivateNameAllowed */ false); return this.tsParsePropertyOrMethodSignature(node, readonly); } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js new file mode 100644 index 000000000000..efc69f1bc6eb --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/input.js @@ -0,0 +1,4 @@ +class C { + #x = 1; + #p = ({ #x: x }) => {} +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json new file mode 100644 index 000000000000..f26e916957c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json new file mode 100644 index 000000000000..d8c6109cf982 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json @@ -0,0 +1,324 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (3:11)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "sourceType": "script", + "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": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 4, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ClassPrivateProperty", + "start": 22, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "static": false, + "key": { + "type": "PrivateName", + "start": 22, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 23, + "end": 24, + "loc": { + "start": { + "line": 3, + "column": 3 + }, + "end": { + "line": 3, + "column": 4 + }, + "identifierName": "p" + }, + "name": "p" + } + }, + "value": { + "type": "ArrowFunctionExpression", + "start": 27, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 7 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "id": null, + "generator": false, + "async": false, + "params": [ + { + "type": "ObjectPattern", + "start": 28, + "end": 37, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 30, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "method": false, + "key": { + "type": "PrivateName", + "start": 30, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 10 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 31, + "end": 32, + "loc": { + "start": { + "line": 3, + "column": 11 + }, + "end": { + "line": 3, + "column": 12 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 34, + "end": 35, + "loc": { + "start": { + "line": 3, + "column": 14 + }, + "end": { + "line": 3, + "column": 15 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + } + ], + "body": { + "type": "BlockStatement", + "start": 42, + "end": 44, + "loc": { + "start": { + "line": 3, + "column": 22 + }, + "end": { + "line": 3, + "column": 24 + } + }, + "body": [], + "directives": [] + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js new file mode 100644 index 000000000000..980a785949d2 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/input.js @@ -0,0 +1,6 @@ +class C { + #x = 1; + m() { + const {#x: x} = this; + } +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json new file mode 100644 index 000000000000..f26e916957c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json new file mode 100644 index 000000000000..73b7c2579453 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json @@ -0,0 +1,344 @@ +{ + "type": "File", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (4:12)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 59, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "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": 59, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 6, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 19, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 9 + } + }, + "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": "x" + }, + "name": "x" + } + }, + "value": { + "type": "NumericLiteral", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 7 + }, + "end": { + "line": 2, + "column": 8 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ClassMethod", + "start": 22, + "end": 57, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 22, + "end": 23, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 3 + }, + "identifierName": "m" + }, + "name": "m" + }, + "computed": false, + "kind": "method", + "id": null, + "generator": false, + "async": false, + "params": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 57, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 5, + "column": 3 + } + }, + "body": [ + { + "type": "VariableDeclaration", + "start": 32, + "end": 53, + "loc": { + "start": { + "line": 4, + "column": 4 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 38, + "end": 52, + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 24 + } + }, + "id": { + "type": "ObjectPattern", + "start": 38, + "end": 45, + "loc": { + "start": { + "line": 4, + "column": 10 + }, + "end": { + "line": 4, + "column": 17 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 39, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 16 + } + }, + "method": false, + "key": { + "type": "PrivateName", + "start": 39, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 13 + } + }, + "id": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 4, + "column": 12 + }, + "end": { + "line": 4, + "column": 13 + }, + "identifierName": "x" + }, + "name": "x" + } + }, + "shorthand": false, + "value": { + "type": "Identifier", + "start": 43, + "end": 44, + "loc": { + "start": { + "line": 4, + "column": 15 + }, + "end": { + "line": 4, + "column": 16 + }, + "identifierName": "x" + }, + "name": "x" + } + } + ] + }, + "init": { + "type": "ThisExpression", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 24 + } + } + } + } + ], + "kind": "const" + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js new file mode 100644 index 000000000000..234c9a49371e --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/input.js @@ -0,0 +1,3 @@ +class C { + #p = ({ #x: 42 }); +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json new file mode 100644 index 000000000000..f26e916957c8 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json new file mode 100644 index 000000000000..7a5716ee676d --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json @@ -0,0 +1,226 @@ +{ + "type": "File", + "start": 0, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (2:11)" + ], + "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": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "C" + }, + "name": "C" + }, + "superClass": null, + "body": { + "type": "ClassBody", + "start": 8, + "end": 32, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "ClassPrivateProperty", + "start": 12, + "end": 30, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "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": "p" + }, + "name": "p" + } + }, + "value": { + "type": "ObjectExpression", + "start": 18, + "end": 28, + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "method": 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": "x" + }, + "name": "x" + } + }, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 14 + }, + "end": { + "line": 2, + "column": 16 + } + }, + "extra": { + "rawValue": 42, + "raw": "42" + }, + "value": 42 + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 17 + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js new file mode 100644 index 000000000000..dd79bd88301a --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/input.js @@ -0,0 +1,3 @@ +interface I { + #p: string +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json new file mode 100644 index 000000000000..cb835ce4233c --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["classPrivateProperties", "typescript"] +} diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json new file mode 100644 index 000000000000..3422be4603b9 --- /dev/null +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json @@ -0,0 +1,164 @@ +{ + "type": "File", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "errors": [ + "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (2:3)" + ], + "program": { + "type": "Program", + "start": 0, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "sourceType": "script", + "interpreter": null, + "body": [ + { + "type": "TSInterfaceDeclaration", + "start": 0, + "end": 28, + "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": "I" + }, + "name": "I" + }, + "body": { + "type": "TSInterfaceBody", + "start": 12, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 3, + "column": 1 + } + }, + "body": [ + { + "type": "TSPropertySignature", + "start": 16, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "key": { + "type": "PrivateName", + "start": 16, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 4 + } + }, + "id": { + "type": "Identifier", + "start": 17, + "end": 18, + "loc": { + "start": { + "line": 2, + "column": 3 + }, + "end": { + "line": 2, + "column": 4 + }, + "identifierName": "p" + }, + "name": "p" + } + }, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 18, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "typeAnnotation": { + "type": "TSStringKeyword", + "start": 20, + "end": 26, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 12 + } + } + } + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/parser-tests/test262/whitelist.txt b/scripts/parser-tests/test262/whitelist.txt index d7a38c2104cf..8b137891791f 100644 --- a/scripts/parser-tests/test262/whitelist.txt +++ b/scripts/parser-tests/test262/whitelist.txt @@ -1,16 +1 @@ -language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) -language/expressions/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(default) -language/expressions/object/method-definition/private-name-early-error-async-gen-inside-class.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-async-gen.js(default) -language/expressions/object/method-definition/private-name-early-error-async-gen.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(default) -language/expressions/object/method-definition/private-name-early-error-gen-inside-class.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-gen.js(default) -language/expressions/object/method-definition/private-name-early-error-gen.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(default) -language/expressions/object/method-definition/private-name-early-error-method-inside-class.js(strict mode) -language/expressions/object/method-definition/private-name-early-error-method.js(default) -language/expressions/object/method-definition/private-name-early-error-method.js(strict mode) -language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(default) -language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js(strict mode) + From d8e6219ad92e87e5c339c52314bb0121f20685fd Mon Sep 17 00:00:00 2001 From: Kai Cataldo Date: Sat, 11 Jan 2020 14:42:21 -0500 Subject: [PATCH 945/965] @babel/eslint-plugin: Update rules/tests to use @babel/eslint-parser (#10977) * Use @babel/eslint-parser for tests * Update rules/tests * Update docs * add @babel/eslint-shared-fixtures to package.json * remove bug fix * convert RuleTester to ESM * Update devDep versions --- eslint/babel-eslint-parser/package.json | 18 +- .../test/babel-eslint-parser.js | 5 +- .../test/non-regression.js | 10 +- eslint/babel-eslint-plugin/README.md | 16 +- eslint/babel-eslint-plugin/package.json | 8 +- eslint/babel-eslint-plugin/src/index.js | 3 - .../src/rules/camelcase.js | 231 ---- .../babel-eslint-plugin/src/rules/new-cap.js | 4 +- .../src/rules/no-unused-expressions.js | 3 +- .../src/rules/object-curly-spacing.js | 34 +- eslint/babel-eslint-plugin/src/rules/semi.js | 43 +- .../test/helpers/RuleTester.js | 13 +- .../test/rules/camelcase.js | 570 --------- .../babel-eslint-plugin/test/rules/new-cap.js | 294 +---- .../test/rules/no-invalid-this.js | 571 +-------- .../test/rules/no-unused-expressions.js | 353 +----- .../test/rules/object-curly-spacing.js | 1129 +---------------- eslint/babel-eslint-plugin/test/rules/semi.js | 645 +--------- .../config/babel.config.decorators-legacy.js | 0 .../config/babel.config.js | 1 + .../babel-eslint-shared-fixtures/package.json | 25 + jest.config.js | 3 +- 22 files changed, 101 insertions(+), 3878 deletions(-) delete mode 100644 eslint/babel-eslint-plugin/src/rules/camelcase.js delete mode 100644 eslint/babel-eslint-plugin/test/rules/camelcase.js rename eslint/{babel-eslint-parser/test/fixtures => babel-eslint-shared-fixtures}/config/babel.config.decorators-legacy.js (100%) rename eslint/{babel-eslint-parser/test/fixtures => babel-eslint-shared-fixtures}/config/babel.config.js (94%) create mode 100644 eslint/babel-eslint-shared-fixtures/package.json diff --git a/eslint/babel-eslint-parser/package.json b/eslint/babel-eslint-parser/package.json index c7b4300bec50..e9377d7052e5 100644 --- a/eslint/babel-eslint-parser/package.json +++ b/eslint/babel-eslint-parser/package.json @@ -21,7 +21,7 @@ "main": "lib/index.js", "peerDependencies": { "@babel/core": ">=7.2.0", - "eslint": ">= 6.0.0" + "eslint": ">=6.0.0" }, "dependencies": { "eslint-scope": "5.0.0", @@ -29,22 +29,8 @@ "semver": "^6.3.0" }, "devDependencies": { + "@babel/eslint-shared-fixtures": "*", "@babel/core": "^7.2.0", - "@babel/plugin-proposal-class-properties": "^7.1.0", - "@babel/plugin-proposal-decorators": "^7.1.2", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", - "@babel/plugin-proposal-optional-chaining": "^7.0.0", - "@babel/plugin-proposal-pipeline-operator": "^7.0.0", - "@babel/plugin-proposal-private-methods": "^7.7.4", - "@babel/plugin-syntax-bigint": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.0.0", - "@babel/plugin-syntax-export-default-from": "^7.0.0", - "@babel/plugin-syntax-export-namespace-from": "^7.0.0", - "@babel/plugin-syntax-import-meta": "^7.0.0", - "@babel/plugin-syntax-numeric-separator": "^7.0.0", - "@babel/preset-env": "^7.1.5", - "@babel/preset-flow": "^7.0.0", - "@babel/preset-react": "^7.0.0", "dedent": "^0.7.0", "eslint": "^6.0.1", "espree": "^6.0.0" diff --git a/eslint/babel-eslint-parser/test/babel-eslint-parser.js b/eslint/babel-eslint-parser/test/babel-eslint-parser.js index 3924875d38d5..3e692340ce59 100644 --- a/eslint/babel-eslint-parser/test/babel-eslint-parser.js +++ b/eslint/babel-eslint-parser/test/babel-eslint-parser.js @@ -1,5 +1,4 @@ import assert from "assert"; -import path from "path"; import espree from "espree"; import escope from "eslint-scope"; import unpad from "dedent"; @@ -7,7 +6,9 @@ import { parseForESLint } from "../src"; import assertImplementsAST from "./helpers/assert-implements-ast"; const babelOptions = { - configFile: path.resolve(__dirname, "./fixtures/config/babel.config.js"), + configFile: require.resolve( + "@babel/eslint-shared-fixtures/config/babel.config.js", + ), }; function parseAndAssertSame(code) { diff --git a/eslint/babel-eslint-parser/test/non-regression.js b/eslint/babel-eslint-parser/test/non-regression.js index 418c651d1640..13524702e335 100644 --- a/eslint/babel-eslint-parser/test/non-regression.js +++ b/eslint/babel-eslint-parser/test/non-regression.js @@ -23,9 +23,8 @@ function verifyAndAssertMessagesWithSpecificESLint( sourceType, requireConfigFile: false, babelOptions: { - configFile: path.resolve( - __dirname, - "./fixtures/config/babel.config.js", + configFile: require.resolve( + "@babel/eslint-shared-fixtures/config/babel.config.js", ), }, ...overrideConfig?.parserOptions, @@ -1157,9 +1156,8 @@ describe("verify", () => { parserOptions: { sourceType, babelOptions: { - configFile: path.resolve( - __dirname, - "./fixtures/config/babel.config.decorators-legacy.js", + configFile: require.resolve( + "@babel/eslint-shared-fixtures/config/babel.config.decorators-legacy.js", ), }, }, diff --git a/eslint/babel-eslint-plugin/README.md b/eslint/babel-eslint-plugin/README.md index 2d1e11c45860..5577c01344c0 100644 --- a/eslint/babel-eslint-plugin/README.md +++ b/eslint/babel-eslint-plugin/README.md @@ -1,7 +1,7 @@ # @babel/eslint-plugin Companion rules for `@babel/eslint-parser`. `@babel/eslint-parser` does a great job at adapting `eslint` -for use with Babel, but it can't change the built in rules to support experimental features. +for use with Babel, but it can't change the built-in rules to support experimental features. `@babel/eslint-plugin` re-implements problematic rules so they do not give false positives or negatives. > Requires Node 10.9 or greater @@ -26,7 +26,6 @@ original ones as well!). ```json { "rules": { - "babel/camelcase": "error", "babel/new-cap": "error", "babel/no-invalid-this": "error", "babel/no-unused-expressions": "error", @@ -37,13 +36,12 @@ original ones as well!). ``` ### Rules -Each rule corresponds to a core `eslint` rule, and has the same options. +Each rule corresponds to a core `eslint` rule and has the same options. 🛠: means it's autofixable with `--fix`. -- `babel/camelcase: doesn't complain about optional chaining (`var foo = bar?.a_b;`) -- `babel/new-cap`: Ignores capitalized decorators (`@Decorator`) -- `babel/no-invalid-this`: doesn't fail when inside class properties (`class A { a = this.b; }`) -- `babel/no-unused-expressions`: doesn't fail when using `do` expressions or [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`a?.b()`). -- `babel/object-curly-spacing`: doesn't complain about `export x from "mod";` or `export * as x from "mod";` (🛠) -- `babel/semi`: doesn't fail when using `for await (let something of {})`. Includes class properties (🛠) +- `babel/new-cap`: handles decorators (`@Decorator`) +- `babel/no-invalid-this`: handles class fields and private class methods (`class A { a = this.b; }`) +- `babel/no-unused-expressions`: handles `do` expressions +- `babel/object-curly-spacing`: handles `export * as x from "mod";` (🛠) +- `babel/semi`: Handles class properties (🛠) diff --git a/eslint/babel-eslint-plugin/package.json b/eslint/babel-eslint-plugin/package.json index c035493b7c3b..11384c7a3102 100644 --- a/eslint/babel-eslint-plugin/package.json +++ b/eslint/babel-eslint-plugin/package.json @@ -27,14 +27,16 @@ }, "homepage": "https://github.com/babel/babel/tree/master/eslint/babel-eslint-plugin", "peerDependencies": { - "eslint": ">=4.0.0" + "@babel/eslint-parser": "0.0.0", + "eslint": ">=6.0.0" }, "dependencies": { "eslint-rule-composer": "^0.3.0" }, "devDependencies": { - "babel-eslint": "^8.2.2", - "eslint": "^4.19.1", + "@babel/eslint-shared-fixtures": "*", + "@babel/eslint-parser": "*", + "eslint": "^6.0.0", "lodash.clonedeep": "^4.5.0" } } diff --git a/eslint/babel-eslint-plugin/src/index.js b/eslint/babel-eslint-plugin/src/index.js index 8b8c0fbf37d7..96fd40caf70e 100644 --- a/eslint/babel-eslint-plugin/src/index.js +++ b/eslint/babel-eslint-plugin/src/index.js @@ -1,5 +1,4 @@ import newCap from "./rules/new-cap"; -import camelcase from "./rules/camelcase"; import noInvalidThis from "./rules/no-invalid-this"; import noUnusedExpressions from "./rules/no-unused-expressions"; import objectCurlySpacing from "./rules/object-curly-spacing"; @@ -7,7 +6,6 @@ import semi from "./rules/semi"; module.exports = { rules: { - camelcase, "new-cap": newCap, "no-invalid-this": noInvalidThis, "no-unused-expressions": noUnusedExpressions, @@ -15,7 +13,6 @@ module.exports = { semi, }, rulesConfig: { - camelcase: "off", "new-cap": "off", "no-invalid-this": "off", "no-unused-expressions": "off", diff --git a/eslint/babel-eslint-plugin/src/rules/camelcase.js b/eslint/babel-eslint-plugin/src/rules/camelcase.js deleted file mode 100644 index 84e1605c5ff4..000000000000 --- a/eslint/babel-eslint-plugin/src/rules/camelcase.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * @fileoverview Rule to flag non-camelcased identifiers - * @author Nicholas C. Zakas - */ - -"use strict"; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -export default { - meta: { - docs: { - description: "enforce camelcase naming convention", - category: "Stylistic Issues", - recommended: false, - url: "https://eslint.org/docs/rules/camelcase", - }, - - schema: [ - { - type: "object", - properties: { - ignoreDestructuring: { - type: "boolean", - }, - properties: { - enum: ["always", "never"], - }, - }, - additionalProperties: false, - }, - ], - - messages: { - notCamelCase: "Identifier '{{name}}' is not in camel case.", - }, - }, - - create(context) { - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- - - // contains reported nodes to avoid reporting twice on destructuring with shorthand notation - const reported = []; - const ALLOWED_PARENT_TYPES = new Set(["CallExpression", "NewExpression"]); - const MEMBER_EXPRESSIONS = ["MemberExpression", "OptionalMemberExpression"]; - - /** - * Checks if expression is supported member expression. - * - * @param {string} expression - An expression to check. - * @returns {boolean} `true` if the expression type is supported - */ - function isMemberExpression(expression) { - return MEMBER_EXPRESSIONS.indexOf(expression) >= 0; - } - - /** - * Checks if a string contains an underscore and isn't all upper-case - * @param {string} name The string to check. - * @returns {boolean} if the string is underscored - * @private - */ - function isUnderscored(name) { - // if there's an underscore, it might be A_CONSTANT, which is okay - return name.indexOf("_") > -1 && name !== name.toUpperCase(); - } - - /** - * Checks if a parent of a node is an ObjectPattern. - * @param {ASTNode} node The node to check. - * @returns {boolean} if the node is inside an ObjectPattern - * @private - */ - function isInsideObjectPattern(node) { - let { parent } = node; - - while (parent) { - if (parent.type === "ObjectPattern") { - return true; - } - - parent = parent.parent; - } - - return false; - } - - /** - * Reports an AST node as a rule violation. - * @param {ASTNode} node The node to report. - * @returns {void} - * @private - */ - function report(node) { - if (reported.indexOf(node.parent) < 0) { - reported.push(node.parent); - context.report({ - node, - messageId: "notCamelCase", - data: { name: node.name }, - }); - } - } - - const options = context.options[0] || {}; - let properties = options.properties || ""; - const ignoreDestructuring = options.ignoreDestructuring || false; - - if (properties !== "always" && properties !== "never") { - properties = "always"; - } - - return { - Identifier(node) { - /* - * Leading and trailing underscores are commonly used to flag - * private/protected identifiers, strip them - */ - const name = node.name.replace(/^_+|_+$/g, ""), - effectiveParent = isMemberExpression(node.parent.type) - ? node.parent.parent - : node.parent; - - // MemberExpressions get special rules - if (isMemberExpression(node.parent.type)) { - // "never" check properties - if (properties === "never") { - return; - } - - // Always report underscored object names - if ( - node.parent.object.type === "Identifier" && - node.parent.object.name === node.name && - isUnderscored(name) - ) { - report(node); - - // Report AssignmentExpressions only if they are the left side of the assignment - } else if ( - effectiveParent.type === "AssignmentExpression" && - isUnderscored(name) && - (!isMemberExpression(effectiveParent.right.type) || - (isMemberExpression(effectiveParent.left.type) && - effectiveParent.left.property.name === node.name)) - ) { - report(node); - } - - /* - * Properties have their own rules, and - * AssignmentPattern nodes can be treated like Properties: - * e.g.: const { no_camelcased = false } = bar; - */ - } else if ( - node.parent.type === "Property" || - node.parent.type === "AssignmentPattern" - ) { - if ( - node.parent.parent && - node.parent.parent.type === "ObjectPattern" - ) { - const assignmentKeyEqualsValue = - node.parent.key.name === node.parent.value.name; - - // prevent checking righthand side of destructured object - if (node.parent.key === node && node.parent.value !== node) { - return; - } - - const valueIsUnderscored = - node.parent.value.name && isUnderscored(name); - - // ignore destructuring if the option is set, unless a new identifier is created - if ( - valueIsUnderscored && - !(assignmentKeyEqualsValue && ignoreDestructuring) - ) { - report(node); - } - } - - // "never" check properties or always ignore destructuring - if ( - properties === "never" || - (ignoreDestructuring && isInsideObjectPattern(node)) - ) { - return; - } - - // don't check right hand side of AssignmentExpression to prevent duplicate warnings - if ( - isUnderscored(name) && - !ALLOWED_PARENT_TYPES.has(effectiveParent.type) && - !(node.parent.right === node) - ) { - report(node); - } - - // Check if it's an import specifier - } else if ( - [ - "ImportSpecifier", - "ImportNamespaceSpecifier", - "ImportDefaultSpecifier", - ].indexOf(node.parent.type) >= 0 - ) { - // Report only if the local imported identifier is underscored - if ( - node.parent.local && - node.parent.local.name === node.name && - isUnderscored(name) - ) { - report(node); - } - - // Report anything that is underscored that isn't a CallExpression - } else if ( - isUnderscored(name) && - !ALLOWED_PARENT_TYPES.has(effectiveParent.type) - ) { - report(node); - } - }, - }; - }, -}; diff --git a/eslint/babel-eslint-plugin/src/rules/new-cap.js b/eslint/babel-eslint-plugin/src/rules/new-cap.js index 9e8320c0e76f..1fddf1a43b5a 100644 --- a/eslint/babel-eslint-plugin/src/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/src/rules/new-cap.js @@ -1,7 +1,7 @@ import ruleComposer from "eslint-rule-composer"; import eslint from "eslint"; -const newCapRule = new eslint.Linter().getRules().get("new-cap"); +const rule = new eslint.Linter().getRules().get("new-cap"); /** * Returns whether a node is under a decorator or not. @@ -13,6 +13,6 @@ function isDecorator(node) { } export default ruleComposer.filterReports( - newCapRule, + rule, problem => !isDecorator(problem.node), ); diff --git a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js index de72047dd00b..a313b0743245 100644 --- a/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/src/rules/no-unused-expressions.js @@ -21,6 +21,7 @@ function isFinalStatementInBlockStatement(node) { * @param {ASTNode} node - any node * @returns {boolean} whether the given node represents an unbroken chain of * tail ExpressionStatements and IfStatements within a DoExpression + * https://github.com/tc39/proposal-do-expressions */ function isInDoStatement(node) { if (!node) return false; @@ -46,7 +47,7 @@ function isInDoStatement(node) { /** * @param {ASTNode} node - any node * @returns {boolean} whether the given node is an optional call expression, - * see https://github.com/tc39/proposal-optional-chaining + * https://github.com/tc39/proposal-optional-chaining */ function isOptionalCallExpression(node) { return ( diff --git a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js index 52d877ac8732..210f7a9fe5fa 100644 --- a/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/src/rules/object-curly-spacing.js @@ -1,26 +1,20 @@ import ruleComposer from "eslint-rule-composer"; import eslint from "eslint"; -const objectCurlySpacingRule = new eslint.Linter() - .getRules() - .get("object-curly-spacing"); +const rule = new eslint.Linter().getRules().get("object-curly-spacing"); -export default ruleComposer.filterReports( - objectCurlySpacingRule, - (problem, metadata) => { - const node = problem.node; +export default ruleComposer.filterReports(rule, problem => { + const node = problem.node; - // Allow `exportNamespaceFrom` and `exportDefaultFrom` syntax: - // export * as x from '...'; - // export x from '...'; - if ( - node.type === "ExportNamedDeclaration" && - node.specifiers.length > 0 && - metadata.sourceCode.getTokenBefore(node.specifiers[0]).value === "export" - ) { - return false; - } + // Allow exportDefaultFrom syntax: + // export x from '...'; + if ( + node.type === "ExportNamedDeclaration" && + node.specifiers.length === 1 && + node.specifiers[0].type === "ExportDefaultSpecifier" + ) { + return false; + } - return true; - }, -); + return true; +}); diff --git a/eslint/babel-eslint-plugin/src/rules/semi.js b/eslint/babel-eslint-plugin/src/rules/semi.js index a1dabd1bbf96..f8cc783ac64a 100644 --- a/eslint/babel-eslint-plugin/src/rules/semi.js +++ b/eslint/babel-eslint-plugin/src/rules/semi.js @@ -1,13 +1,15 @@ import ruleComposer from "eslint-rule-composer"; import eslint from "eslint"; -const semiRule = new eslint.Linter().getRules().get("semi"); - const OPT_OUT_PATTERN = /^[-[(/+`]/; // One of [(/+-` -const isSemicolon = token => token.type === "Punctuator" && token.value === ";"; +const rule = new eslint.Linter().getRules().get("semi"); + +function isSemicolon(token) { + return token.type === "Punctuator" && token.value === ";"; +} -const isUnnecessarySemicolon = (context, lastToken) => { +function isUnnecessarySemicolon(context, lastToken) { if (!isSemicolon(lastToken)) { return false; } @@ -27,9 +29,9 @@ const isUnnecessarySemicolon = (context, lastToken) => { const isDivider = nextToken.value === "}" || nextToken.value === ";"; return (lastTokenLine !== nextTokenLine && !isOptOutToken) || isDivider; -}; +} -const isOneLinerBlock = (context, node) => { +function isOneLinerBlock(context, node) { const nextToken = context.getSourceCode().getTokenAfter(node); if (!nextToken || nextToken.value !== "}") { @@ -43,9 +45,9 @@ const isOneLinerBlock = (context, node) => { parent.type === "BlockStatement" && parent.loc.start.line === parent.loc.end.line ); -}; +} -const report = (context, node, missing) => { +function report(context, node, missing) { const lastToken = context.getSourceCode().getLastToken(node); let message, @@ -72,15 +74,14 @@ const report = (context, node, missing) => { message, fix, }); -}; +} -const semiRuleWithClassProperty = ruleComposer.joinReports([ - semiRule, +export default ruleComposer.joinReports([ + rule, context => ({ ClassProperty(node) { const options = context.options[1]; const exceptOneLine = options && options.omitLastInOneLineBlock === true; - const sourceCode = context.getSourceCode(); const lastToken = sourceCode.getLastToken(node); @@ -102,21 +103,3 @@ const semiRuleWithClassProperty = ruleComposer.joinReports([ }, }), ]); - -export default ruleComposer.filterReports( - semiRuleWithClassProperty, - problem => { - const node = problem.node; - - // Handle async iterator: - // for await (let something of {}) - if ( - node.type === "VariableDeclaration" && - node.parent.type === "ForAwaitStatement" - ) { - return false; - } - - return true; - }, -); diff --git a/eslint/babel-eslint-plugin/test/helpers/RuleTester.js b/eslint/babel-eslint-plugin/test/helpers/RuleTester.js index e183277bfb40..47166bd51185 100644 --- a/eslint/babel-eslint-plugin/test/helpers/RuleTester.js +++ b/eslint/babel-eslint-plugin/test/helpers/RuleTester.js @@ -1,7 +1,14 @@ -var RuleTester = require("eslint").RuleTester; +import { RuleTester } from "eslint"; RuleTester.setDefaultConfig({ - parser: 'babel-eslint' + parser: require.resolve("@babel/eslint-parser"), + parserOptions: { + babelOptions: { + configFile: require.resolve( + "@babel/eslint-shared-fixtures/config/babel.config.js", + ), + }, + }, }); -module.exports = RuleTester; +export default RuleTester; diff --git a/eslint/babel-eslint-plugin/test/rules/camelcase.js b/eslint/babel-eslint-plugin/test/rules/camelcase.js deleted file mode 100644 index c44861557ab1..000000000000 --- a/eslint/babel-eslint-plugin/test/rules/camelcase.js +++ /dev/null @@ -1,570 +0,0 @@ -/** - * @fileoverview Tests for camelcase rule. - * @author Nicholas C. Zakas - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -import rule from "../../src/rules/camelcase"; -import RuleTester from "../helpers/RuleTester"; - -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - -const ruleTester = new RuleTester(); - -ruleTester.run("camelcase", rule, { - valid: [ - // Original test cases. - 'firstName = "Nicholas"', - 'FIRST_NAME = "Nicholas"', - '__myPrivateVariable = "Patrick"', - 'myPrivateVariable_ = "Patrick"', - "function doSomething(){}", - "do_something()", - "new do_something", - "new do_something()", - "foo.do_something()", - "var foo = bar.baz_boom;", - "var foo = bar.baz_boom.something;", - "foo.boom_pow.qux = bar.baz_boom.something;", - "if (bar.baz_boom) {}", - "var obj = { key: foo.bar_baz };", - "var arr = [foo.bar_baz];", - "[foo.bar_baz]", - "var arr = [foo.bar_baz.qux];", - "[foo.bar_baz.nesting]", - "if (foo.bar_baz === boom.bam_pow) { [foo.baz_boom] }", - { - code: "var o = {key: 1}", - options: [{ properties: "always" }], - }, - { - code: "var o = {_leading: 1}", - options: [{ properties: "always" }], - }, - { - code: "var o = {trailing_: 1}", - options: [{ properties: "always" }], - }, - { - code: "var o = {bar_baz: 1}", - options: [{ properties: "never" }], - }, - { - code: "var o = {_leading: 1}", - options: [{ properties: "never" }], - }, - { - code: "var o = {trailing_: 1}", - options: [{ properties: "never" }], - }, - { - code: "obj.a_b = 2;", - options: [{ properties: "never" }], - }, - { - code: "obj._a = 2;", - options: [{ properties: "always" }], - }, - { - code: "obj.a_ = 2;", - options: [{ properties: "always" }], - }, - { - code: "obj._a = 2;", - options: [{ properties: "never" }], - }, - { - code: "obj.a_ = 2;", - options: [{ properties: "never" }], - }, - { - code: "var obj = {\n a_a: 1 \n};\n obj.a_b = 2;", - options: [{ properties: "never" }], - }, - { - code: "obj.foo_bar = function(){};", - options: [{ properties: "never" }], - }, - { - code: "var { category_id } = query;", - options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var { category_id: category_id } = query;", - options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var { category_id = 1 } = query;", - options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var { category_id: category } = query;", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var { _leading } = query;", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "var { trailing_ } = query;", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: 'import { camelCased } from "external module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: 'import { _leading } from "external module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: 'import { trailing_ } from "external module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: 'import { no_camelcased as camelCased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: 'import { no_camelcased as _leading } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: 'import { no_camelcased as trailing_ } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: - 'import { no_camelcased as camelCased, anoterCamelCased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - }, - { - code: "function foo({ no_camelcased: camelCased }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ no_camelcased: _leading }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ no_camelcased: trailing_ }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ camelCased = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ _leading = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ trailing_ = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ camelCased }) {};", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ _leading }) {}", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "function foo({ trailing_ }) {}", - parserOptions: { ecmaVersion: 6 }, - }, - - // Babel-specific test cases - { - code: "var foo = bar?.a_b;", - options: [{ properties: "never" }], - }, - ], - invalid: [ - { - code: 'first_name = "Nicholas"', - errors: [ - { - messageId: "notCamelCase", - data: { name: "first_name" }, - type: "Identifier", - }, - ], - }, - { - code: '__private_first_name = "Patrick"', - errors: [ - { - messageId: "notCamelCase", - data: { name: "__private_first_name" }, - type: "Identifier", - }, - ], - }, - { - code: "function foo_bar(){}", - errors: [ - { - messageId: "notCamelCase", - data: { name: "foo_bar" }, - type: "Identifier", - }, - ], - }, - { - code: "obj.foo_bar = function(){};", - errors: [ - { - messageId: "notCamelCase", - data: { name: "foo_bar" }, - type: "Identifier", - }, - ], - }, - { - code: "bar_baz.foo = function(){};", - errors: [ - { - messageId: "notCamelCase", - data: { name: "bar_baz" }, - type: "Identifier", - }, - ], - }, - { - code: "[foo_bar.baz]", - errors: [ - { - messageId: "notCamelCase", - data: { name: "foo_bar" }, - type: "Identifier", - }, - ], - }, - { - code: "if (foo.bar_baz === boom.bam_pow) { [foo_bar.baz] }", - errors: [ - { - messageId: "notCamelCase", - data: { name: "foo_bar" }, - type: "Identifier", - }, - ], - }, - { - code: "foo.bar_baz = boom.bam_pow", - errors: [ - { - messageId: "notCamelCase", - data: { name: "bar_baz" }, - type: "Identifier", - }, - ], - }, - { - code: "var foo = { bar_baz: boom.bam_pow }", - errors: [ - { - messageId: "notCamelCase", - data: { name: "bar_baz" }, - type: "Identifier", - }, - ], - }, - { - code: "foo.qux.boom_pow = { bar: boom.bam_pow }", - errors: [ - { - messageId: "notCamelCase", - data: { name: "boom_pow" }, - type: "Identifier", - }, - ], - }, - { - code: "var o = {bar_baz: 1}", - options: [{ properties: "always" }], - errors: [ - { - messageId: "notCamelCase", - data: { name: "bar_baz" }, - type: "Identifier", - }, - ], - }, - { - code: "obj.a_b = 2;", - options: [{ properties: "always" }], - errors: [ - { - messageId: "notCamelCase", - data: { name: "a_b" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id: category_alias } = query;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "category_alias" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id: category_alias } = query;", - options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "category_alias" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id: categoryId, ...other_props } = query;", - options: [{ ignoreDestructuring: true }], - parserOptions: { ecmaVersion: 2018 }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "other_props" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id } = query;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "category_id" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id: category_id } = query;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "category_id" }, - type: "Identifier", - }, - ], - }, - { - code: "var { category_id = 1 } = query;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'category_id' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: 'import no_camelcased from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: 'import * as no_camelcased from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: 'import { no_camelcased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: - 'import { no_camelcased as no_camel_cased } from "external module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camel_cased" }, - type: "Identifier", - }, - ], - }, - { - code: 'import { camelCased as no_camel_cased } from "external module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camel_cased" }, - type: "Identifier", - }, - ], - }, - { - code: 'import { camelCased, no_camelcased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: - 'import { no_camelcased as camelCased, another_no_camelcased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "another_no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: 'import camelCased, { no_camelcased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: - 'import no_camelcased, { another_no_camelcased as camelCased } from "external-module";', - parserOptions: { ecmaVersion: 6, sourceType: "module" }, - errors: [ - { - messageId: "notCamelCase", - data: { name: "no_camelcased" }, - type: "Identifier", - }, - ], - }, - { - code: "function foo({ no_camelcased }) {};", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "function foo({ no_camelcased = 'default value' }) {};", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: - "const no_camelcased = 0; function foo({ camelcased_value = no_camelcased}) {}", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - { - message: "Identifier 'camelcased_value' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "const { bar: no_camelcased } = foo;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "function foo({ value_1: my_default }) {}", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'my_default' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "function foo({ isCamelcased: no_camelcased }) {};", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "var { foo: bar_baz = 1 } = quz;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'bar_baz' is not in camel case.", - type: "Identifier", - }, - ], - }, - { - code: "const { no_camelcased = false } = bar;", - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: "Identifier 'no_camelcased' is not in camel case.", - type: "Identifier", - }, - ], - }, - ], -}); diff --git a/eslint/babel-eslint-plugin/test/rules/new-cap.js b/eslint/babel-eslint-plugin/test/rules/new-cap.js index 058ef3d9153f..d5e44984152e 100644 --- a/eslint/babel-eslint-plugin/test/rules/new-cap.js +++ b/eslint/babel-eslint-plugin/test/rules/new-cap.js @@ -1,300 +1,12 @@ -/** - * @fileoverview Tests for new-cap rule. - * @author Nicholas C. Zakas - */ - import rule from "../../src/rules/new-cap"; import RuleTester from "../helpers/RuleTester"; const ruleTester = new RuleTester(); -ruleTester.run("babel/new-cap", rule, { +ruleTester.run("@babel/new-cap", rule, { valid: [ - // Original test cases. - "var x = new Constructor();", - "var x = new a.b.Constructor();", - "var x = new a.b['Constructor']();", - "var x = new a.b[Constructor]();", - "var x = new a.b[constructor]();", - "var x = new function(){};", - "var x = new _;", - "var x = new $;", - "var x = new Σ;", - "var x = new _x;", - "var x = new $x;", - "var x = new this;", - "var x = Array(42)", - "var x = Boolean(42)", - "var x = Date(42)", - "var x = Date.UTC(2000, 0)", - "var x = Error('error')", - "var x = Function('return 0')", - "var x = Number(42)", - "var x = Object(null)", - "var x = RegExp(42)", - "var x = String(42)", - "var x = Symbol('symbol')", - "var x = _();", - "var x = $();", - { code: "var x = Foo(42)", options: [{ capIsNew: false }] }, - { code: "var x = bar.Foo(42)", options: [{ capIsNew: false }] }, - { code: "var x = Foo.bar(42)", options: [{ capIsNew: false }] }, - "var x = bar[Foo](42)", - { code: "var x = bar['Foo'](42)", options: [{ capIsNew: false }] }, - "var x = Foo.bar(42)", - { code: "var x = new foo(42)", options: [{ newIsCap: false }] }, - "var o = { 1: function() {} }; o[1]();", - "var o = { 1: function() {} }; new o[1]();", - { - code: "var x = Foo(42);", - options: [{ capIsNew: true, capIsNewExceptions: ["Foo"] }], - }, - { - code: "var x = Foo(42);", - options: [{ capIsNewExceptionPattern: "^Foo" }], - }, - { - code: "var x = new foo(42);", - options: [{ newIsCap: true, newIsCapExceptions: ["foo"] }], - }, - { - code: "var x = new foo(42);", - options: [{ newIsCapExceptionPattern: "^foo" }], - }, - { code: "var x = Object(42);", options: [{ capIsNewExceptions: ["Foo"] }] }, - - { - code: "var x = Foo.Bar(42);", - options: [{ capIsNewExceptions: ["Bar"] }], - }, - { - code: "var x = Foo.Bar(42);", - options: [{ capIsNewExceptions: ["Foo.Bar"] }], - }, - - { - code: "var x = Foo.Bar(42);", - options: [{ capIsNewExceptionPattern: "^Foo\\.." }], - }, { - code: "var x = new foo.bar(42);", - options: [{ newIsCapExceptions: ["bar"] }], - }, - { - code: "var x = new foo.bar(42);", - options: [{ newIsCapExceptions: ["foo.bar"] }], - }, - - { - code: "var x = new foo.bar(42);", - options: [{ newIsCapExceptionPattern: "^foo\\.." }], - }, - { code: "var x = new foo.bar(42);", options: [{ properties: false }] }, - { code: "var x = Foo.bar(42);", options: [{ properties: false }] }, - { - code: "var x = foo.Bar(42);", - options: [{ capIsNew: false, properties: false }], - }, - - // Babel-specific test cases. - { code: "@MyDecorator(123) class MyClass{}", parser: "babel-eslint" }, - ], - invalid: [ - { - code: "var x = new c();", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - }, - ], - }, - { - code: "var x = new φ;", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - }, - ], - }, - { - code: "var x = new a.b.c;", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - }, - ], - }, - { - code: "var x = new a.b['c'];", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - }, - ], - }, - { - code: "var b = Foo();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - }, - ], - }, - { - code: "var b = a.Foo();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - }, - ], - }, - { - code: "var b = a['Foo']();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - }, - ], - }, - { - code: "var b = a.Date.UTC();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - }, - ], - }, - { - code: "var b = UTC();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - }, - ], - }, - { - code: "var a = B.C();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - line: 1, - column: 11, - }, - ], - }, - { - code: "var a = B\n.C();", - errors: [ - { - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - type: "CallExpression", - line: 2, - column: 2, - }, - ], - }, - { - code: "var a = new B.c();", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 1, - column: 15, - }, - ], - }, - { - code: "var a = new B.\nc();", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 2, - column: 1, - }, - ], - }, - { - code: "var a = new c();", - errors: [ - { - message: - "A constructor name should not start with a lowercase letter.", - type: "NewExpression", - line: 1, - column: 13, - }, - ], - }, - - { - code: "var x = Foo.Bar(42);", - options: [{ capIsNewExceptions: ["Foo"] }], - errors: [ - { - type: "CallExpression", - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - }, - ], - }, - { - code: "var x = Bar.Foo(42);", - - options: [{ capIsNewExceptionPattern: "^Foo\\.." }], - errors: [ - { - type: "CallExpression", - message: - "A function with a name starting with an uppercase letter should only be used as a constructor.", - }, - ], - }, - { - code: "var x = new foo.bar(42);", - options: [{ newIsCapExceptions: ["foo"] }], - errors: [ - { - type: "NewExpression", - message: - "A constructor name should not start with a lowercase letter.", - }, - ], - }, - { - code: "var x = new bar.foo(42);", - - options: [{ newIsCapExceptionPattern: "^foo\\.." }], - errors: [ - { - type: "NewExpression", - message: - "A constructor name should not start with a lowercase letter.", - }, - ], + code: "@MyDecorator(123) class MyClass{}", }, ], + invalid: [], }); diff --git a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js index eeca380d389e..0f8b12a5159b 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js +++ b/eslint/babel-eslint-plugin/test/rules/no-invalid-this.js @@ -1,20 +1,7 @@ -/** - * @fileoverview Tests for no-invalid-this rule. - * @author Toru Nagashima - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - import cloneDeep from "lodash.clonedeep"; import rule from "../../src/rules/no-invalid-this"; import RuleTester from "../helpers/RuleTester"; -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - /** * A constant value for non strict mode environment. * @returns {void} @@ -96,558 +83,7 @@ const errors = [ ]; const patterns = [ - // Global. - { - code: "console.log(this); z(x => console.log(x, this));", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: "console.log(this); z(x => console.log(x, this));", - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { globalReturn: true }, - }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // IIFE. - { - code: - "(function() { console.log(this); z(x => console.log(x, this)); })();", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // Just functions. - { - code: "function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - 'function foo() { "use strict"; console.log(this); z(x => console.log(x, this)); }', - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "return function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { - ecmaVersion: 6, - ecmaFeatures: { globalReturn: true }, - }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT], // modules cannot return on global. - }, - { - code: - "var foo = (function() { console.log(this); z(x => console.log(x, this)); }).bar(obj);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // Functions in methods. - { - code: - "var obj = {foo: function() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "var obj = {foo() { function foo() { console.log(this); z(x => console.log(x, this)); } foo(); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "var obj = {foo: function() { return function() { console.log(this); z(x => console.log(x, this)); }; }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - 'var obj = {foo: function() { "use strict"; return function() { console.log(this); z(x => console.log(x, this)); }; }};', - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "obj.foo = function() { return function() { console.log(this); z(x => console.log(x, this)); }; };", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - 'obj.foo = function() { "use strict"; return function() { console.log(this); z(x => console.log(x, this)); }; };', - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "class A { foo() { return function() { console.log(this); z(x => console.log(x, this)); }; } }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [], - invalid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // Class Static methods. - { - code: - "class A {static foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // Constructors. - { - code: "function Foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var Foo = function Foo() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "class A {constructor() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // On a property. - { - code: - "var obj = {foo: function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var obj = {foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var obj = {foo: foo || function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var obj = {foo: hasNative ? foo : function() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var obj = {foo: (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })()};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - 'Object.defineProperty(obj, "foo", {value: function() { console.log(this); z(x => console.log(x, this)); }})', - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "Object.defineProperties(obj, {foo: {value: function() { console.log(this); z(x => console.log(x, this)); }}})", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // Assigns to a property. - { - code: - "obj.foo = function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "obj.foo = foo || function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "obj.foo = foo ? bar : function() { console.log(this); z(x => console.log(x, this)); };", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "obj.foo = (function() { return function() { console.log(this); z(x => console.log(x, this)); }; })();", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // Class Instance Methods. - { - code: - "class A {foo() { console.log(this); z(x => console.log(x, this)); }};", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // Bind/Call/Apply - { - code: - "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var foo = function() { console.log(this); z(x => console.log(x, this)); }.bind(null);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "(function() { console.log(this); z(x => console.log(x, this)); }).call(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "(function() { console.log(this); z(x => console.log(x, this)); }).call(undefined);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "(function() { console.log(this); z(x => console.log(x, this)); }).apply(obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "(function() { console.log(this); z(x => console.log(x, this)); }).apply(void 0);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "Reflect.apply(function() { console.log(this); z(x => console.log(x, this)); }, obj, []);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // Array methods. - { - code: - "Array.from([], function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.every(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.filter(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.find(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.map(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo.some(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "Array.from([], function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.every(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.filter(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.find(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.findIndex(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.map(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.some(function() { console.log(this); z(x => console.log(x, this)); }, obj);", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "foo.forEach(function() { console.log(this); z(x => console.log(x, this)); }, null);", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // @this tag. - { - code: - "/** @this Obj */ function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "/**\n * @returns {void}\n * @this Obj\n */\nfunction foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "/** @returns {void} */ function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "/** @this Obj */ foo(function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "foo(/* @this Obj */ function() { console.log(this); z(x => console.log(x, this)); });", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // https://github.com/eslint/eslint/issues/3254 - { - code: "function foo() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // https://github.com/eslint/eslint/issues/3287 - { - code: - "function foo() { /** @this Obj*/ return function bar() { console.log(this); z(x => console.log(x, this)); }; }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - - // https://github.com/eslint/eslint/issues/6824 - { - code: - "var Ctor = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "var func = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "Ctor = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "func = function() { console.log(this); z(x => console.log(x, this)); }", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "function foo(Ctor = function() { console.log(this); z(x => console.log(x, this)); }) {}", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "function foo(func = function() { console.log(this); z(x => console.log(x, this)); }) {}", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - { - code: - "[obj.method = function() { console.log(this); z(x => console.log(x, this)); }] = a", - parserOptions: { ecmaVersion: 6 }, - valid: [NORMAL, USE_STRICT, IMPLIED_STRICT, MODULES], - invalid: [], - }, - { - code: - "[func = function() { console.log(this); z(x => console.log(x, this)); }] = a", - parserOptions: { ecmaVersion: 6 }, - errors, - valid: [NORMAL], - invalid: [USE_STRICT, IMPLIED_STRICT, MODULES], - }, - - // babel/no-invalid-this - - // Class Instance Properties. + // Class private fields { code: "class A {a = this.b;};", parserOptions: { ecmaVersion: 6 }, @@ -662,7 +98,7 @@ const patterns = [ invalid: [], }, - // Class Private Instance Properties. + // Class Private methods { code: "class A {#a = this.b;};", parserOptions: { ecmaVersion: 6 }, @@ -679,8 +115,7 @@ const patterns = [ ]; const ruleTester = new RuleTester(); - -ruleTester.run("no-invalid-this", rule, { +ruleTester.run("@babel/no-invalid-this", rule, { valid: extractPatterns(patterns, "valid"), invalid: extractPatterns(patterns, "invalid"), }); diff --git a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js index 1bb327883bfc..991bf6fa80b4 100644 --- a/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js +++ b/eslint/babel-eslint-plugin/test/rules/no-unused-expressions.js @@ -1,83 +1,9 @@ -/** - * @fileoverview Tests for no-unused-expressions rule. - * @author Michael Ficarra - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - import rule from "../../src/rules/no-unused-expressions"; import RuleTester from "../helpers/RuleTester"; -//------------------------------------------------------------------------------ -// Tests -//------------------------------------------------------------------------------ - const ruleTester = new RuleTester(); - -ruleTester.run("no-unused-expressions", rule, { +ruleTester.run("@babel/no-unused-expressions", rule, { valid: [ - // Original test cases. - "function f(){}", - "a = b", - "new a", - "{}", - "f(); g()", - "i++", - "a()", - { code: "a && a()", options: [{ allowShortCircuit: true }] }, - { code: "a() || (b = c)", options: [{ allowShortCircuit: true }] }, - { code: "a ? b() : c()", options: [{ allowTernary: true }] }, - { - code: "a ? b() || (c = d) : e()", - options: [{ allowShortCircuit: true, allowTernary: true }], - }, - "delete foo.bar", - "void new C", - '"use strict";', - '"directive one"; "directive two"; f();', - 'function foo() {"use strict"; return true; }', - { - code: 'var foo = () => {"use strict"; return true; }', - parserOptions: { ecmaVersion: 6 }, - }, - 'function foo() {"directive one"; "directive two"; f(); }', - 'function foo() { var foo = "use strict"; return true; }', - { - code: "function* foo(){ yield 0; }", - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "async function foo() { await 5; }", - parserOptions: { ecmaVersion: 8 }, - }, - { - code: "async function foo() { await foo.bar; }", - parserOptions: { ecmaVersion: 8 }, - }, - { - code: "async function foo() { bar && await baz; }", - options: [{ allowShortCircuit: true }], - parserOptions: { ecmaVersion: 8 }, - }, - { - code: "async function foo() { foo ? await bar : await baz; }", - options: [{ allowTernary: true }], - parserOptions: { ecmaVersion: 8 }, - }, - { - code: "tag`tagged template literal`", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 }, - }, - { - code: "shouldNotBeAffectedByAllowTemplateTagsOption()", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 }, - }, - - // Babel-specific test cases. "let a = do { if (foo) { foo.bar; } }", "let a = do { foo; }", "let a = do { let b = 2; foo; }", @@ -87,283 +13,6 @@ ruleTester.run("no-unused-expressions", rule, { "foo.bar?.();", ], invalid: [ - { - code: "0", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "f(), 0", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "{0}", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "[]", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a && b();", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a() || false", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a || (b = c)", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a ? b() || (c = d) : e", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "`untagged template literal`", - parserOptions: { ecmaVersion: 6 }, - errors: [ - "Expected an assignment or function call and instead saw an expression.", - ], - }, - { - code: "tag`tagged template literal`", - parserOptions: { ecmaVersion: 6 }, - errors: [ - "Expected an assignment or function call and instead saw an expression.", - ], - }, - { - code: "a && b()", - options: [{ allowTernary: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a ? b() : c()", - options: [{ allowShortCircuit: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a || b", - options: [{ allowShortCircuit: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a() && b", - options: [{ allowShortCircuit: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a ? b : 0", - options: [{ allowTernary: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "a ? b : c()", - options: [{ allowTernary: true }], - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "foo.bar;", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "!a", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "+a", - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: '"directive one"; f(); "directive two";', - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: 'function foo() {"directive one"; f(); "directive two"; }', - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: 'if (0) { "not a directive"; f(); }', - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: 'function foo() { var foo = true; "use strict"; }', - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: 'var foo = () => { var foo = true; "use strict"; }', - parserOptions: { ecmaVersion: 6 }, - errors: [ - { - message: - "Expected an assignment or function call and instead saw an expression.", - type: "ExpressionStatement", - }, - ], - }, - { - code: "`untagged template literal`", - options: [{ allowTaggedTemplates: true }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - "Expected an assignment or function call and instead saw an expression.", - ], - }, - { - code: "`untagged template literal`", - options: [{ allowTaggedTemplates: false }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - "Expected an assignment or function call and instead saw an expression.", - ], - }, - { - code: "tag`tagged template literal`", - options: [{ allowTaggedTemplates: false }], - parserOptions: { ecmaVersion: 6 }, - errors: [ - "Expected an assignment or function call and instead saw an expression.", - ], - }, - - // Babel-specific test cases. { code: "let a = do { foo; let b = 2; }", errors: [ diff --git a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js index dfe03196f208..8a08a09516c7 100644 --- a/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js +++ b/eslint/babel-eslint-plugin/test/rules/object-curly-spacing.js @@ -1,1138 +1,13 @@ -/** - * @fileoverview Disallows or enforces spaces inside of object literals. - * @author Jamund Ferguson - * @copyright 2014 Vignesh Anand. All rights reserved. - * @copyright 2015 Jamund Ferguson. All rights reserved. - * @copyright 2015 Mathieu M-Gosselin. All rights reserved. - */ - import rule from "../../src/rules/object-curly-spacing"; import RuleTester from "../helpers/RuleTester"; const ruleTester = new RuleTester(); -ruleTester.run("babel/object-curly-spacing", rule, { +ruleTester.run("@babel/object-curly-spacing", rule, { valid: [ - // always - object literals - { code: "var obj = { foo: bar, baz: qux };", options: ["always"] }, - { - code: "var obj = { foo: { bar: quxx }, baz: qux };", - options: ["always"], - }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["always"] }, - - // always - destructuring - { - code: "var { x } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { x, y } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { x,y } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\nx,y } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\nx,y\n} = z", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { x = 10, y } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { x: { z }, y } = y", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\ny,\n} = x", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { y, } = x", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var { y: x } = x", - options: ["always"], - ecmaFeatures: { destructuring: true }, - }, - - // always - import / export - { - code: "import door from 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import * as door from 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import { door } from 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\ndoor } from 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export { door } from 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import { house, mouse } from 'caravan'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nhouse,\nmouse\n} from 'caravan'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nhouse,\nmouse,\n} from 'caravan'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import house, { mouse } from 'caravan'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import door, { house, mouse } from 'caravan'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export { door }", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\ndoor,\nhouse\n}", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\ndoor,\nhouse,\n}", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import 'room'", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import { bar as x } from 'foo';", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import { x, } from 'foo';", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nx,\n} from 'foo';", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export { x, } from 'foo';", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\nx,\n} from 'foo';", - options: ["always"], - ecmaFeatures: { modules: true }, - }, - - // always - empty object - { code: "var foo = {};", options: ["always"] }, - - // always - objectsInObjects - { - code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", - options: ["always", { objectsInObjects: false }], - }, - - // always - arraysInObjects - { - code: "var obj = { 'foo': [ 1, 2 ]};", - options: ["always", { arraysInObjects: false }], - }, - - // always - arraysInObjects, objectsInObjects - { - code: "var obj = { 'qux': [ 1, 2 ], 'foo': { 'bar': 1, 'baz': 2 }};", - options: ["always", { arraysInObjects: false, objectsInObjects: false }], - }, - - // always - arraysInObjects, objectsInObjects (reverse) - { - code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }, 'qux': [ 1, 2 ]};", - options: ["always", { arraysInObjects: false, objectsInObjects: false }], - }, - - // never - { code: "var obj = {foo: bar,\nbaz: qux\n};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux};", options: ["never"] }, - - // never - object literals - { code: "var obj = {foo: bar, baz: qux};", options: ["never"] }, - { code: "var obj = {foo: {bar: quxx}, baz: qux};", options: ["never"] }, - { code: "var obj = {foo: {\nbar: quxx}, baz: qux\n};", options: ["never"] }, - { code: "var obj = {foo: {\nbar: quxx\n}, baz: qux};", options: ["never"] }, - { code: "var obj = {\nfoo: bar,\nbaz: qux\n};", options: ["never"] }, - - // never - destructuring - { - code: "var {x} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {x, y} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {x,y} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\nx,y\n} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {x = 10} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {x = 10, y} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {x: {z}, y} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\nx: {z\n}, y} = y", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {\ny,\n} = x", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {y,} = x", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {y:x} = x", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - - // never - import / export - { - code: "import door from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import * as door from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {door} from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {door} from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\ndoor} from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\ndoor\n} from 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {house,mouse} from 'caravan'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {house, mouse} from 'caravan'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nhouse,\nmouse} from 'caravan'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nhouse,\nmouse,\n} from 'caravan'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {door}", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\ndoor,\nmouse\n}", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\ndoor,\nmouse,\n}", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import 'room'", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import x, {bar} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import x, {bar, baz} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {bar as y} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {x,} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "import {\nx,\n} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {x,} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {\nx,\n} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - - // never - empty object - { code: "var foo = {};", options: ["never"] }, - - // never - objectsInObjects - { - code: "var obj = {'foo': {'bar': 1, 'baz': 2} };", - options: ["never", { objectsInObjects: true }], - }, - - // https://github.com/eslint/eslint/issues/3658 - // Empty cases. - { code: "var {} = foo;", ecmaFeatures: { destructuring: true } }, - { code: "var [] = foo;", ecmaFeatures: { destructuring: true } }, - { code: "var {a: {}} = foo;", ecmaFeatures: { destructuring: true } }, - { code: "var {a: []} = foo;", ecmaFeatures: { destructuring: true } }, - { code: "import {} from 'foo';", ecmaFeatures: { modules: true } }, - { code: "export {} from 'foo';", ecmaFeatures: { modules: true } }, - { code: "export {};", ecmaFeatures: { modules: true } }, - { - code: "var {} = foo;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var [] = foo;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {a: {}} = foo;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "var {a: []} = foo;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - }, - { - code: "import {} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { - code: "export {} from 'foo';", - options: ["never"], - ecmaFeatures: { modules: true }, - }, - { code: "export {};", options: ["never"], ecmaFeatures: { modules: true } }, - - // Babel test cases. - { - code: 'export * as x from "mod";', - parser: "babel-eslint", - ecmaFeatures: { modules: true }, - }, { code: 'export x from "mod";', - parser: "babel-eslint", - ecmaFeatures: { modules: true }, - }, - - // always - destructuring typed object param - { - code: "function fn({ a,b }:Object){}", - options: ["always"], - parser: "babel-eslint", - ecmaFeatures: { destructuring: true }, - }, - - // never - destructuring typed object param - { - code: "function fn({a,b}: Object){}", - options: ["never"], - parser: "babel-eslint", - ecmaFeatures: { destructuring: true }, }, ], - invalid: [ - { - code: "import {bar} from 'foo.js';", - output: "import { bar } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8, - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 12, - }, - ], - }, - { - code: "import { bar as y} from 'foo.js';", - output: "import { bar as y } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 18, - }, - ], - }, - { - code: "import {bar as y} from 'foo.js';", - output: "import { bar as y } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8, - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 17, - }, - ], - }, - { - code: "import { bar} from 'foo.js';", - output: "import { bar } from 'foo.js';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 13, - }, - ], - }, - { - code: "import x, { bar} from 'foo';", - output: "import x, { bar } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 16, - }, - ], - }, - { - code: "import x, { bar, baz} from 'foo';", - output: "import x, { bar, baz } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 21, - }, - ], - }, - { - code: "import x, {bar} from 'foo';", - output: "import x, { bar } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 11, - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 15, - }, - ], - }, - { - code: "import x, {bar, baz} from 'foo';", - output: "import x, { bar, baz } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 11, - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 20, - }, - ], - }, - { - code: "import {bar,} from 'foo';", - output: "import { bar, } from 'foo';", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8, - }, - { - message: "A space is required before '}'.", - type: "ImportDeclaration", - line: 1, - column: 13, - }, - ], - }, - { - code: "import { bar, } from 'foo';", - output: "import {bar,} from 'foo';", - options: ["never"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ImportDeclaration", - line: 1, - column: 8, - }, - { - message: "There should be no space before '}'.", - type: "ImportDeclaration", - line: 1, - column: 15, - }, - ], - }, - { - code: "export {bar};", - output: "export { bar };", - options: ["always"], - ecmaFeatures: { - modules: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ExportNamedDeclaration", - line: 1, - column: 8, - }, - { - message: "A space is required before '}'.", - type: "ExportNamedDeclaration", - line: 1, - column: 12, - }, - ], - }, - - // always - arraysInObjects - { - code: "var obj = { 'foo': [ 1, 2 ] };", - output: "var obj = { 'foo': [ 1, 2 ]};", - options: ["always", { arraysInObjects: false }], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - }, - ], - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ] };", - output: "var obj = { 'foo': [ 1, 2 ] , 'bar': [ 'baz', 'qux' ]};", - options: ["always", { arraysInObjects: false }], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - }, - ], - }, - - // always-objectsInObjects - { - code: "var obj = { 'foo': { 'bar': 1, 'baz': 2 } };", - output: "var obj = { 'foo': { 'bar': 1, 'baz': 2 }};", - options: ["always", { objectsInObjects: false }], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 43, - }, - ], - }, - { - code: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 } };", - output: "var obj = { 'foo': [ 1, 2 ] , 'bar': { 'baz': 1, 'qux': 2 }};", - options: ["always", { objectsInObjects: false }], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 61, - }, - ], - }, - - // always-destructuring trailing comma - { - code: "var { a,} = x;", - output: "var { a, } = x;", - options: ["always"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 9, - }, - ], - }, - { - code: "var {a, } = x;", - output: "var {a,} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 9, - }, - ], - }, - { - code: "var {a:b } = x;", - output: "var {a:b} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 10, - }, - ], - }, - { - code: "var { a:b } = x;", - output: "var {a:b} = x;", - options: ["never"], - ecmaFeatures: { destructuring: true }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 5, - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 11, - }, - ], - }, - - // never-objectsInObjects - { - code: "var obj = {'foo': {'bar': 1, 'baz': 2}};", - output: "var obj = {'foo': {'bar': 1, 'baz': 2} };", - options: ["never", { objectsInObjects: true }], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 39, - }, - ], - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2}};", - output: "var obj = {'foo': [1, 2] , 'bar': {'baz': 1, 'qux': 2} };", - options: ["never", { objectsInObjects: true }], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 55, - }, - ], - }, - - // always & never - { - code: "var obj = {foo: bar, baz: qux};", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 11, - }, - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 30, - }, - ], - }, - { - code: "var obj = {foo: bar, baz: qux };", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 11, - }, - ], - }, - { - code: "var obj = { foo: bar, baz: qux};", - output: "var obj = { foo: bar, baz: qux };", - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - line: 1, - column: 31, - }, - ], - }, - { - code: "var obj = { foo: bar, baz: qux };", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11, - }, - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 32, - }, - ], - }, - { - code: "var obj = {foo: bar, baz: qux };", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 31, - }, - ], - }, - { - code: "var obj = { foo: bar, baz: qux};", - output: "var obj = {foo: bar, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11, - }, - ], - }, - { - code: "var obj = { foo: { bar: quxx}, baz: qux};", - output: "var obj = {foo: {bar: quxx}, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 11, - }, - { - message: "There should be no space after '{'.", - type: "ObjectExpression", - line: 1, - column: 18, - }, - ], - }, - { - code: "var obj = {foo: {bar: quxx }, baz: qux };", - output: "var obj = {foo: {bar: quxx}, baz: qux};", - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 28, - }, - { - message: "There should be no space before '}'.", - type: "ObjectExpression", - line: 1, - column: 40, - }, - ], - }, - { - code: "export const thing = {value: 1 };", - output: "export const thing = { value: 1 };", - ecmaFeatures: { - modules: true, - blockBindings: true, - }, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectExpression", - line: 1, - column: 22, - }, - ], - }, - - // destructuring - { - code: "var {x, y} = y", - output: "var { x, y } = y", - ecmaFeatures: { destructuring: true }, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 5, - }, - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 10, - }, - ], - }, - { - code: "var { x, y} = y", - output: "var { x, y } = y", - ecmaFeatures: { destructuring: true }, - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 11, - }, - ], - }, - { - code: "var { x, y } = y", - output: "var {x, y} = y", - ecmaFeatures: { destructuring: true }, - options: ["never"], - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 5, - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 12, - }, - ], - }, - { - code: "var {x, y } = y", - output: "var {x, y} = y", - ecmaFeatures: { destructuring: true }, - options: ["never"], - errors: [ - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 11, - }, - ], - }, - { - code: "var { x=10} = y", - output: "var { x=10 } = y", - ecmaFeatures: { destructuring: true }, - options: ["always"], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 11, - }, - ], - }, - { - code: "var {x=10 } = y", - output: "var { x=10 } = y", - ecmaFeatures: { destructuring: true }, - options: ["always"], - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 5, - }, - ], - }, - - // never - arraysInObjects - { - code: "var obj = {'foo': [1, 2]};", - output: "var obj = {'foo': [1, 2] };", - options: ["never", { arraysInObjects: true }], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - }, - ], - }, - { - code: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux']};", - output: "var obj = {'foo': [1, 2] , 'bar': ['baz', 'qux'] };", - options: ["never", { arraysInObjects: true }], - errors: [ - { - message: "A space is required before '}'.", - type: "ObjectExpression", - }, - ], - }, - - // Babel test cases. - - // always - destructuring typed object param - { - code: "function fn({a,b}: Object){}", - output: "function fn({ a,b }: Object){}", - options: ["always"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true, - }, - errors: [ - { - message: "A space is required after '{'.", - type: "ObjectPattern", - line: 1, - column: 13, - }, - { - message: "A space is required before '}'.", - type: "ObjectPattern", - line: 1, - column: 17, - }, - ], - }, - - // never - destructuring typed object param - { - code: "function fn({ a,b }: Object){}", - output: "function fn({a,b}: Object){}", - options: ["never"], - parser: "babel-eslint", - ecmaFeatures: { - destructuring: true, - }, - errors: [ - { - message: "There should be no space after '{'.", - type: "ObjectPattern", - line: 1, - column: 13, - }, - { - message: "There should be no space before '}'.", - type: "ObjectPattern", - line: 1, - column: 19, - }, - ], - }, - ], + invalid: [], }); diff --git a/eslint/babel-eslint-plugin/test/rules/semi.js b/eslint/babel-eslint-plugin/test/rules/semi.js index c5b8a8fc4a09..d7a757b62616 100644 --- a/eslint/babel-eslint-plugin/test/rules/semi.js +++ b/eslint/babel-eslint-plugin/test/rules/semi.js @@ -1,13 +1,3 @@ -/* eslnit-disable */ -/** - * @fileoverview Tests for semi rule. - * @author Nicholas C. Zakas - */ - -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - import rule from "../../src/rules/semi"; import RuleTester from "../helpers/RuleTester"; @@ -15,650 +5,19 @@ const ruleTester = new RuleTester(); ruleTester.run("semi", rule, { valid: [ - "var x = 5;", - "var x =5, y;", - "foo();", - "x = foo();", - 'setTimeout(function() {foo = "bar"; });', - 'setTimeout(function() {foo = "bar";});', - "for (var a in b){}", - "for (var i;;){}", - "if (true) {}\n;[global, extended].forEach(function(){});", - "throw new Error('foo');", - { code: "throw new Error('foo')", options: ["never"] }, - { code: "var x = 5", options: ["never"] }, - { code: "var x =5, y", options: ["never"] }, - { code: "foo()", options: ["never"] }, - { code: "debugger", options: ["never"] }, - { code: "for (var a in b){}", options: ["never"] }, - { code: "for (var i;;){}", options: ["never"] }, - { code: "x = foo()", options: ["never"] }, - { - code: "if (true) {}\n;[global, extended].forEach(function(){})", - options: ["never"], - }, - { code: "(function bar() {})\n;(function foo(){})", options: ["never"] }, - { code: ";/foo/.test('bar')", options: ["never"] }, - { code: ";+5", options: ["never"] }, - { code: ";-foo()", options: ["never"] }, - { code: "a++\nb++", options: ["never"] }, - { code: "a++; b++", options: ["never"] }, - { - code: "for (let thing of {}) {\n console.log(thing);\n}", - parserOptions: { ecmaVersion: 6 }, - }, - { code: "do{}while(true)", options: ["never"] }, - { code: "do{}while(true);", options: ["always"] }, - - { - code: "if (foo) { bar() }", - options: ["always", { omitLastInOneLineBlock: true }], - }, - { - code: "if (foo) { bar(); baz() }", - options: ["always", { omitLastInOneLineBlock: true }], - }, - - // method definitions don't have a semicolon. - { code: "class A { a() {} b() {} }", parserOptions: { ecmaVersion: 6 } }, - { - code: "var A = class { a() {} b() {} };", - parserOptions: { ecmaVersion: 6 }, - }, - - { - code: "import theDefault, { named1, named2 } from 'src/mylib';", - parserOptions: { sourceType: "module" }, - }, - { - code: "import theDefault, { named1, named2 } from 'src/mylib'", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - - // exports, "always" - { code: "export * from 'foo';", parserOptions: { sourceType: "module" } }, - { - code: "export { foo } from 'foo';", - parserOptions: { sourceType: "module" }, - }, - { code: "export { foo };", parserOptions: { sourceType: "module" } }, - { code: "export var foo;", parserOptions: { sourceType: "module" } }, - { - code: "export function foo () { }", - parserOptions: { sourceType: "module" }, - }, - { - code: "export function* foo () { }", - parserOptions: { sourceType: "module" }, - }, - { code: "export class Foo { }", parserOptions: { sourceType: "module" } }, - { code: "export let foo;", parserOptions: { sourceType: "module" } }, - { code: "export const FOO = 42;", parserOptions: { sourceType: "module" } }, - { - code: "export default function() { }", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default function* () { }", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default class { }", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo || bar;", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default (foo) => foo.bar();", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo = 42;", - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo += 42;", - parserOptions: { sourceType: "module" }, - }, - - // exports, "never" - { - code: "export * from 'foo'", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export { foo } from 'foo'", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export { foo }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export var foo", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export function foo () { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export function* foo () { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export class Foo { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export let foo", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export const FOO = 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default function() { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default function* () { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default class { }", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo || bar", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default (foo) => foo.bar()", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo = 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { - code: "export default foo += 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - }, - { code: "++\nfoo;", options: ["always"] }, - { code: "var a = b;\n+ c", options: ["never"] }, - - // https://github.com/eslint/eslint/issues/7782 - { code: "var a = b;\n/foo/.test(c)", options: ["never"] }, - { - code: "var a = b;\n`foo`", - options: ["never"], - parserOptions: { ecmaVersion: 6 }, - }, - - // babel "class Foo { bar = 'example'; }", "class Foo { static bar = 'example'; }", - { - code: - "async function foo() { for await (let thing of {}) { console.log(thing); } }", - parserOptions: { ecmaVersion: 6 }, - }, { code: "class Foo { bar = () => {}; }", options: ["always", { omitLastInOneLineBlock: true }], }, - // babel, "never" + // never { code: "class Foo { bar = 'example' }", options: ["never"] }, { code: "class Foo { static bar = 'example' }", options: ["never"] }, { code: "class Foo { bar = () => {} }", options: ["never"] }, ], invalid: [ - { - code: "import * as utils from './utils'", - output: "import * as utils from './utils';", - parserOptions: { sourceType: "module" }, - errors: [ - { - message: "Missing semicolon.", - type: "ImportDeclaration", - column: 33, - }, - ], - }, - { - code: "import { square, diag } from 'lib'", - output: "import { square, diag } from 'lib';", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], - }, - { - code: "import { default as foo } from 'lib'", - output: "import { default as foo } from 'lib';", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], - }, - { - code: "import 'src/mylib'", - output: "import 'src/mylib';", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], - }, - { - code: "import theDefault, { named1, named2 } from 'src/mylib'", - output: "import theDefault, { named1, named2 } from 'src/mylib';", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "ImportDeclaration" }], - }, - { - code: "function foo() { return [] }", - output: "function foo() { return []; }", - errors: [{ message: "Missing semicolon.", type: "ReturnStatement" }], - }, - { - code: "while(true) { break }", - output: "while(true) { break; }", - errors: [{ message: "Missing semicolon.", type: "BreakStatement" }], - }, - { - code: "while(true) { continue }", - output: "while(true) { continue; }", - errors: [{ message: "Missing semicolon.", type: "ContinueStatement" }], - }, - { - code: "let x = 5", - output: "let x = 5;", - parserOptions: { ecmaVersion: 6 }, - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var x = 5", - output: "var x = 5;", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var x = 5, y", - output: "var x = 5, y;", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "debugger", - output: "debugger;", - errors: [{ message: "Missing semicolon.", type: "DebuggerStatement" }], - }, - { - code: "foo()", - output: "foo();", - errors: [{ message: "Missing semicolon.", type: "ExpressionStatement" }], - }, - { - code: "var x = 5, y", - output: "var x = 5, y;", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (var a in b) var i ", - output: "for (var a in b) var i; ", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (;;){var i}", - output: "for (;;){var i;}", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (;;) var i ", - output: "for (;;) var i; ", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (var j;;) {var i}", - output: "for (var j;;) {var i;}", - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var foo = {\n bar: baz\n}", - output: "var foo = {\n bar: baz\n};", - errors: [ - { message: "Missing semicolon.", type: "VariableDeclaration", line: 3 }, - ], - }, - { - code: "var foo\nvar bar;", - output: "var foo;\nvar bar;", - errors: [ - { message: "Missing semicolon.", type: "VariableDeclaration", line: 1 }, - ], - }, - { - code: "throw new Error('foo')", - output: "throw new Error('foo');", - errors: [ - { message: "Missing semicolon.", type: "ThrowStatement", line: 1 }, - ], - }, - { - code: "do{}while(true)", - output: "do{}while(true);", - errors: [ - { message: "Missing semicolon.", type: "DoWhileStatement", line: 1 }, - ], - }, - - { - code: "throw new Error('foo');", - output: "throw new Error('foo')", - options: ["never"], - errors: [ - { message: "Extra semicolon.", type: "ThrowStatement", column: 23 }, - ], - }, - { - code: "function foo() { return []; }", - output: "function foo() { return [] }", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "ReturnStatement" }], - }, - { - code: "while(true) { break; }", - output: "while(true) { break }", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "BreakStatement" }], - }, - { - code: "while(true) { continue; }", - output: "while(true) { continue }", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "ContinueStatement" }], - }, - { - code: "let x = 5;", - output: "let x = 5", - parserOptions: { ecmaVersion: 6 }, - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var x = 5;", - output: "var x = 5", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var x = 5, y;", - output: "var x = 5, y", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "debugger;", - output: "debugger", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "DebuggerStatement" }], - }, - { - code: "foo();", - output: "foo()", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "ExpressionStatement" }], - }, - { - code: "var x = 5, y;", - output: "var x = 5, y", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (var a in b) var i; ", - output: "for (var a in b) var i ", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (;;){var i;}", - output: "for (;;){var i}", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (;;) var i; ", - output: "for (;;) var i ", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "for (var j;;) {var i;}", - output: "for (var j;;) {var i}", - options: ["never"], - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "var foo = {\n bar: baz\n};", - output: "var foo = {\n bar: baz\n}", - options: ["never"], - errors: [ - { message: "Extra semicolon.", type: "VariableDeclaration", line: 3 }, - ], - }, - { - code: "import theDefault, { named1, named2 } from 'src/mylib';", - output: "import theDefault, { named1, named2 } from 'src/mylib'", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "ImportDeclaration" }], - }, - { - code: "do{}while(true);", - output: "do{}while(true)", - options: ["never"], - errors: [ - { message: "Extra semicolon.", type: "DoWhileStatement", line: 1 }, - ], - }, - - { - code: "if (foo) { bar()\n }", - options: ["always", { omitLastInOneLineBlock: true }], - errors: [{ message: "Missing semicolon." }], - }, - { - code: "if (foo) {\n bar() }", - options: ["always", { omitLastInOneLineBlock: true }], - errors: [{ message: "Missing semicolon." }], - }, - { - code: "if (foo) {\n bar(); baz() }", - options: ["always", { omitLastInOneLineBlock: true }], - errors: [{ message: "Missing semicolon." }], - }, - { - code: "if (foo) { bar(); }", - options: ["always", { omitLastInOneLineBlock: true }], - errors: [{ message: "Extra semicolon." }], - }, - - // exports, "always" - { - code: "export * from 'foo'", - output: "export * from 'foo';", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "ExportAllDeclaration" }], - }, - { - code: "export { foo } from 'foo'", - output: "export { foo } from 'foo';", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportNamedDeclaration" }, - ], - }, - { - code: "export { foo }", - output: "export { foo };", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportNamedDeclaration" }, - ], - }, - { - code: "export var foo", - output: "export var foo;", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export let foo", - output: "export let foo;", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export const FOO = 42", - output: "export const FOO = 42;", - parserOptions: { sourceType: "module" }, - errors: [{ message: "Missing semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export default foo || bar", - output: "export default foo || bar;", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default (foo) => foo.bar()", - output: "export default (foo) => foo.bar();", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default foo = 42", - output: "export default foo = 42;", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default foo += 42", - output: "export default foo += 42;", - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Missing semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - - // exports, "never" - { - code: "export * from 'foo';", - output: "export * from 'foo'", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "ExportAllDeclaration" }], - }, - { - code: "export { foo } from 'foo';", - output: "export { foo } from 'foo'", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }], - }, - { - code: "export { foo };", - output: "export { foo }", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "ExportNamedDeclaration" }], - }, - { - code: "export var foo;", - output: "export var foo", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export let foo;", - output: "export let foo", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export const FOO = 42;", - output: "export const FOO = 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [{ message: "Extra semicolon.", type: "VariableDeclaration" }], - }, - { - code: "export default foo || bar;", - output: "export default foo || bar", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default (foo) => foo.bar();", - output: "export default (foo) => foo.bar()", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default foo = 42;", - output: "export default foo = 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "export default foo += 42;", - output: "export default foo += 42", - options: ["never"], - parserOptions: { sourceType: "module" }, - errors: [ - { message: "Extra semicolon.", type: "ExportDefaultDeclaration" }, - ], - }, - { - code: "a;\n++b", - output: "a\n++b", - options: ["never"], - errors: [{ message: "Extra semicolon." }], - }, - - // babel { code: "class Foo { bar = 'example' }", errors: [{ message: "Missing semicolon." }], @@ -673,7 +32,7 @@ ruleTester.run("semi", rule, { errors: [{ message: "Missing semicolon." }], }, - // babel, "never" + // "never" { code: "class Foo { bar = 'example'; }", options: ["never"], diff --git a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js b/eslint/babel-eslint-shared-fixtures/config/babel.config.decorators-legacy.js similarity index 100% rename from eslint/babel-eslint-parser/test/fixtures/config/babel.config.decorators-legacy.js rename to eslint/babel-eslint-shared-fixtures/config/babel.config.decorators-legacy.js diff --git a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js b/eslint/babel-eslint-shared-fixtures/config/babel.config.js similarity index 94% rename from eslint/babel-eslint-parser/test/fixtures/config/babel.config.js rename to eslint/babel-eslint-shared-fixtures/config/babel.config.js index b84b8d0b3cca..202b888fe7b1 100644 --- a/eslint/babel-eslint-parser/test/fixtures/config/babel.config.js +++ b/eslint/babel-eslint-shared-fixtures/config/babel.config.js @@ -19,5 +19,6 @@ module.exports = { ["@babel/plugin-proposal-pipeline-operator", { proposal: "minimal" }], "@babel/plugin-syntax-bigint", "@babel/plugin-proposal-private-methods", + "@babel/plugin-proposal-do-expressions", ], }; diff --git a/eslint/babel-eslint-shared-fixtures/package.json b/eslint/babel-eslint-shared-fixtures/package.json new file mode 100644 index 000000000000..96bbb96dde67 --- /dev/null +++ b/eslint/babel-eslint-shared-fixtures/package.json @@ -0,0 +1,25 @@ +{ + "name": "@babel/eslint-shared-fixtures", + "version": "0.0.0", + "description": "Shared fixtures for testing @babel/eslint-* packages", + "license": "MIT", + "private": true, + "dependencies": { + "@babel/plugin-proposal-class-properties": "^7.1.0", + "@babel/plugin-proposal-decorators": "^7.1.2", + "@babel/plugin-proposal-do-expressions": "^7.7.4", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0", + "@babel/plugin-proposal-optional-chaining": "^7.0.0", + "@babel/plugin-proposal-pipeline-operator": "^7.0.0", + "@babel/plugin-proposal-private-methods": "^7.7.4", + "@babel/plugin-syntax-bigint": "^7.7.4", + "@babel/plugin-syntax-dynamic-import": "^7.0.0", + "@babel/plugin-syntax-export-default-from": "^7.0.0", + "@babel/plugin-syntax-export-namespace-from": "^7.0.0", + "@babel/plugin-syntax-import-meta": "^7.0.0", + "@babel/plugin-syntax-numeric-separator": "^7.0.0", + "@babel/preset-env": "^7.1.5", + "@babel/preset-flow": "^7.0.0", + "@babel/preset-react": "^7.0.0" + } +} diff --git a/jest.config.js b/jest.config.js index 6145dd3f2f5a..b170ea8f5825 100644 --- a/jest.config.js +++ b/jest.config.js @@ -46,6 +46,7 @@ module.exports = { "/build/", ], moduleNameMapper: { - "^@babel/([a-zA-Z0-9_-]+)$": "/packages/babel-$1/", + "^@babel/(?!eslint-)([a-zA-Z0-9_-]+)$": "/packages/babel-$1/", + "^@babel/eslint-([a-zA-Z0-9_-]+)$": "/eslint/babel-eslint-$1/", }, }; From 2486615a74580283c49475d66067bd7fcab3330e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 12 Jan 2020 01:09:29 +0100 Subject: [PATCH 946/965] v7.8.0 --- lerna.json | 2 +- packages/babel-cli/package.json | 6 +- packages/babel-code-frame/package.json | 4 +- packages/babel-compat-data/package.json | 6 +- packages/babel-core/package.json | 18 +- packages/babel-generator/package.json | 8 +- .../package.json | 4 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 4 +- .../babel-helper-call-delegate/package.json | 8 +- .../package.json | 10 +- .../package.json | 18 +- .../package.json | 8 +- packages/babel-helper-define-map/package.json | 6 +- .../package.json | 6 +- .../babel-helper-explode-class/package.json | 8 +- packages/babel-helper-fixtures/package.json | 2 +- .../babel-helper-function-name/package.json | 8 +- .../package.json | 4 +- .../babel-helper-hoist-variables/package.json | 4 +- .../package.json | 4 +- .../babel-helper-module-imports/package.json | 6 +- .../package.json | 12 +- .../package.json | 4 +- .../package.json | 4 +- .../babel-helper-plugin-utils/package.json | 2 +- packages/babel-helper-regex/package.json | 2 +- .../package.json | 12 +- .../babel-helper-replace-supers/package.json | 10 +- .../babel-helper-simple-access/package.json | 6 +- .../package.json | 4 +- .../package.json | 10 +- .../babel-helper-wrap-function/package.json | 10 +- packages/babel-helpers/package.json | 10 +- packages/babel-highlight/package.json | 2 +- packages/babel-node/package.json | 10 +- packages/babel-parser/package.json | 6 +- .../package.json | 8 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 14 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 6 +- .../babel-plugin-syntax-bigint/package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../babel-plugin-syntax-flow/package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- packages/babel-plugin-syntax-jsx/package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 6 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 20 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 14 +- .../package.json | 14 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 12 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 10 +- .../package.json | 12 +- .../package.json | 6 +- .../package.json | 8 +- .../package.json | 22 +- .../package.json | 8 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 10 +- .../package.json | 8 +- .../package.json | 12 +- .../package.json | 10 +- packages/babel-polyfill/package.json | 2 +- .../babel-preset-env-standalone/package.json | 26 +-- packages/babel-preset-env/package.json | 114 +++++------ packages/babel-preset-flow/package.json | 10 +- packages/babel-preset-react/package.json | 18 +- packages/babel-preset-stage-0/package.json | 2 +- packages/babel-preset-stage-1/package.json | 2 +- packages/babel-preset-stage-2/package.json | 2 +- packages/babel-preset-stage-3/package.json | 2 +- packages/babel-preset-typescript/package.json | 10 +- packages/babel-register/package.json | 6 +- packages/babel-runtime-corejs2/package.json | 4 +- packages/babel-runtime-corejs3/package.json | 2 +- packages/babel-runtime/package.json | 4 +- packages/babel-standalone/package.json | 188 +++++++++--------- packages/babel-template/package.json | 8 +- packages/babel-traverse/package.json | 16 +- packages/babel-types/package.json | 6 +- 152 files changed, 774 insertions(+), 774 deletions(-) diff --git a/lerna.json b/lerna.json index 53ee39160e51..3eddd66bc4c9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.7.7", + "version": "7.8.0", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 90b9991c5385..1f59b9a76bf1 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.7.7", + "version": "7.8.0", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -36,8 +36,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-fixtures": "^7.6.3", + "@babel/core": "^7.8.0", + "@babel/helper-fixtures": "^7.8.0", "rimraf": "^3.0.0" }, "bin": { diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index 6eb8a55443ab..d9bfdbfe7f0d 100644 --- a/packages/babel-code-frame/package.json +++ b/packages/babel-code-frame/package.json @@ -1,6 +1,6 @@ { "name": "@babel/code-frame", - "version": "7.5.5", + "version": "7.8.0", "description": "Generate errors that contain a code frame that point to source locations.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame", "main": "lib/index.js", "dependencies": { - "@babel/highlight": "^7.0.0" + "@babel/highlight": "^7.8.0" }, "devDependencies": { "chalk": "^2.0.0", diff --git a/packages/babel-compat-data/package.json b/packages/babel-compat-data/package.json index 112e1058cfdf..d0e42ee1ea3d 100644 --- a/packages/babel-compat-data/package.json +++ b/packages/babel-compat-data/package.json @@ -1,6 +1,6 @@ { "name": "@babel/compat-data", - "version": "0.0.0", + "version": "7.8.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "", @@ -28,9 +28,9 @@ "semver": "^7.1.1" }, "devDependencies": { + "@babel/helper-compilation-targets": "^7.8.0", "caniuse-db": "1.0.30000969", "electron-to-chromium": "1.3.113", - "lodash": "^4.17.15", - "@babel/helper-compilation-targets": "^0.0.0" + "lodash": "^4.17.15" } } diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index 2b0684495b50..575013120ac8 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.7.7", + "version": "7.8.0", "description": "Babel compiler core.", "main": "lib/index.js", "author": "Sebastian McKenzie ", @@ -40,13 +40,13 @@ "./src/transform-file.js": "./src/transform-file-browser.js" }, "dependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.7", - "@babel/helpers": "^7.7.4", - "@babel/parser": "^7.7.7", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.0", + "@babel/generator": "^7.8.0", + "@babel/helpers": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -57,6 +57,6 @@ "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.7.5" + "@babel/helper-transform-fixture-test-runner": "^7.8.0" } } diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 306fa5d00f9f..cc7802d6d2d9 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.7.7", + "version": "7.8.0", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -15,13 +15,13 @@ "lib" ], "dependencies": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.8.0", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-fixtures": "^7.6.3", - "@babel/parser": "^7.7.7" + "@babel/helper-fixtures": "^7.8.0", + "@babel/parser": "^7.8.0" } } diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index dfde03584b51..745575f9daf3 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-annotate-as-pure", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to annotate paths and nodes with #__PURE__ comment", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-annotate-as-pure", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index ca33fa6488d1..5b3915a0a184 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-bindify-decorators", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to bindify decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators", "license": "MIT", @@ -10,7 +10,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json index 1e27b557d7ad..a0e7b9569509 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to build binary assignment operator visitors", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-binary-assignment-operator-visitor", "license": "MIT", @@ -10,7 +10,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-explode-assignable-expression": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-explode-assignable-expression": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index 67d3c00c4bf2..a16281377e4d 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-builder-react-jsx", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to build react jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx", "license": "MIT", @@ -10,7 +10,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4", + "@babel/types": "^7.8.0", "esutils": "^2.0.0" } } diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index a9137a0131c7..f8899310f8ac 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-call-delegate", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to call delegate", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-hoist-variables": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-compilation-targets/package.json b/packages/babel-helper-compilation-targets/package.json index 251a902a20aa..23dd71f4d7ea 100644 --- a/packages/babel-helper-compilation-targets/package.json +++ b/packages/babel-helper-compilation-targets/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-compilation-targets", - "version": "0.0.0", + "version": "7.8.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Engine compat data used in @babel/preset-env", @@ -16,17 +16,17 @@ "babel-plugin" ], "dependencies": { - "@babel/compat-data": "^0.0.0", + "@babel/compat-data": "^7.8.0", "browserslist": "^4.8.2", - "levenary": "^1.1.0", "invariant": "^2.2.4", + "levenary": "^1.1.0", "semver": "^7.1.1" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-helper-create-class-features-plugin/package.json b/packages/babel-helper-create-class-features-plugin/package.json index fabc6a8102a0..4f0ba54f66fc 100644 --- a/packages/babel-helper-create-class-features-plugin/package.json +++ b/packages/babel-helper-create-class-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-class-features-plugin", - "version": "7.7.4", + "version": "7.8.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "type": "commonjs", @@ -15,18 +15,18 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-member-expression-to-functions": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4" + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-member-expression-to-functions": "^7.8.0", + "@babel/helper-optimise-call-expression": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-replace-supers": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-helper-create-regexp-features-plugin/package.json b/packages/babel-helper-create-regexp-features-plugin/package.json index 694cda7c9e5b..e1764a0da6c8 100644 --- a/packages/babel-helper-create-regexp-features-plugin/package.json +++ b/packages/babel-helper-create-regexp-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-regexp-features-plugin", - "version": "7.7.4", + "version": "7.8.0", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "type": "commonjs", @@ -19,14 +19,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-regex": "^7.4.4", + "@babel/helper-regex": "^7.8.0", "regexpu-core": "^4.6.0" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index 2a43a7344f72..0dfb50611930 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-define-map", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to define a map", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/helper-function-name": "^7.8.0", + "@babel/types": "^7.8.0", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index 43c811430033..81e8b0433f30 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-assignable-expression", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to explode an assignable expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", "license": "MIT", @@ -10,7 +10,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index 9d2b1867d448..b627f7a32e2f 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-explode-class", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to explode class", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-bindify-decorators": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-bindify-decorators": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index 6e09ce01bcc8..c4f6d841ba29 100644 --- a/packages/babel-helper-fixtures/package.json +++ b/packages/babel-helper-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-fixtures", - "version": "7.6.3", + "version": "7.8.0", "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index 1d0f2b20930a..4ab3de6871a6 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-function-name", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to change the property 'name' of every function", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-get-function-arity": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index fb57100f5bf4..d69e62baa880 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-get-function-arity", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to get function arity", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index e1963d8b3c45..4e2e2ed74792 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-hoist-variables", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to hoist variables", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-member-expression-to-functions/package.json b/packages/babel-helper-member-expression-to-functions/package.json index 1fe57249d823..6a1a3cb80ed6 100644 --- a/packages/babel-helper-member-expression-to-functions/package.json +++ b/packages/babel-helper-member-expression-to-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-member-expression-to-functions", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to replace certain member expressions with function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions", "license": "MIT", @@ -11,6 +11,6 @@ "main": "lib/index.js", "author": "Justin Ridgewell ", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index c2233db1d98f..ddc735c849b1 100644 --- a/packages/babel-helper-module-imports/package.json +++ b/packages/babel-helper-module-imports/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-imports", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel helper functions for inserting module loads", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -12,9 +12,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports", "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 831e46545cc6..afba07cd308e 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-module-transforms", - "version": "7.7.5", + "version": "7.8.0", "description": "Babel helper functions for implementing ES6 module transformations", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-transforms", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-simple-access": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/helper-module-imports": "^7.8.0", + "@babel/helper-simple-access": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/types": "^7.8.0", "lodash": "^4.17.13" } } diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index 31bf72d0a9a9..7e28722e1c4e 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-optimise-call-expression", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to optimise call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-plugin-test-runner/package.json b/packages/babel-helper-plugin-test-runner/package.json index e921e208a386..94dbbbd017f2 100644 --- a/packages/babel-helper-plugin-test-runner/package.json +++ b/packages/babel-helper-plugin-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-plugin-test-runner", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to support test runner", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-transform-fixture-test-runner": "^7.7.4" + "@babel/helper-transform-fixture-test-runner": "^7.8.0" } } diff --git a/packages/babel-helper-plugin-utils/package.json b/packages/babel-helper-plugin-utils/package.json index 198ed3c13077..5d002fab6937 100644 --- a/packages/babel-helper-plugin-utils/package.json +++ b/packages/babel-helper-plugin-utils/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-plugin-utils", - "version": "7.0.0", + "version": "7.8.0", "description": "General utilities for plugins to use", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-helper-regex/package.json b/packages/babel-helper-regex/package.json index 808fe8e5e9e9..b802fac4b8b9 100644 --- a/packages/babel-helper-regex/package.json +++ b/packages/babel-helper-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-regex", - "version": "7.5.5", + "version": "7.8.0", "description": "Helper function to check for literal RegEx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex", "license": "MIT", diff --git a/packages/babel-helper-remap-async-to-generator/package.json b/packages/babel-helper-remap-async-to-generator/package.json index 3545cdd622b7..93e5f6d8a5f9 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-remap-async-to-generator", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to remap async functions to generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-remap-async-to-generator", "license": "MIT", @@ -10,10 +10,10 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-wrap-function": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-annotate-as-pure": "^7.8.0", + "@babel/helper-wrap-function": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index f0c01d8514e2..9f0258de7801 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-replace-supers", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper function to replace supers", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers", "license": "MIT", @@ -10,9 +10,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-member-expression-to-functions": "^7.8.0", + "@babel/helper-optimise-call-expression": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index 8b33edb352fc..709f6eb3eb72 100644 --- a/packages/babel-helper-simple-access/package.json +++ b/packages/babel-helper-simple-access/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-simple-access", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -12,7 +12,7 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/template": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json index 30e26ea2f17d..999ec1936c77 100644 --- a/packages/babel-helper-split-export-declaration/package.json +++ b/packages/babel-helper-split-export-declaration/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-split-export-declaration", - "version": "7.7.4", + "version": "7.8.0", "description": "", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", "license": "MIT", @@ -10,6 +10,6 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/types": "^7.7.4" + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 234faf602dd2..15f36553ead4 100644 --- a/packages/babel-helper-transform-fixture-test-runner/package.json +++ b/packages/babel-helper-transform-fixture-test-runner/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-transform-fixture-test-runner", - "version": "7.7.5", + "version": "7.8.0", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,10 +12,10 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-transform-fixture-test-runner", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/core": "^7.7.5", - "@babel/helper-fixtures": "^7.6.3", - "@babel/polyfill": "^7.6.0", + "@babel/code-frame": "^7.8.0", + "@babel/core": "^7.8.0", + "@babel/helper-fixtures": "^7.8.0", + "@babel/polyfill": "^7.8.0", "babel-check-duplicated-nodes": "^1.0.0", "jest": "^24.8.0", "jest-diff": "^24.8.0", diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index f71836605c20..451f90741aa4 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-wrap-function", - "version": "7.7.4", + "version": "7.8.0", "description": "Helper to wrap functions inside a function call.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function", "license": "MIT", @@ -10,9 +10,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "^7.7.4", - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/helper-function-name": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index d89e6c11ff88..4c611aaa0a76 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.7.4", + "version": "7.8.0", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,11 +12,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers", "main": "lib/index.js", "dependencies": { - "@babel/template": "^7.7.4", - "@babel/traverse": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/template": "^7.8.0", + "@babel/traverse": "^7.8.0", + "@babel/types": "^7.8.0" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json index f78d5c52b4b9..48137d812af0 100644 --- a/packages/babel-highlight/package.json +++ b/packages/babel-highlight/package.json @@ -1,6 +1,6 @@ { "name": "@babel/highlight", - "version": "7.5.0", + "version": "7.8.0", "description": "Syntax highlight JavaScript strings for output in terminals.", "author": "suchipi ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index d482aecbebba..24eb8bc02b9e 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.7.7", + "version": "7.8.0", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -20,7 +20,7 @@ "compiler" ], "dependencies": { - "@babel/register": "^7.7.7", + "@babel/register": "^7.8.0", "commander": "^4.0.1", "core-js": "^3.2.1", "lodash": "^4.17.13", @@ -33,9 +33,9 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-fixtures": "^7.6.3", - "@babel/runtime": "^7.7.7", + "@babel/core": "^7.8.0", + "@babel/helper-fixtures": "^7.8.0", + "@babel/runtime": "^7.8.0", "fs-readdir-recursive": "^1.0.0", "make-dir": "^2.1.0", "rimraf": "^3.0.0" diff --git a/packages/babel-parser/package.json b/packages/babel-parser/package.json index 891793614029..cb6eb4b1e5ef 100644 --- a/packages/babel-parser/package.json +++ b/packages/babel-parser/package.json @@ -1,6 +1,6 @@ { "name": "@babel/parser", - "version": "7.7.7", + "version": "7.8.0", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -29,8 +29,8 @@ "node": ">=6.0.0" }, "devDependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/helper-fixtures": "^7.6.3", + "@babel/code-frame": "^7.8.0", + "@babel/helper-fixtures": "^7.8.0", "charcodes": "^0.2.0", "unicode-12.0.0": "^0.7.9" }, diff --git a/packages/babel-plugin-external-helpers/package.json b/packages/babel-plugin-external-helpers/package.json index 2fea68604714..ed398982139e 100644 --- a/packages/babel-plugin-external-helpers/package.json +++ b/packages/babel-plugin-external-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-external-helpers", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin contains helper functions that’ll be placed at the top of the generated code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-external-helpers", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-async-generator-functions/package.json b/packages/babel-plugin-proposal-async-generator-functions/package.json index b653ad495381..485b0d281afa 100644 --- a/packages/babel-plugin-proposal-async-generator-functions/package.json +++ b/packages/babel-plugin-proposal-async-generator-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-async-generator-functions", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn async generator functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-async-generator-functions", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.4", - "@babel/plugin-syntax-async-generators": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-remap-async-to-generator": "^7.8.0", + "@babel/plugin-syntax-async-generators": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-class-properties/package.json b/packages/babel-plugin-proposal-class-properties/package.json index b20fde33ea94..56caa39ff33c 100644 --- a/packages/babel-plugin-proposal-class-properties/package.json +++ b/packages/babel-plugin-proposal-class-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-class-properties", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-class-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index 40a54e62a55b..b5ab0bcc29a4 100644 --- a/packages/babel-plugin-proposal-decorators/package.json +++ b/packages/babel-plugin-proposal-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-decorators", - "version": "7.7.4", + "version": "7.8.0", "author": "Logan Smyth ", "license": "MIT", "type": "commonjs", @@ -16,15 +16,15 @@ "decorators" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-decorators": "^7.7.4" + "@babel/helper-create-class-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-decorators": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-do-expressions/package.json b/packages/babel-plugin-proposal-do-expressions/package.json index e07a2f44f059..7f0fc96be4ee 100644 --- a/packages/babel-plugin-proposal-do-expressions/package.json +++ b/packages/babel-plugin-proposal-do-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-do-expressions", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile do expressions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-do-expressions", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-do-expressions": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-do-expressions": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-dynamic-import/package.json b/packages/babel-plugin-proposal-dynamic-import/package.json index 77cc55dbf944..c668564797b2 100644 --- a/packages/babel-plugin-proposal-dynamic-import/package.json +++ b/packages/babel-plugin-proposal-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-dynamic-import", - "version": "7.7.4", + "version": "7.8.0", "description": "Transform import() expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-dynamic-import", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-dynamic-import": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-export-default-from/package.json b/packages/babel-plugin-proposal-export-default-from/package.json index 28968a34d700..b91cfa6d12a3 100644 --- a/packages/babel-plugin-proposal-export-default-from/package.json +++ b/packages/babel-plugin-proposal-export-default-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-export-default-from", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile export default to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-export-default-from": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-export-namespace-from/package.json b/packages/babel-plugin-proposal-export-namespace-from/package.json index 7d875e83d8d4..5a2183d451e4 100644 --- a/packages/babel-plugin-proposal-export-namespace-from/package.json +++ b/packages/babel-plugin-proposal-export-namespace-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-export-namespace-from", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile export namespace to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-namespace-from", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-export-namespace-from": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-function-bind/package.json b/packages/babel-plugin-proposal-function-bind/package.json index bd39b2dcda8b..e27a10e00fdb 100644 --- a/packages/babel-plugin-proposal-function-bind/package.json +++ b/packages/babel-plugin-proposal-function-bind/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-function-bind", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile function bind operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-bind", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-function-bind": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-function-bind": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-function-sent/package.json b/packages/babel-plugin-proposal-function-sent/package.json index 23903d43772b..77a6abb22932 100644 --- a/packages/babel-plugin-proposal-function-sent/package.json +++ b/packages/babel-plugin-proposal-function-sent/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-function-sent", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile the function.sent meta property to valid ES2015 code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-sent", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-wrap-function": "^7.7.4", - "@babel/plugin-syntax-function-sent": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-wrap-function": "^7.8.0", + "@babel/plugin-syntax-function-sent": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-json-strings/package.json b/packages/babel-plugin-proposal-json-strings/package.json index 111ff9c3cd48..4036e8fd5a20 100644 --- a/packages/babel-plugin-proposal-json-strings/package.json +++ b/packages/babel-plugin-proposal-json-strings/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-json-strings", - "version": "7.7.4", + "version": "7.8.0", "description": "Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-json-strings", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-json-strings": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/package.json b/packages/babel-plugin-proposal-logical-assignment-operators/package.json index 2c657e96864e..eba61333a1f6 100644 --- a/packages/babel-plugin-proposal-logical-assignment-operators/package.json +++ b/packages/babel-plugin-proposal-logical-assignment-operators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-logical-assignment-operators", - "version": "7.7.4", + "version": "7.8.0", "description": "Transforms logical assignment operators into short-circuited assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-logical-assignment-operators", "license": "MIT", @@ -13,16 +13,16 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-logical-assignment-operators": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json index eb877ec4de08..16cc1e498a05 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-nullish-coalescing-operator", - "version": "7.7.4", + "version": "7.8.0", "description": "Remove nullish coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-nullish-coalescing-operator", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-numeric-separator/package.json b/packages/babel-plugin-proposal-numeric-separator/package.json index ba2f6ef84189..2f8549c7a0cb 100644 --- a/packages/babel-plugin-proposal-numeric-separator/package.json +++ b/packages/babel-plugin-proposal-numeric-separator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-numeric-separator", - "version": "7.7.4", + "version": "7.8.0", "description": "Remove numeric separators from Decimal, Binary, Hex and Octal literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-numeric-separator", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-numeric-separator": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index d2b69edd511f..f7ea20ce513d 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/package.json +++ b/packages/babel-plugin-proposal-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-object-rest-spread", - "version": "7.7.7", + "version": "7.8.0", "description": "Compile object rest and spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-optional-catch-binding/package.json b/packages/babel-plugin-proposal-optional-catch-binding/package.json index d0ac5095e8d9..cca085c33af6 100644 --- a/packages/babel-plugin-proposal-optional-catch-binding/package.json +++ b/packages/babel-plugin-proposal-optional-catch-binding/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-catch-binding", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index 1d8cc310eb03..c46bfc43dcc9 100644 --- a/packages/babel-plugin-proposal-optional-chaining/package.json +++ b/packages/babel-plugin-proposal-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-optional-chaining", - "version": "7.7.5", + "version": "7.8.0", "description": "Transform optional chaining operators into a series of nil checks", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-optional-chaining": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-transform-block-scoping": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/plugin-transform-block-scoping": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-partial-application/package.json b/packages/babel-plugin-proposal-partial-application/package.json index 438794408bae..fe3641116c26 100644 --- a/packages/babel-plugin-proposal-partial-application/package.json +++ b/packages/babel-plugin-proposal-partial-application/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-partial-application", - "version": "7.7.4", + "version": "7.8.0", "description": "Introduces a new ? token in an argument list which allows for partially applying an argument list to a call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-partial-application", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-partial-application": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-partial-application": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-pipeline-operator/package.json b/packages/babel-plugin-proposal-pipeline-operator/package.json index 1d3659d3f2f0..46591d9274c9 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/package.json +++ b/packages/babel-plugin-proposal-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-pipeline-operator", - "version": "7.7.7", + "version": "7.8.0", "description": "Transform pipeline operator into call expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-pipeline-operator": "^7.7.7" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-pipeline-operator": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-private-methods/package.json b/packages/babel-plugin-proposal-private-methods/package.json index 43987665df15..f8786ae03b24 100644 --- a/packages/babel-plugin-proposal-private-methods/package.json +++ b/packages/babel-plugin-proposal-private-methods/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-private-methods", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin transforms private class methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-private-methods", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-class-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-throw-expressions/package.json b/packages/babel-plugin-proposal-throw-expressions/package.json index 1336eb43fd67..651a19d57fc5 100644 --- a/packages/babel-plugin-proposal-throw-expressions/package.json +++ b/packages/babel-plugin-proposal-throw-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-throw-expressions", - "version": "7.7.4", + "version": "7.8.0", "description": "Wraps Throw Expressions in an IIFE", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-throw-expressions", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-throw-expressions": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-throw-expressions": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index c506443796b1..05122cc7ddc6 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/package.json +++ b/packages/babel-plugin-proposal-unicode-property-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-proposal-unicode-property-regex", - "version": "7.7.7", + "version": "7.8.0", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -23,14 +23,14 @@ "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-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-async-generators/package.json b/packages/babel-plugin-syntax-async-generators/package.json index 8b73a168a369..2d8af6a3983e 100644 --- a/packages/babel-plugin-syntax-async-generators/package.json +++ b/packages/babel-plugin-syntax-async-generators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-async-generators", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of async generator functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-bigint/package.json b/packages/babel-plugin-syntax-bigint/package.json index 3f4384496a3c..917845fecccc 100644 --- a/packages/babel-plugin-syntax-bigint/package.json +++ b/packages/babel-plugin-syntax-bigint/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-bigint", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of BigInt literals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-bigint", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-class-properties/package.json b/packages/babel-plugin-syntax-class-properties/package.json index dc3baa374311..11cc502e4e5d 100644 --- a/packages/babel-plugin-syntax-class-properties/package.json +++ b/packages/babel-plugin-syntax-class-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-class-properties", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of class properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-decorators/package.json b/packages/babel-plugin-syntax-decorators/package.json index 118ca5ed56a6..1921ddeeff7c 100644 --- a/packages/babel-plugin-syntax-decorators/package.json +++ b/packages/babel-plugin-syntax-decorators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-decorators", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-do-expressions/package.json b/packages/babel-plugin-syntax-do-expressions/package.json index de21eabceaff..a1225e694bfd 100644 --- a/packages/babel-plugin-syntax-do-expressions/package.json +++ b/packages/babel-plugin-syntax-do-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-do-expressions", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of do expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-do-expressions", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-dynamic-import/package.json b/packages/babel-plugin-syntax-dynamic-import/package.json index aa06c10acfca..c85ec644f522 100644 --- a/packages/babel-plugin-syntax-dynamic-import/package.json +++ b/packages/babel-plugin-syntax-dynamic-import/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-dynamic-import", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of import()", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-export-default-from/package.json b/packages/babel-plugin-syntax-export-default-from/package.json index 01c143f9c423..40a7ef104404 100644 --- a/packages/babel-plugin-syntax-export-default-from/package.json +++ b/packages/babel-plugin-syntax-export-default-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-export-default-from", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of export default from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-export-namespace-from/package.json b/packages/babel-plugin-syntax-export-namespace-from/package.json index 35997173a08e..46cc2781e3bb 100644 --- a/packages/babel-plugin-syntax-export-namespace-from/package.json +++ b/packages/babel-plugin-syntax-export-namespace-from/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-export-namespace-from", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of export namespace from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-namespace-from", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-flow/package.json b/packages/babel-plugin-syntax-flow/package.json index 36984d35cd40..f79cfe30e1a7 100644 --- a/packages/babel-plugin-syntax-flow/package.json +++ b/packages/babel-plugin-syntax-flow/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-flow", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of the flow syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-function-bind/package.json b/packages/babel-plugin-syntax-function-bind/package.json index e38f0eae6fac..d4abdf8240fb 100644 --- a/packages/babel-plugin-syntax-function-bind/package.json +++ b/packages/babel-plugin-syntax-function-bind/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-function-bind", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of function bind", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-bind", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-function-sent/package.json b/packages/babel-plugin-syntax-function-sent/package.json index dfc1760f3f6f..2091dc8b6895 100644 --- a/packages/babel-plugin-syntax-function-sent/package.json +++ b/packages/babel-plugin-syntax-function-sent/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-function-sent", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of the function.sent meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-sent", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-import-meta/package.json b/packages/babel-plugin-syntax-import-meta/package.json index 1b63c6a5ea48..b0aa4d99a3cc 100644 --- a/packages/babel-plugin-syntax-import-meta/package.json +++ b/packages/babel-plugin-syntax-import-meta/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-import-meta", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of import.meta", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-import-meta", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-json-strings/package.json b/packages/babel-plugin-syntax-json-strings/package.json index 7832e25f142b..82798edd63e9 100644 --- a/packages/babel-plugin-syntax-json-strings/package.json +++ b/packages/babel-plugin-syntax-json-strings/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-json-strings", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-jsx/package.json b/packages/babel-plugin-syntax-jsx/package.json index c51a4afe27e5..5ed4541c2e95 100644 --- a/packages/babel-plugin-syntax-jsx/package.json +++ b/packages/babel-plugin-syntax-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-jsx", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/package.json b/packages/babel-plugin-syntax-logical-assignment-operators/package.json index 79cbfed5e1cd..e9c884994dd6 100644 --- a/packages/babel-plugin-syntax-logical-assignment-operators/package.json +++ b/packages/babel-plugin-syntax-logical-assignment-operators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-logical-assignment-operators", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of the logical assignment operators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-logical-assignment-operators", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json index 2efdc6e19563..1aea08cc5783 100644 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json +++ b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-nullish-coalescing-operator", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of the nullish-coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-numeric-separator/package.json b/packages/babel-plugin-syntax-numeric-separator/package.json index fdaa64bc19db..f26cb7655f92 100644 --- a/packages/babel-plugin-syntax-numeric-separator/package.json +++ b/packages/babel-plugin-syntax-numeric-separator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-numeric-separator", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of Decimal, Binary, Hex and Octal literals that contain a Numeric Literal Separator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-numeric-separator", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-object-rest-spread/package.json b/packages/babel-plugin-syntax-object-rest-spread/package.json index c4146bda8913..6b7bbf458799 100644 --- a/packages/babel-plugin-syntax-object-rest-spread/package.json +++ b/packages/babel-plugin-syntax-object-rest-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-object-rest-spread", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of object rest/spread", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-optional-catch-binding/package.json b/packages/babel-plugin-syntax-optional-catch-binding/package.json index 2c6c290688d1..c5b2bd0e7fc6 100644 --- a/packages/babel-plugin-syntax-optional-catch-binding/package.json +++ b/packages/babel-plugin-syntax-optional-catch-binding/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-optional-catch-binding", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-optional-chaining/package.json b/packages/babel-plugin-syntax-optional-chaining/package.json index d82d56edc478..b42aa5e52551 100644 --- a/packages/babel-plugin-syntax-optional-chaining/package.json +++ b/packages/babel-plugin-syntax-optional-chaining/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-optional-chaining", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of optional properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-partial-application/package.json b/packages/babel-plugin-syntax-partial-application/package.json index c16bf87311cc..127240edec2f 100644 --- a/packages/babel-plugin-syntax-partial-application/package.json +++ b/packages/babel-plugin-syntax-partial-application/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-partial-application", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of partial application syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-partial-application", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-pipeline-operator/package.json b/packages/babel-plugin-syntax-pipeline-operator/package.json index 3aba8d0e4e11..c27a7fa11411 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/package.json +++ b/packages/babel-plugin-syntax-pipeline-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-pipeline-operator", - "version": "7.7.7", + "version": "7.8.0", "description": "Allow parsing of the pipeline operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-pipeline-operator", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-throw-expressions/package.json b/packages/babel-plugin-syntax-throw-expressions/package.json index 3a98bdf794aa..fc37197d00e8 100644 --- a/packages/babel-plugin-syntax-throw-expressions/package.json +++ b/packages/babel-plugin-syntax-throw-expressions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-throw-expressions", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of Throw Expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-throw-expressions", "license": "MIT", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-top-level-await/package.json b/packages/babel-plugin-syntax-top-level-await/package.json index 68060722d8d5..29a93c7c0f03 100644 --- a/packages/babel-plugin-syntax-top-level-await/package.json +++ b/packages/babel-plugin-syntax-top-level-await/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-top-level-await", - "version": "7.7.4", + "version": "7.8.0", "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", @@ -13,12 +13,12 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-syntax-typescript/package.json b/packages/babel-plugin-syntax-typescript/package.json index 887a819f999e..d18cba16de41 100644 --- a/packages/babel-plugin-syntax-typescript/package.json +++ b/packages/babel-plugin-syntax-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-syntax-typescript", - "version": "7.7.4", + "version": "7.8.0", "description": "Allow parsing of TypeScript syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript", "license": "MIT", @@ -14,12 +14,12 @@ "typescript" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4" + "@babel/core": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-arrow-functions/package.json b/packages/babel-plugin-transform-arrow-functions/package.json index 70150045f77f..427f98ec5aef 100644 --- a/packages/babel-plugin-transform-arrow-functions/package.json +++ b/packages/babel-plugin-transform-arrow-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-arrow-functions", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 arrow functions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/traverse": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/traverse": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-async-to-generator/package.json b/packages/babel-plugin-transform-async-to-generator/package.json index 112f750b69fa..c5be398134c9 100644 --- a/packages/babel-plugin-transform-async-to-generator/package.json +++ b/packages/babel-plugin-transform-async-to-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-async-to-generator", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn async functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-remap-async-to-generator": "^7.7.4" + "@babel/helper-module-imports": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-remap-async-to-generator": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-block-scoped-functions/package.json b/packages/babel-plugin-transform-block-scoped-functions/package.json index f435fef60dc3..8fb81264f851 100644 --- a/packages/babel-plugin-transform-block-scoped-functions/package.json +++ b/packages/babel-plugin-transform-block-scoped-functions/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoped-functions", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel plugin to ensure function declarations at the block level are block scoped", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoped-functions", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index bb895e5b3f3b..73b73a8fcab6 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 block scoping (const and let) to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-block-scoping", "license": "MIT", @@ -10,7 +10,7 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-plugin-utils": "^7.8.0", "lodash": "^4.17.13" }, "keywords": [ @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-classes/package.json b/packages/babel-plugin-transform-classes/package.json index 6fd532a881e1..2ea9d700e464 100644 --- a/packages/babel-plugin-transform-classes/package.json +++ b/packages/babel-plugin-transform-classes/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-classes", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 classes to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes", "license": "MIT", @@ -10,13 +10,13 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-define-map": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-optimise-call-expression": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/helper-annotate-as-pure": "^7.8.0", + "@babel/helper-define-map": "^7.8.0", + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-optimise-call-expression": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-replace-supers": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0", "globals": "^11.1.0" }, "keywords": [ @@ -26,7 +26,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-computed-properties/package.json b/packages/babel-plugin-transform-computed-properties/package.json index bf1680e79bfd..4ba60b6cbceb 100644 --- a/packages/babel-plugin-transform-computed-properties/package.json +++ b/packages/babel-plugin-transform-computed-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-computed-properties", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 computed properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-destructuring/package.json b/packages/babel-plugin-transform-destructuring/package.json index 7a442a819c00..65878aed2803 100644 --- a/packages/babel-plugin-transform-destructuring/package.json +++ b/packages/babel-plugin-transform-destructuring/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-destructuring", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 destructuring to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 0225f28d168a..0c70971cabfb 100644 --- a/packages/babel-plugin-transform-dotall-regex/package.json +++ b/packages/babel-plugin-transform-dotall-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-dotall-regex", - "version": "7.7.7", + "version": "7.8.0", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -19,14 +19,14 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-dotall-regex", "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-duplicate-keys/package.json b/packages/babel-plugin-transform-duplicate-keys/package.json index 5d4b2026b7e6..ec3649b72c04 100644 --- a/packages/babel-plugin-transform-duplicate-keys/package.json +++ b/packages/babel-plugin-transform-duplicate-keys/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-duplicate-keys", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile objects with duplicate keys to valid strict ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-duplicate-keys", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-exponentiation-operator/package.json b/packages/babel-plugin-transform-exponentiation-operator/package.json index 8fb5e21710d9..36e74c87ceac 100644 --- a/packages/babel-plugin-transform-exponentiation-operator/package.json +++ b/packages/babel-plugin-transform-exponentiation-operator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-exponentiation-operator", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile exponentiation operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index ec05f8149cfd..cf237618b481 100644 --- a/packages/babel-plugin-transform-flow-comments/package.json +++ b/packages/babel-plugin-transform-flow-comments/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-comments", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/generator": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.7.4" + "@babel/generator": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-flow": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-flow-strip-types/package.json b/packages/babel-plugin-transform-flow-strip-types/package.json index bc430c38d7cb..9a169fc34828 100644 --- a/packages/babel-plugin-transform-flow-strip-types/package.json +++ b/packages/babel-plugin-transform-flow-strip-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-flow-strip-types", - "version": "7.7.4", + "version": "7.8.0", "description": "Strip flow type annotations from your output code.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-strip-types", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-flow": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-flow": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-for-of/package.json b/packages/babel-plugin-transform-for-of/package.json index 6e4794e40540..0e77ea3aa60f 100644 --- a/packages/babel-plugin-transform-for-of/package.json +++ b/packages/babel-plugin-transform-for-of/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-for-of", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 for...of to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-function-name/package.json b/packages/babel-plugin-transform-function-name/package.json index 34e1f16e212a..3a013e612904 100644 --- a/packages/babel-plugin-transform-function-name/package.json +++ b/packages/babel-plugin-transform-function-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-function-name", - "version": "7.7.4", + "version": "7.8.0", "description": "Apply ES2015 function.name semantics to all functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-function-name", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-instanceof/package.json b/packages/babel-plugin-transform-instanceof/package.json index e0c436402d23..39f379b9aee0 100644 --- a/packages/babel-plugin-transform-instanceof/package.json +++ b/packages/babel-plugin-transform-instanceof/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-instanceof", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin transforms all the ES2015 'instanceof' methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-instanceof", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-jscript/package.json b/packages/babel-plugin-transform-jscript/package.json index fd5547b91c0e..3e133ca3f266 100644 --- a/packages/babel-plugin-transform-jscript/package.json +++ b/packages/babel-plugin-transform-jscript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-jscript", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel plugin to fix buggy JScript named function expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-jscript", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-literals/package.json b/packages/babel-plugin-transform-literals/package.json index e9123046fe55..71cb38021646 100644 --- a/packages/babel-plugin-transform-literals/package.json +++ b/packages/babel-plugin-transform-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-literals", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 unicode string and number literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-literals", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-member-expression-literals/package.json b/packages/babel-plugin-transform-member-expression-literals/package.json index cca252b888d5..5b97bf2809dc 100644 --- a/packages/babel-plugin-transform-member-expression-literals/package.json +++ b/packages/babel-plugin-transform-member-expression-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-member-expression-literals", - "version": "7.7.4", + "version": "7.8.0", "description": "Ensure that reserved words are quoted in property accesses", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-member-expression-literals", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-modules-amd/package.json b/packages/babel-plugin-transform-modules-amd/package.json index 6cc94d7878ea..fc6ed07c9ccc 100644 --- a/packages/babel-plugin-transform-modules-amd/package.json +++ b/packages/babel-plugin-transform-modules-amd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-amd", - "version": "7.7.5", + "version": "7.8.0", "description": "This plugin transforms ES2015 modules to AMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.5", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-module-transforms": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, "keywords": [ @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index 33be21373278..68560721dc11 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.7.5", + "version": "7.8.0", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", @@ -10,9 +10,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.5", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-simple-access": "^7.7.4", + "@babel/helper-module-transforms": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-simple-access": "^7.8.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, "keywords": [ @@ -22,8 +22,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index 596c79bcaee1..bd39b744d73e 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-systemjs", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin transforms ES2015 modules to SystemJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", "license": "MIT", @@ -10,9 +10,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "^7.7.4", - "@babel/helper-module-transforms": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-hoist-variables": "^7.8.0", + "@babel/helper-module-transforms": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", "babel-plugin-dynamic-import-node": "^2.3.0" }, "keywords": [ @@ -22,8 +22,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-modules-umd/package.json b/packages/babel-plugin-transform-modules-umd/package.json index 94c1bfad4035..99a824796b26 100644 --- a/packages/babel-plugin-transform-modules-umd/package.json +++ b/packages/babel-plugin-transform-modules-umd/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-modules-umd", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin transforms ES2015 modules to UMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-module-transforms": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "keywords": [ "babel-plugin" @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } 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 f8dec6007df9..f6ee3be6ce24 100644 --- a/packages/babel-plugin-transform-named-capturing-groups-regex/package.json +++ b/packages/babel-plugin-transform-named-capturing-groups-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-named-capturing-groups-regex", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile regular expressions using named groups to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -22,14 +22,14 @@ }, "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4" + "@babel/helper-create-regexp-features-plugin": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", "core-js": "^3.2.1", "core-js-pure": "^3.2.1" } diff --git a/packages/babel-plugin-transform-new-target/package.json b/packages/babel-plugin-transform-new-target/package.json index 2e3ece2bb359..b6f52b755102 100644 --- a/packages/babel-plugin-transform-new-target/package.json +++ b/packages/babel-plugin-transform-new-target/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-new-target", - "version": "7.7.4", + "version": "7.8.0", "description": "Transforms new.target meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/plugin-proposal-class-properties": "^7.7.4", - "@babel/plugin-transform-arrow-functions": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/plugin-proposal-class-properties": "^7.8.0", + "@babel/plugin-transform-arrow-functions": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-object-assign/package.json b/packages/babel-plugin-transform-object-assign/package.json index e3cafb627a61..3145e8a67250 100644 --- a/packages/babel-plugin-transform-object-assign/package.json +++ b/packages/babel-plugin-transform-object-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-assign", - "version": "7.7.4", + "version": "7.8.0", "description": "Replace Object.assign with an inline helper", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-assign", "author": "Jed Watson", @@ -14,13 +14,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json index e96d9cee38f7..94b32a7c705c 100644 --- a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json +++ b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-set-prototype-of-to-assign", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn Object.setPrototypeOf to assignments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-set-prototype-of-to-assign", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-object-super/package.json b/packages/babel-plugin-transform-object-super/package.json index f9575d759a78..c2f2a028e893 100644 --- a/packages/babel-plugin-transform-object-super/package.json +++ b/packages/babel-plugin-transform-object-super/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-object-super", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 object super to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-replace-supers": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-replace-supers": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-parameters/package.json b/packages/babel-plugin-transform-parameters/package.json index 415781c39ce3..956de63f1152 100644 --- a/packages/babel-plugin-transform-parameters/package.json +++ b/packages/babel-plugin-transform-parameters/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-parameters", - "version": "7.7.7", + "version": "7.8.0", "description": "Compile ES2015 default and rest parameters to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", "license": "MIT", @@ -10,9 +10,9 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-call-delegate": "^7.7.4", - "@babel/helper-get-function-arity": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-call-delegate": "^7.8.0", + "@babel/helper-get-function-arity": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "keywords": [ "babel-plugin" @@ -21,7 +21,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-property-literals/package.json b/packages/babel-plugin-transform-property-literals/package.json index 7dee396801c8..1823601d6aad 100644 --- a/packages/babel-plugin-transform-property-literals/package.json +++ b/packages/babel-plugin-transform-property-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-property-literals", - "version": "7.7.4", + "version": "7.8.0", "description": "Ensure that reserved words are quoted in object property keys", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-literals", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-property-mutators/package.json b/packages/babel-plugin-transform-property-mutators/package.json index f790b51898d7..3ab22baf7274 100644 --- a/packages/babel-plugin-transform-property-mutators/package.json +++ b/packages/babel-plugin-transform-property-mutators/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-property-mutators", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES5 property mutator shorthand syntax to Object.defineProperty", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-property-mutators", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-define-map": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-define-map": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-proto-to-assign/package.json b/packages/babel-plugin-transform-proto-to-assign/package.json index 3e2591f75579..9c2a0668e936 100644 --- a/packages/babel-plugin-transform-proto-to-assign/package.json +++ b/packages/babel-plugin-transform-proto-to-assign/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-proto-to-assign", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel plugin for turning __proto__ into a shallow property clone", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-proto-to-assign", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-plugin-utils": "^7.8.0", "lodash": "^4.17.13" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index 465b32f9bd9f..d198d163fe58 100644 --- a/packages/babel-plugin-transform-react-constant-elements/package.json +++ b/packages/babel-plugin-transform-react-constant-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-constant-elements", - "version": "7.7.4", + "version": "7.8.0", "description": "Treat React JSX elements as value types and hoist them to the highest scope", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-constant-elements", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-annotate-as-pure": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-display-name/package.json b/packages/babel-plugin-transform-react-display-name/package.json index 989f89776aab..dbdfbf6f723a 100644 --- a/packages/babel-plugin-transform-react-display-name/package.json +++ b/packages/babel-plugin-transform-react-display-name/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-display-name", - "version": "7.7.4", + "version": "7.8.0", "description": "Add displayName to React.createClass calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-inline-elements/package.json b/packages/babel-plugin-transform-react-inline-elements/package.json index ed011f78d7b5..07be3c891a33 100644 --- a/packages/babel-plugin-transform-react-inline-elements/package.json +++ b/packages/babel-plugin-transform-react-inline-elements/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-inline-elements", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn JSX elements into exploded React objects", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-inline-elements", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-builder-react-jsx": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-jsx-compat/package.json b/packages/babel-plugin-transform-react-jsx-compat/package.json index cec02c2c9c34..face8499d4ac 100644 --- a/packages/babel-plugin-transform-react-jsx-compat/package.json +++ b/packages/babel-plugin-transform-react-jsx-compat/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-compat", - "version": "7.7.4", + "version": "7.8.0", "description": "Turn JSX into React Pre-0.12 function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-compat", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-builder-react-jsx": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-jsx-self/package.json b/packages/babel-plugin-transform-react-jsx-self/package.json index 581cdbf66a6e..3dc4108fa812 100644 --- a/packages/babel-plugin-transform-react-jsx-self/package.json +++ b/packages/babel-plugin-transform-react-jsx-self/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-self", - "version": "7.7.4", + "version": "7.8.0", "description": "Add a __self prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-self", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-jsx": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-jsx-source/package.json b/packages/babel-plugin-transform-react-jsx-source/package.json index 8b0e0dd17605..8750c2605a29 100644 --- a/packages/babel-plugin-transform-react-jsx-source/package.json +++ b/packages/babel-plugin-transform-react-jsx-source/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx-source", - "version": "7.7.4", + "version": "7.8.0", "description": "Add a __source prop to all JSX Elements", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx-source", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-jsx": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index 393bd98aa61b..fe53dac28b4d 100644 --- a/packages/babel-plugin-transform-react-jsx/package.json +++ b/packages/babel-plugin-transform-react-jsx/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-react-jsx", - "version": "7.7.7", + "version": "7.8.0", "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", @@ -13,15 +13,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-jsx": "^7.7.4" + "@babel/helper-builder-react-jsx": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-jsx": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index 786c675c5a2f..5d70151aa058 100644 --- a/packages/babel-plugin-transform-regenerator/package.json +++ b/packages/babel-plugin-transform-regenerator/package.json @@ -2,7 +2,7 @@ "name": "@babel/plugin-transform-regenerator", "author": "Ben Newman ", "description": "Explode async and generator functions into a state machine.", - "version": "7.7.5", + "version": "7.8.0", "homepage": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-regenerator", "main": "lib/index.js", @@ -18,7 +18,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-reserved-words/package.json b/packages/babel-plugin-transform-reserved-words/package.json index 2fcec4a64709..5ca5659e3ccc 100644 --- a/packages/babel-plugin-transform-reserved-words/package.json +++ b/packages/babel-plugin-transform-reserved-words/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-reserved-words", - "version": "7.7.4", + "version": "7.8.0", "description": "Ensure that no reserved words are used.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index 9e5d72dd9678..a156bc3a2972 100644 --- a/packages/babel-plugin-transform-runtime/package.json +++ b/packages/babel-plugin-transform-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-runtime", - "version": "7.7.6", + "version": "7.8.0", "description": "Externalise references to helpers and builtins, automatically polyfilling your code without polluting globals", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-runtime", "license": "MIT", @@ -13,8 +13,8 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-module-imports": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", "resolve": "^1.8.1", "semver": "^5.5.1" }, @@ -22,13 +22,13 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.5", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/helpers": "^7.7.4", - "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/preset-env": "^7.7.6", - "@babel/runtime": "^7.7.6", - "@babel/template": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/helpers": "^7.8.0", + "@babel/plugin-transform-typeof-symbol": "^7.8.0", + "@babel/preset-env": "^7.8.0", + "@babel/runtime": "^7.8.0", + "@babel/template": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-shorthand-properties/package.json b/packages/babel-plugin-transform-shorthand-properties/package.json index 6358cbe96c0f..88997e27f101 100644 --- a/packages/babel-plugin-transform-shorthand-properties/package.json +++ b/packages/babel-plugin-transform-shorthand-properties/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-shorthand-properties", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 shorthand properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-spread/package.json b/packages/babel-plugin-transform-spread/package.json index f1084a953e37..c4b311071e20 100644 --- a/packages/babel-plugin-transform-spread/package.json +++ b/packages/babel-plugin-transform-spread/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-spread", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-sticky-regex/package.json b/packages/babel-plugin-transform-sticky-regex/package.json index 9b72f700ccf5..451f93611e26 100644 --- a/packages/babel-plugin-transform-sticky-regex/package.json +++ b/packages/babel-plugin-transform-sticky-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-sticky-regex", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 sticky regex to an ES5 RegExp constructor", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-sticky-regex", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/helper-regex": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/helper-regex": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-strict-mode/package.json b/packages/babel-plugin-transform-strict-mode/package.json index 8cd46bcfb58b..c5c257a2626c 100644 --- a/packages/babel-plugin-transform-strict-mode/package.json +++ b/packages/babel-plugin-transform-strict-mode/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-strict-mode", - "version": "7.7.4", + "version": "7.8.0", "description": "This plugin places a 'use strict'; directive at the top of all files to enable strict mode", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-strict-mode", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-template-literals/package.json b/packages/babel-plugin-transform-template-literals/package.json index a4392760edfc..be26195eb31e 100644 --- a/packages/babel-plugin-transform-template-literals/package.json +++ b/packages/babel-plugin-transform-template-literals/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-template-literals", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 template literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals", "license": "MIT", @@ -10,8 +10,8 @@ }, "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-annotate-as-pure": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "keywords": [ "babel-plugin" @@ -20,7 +20,7 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-typeof-symbol/package.json b/packages/babel-plugin-transform-typeof-symbol/package.json index e336f9d4a3f0..dbeed8c13bc3 100644 --- a/packages/babel-plugin-transform-typeof-symbol/package.json +++ b/packages/babel-plugin-transform-typeof-symbol/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typeof-symbol", - "version": "7.7.4", + "version": "7.8.0", "description": "This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol", "license": "MIT", @@ -13,13 +13,13 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index 56b43eb78a2d..f6b72bba4288 100644 --- a/packages/babel-plugin-transform-typescript/package.json +++ b/packages/babel-plugin-transform-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-typescript", - "version": "7.7.4", + "version": "7.8.0", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -14,15 +14,15 @@ "typescript" ], "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-syntax-typescript": "^7.7.4" + "@babel/helper-create-class-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-syntax-typescript": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index fd903a966bc4..4120510e22db 100644 --- a/packages/babel-plugin-transform-unicode-regex/package.json +++ b/packages/babel-plugin-transform-unicode-regex/package.json @@ -1,6 +1,6 @@ { "name": "@babel/plugin-transform-unicode-regex", - "version": "7.7.4", + "version": "7.8.0", "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", @@ -13,14 +13,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0" + "@babel/helper-create-regexp-features-plugin": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index 6c7727ac3608..28e95bf25f50 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@babel/polyfill", - "version": "7.7.0", + "version": "7.8.0", "description": "Provides polyfills necessary for a full ES2015+ environment", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-env-standalone/package.json b/packages/babel-preset-env-standalone/package.json index 264a2f579bb8..af2f9195b678 100644 --- a/packages/babel-preset-env-standalone/package.json +++ b/packages/babel-preset-env-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env-standalone", - "version": "7.7.7", + "version": "7.8.0", "description": "Standalone build of babel-preset-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -11,18 +11,18 @@ "prepublishOnly": "cd ../.. && make prepublish-build-preset-env-standalone" }, "devDependencies": { - "@babel/plugin-proposal-dynamic-import": "^7.7.4", - "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-proposal-optional-chaining": "^7.7.4", - "@babel/plugin-syntax-json-strings": "^7.7.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-syntax-optional-chaining": "^7.7.4", - "@babel/plugin-syntax-top-level-await": "^7.7.4", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", - "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/preset-env": "^7.7.7", - "@babel/standalone": "^7.7.7", + "@babel/plugin-proposal-dynamic-import": "^7.8.0", + "@babel/plugin-proposal-json-strings": "^7.8.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-proposal-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.0", + "@babel/plugin-transform-new-target": "^7.8.0", + "@babel/preset-env": "^7.8.0", + "@babel/standalone": "^7.8.0", "lodash": "^4.17.13" }, "keywords": [ diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 5cc8426ebcf1..996a95b52760 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.7.7", + "version": "7.8.0", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -12,58 +12,58 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env", "main": "lib/index.js", "dependencies": { - "@babel/compat-data": "^0.0.0", - "@babel/helper-compilation-targets": "^0.0.0", - "@babel/helper-module-imports": "^7.7.4", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-proposal-async-generator-functions": "^7.7.4", - "@babel/plugin-proposal-dynamic-import": "^7.7.4", - "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.7", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-optional-chaining": "^7.7.5", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", - "@babel/plugin-syntax-async-generators": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.7.4", - "@babel/plugin-syntax-json-strings": "^7.7.4", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", - "@babel/plugin-syntax-optional-chaining": "^7.7.4", - "@babel/plugin-syntax-top-level-await": "^7.7.4", - "@babel/plugin-transform-arrow-functions": "^7.7.4", - "@babel/plugin-transform-async-to-generator": "^7.7.4", - "@babel/plugin-transform-block-scoped-functions": "^7.7.4", - "@babel/plugin-transform-block-scoping": "^7.7.4", - "@babel/plugin-transform-classes": "^7.7.4", - "@babel/plugin-transform-computed-properties": "^7.7.4", - "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.7", - "@babel/plugin-transform-duplicate-keys": "^7.7.4", - "@babel/plugin-transform-exponentiation-operator": "^7.7.4", - "@babel/plugin-transform-for-of": "^7.7.4", - "@babel/plugin-transform-function-name": "^7.7.4", - "@babel/plugin-transform-literals": "^7.7.4", - "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.5", - "@babel/plugin-transform-modules-commonjs": "^7.7.5", - "@babel/plugin-transform-modules-systemjs": "^7.7.4", - "@babel/plugin-transform-modules-umd": "^7.7.4", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", - "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.7", - "@babel/plugin-transform-property-literals": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.5", - "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-shorthand-properties": "^7.7.4", - "@babel/plugin-transform-spread": "^7.7.4", - "@babel/plugin-transform-sticky-regex": "^7.7.4", - "@babel/plugin-transform-template-literals": "^7.7.4", - "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/plugin-transform-unicode-regex": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/compat-data": "^7.8.0", + "@babel/helper-compilation-targets": "^7.8.0", + "@babel/helper-module-imports": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-proposal-async-generator-functions": "^7.8.0", + "@babel/plugin-proposal-dynamic-import": "^7.8.0", + "@babel/plugin-proposal-json-strings": "^7.8.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-proposal-object-rest-spread": "^7.8.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.0", + "@babel/plugin-proposal-optional-chaining": "^7.8.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.0", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.0", + "@babel/plugin-transform-arrow-functions": "^7.8.0", + "@babel/plugin-transform-async-to-generator": "^7.8.0", + "@babel/plugin-transform-block-scoped-functions": "^7.8.0", + "@babel/plugin-transform-block-scoping": "^7.8.0", + "@babel/plugin-transform-classes": "^7.8.0", + "@babel/plugin-transform-computed-properties": "^7.8.0", + "@babel/plugin-transform-destructuring": "^7.8.0", + "@babel/plugin-transform-dotall-regex": "^7.8.0", + "@babel/plugin-transform-duplicate-keys": "^7.8.0", + "@babel/plugin-transform-exponentiation-operator": "^7.8.0", + "@babel/plugin-transform-for-of": "^7.8.0", + "@babel/plugin-transform-function-name": "^7.8.0", + "@babel/plugin-transform-literals": "^7.8.0", + "@babel/plugin-transform-member-expression-literals": "^7.8.0", + "@babel/plugin-transform-modules-amd": "^7.8.0", + "@babel/plugin-transform-modules-commonjs": "^7.8.0", + "@babel/plugin-transform-modules-systemjs": "^7.8.0", + "@babel/plugin-transform-modules-umd": "^7.8.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.0", + "@babel/plugin-transform-new-target": "^7.8.0", + "@babel/plugin-transform-object-super": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.8.0", + "@babel/plugin-transform-property-literals": "^7.8.0", + "@babel/plugin-transform-regenerator": "^7.8.0", + "@babel/plugin-transform-reserved-words": "^7.8.0", + "@babel/plugin-transform-shorthand-properties": "^7.8.0", + "@babel/plugin-transform-spread": "^7.8.0", + "@babel/plugin-transform-sticky-regex": "^7.8.0", + "@babel/plugin-transform-template-literals": "^7.8.0", + "@babel/plugin-transform-typeof-symbol": "^7.8.0", + "@babel/plugin-transform-unicode-regex": "^7.8.0", + "@babel/types": "^7.8.0", "browserslist": "^4.8.2", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", @@ -74,10 +74,10 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/cli": "^7.7.7", - "@babel/core": "^7.7.7", - "@babel/helper-fixtures": "^7.6.3", - "@babel/helper-plugin-test-runner": "^7.7.4", + "@babel/cli": "^7.8.0", + "@babel/core": "^7.8.0", + "@babel/helper-fixtures": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", "@babel/plugin-syntax-dynamic-import": "^7.2.0" } } diff --git a/packages/babel-preset-flow/package.json b/packages/babel-preset-flow/package.json index 187a3e9d0d25..9e7efd556e0e 100644 --- a/packages/babel-preset-flow/package.json +++ b/packages/babel-preset-flow/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-flow", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel preset for all Flow plugins.", "author": "James Kyle ", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-flow", @@ -17,14 +17,14 @@ "types" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-flow-strip-types": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-transform-flow-strip-types": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index f0c1394437b0..6420620f142f 100644 --- a/packages/babel-preset-react/package.json +++ b/packages/babel-preset-react/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-react", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel preset for all React plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,18 +12,18 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-react", "main": "lib/index.js", "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-react-display-name": "^7.7.4", - "@babel/plugin-transform-react-jsx": "^7.7.4", - "@babel/plugin-transform-react-jsx-self": "^7.7.4", - "@babel/plugin-transform-react-jsx-source": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-transform-react-display-name": "^7.8.0", + "@babel/plugin-transform-react-jsx": "^7.8.0", + "@babel/plugin-transform-react-jsx-self": "^7.8.0", + "@babel/plugin-transform-react-jsx-source": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.4", - "@babel/helper-plugin-test-runner": "^7.7.4", - "@babel/helper-transform-fixture-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0", + "@babel/helper-transform-fixture-test-runner": "^7.8.0" } } diff --git a/packages/babel-preset-stage-0/package.json b/packages/babel-preset-stage-0/package.json index 0ecff050472e..ca1b2402c2dd 100644 --- a/packages/babel-preset-stage-0/package.json +++ b/packages/babel-preset-stage-0/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-stage-0", - "version": "7.0.0", + "version": "7.8.0", "description": "Babel preset for stage 0 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-stage-1/package.json b/packages/babel-preset-stage-1/package.json index 65e776b3e94e..a06208115007 100644 --- a/packages/babel-preset-stage-1/package.json +++ b/packages/babel-preset-stage-1/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-stage-1", - "version": "7.0.0", + "version": "7.8.0", "description": "Babel preset for stage 1 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-stage-2/package.json b/packages/babel-preset-stage-2/package.json index ac6458862919..b256e566ed1f 100644 --- a/packages/babel-preset-stage-2/package.json +++ b/packages/babel-preset-stage-2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-stage-2", - "version": "7.0.0", + "version": "7.8.0", "description": "Babel preset for stage 2 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-stage-3/package.json b/packages/babel-preset-stage-3/package.json index f49fae806ff4..10b4b25fca46 100644 --- a/packages/babel-preset-stage-3/package.json +++ b/packages/babel-preset-stage-3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-stage-3", - "version": "7.0.0", + "version": "7.8.0", "description": "Babel preset for stage 3 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index cf369a725d48..e1613e021628 100644 --- a/packages/babel-preset-typescript/package.json +++ b/packages/babel-preset-typescript/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-typescript", - "version": "7.7.7", + "version": "7.8.0", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -14,14 +14,14 @@ "typescript" ], "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-transform-typescript": "^7.7.4" + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-transform-typescript": "^7.8.0" }, "peerDependencies": { "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index 6d9f68023f11..fe8565806a22 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.7.7", + "version": "7.8.0", "description": "babel require hook", "license": "MIT", "type": "commonjs", @@ -24,8 +24,8 @@ "@babel/core": "^7.0.0-0" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/plugin-transform-modules-commonjs": "^7.7.4", + "@babel/core": "^7.8.0", + "@babel/plugin-transform-modules-commonjs": "^7.8.0", "browserify": "16.5.0", "default-require-extensions": "^2.0.0" } diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index e79006f76f10..7e498ac4d5a8 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs2", - "version": "7.7.7", + "version": "7.8.0", "description": "babel's modular runtime helpers with core-js@2 polyfilling", "license": "MIT", "type": "commonjs", @@ -14,6 +14,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.7.4" + "@babel/helpers": "^7.8.0" } } diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 5065cce5a117..90d8a049322e 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime-corejs3", - "version": "7.7.7", + "version": "7.8.0", "description": "babel's modular runtime helpers with core-js@3 polyfilling", "license": "MIT", "type": "commonjs", diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index d96a7b2a8327..50e83e3a9d6a 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.7.7", + "version": "7.8.0", "description": "babel's modular runtime helpers", "license": "MIT", "type": "commonjs", @@ -18,6 +18,6 @@ "regenerator-runtime": "^0.13.2" }, "devDependencies": { - "@babel/helpers": "^7.7.4" + "@babel/helpers": "^7.8.0" } } diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 4229bfcfb0ce..32809bb98fd4 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.7.7", + "version": "7.8.0", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -11,99 +11,99 @@ "prepublishOnly": "cd ../.. && make prepublish-build-standalone" }, "devDependencies": { - "@babel/core": "^7.7.7", - "@babel/helper-plugin-utils": "^7.0.0", - "@babel/plugin-external-helpers": "^7.7.4", - "@babel/plugin-proposal-async-generator-functions": "^7.7.4", - "@babel/plugin-proposal-class-properties": "^7.7.4", - "@babel/plugin-proposal-decorators": "^7.7.4", - "@babel/plugin-proposal-do-expressions": "^7.7.4", - "@babel/plugin-proposal-dynamic-import": "^7.7.4", - "@babel/plugin-proposal-export-default-from": "^7.7.4", - "@babel/plugin-proposal-export-namespace-from": "^7.7.4", - "@babel/plugin-proposal-function-bind": "^7.7.4", - "@babel/plugin-proposal-function-sent": "^7.7.4", - "@babel/plugin-proposal-json-strings": "^7.7.4", - "@babel/plugin-proposal-logical-assignment-operators": "^7.7.4", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.7.4", - "@babel/plugin-proposal-numeric-separator": "^7.7.4", - "@babel/plugin-proposal-object-rest-spread": "^7.7.7", - "@babel/plugin-proposal-optional-catch-binding": "^7.7.4", - "@babel/plugin-proposal-optional-chaining": "^7.7.5", - "@babel/plugin-proposal-pipeline-operator": "^7.7.7", - "@babel/plugin-proposal-private-methods": "^7.7.4", - "@babel/plugin-proposal-throw-expressions": "^7.7.4", - "@babel/plugin-proposal-unicode-property-regex": "^7.7.7", - "@babel/plugin-syntax-async-generators": "^7.7.4", - "@babel/plugin-syntax-class-properties": "^7.7.4", - "@babel/plugin-syntax-decorators": "^7.7.4", - "@babel/plugin-syntax-do-expressions": "^7.7.4", - "@babel/plugin-syntax-dynamic-import": "^7.7.4", - "@babel/plugin-syntax-export-default-from": "^7.7.4", - "@babel/plugin-syntax-export-namespace-from": "^7.7.4", - "@babel/plugin-syntax-flow": "^7.7.4", - "@babel/plugin-syntax-function-bind": "^7.7.4", - "@babel/plugin-syntax-function-sent": "^7.7.4", - "@babel/plugin-syntax-import-meta": "^7.7.4", - "@babel/plugin-syntax-jsx": "^7.7.4", - "@babel/plugin-syntax-object-rest-spread": "^7.7.4", - "@babel/plugin-syntax-optional-catch-binding": "^7.7.4", - "@babel/plugin-syntax-pipeline-operator": "^7.7.7", - "@babel/plugin-syntax-top-level-await": "^7.7.4", - "@babel/plugin-syntax-typescript": "^7.7.4", - "@babel/plugin-transform-arrow-functions": "^7.7.4", - "@babel/plugin-transform-async-to-generator": "^7.7.4", - "@babel/plugin-transform-block-scoped-functions": "^7.7.4", - "@babel/plugin-transform-block-scoping": "^7.7.4", - "@babel/plugin-transform-classes": "^7.7.4", - "@babel/plugin-transform-computed-properties": "^7.7.4", - "@babel/plugin-transform-destructuring": "^7.7.4", - "@babel/plugin-transform-dotall-regex": "^7.7.7", - "@babel/plugin-transform-duplicate-keys": "^7.7.4", - "@babel/plugin-transform-exponentiation-operator": "^7.7.4", - "@babel/plugin-transform-flow-comments": "^7.7.4", - "@babel/plugin-transform-flow-strip-types": "^7.7.4", - "@babel/plugin-transform-for-of": "^7.7.4", - "@babel/plugin-transform-function-name": "^7.7.4", - "@babel/plugin-transform-instanceof": "^7.7.4", - "@babel/plugin-transform-jscript": "^7.7.4", - "@babel/plugin-transform-literals": "^7.7.4", - "@babel/plugin-transform-member-expression-literals": "^7.7.4", - "@babel/plugin-transform-modules-amd": "^7.7.5", - "@babel/plugin-transform-modules-commonjs": "^7.7.5", - "@babel/plugin-transform-modules-systemjs": "^7.7.4", - "@babel/plugin-transform-modules-umd": "^7.7.4", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.7.4", - "@babel/plugin-transform-new-target": "^7.7.4", - "@babel/plugin-transform-object-assign": "^7.7.4", - "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.7.4", - "@babel/plugin-transform-object-super": "^7.7.4", - "@babel/plugin-transform-parameters": "^7.7.7", - "@babel/plugin-transform-property-literals": "^7.7.4", - "@babel/plugin-transform-property-mutators": "^7.7.4", - "@babel/plugin-transform-proto-to-assign": "^7.7.4", - "@babel/plugin-transform-react-constant-elements": "^7.7.4", - "@babel/plugin-transform-react-display-name": "^7.7.4", - "@babel/plugin-transform-react-inline-elements": "^7.7.4", - "@babel/plugin-transform-react-jsx": "^7.7.7", - "@babel/plugin-transform-react-jsx-compat": "^7.7.4", - "@babel/plugin-transform-react-jsx-self": "^7.7.4", - "@babel/plugin-transform-react-jsx-source": "^7.7.4", - "@babel/plugin-transform-regenerator": "^7.7.5", - "@babel/plugin-transform-reserved-words": "^7.7.4", - "@babel/plugin-transform-runtime": "^7.7.6", - "@babel/plugin-transform-shorthand-properties": "^7.7.4", - "@babel/plugin-transform-spread": "^7.7.4", - "@babel/plugin-transform-sticky-regex": "^7.7.4", - "@babel/plugin-transform-strict-mode": "^7.7.4", - "@babel/plugin-transform-template-literals": "^7.7.4", - "@babel/plugin-transform-typeof-symbol": "^7.7.4", - "@babel/plugin-transform-typescript": "^7.7.4", - "@babel/plugin-transform-unicode-regex": "^7.7.4", - "@babel/preset-env": "^7.7.4", - "@babel/preset-flow": "^7.7.4", - "@babel/preset-react": "^7.7.4", - "@babel/preset-typescript": "^7.7.7" + "@babel/core": "^7.8.0", + "@babel/helper-plugin-utils": "^7.8.0", + "@babel/plugin-external-helpers": "^7.8.0", + "@babel/plugin-proposal-async-generator-functions": "^7.8.0", + "@babel/plugin-proposal-class-properties": "^7.8.0", + "@babel/plugin-proposal-decorators": "^7.8.0", + "@babel/plugin-proposal-do-expressions": "^7.8.0", + "@babel/plugin-proposal-dynamic-import": "^7.8.0", + "@babel/plugin-proposal-export-default-from": "^7.8.0", + "@babel/plugin-proposal-export-namespace-from": "^7.8.0", + "@babel/plugin-proposal-function-bind": "^7.8.0", + "@babel/plugin-proposal-function-sent": "^7.8.0", + "@babel/plugin-proposal-json-strings": "^7.8.0", + "@babel/plugin-proposal-logical-assignment-operators": "^7.8.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-proposal-numeric-separator": "^7.8.0", + "@babel/plugin-proposal-object-rest-spread": "^7.8.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.8.0", + "@babel/plugin-proposal-optional-chaining": "^7.8.0", + "@babel/plugin-proposal-pipeline-operator": "^7.8.0", + "@babel/plugin-proposal-private-methods": "^7.8.0", + "@babel/plugin-proposal-throw-expressions": "^7.8.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.8.0", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.8.0", + "@babel/plugin-syntax-decorators": "^7.8.0", + "@babel/plugin-syntax-do-expressions": "^7.8.0", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-export-default-from": "^7.8.0", + "@babel/plugin-syntax-export-namespace-from": "^7.8.0", + "@babel/plugin-syntax-flow": "^7.8.0", + "@babel/plugin-syntax-function-bind": "^7.8.0", + "@babel/plugin-syntax-function-sent": "^7.8.0", + "@babel/plugin-syntax-import-meta": "^7.8.0", + "@babel/plugin-syntax-jsx": "^7.8.0", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-pipeline-operator": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.8.0", + "@babel/plugin-syntax-typescript": "^7.8.0", + "@babel/plugin-transform-arrow-functions": "^7.8.0", + "@babel/plugin-transform-async-to-generator": "^7.8.0", + "@babel/plugin-transform-block-scoped-functions": "^7.8.0", + "@babel/plugin-transform-block-scoping": "^7.8.0", + "@babel/plugin-transform-classes": "^7.8.0", + "@babel/plugin-transform-computed-properties": "^7.8.0", + "@babel/plugin-transform-destructuring": "^7.8.0", + "@babel/plugin-transform-dotall-regex": "^7.8.0", + "@babel/plugin-transform-duplicate-keys": "^7.8.0", + "@babel/plugin-transform-exponentiation-operator": "^7.8.0", + "@babel/plugin-transform-flow-comments": "^7.8.0", + "@babel/plugin-transform-flow-strip-types": "^7.8.0", + "@babel/plugin-transform-for-of": "^7.8.0", + "@babel/plugin-transform-function-name": "^7.8.0", + "@babel/plugin-transform-instanceof": "^7.8.0", + "@babel/plugin-transform-jscript": "^7.8.0", + "@babel/plugin-transform-literals": "^7.8.0", + "@babel/plugin-transform-member-expression-literals": "^7.8.0", + "@babel/plugin-transform-modules-amd": "^7.8.0", + "@babel/plugin-transform-modules-commonjs": "^7.8.0", + "@babel/plugin-transform-modules-systemjs": "^7.8.0", + "@babel/plugin-transform-modules-umd": "^7.8.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.0", + "@babel/plugin-transform-new-target": "^7.8.0", + "@babel/plugin-transform-object-assign": "^7.8.0", + "@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.8.0", + "@babel/plugin-transform-object-super": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.8.0", + "@babel/plugin-transform-property-literals": "^7.8.0", + "@babel/plugin-transform-property-mutators": "^7.8.0", + "@babel/plugin-transform-proto-to-assign": "^7.8.0", + "@babel/plugin-transform-react-constant-elements": "^7.8.0", + "@babel/plugin-transform-react-display-name": "^7.8.0", + "@babel/plugin-transform-react-inline-elements": "^7.8.0", + "@babel/plugin-transform-react-jsx": "^7.8.0", + "@babel/plugin-transform-react-jsx-compat": "^7.8.0", + "@babel/plugin-transform-react-jsx-self": "^7.8.0", + "@babel/plugin-transform-react-jsx-source": "^7.8.0", + "@babel/plugin-transform-regenerator": "^7.8.0", + "@babel/plugin-transform-reserved-words": "^7.8.0", + "@babel/plugin-transform-runtime": "^7.8.0", + "@babel/plugin-transform-shorthand-properties": "^7.8.0", + "@babel/plugin-transform-spread": "^7.8.0", + "@babel/plugin-transform-sticky-regex": "^7.8.0", + "@babel/plugin-transform-strict-mode": "^7.8.0", + "@babel/plugin-transform-template-literals": "^7.8.0", + "@babel/plugin-transform-typeof-symbol": "^7.8.0", + "@babel/plugin-transform-typescript": "^7.8.0", + "@babel/plugin-transform-unicode-regex": "^7.8.0", + "@babel/preset-env": "^7.8.0", + "@babel/preset-flow": "^7.8.0", + "@babel/preset-react": "^7.8.0", + "@babel/preset-typescript": "^7.8.0" }, "keywords": [ "babel", diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index 30dd8b8a57bf..ab0412cf03ef 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -1,6 +1,6 @@ { "name": "@babel/template", - "version": "7.7.4", + "version": "7.8.0", "description": "Generate an AST from a string template.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,8 +12,8 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-template", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4" + "@babel/code-frame": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/types": "^7.8.0" } } diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 9e1c2a200fd2..08747752a202 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.7.4", + "version": "7.8.0", "description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -12,17 +12,17 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-traverse", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "^7.5.5", - "@babel/generator": "^7.7.4", - "@babel/helper-function-name": "^7.7.4", - "@babel/helper-split-export-declaration": "^7.7.4", - "@babel/parser": "^7.7.4", - "@babel/types": "^7.7.4", + "@babel/code-frame": "^7.8.0", + "@babel/generator": "^7.8.0", + "@babel/helper-function-name": "^7.8.0", + "@babel/helper-split-export-declaration": "^7.8.0", + "@babel/parser": "^7.8.0", + "@babel/types": "^7.8.0", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "^7.7.4" + "@babel/helper-plugin-test-runner": "^7.8.0" } } diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 33b0b4f81512..cc12e41d35b7 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.7.4", + "version": "7.8.0", "description": "Babel Types is a Lodash-esque utility library for AST nodes", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -18,7 +18,7 @@ "to-fast-properties": "^2.0.0" }, "devDependencies": { - "@babel/generator": "^7.7.4", - "@babel/parser": "^7.7.4" + "@babel/generator": "^7.8.0", + "@babel/parser": "^7.8.0" } } From 9647560dd6c83b9b35f81844e135351a83cdf0e3 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Sun, 12 Jan 2020 00:27:36 +0000 Subject: [PATCH 947/965] Add v7.8.0 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 107 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 884ce9967f78..b52d15feca3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,113 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.8.0 (2020-01-12) + +#### :eyeglasses: Spec Compliance +* `babel-parser` + * [#10980](https://github.com/babel/babel/pull/10980) Disallow private name in object elements and TS type elements ([@JLHwung](https://github.com/JLHwung)) + * [#10955](https://github.com/babel/babel/pull/10955) LiteralPropertyName should allow BigIntLiteral ([@JLHwung](https://github.com/JLHwung)) + * [#10953](https://github.com/babel/babel/pull/10953) fix: check await when parsing AsyncArrowBindingIdentifier ([@JLHwung](https://github.com/JLHwung)) + * [#10947](https://github.com/babel/babel/pull/10947) Fix: TopLevelAwait should respect await identifiers defined in sub scope. ([@JLHwung](https://github.com/JLHwung)) + * [#10946](https://github.com/babel/babel/pull/10946) fix: Class Field Initializer should not allow await expression as immediate child ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-proposal-numeric-separator` + * [#10938](https://github.com/babel/babel/pull/10938) StringNumericLiteral does not include NumericLiteralSeparator ([@JLHwung](https://github.com/JLHwung)) +* `babel-generator`, `babel-parser`, `babel-plugin-proposal-private-methods` + * [#10456](https://github.com/babel/babel/pull/10456) [parser] Disallow duplicate and undeclared private names ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :boom: Breaking Change +* `babel-types` + * [#10917](https://github.com/babel/babel/pull/10917) (opt-in) Improve @babel/types with env.BABEL_TYPES_8_BREAKING ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + +#### :rocket: New Feature +* `babel-standalone` + * [#10821](https://github.com/babel/babel/pull/10821) Merge env-standalone to babel-standalone ([@JLHwung](https://github.com/JLHwung)) +* `babel-core` + * [#10783](https://github.com/babel/babel/pull/10783) Add babelrc.json support ([@yordis](https://github.com/yordis)) + * [#10903](https://github.com/babel/babel/pull/10903) Add support for babel.config.mjs and .babelrc.mjs ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-compat-data`, `babel-preset-env-standalone`, `babel-preset-env` + * [#10811](https://github.com/babel/babel/pull/10811) Add optional-chaining and nullish-coalescing to preset-env ([@Druotic](https://github.com/Druotic)) +* `babel-helper-module-transforms`, `babel-plugin-transform-modules-systemjs` + * [#10780](https://github.com/babel/babel/pull/10780) add `allowTopLevelThis` option to `transform-modules-systemjs` ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10817](https://github.com/babel/babel/pull/10817) enable optional chaining by default in @babel/parser ([@jackisherwood](https://github.com/jackisherwood)) +* `babel-cli` + * [#10887](https://github.com/babel/babel/pull/10887) --copy-ignored flag added to CLI ([@rajasekarm](https://github.com/rajasekarm)) + * [#9144](https://github.com/babel/babel/pull/9144) Add --out-file-extension option to babel-cli ([@eps1lon](https://github.com/eps1lon)) +* `babel-core`, `babel-generator`, `babel-parser` + * [#10819](https://github.com/babel/babel/pull/10819) Enable nullish coalescing by default in @babel/parser ([@layershifter](https://github.com/layershifter)) +* `babel-core`, `babel-parser` + * [#10843](https://github.com/babel/babel/pull/10843) [parser] enable dynamic import by default ([@AbdulAli19](https://github.com/AbdulAli19)) + +#### :bug: Bug Fix +* `babel-node` + * [#10763](https://github.com/babel/babel/pull/10763) Filename detection should respect short flags ([@JLHwung](https://github.com/JLHwung)) +* `babel-plugin-proposal-numeric-separator` + * [#10938](https://github.com/babel/babel/pull/10938) StringNumericLiteral does not include NumericLiteralSeparator ([@JLHwung](https://github.com/JLHwung)) +* `babel-preset-env` + * [#10790](https://github.com/babel/babel/pull/10790) Use chrome data when android is absent ([@JLHwung](https://github.com/JLHwung)) + * [#10930](https://github.com/babel/babel/pull/10930) fix: Promise.any requires global.AggregateError ([@JLHwung](https://github.com/JLHwung)) +* `babel-parser` + * [#10944](https://github.com/babel/babel/pull/10944) When reading a new string, U+2028/2029 should correctly set the new column ([@JLHwung](https://github.com/JLHwung)) + * [#10937](https://github.com/babel/babel/pull/10937) Refactor parseSubscript ([@JLHwung](https://github.com/JLHwung)) + * [#10901](https://github.com/babel/babel/pull/10901) fix: lost leading comment after named import ([@elevatebart](https://github.com/elevatebart)) +* Other + * [#10913](https://github.com/babel/babel/pull/10913) @babel/eslint-parser: update scope analysis for ClassPrivateProperty ([@kaicataldo](https://github.com/kaicataldo)) +* `babel-traverse` + * [#10949](https://github.com/babel/babel/pull/10949) Override toString in case this function is printed ([@jayenashar](https://github.com/jayenashar)) +* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs` + * [#10934](https://github.com/babel/babel/pull/10934) helper-module-transforms: dereference imported template tag ([@ajafff](https://github.com/ajafff)) +* `babel-traverse`, `babel-types` + * [#10912](https://github.com/babel/babel/pull/10912) Fix parameter expression get binding ([@JLHwung](https://github.com/JLHwung)) +* `babel-core` + * [#10914](https://github.com/babel/babel/pull/10914) @babel-core: parse should parse only ([@kaicataldo](https://github.com/kaicataldo)) +* `babel-helpers` + * [#10902](https://github.com/babel/babel/pull/10902) fix: Object.getOwnPropertySymbols called on non-object ([@bassaer](https://github.com/bassaer)) + +#### :nail_care: Polish +* `babel-node` + * [#9695](https://github.com/babel/babel/pull/9695) Use `babel > ` as prompt in babel-node ([@ZYSzys](https://github.com/ZYSzys)) +* `babel-parser` + * [#10906](https://github.com/babel/babel/pull/10906) refactor: remove inClassProperty parser state ([@JLHwung](https://github.com/JLHwung)) + +#### :memo: Documentation +* `babel-preset-env` + * [#10982](https://github.com/babel/babel/pull/10982) CONTRIBUTING: Update link to plugin-features.js [skip ci] ([@andersk](https://github.com/andersk)) +* Other + * [#10973](https://github.com/babel/babel/pull/10973) Added instructions to fork the repo in order to setup. ([@sidntrivedi012](https://github.com/sidntrivedi012)) + +#### :house: Internal +* `babel-preset-env` + * [#10983](https://github.com/babel/babel/pull/10983) chore: update corejs fixtures ([@JLHwung](https://github.com/JLHwung)) + * [#10974](https://github.com/babel/babel/pull/10974) chore: update caniuse-usage Chrome 49 related fixtures ([@JLHwung](https://github.com/JLHwung)) + * [#10924](https://github.com/babel/babel/pull/10924) Replace custom "findSuggestion" function with "levenary" ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-core` + * [#10507](https://github.com/babel/babel/pull/10507) Prepare @babel/core for asynchronicity ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* Other + * [#10979](https://github.com/babel/babel/pull/10979) Reduce false negative cases of typescript parser tests ([@JLHwung](https://github.com/JLHwung)) + * [#10976](https://github.com/babel/babel/pull/10976) Update Test262, Flow and TS parser tests ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10964](https://github.com/babel/babel/pull/10964) Bump coverage target from 80% to 90% ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) + * [#10958](https://github.com/babel/babel/pull/10958) Fix recent e2e-vuejs-cli error ([@JLHwung](https://github.com/JLHwung)) + * [#10919](https://github.com/babel/babel/pull/10919) Add integration test: e2e-vue-cli ([@JLHwung](https://github.com/JLHwung)) + * [#10943](https://github.com/babel/babel/pull/10943) chore: update test262 ([@JLHwung](https://github.com/JLHwung)) + * [#10918](https://github.com/babel/babel/pull/10918) chore: refine e2e test scripts ([@JLHwung](https://github.com/JLHwung)) + * [#10916](https://github.com/babel/babel/pull/10916) @babel/eslint-parser: Refactor ([@kaicataldo](https://github.com/kaicataldo)) + * [#10905](https://github.com/babel/babel/pull/10905) chore: separate build-standalone with coverage ([@JLHwung](https://github.com/JLHwung)) + * [#10898](https://github.com/babel/babel/pull/10898) Move coverage to GitHub actions ([@JLHwung](https://github.com/JLHwung)) +* `babel-cli`, `babel-code-frame`, `babel-core`, `babel-generator`, `babel-helper-annotate-as-pure`, `babel-helper-bindify-decorators`, `babel-helper-builder-binary-assignment-operator-visitor`, `babel-helper-builder-react-jsx`, `babel-helper-call-delegate`, `babel-helper-create-class-features-plugin`, `babel-helper-create-regexp-features-plugin`, `babel-helper-define-map`, `babel-helper-explode-assignable-expression`, `babel-helper-explode-class`, `babel-helper-fixtures`, `babel-helper-function-name`, `babel-helper-get-function-arity`, `babel-helper-hoist-variables`, `babel-helper-member-expression-to-functions`, `babel-helper-module-imports`, `babel-helper-module-transforms`, `babel-helper-optimise-call-expression`, `babel-helper-plugin-test-runner`, `babel-helper-plugin-utils`, `babel-helper-regex`, `babel-helper-remap-async-to-generator`, `babel-helper-replace-supers`, `babel-helper-simple-access`, `babel-helper-split-export-declaration`, `babel-helper-transform-fixture-test-runner`, `babel-helper-wrap-function`, `babel-helpers`, `babel-highlight`, `babel-node`, `babel-parser`, `babel-plugin-external-helpers`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-do-expressions`, `babel-plugin-proposal-dynamic-import`, `babel-plugin-proposal-export-default-from`, `babel-plugin-proposal-export-namespace-from`, `babel-plugin-proposal-function-bind`, `babel-plugin-proposal-function-sent`, `babel-plugin-proposal-json-strings`, `babel-plugin-proposal-logical-assignment-operators`, `babel-plugin-proposal-nullish-coalescing-operator`, `babel-plugin-proposal-numeric-separator`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-proposal-optional-catch-binding`, `babel-plugin-proposal-optional-chaining`, `babel-plugin-proposal-partial-application`, `babel-plugin-proposal-pipeline-operator`, `babel-plugin-proposal-private-methods`, `babel-plugin-proposal-throw-expressions`, `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-syntax-async-generators`, `babel-plugin-syntax-bigint`, `babel-plugin-syntax-class-properties`, `babel-plugin-syntax-decorators`, `babel-plugin-syntax-do-expressions`, `babel-plugin-syntax-dynamic-import`, `babel-plugin-syntax-export-default-from`, `babel-plugin-syntax-export-namespace-from`, `babel-plugin-syntax-flow`, `babel-plugin-syntax-function-bind`, `babel-plugin-syntax-function-sent`, `babel-plugin-syntax-import-meta`, `babel-plugin-syntax-json-strings`, `babel-plugin-syntax-jsx`, `babel-plugin-syntax-logical-assignment-operators`, `babel-plugin-syntax-nullish-coalescing-operator`, `babel-plugin-syntax-numeric-separator`, `babel-plugin-syntax-object-rest-spread`, `babel-plugin-syntax-optional-catch-binding`, `babel-plugin-syntax-optional-chaining`, `babel-plugin-syntax-partial-application`, `babel-plugin-syntax-pipeline-operator`, `babel-plugin-syntax-throw-expressions`, `babel-plugin-syntax-top-level-await`, `babel-plugin-syntax-typescript`, `babel-plugin-transform-arrow-functions`, `babel-plugin-transform-async-to-generator`, `babel-plugin-transform-block-scoped-functions`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-classes`, `babel-plugin-transform-computed-properties`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-duplicate-keys`, `babel-plugin-transform-exponentiation-operator`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-for-of`, `babel-plugin-transform-function-name`, `babel-plugin-transform-instanceof`, `babel-plugin-transform-jscript`, `babel-plugin-transform-literals`, `babel-plugin-transform-member-expression-literals`, `babel-plugin-transform-modules-amd`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`, `babel-plugin-transform-modules-umd`, `babel-plugin-transform-named-capturing-groups-regex`, `babel-plugin-transform-new-target`, `babel-plugin-transform-object-assign`, `babel-plugin-transform-object-set-prototype-of-to-assign`, `babel-plugin-transform-object-super`, `babel-plugin-transform-parameters`, `babel-plugin-transform-property-literals`, `babel-plugin-transform-property-mutators`, `babel-plugin-transform-proto-to-assign`, `babel-plugin-transform-react-constant-elements`, `babel-plugin-transform-react-display-name`, `babel-plugin-transform-react-inline-elements`, `babel-plugin-transform-react-jsx-compat`, `babel-plugin-transform-react-jsx-self`, `babel-plugin-transform-react-jsx-source`, `babel-plugin-transform-react-jsx`, `babel-plugin-transform-regenerator`, `babel-plugin-transform-reserved-words`, `babel-plugin-transform-runtime`, `babel-plugin-transform-shorthand-properties`, `babel-plugin-transform-spread`, `babel-plugin-transform-sticky-regex`, `babel-plugin-transform-strict-mode`, `babel-plugin-transform-template-literals`, `babel-plugin-transform-typeof-symbol`, `babel-plugin-transform-typescript`, `babel-plugin-transform-unicode-regex`, `babel-polyfill`, `babel-preset-env`, `babel-preset-flow`, `babel-preset-react`, `babel-preset-stage-0`, `babel-preset-stage-1`, `babel-preset-stage-2`, `babel-preset-stage-3`, `babel-preset-typescript`, `babel-register`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`, `babel-template`, `babel-traverse`, `babel-types` + * [#10849](https://github.com/babel/babel/pull/10849) chore: specify package type [skip-ci] ([@JLHwung](https://github.com/JLHwung)) +* `babel-compat-data`, `babel-helper-compilation-targets`, `babel-preset-env` + * [#10899](https://github.com/babel/babel/pull/10899) Extract targets parser and compat data from preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) +* `babel-parser` + * [#10950](https://github.com/babel/babel/pull/10950) test: add invalid-lone-import test ([@JLHwung](https://github.com/JLHwung)) + * [#10936](https://github.com/babel/babel/pull/10936) refactor: remove unecessary checkYieldAwaitInDefaultParams ([@JLHwung](https://github.com/JLHwung)) + * [#10935](https://github.com/babel/babel/pull/10935) refactor: remove unused invalidTemplateEscapePosition tokenizer state ([@JLHwung](https://github.com/JLHwung)) + * [#10939](https://github.com/babel/babel/pull/10939) TSTypeCastExpression should not be inside call parameters ([@JLHwung](https://github.com/JLHwung)) + * [#10942](https://github.com/babel/babel/pull/10942) Remove unused parser methods ([@JLHwung](https://github.com/JLHwung)) + +#### :leftwards_arrow_with_hook: Revert +* `babel-cli` + * [#10923](https://github.com/babel/babel/pull/10923) fix: minified should not accept optional argument ([@JLHwung](https://github.com/JLHwung)) ## v7.7.7 (2019-12-19) #### :eyeglasses: Spec Compliance From d1c93e7e3e436850741cc0858faf1df1c7a2dd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 12 Jan 2020 01:54:11 +0100 Subject: [PATCH 948/965] Remove ESLint packages from the changelog They are not published --- CHANGELOG.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b52d15feca3b..8f525c7e14af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,8 +69,6 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * [#10944](https://github.com/babel/babel/pull/10944) When reading a new string, U+2028/2029 should correctly set the new column ([@JLHwung](https://github.com/JLHwung)) * [#10937](https://github.com/babel/babel/pull/10937) Refactor parseSubscript ([@JLHwung](https://github.com/JLHwung)) * [#10901](https://github.com/babel/babel/pull/10901) fix: lost leading comment after named import ([@elevatebart](https://github.com/elevatebart)) -* Other - * [#10913](https://github.com/babel/babel/pull/10913) @babel/eslint-parser: update scope analysis for ClassPrivateProperty ([@kaicataldo](https://github.com/kaicataldo)) * `babel-traverse` * [#10949](https://github.com/babel/babel/pull/10949) Override toString in case this function is printed ([@jayenashar](https://github.com/jayenashar)) * `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs` @@ -109,11 +107,8 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * [#10919](https://github.com/babel/babel/pull/10919) Add integration test: e2e-vue-cli ([@JLHwung](https://github.com/JLHwung)) * [#10943](https://github.com/babel/babel/pull/10943) chore: update test262 ([@JLHwung](https://github.com/JLHwung)) * [#10918](https://github.com/babel/babel/pull/10918) chore: refine e2e test scripts ([@JLHwung](https://github.com/JLHwung)) - * [#10916](https://github.com/babel/babel/pull/10916) @babel/eslint-parser: Refactor ([@kaicataldo](https://github.com/kaicataldo)) * [#10905](https://github.com/babel/babel/pull/10905) chore: separate build-standalone with coverage ([@JLHwung](https://github.com/JLHwung)) * [#10898](https://github.com/babel/babel/pull/10898) Move coverage to GitHub actions ([@JLHwung](https://github.com/JLHwung)) -* `babel-cli`, `babel-code-frame`, `babel-core`, `babel-generator`, `babel-helper-annotate-as-pure`, `babel-helper-bindify-decorators`, `babel-helper-builder-binary-assignment-operator-visitor`, `babel-helper-builder-react-jsx`, `babel-helper-call-delegate`, `babel-helper-create-class-features-plugin`, `babel-helper-create-regexp-features-plugin`, `babel-helper-define-map`, `babel-helper-explode-assignable-expression`, `babel-helper-explode-class`, `babel-helper-fixtures`, `babel-helper-function-name`, `babel-helper-get-function-arity`, `babel-helper-hoist-variables`, `babel-helper-member-expression-to-functions`, `babel-helper-module-imports`, `babel-helper-module-transforms`, `babel-helper-optimise-call-expression`, `babel-helper-plugin-test-runner`, `babel-helper-plugin-utils`, `babel-helper-regex`, `babel-helper-remap-async-to-generator`, `babel-helper-replace-supers`, `babel-helper-simple-access`, `babel-helper-split-export-declaration`, `babel-helper-transform-fixture-test-runner`, `babel-helper-wrap-function`, `babel-helpers`, `babel-highlight`, `babel-node`, `babel-parser`, `babel-plugin-external-helpers`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-do-expressions`, `babel-plugin-proposal-dynamic-import`, `babel-plugin-proposal-export-default-from`, `babel-plugin-proposal-export-namespace-from`, `babel-plugin-proposal-function-bind`, `babel-plugin-proposal-function-sent`, `babel-plugin-proposal-json-strings`, `babel-plugin-proposal-logical-assignment-operators`, `babel-plugin-proposal-nullish-coalescing-operator`, `babel-plugin-proposal-numeric-separator`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-proposal-optional-catch-binding`, `babel-plugin-proposal-optional-chaining`, `babel-plugin-proposal-partial-application`, `babel-plugin-proposal-pipeline-operator`, `babel-plugin-proposal-private-methods`, `babel-plugin-proposal-throw-expressions`, `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-syntax-async-generators`, `babel-plugin-syntax-bigint`, `babel-plugin-syntax-class-properties`, `babel-plugin-syntax-decorators`, `babel-plugin-syntax-do-expressions`, `babel-plugin-syntax-dynamic-import`, `babel-plugin-syntax-export-default-from`, `babel-plugin-syntax-export-namespace-from`, `babel-plugin-syntax-flow`, `babel-plugin-syntax-function-bind`, `babel-plugin-syntax-function-sent`, `babel-plugin-syntax-import-meta`, `babel-plugin-syntax-json-strings`, `babel-plugin-syntax-jsx`, `babel-plugin-syntax-logical-assignment-operators`, `babel-plugin-syntax-nullish-coalescing-operator`, `babel-plugin-syntax-numeric-separator`, `babel-plugin-syntax-object-rest-spread`, `babel-plugin-syntax-optional-catch-binding`, `babel-plugin-syntax-optional-chaining`, `babel-plugin-syntax-partial-application`, `babel-plugin-syntax-pipeline-operator`, `babel-plugin-syntax-throw-expressions`, `babel-plugin-syntax-top-level-await`, `babel-plugin-syntax-typescript`, `babel-plugin-transform-arrow-functions`, `babel-plugin-transform-async-to-generator`, `babel-plugin-transform-block-scoped-functions`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-classes`, `babel-plugin-transform-computed-properties`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-duplicate-keys`, `babel-plugin-transform-exponentiation-operator`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-for-of`, `babel-plugin-transform-function-name`, `babel-plugin-transform-instanceof`, `babel-plugin-transform-jscript`, `babel-plugin-transform-literals`, `babel-plugin-transform-member-expression-literals`, `babel-plugin-transform-modules-amd`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`, `babel-plugin-transform-modules-umd`, `babel-plugin-transform-named-capturing-groups-regex`, `babel-plugin-transform-new-target`, `babel-plugin-transform-object-assign`, `babel-plugin-transform-object-set-prototype-of-to-assign`, `babel-plugin-transform-object-super`, `babel-plugin-transform-parameters`, `babel-plugin-transform-property-literals`, `babel-plugin-transform-property-mutators`, `babel-plugin-transform-proto-to-assign`, `babel-plugin-transform-react-constant-elements`, `babel-plugin-transform-react-display-name`, `babel-plugin-transform-react-inline-elements`, `babel-plugin-transform-react-jsx-compat`, `babel-plugin-transform-react-jsx-self`, `babel-plugin-transform-react-jsx-source`, `babel-plugin-transform-react-jsx`, `babel-plugin-transform-regenerator`, `babel-plugin-transform-reserved-words`, `babel-plugin-transform-runtime`, `babel-plugin-transform-shorthand-properties`, `babel-plugin-transform-spread`, `babel-plugin-transform-sticky-regex`, `babel-plugin-transform-strict-mode`, `babel-plugin-transform-template-literals`, `babel-plugin-transform-typeof-symbol`, `babel-plugin-transform-typescript`, `babel-plugin-transform-unicode-regex`, `babel-polyfill`, `babel-preset-env`, `babel-preset-flow`, `babel-preset-react`, `babel-preset-stage-0`, `babel-preset-stage-1`, `babel-preset-stage-2`, `babel-preset-stage-3`, `babel-preset-typescript`, `babel-register`, `babel-runtime-corejs2`, `babel-runtime-corejs3`, `babel-runtime`, `babel-template`, `babel-traverse`, `babel-types` - * [#10849](https://github.com/babel/babel/pull/10849) chore: specify package type [skip-ci] ([@JLHwung](https://github.com/JLHwung)) * `babel-compat-data`, `babel-helper-compilation-targets`, `babel-preset-env` * [#10899](https://github.com/babel/babel/pull/10899) Extract targets parser and compat data from preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) * `babel-parser` @@ -122,6 +117,8 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * [#10935](https://github.com/babel/babel/pull/10935) refactor: remove unused invalidTemplateEscapePosition tokenizer state ([@JLHwung](https://github.com/JLHwung)) * [#10939](https://github.com/babel/babel/pull/10939) TSTypeCastExpression should not be inside call parameters ([@JLHwung](https://github.com/JLHwung)) * [#10942](https://github.com/babel/babel/pull/10942) Remove unused parser methods ([@JLHwung](https://github.com/JLHwung)) +* _Every package_ + * [#10849](https://github.com/babel/babel/pull/10849) chore: specify package type [skip-ci] ([@JLHwung](https://github.com/JLHwung)) #### :leftwards_arrow_with_hook: Revert * `babel-cli` @@ -143,8 +140,8 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba * `babel-plugin-transform-parameters` * [#10053](https://github.com/babel/babel/pull/10053) Check shadow variable to identifier in default parameters ([@JLHwung](https://github.com/JLHwung)) * `babel-parser` - * [#10828](https://github.com/babel/babel/pull/10828) @babel/eslint-parser: fix ImportExpression node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) - * [#10827](https://github.com/babel/babel/pull/10827) @babel/eslint-parser: fix BigIntLiteral node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) + * [#10828](https://github.com/babel/babel/pull/10828) @babel/parser: fix ImportExpression node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) + * [#10827](https://github.com/babel/babel/pull/10827) @babel/parser: fix BigIntLiteral node to match ESTree spec ([@kaicataldo](https://github.com/kaicataldo)) #### :nail_care: Polish * `babel-plugin-transform-react-jsx` From 27668377b54fb08f4c475a4c87f5c1bc97e8ddde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 12 Jan 2020 13:56:09 +0100 Subject: [PATCH 949/965] Downgrade semver for compatibility with Node 6 (#10991) --- packages/babel-compat-data/package.json | 2 +- packages/babel-helper-compilation-targets/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-compat-data/package.json b/packages/babel-compat-data/package.json index d0e42ee1ea3d..e751f42d7261 100644 --- a/packages/babel-compat-data/package.json +++ b/packages/babel-compat-data/package.json @@ -25,7 +25,7 @@ "dependencies": { "browserslist": "^4.8.2", "invariant": "^2.2.4", - "semver": "^7.1.1" + "semver": "^5.5.0" }, "devDependencies": { "@babel/helper-compilation-targets": "^7.8.0", diff --git a/packages/babel-helper-compilation-targets/package.json b/packages/babel-helper-compilation-targets/package.json index 23dd71f4d7ea..0032aa9e23ac 100644 --- a/packages/babel-helper-compilation-targets/package.json +++ b/packages/babel-helper-compilation-targets/package.json @@ -20,7 +20,7 @@ "browserslist": "^4.8.2", "invariant": "^2.2.4", "levenary": "^1.1.0", - "semver": "^7.1.1" + "semver": "^5.5.0" }, "peerDependencies": { "@babel/core": "^7.0.0" From 575eeb370efd1a234bd7f124dc6b1f9161f0c161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 12 Jan 2020 13:58:53 +0100 Subject: [PATCH 950/965] v7.8.1 --- lerna.json | 2 +- packages/babel-compat-data/package.json | 4 ++-- packages/babel-helper-compilation-targets/package.json | 4 ++-- packages/babel-standalone/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lerna.json b/lerna.json index 3eddd66bc4c9..676653ed7d75 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.8.0", + "version": "7.8.1", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-compat-data/package.json b/packages/babel-compat-data/package.json index e751f42d7261..824d84bca145 100644 --- a/packages/babel-compat-data/package.json +++ b/packages/babel-compat-data/package.json @@ -1,6 +1,6 @@ { "name": "@babel/compat-data", - "version": "7.8.0", + "version": "7.8.1", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "", @@ -28,7 +28,7 @@ "semver": "^5.5.0" }, "devDependencies": { - "@babel/helper-compilation-targets": "^7.8.0", + "@babel/helper-compilation-targets": "^7.8.1", "caniuse-db": "1.0.30000969", "electron-to-chromium": "1.3.113", "lodash": "^4.17.15" diff --git a/packages/babel-helper-compilation-targets/package.json b/packages/babel-helper-compilation-targets/package.json index 0032aa9e23ac..b00e2bb7002a 100644 --- a/packages/babel-helper-compilation-targets/package.json +++ b/packages/babel-helper-compilation-targets/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-compilation-targets", - "version": "7.8.0", + "version": "7.8.1", "author": "The Babel Team (https://babeljs.io/team)", "license": "MIT", "description": "Engine compat data used in @babel/preset-env", @@ -16,7 +16,7 @@ "babel-plugin" ], "dependencies": { - "@babel/compat-data": "^7.8.0", + "@babel/compat-data": "^7.8.1", "browserslist": "^4.8.2", "invariant": "^2.2.4", "levenary": "^1.1.0", diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 32809bb98fd4..c42a5706ffcf 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.8.0", + "version": "7.8.1", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ From 2ccc451e96b3faccbef311f9eb5e2eb347ad0ce6 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Sun, 12 Jan 2020 13:04:04 +0000 Subject: [PATCH 951/965] Add v7.8.1 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f525c7e14af..395827135a65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.8.1 (2020-01-12) + +#### :bug: Bug Fix +* `babel-compat-data`, `babel-helper-compilation-targets` + * [#10991](https://github.com/babel/babel/pull/10991) Downgrade semver for compatibility with Node 6 ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo)) ## v7.8.0 (2020-01-12) #### :eyeglasses: Spec Compliance From f995f8e02c351ca97f34eb61172903c0d8b6233c Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 13 Jan 2020 06:43:03 +0800 Subject: [PATCH 952/965] fix: `isPluginRequired` returns the opposite result in v7.8.0 (#10992) --- packages/babel-preset-env/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js index 19cc41121464..8ff9d72e5caf 100644 --- a/packages/babel-preset-env/src/index.js +++ b/packages/babel-preset-env/src/index.js @@ -32,7 +32,7 @@ import type { BuiltInsOption, ModuleOption } from "./types"; // TODO: Remove in Babel 8 export function isPluginRequired(targets: Targets, support: Targets) { - return !isRequired("fake-name", targets, { + return isRequired("fake-name", targets, { compatData: { "fake-name": support }, }); } From 61d01f11145bc3d6b43dd6e0b8d49f9d158abed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 12 Jan 2020 23:44:39 +0100 Subject: [PATCH 953/965] v7.8.2 --- lerna.json | 2 +- packages/babel-preset-env/package.json | 2 +- packages/babel-standalone/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lerna.json b/lerna.json index 676653ed7d75..9ed5dbd5b7e1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "7.8.1", + "version": "7.8.2", "changelog": { "repo": "babel/babel", "cacheDir": ".changelog", diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index 996a95b52760..41e05c41f593 100644 --- a/packages/babel-preset-env/package.json +++ b/packages/babel-preset-env/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-env", - "version": "7.8.0", + "version": "7.8.2", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index c42a5706ffcf..21e7aecaaf4f 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.8.1", + "version": "7.8.2", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -100,7 +100,7 @@ "@babel/plugin-transform-typeof-symbol": "^7.8.0", "@babel/plugin-transform-typescript": "^7.8.0", "@babel/plugin-transform-unicode-regex": "^7.8.0", - "@babel/preset-env": "^7.8.0", + "@babel/preset-env": "^7.8.2", "@babel/preset-flow": "^7.8.0", "@babel/preset-react": "^7.8.0", "@babel/preset-typescript": "^7.8.0" From c7f7f9b8b5fceea0641fc0f2c3d033b91abcbf38 Mon Sep 17 00:00:00 2001 From: Babel Bot Date: Sun, 12 Jan 2020 22:50:23 +0000 Subject: [PATCH 954/965] Add v7.8.2 to CHANGELOG.md [skip ci] --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 395827135a65..bba2ec97faca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ See [`eslint-plugin-babel`'s releases](https://github.com/babel/eslint-plugin-ba +## v7.8.2 (2020-01-12) + +#### :bug: Bug Fix +* `babel-preset-env` + * [#10992](https://github.com/babel/babel/pull/10992) fix: `isPluginRequired` returns the opposite result in v7.8.0 ([@sodatea](https://github.com/sodatea)) ## v7.8.1 (2020-01-12) #### :bug: Bug Fix From a677d59a638f4879245c16c12b95b7c784b05d2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 13 Jan 2020 00:31:48 +0100 Subject: [PATCH 955/965] Archive syntax plugins enabled by default (#10820) * Remove syntax plugins enabled by default Moved to babel-archive: babel/babel-archive@8f23ddce037a6eead85c012e07e618c01f33bfaa - `@babel/plugin-syntax-async-generators` - `@babel/plugin-syntax-bigint` - `@babel/plugin-syntax-dynamic-import` - `@babel/plugin-syntax-json-strings` - `@babel/plugin-syntax-nullish-coalescing-operator` - `@babel/plugin-syntax-object-rest-spread` - `@babel/plugin-syntax-optional-catch-binding` - `@babel/plugin-syntax-optional-chaining` * Fix build script * Fix jest config * Remove archived plugins from tests --- jest.config.js | 18 +++++++- .../async-generator-method/options.json | 1 - .../class-decorators-yield-await/options.json | 3 +- .../fixtures/amd/missing-plugin/options.json | 1 - .../commonjs/missing-plugin/options.json | 1 - .../systemjs/missing-plugin/options.json | 1 - .../options.json | 3 +- .../test/fixtures/object-rest/options.json | 1 - .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../babel-plugin-syntax-bigint/.npmignore | 3 -- packages/babel-plugin-syntax-bigint/README.md | 19 --------- .../babel-plugin-syntax-bigint/package.json | 24 ----------- .../babel-plugin-syntax-bigint/src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../.npmignore | 3 -- .../README.md | 19 --------- .../package.json | 24 ----------- .../src/index.js | 13 ------ .../strip-typeapp-call/options.json | 1 - .../test/fixtures/strict/options.json | 2 - .../test/fixtures/import-meta/options.json | 1 - .../options.json | 3 +- .../parameter-destructure-rest/options.json | 1 - .../options.json | 1 - .../babel-preset-env.js.map | 1 + .../options.json | 1 - .../corejs3/usage-dynamic-import/options.json | 1 - packages/babel-standalone/babel.js.map | 1 + scripts/rollup-plugin-babel-source.js | 41 ++++++++++++------- 51 files changed, 48 insertions(+), 507 deletions(-) delete mode 100644 packages/babel-plugin-syntax-async-generators/.npmignore delete mode 100644 packages/babel-plugin-syntax-async-generators/README.md delete mode 100644 packages/babel-plugin-syntax-async-generators/package.json delete mode 100644 packages/babel-plugin-syntax-async-generators/src/index.js delete mode 100644 packages/babel-plugin-syntax-bigint/.npmignore delete mode 100644 packages/babel-plugin-syntax-bigint/README.md delete mode 100644 packages/babel-plugin-syntax-bigint/package.json delete mode 100644 packages/babel-plugin-syntax-bigint/src/index.js delete mode 100644 packages/babel-plugin-syntax-dynamic-import/.npmignore delete mode 100644 packages/babel-plugin-syntax-dynamic-import/README.md delete mode 100644 packages/babel-plugin-syntax-dynamic-import/package.json delete mode 100644 packages/babel-plugin-syntax-dynamic-import/src/index.js delete mode 100644 packages/babel-plugin-syntax-json-strings/.npmignore delete mode 100644 packages/babel-plugin-syntax-json-strings/README.md delete mode 100644 packages/babel-plugin-syntax-json-strings/package.json delete mode 100644 packages/babel-plugin-syntax-json-strings/src/index.js delete mode 100644 packages/babel-plugin-syntax-nullish-coalescing-operator/.npmignore delete mode 100644 packages/babel-plugin-syntax-nullish-coalescing-operator/README.md delete mode 100644 packages/babel-plugin-syntax-nullish-coalescing-operator/package.json delete mode 100644 packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js delete mode 100644 packages/babel-plugin-syntax-object-rest-spread/.npmignore delete mode 100644 packages/babel-plugin-syntax-object-rest-spread/README.md delete mode 100644 packages/babel-plugin-syntax-object-rest-spread/package.json delete mode 100644 packages/babel-plugin-syntax-object-rest-spread/src/index.js delete mode 100644 packages/babel-plugin-syntax-optional-catch-binding/.npmignore delete mode 100644 packages/babel-plugin-syntax-optional-catch-binding/README.md delete mode 100644 packages/babel-plugin-syntax-optional-catch-binding/package.json delete mode 100644 packages/babel-plugin-syntax-optional-catch-binding/src/index.js delete mode 100644 packages/babel-plugin-syntax-optional-chaining/.npmignore delete mode 100644 packages/babel-plugin-syntax-optional-chaining/README.md delete mode 100644 packages/babel-plugin-syntax-optional-chaining/package.json delete mode 100644 packages/babel-plugin-syntax-optional-chaining/src/index.js create mode 100644 packages/babel-preset-env-standalone/babel-preset-env.js.map create mode 100644 packages/babel-standalone/babel.js.map diff --git a/jest.config.js b/jest.config.js index b170ea8f5825..667ea5395c29 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,19 @@ +// These packages undet the @babel namespace aren't in this monorepo. +const externalBabelPackages = [ + "plugin-syntax-async-generators", + "plugin-syntax-bigint", + "plugin-syntax-dynamic-import", + "plugin-syntax-json-strings", + "plugin-syntax-nullish-coalescing-operator", + "plugin-syntax-object-rest-spread", + "plugin-syntax-optional-catch-binding", + "plugin-syntax-optional-chaining", +]; + +// prettier-ignore +const monorepoPackagePattern = + `^@babel/(?!eslint-)(?!${externalBabelPackages.join("|")})([a-zA-Z0-9_-]+)$`; + module.exports = { collectCoverageFrom: [ "packages/*/src/**/*.mjs", @@ -46,7 +62,7 @@ module.exports = { "/build/", ], moduleNameMapper: { - "^@babel/(?!eslint-)([a-zA-Z0-9_-]+)$": "/packages/babel-$1/", + [monorepoPackagePattern]: "/packages/babel-$1/", "^@babel/eslint-([a-zA-Z0-9_-]+)$": "/eslint/babel-eslint-$1/", }, }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/async-generator-method/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/async-generator-method/options.json index a3587a401c6c..0c2c9bd2056d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/async-generator-method/options.json +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/async-generator-method/options.json @@ -2,7 +2,6 @@ "plugins": [ ["proposal-decorators", { "decoratorsBeforeExport": false }], "proposal-class-properties", - "syntax-async-generators", ["external-helpers", { "helperVersion": "7.1.5" }] ] } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/class-decorators-yield-await/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/class-decorators-yield-await/options.json index 7879b5a6675a..0fbe73eecd01 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/class-decorators-yield-await/options.json +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/transformation/class-decorators-yield-await/options.json @@ -7,7 +7,6 @@ { "helperVersion": "7.1.5" } - ], - "syntax-async-generators" + ] ] } diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/amd/missing-plugin/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/amd/missing-plugin/options.json index 97137d02166f..2a0c361b6895 100644 --- a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/amd/missing-plugin/options.json +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/amd/missing-plugin/options.json @@ -1,6 +1,5 @@ { "plugins": [ - "syntax-dynamic-import", "transform-modules-amd", "external-helpers" ] diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/missing-plugin/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/missing-plugin/options.json index d0f7c55cbaa3..46b55e8254a8 100644 --- a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/missing-plugin/options.json +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/commonjs/missing-plugin/options.json @@ -1,6 +1,5 @@ { "plugins": [ - "syntax-dynamic-import", "transform-modules-commonjs", "external-helpers" ] diff --git a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json index c269a708f8a2..28922079e566 100644 --- a/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json +++ b/packages/babel-plugin-proposal-dynamic-import/test/fixtures/systemjs/missing-plugin/options.json @@ -1,7 +1,6 @@ { "validateLogs": true, "plugins": [ - "syntax-dynamic-import", "transform-modules-systemjs", "external-helpers" ] diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/null-coalescing-without-other/options.json b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/null-coalescing-without-other/options.json index 8507a894f763..ef8c2205db57 100644 --- a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/null-coalescing-without-other/options.json +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/null-coalescing-without-other/options.json @@ -1,6 +1,5 @@ { "plugins": [ - "proposal-logical-assignment-operators", - "syntax-nullish-coalescing-operator" + "proposal-logical-assignment-operators" ] } diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/options.json b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/options.json index ac791b82acf2..6f9add3661d6 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/options.json +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/options.json @@ -1,6 +1,5 @@ { "plugins": [ - "syntax-async-generators", "proposal-object-rest-spread", ["external-helpers", { "helperVersion": "7.1.5" }] ] diff --git a/packages/babel-plugin-syntax-async-generators/.npmignore b/packages/babel-plugin-syntax-async-generators/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-async-generators/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-async-generators/README.md b/packages/babel-plugin-syntax-async-generators/README.md deleted file mode 100644 index 4fdb68df562d..000000000000 --- a/packages/babel-plugin-syntax-async-generators/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-async-generators - -> Allow parsing of async generator functions - -See our website [@babel/plugin-syntax-async-generators](https://babeljs.io/docs/en/next/babel-plugin-syntax-async-generators.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-async-generators -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-async-generators --dev -``` diff --git a/packages/babel-plugin-syntax-async-generators/package.json b/packages/babel-plugin-syntax-async-generators/package.json deleted file mode 100644 index 2d8af6a3983e..000000000000 --- a/packages/babel-plugin-syntax-async-generators/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-async-generators", - "version": "7.8.0", - "description": "Allow parsing of async generator functions", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-async-generators/src/index.js b/packages/babel-plugin-syntax-async-generators/src/index.js deleted file mode 100644 index e18612556b27..000000000000 --- a/packages/babel-plugin-syntax-async-generators/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-async-generators", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("asyncGenerators"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-bigint/.npmignore b/packages/babel-plugin-syntax-bigint/.npmignore deleted file mode 100644 index cace0d6ddcdd..000000000000 --- a/packages/babel-plugin-syntax-bigint/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -*.log -src diff --git a/packages/babel-plugin-syntax-bigint/README.md b/packages/babel-plugin-syntax-bigint/README.md deleted file mode 100644 index bb49aab8ee34..000000000000 --- a/packages/babel-plugin-syntax-bigint/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-bigint - -> Allow parsing of BigInt literals - -See our website [@babel/plugin-syntax-bigint](https://babeljs.io/docs/en/next/babel-plugin-syntax-bigint.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-bigint -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-bigint --dev -``` diff --git a/packages/babel-plugin-syntax-bigint/package.json b/packages/babel-plugin-syntax-bigint/package.json deleted file mode 100644 index 917845fecccc..000000000000 --- a/packages/babel-plugin-syntax-bigint/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-bigint", - "version": "7.8.0", - "description": "Allow parsing of BigInt literals", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-bigint", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-bigint/src/index.js b/packages/babel-plugin-syntax-bigint/src/index.js deleted file mode 100644 index 89129a5f06d4..000000000000 --- a/packages/babel-plugin-syntax-bigint/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-bigint", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("bigInt"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-dynamic-import/.npmignore b/packages/babel-plugin-syntax-dynamic-import/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-dynamic-import/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-dynamic-import/README.md b/packages/babel-plugin-syntax-dynamic-import/README.md deleted file mode 100644 index 127903505f21..000000000000 --- a/packages/babel-plugin-syntax-dynamic-import/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-dynamic-import - -> Allow parsing of import() - -See our website [@babel/plugin-syntax-dynamic-import](https://babeljs.io/docs/en/next/babel-plugin-syntax-dynamic-import.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-dynamic-import -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-dynamic-import --dev -``` diff --git a/packages/babel-plugin-syntax-dynamic-import/package.json b/packages/babel-plugin-syntax-dynamic-import/package.json deleted file mode 100644 index c85ec644f522..000000000000 --- a/packages/babel-plugin-syntax-dynamic-import/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-dynamic-import", - "version": "7.8.0", - "description": "Allow parsing of import()", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-dynamic-import/src/index.js b/packages/babel-plugin-syntax-dynamic-import/src/index.js deleted file mode 100644 index 13914e3ada57..000000000000 --- a/packages/babel-plugin-syntax-dynamic-import/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-dynamic-import", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("dynamicImport"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-json-strings/.npmignore b/packages/babel-plugin-syntax-json-strings/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-json-strings/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-json-strings/README.md b/packages/babel-plugin-syntax-json-strings/README.md deleted file mode 100644 index 03c00a2d1764..000000000000 --- a/packages/babel-plugin-syntax-json-strings/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-json-strings - -> Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings - -See our website [@babel/plugin-syntax-json-strings](https://babeljs.io/docs/en/next/babel-plugin-syntax-json-strings.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-json-strings -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-json-strings --dev -``` diff --git a/packages/babel-plugin-syntax-json-strings/package.json b/packages/babel-plugin-syntax-json-strings/package.json deleted file mode 100644 index 82798edd63e9..000000000000 --- a/packages/babel-plugin-syntax-json-strings/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-json-strings", - "version": "7.8.0", - "description": "Allow parsing of the U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-json-strings", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-json-strings/src/index.js b/packages/babel-plugin-syntax-json-strings/src/index.js deleted file mode 100644 index 0a61997b8a6f..000000000000 --- a/packages/babel-plugin-syntax-json-strings/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-json-strings", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("jsonStrings"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/.npmignore b/packages/babel-plugin-syntax-nullish-coalescing-operator/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/README.md b/packages/babel-plugin-syntax-nullish-coalescing-operator/README.md deleted file mode 100644 index f91e8117f785..000000000000 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-nullish-coalescing-operator - -> Allow parsing of the nullish-coalescing operator - -See our website [@babel/plugin-syntax-nullish-coalescing-operator](https://babeljs.io/docs/en/next/babel-plugin-syntax-nullish-coalescing-operator.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-nullish-coalescing-operator -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-nullish-coalescing-operator --dev -``` diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json deleted file mode 100644 index 1aea08cc5783..000000000000 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-nullish-coalescing-operator", - "version": "7.8.0", - "description": "Allow parsing of the nullish-coalescing operator", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-nullish-coalescing-operator", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js b/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js deleted file mode 100644 index 0bd6c5d70048..000000000000 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-nullish-coalescing-operator", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("nullishCoalescingOperator"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-object-rest-spread/.npmignore b/packages/babel-plugin-syntax-object-rest-spread/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-object-rest-spread/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-object-rest-spread/README.md b/packages/babel-plugin-syntax-object-rest-spread/README.md deleted file mode 100644 index 95c4472ebe68..000000000000 --- a/packages/babel-plugin-syntax-object-rest-spread/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-object-rest-spread - -> Allow parsing of object rest/spread - -See our website [@babel/plugin-syntax-object-rest-spread](https://babeljs.io/docs/en/next/babel-plugin-syntax-object-rest-spread.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-object-rest-spread -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-object-rest-spread --dev -``` diff --git a/packages/babel-plugin-syntax-object-rest-spread/package.json b/packages/babel-plugin-syntax-object-rest-spread/package.json deleted file mode 100644 index 6b7bbf458799..000000000000 --- a/packages/babel-plugin-syntax-object-rest-spread/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-object-rest-spread", - "version": "7.8.0", - "description": "Allow parsing of object rest/spread", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-object-rest-spread/src/index.js b/packages/babel-plugin-syntax-object-rest-spread/src/index.js deleted file mode 100644 index 66f909c5a1d9..000000000000 --- a/packages/babel-plugin-syntax-object-rest-spread/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-object-rest-spread", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("objectRestSpread"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-optional-catch-binding/.npmignore b/packages/babel-plugin-syntax-optional-catch-binding/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-optional-catch-binding/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-optional-catch-binding/README.md b/packages/babel-plugin-syntax-optional-catch-binding/README.md deleted file mode 100644 index 9085f9180c54..000000000000 --- a/packages/babel-plugin-syntax-optional-catch-binding/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-optional-catch-binding - -> Allow parsing of optional catch bindings - -See our website [@babel/plugin-syntax-optional-catch-binding](https://babeljs.io/docs/en/next/babel-plugin-syntax-optional-catch-binding.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-optional-catch-binding -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-optional-catch-binding --dev -``` diff --git a/packages/babel-plugin-syntax-optional-catch-binding/package.json b/packages/babel-plugin-syntax-optional-catch-binding/package.json deleted file mode 100644 index c5b2bd0e7fc6..000000000000 --- a/packages/babel-plugin-syntax-optional-catch-binding/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-optional-catch-binding", - "version": "7.8.0", - "description": "Allow parsing of optional catch bindings", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-optional-catch-binding/src/index.js b/packages/babel-plugin-syntax-optional-catch-binding/src/index.js deleted file mode 100644 index 68de2be52c31..000000000000 --- a/packages/babel-plugin-syntax-optional-catch-binding/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-optional-catch-binding", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("optionalCatchBinding"); - }, - }; -}); diff --git a/packages/babel-plugin-syntax-optional-chaining/.npmignore b/packages/babel-plugin-syntax-optional-chaining/.npmignore deleted file mode 100644 index f9806945836e..000000000000 --- a/packages/babel-plugin-syntax-optional-chaining/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -src -test -*.log diff --git a/packages/babel-plugin-syntax-optional-chaining/README.md b/packages/babel-plugin-syntax-optional-chaining/README.md deleted file mode 100644 index 712abc37046d..000000000000 --- a/packages/babel-plugin-syntax-optional-chaining/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# @babel/plugin-syntax-optional-chaining - -> Allow parsing of optional properties - -See our website [@babel/plugin-syntax-optional-chaining](https://babeljs.io/docs/en/next/babel-plugin-syntax-optional-chaining.html) for more information. - -## Install - -Using npm: - -```sh -npm install --save-dev @babel/plugin-syntax-optional-chaining -``` - -or using yarn: - -```sh -yarn add @babel/plugin-syntax-optional-chaining --dev -``` diff --git a/packages/babel-plugin-syntax-optional-chaining/package.json b/packages/babel-plugin-syntax-optional-chaining/package.json deleted file mode 100644 index b42aa5e52551..000000000000 --- a/packages/babel-plugin-syntax-optional-chaining/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@babel/plugin-syntax-optional-chaining", - "version": "7.8.0", - "description": "Allow parsing of optional properties", - "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining", - "license": "MIT", - "type": "commonjs", - "publishConfig": { - "access": "public" - }, - "main": "lib/index.js", - "keywords": [ - "babel-plugin" - ], - "dependencies": { - "@babel/helper-plugin-utils": "^7.8.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - }, - "devDependencies": { - "@babel/core": "^7.8.0" - } -} diff --git a/packages/babel-plugin-syntax-optional-chaining/src/index.js b/packages/babel-plugin-syntax-optional-chaining/src/index.js deleted file mode 100644 index 968f34dd728e..000000000000 --- a/packages/babel-plugin-syntax-optional-chaining/src/index.js +++ /dev/null @@ -1,13 +0,0 @@ -import { declare } from "@babel/helper-plugin-utils"; - -export default declare(api => { - api.assertVersion(7); - - return { - name: "syntax-optional-chaining", - - manipulateOptions(opts, parserOpts) { - parserOpts.plugins.push("optionalChaining"); - }, - }; -}); diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-typeapp-call/options.json b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-typeapp-call/options.json index 81c1ea3a2294..1eca5cfc9f6b 100644 --- a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-typeapp-call/options.json +++ b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-typeapp-call/options.json @@ -1,7 +1,6 @@ { "plugins": [ "syntax-jsx", - "syntax-optional-chaining", "transform-flow-strip-types" ] } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json index 39f3a7421118..3e4f571b01d8 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/options.json @@ -1,8 +1,6 @@ { "plugins": [ "external-helpers", - "syntax-object-rest-spread", - "syntax-optional-chaining", [ "transform-modules-commonjs", { "strict": true, "mjsStrictNamespace": false } diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/import-meta/options.json b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/import-meta/options.json index 7513a834e42e..cb038f2e52c5 100644 --- a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/import-meta/options.json +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/import-meta/options.json @@ -1,7 +1,6 @@ { "plugins": [ "external-helpers", - "syntax-dynamic-import", "syntax-import-meta", "transform-modules-systemjs" ] diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json index 09137adf8d2e..3329c8d9519f 100644 --- a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json +++ b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/options.json @@ -1,7 +1,6 @@ { "plugins": [ "external-helpers", - "transform-modules-systemjs", - "syntax-object-rest-spread" + "transform-modules-systemjs" ] } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/options.json b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/options.json index 1b0cc13a7a3f..01101cd37ccb 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/options.json +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/options.json @@ -3,7 +3,6 @@ "transform-destructuring", "transform-parameters", "transform-spread", - "syntax-object-rest-spread", "transform-react-constant-elements", "syntax-jsx", "external-helpers" diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-spread-deopt/options.json b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-spread-deopt/options.json index 1b0cc13a7a3f..01101cd37ccb 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-spread-deopt/options.json +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-spread-deopt/options.json @@ -3,7 +3,6 @@ "transform-destructuring", "transform-parameters", "transform-spread", - "syntax-object-rest-spread", "transform-react-constant-elements", "syntax-jsx", "external-helpers" diff --git a/packages/babel-preset-env-standalone/babel-preset-env.js.map b/packages/babel-preset-env-standalone/babel-preset-env.js.map new file mode 100644 index 000000000000..a3081a9787a1 --- /dev/null +++ b/packages/babel-preset-env-standalone/babel-preset-env.js.map @@ -0,0 +1 @@ +{"version":3,"file":"babel-preset-env.js","sources":["../../node_modules/rollup-plugin-node-globals/src/global.js","../../node_modules/process-es6/browser.js","../../node_modules/semver/semver.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/browsers.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/browsers.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/browserVersions.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/browserVersions.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/data/agents.js","../babel-helper-compilation-targets/node_modules/caniuse-lite/dist/unpacker/agents.js","../babel-helper-compilation-targets/node_modules/electron-to-chromium/versions.js","../babel-helper-compilation-targets/node_modules/browserslist/error.js","../babel-helper-compilation-targets/node_modules/browserslist/browser.js","../babel-helper-compilation-targets/node_modules/browserslist/index.js","../babel-helper-compilation-targets/node_modules/leven/index.js","../babel-helper-compilation-targets/node_modules/levenary/index.mjs","../babel-helper-compilation-targets/node_modules/invariant/browser.js","../babel-compat-data/native-modules.js","../babel-helper-compilation-targets/src/targets.js","../babel-helper-compilation-targets/src/utils.js","../babel-helper-compilation-targets/src/options.js","../babel-helper-compilation-targets/src/pretty.js","../babel-helper-compilation-targets/src/debug.js","../babel-compat-data/plugins.js","../babel-helper-compilation-targets/src/filter-items.js","../babel-helper-compilation-targets/src/index.js","../babel-preset-env/src/debug.js","../babel-preset-env/src/get-option-specific-excludes.js","../babel-preset-env/src/filter-items.js","../babel-preset-env/src/module-transformations.js","../babel-preset-env/node_modules/leven/index.js","../babel-preset-env/node_modules/levenary/index.mjs","../babel-preset-env/node_modules/invariant/browser.js","../babel-compat-data/corejs2-built-ins.js","../babel-preset-env/src/options.js","../babel-preset-env/src/polyfills/corejs2/get-platform-specific-default.js","../babel-preset-env/src/normalize-options.js","../babel-preset-env/data/shipped-proposals.js","../babel-compat-data/overlapping-plugins.js","../babel-preset-env/src/polyfills/corejs2/built-in-definitions.js","../babel-types/src/utils/shallowEqual.js","../babel-types/src/validators/generated/index.js","../babel-types/src/validators/matchesPattern.js","../babel-types/src/validators/buildMatchMemberExpression.js","../babel-types/src/validators/react/isReactComponent.js","../babel-types/src/validators/react/isCompatTag.js","../../node_modules/lodash/_listCacheClear.js","../../node_modules/lodash/eq.js","../../node_modules/lodash/_assocIndexOf.js","../../node_modules/lodash/_listCacheDelete.js","../../node_modules/lodash/_listCacheGet.js","../../node_modules/lodash/_listCacheHas.js","../../node_modules/lodash/_listCacheSet.js","../../node_modules/lodash/_ListCache.js","../../node_modules/lodash/_stackClear.js","../../node_modules/lodash/_stackDelete.js","../../node_modules/lodash/_stackGet.js","../../node_modules/lodash/_stackHas.js","../../node_modules/lodash/_freeGlobal.js","../../node_modules/lodash/_root.js","../../node_modules/lodash/_Symbol.js","../../node_modules/lodash/_getRawTag.js","../../node_modules/lodash/_objectToString.js","../../node_modules/lodash/_baseGetTag.js","../../node_modules/lodash/isObject.js","../../node_modules/lodash/isFunction.js","../../node_modules/lodash/_coreJsData.js","../../node_modules/lodash/_isMasked.js","../../node_modules/lodash/_toSource.js","../../node_modules/lodash/_baseIsNative.js","../../node_modules/lodash/_getValue.js","../../node_modules/lodash/_getNative.js","../../node_modules/lodash/_Map.js","../../node_modules/lodash/_nativeCreate.js","../../node_modules/lodash/_hashClear.js","../../node_modules/lodash/_hashDelete.js","../../node_modules/lodash/_hashGet.js","../../node_modules/lodash/_hashHas.js","../../node_modules/lodash/_hashSet.js","../../node_modules/lodash/_Hash.js","../../node_modules/lodash/_mapCacheClear.js","../../node_modules/lodash/_isKeyable.js","../../node_modules/lodash/_getMapData.js","../../node_modules/lodash/_mapCacheDelete.js","../../node_modules/lodash/_mapCacheGet.js","../../node_modules/lodash/_mapCacheHas.js","../../node_modules/lodash/_mapCacheSet.js","../../node_modules/lodash/_MapCache.js","../../node_modules/lodash/_stackSet.js","../../node_modules/lodash/_Stack.js","../../node_modules/lodash/_arrayEach.js","../../node_modules/lodash/_defineProperty.js","../../node_modules/lodash/_baseAssignValue.js","../../node_modules/lodash/_assignValue.js","../../node_modules/lodash/_copyObject.js","../../node_modules/lodash/_baseTimes.js","../../node_modules/lodash/isObjectLike.js","../../node_modules/lodash/_baseIsArguments.js","../../node_modules/lodash/isArguments.js","../../node_modules/lodash/isArray.js","../../node_modules/lodash/stubFalse.js","../../node_modules/lodash/isBuffer.js","../../node_modules/lodash/_isIndex.js","../../node_modules/lodash/isLength.js","../../node_modules/lodash/_baseIsTypedArray.js","../../node_modules/lodash/_baseUnary.js","../../node_modules/lodash/_nodeUtil.js","../../node_modules/lodash/isTypedArray.js","../../node_modules/lodash/_arrayLikeKeys.js","../../node_modules/lodash/_isPrototype.js","../../node_modules/lodash/_overArg.js","../../node_modules/lodash/_nativeKeys.js","../../node_modules/lodash/_baseKeys.js","../../node_modules/lodash/isArrayLike.js","../../node_modules/lodash/keys.js","../../node_modules/lodash/_baseAssign.js","../../node_modules/lodash/_nativeKeysIn.js","../../node_modules/lodash/_baseKeysIn.js","../../node_modules/lodash/keysIn.js","../../node_modules/lodash/_baseAssignIn.js","../../node_modules/lodash/_cloneBuffer.js","../../node_modules/lodash/_copyArray.js","../../node_modules/lodash/_arrayFilter.js","../../node_modules/lodash/stubArray.js","../../node_modules/lodash/_getSymbols.js","../../node_modules/lodash/_copySymbols.js","../../node_modules/lodash/_arrayPush.js","../../node_modules/lodash/_getPrototype.js","../../node_modules/lodash/_getSymbolsIn.js","../../node_modules/lodash/_copySymbolsIn.js","../../node_modules/lodash/_baseGetAllKeys.js","../../node_modules/lodash/_getAllKeys.js","../../node_modules/lodash/_getAllKeysIn.js","../../node_modules/lodash/_DataView.js","../../node_modules/lodash/_Promise.js","../../node_modules/lodash/_Set.js","../../node_modules/lodash/_WeakMap.js","../../node_modules/lodash/_getTag.js","../../node_modules/lodash/_initCloneArray.js","../../node_modules/lodash/_Uint8Array.js","../../node_modules/lodash/_cloneArrayBuffer.js","../../node_modules/lodash/_cloneDataView.js","../../node_modules/lodash/_cloneRegExp.js","../../node_modules/lodash/_cloneSymbol.js","../../node_modules/lodash/_cloneTypedArray.js","../../node_modules/lodash/_initCloneByTag.js","../../node_modules/lodash/_baseCreate.js","../../node_modules/lodash/_initCloneObject.js","../../node_modules/lodash/_baseIsMap.js","../../node_modules/lodash/isMap.js","../../node_modules/lodash/_baseIsSet.js","../../node_modules/lodash/isSet.js","../../node_modules/lodash/_baseClone.js","../../node_modules/lodash/clone.js","../babel-types/node_modules/to-fast-properties/index.js","../../node_modules/esutils/lib/ast.js","../../node_modules/esutils/lib/code.js","../../node_modules/esutils/lib/keyword.js","../../node_modules/esutils/lib/utils.js","../babel-types/src/validators/isType.js","../babel-types/src/validators/isPlaceholderType.js","../babel-types/src/validators/is.js","../babel-types/src/constants/index.js","../babel-types/src/validators/validate.js","../babel-types/src/definitions/utils.js","../babel-types/src/definitions/core.js","../babel-types/src/definitions/es2015.js","../babel-types/src/definitions/flow.js","../babel-types/src/definitions/jsx.js","../babel-types/src/definitions/placeholders.js","../babel-types/src/definitions/misc.js","../babel-types/src/definitions/experimental.js","../babel-types/src/definitions/typescript.js","../babel-types/src/definitions/index.js","../babel-types/src/builders/builder.js","../babel-types/src/builders/generated/index.js","../babel-types/src/utils/react/cleanJSXElementLiteralChild.js","../babel-types/src/builders/react/buildChildren.js","../babel-types/src/validators/isNode.js","../babel-types/src/asserts/assertNode.js","../babel-types/src/asserts/generated/index.js","../babel-types/src/builders/flow/createTypeAnnotationBasedOnTypeof.js","../babel-types/src/modifications/flow/removeTypeDuplicates.js","../babel-types/src/builders/flow/createUnionTypeAnnotation.js","../babel-types/src/clone/cloneNode.js","../babel-types/src/clone/clone.js","../babel-types/src/clone/cloneDeep.js","../babel-types/src/clone/cloneWithoutLoc.js","../babel-types/src/comments/addComments.js","../babel-types/src/comments/addComment.js","../../node_modules/lodash/_setCacheAdd.js","../../node_modules/lodash/_setCacheHas.js","../../node_modules/lodash/_SetCache.js","../../node_modules/lodash/_baseFindIndex.js","../../node_modules/lodash/_baseIsNaN.js","../../node_modules/lodash/_strictIndexOf.js","../../node_modules/lodash/_baseIndexOf.js","../../node_modules/lodash/_arrayIncludes.js","../../node_modules/lodash/_arrayIncludesWith.js","../../node_modules/lodash/_cacheHas.js","../../node_modules/lodash/noop.js","../../node_modules/lodash/_setToArray.js","../../node_modules/lodash/_createSet.js","../../node_modules/lodash/_baseUniq.js","../../node_modules/lodash/uniq.js","../babel-types/src/utils/inherit.js","../babel-types/src/comments/inheritInnerComments.js","../babel-types/src/comments/inheritLeadingComments.js","../babel-types/src/comments/inheritTrailingComments.js","../babel-types/src/comments/inheritsComments.js","../babel-types/src/comments/removeComments.js","../babel-types/src/constants/generated/index.js","../babel-types/src/converters/toBlock.js","../babel-types/src/converters/ensureBlock.js","../babel-types/src/validators/isValidIdentifier.js","../babel-types/src/converters/toIdentifier.js","../babel-types/src/converters/toBindingIdentifierName.js","../babel-types/src/converters/toComputedKey.js","../babel-types/src/converters/toExpression.js","../babel-types/src/traverse/traverseFast.js","../babel-types/src/modifications/removeProperties.js","../babel-types/src/modifications/removePropertiesDeep.js","../babel-types/src/converters/toKeyAlias.js","../babel-types/src/retrievers/getBindingIdentifiers.js","../babel-types/src/converters/gatherSequenceExpressions.js","../babel-types/src/converters/toSequenceExpression.js","../babel-types/src/converters/toStatement.js","../../node_modules/lodash/isPlainObject.js","../../node_modules/lodash/_baseIsRegExp.js","../../node_modules/lodash/isRegExp.js","../babel-types/src/converters/valueToNode.js","../babel-types/src/modifications/appendToMemberExpression.js","../babel-types/src/modifications/inherits.js","../babel-types/src/modifications/prependToMemberExpression.js","../babel-types/src/retrievers/getOuterBindingIdentifiers.js","../babel-types/src/traverse/traverse.js","../babel-types/src/validators/isBinding.js","../babel-types/src/validators/isLet.js","../babel-types/src/validators/isBlockScoped.js","../babel-types/src/validators/isImmutable.js","../babel-types/src/validators/isNodesEquivalent.js","../babel-types/src/validators/isReferenced.js","../babel-types/src/validators/isScope.js","../babel-types/src/validators/isSpecifierDefault.js","../babel-types/src/validators/isValidES3Identifier.js","../babel-types/src/validators/isVar.js","../babel-types/src/index.js","../../node_modules/buffer-es6/base64.js","../../node_modules/buffer-es6/ieee754.js","../../node_modules/buffer-es6/isArray.js","../../node_modules/buffer-es6/index.js","../../node_modules/rollup-plugin-node-builtins/src/es6/inherits.js","../../node_modules/rollup-plugin-node-builtins/src/es6/util.js","../../node_modules/rollup-plugin-node-builtins/src/es6/assert.js","../babel-helper-module-imports/src/import-builder.js","../babel-helper-module-imports/src/is-module.js","../babel-helper-module-imports/src/import-injector.js","../babel-helper-module-imports/src/index.js","../babel-preset-env/src/utils.js","../babel-preset-env/src/polyfills/corejs2/usage-plugin.js","../babel-preset-env/src/polyfills/corejs3/shipped-proposals.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/debug.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/constants.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/re.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/internal/identifiers.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/classes/semver.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/compare.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/eq.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/neq.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/gt.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/gte.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/lt.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/lte.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/cmp.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/parse.js","../babel-preset-env/node_modules/core-js-compat/node_modules/semver/functions/coerce.js","../babel-preset-env/node_modules/core-js-compat/helpers.js","../babel-preset-env/node_modules/core-js-compat/get-modules-list-for-target-version.js","../babel-preset-env/src/polyfills/corejs3/built-in-definitions.js","../babel-preset-env/src/polyfills/corejs3/usage-plugin.js","../babel-preset-env/src/polyfills/regenerator/usage-plugin.js","../babel-preset-env/src/polyfills/corejs2/entry-plugin.js","../babel-preset-env/src/polyfills/corejs3/entry-plugin.js","../babel-preset-env/src/polyfills/regenerator/entry-plugin.js","../babel-helper-plugin-utils/src/index.js","../babel-plugin-syntax-json-strings/src/index.js","../babel-plugin-proposal-json-strings/src/index.js","../babel-plugin-syntax-dynamic-import/src/index.js","../babel-plugin-proposal-dynamic-import/src/index.js","../babel-plugin-syntax-nullish-coalescing-operator/src/index.js","../babel-traverse/src/path/lib/virtual-types.js","../babel-traverse/node_modules/ms/index.js","../babel-traverse/node_modules/debug/src/common.js","../babel-traverse/node_modules/debug/src/browser.js","../../node_modules/lodash/isString.js","../../node_modules/lodash/isSymbol.js","../../node_modules/lodash/toNumber.js","../../node_modules/lodash/toFinite.js","../../node_modules/lodash/toInteger.js","../../node_modules/lodash/_arrayMap.js","../../node_modules/lodash/_baseValues.js","../../node_modules/lodash/values.js","../../node_modules/lodash/includes.js","../../node_modules/lodash/_baseRepeat.js","../../node_modules/lodash/_isIterateeCall.js","../../node_modules/lodash/_baseToString.js","../../node_modules/lodash/toString.js","../../node_modules/lodash/repeat.js","../babel-traverse/src/scope/binding.js","../babel-helper-split-export-declaration/src/index.js","../babel-traverse/src/scope/lib/renamer.js","../../node_modules/lodash/identity.js","../../node_modules/lodash/_apply.js","../../node_modules/lodash/_overRest.js","../../node_modules/lodash/constant.js","../../node_modules/lodash/_baseSetToString.js","../../node_modules/lodash/_shortOut.js","../../node_modules/lodash/_setToString.js","../../node_modules/lodash/_baseRest.js","../../node_modules/lodash/defaults.js","../babel-traverse/node_modules/globals/index.js","../babel-traverse/src/cache.js","../babel-traverse/src/scope/index.js","../../node_modules/source-map/lib/base64.js","../../node_modules/source-map/lib/base64-vlq.js","../../node_modules/source-map/lib/util.js","../../node_modules/source-map/lib/array-set.js","../../node_modules/source-map/lib/mapping-list.js","../../node_modules/source-map/lib/source-map-generator.js","../../node_modules/source-map/lib/binary-search.js","../../node_modules/source-map/lib/quick-sort.js","../../node_modules/source-map/lib/source-map-consumer.js","../../node_modules/source-map/lib/source-node.js","../../node_modules/source-map/source-map.js","../babel-generator/src/source-map.js","../../node_modules/lodash/isInteger.js","../babel-generator/src/buffer.js","../babel-generator/src/node/whitespace.js","../babel-generator/src/node/parentheses.js","../babel-generator/src/node/index.js","../babel-generator/src/generators/template-literals.js","../babel-generator/src/generators/expressions.js","../babel-generator/src/generators/statements.js","../babel-generator/src/generators/classes.js","../babel-generator/src/generators/methods.js","../babel-generator/src/generators/modules.js","../babel-generator/node_modules/jsesc/jsesc.js","../babel-generator/src/generators/types.js","../babel-generator/src/generators/flow.js","../babel-generator/src/generators/base.js","../babel-generator/src/generators/jsx.js","../babel-generator/src/generators/typescript.js","../babel-generator/src/printer.js","../babel-generator/src/index.js","../babel-traverse/src/path/ancestry.js","../babel-traverse/src/path/inference/inferer-reference.js","../babel-traverse/src/path/inference/inferers.js","../babel-traverse/src/path/inference/index.js","../babel-highlight/node_modules/js-tokens/index.js","../babel-highlight/node_modules/escape-string-regexp/index.js","../babel-highlight/node_modules/color-name/index.js","../babel-highlight/node_modules/color-convert/conversions.js","../babel-highlight/node_modules/color-convert/route.js","../babel-highlight/node_modules/color-convert/index.js","../babel-highlight/node_modules/ansi-styles/index.js","../babel-highlight/node_modules/supports-color/browser.js","../babel-highlight/node_modules/chalk/templates.js","../babel-highlight/node_modules/chalk/index.js","../babel-highlight/src/index.js","../babel-code-frame/src/index.js","../babel-parser/src/tokenizer/types.js","../babel-parser/src/util/scopeflags.js","../babel-parser/src/plugins/estree.js","../babel-parser/src/util/whitespace.js","../babel-parser/src/tokenizer/context.js","../babel-parser/src/util/identifier.js","../babel-parser/src/plugins/flow.js","../babel-parser/src/plugins/jsx/xhtml.js","../babel-parser/src/plugins/jsx/index.js","../babel-parser/src/util/scope.js","../babel-parser/src/plugins/typescript/scope.js","../babel-parser/src/plugins/typescript/index.js","../babel-parser/src/plugins/placeholders.js","../babel-parser/src/plugins/v8intrinsic.js","../babel-parser/src/plugin-utils.js","../babel-parser/src/options.js","../babel-parser/src/util/location.js","../babel-parser/src/parser/base.js","../babel-parser/src/parser/comments.js","../babel-parser/src/parser/location.js","../babel-parser/src/tokenizer/state.js","../babel-parser/src/tokenizer/index.js","../babel-parser/src/parser/util.js","../babel-parser/src/parser/node.js","../babel-parser/src/parser/lval.js","../babel-parser/src/parser/expression.js","../babel-parser/src/parser/statement.js","../babel-parser/src/util/class-scope.js","../babel-parser/src/parser/index.js","../babel-parser/src/index.js","../babel-traverse/src/path/replacement.js","../babel-traverse/src/path/evaluation.js","../babel-helper-get-function-arity/src/index.js","../babel-template/src/formatters.js","../babel-template/src/options.js","../babel-template/src/parse.js","../babel-template/src/populate.js","../babel-template/src/string.js","../babel-template/src/literal.js","../babel-template/src/builder.js","../babel-template/src/index.js","../babel-helper-function-name/src/index.js","../babel-traverse/src/path/conversion.js","../babel-traverse/src/path/introspection.js","../babel-traverse/src/path/context.js","../babel-traverse/src/path/lib/removal-hooks.js","../babel-traverse/src/path/removal.js","../babel-traverse/src/path/lib/hoister.js","../babel-traverse/src/path/modification.js","../babel-traverse/src/path/family.js","../babel-traverse/src/path/comments.js","../babel-traverse/src/path/index.js","../babel-traverse/src/context.js","../babel-traverse/src/visitors.js","../babel-traverse/src/index.js","../babel-helpers/src/helpers.js","../babel-helpers/src/index.js","../babel-core/src/transformation/file/file.js","../babel-core/src/tools/build-external-helpers.js","../babel-runtime/node_modules/regenerator-runtime/runtime.js","../babel-runtime/regenerator/index.js","../babel-core/src/config/files/index-browser.js","../babel-core/src/config/helpers/environment.js","../../node_modules/rollup-plugin-node-builtins/src/es6/path.js","../babel-core/node_modules/gensync/index.js","../babel-core/src/gensync-utils/async.js","../babel-core/src/config/util.js","../babel-core/src/config/caching.js","../babel-core/src/config/config-descriptors.js","../babel-core/src/config/item.js","../babel-core/src/config/plugin.js","../babel-core/node_modules/ms/index.js","../babel-core/node_modules/debug/src/common.js","../babel-core/node_modules/debug/src/browser.js","../babel-core/src/config/validation/removed.js","../babel-core/src/config/validation/option-assertions.js","../babel-core/src/config/validation/options.js","../../node_modules/lodash/escapeRegExp.js","../babel-core/src/config/pattern-to-regex.js","../babel-core/src/config/config-chain.js","../babel-core/src/config/validation/plugins.js","../babel-core/src/config/helpers/config-api.js","../babel-core/src/config/partial.js","../babel-core/src/config/full.js","../babel-core/src/config/index.js","../babel-core/src/transformation/plugin-pass.js","../../node_modules/lodash/_isFlattenable.js","../../node_modules/lodash/_baseFlatten.js","../../node_modules/lodash/_arraySome.js","../../node_modules/lodash/_equalArrays.js","../../node_modules/lodash/_mapToArray.js","../../node_modules/lodash/_equalByTag.js","../../node_modules/lodash/_equalObjects.js","../../node_modules/lodash/_baseIsEqualDeep.js","../../node_modules/lodash/_baseIsEqual.js","../../node_modules/lodash/_baseIsMatch.js","../../node_modules/lodash/_isStrictComparable.js","../../node_modules/lodash/_getMatchData.js","../../node_modules/lodash/_matchesStrictComparable.js","../../node_modules/lodash/_baseMatches.js","../../node_modules/lodash/_isKey.js","../../node_modules/lodash/memoize.js","../../node_modules/lodash/_memoizeCapped.js","../../node_modules/lodash/_stringToPath.js","../../node_modules/lodash/_castPath.js","../../node_modules/lodash/_toKey.js","../../node_modules/lodash/_baseGet.js","../../node_modules/lodash/get.js","../../node_modules/lodash/_baseHasIn.js","../../node_modules/lodash/_hasPath.js","../../node_modules/lodash/hasIn.js","../../node_modules/lodash/_baseMatchesProperty.js","../../node_modules/lodash/_baseProperty.js","../../node_modules/lodash/_basePropertyDeep.js","../../node_modules/lodash/property.js","../../node_modules/lodash/_baseIteratee.js","../../node_modules/lodash/_createBaseFor.js","../../node_modules/lodash/_baseFor.js","../../node_modules/lodash/_baseForOwn.js","../../node_modules/lodash/_createBaseEach.js","../../node_modules/lodash/_baseEach.js","../../node_modules/lodash/_baseMap.js","../../node_modules/lodash/_baseSortBy.js","../../node_modules/lodash/_compareAscending.js","../../node_modules/lodash/_compareMultiple.js","../../node_modules/lodash/_baseOrderBy.js","../../node_modules/lodash/sortBy.js","../babel-core/src/transformation/block-hoist-plugin.js","../babel-core/src/transformation/normalize-opts.js","../../node_modules/rollup-plugin-node-builtins/src/es6/empty.js","../../node_modules/lodash/cloneDeep.js","../babel-core/node_modules/safe-buffer/index.js","../babel-core/node_modules/convert-source-map/index.js","../babel-core/src/parser/util/missing-plugin-helper.js","../babel-core/src/parser/index.js","../babel-core/src/transformation/normalize-file.js","../babel-core/src/transformation/file/merge-map.js","../babel-core/src/transformation/file/generate.js","../babel-core/src/transformation/index.js","../babel-core/src/transform.js","../babel-core/src/transform-file-browser.js","../babel-core/src/transform-ast.js","../babel-core/src/parse.js","../babel-core/src/index.js","../babel-plugin-proposal-nullish-coalescing-operator/src/index.js","../babel-plugin-syntax-optional-chaining/src/index.js","../babel-plugin-proposal-optional-chaining/src/index.js","../babel-plugin-syntax-top-level-await/src/index.js","../babel-helper-create-regexp-features-plugin/node_modules/regjsgen/regjsgen.js","../babel-helper-create-regexp-features-plugin/node_modules/regjsparser/parser.js","../babel-helper-create-regexp-features-plugin/node_modules/regenerate/regenerate.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-canonical-property-names-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-property-aliases-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-value-ecmascript/data/mappings.js","../babel-helper-create-regexp-features-plugin/node_modules/unicode-match-property-value-ecmascript/index.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/data/iu-mappings.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/data/character-class-escape-sets.js","../babel-helper-create-regexp-features-plugin/node_modules/regexpu-core/rewrite-pattern.js","../babel-helper-create-regexp-features-plugin/src/features.js","../babel-helper-create-regexp-features-plugin/src/util.js","../../node_modules/lodash/_baseIndexOfWith.js","../../node_modules/lodash/_basePullAll.js","../../node_modules/lodash/pullAll.js","../../node_modules/lodash/pull.js","../babel-helper-regex/src/index.js","../babel-helper-create-regexp-features-plugin/src/index.js","../babel-plugin-transform-named-capturing-groups-regex/src/index.js","../babel-plugin-transform-new-target/src/index.js","src/available-plugins.js","../babel-preset-env/src/index.js","src/index.js"],"sourcesContent":["export default (typeof global !== \"undefined\" ? global :\n typeof self !== \"undefined\" ? self :\n typeof window !== \"undefined\" ? window : {});\n","// shim for using process in browser\n// based off https://github.com/defunctzombie/node-process/blob/master/browser.js\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\nvar cachedSetTimeout = defaultSetTimout;\nvar cachedClearTimeout = defaultClearTimeout;\nif (typeof global.setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n}\nif (typeof global.clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n}\n\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\nexport function nextTick(fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n}\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nexport var title = 'browser';\nexport var platform = 'browser';\nexport var browser = true;\nexport var env = {};\nexport var argv = [];\nexport var version = ''; // empty string to avoid regexp issues\nexport var versions = {};\nexport var release = {};\nexport var config = {};\n\nfunction noop() {}\n\nexport var on = noop;\nexport var addListener = noop;\nexport var once = noop;\nexport var off = noop;\nexport var removeListener = noop;\nexport var removeAllListeners = noop;\nexport var emit = noop;\n\nexport function binding(name) {\n throw new Error('process.binding is not supported');\n}\n\nexport function cwd () { return '/' }\nexport function chdir (dir) {\n throw new Error('process.chdir is not supported');\n};\nexport function umask() { return 0; }\n\n// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js\nvar performance = global.performance || {}\nvar performanceNow =\n performance.now ||\n performance.mozNow ||\n performance.msNow ||\n performance.oNow ||\n performance.webkitNow ||\n function(){ return (new Date()).getTime() }\n\n// generate timestamp or delta\n// see http://nodejs.org/api/process.html#process_process_hrtime\nexport function hrtime(previousTimestamp){\n var clocktime = performanceNow.call(performance)*1e-3\n var seconds = Math.floor(clocktime)\n var nanoseconds = Math.floor((clocktime%1)*1e9)\n if (previousTimestamp) {\n seconds = seconds - previousTimestamp[0]\n nanoseconds = nanoseconds - previousTimestamp[1]\n if (nanoseconds<0) {\n seconds--\n nanoseconds += 1e9\n }\n }\n return [seconds,nanoseconds]\n}\n\nvar startTime = new Date();\nexport function uptime() {\n var currentTime = new Date();\n var dif = currentTime - startTime;\n return dif / 1000;\n}\n\nexport default {\n nextTick: nextTick,\n title: title,\n browser: browser,\n env: env,\n argv: argv,\n version: version,\n versions: versions,\n on: on,\n addListener: addListener,\n once: once,\n off: off,\n removeListener: removeListener,\n removeAllListeners: removeAllListeners,\n emit: emit,\n binding: binding,\n cwd: cwd,\n chdir: chdir,\n umask: umask,\n hrtime: hrtime,\n platform: platform,\n release: release,\n config: config,\n uptime: uptime\n};\n","exports = module.exports = SemVer\n\nvar debug\n/* istanbul ignore next */\nif (typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)) {\n debug = function () {\n var args = Array.prototype.slice.call(arguments, 0)\n args.unshift('SEMVER')\n console.log.apply(console, args)\n }\n} else {\n debug = function () {}\n}\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0'\n\nvar MAX_LENGTH = 256\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16\n\n// The actual regexps go on exports.re\nvar re = exports.re = []\nvar src = exports.src = []\nvar t = exports.tokens = {}\nvar R = 0\n\nfunction tok (n) {\n t[n] = R++\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ntok('NUMERICIDENTIFIER')\nsrc[t.NUMERICIDENTIFIER] = '0|[1-9]\\\\d*'\ntok('NUMERICIDENTIFIERLOOSE')\nsrc[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ntok('NONNUMERICIDENTIFIER')\nsrc[t.NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*'\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ntok('MAINVERSION')\nsrc[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')'\n\ntok('MAINVERSIONLOOSE')\nsrc[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ntok('PRERELEASEIDENTIFIER')\nsrc[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\ntok('PRERELEASEIDENTIFIERLOOSE')\nsrc[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ntok('PRERELEASE')\nsrc[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'\n\ntok('PRERELEASELOOSE')\nsrc[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ntok('BUILDIDENTIFIER')\nsrc[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ntok('BUILD')\nsrc[t.BUILD] = '(?:\\\\+(' + src[t.BUILDIDENTIFIER] +\n '(?:\\\\.' + src[t.BUILDIDENTIFIER] + ')*))'\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ntok('FULL')\ntok('FULLPLAIN')\nsrc[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +\n src[t.PRERELEASE] + '?' +\n src[t.BUILD] + '?'\n\nsrc[t.FULL] = '^' + src[t.FULLPLAIN] + '$'\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ntok('LOOSEPLAIN')\nsrc[t.LOOSEPLAIN] = '[v=\\\\s]*' + src[t.MAINVERSIONLOOSE] +\n src[t.PRERELEASELOOSE] + '?' +\n src[t.BUILD] + '?'\n\ntok('LOOSE')\nsrc[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'\n\ntok('GTLT')\nsrc[t.GTLT] = '((?:<|>)?=?)'\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ntok('XRANGEIDENTIFIERLOOSE')\nsrc[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*'\ntok('XRANGEIDENTIFIER')\nsrc[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\\\*'\n\ntok('XRANGEPLAIN')\nsrc[t.XRANGEPLAIN] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:' + src[t.PRERELEASE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGEPLAINLOOSE')\nsrc[t.XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:' + src[t.PRERELEASELOOSE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGE')\nsrc[t.XRANGE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAIN] + '$'\ntok('XRANGELOOSE')\nsrc[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ntok('COERCE')\nsrc[t.COERCE] = '(^|[^\\\\d])' +\n '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:$|[^\\\\d])'\ntok('COERCERTL')\nre[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ntok('LONETILDE')\nsrc[t.LONETILDE] = '(?:~>?)'\n\ntok('TILDETRIM')\nsrc[t.TILDETRIM] = '(\\\\s*)' + src[t.LONETILDE] + '\\\\s+'\nre[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')\nvar tildeTrimReplace = '$1~'\n\ntok('TILDE')\nsrc[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'\ntok('TILDELOOSE')\nsrc[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ntok('LONECARET')\nsrc[t.LONECARET] = '(?:\\\\^)'\n\ntok('CARETTRIM')\nsrc[t.CARETTRIM] = '(\\\\s*)' + src[t.LONECARET] + '\\\\s+'\nre[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')\nvar caretTrimReplace = '$1^'\n\ntok('CARET')\nsrc[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'\ntok('CARETLOOSE')\nsrc[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ntok('COMPARATORLOOSE')\nsrc[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'\ntok('COMPARATOR')\nsrc[t.COMPARATOR] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.FULLPLAIN] + ')$|^$'\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ntok('COMPARATORTRIM')\nsrc[t.COMPARATORTRIM] = '(\\\\s*)' + src[t.GTLT] +\n '\\\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'\n\n// this one has to use the /g flag\nre[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')\nvar comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ntok('HYPHENRANGE')\nsrc[t.HYPHENRANGE] = '^\\\\s*(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s*$'\n\ntok('HYPHENRANGELOOSE')\nsrc[t.HYPHENRANGELOOSE] = '^\\\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s*$'\n\n// Star ranges basically just allow anything at all.\ntok('STAR')\nsrc[t.STAR] = '(<|>)?=?\\\\s*\\\\*'\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n debug(i, src[i])\n if (!re[i]) {\n re[i] = new RegExp(src[i])\n }\n}\n\nexports.parse = parse\nfunction parse (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n var r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nexports.valid = valid\nfunction valid (version, options) {\n var v = parse(version, options)\n return v ? v.version : null\n}\n\nexports.clean = clean\nfunction clean (version, options) {\n var s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\n\nexports.SemVer = SemVer\n\nfunction SemVer (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === options.loose) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n }\n\n if (!(this instanceof SemVer)) {\n return new SemVer(version, options)\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n\n var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map(function (id) {\n if (/^[0-9]+$/.test(id)) {\n var num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n}\n\nSemVer.prototype.format = function () {\n this.version = this.major + '.' + this.minor + '.' + this.patch\n if (this.prerelease.length) {\n this.version += '-' + this.prerelease.join('.')\n }\n return this.version\n}\n\nSemVer.prototype.toString = function () {\n return this.version\n}\n\nSemVer.prototype.compare = function (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return this.compareMain(other) || this.comparePre(other)\n}\n\nSemVer.prototype.compareMain = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n}\n\nSemVer.prototype.comparePre = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n var i = 0\n do {\n var a = this.prerelease[i]\n var b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\nSemVer.prototype.compareBuild = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n var i = 0\n do {\n var a = this.build[i]\n var b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n var i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error('invalid increment argument: ' + release)\n }\n this.format()\n this.raw = this.version\n return this\n}\n\nexports.inc = inc\nfunction inc (version, release, loose, identifier) {\n if (typeof (loose) === 'string') {\n identifier = loose\n loose = undefined\n }\n\n try {\n return new SemVer(version, loose).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\n\nexports.diff = diff\nfunction diff (version1, version2) {\n if (eq(version1, version2)) {\n return null\n } else {\n var v1 = parse(version1)\n var v2 = parse(version2)\n var prefix = ''\n if (v1.prerelease.length || v2.prerelease.length) {\n prefix = 'pre'\n var defaultResult = 'prerelease'\n }\n for (var key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\n\nexports.compareIdentifiers = compareIdentifiers\n\nvar numeric = /^[0-9]+$/\nfunction compareIdentifiers (a, b) {\n var anum = numeric.test(a)\n var bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers\nfunction rcompareIdentifiers (a, b) {\n return compareIdentifiers(b, a)\n}\n\nexports.major = major\nfunction major (a, loose) {\n return new SemVer(a, loose).major\n}\n\nexports.minor = minor\nfunction minor (a, loose) {\n return new SemVer(a, loose).minor\n}\n\nexports.patch = patch\nfunction patch (a, loose) {\n return new SemVer(a, loose).patch\n}\n\nexports.compare = compare\nfunction compare (a, b, loose) {\n return new SemVer(a, loose).compare(new SemVer(b, loose))\n}\n\nexports.compareLoose = compareLoose\nfunction compareLoose (a, b) {\n return compare(a, b, true)\n}\n\nexports.compareBuild = compareBuild\nfunction compareBuild (a, b, loose) {\n var versionA = new SemVer(a, loose)\n var versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\n\nexports.rcompare = rcompare\nfunction rcompare (a, b, loose) {\n return compare(b, a, loose)\n}\n\nexports.sort = sort\nfunction sort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(a, b, loose)\n })\n}\n\nexports.rsort = rsort\nfunction rsort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(b, a, loose)\n })\n}\n\nexports.gt = gt\nfunction gt (a, b, loose) {\n return compare(a, b, loose) > 0\n}\n\nexports.lt = lt\nfunction lt (a, b, loose) {\n return compare(a, b, loose) < 0\n}\n\nexports.eq = eq\nfunction eq (a, b, loose) {\n return compare(a, b, loose) === 0\n}\n\nexports.neq = neq\nfunction neq (a, b, loose) {\n return compare(a, b, loose) !== 0\n}\n\nexports.gte = gte\nfunction gte (a, b, loose) {\n return compare(a, b, loose) >= 0\n}\n\nexports.lte = lte\nfunction lte (a, b, loose) {\n return compare(a, b, loose) <= 0\n}\n\nexports.cmp = cmp\nfunction cmp (a, op, b, loose) {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError('Invalid operator: ' + op)\n }\n}\n\nexports.Comparator = Comparator\nfunction Comparator (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n if (!(this instanceof Comparator)) {\n return new Comparator(comp, options)\n }\n\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n}\n\nvar ANY = {}\nComparator.prototype.parse = function (comp) {\n var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var m = comp.match(r)\n\n if (!m) {\n throw new TypeError('Invalid comparator: ' + comp)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n}\n\nComparator.prototype.toString = function () {\n return this.value\n}\n\nComparator.prototype.test = function (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n}\n\nComparator.prototype.intersects = function (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n var rangeTmp\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n rangeTmp = new Range(comp.value, options)\n return satisfies(this.value, rangeTmp, options)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n rangeTmp = new Range(this.value, options)\n return satisfies(comp.semver, rangeTmp, options)\n }\n\n var sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n var sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n var sameSemVer = this.semver.version === comp.semver.version\n var differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n var oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n ((this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<'))\n var oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n ((this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>'))\n\n return sameDirectionIncreasing || sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan || oppositeDirectionsGreaterThan\n}\n\nexports.Range = Range\nfunction Range (range, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (range instanceof Range) {\n if (range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n return new Range(range.value, options)\n }\n\n if (!(this instanceof Range)) {\n return new Range(range, options)\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First, split based on boolean or ||\n this.raw = range\n this.set = range.split(/\\s*\\|\\|\\s*/).map(function (range) {\n return this.parseRange(range.trim())\n }, this).filter(function (c) {\n // throw out any that are not relevant for whatever reason\n return c.length\n })\n\n if (!this.set.length) {\n throw new TypeError('Invalid SemVer Range: ' + range)\n }\n\n this.format()\n}\n\nRange.prototype.format = function () {\n this.range = this.set.map(function (comps) {\n return comps.join(' ').trim()\n }).join('||').trim()\n return this.range\n}\n\nRange.prototype.toString = function () {\n return this.range\n}\n\nRange.prototype.parseRange = function (range) {\n var loose = this.options.loose\n range = range.trim()\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace)\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, re[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n var set = range.split(' ').map(function (comp) {\n return parseComparator(comp, this.options)\n }, this).join(' ').split(/\\s+/)\n if (this.options.loose) {\n // in loose mode, throw out any that are not valid comparators\n set = set.filter(function (comp) {\n return !!comp.match(compRe)\n })\n }\n set = set.map(function (comp) {\n return new Comparator(comp, this.options)\n }, this)\n\n return set\n}\n\nRange.prototype.intersects = function (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some(function (thisComparators) {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some(function (rangeComparators) {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every(function (thisComparator) {\n return rangeComparators.every(function (rangeComparator) {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n}\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nfunction isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators\nfunction toComparators (range, options) {\n return new Range(range, options).set.map(function (comp) {\n return comp.map(function (c) {\n return c.value\n }).join(' ').trim().split(' ')\n })\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator (comp, options) {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nfunction isX (id) {\n return !id || id.toLowerCase() === 'x' || id === '*'\n}\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","module.exports={A:\"ie\",B:\"edge\",C:\"firefox\",D:\"chrome\",E:\"safari\",F:\"opera\",G:\"ios_saf\",H:\"op_mini\",I:\"android\",J:\"bb\",K:\"op_mob\",L:\"and_chr\",M:\"and_ff\",N:\"ie_mob\",O:\"and_uc\",P:\"samsung\",Q:\"and_qq\",R:\"baidu\",S:\"kaios\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browsers = exports.browsers = require('../../data/browsers');","module.exports={\"0\":\"56\",\"1\":\"57\",\"2\":\"58\",\"3\":\"60\",\"4\":\"62\",\"5\":\"63\",\"6\":\"64\",\"7\":\"11.1\",\"8\":\"68\",\"9\":\"12.1\",A:\"10\",B:\"11\",C:\"12\",D:\"7\",E:\"9\",F:\"4\",G:\"8\",H:\"6\",I:\"17\",J:\"18\",K:\"13\",L:\"15\",M:\"46\",N:\"16\",O:\"5\",P:\"19\",Q:\"20\",R:\"21\",S:\"22\",T:\"23\",U:\"24\",V:\"25\",W:\"26\",X:\"27\",Y:\"28\",Z:\"29\",a:\"30\",b:\"31\",c:\"32\",d:\"33\",e:\"34\",f:\"14\",g:\"36\",h:\"37\",i:\"38\",j:\"39\",k:\"40\",l:\"41\",m:\"42\",n:\"43\",o:\"44\",p:\"45\",q:\"76\",r:\"47\",s:\"48\",t:\"49\",u:\"50\",v:\"51\",w:\"52\",x:\"53\",y:\"54\",z:\"55\",AB:\"35\",BB:\"66\",CB:\"4.2-4.3\",DB:\"65\",EB:\"59\",FB:\"67\",GB:\"11.5\",HB:\"69\",IB:\"70\",JB:\"71\",KB:\"72\",LB:\"73\",MB:\"61\",NB:\"3\",OB:\"10.1\",PB:\"3.2\",QB:\"78\",RB:\"9.0-9.2\",SB:\"77\",TB:\"80\",UB:\"81\",VB:\"3.1\",WB:\"75\",XB:\"5.1\",YB:\"6.1\",ZB:\"7.1\",aB:\"9.1\",bB:\"74\",cB:\"3.6\",dB:\"3.5\",eB:\"TP\",fB:\"9.5-9.6\",gB:\"10.0-10.1\",hB:\"10.5\",iB:\"10.6\",jB:\"2\",kB:\"11.6\",lB:\"4.0-4.1\",mB:\"5.5\",nB:\"5.0-5.1\",oB:\"6.0-6.1\",pB:\"7.0-7.1\",qB:\"8.1-8.4\",rB:\"79\",sB:\"9.3\",tB:\"10.0-10.2\",uB:\"10.3\",vB:\"11.0-11.2\",wB:\"11.3-11.4\",xB:\"12.0-12.1\",yB:\"12.2-12.4\",zB:\"13.0-13.1\",\"0B\":\"13.2\",\"1B\":\"13.3\",\"2B\":\"all\",\"3B\":\"2.1\",\"4B\":\"2.2\",\"5B\":\"2.3\",\"6B\":\"4.1\",\"7B\":\"4.4\",\"8B\":\"4.4.3-4.4.4\",\"9B\":\"12.12\",AC:\"5.0-5.4\",BC:\"6.2-6.4\",CC:\"7.2-7.4\",DC:\"8.2\",EC:\"9.2\",FC:\"1.2\",GC:\"7.12\",HC:\"2.5\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browserVersions = exports.browserVersions = require('../../data/browserVersions');","module.exports={A:{A:{H:0.0092277,D:0.0092277,G:0.110732,E:0.0415246,A:0.0369108,B:1.43029,mB:0.009298},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"mB\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE\",F:{mB:962323200,H:998870400,D:1161129600,G:1237420800,E:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.008806,K:0.008806,f:0.017612,L:0.017612,N:0.039627,I:0.149702,J:1.79642,q:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"q\",\"\",\"\"],E:\"Edge\",F:{C:1438128000,K:1447286400,f:1470096000,L:1491868800,N:1508198400,I:1525046400,J:1542067200,q:null},D:{C:\"ms\",K:\"ms\",f:\"ms\",L:\"ms\",N:\"ms\",I:\"ms\",J:\"ms\"}},C:{A:{\"0\":0.026418,\"1\":0.013209,\"2\":0.008806,\"3\":0.039627,\"4\":0.008806,\"5\":0.017612,\"6\":0.026418,\"8\":0.13209,jB:0.004827,NB:0.00487,F:0.00974,O:0.004879,H:0.020136,D:0.005725,G:0.004525,E:0.00533,A:0.004283,B:0.009042,C:0.004471,K:0.004486,f:0.00453,L:0.004465,N:0.004417,I:0.008922,J:0.004393,P:0.004443,Q:0.004283,R:0.008806,S:0.004393,T:0.004525,U:0.008786,V:0.004403,W:0.004317,X:0.004393,Y:0.004418,Z:0.008834,a:0.004403,b:0.008928,c:0.004471,d:0.008922,e:0.004707,AB:0.022015,g:0.004465,h:0.004783,i:0.008806,j:0.004783,k:0.00487,l:0.005029,m:0.0047,n:0.008806,o:0.008806,p:0.013209,M:0.004525,r:0.022015,s:0.030821,t:0.004403,u:0.013209,v:0.008806,w:0.145299,x:0.008806,y:0.013209,z:0.008806,EB:0.008806,MB:0.013209,DB:0.052836,BB:0.04403,FB:0.026418,HB:0.074851,IB:0.761719,JB:2.42605,KB:0.057239,LB:0,dB:0.008786,cB:0.00487},B:\"moz\",C:[\"\",\"\",\"\",\"jB\",\"NB\",\"dB\",\"cB\",\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"\"],E:\"Firefox\",F:{\"0\":1506556800,\"1\":1510617600,\"2\":1516665600,\"3\":1525824000,\"4\":1536105600,\"5\":1540252800,\"6\":1544486400,\"8\":1562630400,jB:1161648000,NB:1213660800,dB:1246320000,cB:1264032000,F:1300752000,O:1308614400,H:1313452800,D:1317081600,G:1317081600,E:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,f:1338854400,L:1342483200,N:1346112000,I:1349740800,J:1353628800,P:1357603200,Q:1361232000,R:1364860800,S:1368489600,T:1372118400,U:1375747200,V:1379376000,W:1386633600,X:1391472000,Y:1395100800,Z:1398729600,a:1402358400,b:1405987200,c:1409616000,d:1413244800,e:1417392000,AB:1421107200,g:1424736000,h:1428278400,i:1431475200,j:1435881600,k:1439251200,l:1442880000,m:1446508800,n:1450137600,o:1453852800,p:1457395200,M:1461628800,r:1465257600,s:1470096000,t:1474329600,u:1479168000,v:1485216000,w:1488844800,x:1492560000,y:1497312000,z:1502150400,EB:1520985600,MB:1529971200,DB:1548720000,BB:1552953600,FB:1558396800,HB:1567468800,IB:1571788800,JB:1575331200,KB:null,LB:null}},D:{A:{\"0\":0.035224,\"1\":0.066045,\"2\":0.030821,\"3\":0.030821,\"4\":0.030821,\"5\":0.277389,\"6\":0.017612,\"8\":0.061642,F:0.004706,O:0.004879,H:0.004879,D:0.005591,G:0.005591,E:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.004403,f:0.004706,L:0.015087,N:0.004393,I:0.004393,J:0.008652,P:0.004418,Q:0.004393,R:0.004317,S:0.004465,T:0.008786,U:0.008806,V:0.004461,W:0.004403,X:0.004326,Y:0.0047,Z:0.004461,a:0.004403,b:0.013209,c:0.004465,d:0.013209,e:0.008806,AB:0.008806,g:0.008806,h:0.004464,i:0.022015,j:0.004464,k:0.013209,l:0.008806,m:0.004403,n:0.017612,o:0.004465,p:0.004403,M:0.004403,r:0.008806,s:0.035224,t:0.515151,u:0.008806,v:0.013209,w:0.004403,x:0.022015,y:0.026418,z:0.04403,EB:0.017612,MB:0.035224,DB:0.052836,BB:0.035224,FB:0.066045,HB:0.184926,IB:0.149702,JB:0.198135,KB:0.206941,LB:0.184926,bB:0.224553,WB:0.268583,q:0.281792,SB:0.409479,QB:13.9971,rB:11.5006,TB:0.039627,UB:0.017612},B:\"webkit\",C:[\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"bB\",\"WB\",\"q\",\"SB\",\"QB\",\"rB\",\"TB\",\"UB\"],E:\"Chrome\",F:{\"0\":1485302400,\"1\":1489017600,\"2\":1492560000,\"3\":1500940800,\"4\":1508198400,\"5\":1512518400,\"6\":1516752000,\"8\":1532390400,F:1264377600,O:1274745600,H:1283385600,D:1287619200,G:1291248000,E:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,f:1316131200,L:1316131200,N:1319500800,I:1323734400,J:1328659200,P:1332892800,Q:1337040000,R:1340668800,S:1343692800,T:1348531200,U:1352246400,V:1357862400,W:1361404800,X:1364428800,Y:1369094400,Z:1374105600,a:1376956800,b:1384214400,c:1389657600,d:1392940800,e:1397001600,AB:1400544000,g:1405468800,h:1409011200,i:1412640000,j:1416268800,k:1421798400,l:1425513600,m:1429401600,n:1432080000,o:1437523200,p:1441152000,M:1444780800,r:1449014400,s:1453248000,t:1456963200,u:1460592000,v:1464134400,w:1469059200,x:1472601600,y:1476230400,z:1480550400,EB:1496707200,MB:1504569600,DB:1520294400,BB:1523923200,FB:1527552000,HB:1536019200,IB:1539648000,JB:1543968000,KB:1548720000,LB:1552348800,bB:1555977600,WB:1559606400,q:1564444800,SB:1568073600,QB:1571702400,rB:null,TB:null,UB:null}},E:{A:{\"7\":0.184926,\"9\":0.435897,F:0,O:0.004403,H:0.004349,D:0.004465,G:0.026418,E:0.013209,A:0.017612,B:0.039627,C:0.136493,K:2.29396,VB:0,PB:0.008692,XB:0.66045,YB:0.00456,ZB:0.004283,aB:0.035224,OB:0.096866,eB:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"VB\",\"PB\",\"F\",\"O\",\"XB\",\"H\",\"YB\",\"D\",\"ZB\",\"G\",\"E\",\"aB\",\"A\",\"OB\",\"B\",\"7\",\"C\",\"9\",\"K\",\"eB\",\"\",\"\"],E:\"Safari\",F:{\"7\":1522281600,\"9\":1553472000,VB:1205798400,PB:1226534400,F:1244419200,O:1275868800,XB:1311120000,H:1343174400,YB:1382400000,D:1382400000,ZB:1410998400,G:1413417600,E:1443657600,aB:1458518400,A:1474329600,OB:1490572800,B:1505779200,C:1537142400,K:1568851200,eB:null}},F:{A:{\"0\":0.008806,\"1\":0.008806,\"2\":0.013209,\"3\":0.004403,\"4\":0.004403,\"5\":0.013209,\"6\":0.070448,\"7\":0.006229,\"9\":0.008806,E:0.0082,B:0.016581,C:0.004317,L:0.00685,N:0.00685,I:0.00685,J:0.005014,P:0.006015,Q:0.004879,R:0.006597,S:0.006597,T:0.013434,U:0.006702,V:0.006015,W:0.005595,X:0.004393,Y:0.008652,Z:0.004879,a:0.004879,b:0.008806,c:0.005152,d:0.005014,e:0.009758,AB:0.004879,g:0.013209,h:0.004283,i:0.004367,j:0.004534,k:0.004367,l:0.004227,m:0.004418,n:0.009042,o:0.004227,p:0.004725,M:0.004417,r:0.008942,s:0.004707,t:0.004827,u:0.004707,v:0.004707,w:0.004326,x:0.008922,y:0.014349,z:0.004725,fB:0.00685,gB:0,hB:0.008392,iB:0.004706,GB:0.004879,kB:0.008786},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"E\",\"fB\",\"gB\",\"hB\",\"iB\",\"B\",\"7\",\"GB\",\"kB\",\"C\",\"9\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"\",\"\",\"\"],E:\"Opera\",F:{\"0\":1537833600,\"1\":1543363200,\"2\":1548201600,\"3\":1554768000,\"4\":1561593600,\"5\":1566259200,\"6\":1570406400,\"7\":1302566400,\"9\":1352073600,E:1150761600,fB:1223424000,gB:1251763200,hB:1267488000,iB:1277942400,B:1292457600,GB:1309219200,kB:1323129600,C:1323129600,L:1372723200,N:1377561600,I:1381104000,J:1386288000,P:1390867200,Q:1393891200,R:1399334400,S:1401753600,T:1405987200,U:1409616000,V:1413331200,W:1417132800,X:1422316800,Y:1425945600,Z:1430179200,a:1433808000,b:1438646400,c:1442448000,d:1445904000,e:1449100800,AB:1454371200,g:1457308800,h:1462320000,i:1465344000,j:1470096000,k:1474329600,l:1477267200,m:1481587200,n:1486425600,o:1490054400,p:1494374400,M:1498003200,r:1502236800,s:1506470400,t:1510099200,u:1515024000,v:1517961600,w:1521676800,x:1525910400,y:1530144000,z:1534982400},D:{\"7\":\"o\",\"9\":\"o\",E:\"o\",B:\"o\",C:\"o\",fB:\"o\",gB:\"o\",hB:\"o\",iB:\"o\",GB:\"o\",kB:\"o\"}},G:{A:{G:0.00128072,PB:0.00512289,lB:0.00256144,CB:0,nB:0.00768433,oB:0.00256144,pB:0.00896505,qB:0.0166494,RB:0.0153687,sB:0.162652,tB:0.0563518,uB:0.181862,vB:0.153687,wB:0.274074,xB:0.391901,yB:2.77404,zB:4.02787,\"0B\":1.83399,\"1B\":2.88931},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"PB\",\"lB\",\"CB\",\"nB\",\"oB\",\"pB\",\"G\",\"qB\",\"RB\",\"sB\",\"tB\",\"uB\",\"vB\",\"wB\",\"xB\",\"yB\",\"zB\",\"0B\",\"1B\",\"\",\"\"],E:\"iOS Safari\",F:{PB:1270252800,lB:1283904000,CB:1299628800,nB:1331078400,oB:1359331200,pB:1394409600,G:1410912000,qB:1413763200,RB:1442361600,sB:1458518400,tB:1473724800,uB:1490572800,vB:1505779200,wB:1522281600,xB:1537142400,yB:1553472000,zB:1568851200,\"0B\":1572220800,\"1B\":null}},H:{A:{\"2B\":1.16575},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"2B\",\"\",\"\",\"\"],E:\"Opera Mini\",F:{\"2B\":1426464000}},I:{A:{NB:0.000748894,F:0.00324521,q:0,\"3B\":0,\"4B\":0.000499263,\"5B\":0.000499263,\"6B\":0.00574152,CB:0.125565,\"7B\":0,\"8B\":0.0763872},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"3B\",\"4B\",\"5B\",\"NB\",\"F\",\"6B\",\"CB\",\"7B\",\"8B\",\"q\",\"\",\"\",\"\"],E:\"Android Browser\",F:{\"3B\":1256515200,\"4B\":1274313600,\"5B\":1291593600,NB:1298332800,F:1318896000,\"6B\":1341792000,CB:1374624000,\"7B\":1386547200,\"8B\":1401667200,q:1566777600}},J:{A:{D:0,A:0.011194},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"D\",\"A\",\"\",\"\",\"\"],E:\"Blackberry Browser\",F:{D:1325376000,A:1359504000}},K:{A:{\"7\":0,\"9\":0,A:0,B:0,C:0,M:0.0111391,GB:0},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"7\",\"GB\",\"C\",\"9\",\"M\",\"\",\"\",\"\"],E:\"Opera Mobile\",F:{\"7\":1314835200,\"9\":1349740800,A:1287100800,B:1300752000,GB:1318291200,C:1330300800,M:1474588800},D:{M:\"webkit\"}},L:{A:{QB:35.1619},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"QB\",\"\",\"\",\"\"],E:\"Chrome for Android\",F:{QB:1571702400}},M:{A:{\"8\":0.229477},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"8\",\"\",\"\",\"\"],E:\"Firefox for Android\",F:{\"8\":1567468800}},N:{A:{A:0.0115934,B:0.050373},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE Mobile\",F:{A:1340150400,B:1353456000}},O:{A:{\"9B\":2.88246},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"9B\",\"\",\"\",\"\"],E:\"UC Browser for Android\",F:{\"9B\":1471392000},D:{\"9B\":\"webkit\"}},P:{A:{F:0.33211,AC:0.0311353,BC:0.0207569,CC:0.114163,DC:0.0415137,EC:0.321732,OB:2.72953},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"F\",\"AC\",\"BC\",\"CC\",\"DC\",\"EC\",\"OB\",\"\",\"\",\"\"],E:\"Samsung Internet\",F:{F:1461024000,AC:1481846400,BC:1509408000,CC:1528329600,DC:1546128000,EC:1554163200,OB:1567900800}},Q:{A:{FC:0.201492},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"FC\",\"\",\"\",\"\"],E:\"QQ Browser\",F:{FC:1483228800}},R:{A:{GC:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"GC\",\"\",\"\",\"\"],E:\"Baidu Browser\",F:{GC:1491004800}},S:{A:{HC:0.195895},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"HC\",\"\",\"\",\"\"],E:\"KaiOS Browser\",F:{HC:1527811200}}};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.agents = undefined;\n\nvar _browsers = require('./browsers');\n\nvar _browserVersions = require('./browserVersions');\n\nvar agentsData = require('../../data/agents');\n\nfunction unpackBrowserVersions(versionsData) {\n return Object.keys(versionsData).reduce(function (usage, version) {\n usage[_browserVersions.browserVersions[version]] = versionsData[version];\n return usage;\n }, {});\n}\n\nvar agents = exports.agents = Object.keys(agentsData).reduce(function (map, key) {\n var versionsData = agentsData[key];\n map[_browsers.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) {\n if (entry === 'A') {\n data.usage_global = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'C') {\n data.versions = versionsData[entry].reduce(function (list, version) {\n if (version === '') {\n list.push(null);\n } else {\n list.push(_browserVersions.browserVersions[version]);\n }\n return list;\n }, []);\n } else if (entry === 'D') {\n data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'E') {\n data.browser = versionsData[entry];\n } else if (entry === 'F') {\n data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) {\n map[_browserVersions.browserVersions[key]] = versionsData[entry][key];\n return map;\n }, {});\n } else {\n // entry is B\n data.prefix = versionsData[entry];\n }\n return data;\n }, {});\n return map;\n}, {});","module.exports = {\n\t\"8.0\": \"79\",\n\t\"7.1\": \"78\",\n\t\"7.0\": \"78\",\n\t\"6.1\": \"76\",\n\t\"6.0\": \"76\",\n\t\"5.0\": \"72\",\n\t\"4.2\": \"69\",\n\t\"4.1\": \"69\",\n\t\"4.0\": \"69\",\n\t\"3.1\": \"66\",\n\t\"3.0\": \"66\",\n\t\"2.1\": \"61\",\n\t\"2.0\": \"61\",\n\t\"1.8\": \"59\",\n\t\"1.7\": \"58\",\n\t\"1.6\": \"56\",\n\t\"1.5\": \"54\",\n\t\"1.4\": \"53\",\n\t\"1.3\": \"52\",\n\t\"1.2\": \"51\",\n\t\"1.1\": \"50\",\n\t\"1.0\": \"49\",\n\t\"0.37\": \"49\",\n\t\"0.36\": \"47\",\n\t\"0.35\": \"45\",\n\t\"0.34\": \"45\",\n\t\"0.33\": \"45\",\n\t\"0.32\": \"45\",\n\t\"0.31\": \"44\",\n\t\"0.30\": \"44\",\n\t\"0.29\": \"43\",\n\t\"0.28\": \"43\",\n\t\"0.27\": \"42\",\n\t\"0.26\": \"42\",\n\t\"0.25\": \"42\",\n\t\"0.24\": \"41\",\n\t\"0.23\": \"41\",\n\t\"0.22\": \"41\",\n\t\"0.21\": \"40\",\n\t\"0.20\": \"39\"\n};","function BrowserslistError (message) {\n this.name = 'BrowserslistError'\n this.message = message\n this.browserslist = true\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrowserslistError)\n }\n}\n\nBrowserslistError.prototype = Error.prototype\n\nmodule.exports = BrowserslistError\n","var BrowserslistError = require('./error')\n\nfunction noop () { }\n\nmodule.exports = {\n loadQueries: function loadQueries () {\n throw new BrowserslistError(\n 'Sharable configs are not supported in client-side build of Browserslist')\n },\n\n getStat: function getStat (opts) {\n return opts.stats\n },\n\n loadConfig: function loadConfig (opts) {\n if (opts.config) {\n throw new BrowserslistError(\n 'Browserslist config are not supported in client-side build')\n }\n },\n\n loadCountry: function loadCountry () {\n throw new BrowserslistError(\n 'Country statistics is not supported ' +\n 'in client-side build of Browserslist')\n },\n\n currentNode: function currentNode (resolve, context) {\n return resolve(['maintained node versions'], context)[0]\n },\n\n parseConfig: noop,\n\n readConfig: noop,\n\n findConfig: noop,\n\n clearCaches: noop,\n\n oldDataWarning: noop\n}\n","var jsReleases = require('node-releases/data/processed/envs.json')\nvar agents = require('caniuse-lite/dist/unpacker/agents').agents\nvar jsEOL = require('node-releases/data/release-schedule/release-schedule.json')\nvar path = require('path')\nvar e2c = require('electron-to-chromium/versions')\n\nvar BrowserslistError = require('./error')\nvar env = require('./node') // Will load browser.js in webpack\n\nvar YEAR = 365.259641 * 24 * 60 * 60 * 1000\nvar ANDROID_EVERGREEN_FIRST = 37\n\nvar QUERY_OR = 1\nvar QUERY_AND = 2\n\nfunction isVersionsMatch (versionA, versionB) {\n return (versionA + '.').indexOf(versionB + '.') === 0\n}\n\nfunction isEolReleased (name) {\n var version = name.slice(1)\n return jsReleases.some(function (i) {\n return isVersionsMatch(i.version, version)\n })\n}\n\nfunction normalize (versions) {\n return versions.filter(function (version) {\n return typeof version === 'string'\n })\n}\n\nfunction normalizeElectron (version) {\n var versionToUse = version\n if (version.split('.').length === 3) {\n versionToUse = version\n .split('.')\n .slice(0, -1)\n .join('.')\n }\n return versionToUse\n}\n\nfunction nameMapper (name) {\n return function mapName (version) {\n return name + ' ' + version\n }\n}\n\nfunction getMajor (version) {\n return parseInt(version.split('.')[0])\n}\n\nfunction getMajorVersions (released, number) {\n if (released.length === 0) return []\n var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1\n var selected = []\n for (var i = released.length - 1; i >= 0; i--) {\n if (minimum > getMajor(released[i])) break\n selected.unshift(released[i])\n }\n return selected\n}\n\nfunction uniq (array) {\n var filtered = []\n for (var i = 0; i < array.length; i++) {\n if (filtered.indexOf(array[i]) === -1) filtered.push(array[i])\n }\n return filtered\n}\n\n// Helpers\n\nfunction fillUsage (result, name, data) {\n for (var i in data) {\n result[name + ' ' + i] = data[i]\n }\n}\n\nfunction generateFilter (sign, version) {\n version = parseFloat(version)\n if (sign === '>') {\n return function (v) {\n return parseFloat(v) > version\n }\n } else if (sign === '>=') {\n return function (v) {\n return parseFloat(v) >= version\n }\n } else if (sign === '<') {\n return function (v) {\n return parseFloat(v) < version\n }\n } else {\n return function (v) {\n return parseFloat(v) <= version\n }\n }\n}\n\nfunction generateSemverFilter (sign, version) {\n version = version.split('.').map(parseSimpleInt)\n version[1] = version[1] || 0\n version[2] = version[2] || 0\n if (sign === '>') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) > 0\n }\n } else if (sign === '>=') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) >= 0\n }\n } else if (sign === '<') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) > 0\n }\n } else {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) >= 0\n }\n }\n}\n\nfunction parseSimpleInt (x) {\n return parseInt(x)\n}\n\nfunction compare (a, b) {\n if (a < b) return -1\n if (a > b) return +1\n return 0\n}\n\nfunction compareSemver (a, b) {\n return (\n compare(parseInt(a[0]), parseInt(b[0])) ||\n compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) ||\n compare(parseInt(a[2] || '0'), parseInt(b[2] || '0'))\n )\n}\n\nfunction resolveVersion (data, version) {\n if (data.versions.indexOf(version) !== -1) {\n return version\n } else if (browserslist.versionAliases[data.name][version]) {\n return browserslist.versionAliases[data.name][version]\n } else {\n return false\n }\n}\n\nfunction normalizeVersion (data, version) {\n var resolved = resolveVersion(data, version)\n if (resolved) {\n return resolved\n } else if (data.versions.length === 1) {\n return data.versions[0]\n } else {\n return false\n }\n}\n\nfunction filterByYear (since, context) {\n since = since / 1000\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var versions = Object.keys(data.releaseDate).filter(function (v) {\n return data.releaseDate[v] >= since\n })\n return selected.concat(versions.map(nameMapper(data.name)))\n }, [])\n}\n\nfunction cloneData (data) {\n return {\n name: data.name,\n versions: data.versions,\n released: data.released,\n releaseDate: data.releaseDate\n }\n}\n\nfunction byName (name, context) {\n name = name.toLowerCase()\n name = browserslist.aliases[name] || name\n if (context.mobileToDesktop && browserslist.desktopNames[name]) {\n var desktop = browserslist.data[browserslist.desktopNames[name]]\n if (name === 'android') {\n return normalizeAndroidData(cloneData(browserslist.data[name]), desktop)\n } else {\n var cloned = cloneData(desktop)\n cloned.name = name\n return cloned\n }\n }\n return browserslist.data[name]\n}\n\nfunction normalizeAndroidVersions (androidVersions, chromeVersions) {\n var firstEvergreen = ANDROID_EVERGREEN_FIRST\n var last = chromeVersions[chromeVersions.length - 1]\n return androidVersions\n .filter(function (version) { return /^(?:[2-4]\\.|[34]$)/.test(version) })\n .concat(chromeVersions.slice(firstEvergreen - last - 1))\n}\n\nfunction normalizeAndroidData (android, chrome) {\n android.released = normalizeAndroidVersions(android.released, chrome.released)\n android.versions = normalizeAndroidVersions(android.versions, chrome.versions)\n return android\n}\n\nfunction checkName (name, context) {\n var data = byName(name, context)\n if (!data) throw new BrowserslistError('Unknown browser ' + name)\n return data\n}\n\nfunction unknownQuery (query) {\n return new BrowserslistError(\n 'Unknown browser query `' + query + '`. ' +\n 'Maybe you are using old Browserslist or made typo in query.'\n )\n}\n\nfunction filterAndroid (list, versions, context) {\n if (context.mobileToDesktop) return list\n var released = browserslist.data.android.released\n var last = released[released.length - 1]\n var diff = last - ANDROID_EVERGREEN_FIRST - versions\n if (diff > 0) {\n return list.slice(-1)\n } else {\n return list.slice(diff - 1)\n }\n}\n\n/**\n * Resolves queries into a browser list.\n * @param {string|string[]} queries Queries to combine.\n * Either an array of queries or a long string of queries.\n * @param {object} [context] Optional arguments to\n * the select function in `queries`.\n * @returns {string[]} A list of browsers\n */\nfunction resolve (queries, context) {\n if (Array.isArray(queries)) {\n queries = flatten(queries.map(parse))\n } else {\n queries = parse(queries)\n }\n\n return queries.reduce(function (result, query, index) {\n var selection = query.queryString\n\n var isExclude = selection.indexOf('not ') === 0\n if (isExclude) {\n if (index === 0) {\n throw new BrowserslistError(\n 'Write any browsers query (for instance, `defaults`) ' +\n 'before `' + selection + '`')\n }\n selection = selection.slice(4)\n }\n\n for (var i = 0; i < QUERIES.length; i++) {\n var type = QUERIES[i]\n var match = selection.match(type.regexp)\n if (match) {\n var args = [context].concat(match.slice(1))\n var array = type.select.apply(browserslist, args).map(function (j) {\n var parts = j.split(' ')\n if (parts[1] === '0') {\n return parts[0] + ' ' + byName(parts[0], context).versions[0]\n } else {\n return j\n }\n })\n\n switch (query.type) {\n case QUERY_AND:\n if (isExclude) {\n return result.filter(function (j) {\n return array.indexOf(j) === -1\n })\n } else {\n return result.filter(function (j) {\n return array.indexOf(j) !== -1\n })\n }\n case QUERY_OR:\n default:\n if (isExclude) {\n var filter = { }\n array.forEach(function (j) {\n filter[j] = true\n })\n return result.filter(function (j) {\n return !filter[j]\n })\n }\n return result.concat(array)\n }\n }\n }\n\n throw unknownQuery(selection)\n }, [])\n}\n\nvar cache = { }\n\n/**\n * Return array of browsers by selection queries.\n *\n * @param {(string|string[])} [queries=browserslist.defaults] Browser queries.\n * @param {object} [opts] Options.\n * @param {string} [opts.path=\".\"] Path to processed file.\n * It will be used to find config files.\n * @param {string} [opts.env=\"production\"] Processing environment.\n * It will be used to take right\n * queries from config file.\n * @param {string} [opts.config] Path to config file with queries.\n * @param {object} [opts.stats] Custom browser usage statistics\n * for \"> 1% in my stats\" query.\n * @param {boolean} [opts.ignoreUnknownVersions=false] Do not throw on unknown\n * version in direct query.\n * @param {boolean} [opts.dangerousExtend] Disable security checks\n * for extend query.\n * @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop\n * version when Can I Use doesn't have\n * data about the specified version.\n * @returns {string[]} Array with browser names in Can I Use.\n *\n * @example\n * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']\n */\nfunction browserslist (queries, opts) {\n if (typeof opts === 'undefined') opts = { }\n\n if (typeof opts.path === 'undefined') {\n opts.path = path.resolve ? path.resolve('.') : '.'\n }\n\n if (typeof queries === 'undefined' || queries === null) {\n var config = browserslist.loadConfig(opts)\n if (config) {\n queries = config\n } else {\n queries = browserslist.defaults\n }\n }\n\n if (!(typeof queries === 'string' || Array.isArray(queries))) {\n throw new BrowserslistError(\n 'Browser queries must be an array or string. Got ' + typeof queries + '.')\n }\n\n var context = {\n ignoreUnknownVersions: opts.ignoreUnknownVersions,\n dangerousExtend: opts.dangerousExtend,\n mobileToDesktop: opts.mobileToDesktop\n }\n\n env.oldDataWarning(browserslist.data)\n var stats = env.getStat(opts, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n\n var cacheKey = JSON.stringify([queries, context])\n if (cache[cacheKey]) return cache[cacheKey]\n\n var result = uniq(resolve(queries, context)).sort(function (name1, name2) {\n name1 = name1.split(' ')\n name2 = name2.split(' ')\n if (name1[0] === name2[0]) {\n // assumptions on caniuse data\n // 1) version ranges never overlaps\n // 2) if version is not a range, it never contains `-`\n var version1 = name1[1].split('-')[0]\n var version2 = name2[1].split('-')[0]\n return compareSemver(version2.split('.'), version1.split('.'))\n } else {\n return compare(name1[0], name2[0])\n }\n })\n if (!process.env.BROWSERSLIST_DISABLE_CACHE) {\n cache[cacheKey] = result\n }\n return result\n}\n\nfunction parse (queries) {\n var qs = []\n do {\n queries = doMatch(queries, qs)\n } while (queries)\n return qs\n}\n\nfunction doMatch (string, qs) {\n var or = /^(?:,\\s*|\\s+or\\s+)(.*)/i\n var and = /^\\s+and\\s+(.*)/i\n\n return find(string, function (parsed, n, max) {\n if (and.test(parsed)) {\n qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })\n return true\n } else if (or.test(parsed)) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })\n return true\n } else if (n === max) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })\n return true\n }\n return false\n })\n}\n\nfunction find (string, predicate) {\n for (var n = 1, max = string.length; n <= max; n++) {\n var parsed = string.substr(-n, n)\n if (predicate(parsed, n, max)) {\n return string.slice(0, -n)\n }\n }\n return ''\n}\n\nfunction flatten (array) {\n if (!Array.isArray(array)) return [array]\n return array.reduce(function (a, b) {\n return a.concat(flatten(b))\n }, [])\n}\n\n// Will be filled by Can I Use data below\nbrowserslist.data = { }\nbrowserslist.usage = {\n global: { },\n custom: null\n}\n\n// Default browsers query\nbrowserslist.defaults = [\n '> 0.5%',\n 'last 2 versions',\n 'Firefox ESR',\n 'not dead'\n]\n\n// Browser names aliases\nbrowserslist.aliases = {\n fx: 'firefox',\n ff: 'firefox',\n ios: 'ios_saf',\n explorer: 'ie',\n blackberry: 'bb',\n explorermobile: 'ie_mob',\n operamini: 'op_mini',\n operamobile: 'op_mob',\n chromeandroid: 'and_chr',\n firefoxandroid: 'and_ff',\n ucandroid: 'and_uc',\n qqandroid: 'and_qq'\n}\n\n// Can I Use only provides a few versions for some browsers (e.g. and_chr).\n// Fallback to a similar browser for unknown versions\nbrowserslist.desktopNames = {\n and_chr: 'chrome',\n and_ff: 'firefox',\n ie_mob: 'ie',\n op_mob: 'opera',\n android: 'chrome' // has extra processing logic\n}\n\n// Aliases to work with joined versions like `ios_saf 7.0-7.1`\nbrowserslist.versionAliases = { }\n\nbrowserslist.clearCaches = env.clearCaches\nbrowserslist.parseConfig = env.parseConfig\nbrowserslist.readConfig = env.readConfig\nbrowserslist.findConfig = env.findConfig\nbrowserslist.loadConfig = env.loadConfig\n\n/**\n * Return browsers market coverage.\n *\n * @param {string[]} browsers Browsers names in Can I Use.\n * @param {string|object} [stats=\"global\"] Which statistics should be used.\n * Country code or custom statistics.\n * Pass `\"my stats\"` to load statistics\n * from Browserslist files.\n *\n * @return {number} Total market coverage for all selected browsers.\n *\n * @example\n * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1\n */\nbrowserslist.coverage = function (browsers, stats) {\n var data\n if (typeof stats === 'undefined') {\n data = browserslist.usage.global\n } else if (stats === 'my stats') {\n var opts = {}\n opts.path = path.resolve ? path.resolve('.') : '.'\n var customStats = env.getStat(opts)\n if (!customStats) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n data = {}\n for (var browser in customStats) {\n fillUsage(data, browser, customStats[browser])\n }\n } else if (typeof stats === 'string') {\n if (stats.length > 2) {\n stats = stats.toLowerCase()\n } else {\n stats = stats.toUpperCase()\n }\n env.loadCountry(browserslist.usage, stats)\n data = browserslist.usage[stats]\n } else {\n if ('dataByBrowser' in stats) {\n stats = stats.dataByBrowser\n }\n data = { }\n for (var name in stats) {\n for (var version in stats[name]) {\n data[name + ' ' + version] = stats[name][version]\n }\n }\n }\n\n return browsers.reduce(function (all, i) {\n var usage = data[i]\n if (usage === undefined) {\n usage = data[i.replace(/ \\S+$/, ' 0')]\n }\n return all + (usage || 0)\n }, 0)\n}\n\nvar QUERIES = [\n {\n regexp: /^last\\s+(\\d+)\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = getMajorVersions(data.released, versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.released.slice(-versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n var validVersions = getMajorVersions(Object.keys(e2c).reverse(), versions)\n return validVersions.map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+major\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var validVersions = getMajorVersions(data.released, versions)\n var list = validVersions.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(e2c).reverse().slice(-versions).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var list = data.released.slice(-versions).map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^unreleased\\s+versions$/i,\n select: function (context) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n })\n list = list.map(nameMapper(data.name))\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^unreleased\\s+electron\\s+versions?$/i,\n select: function () {\n return []\n }\n },\n {\n regexp: /^unreleased\\s+(\\w+)\\s+versions?$/i,\n select: function (context, name) {\n var data = checkName(name, context)\n return data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n }).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^last\\s+(\\d*.?\\d+)\\s+years?$/i,\n select: function (context, years) {\n return filterByYear(Date.now() - YEAR * years, context)\n }\n },\n {\n regexp: /^since (\\d+)(?:-(\\d+))?(?:-(\\d+))?$/i,\n select: function (context, year, month, date) {\n year = parseInt(year)\n month = parseInt(month || '01') - 1\n date = parseInt(date || '01')\n return filterByYear(Date.UTC(year, month, date, 0, 0, 0), context)\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n var usage = browserslist.usage.global\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+my\\s+stats$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+(\\S+)\\s+stats$/,\n select: function (context, sign, popularity, name) {\n popularity = parseFloat(popularity)\n var stats = env.loadStat(context, name, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+((alt-)?\\w\\w)$/,\n select: function (context, sign, popularity, place) {\n popularity = parseFloat(popularity)\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n var usage = browserslist.usage[place]\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^cover\\s+(\\d*\\.?\\d+)%(\\s+in\\s+(my\\s+stats|(alt-)?\\w\\w))?$/,\n select: function (context, coverage, statMode) {\n coverage = parseFloat(coverage)\n var usage = browserslist.usage.global\n if (statMode) {\n if (statMode.match(/^\\s+in\\s+my\\s+stats$/)) {\n if (!context.customUsage) {\n throw new BrowserslistError(\n 'Custom usage statistics was not provided'\n )\n }\n usage = context.customUsage\n } else {\n var match = statMode.match(/\\s+in\\s+((alt-)?\\w\\w)/)\n var place = match[1]\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n usage = browserslist.usage[place]\n }\n }\n var versions = Object.keys(usage).sort(function (a, b) {\n return usage[b] - usage[a]\n })\n var coveraged = 0\n var result = []\n var version\n for (var i = 0; i <= versions.length; i++) {\n version = versions[i]\n if (usage[version] === 0) break\n coveraged += usage[version]\n result.push(version)\n if (coveraged >= coverage) break\n }\n return result\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, from, to) {\n var fromToUse = normalizeElectron(from)\n var toToUse = normalizeElectron(to)\n if (!e2c[fromToUse]) {\n throw new BrowserslistError('Unknown version ' + from + ' of electron')\n }\n if (!e2c[toToUse]) {\n throw new BrowserslistError('Unknown version ' + to + ' of electron')\n }\n from = parseFloat(from)\n to = parseFloat(to)\n return Object.keys(e2c).filter(function (i) {\n var parsed = parseFloat(i)\n return parsed >= from && parsed <= to\n }).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^(\\w+)\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, name, from, to) {\n var data = checkName(name, context)\n from = parseFloat(normalizeVersion(data, from) || from)\n to = parseFloat(normalizeVersion(data, to) || to)\n function filter (v) {\n var parsed = parseFloat(v)\n return parsed >= from && parsed <= to\n }\n return data.released.filter(filter).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^electron\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var versionToUse = normalizeElectron(version)\n return Object.keys(e2c)\n .filter(generateFilter(sign, versionToUse))\n .map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^node\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var nodeVersions = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n }).map(function (i) {\n return i.version\n })\n return nodeVersions\n .filter(generateSemverFilter(sign, version))\n .map(function (v) {\n return 'node ' + v\n })\n }\n },\n {\n regexp: /^(\\w+)\\s*(>=?|<=?)\\s*([\\d.]+)$/,\n select: function (context, name, sign, version) {\n var data = checkName(name, context)\n var alias = browserslist.versionAliases[data.name][version]\n if (alias) {\n version = alias\n }\n return data.released\n .filter(generateFilter(sign, version))\n .map(function (v) {\n return data.name + ' ' + v\n })\n }\n },\n {\n regexp: /^(firefox|ff|fx)\\s+esr$/i,\n select: function () {\n return ['firefox 68']\n }\n },\n {\n regexp: /(operamini|op_mini)\\s+all/i,\n select: function () {\n return ['op_mini all']\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)$/i,\n select: function (context, version) {\n var versionToUse = normalizeElectron(version)\n var chrome = e2c[versionToUse]\n if (!chrome) {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of electron')\n }\n return ['chrome ' + chrome]\n }\n },\n {\n regexp: /^node\\s+(\\d+(\\.\\d+)?(\\.\\d+)?)$/i,\n select: function (context, version) {\n var nodeReleases = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n })\n var matched = nodeReleases.filter(function (i) {\n return isVersionsMatch(i.version, version)\n })\n if (matched.length === 0) {\n if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of Node.js')\n }\n }\n return ['node ' + matched[matched.length - 1].version]\n }\n },\n {\n regexp: /^current\\s+node$/i,\n select: function (context) {\n return [env.currentNode(resolve, context)]\n }\n },\n {\n regexp: /^maintained\\s+node\\s+versions$/i,\n select: function (context) {\n var now = Date.now()\n var queries = Object.keys(jsEOL).filter(function (key) {\n return now < Date.parse(jsEOL[key].end) &&\n now > Date.parse(jsEOL[key].start) &&\n isEolReleased(key)\n }).map(function (key) {\n return 'node ' + key.slice(1)\n })\n return resolve(queries, context)\n }\n },\n {\n regexp: /^phantomjs\\s+1.9$/i,\n select: function () {\n return ['safari 5']\n }\n },\n {\n regexp: /^phantomjs\\s+2.1$/i,\n select: function () {\n return ['safari 6']\n }\n },\n {\n regexp: /^(\\w+)\\s+(tp|[\\d.]+)$/i,\n select: function (context, name, version) {\n if (/^tp$/i.test(version)) version = 'TP'\n var data = checkName(name, context)\n var alias = normalizeVersion(data, version)\n if (alias) {\n version = alias\n } else {\n if (version.indexOf('.') === -1) {\n alias = version + '.0'\n } else {\n alias = version.replace(/\\.0$/, '')\n }\n alias = normalizeVersion(data, alias)\n if (alias) {\n version = alias\n } else if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of ' + name)\n }\n }\n return [data.name + ' ' + version]\n }\n },\n {\n regexp: /^extends (.+)$/i,\n select: function (context, name) {\n return resolve(env.loadQueries(context, name), context)\n }\n },\n {\n regexp: /^defaults$/i,\n select: function (context) {\n return resolve(browserslist.defaults, context)\n }\n },\n {\n regexp: /^dead$/i,\n select: function (context) {\n var dead = [\n 'ie <= 10', 'ie_mob <= 10',\n 'bb <= 10',\n 'op_mob <= 12.1',\n 'samsung 4'\n ]\n return resolve(dead, context)\n }\n },\n {\n regexp: /^(\\w+)$/i,\n select: function (context, name) {\n if (byName(name, context)) {\n throw new BrowserslistError(\n 'Specify versions in Browserslist query for browser ' + name)\n } else {\n throw unknownQuery(name)\n }\n }\n }\n];\n\n// Get and convert Can I Use data\n\n(function () {\n for (var name in agents) {\n var browser = agents[name]\n browserslist.data[name] = {\n name: name,\n versions: normalize(agents[name].versions),\n released: normalize(agents[name].versions.slice(0, -3)),\n releaseDate: agents[name].release_date\n }\n fillUsage(browserslist.usage.global, name, browser.usage_global)\n\n browserslist.versionAliases[name] = { }\n for (var i = 0; i < browser.versions.length; i++) {\n var full = browser.versions[i]\n if (!full) continue\n\n if (full.indexOf('-') !== -1) {\n var interval = full.split('-')\n for (var j = 0; j < interval.length; j++) {\n browserslist.versionAliases[name][interval[j]] = full\n }\n }\n }\n }\n}())\n\nmodule.exports = browserslist\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/native-modules.json\");\n","export const unreleasedLabels = {\n safari: \"tp\",\n};\n\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n op_mob: \"opera\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n};\n","// @flow\n\nimport invariant from \"invariant\";\nimport semver from \"semver\";\n\nimport { unreleasedLabels } from \"./targets\";\nimport type { Target, Targets } from \"./types\";\n\nconst versionRegExp = /^(\\d+|\\d+.\\d+)$/;\n\nexport function semverMin(first: ?string, second: string): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n const split = version.toString().split(\".\");\n while (split.length < 3) {\n split.push(\"0\");\n }\n return split.join(\".\");\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: string,\n): boolean {\n const unreleasedLabel = unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: string): string {\n const unreleasedLabel = unreleasedLabels[env];\n const hasUnreleased = [a, b].some(item => item === unreleasedLabel);\n if (hasUnreleased) {\n return a === hasUnreleased ? b : a || b;\n }\n return semverMin(a, b);\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n","// @flow\n\nexport const TargetNames = {\n esmodules: \"esmodules\",\n node: \"node\",\n browsers: \"browsers\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n\n // deprecated\n uglify: \"uglify\",\n};\n","import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const parts = [semver.major(version)];\n const minor = semver.minor(version);\n const patch = semver.patch(version);\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target) => {\n let value = targets[target];\n\n const unreleasedLabel = unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {});\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { prettifyVersion } from \"./pretty\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils\";\nimport type { Targets } from \"./types\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return Object.keys(targetVersions).reduce((result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n }, {});\n}\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/plugins.json\");\n","// @flow\n\nimport semver from \"semver\";\n\nimport pluginsCompatData from \"@babel/compat-data/plugins\";\n\nimport type { Targets } from \"./types\";\nimport {\n getLowestImplementedVersion,\n isUnreleasedVersion,\n semverify,\n} from \"./utils\";\n\nexport function targetsSupported(target: Targets, support: Targets) {\n const targetEnvironments = Object.keys(target);\n\n if (targetEnvironments.length === 0) {\n return false;\n }\n\n const unsupportedEnvironments = targetEnvironments.filter(environment => {\n const lowestImplementedVersion = getLowestImplementedVersion(\n support,\n environment,\n );\n\n // Feature is not implemented in that environment\n if (!lowestImplementedVersion) {\n return true;\n }\n\n const lowestTargetedVersion = target[environment];\n\n // If targets has unreleased value as a lowest version, then don't require a plugin.\n if (isUnreleasedVersion(lowestTargetedVersion, environment)) {\n return false;\n }\n\n // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets\n if (isUnreleasedVersion(lowestImplementedVersion, environment)) {\n return true;\n }\n\n if (!semver.valid(lowestTargetedVersion.toString())) {\n throw new Error(\n `Invalid version passed for target \"${environment}\": \"${lowestTargetedVersion}\". ` +\n \"Versions must be in semver format (major.minor.patch)\",\n );\n }\n\n return semver.gt(\n semverify(lowestImplementedVersion),\n lowestTargetedVersion.toString(),\n );\n });\n\n return unsupportedEnvironments.length === 0;\n}\n\nexport function isRequired(\n name: string,\n targets: Targets,\n {\n compatData = pluginsCompatData,\n includes,\n excludes,\n }: {\n compatData?: { [feature: string]: Targets },\n includes?: Set,\n excludes?: Set,\n } = {},\n) {\n if (excludes && excludes.has(name)) return false;\n if (includes && includes.has(name)) return true;\n return !targetsSupported(targets, compatData[name]);\n}\n\nexport default function filterItems(\n list: { [feature: string]: Targets },\n includes: Set,\n excludes: Set,\n targets: Targets,\n defaultIncludes: Array | null,\n defaultExcludes?: Array | null,\n pluginSyntaxMap?: Map,\n) {\n const result = new Set();\n const options = { compatData: list, includes, excludes };\n\n for (const item in list) {\n if (isRequired(item, targets, options)) {\n result.add(item);\n } else if (pluginSyntaxMap) {\n const shippedProposalsSyntax = pluginSyntaxMap.get(item);\n\n if (shippedProposalsSyntax) {\n result.add(shippedProposalsSyntax);\n }\n }\n }\n\n if (defaultIncludes) {\n defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));\n }\n\n if (defaultExcludes) {\n defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));\n }\n\n return result;\n}\n","// @flow\n\nimport browserslist from \"browserslist\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport browserModulesData from \"@babel/compat-data/native-modules\";\n\nimport {\n semverify,\n semverMin,\n isUnreleasedVersion,\n getLowestUnreleased,\n} from \"./utils\";\nimport { browserNameMap } from \"./targets\";\nimport { TargetNames } from \"./options\";\nimport type { Targets } from \"./types\";\n\nexport type { Targets };\n\nexport { prettifyTargets } from \"./pretty\";\nexport { getInclusionReasons } from \"./debug\";\nexport { default as filterItems, isRequired } from \"./filter-items\";\nexport { unreleasedLabels } from \"./targets\";\n\nconst browserslistDefaults = browserslist.defaults;\n\nconst validBrowserslistTargets = [\n ...Object.keys(browserslist.data),\n ...Object.keys(browserslist.aliases),\n];\n\nfunction objectToBrowserslist(object: Targets): Array {\n return Object.keys(object).reduce((list, targetName) => {\n if (validBrowserslistTargets.indexOf(targetName) >= 0) {\n const targetVersion = object[targetName];\n return list.concat(`${targetName} ${targetVersion}`);\n }\n return list;\n }, []);\n}\n\nfunction validateTargetNames(targets: Targets): void {\n const validTargets = Object.keys(TargetNames);\n for (const target in targets) {\n if (!TargetNames[target]) {\n throw new Error(\n `Invalid Option: '${target}' is not a valid target\n Maybe you meant to use '${findSuggestion(target, validTargets)}'?`,\n );\n }\n }\n}\n\nexport function isBrowsersQueryValid(\n browsers: string | Array | Targets,\n): boolean {\n return typeof browsers === \"string\" || Array.isArray(browsers);\n}\n\nfunction validateBrowsers(browsers) {\n invariant(\n typeof browsers === \"undefined\" || isBrowsersQueryValid(browsers),\n `Invalid Option: '${browsers}' is not a valid browserslist query`,\n );\n\n return browsers;\n}\n\nfunction mergeBrowsers(fromQuery: Targets, fromTarget: Targets) {\n return Object.keys(fromTarget).reduce((queryObj, targKey) => {\n if (targKey !== TargetNames.browsers) {\n queryObj[targKey] = fromTarget[targKey];\n }\n return queryObj;\n }, fromQuery);\n}\n\nfunction getLowestVersions(browsers: Array): Targets {\n return browsers.reduce((all: Object, browser: string): Object => {\n const [browserName, browserVersion] = browser.split(\" \");\n const normalizedBrowserName = browserNameMap[browserName];\n\n if (!normalizedBrowserName) {\n return all;\n }\n\n try {\n // Browser version can return as \"10.0-10.2\"\n const splitVersion = browserVersion.split(\"-\")[0].toLowerCase();\n const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName);\n\n if (!all[normalizedBrowserName]) {\n all[normalizedBrowserName] = isSplitUnreleased\n ? splitVersion\n : semverify(splitVersion);\n return all;\n }\n\n const version = all[normalizedBrowserName];\n const isUnreleased = isUnreleasedVersion(version, browserName);\n\n if (isUnreleased && isSplitUnreleased) {\n all[normalizedBrowserName] = getLowestUnreleased(\n version,\n splitVersion,\n browserName,\n );\n } else if (isUnreleased) {\n all[normalizedBrowserName] = semverify(splitVersion);\n } else if (!isUnreleased && !isSplitUnreleased) {\n const parsedBrowserVersion = semverify(splitVersion);\n\n all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion);\n }\n } catch (e) {}\n\n return all;\n }, {});\n}\n\nfunction outputDecimalWarning(decimalTargets: Array): void {\n if (!decimalTargets || !decimalTargets.length) {\n return;\n }\n\n console.log(\"Warning, the following targets are using a decimal version:\");\n console.log(\"\");\n decimalTargets.forEach(({ target, value }) =>\n console.log(` ${target}: ${value}`),\n );\n console.log(\"\");\n console.log(\n \"We recommend using a string for minor/patch versions to avoid numbers like 6.10\",\n );\n console.log(\"getting parsed as 6.1, which can lead to unexpected behavior.\");\n console.log(\"\");\n}\n\nfunction semverifyTarget(target, value) {\n try {\n return semverify(value);\n } catch (error) {\n throw new Error(\n `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`,\n );\n }\n}\n\nconst targetParserMap = {\n __default(target, value) {\n const version = isUnreleasedVersion(value, target)\n ? value.toLowerCase()\n : semverifyTarget(target, value);\n return [target, version];\n },\n\n // Parse `node: true` and `node: \"current\"` to version\n node(target, value) {\n const parsed =\n value === true || value === \"current\"\n ? process.versions.node\n : semverifyTarget(target, value);\n return [target, parsed];\n },\n};\n\ntype ParsedResult = {\n targets: Targets,\n decimalWarnings: Array,\n};\n\nexport default function getTargets(\n targets: Object = {},\n options: Object = {},\n): Targets {\n const targetOpts: Targets = {};\n\n validateTargetNames(targets);\n\n // `esmodules` as a target indicates the specific set of browsers supporting ES Modules.\n // These values OVERRIDE the `browsers` field.\n if (targets.esmodules) {\n const supportsESModules = browserModulesData[\"es6.module\"];\n targets.browsers = Object.keys(supportsESModules)\n .map(browser => `${browser} ${supportsESModules[browser]}`)\n .join(\", \");\n }\n\n // Parse browsers target via browserslist\n const browsersquery = validateBrowsers(targets.browsers);\n\n const hasTargets = Object.keys(targets).length > 0;\n const shouldParseBrowsers = !!targets.browsers;\n const shouldSearchForConfig =\n !options.ignoreBrowserslistConfig && !hasTargets;\n\n if (shouldParseBrowsers || shouldSearchForConfig) {\n // If no targets are passed, we need to overwrite browserslist's defaults\n // so that we enable all transforms (acting like the now deprecated\n // preset-latest).\n //\n // Note, if browserslist resolves the config (ex. package.json), then usage\n // of `defaults` in queries will be different since we don't want to break\n // the behavior of \"no targets is the same as preset-latest\".\n if (!hasTargets) {\n browserslist.defaults = objectToBrowserslist(targets);\n }\n\n const browsers = browserslist(browsersquery, {\n path: options.configPath,\n mobileToDesktop: true,\n });\n\n const queryBrowsers = getLowestVersions(browsers);\n targets = mergeBrowsers(queryBrowsers, targets);\n\n // Reset browserslist defaults\n browserslist.defaults = browserslistDefaults;\n }\n\n // Parse remaining targets\n const parsed = Object.keys(targets)\n .filter(value => value !== TargetNames.esmodules)\n .sort()\n .reduce(\n (results: ParsedResult, target: string): ParsedResult => {\n if (target !== TargetNames.browsers) {\n const value = targets[target];\n\n // Warn when specifying minor/patch as a decimal\n if (typeof value === \"number\" && value % 1 !== 0) {\n results.decimalWarnings.push({ target, value });\n }\n\n // Check if we have a target parser?\n const parser = targetParserMap[target] || targetParserMap.__default;\n const [parsedTarget, parsedValue] = parser(target, value);\n\n if (parsedValue) {\n // Merge (lowest wins)\n results.targets[parsedTarget] = parsedValue;\n }\n }\n\n return results;\n },\n {\n targets: targetOpts,\n decimalWarnings: [],\n },\n );\n\n outputDecimalWarning(parsed.decimalWarnings);\n\n return parsed.targets;\n}\n","// @flow\n\nimport {\n getInclusionReasons,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\n\nconst wordEnds = (size: number) => {\n return size > 1 ? \"s\" : \"\";\n};\n\n// Outputs a message that shows which target(s) caused an item to be included:\n// transform-foo { \"edge\":\"13\", \"firefox\":\"49\", \"ie\":\"10\" }\nexport const logPluginOrPolyfill = (\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) => {\n const filteredList = getInclusionReasons(item, targetVersions, list);\n\n const formattedTargets = JSON.stringify(filteredList)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${item} ${formattedTargets}`);\n};\n\nexport const logEntryPolyfills = (\n polyfillName: string,\n importPolyfillIncluded: boolean,\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!importPolyfillIncluded) {\n console.log(`\\n[${filename}] Import of ${polyfillName} was not found.`);\n return;\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your targets, polyfills were not added.`,\n );\n return;\n }\n\n console.log(\n `\\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n\nexport const logUsagePolyfills = (\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your code and targets, core-js polyfills were not added.`,\n );\n return;\n }\n console.log(\n `\\n[${filename}] Added following core-js polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n","// @flow\n\nconst defaultExcludesForLooseMode = [\"transform-typeof-symbol\"];\n\nexport default function({ loose }: { loose: boolean }): null | string[] {\n return loose ? defaultExcludesForLooseMode : null;\n}\n","// @flow\n\nexport function removeUnnecessaryItems(\n items: Set,\n overlapping: { [name: string]: string[] },\n) {\n items.forEach(item => {\n // $FlowIgnore Flow doesn't support calls in optional chains\n overlapping[item]?.forEach(name => items.delete(name));\n });\n}\n","// @flow\n\nimport typeof AvailablePlugins from \"./available-plugins\";\n\nexport default ({\n auto: \"transform-modules-commonjs\",\n amd: \"transform-modules-amd\",\n commonjs: \"transform-modules-commonjs\",\n cjs: \"transform-modules-commonjs\",\n systemjs: \"transform-modules-systemjs\",\n umd: \"transform-modules-umd\",\n}: { [transform: string]: $Keys });\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/corejs2-built-ins.json\");\n","// @flow\n\nexport const TopLevelOptions = {\n configPath: \"configPath\",\n corejs: \"corejs\",\n debug: \"debug\",\n exclude: \"exclude\",\n forceAllTransforms: \"forceAllTransforms\",\n ignoreBrowserslistConfig: \"ignoreBrowserslistConfig\",\n include: \"include\",\n loose: \"loose\",\n modules: \"modules\",\n shippedProposals: \"shippedProposals\",\n spec: \"spec\",\n targets: \"targets\",\n useBuiltIns: \"useBuiltIns\",\n};\n\nexport const ModulesOption = {\n false: false,\n auto: \"auto\",\n amd: \"amd\",\n commonjs: \"commonjs\",\n cjs: \"cjs\",\n systemjs: \"systemjs\",\n umd: \"umd\",\n};\n\nexport const UseBuiltInsOption = {\n false: false,\n entry: \"entry\",\n usage: \"usage\",\n};\n","// @flow\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const defaultWebIncludes = [\n \"web.timers\",\n \"web.immediate\",\n \"web.dom.iterable\",\n];\n\nexport default function(targets: Targets): null | string[] {\n const targetNames = Object.keys(targets);\n const isAnyTarget = !targetNames.length;\n const isWebTarget = targetNames.some(name => name !== \"node\");\n\n return isAnyTarget || isWebTarget ? defaultWebIncludes : null;\n}\n","// @flow\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport { coerce, SemVer } from \"semver\";\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport pluginsList from \"@babel/compat-data/plugins\";\nimport moduleTransformations from \"./module-transformations\";\nimport { TopLevelOptions, ModulesOption, UseBuiltInsOption } from \"./options\";\nimport { defaultWebIncludes } from \"./polyfills/corejs2/get-platform-specific-default\";\n\nimport type {\n BuiltInsOption,\n CorejsOption,\n ModuleOption,\n Options,\n PluginListItem,\n PluginListOption,\n} from \"./types\";\n\nconst validateTopLevelOptions = (options: Options) => {\n const validOptions = Object.keys(TopLevelOptions);\n\n for (const option in options) {\n if (!TopLevelOptions[option]) {\n throw new Error(\n `Invalid Option: ${option} is not a valid top-level option.\n Maybe you meant to use '${findSuggestion(option, validOptions)}'?`,\n );\n }\n }\n};\n\nconst allPluginsList = Object.keys(pluginsList);\n\n// NOTE: Since module plugins are handled seperatly compared to other plugins (via the \"modules\" option) it\n// should only be possible to exclude and not include module plugins, otherwise it's possible that preset-env\n// will add a module plugin twice.\nconst modulePlugins = [\n \"proposal-dynamic-import\",\n ...Object.keys(moduleTransformations).map(m => moduleTransformations[m]),\n];\n\nconst getValidIncludesAndExcludes = (\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n new Set([\n ...allPluginsList,\n ...(type === \"exclude\" ? modulePlugins : []),\n ...(corejs\n ? corejs == 2\n ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes]\n : Object.keys(corejs3Polyfills)\n : []),\n ]);\n\nconst pluginToRegExp = (plugin: PluginListItem) => {\n if (plugin instanceof RegExp) return plugin;\n try {\n return new RegExp(`^${normalizePluginName(plugin)}$`);\n } catch (e) {\n return null;\n }\n};\n\nconst selectPlugins = (\n regexp: RegExp | null,\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n Array.from(getValidIncludesAndExcludes(type, corejs)).filter(\n item => regexp instanceof RegExp && regexp.test(item),\n );\n\nconst flatten = (array: Array>): Array => [].concat(...array);\n\nconst expandIncludesAndExcludes = (\n plugins: PluginListOption = [],\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) => {\n if (plugins.length === 0) return [];\n\n const selectedPlugins = plugins.map(plugin =>\n selectPlugins(pluginToRegExp(plugin), type, corejs),\n );\n const invalidRegExpList = plugins.filter(\n (p, i) => selectedPlugins[i].length === 0,\n );\n\n invariant(\n invalidRegExpList.length === 0,\n `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(\n \", \",\n )}' passed to the '${type}' option are not\n valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`,\n );\n\n return flatten(selectedPlugins);\n};\n\nexport const normalizePluginName = (plugin: string) =>\n plugin.replace(/^(@babel\\/|babel-)(plugin-)?/, \"\");\n\nexport const checkDuplicateIncludeExcludes = (\n include: Array = [],\n exclude: Array = [],\n) => {\n const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);\n\n invariant(\n duplicates.length === 0,\n `Invalid Option: The plugins/built-ins '${duplicates.join(\n \", \",\n )}' were found in both the \"include\" and\n \"exclude\" options.`,\n );\n};\n\nconst normalizeTargets = targets => {\n // TODO: Allow to use only query or strings as a targets from next breaking change.\n if (typeof targets === \"string\" || Array.isArray(targets)) {\n return { browsers: targets };\n }\n return {\n ...targets,\n };\n};\n\nexport const validateConfigPathOption = (\n configPath: string = process.cwd(),\n) => {\n invariant(\n typeof configPath === \"string\",\n `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`,\n );\n return configPath;\n};\n\nexport const validateBoolOption = (\n name: string,\n value?: boolean,\n defaultValue: boolean,\n) => {\n if (typeof value === \"undefined\") {\n value = defaultValue;\n }\n\n if (typeof value !== \"boolean\") {\n throw new Error(`Preset env: '${name}' option must be a boolean.`);\n }\n\n return value;\n};\n\nexport const validateIgnoreBrowserslistConfig = (\n ignoreBrowserslistConfig: boolean,\n) =>\n validateBoolOption(\n TopLevelOptions.ignoreBrowserslistConfig,\n ignoreBrowserslistConfig,\n false,\n );\n\nexport const validateModulesOption = (\n modulesOpt: ModuleOption = ModulesOption.auto,\n) => {\n invariant(\n ModulesOption[modulesOpt.toString()] ||\n ModulesOption[modulesOpt.toString()] === ModulesOption.false,\n `Invalid Option: The 'modules' option must be one of \\n` +\n ` - 'false' to indicate no module processing\\n` +\n ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` +\n ` - 'auto' (default) which will automatically select 'false' if the current\\n` +\n ` process is known to support ES module syntax, or \"commonjs\" otherwise\\n`,\n );\n\n return modulesOpt;\n};\n\nexport const validateUseBuiltInsOption = (\n builtInsOpt: BuiltInsOption = false,\n) => {\n invariant(\n UseBuiltInsOption[builtInsOpt.toString()] ||\n UseBuiltInsOption[builtInsOpt.toString()] === UseBuiltInsOption.false,\n `Invalid Option: The 'useBuiltIns' option must be either\n 'false' (default) to indicate no polyfill,\n '\"entry\"' to indicate replacing the entry polyfill, or\n '\"usage\"' to import only used polyfills per file`,\n );\n\n return builtInsOpt;\n};\n\nexport type NormalizedCorejsOption = {\n proposals: boolean,\n version: typeof SemVer | null | false,\n};\n\nexport function normalizeCoreJSOption(\n corejs?: CorejsOption,\n useBuiltIns: BuiltInsOption,\n): NormalizedCorejsOption {\n let proposals = false;\n let rawVersion;\n\n if (useBuiltIns && corejs === undefined) {\n rawVersion = 2;\n console.warn(\n \"\\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a \" +\n \"core-js version. Currently, we assume version 2.x when no version \" +\n \"is passed. Since this default version will likely change in future \" +\n \"versions of Babel, we recommend explicitly setting the core-js version \" +\n \"you are using via the `corejs` option.\\n\" +\n \"\\nYou should also be sure that the version you pass to the `corejs` \" +\n \"option matches the version specified in your `package.json`'s \" +\n \"`dependencies` section. If it doesn't, you need to run one of the \" +\n \"following commands:\\n\\n\" +\n \" npm install --save core-js@2 npm install --save core-js@3\\n\" +\n \" yarn add core-js@2 yarn add core-js@3\\n\",\n );\n } else if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const version = rawVersion ? coerce(String(rawVersion)) : false;\n\n if (!useBuiltIns && version) {\n console.log(\n \"\\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\\n\",\n );\n }\n\n if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {\n throw new RangeError(\n \"Invalid Option: The version passed to `corejs` is invalid. Currently, \" +\n \"only core-js@2 and core-js@3 are supported.\",\n );\n }\n\n return { version, proposals };\n}\n\nexport default function normalizeOptions(opts: Options) {\n validateTopLevelOptions(opts);\n\n const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);\n\n const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);\n\n const include = expandIncludesAndExcludes(\n opts.include,\n TopLevelOptions.include,\n !!corejs.version && corejs.version.major,\n );\n\n const exclude = expandIncludesAndExcludes(\n opts.exclude,\n TopLevelOptions.exclude,\n !!corejs.version && corejs.version.major,\n );\n\n checkDuplicateIncludeExcludes(include, exclude);\n\n const shippedProposals =\n validateBoolOption(\n TopLevelOptions.shippedProposals,\n opts.shippedProposals,\n false,\n ) || corejs.proposals;\n\n return {\n configPath: validateConfigPathOption(opts.configPath),\n corejs,\n debug: validateBoolOption(TopLevelOptions.debug, opts.debug, false),\n include,\n exclude,\n forceAllTransforms: validateBoolOption(\n TopLevelOptions.forceAllTransforms,\n opts.forceAllTransforms,\n false,\n ),\n ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(\n opts.ignoreBrowserslistConfig,\n ),\n loose: validateBoolOption(TopLevelOptions.loose, opts.loose, false),\n modules: validateModulesOption(opts.modules),\n shippedProposals,\n spec: validateBoolOption(TopLevelOptions.spec, opts.spec, false),\n targets: normalizeTargets(opts.targets),\n useBuiltIns: useBuiltIns,\n };\n}\n","/* eslint sort-keys: \"error\" */\n// These mappings represent the syntax proposals that have been\n// shipped by browsers, and are enabled by the `shippedProposals` option.\n\nconst proposalPlugins = {};\n\n// use intermediary object to enforce alphabetical key order\nconst pluginSyntaxObject = {\n \"proposal-async-generator-functions\": \"syntax-async-generators\",\n \"proposal-json-strings\": \"syntax-json-strings\",\n \"proposal-nullish-coalescing-operator\": \"syntax-nullish-coalescing-operator\",\n \"proposal-object-rest-spread\": \"syntax-object-rest-spread\",\n \"proposal-optional-catch-binding\": \"syntax-optional-catch-binding\",\n \"proposal-optional-chaining\": \"syntax-optional-chaining\",\n \"proposal-unicode-property-regex\": null,\n};\n\nconst pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {\n return [key, pluginSyntaxObject[key]];\n});\n\nconst pluginSyntaxMap = new Map(pluginSyntaxEntries);\n\nmodule.exports = { pluginSyntaxMap, proposalPlugins };\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/overlapping-plugins.json\");\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es6.object.to-string\",\n \"es6.array.iterator\",\n \"web.dom.iterable\",\n];\n\nconst CommonIterators = [\"es6.string.iterator\", ...ArrayNatureIterators];\n\nconst PromiseDependencies = [\"es6.object.to-string\", \"es6.promise\"];\n\nexport const BuiltIns: ObjectMap = {\n DataView: \"es6.typed.data-view\",\n Float32Array: \"es6.typed.float32-array\",\n Float64Array: \"es6.typed.float64-array\",\n Int8Array: \"es6.typed.int8-array\",\n Int16Array: \"es6.typed.int16-array\",\n Int32Array: \"es6.typed.int32-array\",\n Map: [\"es6.map\", ...CommonIterators],\n Number: \"es6.number.constructor\",\n Promise: PromiseDependencies,\n RegExp: [\"es6.regexp.constructor\"],\n Set: [\"es6.set\", ...CommonIterators],\n Symbol: [\"es6.symbol\", \"es7.symbol.async-iterator\"],\n Uint8Array: \"es6.typed.uint8-array\",\n Uint8ClampedArray: \"es6.typed.uint8-clamped-array\",\n Uint16Array: \"es6.typed.uint16-array\",\n Uint32Array: \"es6.typed.uint32-array\",\n WeakMap: [\"es6.weak-map\", ...CommonIterators],\n WeakSet: [\"es6.weak-set\", ...CommonIterators],\n};\n\nexport const InstanceProperties: ObjectMap = {\n __defineGetter__: [\"es7.object.define-getter\"],\n __defineSetter__: [\"es7.object.define-setter\"],\n __lookupGetter__: [\"es7.object.lookup-getter\"],\n __lookupSetter__: [\"es7.object.lookup-setter\"],\n anchor: [\"es6.string.anchor\"],\n big: [\"es6.string.big\"],\n bind: [\"es6.function.bind\"],\n blink: [\"es6.string.blink\"],\n bold: [\"es6.string.bold\"],\n codePointAt: [\"es6.string.code-point-at\"],\n copyWithin: [\"es6.array.copy-within\"],\n endsWith: [\"es6.string.ends-with\"],\n entries: ArrayNatureIterators,\n every: [\"es6.array.is-array\"],\n fill: [\"es6.array.fill\"],\n filter: [\"es6.array.filter\"],\n finally: [\"es7.promise.finally\", ...PromiseDependencies],\n find: [\"es6.array.find\"],\n findIndex: [\"es6.array.find-index\"],\n fixed: [\"es6.string.fixed\"],\n flags: [\"es6.regexp.flags\"],\n flatMap: [\"es7.array.flat-map\"],\n fontcolor: [\"es6.string.fontcolor\"],\n fontsize: [\"es6.string.fontsize\"],\n forEach: [\"es6.array.for-each\"],\n includes: [\"es6.string.includes\", \"es7.array.includes\"],\n indexOf: [\"es6.array.index-of\"],\n italics: [\"es6.string.italics\"],\n keys: ArrayNatureIterators,\n lastIndexOf: [\"es6.array.last-index-of\"],\n link: [\"es6.string.link\"],\n map: [\"es6.array.map\"],\n match: [\"es6.regexp.match\"],\n name: [\"es6.function.name\"],\n padStart: [\"es7.string.pad-start\"],\n padEnd: [\"es7.string.pad-end\"],\n reduce: [\"es6.array.reduce\"],\n reduceRight: [\"es6.array.reduce-right\"],\n repeat: [\"es6.string.repeat\"],\n replace: [\"es6.regexp.replace\"],\n search: [\"es6.regexp.search\"],\n slice: [\"es6.array.slice\"],\n small: [\"es6.string.small\"],\n some: [\"es6.array.some\"],\n sort: [\"es6.array.sort\"],\n split: [\"es6.regexp.split\"],\n startsWith: [\"es6.string.starts-with\"],\n strike: [\"es6.string.strike\"],\n sub: [\"es6.string.sub\"],\n sup: [\"es6.string.sup\"],\n toISOString: [\"es6.date.to-iso-string\"],\n toJSON: [\"es6.date.to-json\"],\n toString: [\n \"es6.object.to-string\",\n \"es6.date.to-string\",\n \"es6.regexp.to-string\",\n ],\n trim: [\"es6.string.trim\"],\n trimEnd: [\"es7.string.trim-right\"],\n trimLeft: [\"es7.string.trim-left\"],\n trimRight: [\"es7.string.trim-right\"],\n trimStart: [\"es7.string.trim-left\"],\n values: ArrayNatureIterators,\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es6.array.from\", \"es6.string.iterator\"],\n isArray: \"es6.array.is-array\",\n of: \"es6.array.of\",\n },\n\n Date: {\n now: \"es6.date.now\",\n },\n\n Object: {\n assign: \"es6.object.assign\",\n create: \"es6.object.create\",\n defineProperty: \"es6.object.define-property\",\n defineProperties: \"es6.object.define-properties\",\n entries: \"es7.object.entries\",\n freeze: \"es6.object.freeze\",\n getOwnPropertyDescriptors: \"es7.object.get-own-property-descriptors\",\n getOwnPropertySymbols: \"es6.symbol\",\n is: \"es6.object.is\",\n isExtensible: \"es6.object.is-extensible\",\n isFrozen: \"es6.object.is-frozen\",\n isSealed: \"es6.object.is-sealed\",\n keys: \"es6.object.keys\",\n preventExtensions: \"es6.object.prevent-extensions\",\n seal: \"es6.object.seal\",\n setPrototypeOf: \"es6.object.set-prototype-of\",\n values: \"es7.object.values\",\n },\n\n Math: {\n acosh: \"es6.math.acosh\",\n asinh: \"es6.math.asinh\",\n atanh: \"es6.math.atanh\",\n cbrt: \"es6.math.cbrt\",\n clz32: \"es6.math.clz32\",\n cosh: \"es6.math.cosh\",\n expm1: \"es6.math.expm1\",\n fround: \"es6.math.fround\",\n hypot: \"es6.math.hypot\",\n imul: \"es6.math.imul\",\n log1p: \"es6.math.log1p\",\n log10: \"es6.math.log10\",\n log2: \"es6.math.log2\",\n sign: \"es6.math.sign\",\n sinh: \"es6.math.sinh\",\n tanh: \"es6.math.tanh\",\n trunc: \"es6.math.trunc\",\n },\n\n String: {\n fromCodePoint: \"es6.string.from-code-point\",\n raw: \"es6.string.raw\",\n },\n\n Number: {\n EPSILON: \"es6.number.epsilon\",\n MIN_SAFE_INTEGER: \"es6.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es6.number.max-safe-integer\",\n isFinite: \"es6.number.is-finite\",\n isInteger: \"es6.number.is-integer\",\n isSafeInteger: \"es6.number.is-safe-integer\",\n isNaN: \"es6.number.is-nan\",\n parseFloat: \"es6.number.parse-float\",\n parseInt: \"es6.number.parse-int\",\n },\n\n Promise: {\n all: CommonIterators,\n race: CommonIterators,\n },\n\n Reflect: {\n apply: \"es6.reflect.apply\",\n construct: \"es6.reflect.construct\",\n defineProperty: \"es6.reflect.define-property\",\n deleteProperty: \"es6.reflect.delete-property\",\n get: \"es6.reflect.get\",\n getOwnPropertyDescriptor: \"es6.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es6.reflect.get-prototype-of\",\n has: \"es6.reflect.has\",\n isExtensible: \"es6.reflect.is-extensible\",\n ownKeys: \"es6.reflect.own-keys\",\n preventExtensions: \"es6.reflect.prevent-extensions\",\n set: \"es6.reflect.set\",\n setPrototypeOf: \"es6.reflect.set-prototype-of\",\n },\n};\n","// @flow\nexport default function shallowEqual(\n actual: Object,\n expected: Object,\n): boolean {\n const keys = Object.keys(expected);\n\n for (const key of (keys: Array)) {\n if (actual[key] !== expected[key]) {\n return false;\n }\n }\n\n return true;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport shallowEqual from \"../../utils/shallowEqual\";\n\nexport function isArrayExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAssignmentExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AssignmentExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBinaryExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BinaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterpreterDirective(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterpreterDirective\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDirective(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Directive\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDirectiveLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DirectiveLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlockStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BlockStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBreakStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BreakStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCallExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"CallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCatchClause(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"CatchClause\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isConditionalExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ConditionalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isContinueStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ContinueStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDebuggerStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DebuggerStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDoWhileStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DoWhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEmptyStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EmptyStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpressionStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExpressionStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFile(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"File\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForInStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForInStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Identifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIfStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"IfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLabeledStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"LabeledStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumericLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumericLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRegExpLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RegExpLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLogicalExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"LogicalExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMemberExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNewExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NewExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isProgram(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Program\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRestElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RestElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isReturnStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ReturnStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSequenceExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SequenceExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isParenthesizedExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ParenthesizedExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSwitchCase(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SwitchCase\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSwitchStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SwitchStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThisExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThisExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThrowStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThrowStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTryStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TryStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnaryExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UnaryExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUpdateExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UpdateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariableDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VariableDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariableDeclarator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VariableDeclarator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWhileStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"WhileStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWithStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"WithStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAssignmentPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AssignmentPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrayPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrowFunctionExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrowFunctionExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportAllDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDefaultDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportDefaultDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportNamedDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportNamedDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForOfStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ForOfStatement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportDefaultSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportNamespaceSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImportSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ImportSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMetaProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MetaProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectPattern\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSpreadElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SpreadElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSuper(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Super\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTaggedTemplateExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TaggedTemplateExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTemplateElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TemplateElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTemplateLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TemplateLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isYieldExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"YieldExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAnyTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AnyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArrayTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArrayTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBooleanLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BooleanLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassImplements(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassImplements\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareClass(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareClass\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareInterface(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareInterface\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareModule(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareModule\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareModuleExports(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareModuleExports\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareTypeAlias(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareTypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareOpaqueType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareOpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareVariable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareVariable\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareExportDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclareExportAllDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclareExportAllDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclaredPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DeclaredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExistsTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExistsTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionTypeParam(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"FunctionTypeParam\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isGenericTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"GenericTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInferredPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InferredPredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceExtends(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceExtends\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isInterfaceTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"InterfaceTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isIntersectionTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"IntersectionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMixedTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"MixedTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEmptyTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EmptyTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNullableTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NullableTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeInternalSlot(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeInternalSlot\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeCallProperty(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeCallProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeIndexer(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeIndexer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectTypeSpreadProperty(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ObjectTypeSpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOpaqueType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OpaqueType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isQualifiedTypeIdentifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"QualifiedTypeIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringLiteralTypeAnnotation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringLiteralTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStringTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"StringTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isThisTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ThisTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTupleTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TupleTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeofTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeofTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeAlias(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeAlias\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeCastExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeCastExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameter(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameterDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTypeParameterInstantiation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnionTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"UnionTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVariance(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Variance\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isVoidTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"VoidTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBooleanBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumBooleanBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumNumberBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumNumberBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumStringBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumStringBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumSymbolBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumSymbolBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBooleanMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumBooleanMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumNumberMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumNumberMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumStringMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumStringMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumDefaultedMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"EnumDefaultedMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXAttribute(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXClosingElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXClosingElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXEmptyExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXEmptyExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXExpressionContainer(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXExpressionContainer\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXSpreadChild(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXSpreadChild\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXMemberExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXNamespacedName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXNamespacedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXOpeningElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXOpeningElement\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXSpreadAttribute(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXSpreadAttribute\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXText(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXText\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXOpeningFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXOpeningFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSXClosingFragment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"JSXClosingFragment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNoop(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Noop\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPlaceholder(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Placeholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isV8IntrinsicIdentifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"V8IntrinsicIdentifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isArgumentPlaceholder(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ArgumentPlaceholder\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isAwaitExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"AwaitExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBindExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BindExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOptionalMemberExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OptionalMemberExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelineTopicExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelineTopicExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelineBareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelineBareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPipelinePrimaryTopicReference(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PipelinePrimaryTopicReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isOptionalCallExpression(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"OptionalCallExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassPrivateProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassPrivateProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClassPrivateMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ClassPrivateMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImport(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Import\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDecorator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"Decorator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDoExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"DoExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDefaultSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportDefaultSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportNamespaceSpecifier(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"ExportNamespaceSpecifier\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPrivateName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"PrivateName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBigIntLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"BigIntLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSParameterProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSParameterProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSDeclareFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSDeclareFunction\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSDeclareMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSDeclareMethod\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSQualifiedName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSQualifiedName\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSCallSignatureDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSCallSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConstructSignatureDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConstructSignatureDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSPropertySignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSPropertySignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSMethodSignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSMethodSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIndexSignature(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIndexSignature\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSAnyKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSAnyKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSBooleanKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSBooleanKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSBigIntKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSBigIntKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNeverKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNeverKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNullKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNullKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNumberKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNumberKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSObjectKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSObjectKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSStringKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSStringKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSSymbolKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSSymbolKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUndefinedKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUndefinedKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUnknownKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUnknownKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSVoidKeyword(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSVoidKeyword\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSThisType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSThisType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSFunctionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSFunctionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConstructorType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConstructorType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeReference(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypePredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypePredicate\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeQuery(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeQuery\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSArrayType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSArrayType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTupleType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTupleType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSOptionalType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSOptionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSRestType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSRestType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSUnionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSUnionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIntersectionType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIntersectionType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSConditionalType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSConditionalType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInferType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInferType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSParenthesizedType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSParenthesizedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeOperator(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeOperator\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSIndexedAccessType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSIndexedAccessType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSMappedType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSMappedType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSLiteralType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSLiteralType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExpressionWithTypeArguments(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExpressionWithTypeArguments\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInterfaceDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInterfaceDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSInterfaceBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSInterfaceBody\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAliasDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAliasDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSAsExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSAsExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAssertion(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAssertion\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEnumDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSEnumDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEnumMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSEnumMember\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSModuleDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSModuleDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSModuleBlock(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSModuleBlock\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSImportType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSImportType\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSImportEqualsDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSImportEqualsDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExternalModuleReference(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExternalModuleReference\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNonNullExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNonNullExpression\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSExportAssignment(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSExportAssignment\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSNamespaceExportDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSNamespaceExportDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeAnnotation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameterInstantiation(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameterInstantiation\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameterDeclaration(\n node: ?Object,\n opts?: Object,\n): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameterDeclaration\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeParameter(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"TSTypeParameter\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpression(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Expression\" ||\n \"ArrayExpression\" === nodeType ||\n \"AssignmentExpression\" === nodeType ||\n \"BinaryExpression\" === nodeType ||\n \"CallExpression\" === nodeType ||\n \"ConditionalExpression\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Identifier\" === nodeType ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"RegExpLiteral\" === nodeType ||\n \"LogicalExpression\" === nodeType ||\n \"MemberExpression\" === nodeType ||\n \"NewExpression\" === nodeType ||\n \"ObjectExpression\" === nodeType ||\n \"SequenceExpression\" === nodeType ||\n \"ParenthesizedExpression\" === nodeType ||\n \"ThisExpression\" === nodeType ||\n \"UnaryExpression\" === nodeType ||\n \"UpdateExpression\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"MetaProperty\" === nodeType ||\n \"Super\" === nodeType ||\n \"TaggedTemplateExpression\" === nodeType ||\n \"TemplateLiteral\" === nodeType ||\n \"YieldExpression\" === nodeType ||\n \"TypeCastExpression\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"AwaitExpression\" === nodeType ||\n \"BindExpression\" === nodeType ||\n \"OptionalMemberExpression\" === nodeType ||\n \"PipelinePrimaryTopicReference\" === nodeType ||\n \"OptionalCallExpression\" === nodeType ||\n \"Import\" === nodeType ||\n \"DoExpression\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n \"TSAsExpression\" === nodeType ||\n \"TSTypeAssertion\" === nodeType ||\n \"TSNonNullExpression\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Expression\" === node.expectedNode ||\n \"Identifier\" === node.expectedNode ||\n \"StringLiteral\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBinary(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Binary\" ||\n \"BinaryExpression\" === nodeType ||\n \"LogicalExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isScopable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Scopable\" ||\n \"BlockStatement\" === nodeType ||\n \"CatchClause\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Program\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlockParent(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"BlockParent\" ||\n \"BlockStatement\" === nodeType ||\n \"CatchClause\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"Program\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isBlock(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Block\" ||\n \"BlockStatement\" === nodeType ||\n \"Program\" === nodeType ||\n \"TSModuleBlock\" === nodeType ||\n (nodeType === \"Placeholder\" && \"BlockStatement\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Statement\" ||\n \"BlockStatement\" === nodeType ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"DebuggerStatement\" === nodeType ||\n \"DoWhileStatement\" === nodeType ||\n \"EmptyStatement\" === nodeType ||\n \"ExpressionStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"FunctionDeclaration\" === nodeType ||\n \"IfStatement\" === nodeType ||\n \"LabeledStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"SwitchStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType ||\n \"TryStatement\" === nodeType ||\n \"VariableDeclaration\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"WithStatement\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ForOfStatement\" === nodeType ||\n \"ImportDeclaration\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"TSDeclareFunction\" === nodeType ||\n \"TSInterfaceDeclaration\" === nodeType ||\n \"TSTypeAliasDeclaration\" === nodeType ||\n \"TSEnumDeclaration\" === nodeType ||\n \"TSModuleDeclaration\" === nodeType ||\n \"TSImportEqualsDeclaration\" === nodeType ||\n \"TSExportAssignment\" === nodeType ||\n \"TSNamespaceExportDeclaration\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Statement\" === node.expectedNode ||\n \"Declaration\" === node.expectedNode ||\n \"BlockStatement\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTerminatorless(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Terminatorless\" ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType ||\n \"YieldExpression\" === nodeType ||\n \"AwaitExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isCompletionStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"CompletionStatement\" ||\n \"BreakStatement\" === nodeType ||\n \"ContinueStatement\" === nodeType ||\n \"ReturnStatement\" === nodeType ||\n \"ThrowStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isConditional(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Conditional\" ||\n \"ConditionalExpression\" === nodeType ||\n \"IfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLoop(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Loop\" ||\n \"DoWhileStatement\" === nodeType ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"WhileStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isWhile(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"While\" ||\n \"DoWhileStatement\" === nodeType ||\n \"WhileStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExpressionWrapper(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ExpressionWrapper\" ||\n \"ExpressionStatement\" === nodeType ||\n \"ParenthesizedExpression\" === nodeType ||\n \"TypeCastExpression\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFor(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"For\" ||\n \"ForInStatement\" === nodeType ||\n \"ForStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isForXStatement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ForXStatement\" ||\n \"ForInStatement\" === nodeType ||\n \"ForOfStatement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunction(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Function\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFunctionParent(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FunctionParent\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"ObjectMethod\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPureish(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Pureish\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"FunctionExpression\" === nodeType ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"ArrowFunctionExpression\" === nodeType ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Declaration\" ||\n \"FunctionDeclaration\" === nodeType ||\n \"VariableDeclaration\" === nodeType ||\n \"ClassDeclaration\" === nodeType ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ImportDeclaration\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"EnumDeclaration\" === nodeType ||\n \"TSDeclareFunction\" === nodeType ||\n \"TSInterfaceDeclaration\" === nodeType ||\n \"TSTypeAliasDeclaration\" === nodeType ||\n \"TSEnumDeclaration\" === nodeType ||\n \"TSModuleDeclaration\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Declaration\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPatternLike(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"PatternLike\" ||\n \"Identifier\" === nodeType ||\n \"RestElement\" === nodeType ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLVal(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"LVal\" ||\n \"Identifier\" === nodeType ||\n \"MemberExpression\" === nodeType ||\n \"RestElement\" === nodeType ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n \"TSParameterProperty\" === nodeType ||\n (nodeType === \"Placeholder\" &&\n (\"Pattern\" === node.expectedNode || \"Identifier\" === node.expectedNode))\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSEntityName(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSEntityName\" ||\n \"Identifier\" === nodeType ||\n \"TSQualifiedName\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Identifier\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isLiteral(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Literal\" ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"RegExpLiteral\" === nodeType ||\n \"TemplateLiteral\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isImmutable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Immutable\" ||\n \"StringLiteral\" === nodeType ||\n \"NumericLiteral\" === nodeType ||\n \"NullLiteral\" === nodeType ||\n \"BooleanLiteral\" === nodeType ||\n \"JSXAttribute\" === nodeType ||\n \"JSXClosingElement\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXExpressionContainer\" === nodeType ||\n \"JSXSpreadChild\" === nodeType ||\n \"JSXOpeningElement\" === nodeType ||\n \"JSXText\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"JSXOpeningFragment\" === nodeType ||\n \"JSXClosingFragment\" === nodeType ||\n \"BigIntLiteral\" === nodeType ||\n (nodeType === \"Placeholder\" && \"StringLiteral\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUserWhitespacable(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"UserWhitespacable\" ||\n \"ObjectMethod\" === nodeType ||\n \"ObjectProperty\" === nodeType ||\n \"ObjectTypeInternalSlot\" === nodeType ||\n \"ObjectTypeCallProperty\" === nodeType ||\n \"ObjectTypeIndexer\" === nodeType ||\n \"ObjectTypeProperty\" === nodeType ||\n \"ObjectTypeSpreadProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isMethod(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Method\" ||\n \"ObjectMethod\" === nodeType ||\n \"ClassMethod\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isObjectMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ObjectMember\" ||\n \"ObjectMethod\" === nodeType ||\n \"ObjectProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isProperty(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Property\" ||\n \"ObjectProperty\" === nodeType ||\n \"ClassProperty\" === nodeType ||\n \"ClassPrivateProperty\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isUnaryLike(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"UnaryLike\" ||\n \"UnaryExpression\" === nodeType ||\n \"SpreadElement\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPattern(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Pattern\" ||\n \"AssignmentPattern\" === nodeType ||\n \"ArrayPattern\" === nodeType ||\n \"ObjectPattern\" === nodeType ||\n (nodeType === \"Placeholder\" && \"Pattern\" === node.expectedNode)\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isClass(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Class\" ||\n \"ClassExpression\" === nodeType ||\n \"ClassDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isModuleDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ModuleDeclaration\" ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType ||\n \"ImportDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isExportDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ExportDeclaration\" ||\n \"ExportAllDeclaration\" === nodeType ||\n \"ExportDefaultDeclaration\" === nodeType ||\n \"ExportNamedDeclaration\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isModuleSpecifier(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"ModuleSpecifier\" ||\n \"ExportSpecifier\" === nodeType ||\n \"ImportDefaultSpecifier\" === nodeType ||\n \"ImportNamespaceSpecifier\" === nodeType ||\n \"ImportSpecifier\" === nodeType ||\n \"ExportDefaultSpecifier\" === nodeType ||\n \"ExportNamespaceSpecifier\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlow(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Flow\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"ArrayTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"BooleanLiteralTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"ClassImplements\" === nodeType ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"DeclaredPredicate\" === nodeType ||\n \"ExistsTypeAnnotation\" === nodeType ||\n \"FunctionTypeAnnotation\" === nodeType ||\n \"FunctionTypeParam\" === nodeType ||\n \"GenericTypeAnnotation\" === nodeType ||\n \"InferredPredicate\" === nodeType ||\n \"InterfaceExtends\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"InterfaceTypeAnnotation\" === nodeType ||\n \"IntersectionTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NullableTypeAnnotation\" === nodeType ||\n \"NumberLiteralTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"ObjectTypeAnnotation\" === nodeType ||\n \"ObjectTypeInternalSlot\" === nodeType ||\n \"ObjectTypeCallProperty\" === nodeType ||\n \"ObjectTypeIndexer\" === nodeType ||\n \"ObjectTypeProperty\" === nodeType ||\n \"ObjectTypeSpreadProperty\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"QualifiedTypeIdentifier\" === nodeType ||\n \"StringLiteralTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"TupleTypeAnnotation\" === nodeType ||\n \"TypeofTypeAnnotation\" === nodeType ||\n \"TypeAlias\" === nodeType ||\n \"TypeAnnotation\" === nodeType ||\n \"TypeCastExpression\" === nodeType ||\n \"TypeParameter\" === nodeType ||\n \"TypeParameterDeclaration\" === nodeType ||\n \"TypeParameterInstantiation\" === nodeType ||\n \"UnionTypeAnnotation\" === nodeType ||\n \"Variance\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowType\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"ArrayTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"BooleanLiteralTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"ExistsTypeAnnotation\" === nodeType ||\n \"FunctionTypeAnnotation\" === nodeType ||\n \"GenericTypeAnnotation\" === nodeType ||\n \"InterfaceTypeAnnotation\" === nodeType ||\n \"IntersectionTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NullableTypeAnnotation\" === nodeType ||\n \"NumberLiteralTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"ObjectTypeAnnotation\" === nodeType ||\n \"StringLiteralTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"TupleTypeAnnotation\" === nodeType ||\n \"TypeofTypeAnnotation\" === nodeType ||\n \"UnionTypeAnnotation\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowBaseAnnotation(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowBaseAnnotation\" ||\n \"AnyTypeAnnotation\" === nodeType ||\n \"BooleanTypeAnnotation\" === nodeType ||\n \"NullLiteralTypeAnnotation\" === nodeType ||\n \"MixedTypeAnnotation\" === nodeType ||\n \"EmptyTypeAnnotation\" === nodeType ||\n \"NumberTypeAnnotation\" === nodeType ||\n \"StringTypeAnnotation\" === nodeType ||\n \"ThisTypeAnnotation\" === nodeType ||\n \"VoidTypeAnnotation\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowDeclaration(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowDeclaration\" ||\n \"DeclareClass\" === nodeType ||\n \"DeclareFunction\" === nodeType ||\n \"DeclareInterface\" === nodeType ||\n \"DeclareModule\" === nodeType ||\n \"DeclareModuleExports\" === nodeType ||\n \"DeclareTypeAlias\" === nodeType ||\n \"DeclareOpaqueType\" === nodeType ||\n \"DeclareVariable\" === nodeType ||\n \"DeclareExportDeclaration\" === nodeType ||\n \"DeclareExportAllDeclaration\" === nodeType ||\n \"InterfaceDeclaration\" === nodeType ||\n \"OpaqueType\" === nodeType ||\n \"TypeAlias\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isFlowPredicate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"FlowPredicate\" ||\n \"DeclaredPredicate\" === nodeType ||\n \"InferredPredicate\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumBody(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"EnumBody\" ||\n \"EnumBooleanBody\" === nodeType ||\n \"EnumNumberBody\" === nodeType ||\n \"EnumStringBody\" === nodeType ||\n \"EnumSymbolBody\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isEnumMember(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"EnumMember\" ||\n \"EnumBooleanMember\" === nodeType ||\n \"EnumNumberMember\" === nodeType ||\n \"EnumStringMember\" === nodeType ||\n \"EnumDefaultedMember\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isJSX(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"JSX\" ||\n \"JSXAttribute\" === nodeType ||\n \"JSXClosingElement\" === nodeType ||\n \"JSXElement\" === nodeType ||\n \"JSXEmptyExpression\" === nodeType ||\n \"JSXExpressionContainer\" === nodeType ||\n \"JSXSpreadChild\" === nodeType ||\n \"JSXIdentifier\" === nodeType ||\n \"JSXMemberExpression\" === nodeType ||\n \"JSXNamespacedName\" === nodeType ||\n \"JSXOpeningElement\" === nodeType ||\n \"JSXSpreadAttribute\" === nodeType ||\n \"JSXText\" === nodeType ||\n \"JSXFragment\" === nodeType ||\n \"JSXOpeningFragment\" === nodeType ||\n \"JSXClosingFragment\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isPrivate(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"Private\" ||\n \"ClassPrivateProperty\" === nodeType ||\n \"ClassPrivateMethod\" === nodeType ||\n \"PrivateName\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSTypeElement(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSTypeElement\" ||\n \"TSCallSignatureDeclaration\" === nodeType ||\n \"TSConstructSignatureDeclaration\" === nodeType ||\n \"TSPropertySignature\" === nodeType ||\n \"TSMethodSignature\" === nodeType ||\n \"TSIndexSignature\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isTSType(node: ?Object, opts?: Object): boolean {\n if (!node) return false;\n\n const nodeType = node.type;\n if (\n nodeType === \"TSType\" ||\n \"TSAnyKeyword\" === nodeType ||\n \"TSBooleanKeyword\" === nodeType ||\n \"TSBigIntKeyword\" === nodeType ||\n \"TSNeverKeyword\" === nodeType ||\n \"TSNullKeyword\" === nodeType ||\n \"TSNumberKeyword\" === nodeType ||\n \"TSObjectKeyword\" === nodeType ||\n \"TSStringKeyword\" === nodeType ||\n \"TSSymbolKeyword\" === nodeType ||\n \"TSUndefinedKeyword\" === nodeType ||\n \"TSUnknownKeyword\" === nodeType ||\n \"TSVoidKeyword\" === nodeType ||\n \"TSThisType\" === nodeType ||\n \"TSFunctionType\" === nodeType ||\n \"TSConstructorType\" === nodeType ||\n \"TSTypeReference\" === nodeType ||\n \"TSTypePredicate\" === nodeType ||\n \"TSTypeQuery\" === nodeType ||\n \"TSTypeLiteral\" === nodeType ||\n \"TSArrayType\" === nodeType ||\n \"TSTupleType\" === nodeType ||\n \"TSOptionalType\" === nodeType ||\n \"TSRestType\" === nodeType ||\n \"TSUnionType\" === nodeType ||\n \"TSIntersectionType\" === nodeType ||\n \"TSConditionalType\" === nodeType ||\n \"TSInferType\" === nodeType ||\n \"TSParenthesizedType\" === nodeType ||\n \"TSTypeOperator\" === nodeType ||\n \"TSIndexedAccessType\" === nodeType ||\n \"TSMappedType\" === nodeType ||\n \"TSLiteralType\" === nodeType ||\n \"TSExpressionWithTypeArguments\" === nodeType ||\n \"TSImportType\" === nodeType\n ) {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isNumberLiteral(node: ?Object, opts?: Object): boolean {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"NumberLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRegexLiteral(node: ?Object, opts?: Object): boolean {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RegexLiteral\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isRestProperty(node: ?Object, opts?: Object): boolean {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"RestProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\nexport function isSpreadProperty(node: ?Object, opts?: Object): boolean {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n if (!node) return false;\n\n const nodeType = node.type;\n if (nodeType === \"SpreadProperty\") {\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n }\n\n return false;\n}\n","import { isIdentifier, isMemberExpression, isStringLiteral } from \"./generated\";\n\n/**\n * Determines whether or not the input node `member` matches the\n * input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function matchesPattern(\n member: Object,\n match: string | Array,\n allowPartial?: boolean,\n): boolean {\n // not a member expression\n if (!isMemberExpression(member)) return false;\n\n const parts = Array.isArray(match) ? match : match.split(\".\");\n const nodes = [];\n\n let node;\n for (node = member; isMemberExpression(node); node = node.object) {\n nodes.push(node.property);\n }\n nodes.push(node);\n\n if (nodes.length < parts.length) return false;\n if (!allowPartial && nodes.length > parts.length) return false;\n\n for (let i = 0, j = nodes.length - 1; i < parts.length; i++, j--) {\n const node = nodes[j];\n let value;\n if (isIdentifier(node)) {\n value = node.name;\n } else if (isStringLiteral(node)) {\n value = node.value;\n } else {\n return false;\n }\n\n if (parts[i] !== value) return false;\n }\n\n return true;\n}\n","import matchesPattern from \"./matchesPattern\";\n\n/**\n * Build a function that when called will return whether or not the\n * input `node` `MemberExpression` matches the input `match`.\n *\n * For example, given the match `React.createClass` it would match the\n * parsed nodes of `React.createClass` and `React[\"createClass\"]`.\n */\nexport default function buildMatchMemberExpression(\n match: string,\n allowPartial?: boolean,\n): Object => boolean {\n const parts = match.split(\".\");\n\n return (member: Object): boolean =>\n matchesPattern(member, parts, allowPartial);\n}\n","// @flow\nimport buildMatchMemberExpression from \"../buildMatchMemberExpression\";\n\nconst isReactComponent = buildMatchMemberExpression(\"React.Component\");\n\nexport default isReactComponent;\n","// @flow\nexport default function isCompatTag(tagName?: string): boolean {\n // Must start with a lowercase ASCII letter\n return !!tagName && /^[a-z]/.test(tagName);\n}\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n","'use strict';\n\nlet fastProto = null;\n\n// Creates an object with permanently fast properties in V8. See Toon Verwaest's\n// post https://medium.com/@tverwaes/setting-up-prototypes-in-v8-ec9c9491dfe2#5f62\n// for more details. Use %HasFastProperties(object) and the Node.js flag\n// --allow-natives-syntax to check whether an object has fast properties.\nfunction FastObject(o) {\n\t// A prototype object will have \"fast properties\" enabled once it is checked\n\t// against the inline property cache of a function, e.g. fastProto.property:\n\t// https://github.com/v8/v8/blob/6.0.122/test/mjsunit/fast-prototype.js#L48-L63\n\tif (fastProto !== null && typeof fastProto.property) {\n\t\tconst result = fastProto;\n\t\tfastProto = FastObject.prototype = null;\n\t\treturn result;\n\t}\n\tfastProto = FastObject.prototype = o == null ? Object.create(null) : o;\n\treturn new FastObject;\n}\n\n// Initialize the inline property cache of FastObject\nFastObject();\n\nmodule.exports = function toFastproperties(o) {\n\treturn FastObject(o);\n};\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n function isExpression(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'ArrayExpression':\n case 'AssignmentExpression':\n case 'BinaryExpression':\n case 'CallExpression':\n case 'ConditionalExpression':\n case 'FunctionExpression':\n case 'Identifier':\n case 'Literal':\n case 'LogicalExpression':\n case 'MemberExpression':\n case 'NewExpression':\n case 'ObjectExpression':\n case 'SequenceExpression':\n case 'ThisExpression':\n case 'UnaryExpression':\n case 'UpdateExpression':\n return true;\n }\n return false;\n }\n\n function isIterationStatement(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'DoWhileStatement':\n case 'ForInStatement':\n case 'ForStatement':\n case 'WhileStatement':\n return true;\n }\n return false;\n }\n\n function isStatement(node) {\n if (node == null) { return false; }\n switch (node.type) {\n case 'BlockStatement':\n case 'BreakStatement':\n case 'ContinueStatement':\n case 'DebuggerStatement':\n case 'DoWhileStatement':\n case 'EmptyStatement':\n case 'ExpressionStatement':\n case 'ForInStatement':\n case 'ForStatement':\n case 'IfStatement':\n case 'LabeledStatement':\n case 'ReturnStatement':\n case 'SwitchStatement':\n case 'ThrowStatement':\n case 'TryStatement':\n case 'VariableDeclaration':\n case 'WhileStatement':\n case 'WithStatement':\n return true;\n }\n return false;\n }\n\n function isSourceElement(node) {\n return isStatement(node) || node != null && node.type === 'FunctionDeclaration';\n }\n\n function trailingStatement(node) {\n switch (node.type) {\n case 'IfStatement':\n if (node.alternate != null) {\n return node.alternate;\n }\n return node.consequent;\n\n case 'LabeledStatement':\n case 'ForStatement':\n case 'ForInStatement':\n case 'WhileStatement':\n case 'WithStatement':\n return node.body;\n }\n return null;\n }\n\n function isProblematicIfStatement(node) {\n var current;\n\n if (node.type !== 'IfStatement') {\n return false;\n }\n if (node.alternate == null) {\n return false;\n }\n current = node.consequent;\n do {\n if (current.type === 'IfStatement') {\n if (current.alternate == null) {\n return true;\n }\n }\n current = trailingStatement(current);\n } while (current);\n\n return false;\n }\n\n module.exports = {\n isExpression: isExpression,\n isStatement: isStatement,\n isIterationStatement: isIterationStatement,\n isSourceElement: isSourceElement,\n isProblematicIfStatement: isProblematicIfStatement,\n\n trailingStatement: trailingStatement\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013-2014 Yusuke Suzuki \n Copyright (C) 2014 Ivan Nikulin \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;\n\n // See `tools/generate-identifier-regex.js`.\n ES5Regex = {\n // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:\n NonAsciiIdentifierStart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/,\n // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:\n NonAsciiIdentifierPart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]/\n };\n\n ES6Regex = {\n // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:\n NonAsciiIdentifierStart: /[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF19]|\\uD806[\\uDCA0-\\uDCDF\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]/,\n // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:\n NonAsciiIdentifierPart: /[\\xAA\\xB5\\xB7\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B4\\u08B6-\\u08BD\\u08D4-\\u08E1\\u08E3-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0AF9\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58-\\u0C5A\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C80-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D54-\\u0D57\\u0D5F-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1369-\\u1371\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19DA\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1C80-\\u1C88\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFB-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FD5\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7AE\\uA7B0-\\uA7B7\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA8FD\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDDFD\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDEE0\\uDF00-\\uDF1F\\uDF30-\\uDF4A\\uDF50-\\uDF7A\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCA0-\\uDCA9\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE33\\uDE38-\\uDE3A\\uDE3F\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE6\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2]|\\uD804[\\uDC00-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDCBA\\uDCD0-\\uDCE8\\uDCF0-\\uDCF9\\uDD00-\\uDD34\\uDD36-\\uDD3F\\uDD50-\\uDD73\\uDD76\\uDD80-\\uDDC4\\uDDCA-\\uDDCC\\uDDD0-\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE37\\uDE3E\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3C-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF50\\uDF57\\uDF5D-\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC00-\\uDC4A\\uDC50-\\uDC59\\uDC80-\\uDCC5\\uDCC7\\uDCD0-\\uDCD9\\uDD80-\\uDDB5\\uDDB8-\\uDDC0\\uDDD8-\\uDDDD\\uDE00-\\uDE40\\uDE44\\uDE50-\\uDE59\\uDE80-\\uDEB7\\uDEC0-\\uDEC9\\uDF00-\\uDF19\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDCA0-\\uDCE9\\uDCFF\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC36\\uDC38-\\uDC40\\uDC50-\\uDC59\\uDC72-\\uDC8F\\uDC92-\\uDCA7\\uDCA9-\\uDCB6]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDE60-\\uDE69\\uDED0-\\uDEED\\uDEF0-\\uDEF4\\uDF00-\\uDF36\\uDF40-\\uDF43\\uDF50-\\uDF59\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDF00-\\uDF44\\uDF50-\\uDF7E\\uDF8F-\\uDF9F\\uDFE0]|\\uD821[\\uDC00-\\uDFEC]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00\\uDC01]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDC00-\\uDCC4\\uDCD0-\\uDCD6\\uDD00-\\uDD4A\\uDD50-\\uDD59]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1]|\\uD87E[\\uDC00-\\uDE1D]|\\uDB40[\\uDD00-\\uDDEF]/\n };\n\n function isDecimalDigit(ch) {\n return 0x30 <= ch && ch <= 0x39; // 0..9\n }\n\n function isHexDigit(ch) {\n return 0x30 <= ch && ch <= 0x39 || // 0..9\n 0x61 <= ch && ch <= 0x66 || // a..f\n 0x41 <= ch && ch <= 0x46; // A..F\n }\n\n function isOctalDigit(ch) {\n return ch >= 0x30 && ch <= 0x37; // 0..7\n }\n\n // 7.2 White Space\n\n NON_ASCII_WHITESPACES = [\n 0x1680,\n 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,\n 0x202F, 0x205F,\n 0x3000,\n 0xFEFF\n ];\n\n function isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||\n ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;\n }\n\n // 7.6 Identifier Names and Identifiers\n\n function fromCodePoint(cp) {\n if (cp <= 0xFFFF) { return String.fromCharCode(cp); }\n var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);\n var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);\n return cu1 + cu2;\n }\n\n IDENTIFIER_START = new Array(0x80);\n for(ch = 0; ch < 0x80; ++ch) {\n IDENTIFIER_START[ch] =\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)\n }\n\n IDENTIFIER_PART = new Array(0x80);\n for(ch = 0; ch < 0x80; ++ch) {\n IDENTIFIER_PART[ch] =\n ch >= 0x61 && ch <= 0x7A || // a..z\n ch >= 0x41 && ch <= 0x5A || // A..Z\n ch >= 0x30 && ch <= 0x39 || // 0..9\n ch === 0x24 || ch === 0x5F; // $ (dollar) and _ (underscore)\n }\n\n function isIdentifierStartES5(ch) {\n return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));\n }\n\n function isIdentifierPartES5(ch) {\n return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));\n }\n\n function isIdentifierStartES6(ch) {\n return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));\n }\n\n function isIdentifierPartES6(ch) {\n return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));\n }\n\n module.exports = {\n isDecimalDigit: isDecimalDigit,\n isHexDigit: isHexDigit,\n isOctalDigit: isOctalDigit,\n isWhiteSpace: isWhiteSpace,\n isLineTerminator: isLineTerminator,\n isIdentifierStartES5: isIdentifierStartES5,\n isIdentifierPartES5: isIdentifierPartES5,\n isIdentifierStartES6: isIdentifierStartES6,\n isIdentifierPartES6: isIdentifierPartES6\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n(function () {\n 'use strict';\n\n var code = require('./code');\n\n function isStrictModeReservedWordES6(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isKeywordES5(id, strict) {\n // yield should not be treated as keyword under non-strict mode.\n if (!strict && id === 'yield') {\n return false;\n }\n return isKeywordES6(id, strict);\n }\n\n function isKeywordES6(id, strict) {\n if (strict && isStrictModeReservedWordES6(id)) {\n return true;\n }\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n function isReservedWordES5(id, strict) {\n return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);\n }\n\n function isReservedWordES6(id, strict) {\n return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n function isIdentifierNameES5(id) {\n var i, iz, ch;\n\n if (id.length === 0) { return false; }\n\n ch = id.charCodeAt(0);\n if (!code.isIdentifierStartES5(ch)) {\n return false;\n }\n\n for (i = 1, iz = id.length; i < iz; ++i) {\n ch = id.charCodeAt(i);\n if (!code.isIdentifierPartES5(ch)) {\n return false;\n }\n }\n return true;\n }\n\n function decodeUtf16(lead, trail) {\n return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n }\n\n function isIdentifierNameES6(id) {\n var i, iz, ch, lowCh, check;\n\n if (id.length === 0) { return false; }\n\n check = code.isIdentifierStartES6;\n for (i = 0, iz = id.length; i < iz; ++i) {\n ch = id.charCodeAt(i);\n if (0xD800 <= ch && ch <= 0xDBFF) {\n ++i;\n if (i >= iz) { return false; }\n lowCh = id.charCodeAt(i);\n if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {\n return false;\n }\n ch = decodeUtf16(ch, lowCh);\n }\n if (!check(ch)) {\n return false;\n }\n check = code.isIdentifierPartES6;\n }\n return true;\n }\n\n function isIdentifierES5(id, strict) {\n return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);\n }\n\n function isIdentifierES6(id, strict) {\n return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);\n }\n\n module.exports = {\n isKeywordES5: isKeywordES5,\n isKeywordES6: isKeywordES6,\n isReservedWordES5: isReservedWordES5,\n isReservedWordES6: isReservedWordES6,\n isRestrictedWord: isRestrictedWord,\n isIdentifierNameES5: isIdentifierNameES5,\n isIdentifierNameES6: isIdentifierNameES6,\n isIdentifierES5: isIdentifierES5,\n isIdentifierES6: isIdentifierES6\n };\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n Copyright (C) 2013 Yusuke Suzuki \n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n\n(function () {\n 'use strict';\n\n exports.ast = require('./ast');\n exports.code = require('./code');\n exports.keyword = require('./keyword');\n}());\n/* vim: set sw=4 ts=4 et tw=80 : */\n","// @flow\nimport { FLIPPED_ALIAS_KEYS, ALIAS_KEYS } from \"../definitions\";\n\n/**\n * Test if a `nodeType` is a `targetType` or if `targetType` is an alias of `nodeType`.\n */\nexport default function isType(nodeType: ?string, targetType: string): boolean {\n if (nodeType === targetType) return true;\n\n // This is a fast-path. If the test above failed, but an alias key is found, then the\n // targetType was a primary node type, so there's no need to check the aliases.\n if (ALIAS_KEYS[targetType]) return false;\n\n const aliases: ?Array = FLIPPED_ALIAS_KEYS[targetType];\n if (aliases) {\n if (aliases[0] === nodeType) return true;\n\n for (const alias of aliases) {\n if (nodeType === alias) return true;\n }\n }\n\n return false;\n}\n","// @flow\nimport { PLACEHOLDERS_ALIAS } from \"../definitions\";\n\n/**\n * Test if a `placeholderType` is a `targetType` or if `targetType` is an alias of `placeholderType`.\n */\nexport default function isPlaceholderType(\n placeholderType: string,\n targetType: string,\n): boolean {\n if (placeholderType === targetType) return true;\n\n const aliases: ?Array = PLACEHOLDERS_ALIAS[placeholderType];\n if (aliases) {\n for (const alias of aliases) {\n if (targetType === alias) return true;\n }\n }\n\n return false;\n}\n","// @flow\nimport shallowEqual from \"../utils/shallowEqual\";\nimport isType from \"./isType\";\nimport isPlaceholderType from \"./isPlaceholderType\";\nimport { FLIPPED_ALIAS_KEYS } from \"../definitions\";\n\n/**\n * Returns whether `node` is of given `type`.\n *\n * For better performance, use this instead of `is[Type]` when `type` is unknown.\n */\nexport default function is(type: string, node: Object, opts?: Object): boolean {\n if (!node) return false;\n\n const matches = isType(node.type, type);\n if (!matches) {\n if (!opts && node.type === \"Placeholder\" && type in FLIPPED_ALIAS_KEYS) {\n // We can only return true if the placeholder doesn't replace a real node,\n // but it replaces a category of nodes (an alias).\n //\n // t.is(\"Identifier\", node) gives some guarantees about node's shape, so we\n // can't say that Placeholder(expectedNode: \"Identifier\") is an identifier\n // because it doesn't have the same properties.\n // On the other hand, t.is(\"Expression\", node) doesn't say anything about\n // the shape of node because Expression can be many different nodes: we can,\n // and should, safely report expression placeholders as Expressions.\n return isPlaceholderType(node.expectedNode, type);\n }\n return false;\n }\n\n if (typeof opts === \"undefined\") {\n return true;\n } else {\n return shallowEqual(node, opts);\n }\n}\n","// @flow\nexport const STATEMENT_OR_BLOCK_KEYS = [\"consequent\", \"body\", \"alternate\"];\nexport const FLATTENABLE_KEYS = [\"body\", \"expressions\"];\nexport const FOR_INIT_KEYS = [\"left\", \"init\"];\nexport const COMMENT_KEYS = [\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n];\n\nexport const LOGICAL_OPERATORS = [\"||\", \"&&\", \"??\"];\nexport const UPDATE_OPERATORS = [\"++\", \"--\"];\n\nexport const BOOLEAN_NUMBER_BINARY_OPERATORS = [\">\", \"<\", \">=\", \"<=\"];\nexport const EQUALITY_BINARY_OPERATORS = [\"==\", \"===\", \"!=\", \"!==\"];\nexport const COMPARISON_BINARY_OPERATORS = [\n ...EQUALITY_BINARY_OPERATORS,\n \"in\",\n \"instanceof\",\n];\nexport const BOOLEAN_BINARY_OPERATORS = [\n ...COMPARISON_BINARY_OPERATORS,\n ...BOOLEAN_NUMBER_BINARY_OPERATORS,\n];\nexport const NUMBER_BINARY_OPERATORS = [\n \"-\",\n \"/\",\n \"%\",\n \"*\",\n \"**\",\n \"&\",\n \"|\",\n \">>\",\n \">>>\",\n \"<<\",\n \"^\",\n];\nexport const BINARY_OPERATORS = [\n \"+\",\n ...NUMBER_BINARY_OPERATORS,\n ...BOOLEAN_BINARY_OPERATORS,\n];\n\nexport const ASSIGNMENT_OPERATORS = [\n \"=\",\n \"+=\",\n ...NUMBER_BINARY_OPERATORS.map(op => op + \"=\"),\n];\n\nexport const BOOLEAN_UNARY_OPERATORS = [\"delete\", \"!\"];\nexport const NUMBER_UNARY_OPERATORS = [\"+\", \"-\", \"~\"];\nexport const STRING_UNARY_OPERATORS = [\"typeof\"];\nexport const UNARY_OPERATORS = [\n \"void\",\n \"throw\",\n ...BOOLEAN_UNARY_OPERATORS,\n ...NUMBER_UNARY_OPERATORS,\n ...STRING_UNARY_OPERATORS,\n];\n\nexport const INHERIT_KEYS = {\n optional: [\"typeAnnotation\", \"typeParameters\", \"returnType\"],\n force: [\"start\", \"loc\", \"end\"],\n};\n\nexport const BLOCK_SCOPED_SYMBOL = Symbol.for(\"var used to be block scoped\");\nexport const NOT_LOCAL_BINDING = Symbol.for(\n \"should not be considered a local binding\",\n);\n","// @flow\nimport { NODE_FIELDS, NODE_PARENT_VALIDATIONS } from \"../definitions\";\n\nexport default function validate(node?: Object, key: string, val: any): void {\n if (!node) return;\n\n const fields = NODE_FIELDS[node.type];\n if (!fields) return;\n\n const field = fields[key];\n validateField(node, key, val, field);\n validateChild(node, key, val);\n}\n\nexport function validateField(\n node?: Object,\n key: string,\n val: any,\n field: any,\n): void {\n if (!field || !field.validate) return;\n if (field.optional && val == null) return;\n\n field.validate(node, key, val);\n}\n\nexport function validateChild(node?: Object, key: string, val?: Object) {\n if (val == null) return;\n const validate = NODE_PARENT_VALIDATIONS[val.type];\n if (!validate) return;\n validate(node, key, val);\n}\n","// @flow\nimport is from \"../validators/is\";\nimport { validateField, validateChild } from \"../validators/validate\";\n\nexport const VISITOR_KEYS: { [string]: Array } = {};\nexport const ALIAS_KEYS: { [string]: Array } = {};\nexport const FLIPPED_ALIAS_KEYS: { [string]: Array } = {};\nexport const NODE_FIELDS: { [string]: {} } = {};\nexport const BUILDER_KEYS: { [string]: Array } = {};\nexport const DEPRECATED_KEYS: { [string]: string } = {};\nexport const NODE_PARENT_VALIDATIONS = {};\n\nfunction getType(val) {\n if (Array.isArray(val)) {\n return \"array\";\n } else if (val === null) {\n return \"null\";\n } else {\n return typeof val;\n }\n}\n\n// TODO: Import and use Node instead of any\ntype Validator = (any, string, any) => void;\n\ntype FieldOptions = {\n default?: any,\n optional?: boolean,\n validate?: Validator,\n};\n\nexport function validate(validate: Validator): FieldOptions {\n return { validate };\n}\n\nexport function typeIs(typeName: string | string[]) {\n return typeof typeName === \"string\"\n ? assertNodeType(typeName)\n : assertNodeType(...typeName);\n}\n\nexport function validateType(typeName: string | string[]) {\n return validate(typeIs(typeName));\n}\n\nexport function validateOptional(validate: Validator): FieldOptions {\n return { validate, optional: true };\n}\n\nexport function validateOptionalType(\n typeName: string | string[],\n): FieldOptions {\n return { validate: typeIs(typeName), optional: true };\n}\n\nexport function arrayOf(elementType: Validator): Validator {\n return chain(assertValueType(\"array\"), assertEach(elementType));\n}\n\nexport function arrayOfType(typeName: string | string[]) {\n return arrayOf(typeIs(typeName));\n}\n\nexport function validateArrayOfType(typeName: string | string[]) {\n return validate(arrayOfType(typeName));\n}\n\nexport function assertEach(callback: Validator): Validator {\n function validator(node, key, val) {\n if (!Array.isArray(val)) return;\n\n for (let i = 0; i < val.length; i++) {\n const subkey = `${key}[${i}]`;\n const v = val[i];\n callback(node, subkey, v);\n if (process.env.BABEL_TYPES_8_BREAKING) validateChild(node, subkey, v);\n }\n }\n validator.each = callback;\n return validator;\n}\n\nexport function assertOneOf(...values: Array): Validator {\n function validate(node: Object, key: string, val: any) {\n if (values.indexOf(val) < 0) {\n throw new TypeError(\n `Property ${key} expected value to be one of ${JSON.stringify(\n values,\n )} but got ${JSON.stringify(val)}`,\n );\n }\n }\n\n validate.oneOf = values;\n\n return validate;\n}\n\nexport function assertNodeType(...types: Array): Validator {\n function validate(node, key, val) {\n for (const type of types) {\n if (is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val && val.type)}`,\n );\n }\n\n validate.oneOfNodeTypes = types;\n\n return validate;\n}\n\nexport function assertNodeOrValueType(...types: Array): Validator {\n function validate(node, key, val) {\n for (const type of types) {\n if (getType(val) === type || is(type, val)) {\n validateChild(node, key, val);\n return;\n }\n }\n\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected node to be of a type ${JSON.stringify(\n types,\n )} but instead got ${JSON.stringify(val && val.type)}`,\n );\n }\n\n validate.oneOfNodeOrValueTypes = types;\n\n return validate;\n}\n\nexport function assertValueType(type: string): Validator {\n function validate(node, key, val) {\n const valid = getType(val) === type;\n\n if (!valid) {\n throw new TypeError(\n `Property ${key} expected type of ${type} but got ${getType(val)}`,\n );\n }\n }\n\n validate.type = type;\n\n return validate;\n}\n\nexport function assertShape(shape: { [string]: FieldOptions }): Validator {\n function validate(node, key, val) {\n const errors = [];\n for (const property of Object.keys(shape)) {\n try {\n validateField(node, property, val[property], shape[property]);\n } catch (error) {\n if (error instanceof TypeError) {\n errors.push(error.message);\n continue;\n }\n throw error;\n }\n }\n if (errors.length) {\n throw new TypeError(\n `Property ${key} of ${\n node.type\n } expected to have the following:\\n${errors.join(\"\\n\")}`,\n );\n }\n }\n\n validate.shapeOf = shape;\n\n return validate;\n}\n\nexport function chain(...fns: Array): Validator {\n function validate(...args) {\n for (const fn of fns) {\n fn(...args);\n }\n }\n validate.chainOf = fns;\n return validate;\n}\n\nconst validTypeOpts = [\n \"aliases\",\n \"builder\",\n \"deprecatedAlias\",\n \"fields\",\n \"inherits\",\n \"visitor\",\n \"validate\",\n];\nconst validFieldKeys = [\"default\", \"optional\", \"validate\"];\n\nexport default function defineType(\n type: string,\n opts: {\n fields?: {\n [string]: FieldOptions,\n },\n visitor?: Array,\n aliases?: Array,\n builder?: Array,\n inherits?: string,\n deprecatedAlias?: string,\n validate?: Validator,\n } = {},\n) {\n const inherits = (opts.inherits && store[opts.inherits]) || {};\n\n let fields = opts.fields;\n if (!fields) {\n fields = {};\n if (inherits.fields) {\n const keys = Object.getOwnPropertyNames(inherits.fields);\n for (const key of (keys: Array)) {\n const field = inherits.fields[key];\n fields[key] = {\n default: field.default,\n optional: field.optional,\n validate: field.validate,\n };\n }\n }\n }\n\n const visitor: Array = opts.visitor || inherits.visitor || [];\n const aliases: Array = opts.aliases || inherits.aliases || [];\n const builder: Array =\n opts.builder || inherits.builder || opts.visitor || [];\n\n for (const k of (Object.keys(opts): Array)) {\n if (validTypeOpts.indexOf(k) === -1) {\n throw new Error(`Unknown type option \"${k}\" on ${type}`);\n }\n }\n\n if (opts.deprecatedAlias) {\n DEPRECATED_KEYS[opts.deprecatedAlias] = type;\n }\n\n // ensure all field keys are represented in `fields`\n for (const key of (visitor.concat(builder): Array)) {\n fields[key] = fields[key] || {};\n }\n\n for (const key of Object.keys(fields)) {\n const field = fields[key];\n\n if (field.default !== undefined && builder.indexOf(key) === -1) {\n field.optional = true;\n }\n if (field.default === undefined) {\n field.default = null;\n } else if (!field.validate && field.default != null) {\n field.validate = assertValueType(getType(field.default));\n }\n\n for (const k of (Object.keys(field): Array)) {\n if (validFieldKeys.indexOf(k) === -1) {\n throw new Error(`Unknown field key \"${k}\" on ${type}.${key}`);\n }\n }\n }\n\n VISITOR_KEYS[type] = opts.visitor = visitor;\n BUILDER_KEYS[type] = opts.builder = builder;\n NODE_FIELDS[type] = opts.fields = fields;\n ALIAS_KEYS[type] = opts.aliases = aliases;\n aliases.forEach(alias => {\n FLIPPED_ALIAS_KEYS[alias] = FLIPPED_ALIAS_KEYS[alias] || [];\n FLIPPED_ALIAS_KEYS[alias].push(type);\n });\n\n if (opts.validate) {\n NODE_PARENT_VALIDATIONS[type] = opts.validate;\n }\n\n store[type] = opts;\n}\n\nconst store = {};\n","// @flow\n\nimport esutils from \"esutils\";\n\nimport is from \"../validators/is\";\n\nimport {\n BINARY_OPERATORS,\n LOGICAL_OPERATORS,\n ASSIGNMENT_OPERATORS,\n UNARY_OPERATORS,\n UPDATE_OPERATORS,\n} from \"../constants\";\n\nimport defineType, {\n assertValueType,\n assertNodeType,\n assertNodeOrValueType,\n assertEach,\n chain,\n assertOneOf,\n} from \"./utils\";\n\ndefineType(\"ArrayExpression\", {\n fields: {\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeOrValueType(\"null\", \"Expression\", \"SpreadElement\"),\n ),\n ),\n default: !process.env.BABEL_TYPES_8_BREAKING ? [] : undefined,\n },\n },\n visitor: [\"elements\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"AssignmentExpression\", {\n fields: {\n operator: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertValueType(\"string\");\n }\n\n const identifier = assertOneOf(...ASSIGNMENT_OPERATORS);\n const pattern = assertOneOf(\"=\");\n\n return function(node, key, val) {\n const validator = is(\"Pattern\", node.left) ? pattern : identifier;\n validator(node, key, val);\n };\n })(),\n },\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"BinaryExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n fields: {\n operator: {\n validate: assertOneOf(...BINARY_OPERATORS),\n },\n left: {\n validate: assertNodeType(\"Expression\"),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n});\n\ndefineType(\"InterpreterDirective\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"Directive\", {\n visitor: [\"value\"],\n fields: {\n value: {\n validate: assertNodeType(\"DirectiveLiteral\"),\n },\n },\n});\n\ndefineType(\"DirectiveLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"BlockStatement\", {\n builder: [\"body\", \"directives\"],\n visitor: [\"directives\", \"body\"],\n fields: {\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\", \"Statement\"],\n});\n\ndefineType(\"BreakStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"CallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\", \"V8IntrinsicIdentifier\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Expression\",\n \"SpreadElement\",\n \"JSXNamespacedName\",\n \"ArgumentPlaceholder\",\n ),\n ),\n ),\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"CatchClause\", {\n visitor: [\"param\", \"body\"],\n fields: {\n param: {\n validate: assertNodeType(\"Identifier\", \"ArrayPattern\", \"ObjectPattern\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\"],\n});\n\ndefineType(\"ConditionalExpression\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Expression\"),\n },\n alternate: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Expression\", \"Conditional\"],\n});\n\ndefineType(\"ContinueStatement\", {\n visitor: [\"label\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n },\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n});\n\ndefineType(\"DebuggerStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"DoWhileStatement\", {\n visitor: [\"test\", \"body\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n});\n\ndefineType(\"EmptyStatement\", {\n aliases: [\"Statement\"],\n});\n\ndefineType(\"ExpressionStatement\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n aliases: [\"Statement\", \"ExpressionWrapper\"],\n});\n\ndefineType(\"File\", {\n builder: [\"program\", \"comments\", \"tokens\"],\n visitor: [\"program\"],\n fields: {\n program: {\n validate: assertNodeType(\"Program\"),\n },\n },\n});\n\ndefineType(\"ForInStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"VariableDeclaration\", \"LVal\")\n : assertNodeType(\n \"VariableDeclaration\",\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"ForStatement\", {\n visitor: [\"init\", \"test\", \"update\", \"body\"],\n aliases: [\"Scopable\", \"Statement\", \"For\", \"BlockParent\", \"Loop\"],\n fields: {\n init: {\n validate: assertNodeType(\"VariableDeclaration\", \"Expression\"),\n optional: true,\n },\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n update: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\nexport const functionCommon = {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"Identifier\",\n \"Pattern\",\n \"RestElement\",\n \"TSParameterProperty\",\n ),\n ),\n ),\n },\n generator: {\n default: false,\n },\n async: {\n default: false,\n },\n};\n\nexport const functionTypeAnnotationCommon = {\n returnType: {\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n \"Noop\",\n ),\n optional: true,\n },\n};\n\nexport const functionDeclarationCommon = {\n ...functionCommon,\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true, // May be null for `export default function`\n },\n};\n\ndefineType(\"FunctionDeclaration\", {\n builder: [\"id\", \"params\", \"body\", \"generator\", \"async\"],\n visitor: [\"id\", \"params\", \"body\", \"returnType\", \"typeParameters\"],\n fields: {\n ...functionDeclarationCommon,\n ...functionTypeAnnotationCommon,\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Statement\",\n \"Pureish\",\n \"Declaration\",\n ],\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) return () => {};\n\n const identifier = assertNodeType(\"Identifier\");\n\n return function(parent, key, node) {\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"FunctionExpression\", {\n inherits: \"FunctionDeclaration\",\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n id: {\n validate: assertNodeType(\"Identifier\"),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\nexport const patternLikeCommon = {\n typeAnnotation: {\n // TODO: @babel/plugin-transform-flow-comments puts a Noop here, is there a better way?\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n },\n};\n\ndefineType(\"Identifier\", {\n builder: [\"name\"],\n visitor: [\"typeAnnotation\", \"decorators\" /* for legacy param decorators */],\n aliases: [\"Expression\", \"PatternLike\", \"LVal\", \"TSEntityName\"],\n fields: {\n ...patternLikeCommon,\n name: {\n validate: chain(assertValueType(\"string\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!esutils.keyword.isIdentifierNameES6(val)) {\n throw new TypeError(`\"${val}\" is not a valid identifier name`);\n }\n }),\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /\\.(\\w+)$/.exec(key);\n if (!match) return;\n\n const [, parentKey] = match;\n const nonComp = { computed: false };\n\n // We can't check if `parent.property === node`, because nodes are validated\n // before replacing them in the AST.\n if (parentKey === \"property\") {\n if (is(\"MemberExpression\", parent, nonComp)) return;\n if (is(\"OptionalMemberExpression\", parent, nonComp)) return;\n } else if (parentKey === \"key\") {\n if (is(\"Property\", parent, nonComp)) return;\n if (is(\"Method\", parent, nonComp)) return;\n } else if (parentKey === \"exported\") {\n if (is(\"ExportSpecifier\", parent)) return;\n } else if (parentKey === \"imported\") {\n if (is(\"ImportSpecifier\", parent, { imported: node })) return;\n } else if (parentKey === \"meta\") {\n if (is(\"MetaProperty\", parent, { meta: node })) return;\n }\n\n if (\n // Ideally this should be strict if this node is a descendant of a block\n // in strict mode. Also, we should disallow \"await\" in modules.\n esutils.keyword.isReservedWordES6(node.name, /* strict */ false) &&\n // Even if \"this\" is a keyword, we are using the Identifier\n // node to represent it.\n node.name !== \"this\"\n ) {\n throw new TypeError(`\"${node.name}\" is not a valid identifer`);\n }\n },\n});\n\ndefineType(\"IfStatement\", {\n visitor: [\"test\", \"consequent\", \"alternate\"],\n aliases: [\"Statement\", \"Conditional\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n consequent: {\n validate: assertNodeType(\"Statement\"),\n },\n alternate: {\n optional: true,\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"LabeledStatement\", {\n visitor: [\"label\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n label: {\n validate: assertNodeType(\"Identifier\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"StringLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NumericLiteral\", {\n builder: [\"value\"],\n deprecatedAlias: \"NumberLiteral\",\n fields: {\n value: {\n validate: assertValueType(\"number\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"NullLiteral\", {\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"BooleanLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"boolean\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n\ndefineType(\"RegExpLiteral\", {\n builder: [\"pattern\", \"flags\"],\n deprecatedAlias: \"RegexLiteral\",\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n pattern: {\n validate: assertValueType(\"string\"),\n },\n flags: {\n validate: chain(assertValueType(\"string\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const invalid = /[^gimsuy]/.exec(val);\n if (invalid) {\n throw new TypeError(`\"${invalid[0]}\" is not a valid RegExp flag`);\n }\n }),\n default: \"\",\n },\n },\n});\n\ndefineType(\"LogicalExpression\", {\n builder: [\"operator\", \"left\", \"right\"],\n visitor: [\"left\", \"right\"],\n aliases: [\"Binary\", \"Expression\"],\n fields: {\n operator: {\n validate: assertOneOf(...LOGICAL_OPERATORS),\n },\n left: {\n validate: assertNodeType(\"Expression\"),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"MemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\", \"LVal\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n property: {\n validate: (function() {\n const normal = assertNodeType(\"Identifier\", \"PrivateName\");\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n computed: {\n default: false,\n },\n ...(!process.env.BABEL_TYPES_8_BREAKING\n ? {\n optional: {\n validate: assertOneOf(true, false),\n optional: true,\n },\n }\n : {}),\n },\n});\n\ndefineType(\"NewExpression\", { inherits: \"CallExpression\" });\n\ndefineType(\"Program\", {\n // Note: We explicitly leave 'interpreter' out here because it is\n // conceptually comment-like, and Babel does not traverse comments either.\n visitor: [\"directives\", \"body\"],\n builder: [\"body\", \"directives\", \"sourceType\", \"interpreter\"],\n fields: {\n sourceFile: {\n validate: assertValueType(\"string\"),\n },\n sourceType: {\n validate: assertOneOf(\"script\", \"module\"),\n default: \"script\",\n },\n interpreter: {\n validate: assertNodeType(\"InterpreterDirective\"),\n default: null,\n optional: true,\n },\n directives: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Directive\")),\n ),\n default: [],\n },\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n aliases: [\"Scopable\", \"BlockParent\", \"Block\"],\n});\n\ndefineType(\"ObjectExpression\", {\n visitor: [\"properties\"],\n aliases: [\"Expression\"],\n fields: {\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"ObjectMethod\", \"ObjectProperty\", \"SpreadElement\"),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ObjectMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"computed\", \"generator\", \"async\"],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n kind: {\n validate: assertOneOf(\"method\", \"get\", \"set\"),\n ...(!process.env.BABEL_TYPES_8_BREAKING ? { default: \"method\" } : {}),\n },\n computed: {\n default: false,\n },\n key: {\n validate: (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"UserWhitespacable\",\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"ObjectMember\",\n ],\n});\n\ndefineType(\"ObjectProperty\", {\n builder: [\n \"key\",\n \"value\",\n \"computed\",\n \"shorthand\",\n ...(!process.env.BABEL_TYPES_8_BREAKING ? [\"decorators\"] : []),\n ],\n fields: {\n computed: {\n default: false,\n },\n key: {\n validate: (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n value: {\n // Value may be PatternLike if this is an AssignmentProperty\n // https://github.com/babel/babylon/issues/434\n validate: assertNodeType(\"Expression\", \"PatternLike\"),\n },\n shorthand: {\n validate: chain(\n assertValueType(\"boolean\"),\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && node.computed) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if computed is true\",\n );\n }\n },\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !is(\"Identifier\", node.key)) {\n throw new TypeError(\n \"Property shorthand of ObjectProperty cannot be true if key is not an Identifier\",\n );\n }\n },\n ),\n default: false,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n visitor: [\"key\", \"value\", \"decorators\"],\n aliases: [\"UserWhitespacable\", \"Property\", \"ObjectMember\"],\n validate: (function() {\n const pattern = assertNodeType(\"Identifier\", \"Pattern\");\n const expression = assertNodeType(\"Expression\");\n\n return function(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const validator = is(\"ObjectPattern\", parent) ? pattern : expression;\n validator(node, \"value\", node.value);\n };\n })(),\n});\n\ndefineType(\"RestElement\", {\n visitor: [\"argument\", \"typeAnnotation\"],\n builder: [\"argument\"],\n aliases: [\"LVal\", \"PatternLike\"],\n deprecatedAlias: \"RestProperty\",\n fields: {\n ...patternLikeCommon,\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"LVal\")\n : assertNodeType(\"Identifier\", \"Pattern\", \"MemberExpression\"),\n },\n },\n validate(parent, key) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n const match = /(\\w+)\\[(\\d+)\\]/.exec(key);\n if (!match) throw new Error(\"Internal Babel error: malformed key.\");\n\n const [, listKey, index] = match;\n if (parent[listKey].length > index + 1) {\n throw new TypeError(`RestElement must be last element of ${listKey}`);\n }\n },\n});\n\ndefineType(\"ReturnStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"SequenceExpression\", {\n visitor: [\"expressions\"],\n fields: {\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\")),\n ),\n },\n },\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ParenthesizedExpression\", {\n visitor: [\"expression\"],\n aliases: [\"Expression\", \"ExpressionWrapper\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"SwitchCase\", {\n visitor: [\"test\", \"consequent\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n consequent: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Statement\")),\n ),\n },\n },\n});\n\ndefineType(\"SwitchStatement\", {\n visitor: [\"discriminant\", \"cases\"],\n aliases: [\"Statement\", \"BlockParent\", \"Scopable\"],\n fields: {\n discriminant: {\n validate: assertNodeType(\"Expression\"),\n },\n cases: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"SwitchCase\")),\n ),\n },\n },\n});\n\ndefineType(\"ThisExpression\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"ThrowStatement\", {\n visitor: [\"argument\"],\n aliases: [\"Statement\", \"Terminatorless\", \"CompletionStatement\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"TryStatement\", {\n visitor: [\"block\", \"handler\", \"finalizer\"],\n aliases: [\"Statement\"],\n fields: {\n block: {\n validate: chain(assertNodeType(\"BlockStatement\"), function(node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (!node.handler && !node.finalizer) {\n throw new TypeError(\n \"TryStatement expects either a handler or finalizer, or both\",\n );\n }\n }),\n },\n handler: {\n optional: true,\n validate: assertNodeType(\"CatchClause\"),\n },\n finalizer: {\n optional: true,\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"UnaryExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: true,\n },\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n operator: {\n validate: assertOneOf(...UNARY_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\", \"Expression\"],\n});\n\ndefineType(\"UpdateExpression\", {\n builder: [\"operator\", \"argument\", \"prefix\"],\n fields: {\n prefix: {\n default: false,\n },\n argument: {\n validate: !process.env.BABEL_TYPES_8_BREAKING\n ? assertNodeType(\"Expression\")\n : assertNodeType(\"Identifier\", \"MemberExpression\"),\n },\n operator: {\n validate: assertOneOf(...UPDATE_OPERATORS),\n },\n },\n visitor: [\"argument\"],\n aliases: [\"Expression\"],\n});\n\ndefineType(\"VariableDeclaration\", {\n builder: [\"kind\", \"declarations\"],\n visitor: [\"declarations\"],\n aliases: [\"Statement\", \"Declaration\"],\n fields: {\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n kind: {\n validate: assertOneOf(\"var\", \"let\", \"const\"),\n },\n declarations: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"VariableDeclarator\")),\n ),\n },\n },\n validate(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ForXStatement\", parent, { left: node })) return;\n if (node.declarations.length !== 1) {\n throw new TypeError(\n `Exactly one VariableDeclarator is required in the VariableDeclaration of a ${parent.type}`,\n );\n }\n },\n});\n\ndefineType(\"VariableDeclarator\", {\n visitor: [\"id\", \"init\"],\n fields: {\n id: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"LVal\");\n }\n\n const normal = assertNodeType(\n \"Identifier\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n );\n const without = assertNodeType(\"Identifier\");\n\n return function(node, key, val) {\n const validator = node.init ? normal : without;\n validator(node, key, val);\n };\n })(),\n },\n definite: {\n optional: true,\n validate: assertValueType(\"boolean\"),\n },\n init: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"WhileStatement\", {\n visitor: [\"test\", \"body\"],\n aliases: [\"Statement\", \"BlockParent\", \"Loop\", \"While\", \"Scopable\"],\n fields: {\n test: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n\ndefineType(\"WithStatement\", {\n visitor: [\"object\", \"body\"],\n aliases: [\"Statement\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n assertShape,\n assertNodeType,\n assertValueType,\n assertNodeOrValueType,\n chain,\n assertEach,\n assertOneOf,\n validateOptional,\n} from \"./utils\";\nimport {\n functionCommon,\n functionTypeAnnotationCommon,\n patternLikeCommon,\n} from \"./core\";\nimport is from \"../validators/is\";\n\ndefineType(\"AssignmentPattern\", {\n visitor: [\"left\", \"right\", \"decorators\" /* for legacy param decorators */],\n builder: [\"left\", \"right\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n left: {\n validate: assertNodeType(\n \"Identifier\",\n \"ObjectPattern\",\n \"ArrayPattern\",\n \"MemberExpression\",\n ),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n // For TypeScript\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ArrayPattern\", {\n visitor: [\"elements\", \"typeAnnotation\"],\n builder: [\"elements\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n elements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeOrValueType(\"null\", \"PatternLike\")),\n ),\n },\n // For TypeScript\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ArrowFunctionExpression\", {\n builder: [\"params\", \"body\", \"async\"],\n visitor: [\"params\", \"body\", \"returnType\", \"typeParameters\"],\n aliases: [\n \"Scopable\",\n \"Function\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Expression\",\n \"Pureish\",\n ],\n fields: {\n ...functionCommon,\n ...functionTypeAnnotationCommon,\n expression: {\n // https://github.com/babel/babylon/issues/505\n validate: assertValueType(\"boolean\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\", \"Expression\"),\n },\n },\n});\n\ndefineType(\"ClassBody\", {\n visitor: [\"body\"],\n fields: {\n body: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ClassMethod\",\n \"ClassPrivateMethod\",\n \"ClassProperty\",\n \"ClassPrivateProperty\",\n \"TSDeclareMethod\",\n \"TSIndexSignature\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"ClassExpression\", {\n builder: [\"id\", \"superClass\", \"body\", \"decorators\"],\n visitor: [\n \"id\",\n \"body\",\n \"superClass\",\n \"mixins\",\n \"typeParameters\",\n \"superTypeParameters\",\n \"implements\",\n \"decorators\",\n ],\n aliases: [\"Scopable\", \"Class\", \"Expression\", \"Pureish\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n // In declarations, this is missing if this is the\n // child of an ExportDefaultDeclaration.\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterDeclaration\",\n \"TSTypeParameterDeclaration\",\n \"Noop\",\n ),\n optional: true,\n },\n body: {\n validate: assertNodeType(\"ClassBody\"),\n },\n superClass: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n superTypeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n implements: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"TSExpressionWithTypeArguments\", \"ClassImplements\"),\n ),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassDeclaration\", {\n inherits: \"ClassExpression\",\n aliases: [\"Scopable\", \"Class\", \"Statement\", \"Declaration\", \"Pureish\"],\n fields: {\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n validate: (function() {\n const identifier = assertNodeType(\"Identifier\");\n\n return function(parent, key, node) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (!is(\"ExportDefaultDeclaration\", parent)) {\n identifier(node, \"id\", node.id);\n }\n };\n })(),\n});\n\ndefineType(\"ExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n },\n});\n\ndefineType(\"ExportDefaultDeclaration\", {\n visitor: [\"declaration\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n validate: assertNodeType(\n \"FunctionDeclaration\",\n \"TSDeclareFunction\",\n \"ClassDeclaration\",\n \"Expression\",\n ),\n },\n },\n});\n\ndefineType(\"ExportNamedDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\n \"Statement\",\n \"Declaration\",\n \"ModuleDeclaration\",\n \"ExportDeclaration\",\n ],\n fields: {\n declaration: {\n optional: true,\n validate: chain(\n assertNodeType(\"Declaration\"),\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.specifiers.length) {\n throw new TypeError(\n \"Only declaration or specifiers is allowed on ExportNamedDeclaration\",\n );\n }\n },\n function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n // This validator isn't put at the top level because we can run it\n // even if this node doesn't have a parent.\n\n if (val && node.source) {\n throw new TypeError(\"Cannot export a declaration from a source\");\n }\n },\n ),\n },\n specifiers: {\n default: [],\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n (function() {\n const sourced = assertNodeType(\n \"ExportSpecifier\",\n \"ExportDefaultSpecifier\",\n \"ExportNamespaceSpecifier\",\n );\n const sourceless = assertNodeType(\"ExportSpecifier\");\n\n if (!process.env.BABEL_TYPES_8_BREAKING) return sourced;\n\n return function(node, key, val) {\n const validator = node.source ? sourced : sourceless;\n validator(node, key, val);\n };\n })(),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n optional: true,\n },\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"ExportSpecifier\", {\n visitor: [\"local\", \"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ForOfStatement\", {\n visitor: [\"left\", \"right\", \"body\"],\n builder: [\"left\", \"right\", \"body\", \"await\"],\n aliases: [\n \"Scopable\",\n \"Statement\",\n \"For\",\n \"BlockParent\",\n \"Loop\",\n \"ForXStatement\",\n ],\n fields: {\n left: {\n validate: (function() {\n if (!process.env.BABEL_TYPES_8_BREAKING) {\n return assertNodeType(\"VariableDeclaration\", \"LVal\");\n }\n\n const declaration = assertNodeType(\"VariableDeclaration\");\n const lval = assertNodeType(\n \"Identifier\",\n \"MemberExpression\",\n \"ArrayPattern\",\n \"ObjectPattern\",\n );\n\n return function(node, key, val) {\n if (is(\"VariableDeclaration\", val)) {\n declaration(node, key, val);\n } else {\n lval(node, key, val);\n }\n };\n })(),\n },\n right: {\n validate: assertNodeType(\"Expression\"),\n },\n body: {\n validate: assertNodeType(\"Statement\"),\n },\n await: {\n default: false,\n },\n },\n});\n\ndefineType(\"ImportDeclaration\", {\n visitor: [\"specifiers\", \"source\"],\n aliases: [\"Statement\", \"Declaration\", \"ModuleDeclaration\"],\n fields: {\n specifiers: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"ImportSpecifier\",\n \"ImportDefaultSpecifier\",\n \"ImportNamespaceSpecifier\",\n ),\n ),\n ),\n },\n source: {\n validate: assertNodeType(\"StringLiteral\"),\n },\n importKind: {\n // Handle Flowtype's extension \"import {typeof foo} from\"\n validate: assertOneOf(\"type\", \"typeof\", \"value\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ImportDefaultSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportNamespaceSpecifier\", {\n visitor: [\"local\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ImportSpecifier\", {\n visitor: [\"local\", \"imported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n local: {\n validate: assertNodeType(\"Identifier\"),\n },\n imported: {\n validate: assertNodeType(\"Identifier\"),\n },\n importKind: {\n // Handle Flowtype's extension \"import {typeof foo} from\"\n validate: assertOneOf(\"type\", \"typeof\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"MetaProperty\", {\n visitor: [\"meta\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n meta: {\n validate: chain(assertNodeType(\"Identifier\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n let property;\n switch (val.name) {\n case \"function\":\n property = \"sent\";\n break;\n case \"new\":\n property = \"target\";\n break;\n case \"import\":\n property = \"meta\";\n break;\n }\n if (!is(\"Identifier\", node.property, { name: property })) {\n throw new TypeError(\"Unrecognised MetaProperty\");\n }\n }),\n },\n property: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\nexport const classMethodOrPropertyCommon = {\n abstract: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n static: {\n default: false,\n },\n computed: {\n default: false,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n key: {\n validate: chain(\n (function() {\n const normal = assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n );\n const computed = assertNodeType(\"Expression\");\n\n return function(node: Object, key: string, val: any) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n assertNodeType(\n \"Identifier\",\n \"StringLiteral\",\n \"NumericLiteral\",\n \"Expression\",\n ),\n ),\n },\n};\n\nexport const classMethodOrDeclareMethodCommon = {\n ...functionCommon,\n ...classMethodOrPropertyCommon,\n kind: {\n validate: assertOneOf(\"get\", \"set\", \"method\", \"constructor\"),\n default: \"method\",\n },\n access: {\n validate: chain(\n assertValueType(\"string\"),\n assertOneOf(\"public\", \"private\", \"protected\"),\n ),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n};\n\ndefineType(\"ClassMethod\", {\n aliases: [\"Function\", \"Scopable\", \"BlockParent\", \"FunctionParent\", \"Method\"],\n builder: [\n \"kind\",\n \"key\",\n \"params\",\n \"body\",\n \"computed\",\n \"static\",\n \"generator\",\n \"async\",\n ],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n ...functionTypeAnnotationCommon,\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"ObjectPattern\", {\n visitor: [\n \"properties\",\n \"typeAnnotation\",\n \"decorators\" /* for legacy param decorators */,\n ],\n builder: [\"properties\"],\n aliases: [\"Pattern\", \"PatternLike\", \"LVal\"],\n fields: {\n ...patternLikeCommon,\n properties: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"RestElement\", \"ObjectProperty\")),\n ),\n },\n },\n});\n\ndefineType(\"SpreadElement\", {\n visitor: [\"argument\"],\n aliases: [\"UnaryLike\"],\n deprecatedAlias: \"SpreadProperty\",\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"Super\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"TaggedTemplateExpression\", {\n visitor: [\"tag\", \"quasi\"],\n aliases: [\"Expression\"],\n fields: {\n tag: {\n validate: assertNodeType(\"Expression\"),\n },\n quasi: {\n validate: assertNodeType(\"TemplateLiteral\"),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"TemplateElement\", {\n builder: [\"value\", \"tail\"],\n fields: {\n value: {\n validate: assertShape({\n raw: {\n validate: assertValueType(\"string\"),\n },\n cooked: {\n validate: assertValueType(\"string\"),\n optional: true,\n },\n }),\n },\n tail: {\n default: false,\n },\n },\n});\n\ndefineType(\"TemplateLiteral\", {\n visitor: [\"quasis\", \"expressions\"],\n aliases: [\"Expression\", \"Literal\"],\n fields: {\n quasis: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TemplateElement\")),\n ),\n },\n expressions: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Expression\")),\n function(node, key, val) {\n if (node.quasis.length !== val.length + 1) {\n throw new TypeError(\n `Number of ${\n node.type\n } quasis should be exactly one more than the number of expressions.\\nExpected ${val.length +\n 1} quasis but got ${node.quasis.length}`,\n );\n }\n },\n ),\n },\n },\n});\n\ndefineType(\"YieldExpression\", {\n builder: [\"argument\", \"delegate\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n delegate: {\n validate: chain(assertValueType(\"boolean\"), function(node, key, val) {\n if (!process.env.BABEL_TYPES_8_BREAKING) return;\n\n if (val && !node.argument) {\n throw new TypeError(\n \"Property delegate of YieldExpression cannot be true if there is no argument\",\n );\n }\n }),\n default: false,\n },\n argument: {\n optional: true,\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n arrayOfType,\n assertOneOf,\n assertValueType,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\n\nconst defineInterfaceishType = (\n name: string,\n typeParameterType: string = \"TypeParameterDeclaration\",\n) => {\n defineType(name, {\n builder: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n visitor: [\n \"id\",\n \"typeParameters\",\n \"extends\",\n \"mixins\",\n \"implements\",\n \"body\",\n ],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(typeParameterType),\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n mixins: validateOptional(arrayOfType(\"InterfaceExtends\")),\n implements: validateOptional(arrayOfType(\"ClassImplements\")),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n });\n};\n\ndefineType(\"AnyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ArrayTypeAnnotation\", {\n visitor: [\"elementType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n elementType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"BooleanTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"BooleanLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"NullLiteralTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ClassImplements\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareClass\");\n\ndefineType(\"DeclareFunction\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n predicate: validateOptionalType(\"DeclaredPredicate\"),\n },\n});\n\ndefineInterfaceishType(\"DeclareInterface\");\n\ndefineType(\"DeclareModule\", {\n builder: [\"id\", \"body\", \"kind\"],\n visitor: [\"id\", \"body\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType(\"BlockStatement\"),\n kind: validateOptional(assertOneOf(\"CommonJS\", \"ES\")),\n },\n});\n\ndefineType(\"DeclareModuleExports\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"DeclareTypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareOpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n },\n});\n\ndefineType(\"DeclareVariable\", {\n visitor: [\"id\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"DeclareExportDeclaration\", {\n visitor: [\"declaration\", \"specifiers\", \"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n declaration: validateOptionalType(\"Flow\"),\n specifiers: validateOptional(\n arrayOfType([\"ExportSpecifier\", \"ExportNamespaceSpecifier\"]),\n ),\n source: validateOptionalType(\"StringLiteral\"),\n default: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"DeclareExportAllDeclaration\", {\n visitor: [\"source\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n source: validateType(\"StringLiteral\"),\n exportKind: validateOptional(assertOneOf(\"type\", \"value\")),\n },\n});\n\ndefineType(\"DeclaredPredicate\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"FlowPredicate\"],\n fields: {\n value: validateType(\"Flow\"),\n },\n});\n\ndefineType(\"ExistsTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\"],\n});\n\ndefineType(\"FunctionTypeAnnotation\", {\n visitor: [\"typeParameters\", \"params\", \"rest\", \"returnType\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n params: validate(arrayOfType(\"FunctionTypeParam\")),\n rest: validateOptionalType(\"FunctionTypeParam\"),\n returnType: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"FunctionTypeParam\", {\n visitor: [\"name\", \"typeAnnotation\"],\n aliases: [\"Flow\"],\n fields: {\n name: validateOptionalType(\"Identifier\"),\n typeAnnotation: validateType(\"FlowType\"),\n optional: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"GenericTypeAnnotation\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"InferredPredicate\", {\n aliases: [\"Flow\", \"FlowPredicate\"],\n});\n\ndefineType(\"InterfaceExtends\", {\n visitor: [\"id\", \"typeParameters\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n typeParameters: validateOptionalType(\"TypeParameterInstantiation\"),\n },\n});\n\ndefineInterfaceishType(\"InterfaceDeclaration\");\n\ndefineType(\"InterfaceTypeAnnotation\", {\n visitor: [\"extends\", \"body\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n extends: validateOptional(arrayOfType(\"InterfaceExtends\")),\n body: validateType(\"ObjectTypeAnnotation\"),\n },\n});\n\ndefineType(\"IntersectionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"MixedTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"EmptyTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"NullableTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"NumberLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"number\")),\n },\n});\n\ndefineType(\"NumberTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ObjectTypeAnnotation\", {\n visitor: [\"properties\", \"indexers\", \"callProperties\", \"internalSlots\"],\n aliases: [\"Flow\", \"FlowType\"],\n builder: [\n \"properties\",\n \"indexers\",\n \"callProperties\",\n \"internalSlots\",\n \"exact\",\n ],\n fields: {\n properties: validate(\n arrayOfType([\"ObjectTypeProperty\", \"ObjectTypeSpreadProperty\"]),\n ),\n indexers: validateOptional(arrayOfType(\"ObjectTypeIndexer\")),\n callProperties: validateOptional(arrayOfType(\"ObjectTypeCallProperty\")),\n internalSlots: validateOptional(arrayOfType(\"ObjectTypeInternalSlot\")),\n exact: {\n validate: assertValueType(\"boolean\"),\n default: false,\n },\n // If the inexact flag is present then this is an object type, and not a\n // declare class, declare interface, or interface. If it is true, the\n // object uses ... to express that it is inexact.\n inexact: validateOptional(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeInternalSlot\", {\n visitor: [\"id\", \"value\", \"optional\", \"static\", \"method\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: validateType(\"Identifier\"),\n value: validateType(\"FlowType\"),\n optional: validate(assertValueType(\"boolean\")),\n static: validate(assertValueType(\"boolean\")),\n method: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeCallProperty\", {\n visitor: [\"value\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n },\n});\n\ndefineType(\"ObjectTypeIndexer\", {\n visitor: [\"id\", \"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n id: validateOptionalType(\"Identifier\"),\n key: validateType(\"FlowType\"),\n value: validateType(\"FlowType\"),\n static: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"ObjectTypeProperty\", {\n visitor: [\"key\", \"value\", \"variance\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n key: validateType([\"Identifier\", \"StringLiteral\"]),\n value: validateType(\"FlowType\"),\n kind: validate(assertOneOf(\"init\", \"get\", \"set\")),\n static: validate(assertValueType(\"boolean\")),\n proto: validate(assertValueType(\"boolean\")),\n optional: validate(assertValueType(\"boolean\")),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"ObjectTypeSpreadProperty\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"UserWhitespacable\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"OpaqueType\", {\n visitor: [\"id\", \"typeParameters\", \"supertype\", \"impltype\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n supertype: validateOptionalType(\"FlowType\"),\n impltype: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"QualifiedTypeIdentifier\", {\n visitor: [\"id\", \"qualification\"],\n aliases: [\"Flow\"],\n fields: {\n id: validateType(\"Identifier\"),\n qualification: validateType([\"Identifier\", \"QualifiedTypeIdentifier\"]),\n },\n});\n\ndefineType(\"StringLiteralTypeAnnotation\", {\n builder: [\"value\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n value: validate(assertValueType(\"string\")),\n },\n});\n\ndefineType(\"StringTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"ThisTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\ndefineType(\"TupleTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"TypeofTypeAnnotation\", {\n visitor: [\"argument\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n argument: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAlias\", {\n visitor: [\"id\", \"typeParameters\", \"right\"],\n aliases: [\"Flow\", \"FlowDeclaration\", \"Statement\", \"Declaration\"],\n fields: {\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TypeParameterDeclaration\"),\n right: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeAnnotation\", {\n aliases: [\"Flow\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"FlowType\"),\n },\n});\n\ndefineType(\"TypeCastExpression\", {\n visitor: [\"expression\", \"typeAnnotation\"],\n aliases: [\"Flow\", \"ExpressionWrapper\", \"Expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TypeAnnotation\"),\n },\n});\n\ndefineType(\"TypeParameter\", {\n aliases: [\"Flow\"],\n visitor: [\"bound\", \"default\", \"variance\"],\n fields: {\n name: validate(assertValueType(\"string\")),\n bound: validateOptionalType(\"TypeAnnotation\"),\n default: validateOptionalType(\"FlowType\"),\n variance: validateOptionalType(\"Variance\"),\n },\n});\n\ndefineType(\"TypeParameterDeclaration\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"TypeParameter\")),\n },\n});\n\ndefineType(\"TypeParameterInstantiation\", {\n aliases: [\"Flow\"],\n visitor: [\"params\"],\n fields: {\n params: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"UnionTypeAnnotation\", {\n visitor: [\"types\"],\n aliases: [\"Flow\", \"FlowType\"],\n fields: {\n types: validate(arrayOfType(\"FlowType\")),\n },\n});\n\ndefineType(\"Variance\", {\n aliases: [\"Flow\"],\n builder: [\"kind\"],\n fields: {\n kind: validate(assertOneOf(\"minus\", \"plus\")),\n },\n});\n\ndefineType(\"VoidTypeAnnotation\", {\n aliases: [\"Flow\", \"FlowType\", \"FlowBaseAnnotation\"],\n});\n\n// Enums\ndefineType(\"EnumDeclaration\", {\n aliases: [\"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n id: validateType(\"Identifier\"),\n body: validateType([\n \"EnumBooleanBody\",\n \"EnumNumberBody\",\n \"EnumStringBody\",\n \"EnumSymbolBody\",\n ]),\n },\n});\n\ndefineType(\"EnumBooleanBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumBooleanMember\"),\n },\n});\n\ndefineType(\"EnumNumberBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType(\"EnumNumberMember\"),\n },\n});\n\ndefineType(\"EnumStringBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n explicit: validate(assertValueType(\"boolean\")),\n members: validateArrayOfType([\"EnumStringMember\", \"EnumDefaultedMember\"]),\n },\n});\n\ndefineType(\"EnumSymbolBody\", {\n aliases: [\"EnumBody\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"EnumDefaultedMember\"),\n },\n});\n\ndefineType(\"EnumBooleanMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"BooleanLiteral\"),\n },\n});\n\ndefineType(\"EnumNumberMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"NumericLiteral\"),\n },\n});\n\ndefineType(\"EnumStringMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\", \"init\"],\n fields: {\n id: validateType(\"Identifier\"),\n init: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"EnumDefaultedMember\", {\n aliases: [\"EnumMember\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n","// @flow\nimport defineType, {\n assertNodeType,\n assertValueType,\n chain,\n assertEach,\n} from \"./utils\";\n\ndefineType(\"JSXAttribute\", {\n visitor: [\"name\", \"value\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\"JSXIdentifier\", \"JSXNamespacedName\"),\n },\n value: {\n optional: true,\n validate: assertNodeType(\n \"JSXElement\",\n \"JSXFragment\",\n \"StringLiteral\",\n \"JSXExpressionContainer\",\n ),\n },\n },\n});\n\ndefineType(\"JSXClosingElement\", {\n visitor: [\"name\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n },\n});\n\ndefineType(\"JSXElement\", {\n builder: [\"openingElement\", \"closingElement\", \"children\", \"selfClosing\"],\n visitor: [\"openingElement\", \"children\", \"closingElement\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingElement: {\n validate: assertNodeType(\"JSXOpeningElement\"),\n },\n closingElement: {\n optional: true,\n validate: assertNodeType(\"JSXClosingElement\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"JSXEmptyExpression\", {\n aliases: [\"JSX\"],\n});\n\ndefineType(\"JSXExpressionContainer\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\", \"JSXEmptyExpression\"),\n },\n },\n});\n\ndefineType(\"JSXSpreadChild\", {\n visitor: [\"expression\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXIdentifier\", {\n builder: [\"name\"],\n aliases: [\"JSX\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXMemberExpression\", {\n visitor: [\"object\", \"property\"],\n aliases: [\"JSX\"],\n fields: {\n object: {\n validate: assertNodeType(\"JSXMemberExpression\", \"JSXIdentifier\"),\n },\n property: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXNamespacedName\", {\n visitor: [\"namespace\", \"name\"],\n aliases: [\"JSX\"],\n fields: {\n namespace: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n name: {\n validate: assertNodeType(\"JSXIdentifier\"),\n },\n },\n});\n\ndefineType(\"JSXOpeningElement\", {\n builder: [\"name\", \"attributes\", \"selfClosing\"],\n visitor: [\"name\", \"attributes\"],\n aliases: [\"JSX\", \"Immutable\"],\n fields: {\n name: {\n validate: assertNodeType(\n \"JSXIdentifier\",\n \"JSXMemberExpression\",\n \"JSXNamespacedName\",\n ),\n },\n selfClosing: {\n default: false,\n },\n attributes: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"JSXAttribute\", \"JSXSpreadAttribute\")),\n ),\n },\n typeParameters: {\n validate: assertNodeType(\n \"TypeParameterInstantiation\",\n \"TSTypeParameterInstantiation\",\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"JSXSpreadAttribute\", {\n visitor: [\"argument\"],\n aliases: [\"JSX\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"JSXText\", {\n aliases: [\"JSX\", \"Immutable\"],\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n\ndefineType(\"JSXFragment\", {\n builder: [\"openingFragment\", \"closingFragment\", \"children\"],\n visitor: [\"openingFragment\", \"children\", \"closingFragment\"],\n aliases: [\"JSX\", \"Immutable\", \"Expression\"],\n fields: {\n openingFragment: {\n validate: assertNodeType(\"JSXOpeningFragment\"),\n },\n closingFragment: {\n validate: assertNodeType(\"JSXClosingFragment\"),\n },\n children: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\n \"JSXText\",\n \"JSXExpressionContainer\",\n \"JSXSpreadChild\",\n \"JSXElement\",\n \"JSXFragment\",\n ),\n ),\n ),\n },\n },\n});\n\ndefineType(\"JSXOpeningFragment\", {\n aliases: [\"JSX\", \"Immutable\"],\n});\n\ndefineType(\"JSXClosingFragment\", {\n aliases: [\"JSX\", \"Immutable\"],\n});\n","import { ALIAS_KEYS } from \"./utils\";\n\nexport const PLACEHOLDERS = [\n \"Identifier\",\n \"StringLiteral\",\n \"Expression\",\n \"Statement\",\n \"Declaration\",\n \"BlockStatement\",\n \"ClassBody\",\n \"Pattern\",\n];\n\nexport const PLACEHOLDERS_ALIAS: { [string]: Array } = {\n Declaration: [\"Statement\"],\n Pattern: [\"PatternLike\", \"LVal\"],\n};\n\nfor (const type of PLACEHOLDERS) {\n const alias = ALIAS_KEYS[type];\n if (alias && alias.length) PLACEHOLDERS_ALIAS[type] = alias;\n}\n\nexport const PLACEHOLDERS_FLIPPED_ALIAS: { [string]: Array } = {};\n\nObject.keys(PLACEHOLDERS_ALIAS).forEach(type => {\n PLACEHOLDERS_ALIAS[type].forEach(alias => {\n if (!Object.hasOwnProperty.call(PLACEHOLDERS_FLIPPED_ALIAS, alias)) {\n PLACEHOLDERS_FLIPPED_ALIAS[alias] = [];\n }\n PLACEHOLDERS_FLIPPED_ALIAS[alias].push(type);\n });\n});\n","// @flow\nimport defineType, {\n assertNodeType,\n assertOneOf,\n assertValueType,\n} from \"./utils\";\nimport { PLACEHOLDERS } from \"./placeholders\";\n\ndefineType(\"Noop\", {\n visitor: [],\n});\n\ndefineType(\"Placeholder\", {\n visitor: [],\n builder: [\"expectedNode\", \"name\"],\n // aliases: [], defined in placeholders.js\n fields: {\n name: {\n validate: assertNodeType(\"Identifier\"),\n },\n expectedNode: {\n validate: assertOneOf(...PLACEHOLDERS),\n },\n },\n});\n\ndefineType(\"V8IntrinsicIdentifier\", {\n builder: [\"name\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n },\n});\n","// @flow\nimport defineType, {\n assertEach,\n assertNodeType,\n assertValueType,\n chain,\n} from \"./utils\";\nimport {\n classMethodOrPropertyCommon,\n classMethodOrDeclareMethodCommon,\n} from \"./es2015\";\n\ndefineType(\"ArgumentPlaceholder\", {});\n\ndefineType(\"AwaitExpression\", {\n builder: [\"argument\"],\n visitor: [\"argument\"],\n aliases: [\"Expression\", \"Terminatorless\"],\n fields: {\n argument: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"BindExpression\", {\n visitor: [\"object\", \"callee\"],\n aliases: [\"Expression\"],\n fields: !process.env.BABEL_TYPES_8_BREAKING\n ? {}\n : {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"ClassProperty\", {\n visitor: [\"key\", \"value\", \"typeAnnotation\", \"decorators\"],\n builder: [\n \"key\",\n \"value\",\n \"typeAnnotation\",\n \"decorators\",\n \"computed\",\n \"static\",\n ],\n aliases: [\"Property\"],\n fields: {\n ...classMethodOrPropertyCommon,\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n definite: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n typeAnnotation: {\n validate: assertNodeType(\"TypeAnnotation\", \"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n declare: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"OptionalMemberExpression\", {\n builder: [\"object\", \"property\", \"computed\", \"optional\"],\n visitor: [\"object\", \"property\"],\n aliases: [\"Expression\"],\n fields: {\n object: {\n validate: assertNodeType(\"Expression\"),\n },\n property: {\n validate: (function() {\n const normal = assertNodeType(\"Identifier\");\n const computed = assertNodeType(\"Expression\");\n\n return function(node, key, val) {\n const validator = node.computed ? computed : normal;\n validator(node, key, val);\n };\n })(),\n },\n computed: {\n default: false,\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n },\n },\n});\n\ndefineType(\"PipelineTopicExpression\", {\n builder: [\"expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"PipelineBareFunction\", {\n builder: [\"callee\"],\n visitor: [\"callee\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"PipelinePrimaryTopicReference\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"OptionalCallExpression\", {\n visitor: [\"callee\", \"arguments\", \"typeParameters\", \"typeArguments\"],\n builder: [\"callee\", \"arguments\", \"optional\"],\n aliases: [\"Expression\"],\n fields: {\n callee: {\n validate: assertNodeType(\"Expression\"),\n },\n arguments: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(\n assertNodeType(\"Expression\", \"SpreadElement\", \"JSXNamespacedName\"),\n ),\n ),\n },\n optional: {\n validate: assertValueType(\"boolean\"),\n },\n typeArguments: {\n validate: assertNodeType(\"TypeParameterInstantiation\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterInstantiation\"),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateProperty\", {\n visitor: [\"key\", \"value\", \"decorators\"],\n builder: [\"key\", \"value\", \"decorators\"],\n aliases: [\"Property\", \"Private\"],\n fields: {\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n value: {\n validate: assertNodeType(\"Expression\"),\n optional: true,\n },\n decorators: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"Decorator\")),\n ),\n optional: true,\n },\n },\n});\n\ndefineType(\"ClassPrivateMethod\", {\n builder: [\"kind\", \"key\", \"params\", \"body\", \"static\"],\n visitor: [\n \"key\",\n \"params\",\n \"body\",\n \"decorators\",\n \"returnType\",\n \"typeParameters\",\n ],\n aliases: [\n \"Function\",\n \"Scopable\",\n \"BlockParent\",\n \"FunctionParent\",\n \"Method\",\n \"Private\",\n ],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n key: {\n validate: assertNodeType(\"PrivateName\"),\n },\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"Import\", {\n aliases: [\"Expression\"],\n});\n\ndefineType(\"Decorator\", {\n visitor: [\"expression\"],\n fields: {\n expression: {\n validate: assertNodeType(\"Expression\"),\n },\n },\n});\n\ndefineType(\"DoExpression\", {\n visitor: [\"body\"],\n aliases: [\"Expression\"],\n fields: {\n body: {\n validate: assertNodeType(\"BlockStatement\"),\n },\n },\n});\n\ndefineType(\"ExportDefaultSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"ExportNamespaceSpecifier\", {\n visitor: [\"exported\"],\n aliases: [\"ModuleSpecifier\"],\n fields: {\n exported: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"PrivateName\", {\n visitor: [\"id\"],\n aliases: [\"Private\"],\n fields: {\n id: {\n validate: assertNodeType(\"Identifier\"),\n },\n },\n});\n\ndefineType(\"BigIntLiteral\", {\n builder: [\"value\"],\n fields: {\n value: {\n validate: assertValueType(\"string\"),\n },\n },\n aliases: [\"Expression\", \"Pureish\", \"Literal\", \"Immutable\"],\n});\n","// @flow\nimport defineType, {\n arrayOfType,\n assertEach,\n assertNodeType,\n assertOneOf,\n assertValueType,\n chain,\n validate,\n validateArrayOfType,\n validateOptional,\n validateOptionalType,\n validateType,\n} from \"./utils\";\nimport { functionDeclarationCommon } from \"./core\";\nimport { classMethodOrDeclareMethodCommon } from \"./es2015\";\n\nconst bool = assertValueType(\"boolean\");\n\nconst tSFunctionTypeAnnotationCommon = {\n returnType: {\n validate: assertNodeType(\"TSTypeAnnotation\", \"Noop\"),\n optional: true,\n },\n typeParameters: {\n validate: assertNodeType(\"TSTypeParameterDeclaration\", \"Noop\"),\n optional: true,\n },\n};\n\ndefineType(\"TSParameterProperty\", {\n aliases: [\"LVal\"], // TODO: This isn't usable in general as an LVal. Should have a \"Parameter\" alias.\n visitor: [\"parameter\"],\n fields: {\n accessibility: {\n validate: assertOneOf(\"public\", \"private\", \"protected\"),\n optional: true,\n },\n readonly: {\n validate: assertValueType(\"boolean\"),\n optional: true,\n },\n parameter: {\n validate: assertNodeType(\"Identifier\", \"AssignmentPattern\"),\n },\n },\n});\n\ndefineType(\"TSDeclareFunction\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...functionDeclarationCommon,\n ...tSFunctionTypeAnnotationCommon,\n },\n});\n\ndefineType(\"TSDeclareMethod\", {\n visitor: [\"decorators\", \"key\", \"typeParameters\", \"params\", \"returnType\"],\n fields: {\n ...classMethodOrDeclareMethodCommon,\n ...tSFunctionTypeAnnotationCommon,\n },\n});\n\ndefineType(\"TSQualifiedName\", {\n aliases: [\"TSEntityName\"],\n visitor: [\"left\", \"right\"],\n fields: {\n left: validateType(\"TSEntityName\"),\n right: validateType(\"Identifier\"),\n },\n});\n\nconst signatureDeclarationCommon = {\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n parameters: validateArrayOfType([\"Identifier\", \"RestElement\"]),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n};\n\nconst callConstructSignatureDeclaration = {\n aliases: [\"TSTypeElement\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon,\n};\n\ndefineType(\"TSCallSignatureDeclaration\", callConstructSignatureDeclaration);\ndefineType(\n \"TSConstructSignatureDeclaration\",\n callConstructSignatureDeclaration,\n);\n\nconst namedTypeElementCommon = {\n key: validateType(\"Expression\"),\n computed: validate(bool),\n optional: validateOptional(bool),\n};\n\ndefineType(\"TSPropertySignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeAnnotation\", \"initializer\"],\n fields: {\n ...namedTypeElementCommon,\n readonly: validateOptional(bool),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSMethodSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"key\", \"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: {\n ...signatureDeclarationCommon,\n ...namedTypeElementCommon,\n },\n});\n\ndefineType(\"TSIndexSignature\", {\n aliases: [\"TSTypeElement\"],\n visitor: [\"parameters\", \"typeAnnotation\"],\n fields: {\n readonly: validateOptional(bool),\n parameters: validateArrayOfType(\"Identifier\"), // Length must be 1\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n },\n});\n\nconst tsKeywordTypes = [\n \"TSAnyKeyword\",\n \"TSBooleanKeyword\",\n \"TSBigIntKeyword\",\n \"TSNeverKeyword\",\n \"TSNullKeyword\",\n \"TSNumberKeyword\",\n \"TSObjectKeyword\",\n \"TSStringKeyword\",\n \"TSSymbolKeyword\",\n \"TSUndefinedKeyword\",\n \"TSUnknownKeyword\",\n \"TSVoidKeyword\",\n];\n\nfor (const type of tsKeywordTypes) {\n defineType(type, {\n aliases: [\"TSType\"],\n visitor: [],\n fields: {},\n });\n}\n\ndefineType(\"TSThisType\", {\n aliases: [\"TSType\"],\n visitor: [],\n fields: {},\n});\n\nconst fnOrCtr = {\n aliases: [\"TSType\"],\n visitor: [\"typeParameters\", \"parameters\", \"typeAnnotation\"],\n fields: signatureDeclarationCommon,\n};\n\ndefineType(\"TSFunctionType\", fnOrCtr);\ndefineType(\"TSConstructorType\", fnOrCtr);\n\ndefineType(\"TSTypeReference\", {\n aliases: [\"TSType\"],\n visitor: [\"typeName\", \"typeParameters\"],\n fields: {\n typeName: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSTypePredicate\", {\n aliases: [\"TSType\"],\n visitor: [\"parameterName\", \"typeAnnotation\"],\n builder: [\"parameterName\", \"typeAnnotation\", \"asserts\"],\n fields: {\n parameterName: validateType([\"Identifier\", \"TSThisType\"]),\n typeAnnotation: validateOptionalType(\"TSTypeAnnotation\"),\n asserts: validateOptional(bool),\n },\n});\n\ndefineType(\"TSTypeQuery\", {\n aliases: [\"TSType\"],\n visitor: [\"exprName\"],\n fields: {\n exprName: validateType([\"TSEntityName\", \"TSImportType\"]),\n },\n});\n\ndefineType(\"TSTypeLiteral\", {\n aliases: [\"TSType\"],\n visitor: [\"members\"],\n fields: {\n members: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSArrayType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementType\"],\n fields: {\n elementType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTupleType\", {\n aliases: [\"TSType\"],\n visitor: [\"elementTypes\"],\n fields: {\n elementTypes: validateArrayOfType(\"TSType\"),\n },\n});\n\ndefineType(\"TSOptionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSRestType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\nconst unionOrIntersection = {\n aliases: [\"TSType\"],\n visitor: [\"types\"],\n fields: {\n types: validateArrayOfType(\"TSType\"),\n },\n};\n\ndefineType(\"TSUnionType\", unionOrIntersection);\ndefineType(\"TSIntersectionType\", unionOrIntersection);\n\ndefineType(\"TSConditionalType\", {\n aliases: [\"TSType\"],\n visitor: [\"checkType\", \"extendsType\", \"trueType\", \"falseType\"],\n fields: {\n checkType: validateType(\"TSType\"),\n extendsType: validateType(\"TSType\"),\n trueType: validateType(\"TSType\"),\n falseType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSInferType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\"],\n fields: {\n typeParameter: validateType(\"TSTypeParameter\"),\n },\n});\n\ndefineType(\"TSParenthesizedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTypeOperator\", {\n aliases: [\"TSType\"],\n visitor: [\"typeAnnotation\"],\n fields: {\n operator: validate(assertValueType(\"string\")),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSIndexedAccessType\", {\n aliases: [\"TSType\"],\n visitor: [\"objectType\", \"indexType\"],\n fields: {\n objectType: validateType(\"TSType\"),\n indexType: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSMappedType\", {\n aliases: [\"TSType\"],\n visitor: [\"typeParameter\", \"typeAnnotation\"],\n fields: {\n readonly: validateOptional(bool),\n typeParameter: validateType(\"TSTypeParameter\"),\n optional: validateOptional(bool),\n typeAnnotation: validateOptionalType(\"TSType\"),\n },\n});\n\ndefineType(\"TSLiteralType\", {\n aliases: [\"TSType\"],\n visitor: [\"literal\"],\n fields: {\n literal: validateType([\n \"NumericLiteral\",\n \"StringLiteral\",\n \"BooleanLiteral\",\n ]),\n },\n});\n\ndefineType(\"TSExpressionWithTypeArguments\", {\n aliases: [\"TSType\"],\n visitor: [\"expression\", \"typeParameters\"],\n fields: {\n expression: validateType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSInterfaceDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"extends\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n extends: validateOptional(arrayOfType(\"TSExpressionWithTypeArguments\")),\n body: validateType(\"TSInterfaceBody\"),\n },\n});\n\ndefineType(\"TSInterfaceBody\", {\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"TSTypeElement\"),\n },\n});\n\ndefineType(\"TSTypeAliasDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"typeParameters\", \"typeAnnotation\"],\n fields: {\n declare: validateOptional(bool),\n id: validateType(\"Identifier\"),\n typeParameters: validateOptionalType(\"TSTypeParameterDeclaration\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSAsExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\", \"typeAnnotation\"],\n fields: {\n expression: validateType(\"Expression\"),\n typeAnnotation: validateType(\"TSType\"),\n },\n});\n\ndefineType(\"TSTypeAssertion\", {\n aliases: [\"Expression\"],\n visitor: [\"typeAnnotation\", \"expression\"],\n fields: {\n typeAnnotation: validateType(\"TSType\"),\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumDeclaration\", {\n // \"Statement\" alias prevents a semicolon from appearing after it in an export declaration.\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"members\"],\n fields: {\n declare: validateOptional(bool),\n const: validateOptional(bool),\n id: validateType(\"Identifier\"),\n members: validateArrayOfType(\"TSEnumMember\"),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSEnumMember\", {\n visitor: [\"id\", \"initializer\"],\n fields: {\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n initializer: validateOptionalType(\"Expression\"),\n },\n});\n\ndefineType(\"TSModuleDeclaration\", {\n aliases: [\"Statement\", \"Declaration\"],\n visitor: [\"id\", \"body\"],\n fields: {\n declare: validateOptional(bool),\n global: validateOptional(bool),\n id: validateType([\"Identifier\", \"StringLiteral\"]),\n body: validateType([\"TSModuleBlock\", \"TSModuleDeclaration\"]),\n },\n});\n\ndefineType(\"TSModuleBlock\", {\n aliases: [\"Scopable\", \"Block\", \"BlockParent\"],\n visitor: [\"body\"],\n fields: {\n body: validateArrayOfType(\"Statement\"),\n },\n});\n\ndefineType(\"TSImportType\", {\n aliases: [\"TSType\"],\n visitor: [\"argument\", \"qualifier\", \"typeParameters\"],\n fields: {\n argument: validateType(\"StringLiteral\"),\n qualifier: validateOptionalType(\"TSEntityName\"),\n typeParameters: validateOptionalType(\"TSTypeParameterInstantiation\"),\n },\n});\n\ndefineType(\"TSImportEqualsDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\", \"moduleReference\"],\n fields: {\n isExport: validate(bool),\n id: validateType(\"Identifier\"),\n moduleReference: validateType([\n \"TSEntityName\",\n \"TSExternalModuleReference\",\n ]),\n },\n});\n\ndefineType(\"TSExternalModuleReference\", {\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"StringLiteral\"),\n },\n});\n\ndefineType(\"TSNonNullExpression\", {\n aliases: [\"Expression\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSExportAssignment\", {\n aliases: [\"Statement\"],\n visitor: [\"expression\"],\n fields: {\n expression: validateType(\"Expression\"),\n },\n});\n\ndefineType(\"TSNamespaceExportDeclaration\", {\n aliases: [\"Statement\"],\n visitor: [\"id\"],\n fields: {\n id: validateType(\"Identifier\"),\n },\n});\n\ndefineType(\"TSTypeAnnotation\", {\n visitor: [\"typeAnnotation\"],\n fields: {\n typeAnnotation: {\n validate: assertNodeType(\"TSType\"),\n },\n },\n});\n\ndefineType(\"TSTypeParameterInstantiation\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSType\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameterDeclaration\", {\n visitor: [\"params\"],\n fields: {\n params: {\n validate: chain(\n assertValueType(\"array\"),\n assertEach(assertNodeType(\"TSTypeParameter\")),\n ),\n },\n },\n});\n\ndefineType(\"TSTypeParameter\", {\n builder: [\"constraint\", \"default\", \"name\"],\n visitor: [\"constraint\", \"default\"],\n fields: {\n name: {\n validate: assertValueType(\"string\"),\n },\n constraint: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n default: {\n validate: assertNodeType(\"TSType\"),\n optional: true,\n },\n },\n});\n","// @flow\nimport toFastProperties from \"to-fast-properties\";\nimport \"./core\";\nimport \"./es2015\";\nimport \"./flow\";\nimport \"./jsx\";\nimport \"./misc\";\nimport \"./experimental\";\nimport \"./typescript\";\nimport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n} from \"./utils\";\nimport {\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n} from \"./placeholders\";\n\n// We do this here, because at this point the visitor keys should be ready and setup\ntoFastProperties(VISITOR_KEYS);\ntoFastProperties(ALIAS_KEYS);\ntoFastProperties(FLIPPED_ALIAS_KEYS);\ntoFastProperties(NODE_FIELDS);\ntoFastProperties(BUILDER_KEYS);\ntoFastProperties(DEPRECATED_KEYS);\n\ntoFastProperties(PLACEHOLDERS_ALIAS);\ntoFastProperties(PLACEHOLDERS_FLIPPED_ALIAS);\n\nconst TYPES: Array = Object.keys(VISITOR_KEYS)\n .concat(Object.keys(FLIPPED_ALIAS_KEYS))\n .concat(Object.keys(DEPRECATED_KEYS));\n\nexport {\n VISITOR_KEYS,\n ALIAS_KEYS,\n FLIPPED_ALIAS_KEYS,\n NODE_FIELDS,\n BUILDER_KEYS,\n DEPRECATED_KEYS,\n NODE_PARENT_VALIDATIONS,\n PLACEHOLDERS,\n PLACEHOLDERS_ALIAS,\n PLACEHOLDERS_FLIPPED_ALIAS,\n TYPES,\n};\n","// @flow\nimport loClone from \"lodash/clone\";\nimport { NODE_FIELDS, BUILDER_KEYS } from \"../definitions\";\nimport validate from \"../validators/validate\";\n\nexport default function builder(type: string, ...args: Array): Object {\n const keys = BUILDER_KEYS[type];\n const countArgs = args.length;\n if (countArgs > keys.length) {\n throw new Error(\n `${type}: Too many arguments passed. Received ${countArgs} but can receive no more than ${keys.length}`,\n );\n }\n\n const node = { type };\n\n let i = 0;\n keys.forEach(key => {\n const field = NODE_FIELDS[type][key];\n\n let arg;\n if (i < countArgs) arg = args[i];\n if (arg === undefined) arg = loClone(field.default);\n\n node[key] = arg;\n i++;\n });\n\n for (const key of Object.keys(node)) {\n validate(node, key, node[key]);\n }\n\n return node;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport builder from \"../builder\";\n\nexport function ArrayExpression(...args: Array): Object {\n return builder(\"ArrayExpression\", ...args);\n}\nexport { ArrayExpression as arrayExpression };\nexport function AssignmentExpression(...args: Array): Object {\n return builder(\"AssignmentExpression\", ...args);\n}\nexport { AssignmentExpression as assignmentExpression };\nexport function BinaryExpression(...args: Array): Object {\n return builder(\"BinaryExpression\", ...args);\n}\nexport { BinaryExpression as binaryExpression };\nexport function InterpreterDirective(...args: Array): Object {\n return builder(\"InterpreterDirective\", ...args);\n}\nexport { InterpreterDirective as interpreterDirective };\nexport function Directive(...args: Array): Object {\n return builder(\"Directive\", ...args);\n}\nexport { Directive as directive };\nexport function DirectiveLiteral(...args: Array): Object {\n return builder(\"DirectiveLiteral\", ...args);\n}\nexport { DirectiveLiteral as directiveLiteral };\nexport function BlockStatement(...args: Array): Object {\n return builder(\"BlockStatement\", ...args);\n}\nexport { BlockStatement as blockStatement };\nexport function BreakStatement(...args: Array): Object {\n return builder(\"BreakStatement\", ...args);\n}\nexport { BreakStatement as breakStatement };\nexport function CallExpression(...args: Array): Object {\n return builder(\"CallExpression\", ...args);\n}\nexport { CallExpression as callExpression };\nexport function CatchClause(...args: Array): Object {\n return builder(\"CatchClause\", ...args);\n}\nexport { CatchClause as catchClause };\nexport function ConditionalExpression(...args: Array): Object {\n return builder(\"ConditionalExpression\", ...args);\n}\nexport { ConditionalExpression as conditionalExpression };\nexport function ContinueStatement(...args: Array): Object {\n return builder(\"ContinueStatement\", ...args);\n}\nexport { ContinueStatement as continueStatement };\nexport function DebuggerStatement(...args: Array): Object {\n return builder(\"DebuggerStatement\", ...args);\n}\nexport { DebuggerStatement as debuggerStatement };\nexport function DoWhileStatement(...args: Array): Object {\n return builder(\"DoWhileStatement\", ...args);\n}\nexport { DoWhileStatement as doWhileStatement };\nexport function EmptyStatement(...args: Array): Object {\n return builder(\"EmptyStatement\", ...args);\n}\nexport { EmptyStatement as emptyStatement };\nexport function ExpressionStatement(...args: Array): Object {\n return builder(\"ExpressionStatement\", ...args);\n}\nexport { ExpressionStatement as expressionStatement };\nexport function File(...args: Array): Object {\n return builder(\"File\", ...args);\n}\nexport { File as file };\nexport function ForInStatement(...args: Array): Object {\n return builder(\"ForInStatement\", ...args);\n}\nexport { ForInStatement as forInStatement };\nexport function ForStatement(...args: Array): Object {\n return builder(\"ForStatement\", ...args);\n}\nexport { ForStatement as forStatement };\nexport function FunctionDeclaration(...args: Array): Object {\n return builder(\"FunctionDeclaration\", ...args);\n}\nexport { FunctionDeclaration as functionDeclaration };\nexport function FunctionExpression(...args: Array): Object {\n return builder(\"FunctionExpression\", ...args);\n}\nexport { FunctionExpression as functionExpression };\nexport function Identifier(...args: Array): Object {\n return builder(\"Identifier\", ...args);\n}\nexport { Identifier as identifier };\nexport function IfStatement(...args: Array): Object {\n return builder(\"IfStatement\", ...args);\n}\nexport { IfStatement as ifStatement };\nexport function LabeledStatement(...args: Array): Object {\n return builder(\"LabeledStatement\", ...args);\n}\nexport { LabeledStatement as labeledStatement };\nexport function StringLiteral(...args: Array): Object {\n return builder(\"StringLiteral\", ...args);\n}\nexport { StringLiteral as stringLiteral };\nexport function NumericLiteral(...args: Array): Object {\n return builder(\"NumericLiteral\", ...args);\n}\nexport { NumericLiteral as numericLiteral };\nexport function NullLiteral(...args: Array): Object {\n return builder(\"NullLiteral\", ...args);\n}\nexport { NullLiteral as nullLiteral };\nexport function BooleanLiteral(...args: Array): Object {\n return builder(\"BooleanLiteral\", ...args);\n}\nexport { BooleanLiteral as booleanLiteral };\nexport function RegExpLiteral(...args: Array): Object {\n return builder(\"RegExpLiteral\", ...args);\n}\nexport { RegExpLiteral as regExpLiteral };\nexport function LogicalExpression(...args: Array): Object {\n return builder(\"LogicalExpression\", ...args);\n}\nexport { LogicalExpression as logicalExpression };\nexport function MemberExpression(...args: Array): Object {\n return builder(\"MemberExpression\", ...args);\n}\nexport { MemberExpression as memberExpression };\nexport function NewExpression(...args: Array): Object {\n return builder(\"NewExpression\", ...args);\n}\nexport { NewExpression as newExpression };\nexport function Program(...args: Array): Object {\n return builder(\"Program\", ...args);\n}\nexport { Program as program };\nexport function ObjectExpression(...args: Array): Object {\n return builder(\"ObjectExpression\", ...args);\n}\nexport { ObjectExpression as objectExpression };\nexport function ObjectMethod(...args: Array): Object {\n return builder(\"ObjectMethod\", ...args);\n}\nexport { ObjectMethod as objectMethod };\nexport function ObjectProperty(...args: Array): Object {\n return builder(\"ObjectProperty\", ...args);\n}\nexport { ObjectProperty as objectProperty };\nexport function RestElement(...args: Array): Object {\n return builder(\"RestElement\", ...args);\n}\nexport { RestElement as restElement };\nexport function ReturnStatement(...args: Array): Object {\n return builder(\"ReturnStatement\", ...args);\n}\nexport { ReturnStatement as returnStatement };\nexport function SequenceExpression(...args: Array): Object {\n return builder(\"SequenceExpression\", ...args);\n}\nexport { SequenceExpression as sequenceExpression };\nexport function ParenthesizedExpression(...args: Array): Object {\n return builder(\"ParenthesizedExpression\", ...args);\n}\nexport { ParenthesizedExpression as parenthesizedExpression };\nexport function SwitchCase(...args: Array): Object {\n return builder(\"SwitchCase\", ...args);\n}\nexport { SwitchCase as switchCase };\nexport function SwitchStatement(...args: Array): Object {\n return builder(\"SwitchStatement\", ...args);\n}\nexport { SwitchStatement as switchStatement };\nexport function ThisExpression(...args: Array): Object {\n return builder(\"ThisExpression\", ...args);\n}\nexport { ThisExpression as thisExpression };\nexport function ThrowStatement(...args: Array): Object {\n return builder(\"ThrowStatement\", ...args);\n}\nexport { ThrowStatement as throwStatement };\nexport function TryStatement(...args: Array): Object {\n return builder(\"TryStatement\", ...args);\n}\nexport { TryStatement as tryStatement };\nexport function UnaryExpression(...args: Array): Object {\n return builder(\"UnaryExpression\", ...args);\n}\nexport { UnaryExpression as unaryExpression };\nexport function UpdateExpression(...args: Array): Object {\n return builder(\"UpdateExpression\", ...args);\n}\nexport { UpdateExpression as updateExpression };\nexport function VariableDeclaration(...args: Array): Object {\n return builder(\"VariableDeclaration\", ...args);\n}\nexport { VariableDeclaration as variableDeclaration };\nexport function VariableDeclarator(...args: Array): Object {\n return builder(\"VariableDeclarator\", ...args);\n}\nexport { VariableDeclarator as variableDeclarator };\nexport function WhileStatement(...args: Array): Object {\n return builder(\"WhileStatement\", ...args);\n}\nexport { WhileStatement as whileStatement };\nexport function WithStatement(...args: Array): Object {\n return builder(\"WithStatement\", ...args);\n}\nexport { WithStatement as withStatement };\nexport function AssignmentPattern(...args: Array): Object {\n return builder(\"AssignmentPattern\", ...args);\n}\nexport { AssignmentPattern as assignmentPattern };\nexport function ArrayPattern(...args: Array): Object {\n return builder(\"ArrayPattern\", ...args);\n}\nexport { ArrayPattern as arrayPattern };\nexport function ArrowFunctionExpression(...args: Array): Object {\n return builder(\"ArrowFunctionExpression\", ...args);\n}\nexport { ArrowFunctionExpression as arrowFunctionExpression };\nexport function ClassBody(...args: Array): Object {\n return builder(\"ClassBody\", ...args);\n}\nexport { ClassBody as classBody };\nexport function ClassExpression(...args: Array): Object {\n return builder(\"ClassExpression\", ...args);\n}\nexport { ClassExpression as classExpression };\nexport function ClassDeclaration(...args: Array): Object {\n return builder(\"ClassDeclaration\", ...args);\n}\nexport { ClassDeclaration as classDeclaration };\nexport function ExportAllDeclaration(...args: Array): Object {\n return builder(\"ExportAllDeclaration\", ...args);\n}\nexport { ExportAllDeclaration as exportAllDeclaration };\nexport function ExportDefaultDeclaration(...args: Array): Object {\n return builder(\"ExportDefaultDeclaration\", ...args);\n}\nexport { ExportDefaultDeclaration as exportDefaultDeclaration };\nexport function ExportNamedDeclaration(...args: Array): Object {\n return builder(\"ExportNamedDeclaration\", ...args);\n}\nexport { ExportNamedDeclaration as exportNamedDeclaration };\nexport function ExportSpecifier(...args: Array): Object {\n return builder(\"ExportSpecifier\", ...args);\n}\nexport { ExportSpecifier as exportSpecifier };\nexport function ForOfStatement(...args: Array): Object {\n return builder(\"ForOfStatement\", ...args);\n}\nexport { ForOfStatement as forOfStatement };\nexport function ImportDeclaration(...args: Array): Object {\n return builder(\"ImportDeclaration\", ...args);\n}\nexport { ImportDeclaration as importDeclaration };\nexport function ImportDefaultSpecifier(...args: Array): Object {\n return builder(\"ImportDefaultSpecifier\", ...args);\n}\nexport { ImportDefaultSpecifier as importDefaultSpecifier };\nexport function ImportNamespaceSpecifier(...args: Array): Object {\n return builder(\"ImportNamespaceSpecifier\", ...args);\n}\nexport { ImportNamespaceSpecifier as importNamespaceSpecifier };\nexport function ImportSpecifier(...args: Array): Object {\n return builder(\"ImportSpecifier\", ...args);\n}\nexport { ImportSpecifier as importSpecifier };\nexport function MetaProperty(...args: Array): Object {\n return builder(\"MetaProperty\", ...args);\n}\nexport { MetaProperty as metaProperty };\nexport function ClassMethod(...args: Array): Object {\n return builder(\"ClassMethod\", ...args);\n}\nexport { ClassMethod as classMethod };\nexport function ObjectPattern(...args: Array): Object {\n return builder(\"ObjectPattern\", ...args);\n}\nexport { ObjectPattern as objectPattern };\nexport function SpreadElement(...args: Array): Object {\n return builder(\"SpreadElement\", ...args);\n}\nexport { SpreadElement as spreadElement };\nexport function Super(...args: Array): Object {\n return builder(\"Super\", ...args);\n}\nexport { Super as super };\nexport function TaggedTemplateExpression(...args: Array): Object {\n return builder(\"TaggedTemplateExpression\", ...args);\n}\nexport { TaggedTemplateExpression as taggedTemplateExpression };\nexport function TemplateElement(...args: Array): Object {\n return builder(\"TemplateElement\", ...args);\n}\nexport { TemplateElement as templateElement };\nexport function TemplateLiteral(...args: Array): Object {\n return builder(\"TemplateLiteral\", ...args);\n}\nexport { TemplateLiteral as templateLiteral };\nexport function YieldExpression(...args: Array): Object {\n return builder(\"YieldExpression\", ...args);\n}\nexport { YieldExpression as yieldExpression };\nexport function AnyTypeAnnotation(...args: Array): Object {\n return builder(\"AnyTypeAnnotation\", ...args);\n}\nexport { AnyTypeAnnotation as anyTypeAnnotation };\nexport function ArrayTypeAnnotation(...args: Array): Object {\n return builder(\"ArrayTypeAnnotation\", ...args);\n}\nexport { ArrayTypeAnnotation as arrayTypeAnnotation };\nexport function BooleanTypeAnnotation(...args: Array): Object {\n return builder(\"BooleanTypeAnnotation\", ...args);\n}\nexport { BooleanTypeAnnotation as booleanTypeAnnotation };\nexport function BooleanLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"BooleanLiteralTypeAnnotation\", ...args);\n}\nexport { BooleanLiteralTypeAnnotation as booleanLiteralTypeAnnotation };\nexport function NullLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"NullLiteralTypeAnnotation\", ...args);\n}\nexport { NullLiteralTypeAnnotation as nullLiteralTypeAnnotation };\nexport function ClassImplements(...args: Array): Object {\n return builder(\"ClassImplements\", ...args);\n}\nexport { ClassImplements as classImplements };\nexport function DeclareClass(...args: Array): Object {\n return builder(\"DeclareClass\", ...args);\n}\nexport { DeclareClass as declareClass };\nexport function DeclareFunction(...args: Array): Object {\n return builder(\"DeclareFunction\", ...args);\n}\nexport { DeclareFunction as declareFunction };\nexport function DeclareInterface(...args: Array): Object {\n return builder(\"DeclareInterface\", ...args);\n}\nexport { DeclareInterface as declareInterface };\nexport function DeclareModule(...args: Array): Object {\n return builder(\"DeclareModule\", ...args);\n}\nexport { DeclareModule as declareModule };\nexport function DeclareModuleExports(...args: Array): Object {\n return builder(\"DeclareModuleExports\", ...args);\n}\nexport { DeclareModuleExports as declareModuleExports };\nexport function DeclareTypeAlias(...args: Array): Object {\n return builder(\"DeclareTypeAlias\", ...args);\n}\nexport { DeclareTypeAlias as declareTypeAlias };\nexport function DeclareOpaqueType(...args: Array): Object {\n return builder(\"DeclareOpaqueType\", ...args);\n}\nexport { DeclareOpaqueType as declareOpaqueType };\nexport function DeclareVariable(...args: Array): Object {\n return builder(\"DeclareVariable\", ...args);\n}\nexport { DeclareVariable as declareVariable };\nexport function DeclareExportDeclaration(...args: Array): Object {\n return builder(\"DeclareExportDeclaration\", ...args);\n}\nexport { DeclareExportDeclaration as declareExportDeclaration };\nexport function DeclareExportAllDeclaration(...args: Array): Object {\n return builder(\"DeclareExportAllDeclaration\", ...args);\n}\nexport { DeclareExportAllDeclaration as declareExportAllDeclaration };\nexport function DeclaredPredicate(...args: Array): Object {\n return builder(\"DeclaredPredicate\", ...args);\n}\nexport { DeclaredPredicate as declaredPredicate };\nexport function ExistsTypeAnnotation(...args: Array): Object {\n return builder(\"ExistsTypeAnnotation\", ...args);\n}\nexport { ExistsTypeAnnotation as existsTypeAnnotation };\nexport function FunctionTypeAnnotation(...args: Array): Object {\n return builder(\"FunctionTypeAnnotation\", ...args);\n}\nexport { FunctionTypeAnnotation as functionTypeAnnotation };\nexport function FunctionTypeParam(...args: Array): Object {\n return builder(\"FunctionTypeParam\", ...args);\n}\nexport { FunctionTypeParam as functionTypeParam };\nexport function GenericTypeAnnotation(...args: Array): Object {\n return builder(\"GenericTypeAnnotation\", ...args);\n}\nexport { GenericTypeAnnotation as genericTypeAnnotation };\nexport function InferredPredicate(...args: Array): Object {\n return builder(\"InferredPredicate\", ...args);\n}\nexport { InferredPredicate as inferredPredicate };\nexport function InterfaceExtends(...args: Array): Object {\n return builder(\"InterfaceExtends\", ...args);\n}\nexport { InterfaceExtends as interfaceExtends };\nexport function InterfaceDeclaration(...args: Array): Object {\n return builder(\"InterfaceDeclaration\", ...args);\n}\nexport { InterfaceDeclaration as interfaceDeclaration };\nexport function InterfaceTypeAnnotation(...args: Array): Object {\n return builder(\"InterfaceTypeAnnotation\", ...args);\n}\nexport { InterfaceTypeAnnotation as interfaceTypeAnnotation };\nexport function IntersectionTypeAnnotation(...args: Array): Object {\n return builder(\"IntersectionTypeAnnotation\", ...args);\n}\nexport { IntersectionTypeAnnotation as intersectionTypeAnnotation };\nexport function MixedTypeAnnotation(...args: Array): Object {\n return builder(\"MixedTypeAnnotation\", ...args);\n}\nexport { MixedTypeAnnotation as mixedTypeAnnotation };\nexport function EmptyTypeAnnotation(...args: Array): Object {\n return builder(\"EmptyTypeAnnotation\", ...args);\n}\nexport { EmptyTypeAnnotation as emptyTypeAnnotation };\nexport function NullableTypeAnnotation(...args: Array): Object {\n return builder(\"NullableTypeAnnotation\", ...args);\n}\nexport { NullableTypeAnnotation as nullableTypeAnnotation };\nexport function NumberLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"NumberLiteralTypeAnnotation\", ...args);\n}\nexport { NumberLiteralTypeAnnotation as numberLiteralTypeAnnotation };\nexport function NumberTypeAnnotation(...args: Array): Object {\n return builder(\"NumberTypeAnnotation\", ...args);\n}\nexport { NumberTypeAnnotation as numberTypeAnnotation };\nexport function ObjectTypeAnnotation(...args: Array): Object {\n return builder(\"ObjectTypeAnnotation\", ...args);\n}\nexport { ObjectTypeAnnotation as objectTypeAnnotation };\nexport function ObjectTypeInternalSlot(...args: Array): Object {\n return builder(\"ObjectTypeInternalSlot\", ...args);\n}\nexport { ObjectTypeInternalSlot as objectTypeInternalSlot };\nexport function ObjectTypeCallProperty(...args: Array): Object {\n return builder(\"ObjectTypeCallProperty\", ...args);\n}\nexport { ObjectTypeCallProperty as objectTypeCallProperty };\nexport function ObjectTypeIndexer(...args: Array): Object {\n return builder(\"ObjectTypeIndexer\", ...args);\n}\nexport { ObjectTypeIndexer as objectTypeIndexer };\nexport function ObjectTypeProperty(...args: Array): Object {\n return builder(\"ObjectTypeProperty\", ...args);\n}\nexport { ObjectTypeProperty as objectTypeProperty };\nexport function ObjectTypeSpreadProperty(...args: Array): Object {\n return builder(\"ObjectTypeSpreadProperty\", ...args);\n}\nexport { ObjectTypeSpreadProperty as objectTypeSpreadProperty };\nexport function OpaqueType(...args: Array): Object {\n return builder(\"OpaqueType\", ...args);\n}\nexport { OpaqueType as opaqueType };\nexport function QualifiedTypeIdentifier(...args: Array): Object {\n return builder(\"QualifiedTypeIdentifier\", ...args);\n}\nexport { QualifiedTypeIdentifier as qualifiedTypeIdentifier };\nexport function StringLiteralTypeAnnotation(...args: Array): Object {\n return builder(\"StringLiteralTypeAnnotation\", ...args);\n}\nexport { StringLiteralTypeAnnotation as stringLiteralTypeAnnotation };\nexport function StringTypeAnnotation(...args: Array): Object {\n return builder(\"StringTypeAnnotation\", ...args);\n}\nexport { StringTypeAnnotation as stringTypeAnnotation };\nexport function ThisTypeAnnotation(...args: Array): Object {\n return builder(\"ThisTypeAnnotation\", ...args);\n}\nexport { ThisTypeAnnotation as thisTypeAnnotation };\nexport function TupleTypeAnnotation(...args: Array): Object {\n return builder(\"TupleTypeAnnotation\", ...args);\n}\nexport { TupleTypeAnnotation as tupleTypeAnnotation };\nexport function TypeofTypeAnnotation(...args: Array): Object {\n return builder(\"TypeofTypeAnnotation\", ...args);\n}\nexport { TypeofTypeAnnotation as typeofTypeAnnotation };\nexport function TypeAlias(...args: Array): Object {\n return builder(\"TypeAlias\", ...args);\n}\nexport { TypeAlias as typeAlias };\nexport function TypeAnnotation(...args: Array): Object {\n return builder(\"TypeAnnotation\", ...args);\n}\nexport { TypeAnnotation as typeAnnotation };\nexport function TypeCastExpression(...args: Array): Object {\n return builder(\"TypeCastExpression\", ...args);\n}\nexport { TypeCastExpression as typeCastExpression };\nexport function TypeParameter(...args: Array): Object {\n return builder(\"TypeParameter\", ...args);\n}\nexport { TypeParameter as typeParameter };\nexport function TypeParameterDeclaration(...args: Array): Object {\n return builder(\"TypeParameterDeclaration\", ...args);\n}\nexport { TypeParameterDeclaration as typeParameterDeclaration };\nexport function TypeParameterInstantiation(...args: Array): Object {\n return builder(\"TypeParameterInstantiation\", ...args);\n}\nexport { TypeParameterInstantiation as typeParameterInstantiation };\nexport function UnionTypeAnnotation(...args: Array): Object {\n return builder(\"UnionTypeAnnotation\", ...args);\n}\nexport { UnionTypeAnnotation as unionTypeAnnotation };\nexport function Variance(...args: Array): Object {\n return builder(\"Variance\", ...args);\n}\nexport { Variance as variance };\nexport function VoidTypeAnnotation(...args: Array): Object {\n return builder(\"VoidTypeAnnotation\", ...args);\n}\nexport { VoidTypeAnnotation as voidTypeAnnotation };\nexport function EnumDeclaration(...args: Array): Object {\n return builder(\"EnumDeclaration\", ...args);\n}\nexport { EnumDeclaration as enumDeclaration };\nexport function EnumBooleanBody(...args: Array): Object {\n return builder(\"EnumBooleanBody\", ...args);\n}\nexport { EnumBooleanBody as enumBooleanBody };\nexport function EnumNumberBody(...args: Array): Object {\n return builder(\"EnumNumberBody\", ...args);\n}\nexport { EnumNumberBody as enumNumberBody };\nexport function EnumStringBody(...args: Array): Object {\n return builder(\"EnumStringBody\", ...args);\n}\nexport { EnumStringBody as enumStringBody };\nexport function EnumSymbolBody(...args: Array): Object {\n return builder(\"EnumSymbolBody\", ...args);\n}\nexport { EnumSymbolBody as enumSymbolBody };\nexport function EnumBooleanMember(...args: Array): Object {\n return builder(\"EnumBooleanMember\", ...args);\n}\nexport { EnumBooleanMember as enumBooleanMember };\nexport function EnumNumberMember(...args: Array): Object {\n return builder(\"EnumNumberMember\", ...args);\n}\nexport { EnumNumberMember as enumNumberMember };\nexport function EnumStringMember(...args: Array): Object {\n return builder(\"EnumStringMember\", ...args);\n}\nexport { EnumStringMember as enumStringMember };\nexport function EnumDefaultedMember(...args: Array): Object {\n return builder(\"EnumDefaultedMember\", ...args);\n}\nexport { EnumDefaultedMember as enumDefaultedMember };\nexport function JSXAttribute(...args: Array): Object {\n return builder(\"JSXAttribute\", ...args);\n}\nexport { JSXAttribute as jsxAttribute };\nexport { JSXAttribute as jSXAttribute };\nexport function JSXClosingElement(...args: Array): Object {\n return builder(\"JSXClosingElement\", ...args);\n}\nexport { JSXClosingElement as jsxClosingElement };\nexport { JSXClosingElement as jSXClosingElement };\nexport function JSXElement(...args: Array): Object {\n return builder(\"JSXElement\", ...args);\n}\nexport { JSXElement as jsxElement };\nexport { JSXElement as jSXElement };\nexport function JSXEmptyExpression(...args: Array): Object {\n return builder(\"JSXEmptyExpression\", ...args);\n}\nexport { JSXEmptyExpression as jsxEmptyExpression };\nexport { JSXEmptyExpression as jSXEmptyExpression };\nexport function JSXExpressionContainer(...args: Array): Object {\n return builder(\"JSXExpressionContainer\", ...args);\n}\nexport { JSXExpressionContainer as jsxExpressionContainer };\nexport { JSXExpressionContainer as jSXExpressionContainer };\nexport function JSXSpreadChild(...args: Array): Object {\n return builder(\"JSXSpreadChild\", ...args);\n}\nexport { JSXSpreadChild as jsxSpreadChild };\nexport { JSXSpreadChild as jSXSpreadChild };\nexport function JSXIdentifier(...args: Array): Object {\n return builder(\"JSXIdentifier\", ...args);\n}\nexport { JSXIdentifier as jsxIdentifier };\nexport { JSXIdentifier as jSXIdentifier };\nexport function JSXMemberExpression(...args: Array): Object {\n return builder(\"JSXMemberExpression\", ...args);\n}\nexport { JSXMemberExpression as jsxMemberExpression };\nexport { JSXMemberExpression as jSXMemberExpression };\nexport function JSXNamespacedName(...args: Array): Object {\n return builder(\"JSXNamespacedName\", ...args);\n}\nexport { JSXNamespacedName as jsxNamespacedName };\nexport { JSXNamespacedName as jSXNamespacedName };\nexport function JSXOpeningElement(...args: Array): Object {\n return builder(\"JSXOpeningElement\", ...args);\n}\nexport { JSXOpeningElement as jsxOpeningElement };\nexport { JSXOpeningElement as jSXOpeningElement };\nexport function JSXSpreadAttribute(...args: Array): Object {\n return builder(\"JSXSpreadAttribute\", ...args);\n}\nexport { JSXSpreadAttribute as jsxSpreadAttribute };\nexport { JSXSpreadAttribute as jSXSpreadAttribute };\nexport function JSXText(...args: Array): Object {\n return builder(\"JSXText\", ...args);\n}\nexport { JSXText as jsxText };\nexport { JSXText as jSXText };\nexport function JSXFragment(...args: Array): Object {\n return builder(\"JSXFragment\", ...args);\n}\nexport { JSXFragment as jsxFragment };\nexport { JSXFragment as jSXFragment };\nexport function JSXOpeningFragment(...args: Array): Object {\n return builder(\"JSXOpeningFragment\", ...args);\n}\nexport { JSXOpeningFragment as jsxOpeningFragment };\nexport { JSXOpeningFragment as jSXOpeningFragment };\nexport function JSXClosingFragment(...args: Array): Object {\n return builder(\"JSXClosingFragment\", ...args);\n}\nexport { JSXClosingFragment as jsxClosingFragment };\nexport { JSXClosingFragment as jSXClosingFragment };\nexport function Noop(...args: Array): Object {\n return builder(\"Noop\", ...args);\n}\nexport { Noop as noop };\nexport function Placeholder(...args: Array): Object {\n return builder(\"Placeholder\", ...args);\n}\nexport { Placeholder as placeholder };\nexport function V8IntrinsicIdentifier(...args: Array): Object {\n return builder(\"V8IntrinsicIdentifier\", ...args);\n}\nexport { V8IntrinsicIdentifier as v8IntrinsicIdentifier };\nexport function ArgumentPlaceholder(...args: Array): Object {\n return builder(\"ArgumentPlaceholder\", ...args);\n}\nexport { ArgumentPlaceholder as argumentPlaceholder };\nexport function AwaitExpression(...args: Array): Object {\n return builder(\"AwaitExpression\", ...args);\n}\nexport { AwaitExpression as awaitExpression };\nexport function BindExpression(...args: Array): Object {\n return builder(\"BindExpression\", ...args);\n}\nexport { BindExpression as bindExpression };\nexport function ClassProperty(...args: Array): Object {\n return builder(\"ClassProperty\", ...args);\n}\nexport { ClassProperty as classProperty };\nexport function OptionalMemberExpression(...args: Array): Object {\n return builder(\"OptionalMemberExpression\", ...args);\n}\nexport { OptionalMemberExpression as optionalMemberExpression };\nexport function PipelineTopicExpression(...args: Array): Object {\n return builder(\"PipelineTopicExpression\", ...args);\n}\nexport { PipelineTopicExpression as pipelineTopicExpression };\nexport function PipelineBareFunction(...args: Array): Object {\n return builder(\"PipelineBareFunction\", ...args);\n}\nexport { PipelineBareFunction as pipelineBareFunction };\nexport function PipelinePrimaryTopicReference(...args: Array): Object {\n return builder(\"PipelinePrimaryTopicReference\", ...args);\n}\nexport { PipelinePrimaryTopicReference as pipelinePrimaryTopicReference };\nexport function OptionalCallExpression(...args: Array): Object {\n return builder(\"OptionalCallExpression\", ...args);\n}\nexport { OptionalCallExpression as optionalCallExpression };\nexport function ClassPrivateProperty(...args: Array): Object {\n return builder(\"ClassPrivateProperty\", ...args);\n}\nexport { ClassPrivateProperty as classPrivateProperty };\nexport function ClassPrivateMethod(...args: Array): Object {\n return builder(\"ClassPrivateMethod\", ...args);\n}\nexport { ClassPrivateMethod as classPrivateMethod };\nexport function Import(...args: Array): Object {\n return builder(\"Import\", ...args);\n}\nexport { Import as import };\nexport function Decorator(...args: Array): Object {\n return builder(\"Decorator\", ...args);\n}\nexport { Decorator as decorator };\nexport function DoExpression(...args: Array): Object {\n return builder(\"DoExpression\", ...args);\n}\nexport { DoExpression as doExpression };\nexport function ExportDefaultSpecifier(...args: Array): Object {\n return builder(\"ExportDefaultSpecifier\", ...args);\n}\nexport { ExportDefaultSpecifier as exportDefaultSpecifier };\nexport function ExportNamespaceSpecifier(...args: Array): Object {\n return builder(\"ExportNamespaceSpecifier\", ...args);\n}\nexport { ExportNamespaceSpecifier as exportNamespaceSpecifier };\nexport function PrivateName(...args: Array): Object {\n return builder(\"PrivateName\", ...args);\n}\nexport { PrivateName as privateName };\nexport function BigIntLiteral(...args: Array): Object {\n return builder(\"BigIntLiteral\", ...args);\n}\nexport { BigIntLiteral as bigIntLiteral };\nexport function TSParameterProperty(...args: Array): Object {\n return builder(\"TSParameterProperty\", ...args);\n}\nexport { TSParameterProperty as tsParameterProperty };\nexport { TSParameterProperty as tSParameterProperty };\nexport function TSDeclareFunction(...args: Array): Object {\n return builder(\"TSDeclareFunction\", ...args);\n}\nexport { TSDeclareFunction as tsDeclareFunction };\nexport { TSDeclareFunction as tSDeclareFunction };\nexport function TSDeclareMethod(...args: Array): Object {\n return builder(\"TSDeclareMethod\", ...args);\n}\nexport { TSDeclareMethod as tsDeclareMethod };\nexport { TSDeclareMethod as tSDeclareMethod };\nexport function TSQualifiedName(...args: Array): Object {\n return builder(\"TSQualifiedName\", ...args);\n}\nexport { TSQualifiedName as tsQualifiedName };\nexport { TSQualifiedName as tSQualifiedName };\nexport function TSCallSignatureDeclaration(...args: Array): Object {\n return builder(\"TSCallSignatureDeclaration\", ...args);\n}\nexport { TSCallSignatureDeclaration as tsCallSignatureDeclaration };\nexport { TSCallSignatureDeclaration as tSCallSignatureDeclaration };\nexport function TSConstructSignatureDeclaration(...args: Array): Object {\n return builder(\"TSConstructSignatureDeclaration\", ...args);\n}\nexport { TSConstructSignatureDeclaration as tsConstructSignatureDeclaration };\nexport { TSConstructSignatureDeclaration as tSConstructSignatureDeclaration };\nexport function TSPropertySignature(...args: Array): Object {\n return builder(\"TSPropertySignature\", ...args);\n}\nexport { TSPropertySignature as tsPropertySignature };\nexport { TSPropertySignature as tSPropertySignature };\nexport function TSMethodSignature(...args: Array): Object {\n return builder(\"TSMethodSignature\", ...args);\n}\nexport { TSMethodSignature as tsMethodSignature };\nexport { TSMethodSignature as tSMethodSignature };\nexport function TSIndexSignature(...args: Array): Object {\n return builder(\"TSIndexSignature\", ...args);\n}\nexport { TSIndexSignature as tsIndexSignature };\nexport { TSIndexSignature as tSIndexSignature };\nexport function TSAnyKeyword(...args: Array): Object {\n return builder(\"TSAnyKeyword\", ...args);\n}\nexport { TSAnyKeyword as tsAnyKeyword };\nexport { TSAnyKeyword as tSAnyKeyword };\nexport function TSBooleanKeyword(...args: Array): Object {\n return builder(\"TSBooleanKeyword\", ...args);\n}\nexport { TSBooleanKeyword as tsBooleanKeyword };\nexport { TSBooleanKeyword as tSBooleanKeyword };\nexport function TSBigIntKeyword(...args: Array): Object {\n return builder(\"TSBigIntKeyword\", ...args);\n}\nexport { TSBigIntKeyword as tsBigIntKeyword };\nexport { TSBigIntKeyword as tSBigIntKeyword };\nexport function TSNeverKeyword(...args: Array): Object {\n return builder(\"TSNeverKeyword\", ...args);\n}\nexport { TSNeverKeyword as tsNeverKeyword };\nexport { TSNeverKeyword as tSNeverKeyword };\nexport function TSNullKeyword(...args: Array): Object {\n return builder(\"TSNullKeyword\", ...args);\n}\nexport { TSNullKeyword as tsNullKeyword };\nexport { TSNullKeyword as tSNullKeyword };\nexport function TSNumberKeyword(...args: Array): Object {\n return builder(\"TSNumberKeyword\", ...args);\n}\nexport { TSNumberKeyword as tsNumberKeyword };\nexport { TSNumberKeyword as tSNumberKeyword };\nexport function TSObjectKeyword(...args: Array): Object {\n return builder(\"TSObjectKeyword\", ...args);\n}\nexport { TSObjectKeyword as tsObjectKeyword };\nexport { TSObjectKeyword as tSObjectKeyword };\nexport function TSStringKeyword(...args: Array): Object {\n return builder(\"TSStringKeyword\", ...args);\n}\nexport { TSStringKeyword as tsStringKeyword };\nexport { TSStringKeyword as tSStringKeyword };\nexport function TSSymbolKeyword(...args: Array): Object {\n return builder(\"TSSymbolKeyword\", ...args);\n}\nexport { TSSymbolKeyword as tsSymbolKeyword };\nexport { TSSymbolKeyword as tSSymbolKeyword };\nexport function TSUndefinedKeyword(...args: Array): Object {\n return builder(\"TSUndefinedKeyword\", ...args);\n}\nexport { TSUndefinedKeyword as tsUndefinedKeyword };\nexport { TSUndefinedKeyword as tSUndefinedKeyword };\nexport function TSUnknownKeyword(...args: Array): Object {\n return builder(\"TSUnknownKeyword\", ...args);\n}\nexport { TSUnknownKeyword as tsUnknownKeyword };\nexport { TSUnknownKeyword as tSUnknownKeyword };\nexport function TSVoidKeyword(...args: Array): Object {\n return builder(\"TSVoidKeyword\", ...args);\n}\nexport { TSVoidKeyword as tsVoidKeyword };\nexport { TSVoidKeyword as tSVoidKeyword };\nexport function TSThisType(...args: Array): Object {\n return builder(\"TSThisType\", ...args);\n}\nexport { TSThisType as tsThisType };\nexport { TSThisType as tSThisType };\nexport function TSFunctionType(...args: Array): Object {\n return builder(\"TSFunctionType\", ...args);\n}\nexport { TSFunctionType as tsFunctionType };\nexport { TSFunctionType as tSFunctionType };\nexport function TSConstructorType(...args: Array): Object {\n return builder(\"TSConstructorType\", ...args);\n}\nexport { TSConstructorType as tsConstructorType };\nexport { TSConstructorType as tSConstructorType };\nexport function TSTypeReference(...args: Array): Object {\n return builder(\"TSTypeReference\", ...args);\n}\nexport { TSTypeReference as tsTypeReference };\nexport { TSTypeReference as tSTypeReference };\nexport function TSTypePredicate(...args: Array): Object {\n return builder(\"TSTypePredicate\", ...args);\n}\nexport { TSTypePredicate as tsTypePredicate };\nexport { TSTypePredicate as tSTypePredicate };\nexport function TSTypeQuery(...args: Array): Object {\n return builder(\"TSTypeQuery\", ...args);\n}\nexport { TSTypeQuery as tsTypeQuery };\nexport { TSTypeQuery as tSTypeQuery };\nexport function TSTypeLiteral(...args: Array): Object {\n return builder(\"TSTypeLiteral\", ...args);\n}\nexport { TSTypeLiteral as tsTypeLiteral };\nexport { TSTypeLiteral as tSTypeLiteral };\nexport function TSArrayType(...args: Array): Object {\n return builder(\"TSArrayType\", ...args);\n}\nexport { TSArrayType as tsArrayType };\nexport { TSArrayType as tSArrayType };\nexport function TSTupleType(...args: Array): Object {\n return builder(\"TSTupleType\", ...args);\n}\nexport { TSTupleType as tsTupleType };\nexport { TSTupleType as tSTupleType };\nexport function TSOptionalType(...args: Array): Object {\n return builder(\"TSOptionalType\", ...args);\n}\nexport { TSOptionalType as tsOptionalType };\nexport { TSOptionalType as tSOptionalType };\nexport function TSRestType(...args: Array): Object {\n return builder(\"TSRestType\", ...args);\n}\nexport { TSRestType as tsRestType };\nexport { TSRestType as tSRestType };\nexport function TSUnionType(...args: Array): Object {\n return builder(\"TSUnionType\", ...args);\n}\nexport { TSUnionType as tsUnionType };\nexport { TSUnionType as tSUnionType };\nexport function TSIntersectionType(...args: Array): Object {\n return builder(\"TSIntersectionType\", ...args);\n}\nexport { TSIntersectionType as tsIntersectionType };\nexport { TSIntersectionType as tSIntersectionType };\nexport function TSConditionalType(...args: Array): Object {\n return builder(\"TSConditionalType\", ...args);\n}\nexport { TSConditionalType as tsConditionalType };\nexport { TSConditionalType as tSConditionalType };\nexport function TSInferType(...args: Array): Object {\n return builder(\"TSInferType\", ...args);\n}\nexport { TSInferType as tsInferType };\nexport { TSInferType as tSInferType };\nexport function TSParenthesizedType(...args: Array): Object {\n return builder(\"TSParenthesizedType\", ...args);\n}\nexport { TSParenthesizedType as tsParenthesizedType };\nexport { TSParenthesizedType as tSParenthesizedType };\nexport function TSTypeOperator(...args: Array): Object {\n return builder(\"TSTypeOperator\", ...args);\n}\nexport { TSTypeOperator as tsTypeOperator };\nexport { TSTypeOperator as tSTypeOperator };\nexport function TSIndexedAccessType(...args: Array): Object {\n return builder(\"TSIndexedAccessType\", ...args);\n}\nexport { TSIndexedAccessType as tsIndexedAccessType };\nexport { TSIndexedAccessType as tSIndexedAccessType };\nexport function TSMappedType(...args: Array): Object {\n return builder(\"TSMappedType\", ...args);\n}\nexport { TSMappedType as tsMappedType };\nexport { TSMappedType as tSMappedType };\nexport function TSLiteralType(...args: Array): Object {\n return builder(\"TSLiteralType\", ...args);\n}\nexport { TSLiteralType as tsLiteralType };\nexport { TSLiteralType as tSLiteralType };\nexport function TSExpressionWithTypeArguments(...args: Array): Object {\n return builder(\"TSExpressionWithTypeArguments\", ...args);\n}\nexport { TSExpressionWithTypeArguments as tsExpressionWithTypeArguments };\nexport { TSExpressionWithTypeArguments as tSExpressionWithTypeArguments };\nexport function TSInterfaceDeclaration(...args: Array): Object {\n return builder(\"TSInterfaceDeclaration\", ...args);\n}\nexport { TSInterfaceDeclaration as tsInterfaceDeclaration };\nexport { TSInterfaceDeclaration as tSInterfaceDeclaration };\nexport function TSInterfaceBody(...args: Array): Object {\n return builder(\"TSInterfaceBody\", ...args);\n}\nexport { TSInterfaceBody as tsInterfaceBody };\nexport { TSInterfaceBody as tSInterfaceBody };\nexport function TSTypeAliasDeclaration(...args: Array): Object {\n return builder(\"TSTypeAliasDeclaration\", ...args);\n}\nexport { TSTypeAliasDeclaration as tsTypeAliasDeclaration };\nexport { TSTypeAliasDeclaration as tSTypeAliasDeclaration };\nexport function TSAsExpression(...args: Array): Object {\n return builder(\"TSAsExpression\", ...args);\n}\nexport { TSAsExpression as tsAsExpression };\nexport { TSAsExpression as tSAsExpression };\nexport function TSTypeAssertion(...args: Array): Object {\n return builder(\"TSTypeAssertion\", ...args);\n}\nexport { TSTypeAssertion as tsTypeAssertion };\nexport { TSTypeAssertion as tSTypeAssertion };\nexport function TSEnumDeclaration(...args: Array): Object {\n return builder(\"TSEnumDeclaration\", ...args);\n}\nexport { TSEnumDeclaration as tsEnumDeclaration };\nexport { TSEnumDeclaration as tSEnumDeclaration };\nexport function TSEnumMember(...args: Array): Object {\n return builder(\"TSEnumMember\", ...args);\n}\nexport { TSEnumMember as tsEnumMember };\nexport { TSEnumMember as tSEnumMember };\nexport function TSModuleDeclaration(...args: Array): Object {\n return builder(\"TSModuleDeclaration\", ...args);\n}\nexport { TSModuleDeclaration as tsModuleDeclaration };\nexport { TSModuleDeclaration as tSModuleDeclaration };\nexport function TSModuleBlock(...args: Array): Object {\n return builder(\"TSModuleBlock\", ...args);\n}\nexport { TSModuleBlock as tsModuleBlock };\nexport { TSModuleBlock as tSModuleBlock };\nexport function TSImportType(...args: Array): Object {\n return builder(\"TSImportType\", ...args);\n}\nexport { TSImportType as tsImportType };\nexport { TSImportType as tSImportType };\nexport function TSImportEqualsDeclaration(...args: Array): Object {\n return builder(\"TSImportEqualsDeclaration\", ...args);\n}\nexport { TSImportEqualsDeclaration as tsImportEqualsDeclaration };\nexport { TSImportEqualsDeclaration as tSImportEqualsDeclaration };\nexport function TSExternalModuleReference(...args: Array): Object {\n return builder(\"TSExternalModuleReference\", ...args);\n}\nexport { TSExternalModuleReference as tsExternalModuleReference };\nexport { TSExternalModuleReference as tSExternalModuleReference };\nexport function TSNonNullExpression(...args: Array): Object {\n return builder(\"TSNonNullExpression\", ...args);\n}\nexport { TSNonNullExpression as tsNonNullExpression };\nexport { TSNonNullExpression as tSNonNullExpression };\nexport function TSExportAssignment(...args: Array): Object {\n return builder(\"TSExportAssignment\", ...args);\n}\nexport { TSExportAssignment as tsExportAssignment };\nexport { TSExportAssignment as tSExportAssignment };\nexport function TSNamespaceExportDeclaration(...args: Array): Object {\n return builder(\"TSNamespaceExportDeclaration\", ...args);\n}\nexport { TSNamespaceExportDeclaration as tsNamespaceExportDeclaration };\nexport { TSNamespaceExportDeclaration as tSNamespaceExportDeclaration };\nexport function TSTypeAnnotation(...args: Array): Object {\n return builder(\"TSTypeAnnotation\", ...args);\n}\nexport { TSTypeAnnotation as tsTypeAnnotation };\nexport { TSTypeAnnotation as tSTypeAnnotation };\nexport function TSTypeParameterInstantiation(...args: Array): Object {\n return builder(\"TSTypeParameterInstantiation\", ...args);\n}\nexport { TSTypeParameterInstantiation as tsTypeParameterInstantiation };\nexport { TSTypeParameterInstantiation as tSTypeParameterInstantiation };\nexport function TSTypeParameterDeclaration(...args: Array): Object {\n return builder(\"TSTypeParameterDeclaration\", ...args);\n}\nexport { TSTypeParameterDeclaration as tsTypeParameterDeclaration };\nexport { TSTypeParameterDeclaration as tSTypeParameterDeclaration };\nexport function TSTypeParameter(...args: Array): Object {\n return builder(\"TSTypeParameter\", ...args);\n}\nexport { TSTypeParameter as tsTypeParameter };\nexport { TSTypeParameter as tSTypeParameter };\nexport function NumberLiteral(...args: Array): Object {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n return NumberLiteral(\"NumberLiteral\", ...args);\n}\nexport { NumberLiteral as numberLiteral };\nexport function RegexLiteral(...args: Array): Object {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n return RegexLiteral(\"RegexLiteral\", ...args);\n}\nexport { RegexLiteral as regexLiteral };\nexport function RestProperty(...args: Array): Object {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n return RestProperty(\"RestProperty\", ...args);\n}\nexport { RestProperty as restProperty };\nexport function SpreadProperty(...args: Array): Object {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n return SpreadProperty(\"SpreadProperty\", ...args);\n}\nexport { SpreadProperty as spreadProperty };\n","// @flow\nimport { stringLiteral } from \"../../builders/generated\";\n\nexport default function cleanJSXElementLiteralChild(\n child: { value: string },\n args: Array,\n) {\n const lines = child.value.split(/\\r\\n|\\n|\\r/);\n\n let lastNonEmptyLine = 0;\n\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].match(/[^ \\t]/)) {\n lastNonEmptyLine = i;\n }\n }\n\n let str = \"\";\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n\n const isFirstLine = i === 0;\n const isLastLine = i === lines.length - 1;\n const isLastNonEmptyLine = i === lastNonEmptyLine;\n\n // replace rendered whitespace tabs with spaces\n let trimmedLine = line.replace(/\\t/g, \" \");\n\n // trim whitespace touching a newline\n if (!isFirstLine) {\n trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n }\n\n // trim whitespace touching an endline\n if (!isLastLine) {\n trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n }\n\n if (trimmedLine) {\n if (!isLastNonEmptyLine) {\n trimmedLine += \" \";\n }\n\n str += trimmedLine;\n }\n }\n\n if (str) args.push(stringLiteral(str));\n}\n","// @flow\nimport {\n isJSXText,\n isJSXExpressionContainer,\n isJSXEmptyExpression,\n} from \"../../validators/generated\";\nimport cleanJSXElementLiteralChild from \"../../utils/react/cleanJSXElementLiteralChild\";\n\nexport default function buildChildren(node: Object): Array {\n const elements = [];\n\n for (let i = 0; i < node.children.length; i++) {\n let child = node.children[i];\n\n if (isJSXText(child)) {\n cleanJSXElementLiteralChild(child, elements);\n continue;\n }\n\n if (isJSXExpressionContainer(child)) child = child.expression;\n if (isJSXEmptyExpression(child)) continue;\n\n elements.push(child);\n }\n\n return elements;\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\nexport default function isNode(node?: Object): boolean {\n return !!(node && VISITOR_KEYS[node.type]);\n}\n","// @flow\nimport isNode from \"../validators/isNode\";\n\nexport default function assertNode(node?: Object): void {\n if (!isNode(node)) {\n const type = (node && node.type) || JSON.stringify(node);\n throw new TypeError(`Not a valid node of type \"${(type: any)}\"`);\n }\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport is from \"../../validators/is\";\n\nfunction assert(type: string, node: Object, opts?: Object): void {\n if (!is(type, node, opts)) {\n throw new Error(\n `Expected type \"${type}\" with option ${JSON.stringify((opts: any))}, ` +\n `but instead got \"${node.type}\".`,\n );\n }\n}\n\nexport function assertArrayExpression(node: Object, opts?: Object = {}): void {\n assert(\"ArrayExpression\", node, opts);\n}\nexport function assertAssignmentExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AssignmentExpression\", node, opts);\n}\nexport function assertBinaryExpression(node: Object, opts?: Object = {}): void {\n assert(\"BinaryExpression\", node, opts);\n}\nexport function assertInterpreterDirective(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterpreterDirective\", node, opts);\n}\nexport function assertDirective(node: Object, opts?: Object = {}): void {\n assert(\"Directive\", node, opts);\n}\nexport function assertDirectiveLiteral(node: Object, opts?: Object = {}): void {\n assert(\"DirectiveLiteral\", node, opts);\n}\nexport function assertBlockStatement(node: Object, opts?: Object = {}): void {\n assert(\"BlockStatement\", node, opts);\n}\nexport function assertBreakStatement(node: Object, opts?: Object = {}): void {\n assert(\"BreakStatement\", node, opts);\n}\nexport function assertCallExpression(node: Object, opts?: Object = {}): void {\n assert(\"CallExpression\", node, opts);\n}\nexport function assertCatchClause(node: Object, opts?: Object = {}): void {\n assert(\"CatchClause\", node, opts);\n}\nexport function assertConditionalExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ConditionalExpression\", node, opts);\n}\nexport function assertContinueStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ContinueStatement\", node, opts);\n}\nexport function assertDebuggerStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DebuggerStatement\", node, opts);\n}\nexport function assertDoWhileStatement(node: Object, opts?: Object = {}): void {\n assert(\"DoWhileStatement\", node, opts);\n}\nexport function assertEmptyStatement(node: Object, opts?: Object = {}): void {\n assert(\"EmptyStatement\", node, opts);\n}\nexport function assertExpressionStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExpressionStatement\", node, opts);\n}\nexport function assertFile(node: Object, opts?: Object = {}): void {\n assert(\"File\", node, opts);\n}\nexport function assertForInStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForInStatement\", node, opts);\n}\nexport function assertForStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForStatement\", node, opts);\n}\nexport function assertFunctionDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionDeclaration\", node, opts);\n}\nexport function assertFunctionExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionExpression\", node, opts);\n}\nexport function assertIdentifier(node: Object, opts?: Object = {}): void {\n assert(\"Identifier\", node, opts);\n}\nexport function assertIfStatement(node: Object, opts?: Object = {}): void {\n assert(\"IfStatement\", node, opts);\n}\nexport function assertLabeledStatement(node: Object, opts?: Object = {}): void {\n assert(\"LabeledStatement\", node, opts);\n}\nexport function assertStringLiteral(node: Object, opts?: Object = {}): void {\n assert(\"StringLiteral\", node, opts);\n}\nexport function assertNumericLiteral(node: Object, opts?: Object = {}): void {\n assert(\"NumericLiteral\", node, opts);\n}\nexport function assertNullLiteral(node: Object, opts?: Object = {}): void {\n assert(\"NullLiteral\", node, opts);\n}\nexport function assertBooleanLiteral(node: Object, opts?: Object = {}): void {\n assert(\"BooleanLiteral\", node, opts);\n}\nexport function assertRegExpLiteral(node: Object, opts?: Object = {}): void {\n assert(\"RegExpLiteral\", node, opts);\n}\nexport function assertLogicalExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"LogicalExpression\", node, opts);\n}\nexport function assertMemberExpression(node: Object, opts?: Object = {}): void {\n assert(\"MemberExpression\", node, opts);\n}\nexport function assertNewExpression(node: Object, opts?: Object = {}): void {\n assert(\"NewExpression\", node, opts);\n}\nexport function assertProgram(node: Object, opts?: Object = {}): void {\n assert(\"Program\", node, opts);\n}\nexport function assertObjectExpression(node: Object, opts?: Object = {}): void {\n assert(\"ObjectExpression\", node, opts);\n}\nexport function assertObjectMethod(node: Object, opts?: Object = {}): void {\n assert(\"ObjectMethod\", node, opts);\n}\nexport function assertObjectProperty(node: Object, opts?: Object = {}): void {\n assert(\"ObjectProperty\", node, opts);\n}\nexport function assertRestElement(node: Object, opts?: Object = {}): void {\n assert(\"RestElement\", node, opts);\n}\nexport function assertReturnStatement(node: Object, opts?: Object = {}): void {\n assert(\"ReturnStatement\", node, opts);\n}\nexport function assertSequenceExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"SequenceExpression\", node, opts);\n}\nexport function assertParenthesizedExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ParenthesizedExpression\", node, opts);\n}\nexport function assertSwitchCase(node: Object, opts?: Object = {}): void {\n assert(\"SwitchCase\", node, opts);\n}\nexport function assertSwitchStatement(node: Object, opts?: Object = {}): void {\n assert(\"SwitchStatement\", node, opts);\n}\nexport function assertThisExpression(node: Object, opts?: Object = {}): void {\n assert(\"ThisExpression\", node, opts);\n}\nexport function assertThrowStatement(node: Object, opts?: Object = {}): void {\n assert(\"ThrowStatement\", node, opts);\n}\nexport function assertTryStatement(node: Object, opts?: Object = {}): void {\n assert(\"TryStatement\", node, opts);\n}\nexport function assertUnaryExpression(node: Object, opts?: Object = {}): void {\n assert(\"UnaryExpression\", node, opts);\n}\nexport function assertUpdateExpression(node: Object, opts?: Object = {}): void {\n assert(\"UpdateExpression\", node, opts);\n}\nexport function assertVariableDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VariableDeclaration\", node, opts);\n}\nexport function assertVariableDeclarator(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VariableDeclarator\", node, opts);\n}\nexport function assertWhileStatement(node: Object, opts?: Object = {}): void {\n assert(\"WhileStatement\", node, opts);\n}\nexport function assertWithStatement(node: Object, opts?: Object = {}): void {\n assert(\"WithStatement\", node, opts);\n}\nexport function assertAssignmentPattern(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AssignmentPattern\", node, opts);\n}\nexport function assertArrayPattern(node: Object, opts?: Object = {}): void {\n assert(\"ArrayPattern\", node, opts);\n}\nexport function assertArrowFunctionExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArrowFunctionExpression\", node, opts);\n}\nexport function assertClassBody(node: Object, opts?: Object = {}): void {\n assert(\"ClassBody\", node, opts);\n}\nexport function assertClassExpression(node: Object, opts?: Object = {}): void {\n assert(\"ClassExpression\", node, opts);\n}\nexport function assertClassDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"ClassDeclaration\", node, opts);\n}\nexport function assertExportAllDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportAllDeclaration\", node, opts);\n}\nexport function assertExportDefaultDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDefaultDeclaration\", node, opts);\n}\nexport function assertExportNamedDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportNamedDeclaration\", node, opts);\n}\nexport function assertExportSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ExportSpecifier\", node, opts);\n}\nexport function assertForOfStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForOfStatement\", node, opts);\n}\nexport function assertImportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportDeclaration\", node, opts);\n}\nexport function assertImportDefaultSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportDefaultSpecifier\", node, opts);\n}\nexport function assertImportNamespaceSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ImportNamespaceSpecifier\", node, opts);\n}\nexport function assertImportSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ImportSpecifier\", node, opts);\n}\nexport function assertMetaProperty(node: Object, opts?: Object = {}): void {\n assert(\"MetaProperty\", node, opts);\n}\nexport function assertClassMethod(node: Object, opts?: Object = {}): void {\n assert(\"ClassMethod\", node, opts);\n}\nexport function assertObjectPattern(node: Object, opts?: Object = {}): void {\n assert(\"ObjectPattern\", node, opts);\n}\nexport function assertSpreadElement(node: Object, opts?: Object = {}): void {\n assert(\"SpreadElement\", node, opts);\n}\nexport function assertSuper(node: Object, opts?: Object = {}): void {\n assert(\"Super\", node, opts);\n}\nexport function assertTaggedTemplateExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TaggedTemplateExpression\", node, opts);\n}\nexport function assertTemplateElement(node: Object, opts?: Object = {}): void {\n assert(\"TemplateElement\", node, opts);\n}\nexport function assertTemplateLiteral(node: Object, opts?: Object = {}): void {\n assert(\"TemplateLiteral\", node, opts);\n}\nexport function assertYieldExpression(node: Object, opts?: Object = {}): void {\n assert(\"YieldExpression\", node, opts);\n}\nexport function assertAnyTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"AnyTypeAnnotation\", node, opts);\n}\nexport function assertArrayTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArrayTypeAnnotation\", node, opts);\n}\nexport function assertBooleanTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"BooleanTypeAnnotation\", node, opts);\n}\nexport function assertBooleanLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"BooleanLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNullLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NullLiteralTypeAnnotation\", node, opts);\n}\nexport function assertClassImplements(node: Object, opts?: Object = {}): void {\n assert(\"ClassImplements\", node, opts);\n}\nexport function assertDeclareClass(node: Object, opts?: Object = {}): void {\n assert(\"DeclareClass\", node, opts);\n}\nexport function assertDeclareFunction(node: Object, opts?: Object = {}): void {\n assert(\"DeclareFunction\", node, opts);\n}\nexport function assertDeclareInterface(node: Object, opts?: Object = {}): void {\n assert(\"DeclareInterface\", node, opts);\n}\nexport function assertDeclareModule(node: Object, opts?: Object = {}): void {\n assert(\"DeclareModule\", node, opts);\n}\nexport function assertDeclareModuleExports(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareModuleExports\", node, opts);\n}\nexport function assertDeclareTypeAlias(node: Object, opts?: Object = {}): void {\n assert(\"DeclareTypeAlias\", node, opts);\n}\nexport function assertDeclareOpaqueType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareOpaqueType\", node, opts);\n}\nexport function assertDeclareVariable(node: Object, opts?: Object = {}): void {\n assert(\"DeclareVariable\", node, opts);\n}\nexport function assertDeclareExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareExportDeclaration\", node, opts);\n}\nexport function assertDeclareExportAllDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclareExportAllDeclaration\", node, opts);\n}\nexport function assertDeclaredPredicate(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"DeclaredPredicate\", node, opts);\n}\nexport function assertExistsTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExistsTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionTypeAnnotation\", node, opts);\n}\nexport function assertFunctionTypeParam(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FunctionTypeParam\", node, opts);\n}\nexport function assertGenericTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"GenericTypeAnnotation\", node, opts);\n}\nexport function assertInferredPredicate(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InferredPredicate\", node, opts);\n}\nexport function assertInterfaceExtends(node: Object, opts?: Object = {}): void {\n assert(\"InterfaceExtends\", node, opts);\n}\nexport function assertInterfaceDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterfaceDeclaration\", node, opts);\n}\nexport function assertInterfaceTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"InterfaceTypeAnnotation\", node, opts);\n}\nexport function assertIntersectionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"IntersectionTypeAnnotation\", node, opts);\n}\nexport function assertMixedTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"MixedTypeAnnotation\", node, opts);\n}\nexport function assertEmptyTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EmptyTypeAnnotation\", node, opts);\n}\nexport function assertNullableTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NullableTypeAnnotation\", node, opts);\n}\nexport function assertNumberLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NumberLiteralTypeAnnotation\", node, opts);\n}\nexport function assertNumberTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"NumberTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeAnnotation\", node, opts);\n}\nexport function assertObjectTypeInternalSlot(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeInternalSlot\", node, opts);\n}\nexport function assertObjectTypeCallProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeCallProperty\", node, opts);\n}\nexport function assertObjectTypeIndexer(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeIndexer\", node, opts);\n}\nexport function assertObjectTypeProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeProperty\", node, opts);\n}\nexport function assertObjectTypeSpreadProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ObjectTypeSpreadProperty\", node, opts);\n}\nexport function assertOpaqueType(node: Object, opts?: Object = {}): void {\n assert(\"OpaqueType\", node, opts);\n}\nexport function assertQualifiedTypeIdentifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"QualifiedTypeIdentifier\", node, opts);\n}\nexport function assertStringLiteralTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"StringLiteralTypeAnnotation\", node, opts);\n}\nexport function assertStringTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"StringTypeAnnotation\", node, opts);\n}\nexport function assertThisTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ThisTypeAnnotation\", node, opts);\n}\nexport function assertTupleTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TupleTypeAnnotation\", node, opts);\n}\nexport function assertTypeofTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeofTypeAnnotation\", node, opts);\n}\nexport function assertTypeAlias(node: Object, opts?: Object = {}): void {\n assert(\"TypeAlias\", node, opts);\n}\nexport function assertTypeAnnotation(node: Object, opts?: Object = {}): void {\n assert(\"TypeAnnotation\", node, opts);\n}\nexport function assertTypeCastExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeCastExpression\", node, opts);\n}\nexport function assertTypeParameter(node: Object, opts?: Object = {}): void {\n assert(\"TypeParameter\", node, opts);\n}\nexport function assertTypeParameterDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeParameterDeclaration\", node, opts);\n}\nexport function assertTypeParameterInstantiation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TypeParameterInstantiation\", node, opts);\n}\nexport function assertUnionTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"UnionTypeAnnotation\", node, opts);\n}\nexport function assertVariance(node: Object, opts?: Object = {}): void {\n assert(\"Variance\", node, opts);\n}\nexport function assertVoidTypeAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"VoidTypeAnnotation\", node, opts);\n}\nexport function assertEnumDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"EnumDeclaration\", node, opts);\n}\nexport function assertEnumBooleanBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumBooleanBody\", node, opts);\n}\nexport function assertEnumNumberBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumNumberBody\", node, opts);\n}\nexport function assertEnumStringBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumStringBody\", node, opts);\n}\nexport function assertEnumSymbolBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumSymbolBody\", node, opts);\n}\nexport function assertEnumBooleanMember(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EnumBooleanMember\", node, opts);\n}\nexport function assertEnumNumberMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumNumberMember\", node, opts);\n}\nexport function assertEnumStringMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumStringMember\", node, opts);\n}\nexport function assertEnumDefaultedMember(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"EnumDefaultedMember\", node, opts);\n}\nexport function assertJSXAttribute(node: Object, opts?: Object = {}): void {\n assert(\"JSXAttribute\", node, opts);\n}\nexport function assertJSXClosingElement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXClosingElement\", node, opts);\n}\nexport function assertJSXElement(node: Object, opts?: Object = {}): void {\n assert(\"JSXElement\", node, opts);\n}\nexport function assertJSXEmptyExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXEmptyExpression\", node, opts);\n}\nexport function assertJSXExpressionContainer(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXExpressionContainer\", node, opts);\n}\nexport function assertJSXSpreadChild(node: Object, opts?: Object = {}): void {\n assert(\"JSXSpreadChild\", node, opts);\n}\nexport function assertJSXIdentifier(node: Object, opts?: Object = {}): void {\n assert(\"JSXIdentifier\", node, opts);\n}\nexport function assertJSXMemberExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXMemberExpression\", node, opts);\n}\nexport function assertJSXNamespacedName(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXNamespacedName\", node, opts);\n}\nexport function assertJSXOpeningElement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXOpeningElement\", node, opts);\n}\nexport function assertJSXSpreadAttribute(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXSpreadAttribute\", node, opts);\n}\nexport function assertJSXText(node: Object, opts?: Object = {}): void {\n assert(\"JSXText\", node, opts);\n}\nexport function assertJSXFragment(node: Object, opts?: Object = {}): void {\n assert(\"JSXFragment\", node, opts);\n}\nexport function assertJSXOpeningFragment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXOpeningFragment\", node, opts);\n}\nexport function assertJSXClosingFragment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"JSXClosingFragment\", node, opts);\n}\nexport function assertNoop(node: Object, opts?: Object = {}): void {\n assert(\"Noop\", node, opts);\n}\nexport function assertPlaceholder(node: Object, opts?: Object = {}): void {\n assert(\"Placeholder\", node, opts);\n}\nexport function assertV8IntrinsicIdentifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"V8IntrinsicIdentifier\", node, opts);\n}\nexport function assertArgumentPlaceholder(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ArgumentPlaceholder\", node, opts);\n}\nexport function assertAwaitExpression(node: Object, opts?: Object = {}): void {\n assert(\"AwaitExpression\", node, opts);\n}\nexport function assertBindExpression(node: Object, opts?: Object = {}): void {\n assert(\"BindExpression\", node, opts);\n}\nexport function assertClassProperty(node: Object, opts?: Object = {}): void {\n assert(\"ClassProperty\", node, opts);\n}\nexport function assertOptionalMemberExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"OptionalMemberExpression\", node, opts);\n}\nexport function assertPipelineTopicExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelineTopicExpression\", node, opts);\n}\nexport function assertPipelineBareFunction(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelineBareFunction\", node, opts);\n}\nexport function assertPipelinePrimaryTopicReference(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"PipelinePrimaryTopicReference\", node, opts);\n}\nexport function assertOptionalCallExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"OptionalCallExpression\", node, opts);\n}\nexport function assertClassPrivateProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ClassPrivateProperty\", node, opts);\n}\nexport function assertClassPrivateMethod(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ClassPrivateMethod\", node, opts);\n}\nexport function assertImport(node: Object, opts?: Object = {}): void {\n assert(\"Import\", node, opts);\n}\nexport function assertDecorator(node: Object, opts?: Object = {}): void {\n assert(\"Decorator\", node, opts);\n}\nexport function assertDoExpression(node: Object, opts?: Object = {}): void {\n assert(\"DoExpression\", node, opts);\n}\nexport function assertExportDefaultSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDefaultSpecifier\", node, opts);\n}\nexport function assertExportNamespaceSpecifier(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportNamespaceSpecifier\", node, opts);\n}\nexport function assertPrivateName(node: Object, opts?: Object = {}): void {\n assert(\"PrivateName\", node, opts);\n}\nexport function assertBigIntLiteral(node: Object, opts?: Object = {}): void {\n assert(\"BigIntLiteral\", node, opts);\n}\nexport function assertTSParameterProperty(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSParameterProperty\", node, opts);\n}\nexport function assertTSDeclareFunction(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSDeclareFunction\", node, opts);\n}\nexport function assertTSDeclareMethod(node: Object, opts?: Object = {}): void {\n assert(\"TSDeclareMethod\", node, opts);\n}\nexport function assertTSQualifiedName(node: Object, opts?: Object = {}): void {\n assert(\"TSQualifiedName\", node, opts);\n}\nexport function assertTSCallSignatureDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSCallSignatureDeclaration\", node, opts);\n}\nexport function assertTSConstructSignatureDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConstructSignatureDeclaration\", node, opts);\n}\nexport function assertTSPropertySignature(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSPropertySignature\", node, opts);\n}\nexport function assertTSMethodSignature(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSMethodSignature\", node, opts);\n}\nexport function assertTSIndexSignature(node: Object, opts?: Object = {}): void {\n assert(\"TSIndexSignature\", node, opts);\n}\nexport function assertTSAnyKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSAnyKeyword\", node, opts);\n}\nexport function assertTSBooleanKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSBooleanKeyword\", node, opts);\n}\nexport function assertTSBigIntKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSBigIntKeyword\", node, opts);\n}\nexport function assertTSNeverKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNeverKeyword\", node, opts);\n}\nexport function assertTSNullKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNullKeyword\", node, opts);\n}\nexport function assertTSNumberKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSNumberKeyword\", node, opts);\n}\nexport function assertTSObjectKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSObjectKeyword\", node, opts);\n}\nexport function assertTSStringKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSStringKeyword\", node, opts);\n}\nexport function assertTSSymbolKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSSymbolKeyword\", node, opts);\n}\nexport function assertTSUndefinedKeyword(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSUndefinedKeyword\", node, opts);\n}\nexport function assertTSUnknownKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSUnknownKeyword\", node, opts);\n}\nexport function assertTSVoidKeyword(node: Object, opts?: Object = {}): void {\n assert(\"TSVoidKeyword\", node, opts);\n}\nexport function assertTSThisType(node: Object, opts?: Object = {}): void {\n assert(\"TSThisType\", node, opts);\n}\nexport function assertTSFunctionType(node: Object, opts?: Object = {}): void {\n assert(\"TSFunctionType\", node, opts);\n}\nexport function assertTSConstructorType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConstructorType\", node, opts);\n}\nexport function assertTSTypeReference(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeReference\", node, opts);\n}\nexport function assertTSTypePredicate(node: Object, opts?: Object = {}): void {\n assert(\"TSTypePredicate\", node, opts);\n}\nexport function assertTSTypeQuery(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeQuery\", node, opts);\n}\nexport function assertTSTypeLiteral(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeLiteral\", node, opts);\n}\nexport function assertTSArrayType(node: Object, opts?: Object = {}): void {\n assert(\"TSArrayType\", node, opts);\n}\nexport function assertTSTupleType(node: Object, opts?: Object = {}): void {\n assert(\"TSTupleType\", node, opts);\n}\nexport function assertTSOptionalType(node: Object, opts?: Object = {}): void {\n assert(\"TSOptionalType\", node, opts);\n}\nexport function assertTSRestType(node: Object, opts?: Object = {}): void {\n assert(\"TSRestType\", node, opts);\n}\nexport function assertTSUnionType(node: Object, opts?: Object = {}): void {\n assert(\"TSUnionType\", node, opts);\n}\nexport function assertTSIntersectionType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSIntersectionType\", node, opts);\n}\nexport function assertTSConditionalType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSConditionalType\", node, opts);\n}\nexport function assertTSInferType(node: Object, opts?: Object = {}): void {\n assert(\"TSInferType\", node, opts);\n}\nexport function assertTSParenthesizedType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSParenthesizedType\", node, opts);\n}\nexport function assertTSTypeOperator(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeOperator\", node, opts);\n}\nexport function assertTSIndexedAccessType(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSIndexedAccessType\", node, opts);\n}\nexport function assertTSMappedType(node: Object, opts?: Object = {}): void {\n assert(\"TSMappedType\", node, opts);\n}\nexport function assertTSLiteralType(node: Object, opts?: Object = {}): void {\n assert(\"TSLiteralType\", node, opts);\n}\nexport function assertTSExpressionWithTypeArguments(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExpressionWithTypeArguments\", node, opts);\n}\nexport function assertTSInterfaceDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSInterfaceDeclaration\", node, opts);\n}\nexport function assertTSInterfaceBody(node: Object, opts?: Object = {}): void {\n assert(\"TSInterfaceBody\", node, opts);\n}\nexport function assertTSTypeAliasDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeAliasDeclaration\", node, opts);\n}\nexport function assertTSAsExpression(node: Object, opts?: Object = {}): void {\n assert(\"TSAsExpression\", node, opts);\n}\nexport function assertTSTypeAssertion(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeAssertion\", node, opts);\n}\nexport function assertTSEnumDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSEnumDeclaration\", node, opts);\n}\nexport function assertTSEnumMember(node: Object, opts?: Object = {}): void {\n assert(\"TSEnumMember\", node, opts);\n}\nexport function assertTSModuleDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSModuleDeclaration\", node, opts);\n}\nexport function assertTSModuleBlock(node: Object, opts?: Object = {}): void {\n assert(\"TSModuleBlock\", node, opts);\n}\nexport function assertTSImportType(node: Object, opts?: Object = {}): void {\n assert(\"TSImportType\", node, opts);\n}\nexport function assertTSImportEqualsDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSImportEqualsDeclaration\", node, opts);\n}\nexport function assertTSExternalModuleReference(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExternalModuleReference\", node, opts);\n}\nexport function assertTSNonNullExpression(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSNonNullExpression\", node, opts);\n}\nexport function assertTSExportAssignment(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSExportAssignment\", node, opts);\n}\nexport function assertTSNamespaceExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSNamespaceExportDeclaration\", node, opts);\n}\nexport function assertTSTypeAnnotation(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeAnnotation\", node, opts);\n}\nexport function assertTSTypeParameterInstantiation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeParameterInstantiation\", node, opts);\n}\nexport function assertTSTypeParameterDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"TSTypeParameterDeclaration\", node, opts);\n}\nexport function assertTSTypeParameter(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeParameter\", node, opts);\n}\nexport function assertExpression(node: Object, opts?: Object = {}): void {\n assert(\"Expression\", node, opts);\n}\nexport function assertBinary(node: Object, opts?: Object = {}): void {\n assert(\"Binary\", node, opts);\n}\nexport function assertScopable(node: Object, opts?: Object = {}): void {\n assert(\"Scopable\", node, opts);\n}\nexport function assertBlockParent(node: Object, opts?: Object = {}): void {\n assert(\"BlockParent\", node, opts);\n}\nexport function assertBlock(node: Object, opts?: Object = {}): void {\n assert(\"Block\", node, opts);\n}\nexport function assertStatement(node: Object, opts?: Object = {}): void {\n assert(\"Statement\", node, opts);\n}\nexport function assertTerminatorless(node: Object, opts?: Object = {}): void {\n assert(\"Terminatorless\", node, opts);\n}\nexport function assertCompletionStatement(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"CompletionStatement\", node, opts);\n}\nexport function assertConditional(node: Object, opts?: Object = {}): void {\n assert(\"Conditional\", node, opts);\n}\nexport function assertLoop(node: Object, opts?: Object = {}): void {\n assert(\"Loop\", node, opts);\n}\nexport function assertWhile(node: Object, opts?: Object = {}): void {\n assert(\"While\", node, opts);\n}\nexport function assertExpressionWrapper(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExpressionWrapper\", node, opts);\n}\nexport function assertFor(node: Object, opts?: Object = {}): void {\n assert(\"For\", node, opts);\n}\nexport function assertForXStatement(node: Object, opts?: Object = {}): void {\n assert(\"ForXStatement\", node, opts);\n}\nexport function assertFunction(node: Object, opts?: Object = {}): void {\n assert(\"Function\", node, opts);\n}\nexport function assertFunctionParent(node: Object, opts?: Object = {}): void {\n assert(\"FunctionParent\", node, opts);\n}\nexport function assertPureish(node: Object, opts?: Object = {}): void {\n assert(\"Pureish\", node, opts);\n}\nexport function assertDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"Declaration\", node, opts);\n}\nexport function assertPatternLike(node: Object, opts?: Object = {}): void {\n assert(\"PatternLike\", node, opts);\n}\nexport function assertLVal(node: Object, opts?: Object = {}): void {\n assert(\"LVal\", node, opts);\n}\nexport function assertTSEntityName(node: Object, opts?: Object = {}): void {\n assert(\"TSEntityName\", node, opts);\n}\nexport function assertLiteral(node: Object, opts?: Object = {}): void {\n assert(\"Literal\", node, opts);\n}\nexport function assertImmutable(node: Object, opts?: Object = {}): void {\n assert(\"Immutable\", node, opts);\n}\nexport function assertUserWhitespacable(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"UserWhitespacable\", node, opts);\n}\nexport function assertMethod(node: Object, opts?: Object = {}): void {\n assert(\"Method\", node, opts);\n}\nexport function assertObjectMember(node: Object, opts?: Object = {}): void {\n assert(\"ObjectMember\", node, opts);\n}\nexport function assertProperty(node: Object, opts?: Object = {}): void {\n assert(\"Property\", node, opts);\n}\nexport function assertUnaryLike(node: Object, opts?: Object = {}): void {\n assert(\"UnaryLike\", node, opts);\n}\nexport function assertPattern(node: Object, opts?: Object = {}): void {\n assert(\"Pattern\", node, opts);\n}\nexport function assertClass(node: Object, opts?: Object = {}): void {\n assert(\"Class\", node, opts);\n}\nexport function assertModuleDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ModuleDeclaration\", node, opts);\n}\nexport function assertExportDeclaration(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"ExportDeclaration\", node, opts);\n}\nexport function assertModuleSpecifier(node: Object, opts?: Object = {}): void {\n assert(\"ModuleSpecifier\", node, opts);\n}\nexport function assertFlow(node: Object, opts?: Object = {}): void {\n assert(\"Flow\", node, opts);\n}\nexport function assertFlowType(node: Object, opts?: Object = {}): void {\n assert(\"FlowType\", node, opts);\n}\nexport function assertFlowBaseAnnotation(\n node: Object,\n opts?: Object = {},\n): void {\n assert(\"FlowBaseAnnotation\", node, opts);\n}\nexport function assertFlowDeclaration(node: Object, opts?: Object = {}): void {\n assert(\"FlowDeclaration\", node, opts);\n}\nexport function assertFlowPredicate(node: Object, opts?: Object = {}): void {\n assert(\"FlowPredicate\", node, opts);\n}\nexport function assertEnumBody(node: Object, opts?: Object = {}): void {\n assert(\"EnumBody\", node, opts);\n}\nexport function assertEnumMember(node: Object, opts?: Object = {}): void {\n assert(\"EnumMember\", node, opts);\n}\nexport function assertJSX(node: Object, opts?: Object = {}): void {\n assert(\"JSX\", node, opts);\n}\nexport function assertPrivate(node: Object, opts?: Object = {}): void {\n assert(\"Private\", node, opts);\n}\nexport function assertTSTypeElement(node: Object, opts?: Object = {}): void {\n assert(\"TSTypeElement\", node, opts);\n}\nexport function assertTSType(node: Object, opts?: Object = {}): void {\n assert(\"TSType\", node, opts);\n}\nexport function assertNumberLiteral(node: Object, opts: Object): void {\n console.trace(\n \"The node type NumberLiteral has been renamed to NumericLiteral\",\n );\n assert(\"NumberLiteral\", node, opts);\n}\nexport function assertRegexLiteral(node: Object, opts: Object): void {\n console.trace(\"The node type RegexLiteral has been renamed to RegExpLiteral\");\n assert(\"RegexLiteral\", node, opts);\n}\nexport function assertRestProperty(node: Object, opts: Object): void {\n console.trace(\"The node type RestProperty has been renamed to RestElement\");\n assert(\"RestProperty\", node, opts);\n}\nexport function assertSpreadProperty(node: Object, opts: Object): void {\n console.trace(\n \"The node type SpreadProperty has been renamed to SpreadElement\",\n );\n assert(\"SpreadProperty\", node, opts);\n}\n","// @flow\nimport {\n stringTypeAnnotation,\n numberTypeAnnotation,\n voidTypeAnnotation,\n booleanTypeAnnotation,\n genericTypeAnnotation,\n identifier,\n} from \"../generated\";\n\n/**\n * Create a type annotation based on typeof expression.\n */\nexport default function createTypeAnnotationBasedOnTypeof(\n type: string,\n): Object {\n if (type === \"string\") {\n return stringTypeAnnotation();\n } else if (type === \"number\") {\n return numberTypeAnnotation();\n } else if (type === \"undefined\") {\n return voidTypeAnnotation();\n } else if (type === \"boolean\") {\n return booleanTypeAnnotation();\n } else if (type === \"function\") {\n return genericTypeAnnotation(identifier(\"Function\"));\n } else if (type === \"object\") {\n return genericTypeAnnotation(identifier(\"Object\"));\n } else if (type === \"symbol\") {\n return genericTypeAnnotation(identifier(\"Symbol\"));\n } else {\n throw new Error(\"Invalid typeof value\");\n }\n}\n","// @flow\nimport {\n isAnyTypeAnnotation,\n isGenericTypeAnnotation,\n isUnionTypeAnnotation,\n isFlowBaseAnnotation,\n} from \"../../validators/generated\";\n\n/**\n * Dedupe type annotations.\n */\nexport default function removeTypeDuplicates(\n nodes: Array,\n): Array {\n const generics = {};\n const bases = {};\n\n // store union type groups to circular references\n const typeGroups = [];\n\n const types = [];\n\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n if (!node) continue;\n\n // detect duplicates\n if (types.indexOf(node) >= 0) {\n continue;\n }\n\n // this type matches anything\n if (isAnyTypeAnnotation(node)) {\n return [node];\n }\n\n if (isFlowBaseAnnotation(node)) {\n bases[node.type] = node;\n continue;\n }\n\n if (isUnionTypeAnnotation(node)) {\n if (typeGroups.indexOf(node.types) < 0) {\n nodes = nodes.concat(node.types);\n typeGroups.push(node.types);\n }\n continue;\n }\n\n // find a matching generic type and merge and deduplicate the type parameters\n if (isGenericTypeAnnotation(node)) {\n const name = node.id.name;\n\n if (generics[name]) {\n let existing = generics[name];\n if (existing.typeParameters) {\n if (node.typeParameters) {\n existing.typeParameters.params = removeTypeDuplicates(\n existing.typeParameters.params.concat(node.typeParameters.params),\n );\n }\n } else {\n existing = node.typeParameters;\n }\n } else {\n generics[name] = node;\n }\n\n continue;\n }\n\n types.push(node);\n }\n\n // add back in bases\n for (const type of Object.keys(bases)) {\n types.push(bases[type]);\n }\n\n // add back in generics\n for (const name of Object.keys(generics)) {\n types.push(generics[name]);\n }\n\n return types;\n}\n","// @flow\nimport { unionTypeAnnotation } from \"../generated\";\nimport removeTypeDuplicates from \"../../modifications/flow/removeTypeDuplicates\";\n\n/**\n * Takes an array of `types` and flattens them, removing duplicates and\n * returns a `UnionTypeAnnotation` node containg them.\n */\nexport default function createUnionTypeAnnotation(\n types: Array,\n): Object {\n const flattened = removeTypeDuplicates(types);\n\n if (flattened.length === 1) {\n return flattened[0];\n } else {\n return unionTypeAnnotation(flattened);\n }\n}\n","import { NODE_FIELDS } from \"../definitions\";\n\nconst has = Function.call.bind(Object.prototype.hasOwnProperty);\n\nfunction cloneIfNode(obj, deep) {\n if (\n obj &&\n typeof obj.type === \"string\" &&\n // CommentLine and CommentBlock are used in File#comments, but they are\n // not defined in babel-types\n obj.type !== \"CommentLine\" &&\n obj.type !== \"CommentBlock\"\n ) {\n return cloneNode(obj, deep);\n }\n\n return obj;\n}\n\nfunction cloneIfNodeOrArray(obj, deep) {\n if (Array.isArray(obj)) {\n return obj.map(node => cloneIfNode(node, deep));\n }\n return cloneIfNode(obj, deep);\n}\n\n/**\n * Create a clone of a `node` including only properties belonging to the node.\n * If the second parameter is `false`, cloneNode performs a shallow clone.\n */\nexport default function cloneNode(node: T, deep: boolean = true): T {\n if (!node) return node;\n\n const { type } = node;\n const newNode = (({ type }: any): T);\n\n // Special-case identifiers since they are the most cloned nodes.\n if (type === \"Identifier\") {\n newNode.name = node.name;\n\n if (has(node, \"optional\") && typeof node.optional === \"boolean\") {\n newNode.optional = node.optional;\n }\n\n if (has(node, \"typeAnnotation\")) {\n newNode.typeAnnotation = deep\n ? cloneIfNodeOrArray(node.typeAnnotation, true)\n : node.typeAnnotation;\n }\n } else if (!has(NODE_FIELDS, type)) {\n throw new Error(`Unknown node type: \"${type}\"`);\n } else {\n for (const field of Object.keys(NODE_FIELDS[type])) {\n if (has(node, field)) {\n newNode[field] = deep\n ? cloneIfNodeOrArray(node[field], true)\n : node[field];\n }\n }\n }\n\n if (has(node, \"loc\")) {\n newNode.loc = node.loc;\n }\n if (has(node, \"leadingComments\")) {\n newNode.leadingComments = node.leadingComments;\n }\n if (has(node, \"innerComments\")) {\n newNode.innerComments = node.innerComments;\n }\n if (has(node, \"trailingComments\")) {\n newNode.trailingComments = node.trailingComments;\n }\n if (has(node, \"extra\")) {\n newNode.extra = {\n ...node.extra,\n };\n }\n\n return newNode;\n}\n","// @flow\n\nimport cloneNode from \"./cloneNode\";\n\n/**\n * Create a shallow clone of a `node`, including only\n * properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function clone(node: T): T {\n return cloneNode(node, /* deep */ false);\n}\n","// @flow\n\nimport cloneNode from \"./cloneNode\";\n\n/**\n * Create a deep clone of a `node` and all of it's child nodes\n * including only properties belonging to the node.\n * @deprecated Use t.cloneNode instead.\n */\nexport default function cloneDeep(node: T): T {\n return cloneNode(node);\n}\n","// @flow\nimport clone from \"./clone\";\n\n/**\n * Create a shallow clone of a `node` excluding `_private` and location properties.\n */\nexport default function cloneWithoutLoc(node: T): T {\n const newNode = clone(node);\n newNode.loc = null;\n\n return newNode;\n}\n","// @flow\n\n/**\n * Add comments of certain type to a node.\n */\nexport default function addComments(\n node: T,\n type: string,\n comments: Array,\n): T {\n if (!comments || !node) return node;\n\n const key = `${type}Comments`;\n\n if (node[key]) {\n if (type === \"leading\") {\n node[key] = comments.concat(node[key]);\n } else {\n node[key] = node[key].concat(comments);\n }\n } else {\n node[key] = comments;\n }\n\n return node;\n}\n","// @flow\nimport addComments from \"./addComments\";\n\n/**\n * Add comment of certain type to a node.\n */\nexport default function addComment(\n node: T,\n type: string,\n content: string,\n line?: boolean,\n): T {\n return addComments(node, type, [\n {\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content,\n },\n ]);\n}\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseUniq = require('./_baseUniq');\n\n/**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\nfunction uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n}\n\nmodule.exports = uniq;\n","// @flow\nimport uniq from \"lodash/uniq\";\n\nexport default function inherit(\n key: string,\n child: Object,\n parent: Object,\n): void {\n if (child && parent) {\n child[key] = uniq([].concat(child[key], parent[key]).filter(Boolean));\n }\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritInnerComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"innerComments\", child, parent);\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritLeadingComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"leadingComments\", child, parent);\n}\n","// @flow\nimport inherit from \"../utils/inherit\";\n\nexport default function inheritTrailingComments(\n child: Object,\n parent: Object,\n): void {\n inherit(\"trailingComments\", child, parent);\n}\n","// @flow\nimport inheritTrailingComments from \"./inheritTrailingComments\";\nimport inheritLeadingComments from \"./inheritLeadingComments\";\nimport inheritInnerComments from \"./inheritInnerComments\";\n\n/**\n * Inherit all unique comments from `parent` node to `child` node.\n */\nexport default function inheritsComments(\n child: T,\n parent: Object,\n): T {\n inheritTrailingComments(child, parent);\n inheritLeadingComments(child, parent);\n inheritInnerComments(child, parent);\n\n return child;\n}\n","// @flow\nimport { COMMENT_KEYS } from \"../constants\";\n\n/**\n * Remove comment properties from a node.\n */\nexport default function removeComments(node: T): T {\n COMMENT_KEYS.forEach(key => {\n node[key] = null;\n });\n\n return node;\n}\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport { FLIPPED_ALIAS_KEYS } from \"../../definitions\";\n\nexport const EXPRESSION_TYPES = FLIPPED_ALIAS_KEYS[\"Expression\"];\nexport const BINARY_TYPES = FLIPPED_ALIAS_KEYS[\"Binary\"];\nexport const SCOPABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Scopable\"];\nexport const BLOCKPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"BlockParent\"];\nexport const BLOCK_TYPES = FLIPPED_ALIAS_KEYS[\"Block\"];\nexport const STATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"Statement\"];\nexport const TERMINATORLESS_TYPES = FLIPPED_ALIAS_KEYS[\"Terminatorless\"];\nexport const COMPLETIONSTATEMENT_TYPES =\n FLIPPED_ALIAS_KEYS[\"CompletionStatement\"];\nexport const CONDITIONAL_TYPES = FLIPPED_ALIAS_KEYS[\"Conditional\"];\nexport const LOOP_TYPES = FLIPPED_ALIAS_KEYS[\"Loop\"];\nexport const WHILE_TYPES = FLIPPED_ALIAS_KEYS[\"While\"];\nexport const EXPRESSIONWRAPPER_TYPES = FLIPPED_ALIAS_KEYS[\"ExpressionWrapper\"];\nexport const FOR_TYPES = FLIPPED_ALIAS_KEYS[\"For\"];\nexport const FORXSTATEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"ForXStatement\"];\nexport const FUNCTION_TYPES = FLIPPED_ALIAS_KEYS[\"Function\"];\nexport const FUNCTIONPARENT_TYPES = FLIPPED_ALIAS_KEYS[\"FunctionParent\"];\nexport const PUREISH_TYPES = FLIPPED_ALIAS_KEYS[\"Pureish\"];\nexport const DECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"Declaration\"];\nexport const PATTERNLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"PatternLike\"];\nexport const LVAL_TYPES = FLIPPED_ALIAS_KEYS[\"LVal\"];\nexport const TSENTITYNAME_TYPES = FLIPPED_ALIAS_KEYS[\"TSEntityName\"];\nexport const LITERAL_TYPES = FLIPPED_ALIAS_KEYS[\"Literal\"];\nexport const IMMUTABLE_TYPES = FLIPPED_ALIAS_KEYS[\"Immutable\"];\nexport const USERWHITESPACABLE_TYPES = FLIPPED_ALIAS_KEYS[\"UserWhitespacable\"];\nexport const METHOD_TYPES = FLIPPED_ALIAS_KEYS[\"Method\"];\nexport const OBJECTMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"ObjectMember\"];\nexport const PROPERTY_TYPES = FLIPPED_ALIAS_KEYS[\"Property\"];\nexport const UNARYLIKE_TYPES = FLIPPED_ALIAS_KEYS[\"UnaryLike\"];\nexport const PATTERN_TYPES = FLIPPED_ALIAS_KEYS[\"Pattern\"];\nexport const CLASS_TYPES = FLIPPED_ALIAS_KEYS[\"Class\"];\nexport const MODULEDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleDeclaration\"];\nexport const EXPORTDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"ExportDeclaration\"];\nexport const MODULESPECIFIER_TYPES = FLIPPED_ALIAS_KEYS[\"ModuleSpecifier\"];\nexport const FLOW_TYPES = FLIPPED_ALIAS_KEYS[\"Flow\"];\nexport const FLOWTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowType\"];\nexport const FLOWBASEANNOTATION_TYPES =\n FLIPPED_ALIAS_KEYS[\"FlowBaseAnnotation\"];\nexport const FLOWDECLARATION_TYPES = FLIPPED_ALIAS_KEYS[\"FlowDeclaration\"];\nexport const FLOWPREDICATE_TYPES = FLIPPED_ALIAS_KEYS[\"FlowPredicate\"];\nexport const ENUMBODY_TYPES = FLIPPED_ALIAS_KEYS[\"EnumBody\"];\nexport const ENUMMEMBER_TYPES = FLIPPED_ALIAS_KEYS[\"EnumMember\"];\nexport const JSX_TYPES = FLIPPED_ALIAS_KEYS[\"JSX\"];\nexport const PRIVATE_TYPES = FLIPPED_ALIAS_KEYS[\"Private\"];\nexport const TSTYPEELEMENT_TYPES = FLIPPED_ALIAS_KEYS[\"TSTypeElement\"];\nexport const TSTYPE_TYPES = FLIPPED_ALIAS_KEYS[\"TSType\"];\n","// @flow\nimport {\n isBlockStatement,\n isFunction,\n isEmptyStatement,\n isStatement,\n} from \"../validators/generated\";\nimport {\n returnStatement,\n expressionStatement,\n blockStatement,\n} from \"../builders/generated\";\n\nexport default function toBlock(node: Object, parent: Object): Object {\n if (isBlockStatement(node)) {\n return node;\n }\n\n let blockNodes = [];\n\n if (isEmptyStatement(node)) {\n blockNodes = [];\n } else {\n if (!isStatement(node)) {\n if (isFunction(parent)) {\n node = returnStatement(node);\n } else {\n node = expressionStatement(node);\n }\n }\n\n blockNodes = [node];\n }\n\n return blockStatement(blockNodes);\n}\n","// @flow\nimport toBlock from \"./toBlock\";\n\n/**\n * Ensure the `key` (defaults to \"body\") of a `node` is a block.\n * Casting it to a block if it is not.\n *\n * Returns the BlockStatement\n */\nexport default function ensureBlock(\n node: Object,\n key: string = \"body\",\n): Object {\n return (node[key] = toBlock(node[key], node));\n}\n","// @flow\nimport esutils from \"esutils\";\n\n/**\n * Check if the input `name` is a valid identifier name\n * and isn't a reserved word.\n */\nexport default function isValidIdentifier(\n name: string,\n reserved: boolean = true,\n): boolean {\n if (typeof name !== \"string\") return false;\n\n if (reserved) {\n if (esutils.keyword.isReservedWordES6(name, true)) {\n return false;\n } else if (name === \"await\") {\n // invalid in module, valid in script; better be safe (see #4952)\n return false;\n }\n }\n\n return esutils.keyword.isIdentifierNameES6(name);\n}\n","// @flow\nimport isValidIdentifier from \"../validators/isValidIdentifier\";\n\nexport default function toIdentifier(name: string): string {\n name = name + \"\";\n\n // replace all non-valid identifiers with dashes\n name = name.replace(/[^a-zA-Z0-9$_]/g, \"-\");\n\n // remove all dashes and numbers from start of name\n name = name.replace(/^[-0-9]+/, \"\");\n\n // camel case\n name = name.replace(/[-\\s]+(.)?/g, function(match, c) {\n return c ? c.toUpperCase() : \"\";\n });\n\n if (!isValidIdentifier(name)) {\n name = `_${name}`;\n }\n\n return name || \"_\";\n}\n","// @flow\nimport toIdentifier from \"./toIdentifier\";\n\nexport default function toBindingIdentifierName(name: string): string {\n name = toIdentifier(name);\n if (name === \"eval\" || name === \"arguments\") name = \"_\" + name;\n\n return name;\n}\n","// @flow\nimport { isIdentifier } from \"../validators/generated\";\nimport { stringLiteral } from \"../builders/generated\";\n\nexport default function toComputedKey(\n node: Object,\n key: Object = node.key || node.property,\n): Object {\n if (!node.computed && isIdentifier(key)) key = stringLiteral(key.name);\n\n return key;\n}\n","// @flow\nimport {\n isExpression,\n isFunction,\n isClass,\n isExpressionStatement,\n} from \"../validators/generated\";\n\nexport default function toExpression(node: Object): Object {\n if (isExpressionStatement(node)) {\n node = node.expression;\n }\n\n // return unmodified node\n // important for things like ArrowFunctions where\n // type change from ArrowFunction to FunctionExpression\n // produces bugs like -> `()=>a` to `function () a`\n // without generating a BlockStatement for it\n // ref: https://github.com/babel/babili/issues/130\n if (isExpression(node)) {\n return node;\n }\n\n // convert all classes and functions\n // ClassDeclaration -> ClassExpression\n // FunctionDeclaration, ObjectMethod, ClassMethod -> FunctionExpression\n if (isClass(node)) {\n node.type = \"ClassExpression\";\n } else if (isFunction(node)) {\n node.type = \"FunctionExpression\";\n }\n\n // if it's still not an expression\n if (!isExpression(node)) {\n throw new Error(`cannot turn ${node.type} to an expression`);\n }\n\n return node;\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\n/**\n * A prefix AST traversal implementation meant for simple searching\n * and processing.\n */\nexport default function traverseFast(\n node: Object,\n enter: (node: BabelNode, opts?: Object) => void,\n opts?: Object,\n): void {\n if (!node) return;\n\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n opts = opts || {};\n enter(node, opts);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (const node of subNode) {\n traverseFast(node, enter, opts);\n }\n } else {\n traverseFast(subNode, enter, opts);\n }\n }\n}\n","// @flow\nimport { COMMENT_KEYS } from \"../constants\";\n\nconst CLEAR_KEYS = [\"tokens\", \"start\", \"end\", \"loc\", \"raw\", \"rawValue\"];\n\nconst CLEAR_KEYS_PLUS_COMMENTS = COMMENT_KEYS.concat([\"comments\"]).concat(\n CLEAR_KEYS,\n);\n\n/**\n * Remove all of the _* properties from a node along with the additional metadata\n * properties like location data and raw token data.\n */\nexport default function removeProperties(\n node: Object,\n opts?: Object = {},\n): void {\n const map = opts.preserveComments ? CLEAR_KEYS : CLEAR_KEYS_PLUS_COMMENTS;\n for (const key of map) {\n if (node[key] != null) node[key] = undefined;\n }\n\n for (const key of Object.keys(node)) {\n if (key[0] === \"_\" && node[key] != null) node[key] = undefined;\n }\n\n const symbols: Array = Object.getOwnPropertySymbols(node);\n for (const sym of symbols) {\n node[sym] = null;\n }\n}\n","// @flow\nimport traverseFast from \"../traverse/traverseFast\";\nimport removeProperties from \"./removeProperties\";\n\nexport default function removePropertiesDeep(\n tree: T,\n opts?: Object,\n): T {\n traverseFast(tree, removeProperties, opts);\n\n return tree;\n}\n","// @flow\nimport { isIdentifier, isStringLiteral } from \"../validators/generated\";\nimport cloneNode from \"../clone/cloneNode\";\nimport removePropertiesDeep from \"../modifications/removePropertiesDeep\";\n\nexport default function toKeyAlias(\n node: Object,\n key: Object = node.key,\n): string {\n let alias;\n\n if (node.kind === \"method\") {\n return toKeyAlias.increment() + \"\";\n } else if (isIdentifier(key)) {\n alias = key.name;\n } else if (isStringLiteral(key)) {\n alias = JSON.stringify(key.value);\n } else {\n alias = JSON.stringify(removePropertiesDeep(cloneNode(key)));\n }\n\n if (node.computed) {\n alias = `[${alias}]`;\n }\n\n if (node.static) {\n alias = `static:${alias}`;\n }\n\n return alias;\n}\n\ntoKeyAlias.uid = 0;\n\ntoKeyAlias.increment = function() {\n if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {\n return (toKeyAlias.uid = 0);\n } else {\n return toKeyAlias.uid++;\n }\n};\n","// @flow\nimport {\n isExportDeclaration,\n isIdentifier,\n isDeclaration,\n isFunctionDeclaration,\n isFunctionExpression,\n} from \"../validators/generated\";\n\n/**\n * Return a list of binding identifiers associated with the input `node`.\n */\nexport default function getBindingIdentifiers(\n node: Object,\n duplicates?: boolean,\n outerOnly?: boolean,\n): { [string]: Object | Array } {\n let search = [].concat(node);\n const ids = Object.create(null);\n\n while (search.length) {\n const id = search.shift();\n if (!id) continue;\n\n const keys = getBindingIdentifiers.keys[id.type];\n\n if (isIdentifier(id)) {\n if (duplicates) {\n const _ids = (ids[id.name] = ids[id.name] || []);\n _ids.push(id);\n } else {\n ids[id.name] = id;\n }\n continue;\n }\n\n if (isExportDeclaration(id)) {\n if (isDeclaration(id.declaration)) {\n search.push(id.declaration);\n }\n continue;\n }\n\n if (outerOnly) {\n if (isFunctionDeclaration(id)) {\n search.push(id.id);\n continue;\n }\n\n if (isFunctionExpression(id)) {\n continue;\n }\n }\n\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (id[key]) {\n search = search.concat(id[key]);\n }\n }\n }\n }\n\n // $FlowIssue Object.create() seems broken\n return ids;\n}\n\n/**\n * Mapping of types to their identifier keys.\n */\ngetBindingIdentifiers.keys = {\n DeclareClass: [\"id\"],\n DeclareFunction: [\"id\"],\n DeclareModule: [\"id\"],\n DeclareVariable: [\"id\"],\n DeclareInterface: [\"id\"],\n DeclareTypeAlias: [\"id\"],\n DeclareOpaqueType: [\"id\"],\n InterfaceDeclaration: [\"id\"],\n TypeAlias: [\"id\"],\n OpaqueType: [\"id\"],\n\n CatchClause: [\"param\"],\n LabeledStatement: [\"label\"],\n UnaryExpression: [\"argument\"],\n AssignmentExpression: [\"left\"],\n\n ImportSpecifier: [\"local\"],\n ImportNamespaceSpecifier: [\"local\"],\n ImportDefaultSpecifier: [\"local\"],\n ImportDeclaration: [\"specifiers\"],\n\n ExportSpecifier: [\"exported\"],\n ExportNamespaceSpecifier: [\"exported\"],\n ExportDefaultSpecifier: [\"exported\"],\n\n FunctionDeclaration: [\"id\", \"params\"],\n FunctionExpression: [\"id\", \"params\"],\n ArrowFunctionExpression: [\"params\"],\n ObjectMethod: [\"params\"],\n ClassMethod: [\"params\"],\n\n ForInStatement: [\"left\"],\n ForOfStatement: [\"left\"],\n\n ClassDeclaration: [\"id\"],\n ClassExpression: [\"id\"],\n\n RestElement: [\"argument\"],\n UpdateExpression: [\"argument\"],\n\n ObjectProperty: [\"value\"],\n\n AssignmentPattern: [\"left\"],\n ArrayPattern: [\"elements\"],\n ObjectPattern: [\"properties\"],\n\n VariableDeclaration: [\"declarations\"],\n VariableDeclarator: [\"id\"],\n};\n","// @flow\nimport type { Scope } from \"@babel/traverse\";\nimport getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\nimport {\n isExpression,\n isExpressionStatement,\n isVariableDeclaration,\n isIfStatement,\n isBlockStatement,\n isEmptyStatement,\n} from \"../validators/generated\";\nimport {\n sequenceExpression,\n assignmentExpression,\n conditionalExpression,\n} from \"../builders/generated\";\nimport cloneNode from \"../clone/cloneNode\";\n\nexport default function gatherSequenceExpressions(\n nodes: Array,\n scope: Scope,\n declars: Array,\n): ?Object {\n const exprs = [];\n let ensureLastUndefined = true;\n\n for (const node of nodes) {\n ensureLastUndefined = false;\n\n if (isExpression(node)) {\n exprs.push(node);\n } else if (isExpressionStatement(node)) {\n exprs.push(node.expression);\n } else if (isVariableDeclaration(node)) {\n if (node.kind !== \"var\") return; // bailed\n\n for (const declar of (node.declarations: Array)) {\n const bindings = getBindingIdentifiers(declar);\n for (const key of Object.keys(bindings)) {\n declars.push({\n kind: node.kind,\n id: cloneNode(bindings[key]),\n });\n }\n\n if (declar.init) {\n exprs.push(assignmentExpression(\"=\", declar.id, declar.init));\n }\n }\n\n ensureLastUndefined = true;\n } else if (isIfStatement(node)) {\n const consequent = node.consequent\n ? gatherSequenceExpressions([node.consequent], scope, declars)\n : scope.buildUndefinedNode();\n const alternate = node.alternate\n ? gatherSequenceExpressions([node.alternate], scope, declars)\n : scope.buildUndefinedNode();\n if (!consequent || !alternate) return; // bailed\n\n exprs.push(conditionalExpression(node.test, consequent, alternate));\n } else if (isBlockStatement(node)) {\n const body = gatherSequenceExpressions(node.body, scope, declars);\n if (!body) return; // bailed\n\n exprs.push(body);\n } else if (isEmptyStatement(node)) {\n // empty statement so ensure the last item is undefined if we're last\n ensureLastUndefined = true;\n } else {\n // bailed, we can't turn this statement into an expression\n return;\n }\n }\n\n if (ensureLastUndefined) {\n exprs.push(scope.buildUndefinedNode());\n }\n\n if (exprs.length === 1) {\n return exprs[0];\n } else {\n return sequenceExpression(exprs);\n }\n}\n","// @flow\nimport type { Scope } from \"@babel/traverse\";\nimport gatherSequenceExpressions from \"./gatherSequenceExpressions\";\n\n/**\n * Turn an array of statement `nodes` into a `SequenceExpression`.\n *\n * Variable declarations are turned into simple assignments and their\n * declarations hoisted to the top of the current scope.\n *\n * Expression statements are just resolved to their expression.\n */\nexport default function toSequenceExpression(\n nodes: Array,\n scope: Scope,\n): ?Object {\n if (!nodes || !nodes.length) return;\n\n const declars = [];\n const result = gatherSequenceExpressions(nodes, scope, declars);\n if (!result) return;\n\n for (const declar of declars) {\n scope.push(declar);\n }\n\n return result;\n}\n","// @flow\nimport {\n isStatement,\n isFunction,\n isClass,\n isAssignmentExpression,\n} from \"../validators/generated\";\nimport { expressionStatement } from \"../builders/generated\";\n\nexport default function toStatement(node: Object, ignore?: boolean) {\n if (isStatement(node)) {\n return node;\n }\n\n let mustHaveId = false;\n let newType;\n\n if (isClass(node)) {\n mustHaveId = true;\n newType = \"ClassDeclaration\";\n } else if (isFunction(node)) {\n mustHaveId = true;\n newType = \"FunctionDeclaration\";\n } else if (isAssignmentExpression(node)) {\n return expressionStatement(node);\n }\n\n if (mustHaveId && !node.id) {\n newType = false;\n }\n\n if (!newType) {\n if (ignore) {\n return false;\n } else {\n throw new Error(`cannot turn ${node.type} to a statement`);\n }\n }\n\n node.type = newType;\n\n return node;\n}\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar regexpTag = '[object RegExp]';\n\n/**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\nfunction baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n}\n\nmodule.exports = baseIsRegExp;\n","var baseIsRegExp = require('./_baseIsRegExp'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;\n\n/**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\nvar isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\nmodule.exports = isRegExp;\n","// @flow\nimport isPlainObject from \"lodash/isPlainObject\";\nimport isRegExp from \"lodash/isRegExp\";\nimport isValidIdentifier from \"../validators/isValidIdentifier\";\nimport {\n identifier,\n booleanLiteral,\n nullLiteral,\n stringLiteral,\n numericLiteral,\n regExpLiteral,\n arrayExpression,\n objectProperty,\n objectExpression,\n unaryExpression,\n binaryExpression,\n} from \"../builders/generated\";\n\nexport default function valueToNode(value: any): Object {\n // undefined\n if (value === undefined) {\n return identifier(\"undefined\");\n }\n\n // boolean\n if (value === true || value === false) {\n return booleanLiteral(value);\n }\n\n // null\n if (value === null) {\n return nullLiteral();\n }\n\n // strings\n if (typeof value === \"string\") {\n return stringLiteral(value);\n }\n\n // numbers\n if (typeof value === \"number\") {\n let result;\n if (Number.isFinite(value)) {\n result = numericLiteral(Math.abs(value));\n } else {\n let numerator;\n if (Number.isNaN(value)) {\n // NaN\n numerator = numericLiteral(0);\n } else {\n // Infinity / -Infinity\n numerator = numericLiteral(1);\n }\n\n result = binaryExpression(\"/\", numerator, numericLiteral(0));\n }\n\n if (value < 0 || Object.is(value, -0)) {\n result = unaryExpression(\"-\", result);\n }\n\n return result;\n }\n\n // regexes\n if (isRegExp(value)) {\n const pattern = value.source;\n const flags = value.toString().match(/\\/([a-z]+|)$/)[1];\n return regExpLiteral(pattern, flags);\n }\n\n // array\n if (Array.isArray(value)) {\n return arrayExpression(value.map(valueToNode));\n }\n\n // object\n if (isPlainObject(value)) {\n const props = [];\n for (const key of Object.keys(value)) {\n let nodeKey;\n if (isValidIdentifier(key)) {\n nodeKey = identifier(key);\n } else {\n nodeKey = stringLiteral(key);\n }\n props.push(objectProperty(nodeKey, valueToNode(value[key])));\n }\n return objectExpression(props);\n }\n\n throw new Error(\"don't know how to turn this value into a node\");\n}\n","// @flow\nimport { memberExpression } from \"../builders/generated\";\n\n/**\n * Append a node to a member expression.\n */\nexport default function appendToMemberExpression(\n member: T,\n append: Object,\n computed?: boolean = false,\n): T {\n member.object = memberExpression(\n member.object,\n member.property,\n member.computed,\n );\n member.property = append;\n member.computed = !!computed;\n\n return member;\n}\n","// @flow\nimport { INHERIT_KEYS } from \"../constants\";\nimport inheritsComments from \"../comments/inheritsComments\";\n\n/**\n * Inherit all contextual properties from `parent` node to `child` node.\n */\nexport default function inherits(child: T, parent: Object): T {\n if (!child || !parent) return child;\n\n // optionally inherit specific properties if not null\n for (const key of (INHERIT_KEYS.optional: Array)) {\n if (child[key] == null) {\n child[key] = parent[key];\n }\n }\n\n // force inherit \"private\" properties\n for (const key of Object.keys(parent)) {\n if (key[0] === \"_\" && key !== \"__clone\") child[key] = parent[key];\n }\n\n // force inherit select properties\n for (const key of (INHERIT_KEYS.force: Array)) {\n child[key] = parent[key];\n }\n\n inheritsComments(child, parent);\n\n return child;\n}\n","// @flow\nimport { memberExpression } from \"../builders/generated\";\n\n/**\n * Prepend a node to a member expression.\n */\nexport default function prependToMemberExpression(\n member: T,\n prepend: Object,\n): T {\n member.object = memberExpression(prepend, member.object);\n\n return member;\n}\n","// @flow\nimport getBindingIdentifiers from \"./getBindingIdentifiers\";\n\nexport default function getOuterBindingIdentifiers(\n node: Object,\n duplicates?: boolean,\n): { [string]: Object | Array } {\n return getBindingIdentifiers(node, duplicates, true);\n}\n","// @flow\nimport { VISITOR_KEYS } from \"../definitions\";\n\nexport type TraversalAncestors = Array<{\n node: BabelNode,\n key: string,\n index?: number,\n}>;\nexport type TraversalHandler = (BabelNode, TraversalAncestors, T) => void;\nexport type TraversalHandlers = {\n enter?: TraversalHandler,\n exit?: TraversalHandler,\n};\n\n/**\n * A general AST traversal with both prefix and postfix handlers, and a\n * state object. Exposes ancestry data to each handler so that more complex\n * AST data can be taken into account.\n */\nexport default function traverse(\n node: BabelNode,\n handlers: TraversalHandler | TraversalHandlers,\n state?: T,\n): void {\n if (typeof handlers === \"function\") {\n handlers = { enter: handlers };\n }\n\n const { enter, exit } = (handlers: TraversalHandlers);\n\n traverseSimpleImpl(node, enter, exit, state, []);\n}\n\nfunction traverseSimpleImpl(\n node: Object,\n enter: ?Function,\n exit: ?Function,\n state: ?T,\n ancestors: TraversalAncestors,\n) {\n const keys = VISITOR_KEYS[node.type];\n if (!keys) return;\n\n if (enter) enter(node, ancestors, state);\n\n for (const key of keys) {\n const subNode = node[key];\n\n if (Array.isArray(subNode)) {\n for (let i = 0; i < subNode.length; i++) {\n const child = subNode[i];\n if (!child) continue;\n\n ancestors.push({\n node,\n key,\n index: i,\n });\n\n traverseSimpleImpl(child, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n } else if (subNode) {\n ancestors.push({\n node,\n key,\n });\n\n traverseSimpleImpl(subNode, enter, exit, state, ancestors);\n\n ancestors.pop();\n }\n }\n\n if (exit) exit(node, ancestors, state);\n}\n","// @flow\nimport getBindingIdentifiers from \"../retrievers/getBindingIdentifiers\";\n/**\n * Check if the input `node` is a binding identifier.\n */\nexport default function isBinding(\n node: Object,\n parent: Object,\n grandparent?: Object,\n): boolean {\n if (\n grandparent &&\n node.type === \"Identifier\" &&\n parent.type === \"ObjectProperty\" &&\n grandparent.type === \"ObjectExpression\"\n ) {\n // We need to special-case this, because getBindingIdentifiers\n // has an ObjectProperty->value entry for destructuring patterns.\n return false;\n }\n\n const keys = getBindingIdentifiers.keys[parent.type];\n if (keys) {\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const val = parent[key];\n if (Array.isArray(val)) {\n if (val.indexOf(node) >= 0) return true;\n } else {\n if (val === node) return true;\n }\n }\n }\n\n return false;\n}\n","// @flow\nimport { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\n\n/**\n * Check if the input `node` is a `let` variable declaration.\n */\nexport default function isLet(node: Object): boolean {\n return (\n isVariableDeclaration(node) &&\n (node.kind !== \"var\" || node[BLOCK_SCOPED_SYMBOL])\n );\n}\n","// @flow\nimport { isClassDeclaration, isFunctionDeclaration } from \"./generated\";\nimport isLet from \"./isLet\";\n\n/**\n * Check if the input `node` is block scoped.\n */\nexport default function isBlockScoped(node: Object): boolean {\n return isFunctionDeclaration(node) || isClassDeclaration(node) || isLet(node);\n}\n","// @flow\nimport isType from \"./isType\";\nimport { isIdentifier } from \"./generated\";\n\n/**\n * Check if the input `node` is definitely immutable.\n */\nexport default function isImmutable(node: Object): boolean {\n if (isType(node.type, \"Immutable\")) return true;\n\n if (isIdentifier(node)) {\n if (node.name === \"undefined\") {\n // immutable!\n return true;\n } else {\n // no idea...\n return false;\n }\n }\n\n return false;\n}\n","// @flow\nimport { NODE_FIELDS, VISITOR_KEYS } from \"../definitions\";\n\n/**\n * Check if two nodes are equivalent\n */\nexport default function isNodesEquivalent(a: any, b: any): boolean {\n if (\n typeof a !== \"object\" ||\n typeof b !== \"object\" ||\n a == null ||\n b == null\n ) {\n return a === b;\n }\n\n if (a.type !== b.type) {\n return false;\n }\n\n const fields = Object.keys(NODE_FIELDS[a.type] || a.type);\n const visitorKeys = VISITOR_KEYS[a.type];\n\n for (const field of fields) {\n if (typeof a[field] !== typeof b[field]) {\n return false;\n }\n if (a[field] == null && b[field] == null) {\n continue;\n } else if (a[field] == null || b[field] == null) {\n return false;\n }\n\n if (Array.isArray(a[field])) {\n if (!Array.isArray(b[field])) {\n return false;\n }\n if (a[field].length !== b[field].length) {\n return false;\n }\n\n for (let i = 0; i < a[field].length; i++) {\n if (!isNodesEquivalent(a[field][i], b[field][i])) {\n return false;\n }\n }\n continue;\n }\n\n if (\n typeof a[field] === \"object\" &&\n (!visitorKeys || !visitorKeys.includes(field))\n ) {\n for (const key of Object.keys(a[field])) {\n if (a[field][key] !== b[field][key]) {\n return false;\n }\n }\n continue;\n }\n\n if (!isNodesEquivalent(a[field], b[field])) {\n return false;\n }\n }\n\n return true;\n}\n","// @flow\n/**\n * Check if the input `node` is a reference to a bound variable.\n */\nexport default function isReferenced(\n node: Object,\n parent: Object,\n grandparent?: Object,\n): boolean {\n switch (parent.type) {\n // yes: PARENT[NODE]\n // yes: NODE.child\n // no: parent.NODE\n case \"MemberExpression\":\n case \"JSXMemberExpression\":\n case \"OptionalMemberExpression\":\n if (parent.property === node) {\n return !!parent.computed;\n }\n return parent.object === node;\n\n // no: let NODE = init;\n // yes: let id = NODE;\n case \"VariableDeclarator\":\n return parent.init === node;\n\n // yes: () => NODE\n // no: (NODE) => {}\n case \"ArrowFunctionExpression\":\n return parent.body === node;\n\n // no: export { foo as NODE };\n // yes: export { NODE as foo };\n // no: export { NODE as foo } from \"foo\";\n case \"ExportSpecifier\":\n if (parent.source) {\n return false;\n }\n return parent.local === node;\n\n // no: class { #NODE; }\n // no: class { get #NODE() {} }\n // no: class { #NODE() {} }\n // no: class { fn() { return this.#NODE; } }\n case \"PrivateName\":\n return false;\n\n // yes: { [NODE]: \"\" }\n // no: { NODE: \"\" }\n // depends: { NODE }\n // depends: { key: NODE }\n case \"ObjectProperty\":\n // no: class { NODE = value; }\n // yes: class { [NODE] = value; }\n // yes: class { key = NODE; }\n case \"ClassProperty\":\n case \"ClassPrivateProperty\":\n // no: class { NODE() {} }\n // yes: class { [NODE]() {} }\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n case \"ObjectMethod\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n if (parent.value === node) {\n return !grandparent || grandparent.type !== \"ObjectPattern\";\n }\n return true;\n\n // no: class NODE {}\n // yes: class Foo extends NODE {}\n case \"ClassDeclaration\":\n case \"ClassExpression\":\n return parent.superClass === node;\n\n // yes: left = NODE;\n // no: NODE = right;\n case \"AssignmentExpression\":\n return parent.right === node;\n\n // no: [NODE = foo] = [];\n // yes: [foo = NODE] = [];\n case \"AssignmentPattern\":\n return parent.right === node;\n\n // no: NODE: for (;;) {}\n case \"LabeledStatement\":\n return false;\n\n // no: try {} catch (NODE) {}\n case \"CatchClause\":\n return false;\n\n // no: function foo(...NODE) {}\n case \"RestElement\":\n return false;\n\n case \"BreakStatement\":\n case \"ContinueStatement\":\n return false;\n\n // no: function NODE() {}\n // no: function foo(NODE) {}\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n return false;\n\n // no: export NODE from \"foo\";\n // no: export * as NODE from \"foo\";\n case \"ExportNamespaceSpecifier\":\n case \"ExportDefaultSpecifier\":\n return false;\n\n // no: import NODE from \"foo\";\n // no: import * as NODE from \"foo\";\n // no: import { NODE as foo } from \"foo\";\n // no: import { foo as NODE } from \"foo\";\n // no: import NODE from \"bar\";\n case \"ImportDefaultSpecifier\":\n case \"ImportNamespaceSpecifier\":\n case \"ImportSpecifier\":\n return false;\n\n // no:
\n case \"JSXAttribute\":\n return false;\n\n // no: [NODE] = [];\n // no: ({ NODE }) = [];\n case \"ObjectPattern\":\n case \"ArrayPattern\":\n return false;\n\n // no: new.NODE\n // no: NODE.target\n case \"MetaProperty\":\n return false;\n\n // yes: type X = { somePropert: NODE }\n // no: type X = { NODE: OtherType }\n case \"ObjectTypeProperty\":\n return parent.key !== node;\n\n // yes: enum X { Foo = NODE }\n // no: enum X { NODE }\n case \"TSEnumMember\":\n return parent.id !== node;\n\n // yes: { [NODE]: value }\n // no: { NODE: value }\n case \"TSPropertySignature\":\n if (parent.key === node) {\n return !!parent.computed;\n }\n\n return true;\n }\n\n return true;\n}\n","// @flow\nimport {\n isFunction,\n isCatchClause,\n isBlockStatement,\n isScopable,\n isPattern,\n} from \"./generated\";\n\n/**\n * Check if the input `node` is a scope.\n */\nexport default function isScope(node: Object, parent: Object): boolean {\n if (isBlockStatement(node) && isFunction(parent, { body: node })) {\n return false;\n }\n\n if (isBlockStatement(node) && isCatchClause(parent, { body: node })) {\n return false;\n }\n\n // If a Pattern is an immediate descendent of a Function, it must be in the params.\n // Hence we skipped the parentKey === \"params\" check\n if (isPattern(node) && isFunction(parent)) {\n return true;\n }\n\n return isScopable(node);\n}\n","// @flow\nimport { isIdentifier, isImportDefaultSpecifier } from \"./generated\";\n\n/**\n * Check if the input `specifier` is a `default` import or export.\n */\nexport default function isSpecifierDefault(specifier: Object): boolean {\n return (\n isImportDefaultSpecifier(specifier) ||\n isIdentifier(specifier.imported || specifier.exported, {\n name: \"default\",\n })\n );\n}\n","// @flow\nimport isValidIdentifier from \"./isValidIdentifier\";\n\nconst RESERVED_WORDS_ES3_ONLY: Set = new Set([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"double\",\n \"enum\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\",\n]);\n\n/**\n * Check if the input `name` is a valid identifier name according to the ES3 specification.\n *\n * Additional ES3 reserved words are\n */\nexport default function isValidES3Identifier(name: string): boolean {\n return isValidIdentifier(name) && !RESERVED_WORDS_ES3_ONLY.has(name);\n}\n","// @flow\nimport { isVariableDeclaration } from \"./generated\";\nimport { BLOCK_SCOPED_SYMBOL } from \"../constants\";\n\n/**\n * Check if the input `node` is a variable declaration.\n */\nexport default function isVar(node: Object): boolean {\n return (\n isVariableDeclaration(node, { kind: \"var\" }) && !node[BLOCK_SCOPED_SYMBOL]\n );\n}\n","// @flow\nimport isReactComponent from \"./validators/react/isReactComponent\";\nimport isCompatTag from \"./validators/react/isCompatTag\";\nimport buildChildren from \"./builders/react/buildChildren\";\n\n// asserts\nexport { default as assertNode } from \"./asserts/assertNode\";\nexport * from \"./asserts/generated\";\n\n// builders\nexport { default as createTypeAnnotationBasedOnTypeof } from \"./builders/flow/createTypeAnnotationBasedOnTypeof\";\nexport { default as createUnionTypeAnnotation } from \"./builders/flow/createUnionTypeAnnotation\";\nexport * from \"./builders/generated\";\n\n// clone\nexport { default as cloneNode } from \"./clone/cloneNode\";\nexport { default as clone } from \"./clone/clone\";\nexport { default as cloneDeep } from \"./clone/cloneDeep\";\nexport { default as cloneWithoutLoc } from \"./clone/cloneWithoutLoc\";\n\n// comments\nexport { default as addComment } from \"./comments/addComment\";\nexport { default as addComments } from \"./comments/addComments\";\nexport { default as inheritInnerComments } from \"./comments/inheritInnerComments\";\nexport { default as inheritLeadingComments } from \"./comments/inheritLeadingComments\";\nexport { default as inheritsComments } from \"./comments/inheritsComments\";\nexport { default as inheritTrailingComments } from \"./comments/inheritTrailingComments\";\nexport { default as removeComments } from \"./comments/removeComments\";\n\n// constants\nexport * from \"./constants/generated\";\nexport * from \"./constants\";\n\n// converters\nexport { default as ensureBlock } from \"./converters/ensureBlock\";\nexport { default as toBindingIdentifierName } from \"./converters/toBindingIdentifierName\";\nexport { default as toBlock } from \"./converters/toBlock\";\nexport { default as toComputedKey } from \"./converters/toComputedKey\";\nexport { default as toExpression } from \"./converters/toExpression\";\nexport { default as toIdentifier } from \"./converters/toIdentifier\";\nexport { default as toKeyAlias } from \"./converters/toKeyAlias\";\nexport { default as toSequenceExpression } from \"./converters/toSequenceExpression\";\nexport { default as toStatement } from \"./converters/toStatement\";\nexport { default as valueToNode } from \"./converters/valueToNode\";\n\n// definitions\nexport * from \"./definitions\";\n\n// modifications\nexport { default as appendToMemberExpression } from \"./modifications/appendToMemberExpression\";\nexport { default as inherits } from \"./modifications/inherits\";\nexport { default as prependToMemberExpression } from \"./modifications/prependToMemberExpression\";\nexport { default as removeProperties } from \"./modifications/removeProperties\";\nexport { default as removePropertiesDeep } from \"./modifications/removePropertiesDeep\";\nexport { default as removeTypeDuplicates } from \"./modifications/flow/removeTypeDuplicates\";\n\n// retrievers\nexport { default as getBindingIdentifiers } from \"./retrievers/getBindingIdentifiers\";\nexport { default as getOuterBindingIdentifiers } from \"./retrievers/getOuterBindingIdentifiers\";\n\n// traverse\nexport { default as traverse } from \"./traverse/traverse\";\nexport type * from \"./traverse/traverse\";\nexport { default as traverseFast } from \"./traverse/traverseFast\";\n\n// utils\nexport { default as shallowEqual } from \"./utils/shallowEqual\";\n\n// validators\nexport { default as is } from \"./validators/is\";\nexport { default as isBinding } from \"./validators/isBinding\";\nexport { default as isBlockScoped } from \"./validators/isBlockScoped\";\nexport { default as isImmutable } from \"./validators/isImmutable\";\nexport { default as isLet } from \"./validators/isLet\";\nexport { default as isNode } from \"./validators/isNode\";\nexport { default as isNodesEquivalent } from \"./validators/isNodesEquivalent\";\nexport { default as isPlaceholderType } from \"./validators/isPlaceholderType\";\nexport { default as isReferenced } from \"./validators/isReferenced\";\nexport { default as isScope } from \"./validators/isScope\";\nexport { default as isSpecifierDefault } from \"./validators/isSpecifierDefault\";\nexport { default as isType } from \"./validators/isType\";\nexport { default as isValidES3Identifier } from \"./validators/isValidES3Identifier\";\nexport { default as isValidIdentifier } from \"./validators/isValidIdentifier\";\nexport { default as isVar } from \"./validators/isVar\";\nexport { default as matchesPattern } from \"./validators/matchesPattern\";\nexport { default as validate } from \"./validators/validate\";\nexport { default as buildMatchMemberExpression } from \"./validators/buildMatchMemberExpression\";\nexport * from \"./validators/generated\";\n\n// react\nexport const react = {\n isReactComponent,\n isCompatTag,\n buildChildren,\n};\n","\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\nvar inited = false;\nfunction init () {\n inited = true;\n var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n for (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n }\n\n revLookup['-'.charCodeAt(0)] = 62\n revLookup['_'.charCodeAt(0)] = 63\n}\n\nexport function toByteArray (b64) {\n if (!inited) {\n init();\n }\n var i, j, l, tmp, placeHolders, arr\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // the number of equal signs (place holders)\n // if there are two placeholders, than the two characters before it\n // represent one byte\n // if there is only one, then the three characters before it represent 2 bytes\n // this is just a cheap hack to not do indexOf twice\n placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n\n // base64 is 4/3 + up to two characters of the original data\n arr = new Arr(len * 3 / 4 - placeHolders)\n\n // if there are placeholders, only get up to the last complete 4 chars\n l = placeHolders > 0 ? len - 4 : len\n\n var L = 0\n\n for (i = 0, j = 0; i < l; i += 4, j += 3) {\n tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n arr[L++] = (tmp >> 16) & 0xFF\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n if (placeHolders === 2) {\n tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[L++] = tmp & 0xFF\n } else if (placeHolders === 1) {\n tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[L++] = (tmp >> 8) & 0xFF\n arr[L++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nexport function fromByteArray (uint8) {\n if (!inited) {\n init();\n }\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var output = ''\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n output += lookup[tmp >> 2]\n output += lookup[(tmp << 4) & 0x3F]\n output += '=='\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n output += lookup[tmp >> 10]\n output += lookup[(tmp >> 4) & 0x3F]\n output += lookup[(tmp << 2) & 0x3F]\n output += '='\n }\n\n parts.push(output)\n\n return parts.join('')\n}\n","\nexport function read (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexport function write (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = nBytes * 8 - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nexport default Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\nimport * as base64 from './base64'\nimport * as ieee754 from './ieee754'\nimport isArray from './isArray'\n\nexport var INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : true\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nvar _kMaxLength = kMaxLength()\nexport {_kMaxLength as kMaxLength};\nfunction typedArraySupport () {\n return true;\n // rollup issues\n // try {\n // var arr = new Uint8Array(1)\n // arr.__proto__ = {\n // __proto__: Uint8Array.prototype,\n // foo: function () { return 42 }\n // }\n // return arr.foo() === 42 && // typed array instances can be augmented\n // typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n // arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n // } catch (e) {\n // return false\n // }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nexport function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n // Object.defineProperty(Buffer, Symbol.species, {\n // value: null,\n // configurable: true\n // })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (internalIsBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nexport function SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\nBuffer.isBuffer = isBuffer;\nfunction internalIsBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!internalIsBuffer(a) || !internalIsBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!internalIsBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (internalIsBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!internalIsBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (internalIsBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!internalIsBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = internalIsBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n\n\n// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nexport function isBuffer(obj) {\n return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))\n}\n\nfunction isFastBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))\n}\n","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n _statements = [];\n _resultName = null;\n\n _scope = null;\n _hub = null;\n\n constructor(importedSource, scope, hub) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n t.importDeclaration([], t.stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n name = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importNamespaceSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n default(name) {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importDefaultSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n named(name, importName) {\n if (importName === \"default\") return this.default(name);\n\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importSpecifier(name, t.identifier(importName))];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n var(name) {\n name = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = t.expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = t.variableDeclaration(\n \"var\",\n [t.variableDeclarator(name, statement.expression)],\n );\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.memberExpression(\n statement.expression,\n t.identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.memberExpression(\n statement.declarations[0].init,\n t.identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name) {\n this._resultName = t.memberExpression(this._resultName, t.identifier(name));\n }\n}\n","/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n const { sourceType } = path.node;\n if (sourceType !== \"module\" && sourceType !== \"script\") {\n throw path.buildCodeFrameError(\n `Unknown sourceType \"${sourceType}\", cannot transform.`,\n );\n }\n\n return path.node.sourceType === \"module\";\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\nimport ImportBuilder from \"./import-builder\";\nimport isModule from \"./is-module\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null,\n\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\",\n\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\",\n\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\",\n\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean,\n\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean,\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n _programScope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n _hub;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n };\n\n constructor(path, importedSource, opts) {\n const programPath = path.find(p => p.isProgram());\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn, opts) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(importName, importedSourceIn, opts) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n false,\n );\n }\n\n _applyDefaults(importedSource, opts, isInit = false) {\n const optsList = [];\n if (typeof importedSource === \"string\") {\n optsList.push({ importedSource });\n optsList.push(opts);\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n\n optsList.push(importedSource);\n }\n\n const newOpts = {\n ...this._defaultOpts,\n };\n for (const opts of optsList) {\n if (!opts) continue;\n Object.keys(newOpts).forEach(key => {\n if (opts[key] !== undefined) newOpts[key] = opts[key];\n });\n\n if (!isInit) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n }\n return newOpts;\n }\n\n _generateImport(opts, importName) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder\n .var(name)\n .defaultInterop()\n .prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return t.sequenceExpression([t.numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(statements, blockHoist = 3) {\n statements.forEach(node => {\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n } else {\n this._programPath.unshiftContainer(\"body\", statements);\n }\n }\n}\n","import ImportInjector from \"./import-injector\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module\";\n\nexport function addDefault(path, importedSource, opts) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nexport function addNamed(path, name, importedSource, opts) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\n\nexport function addNamespace(path, importedSource, opts) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(path, importedSource, opts) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n","// @flow\n\nimport * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { addSideEffect } from \"@babel/helper-module-imports\";\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);\n\nexport function getType(target: any): string {\n return Object.prototype.toString\n .call(target)\n .slice(8, -1)\n .toLowerCase();\n}\n\nexport function intersection(\n first: Set,\n second: Set,\n third: Set,\n): Set {\n const result = new Set();\n for (const el of first) {\n if (second.has(el) && third.has(el)) result.add(el);\n }\n return result;\n}\n\nexport function filterStageFromList(\n list: { [feature: string]: Targets },\n stageList: { [feature: string]: boolean },\n) {\n return Object.keys(list).reduce((result, item) => {\n if (!stageList[item]) {\n result[item] = list[item];\n }\n\n return result;\n }, {});\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n const isRequire =\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0]);\n if (isRequire) return expression.arguments[0].value;\n}\n\nexport function isPolyfillSource(source: ?string): boolean {\n return source === \"@babel/polyfill\" || source === \"core-js\";\n}\n\nconst modulePathMap = {\n \"regenerator-runtime\": \"regenerator-runtime/runtime\",\n};\n\nexport function getModulePath(mod: string): string {\n return modulePathMap[mod] || `core-js/modules/${mod}`;\n}\n\nexport function createImport(path: NodePath, mod: string) {\n return addSideEffect(path, getModulePath(mod));\n}\n\nexport function isNamespaced(path: NodePath) {\n if (!path.node) return false;\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the \\`import '@babel/polyfill'\\` call or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nexport default function(\n { types: t }: { types: Object },\n { include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const addAndRemovePolyfillImports = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n // Symbol()\n // new Promise\n ReferencedIdentifier({ node: { name }, parent, scope }: NodePath) {\n if (t.isMemberExpression(parent)) return;\n if (!has(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n\n // arr[Symbol.iterator]()\n CallExpression(path: NodePath) {\n // we can't compile this\n if (path.node.arguments.length) return;\n\n const callee = path.node.callee;\n\n if (!t.isMemberExpression(callee)) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // Symbol.iterator in arr\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n this.addImport(\"web.dom.iterable\");\n }\n },\n\n // Array.from\n MemberExpression: {\n enter(path: NodePath) {\n const { node } = path;\n const { object, property } = node;\n\n // ignore namespace\n if (isNamespaced(path.get(\"object\"))) return;\n\n let evaluatedPropType = object.name;\n let propertyName = \"\";\n let instanceType = \"\";\n\n if (node.computed) {\n if (t.isStringLiteral(property)) {\n propertyName = property.value;\n } else {\n const result = path.get(\"property\").evaluate();\n if (result.confident && result.value) {\n propertyName = result.value;\n }\n }\n } else {\n propertyName = property.name;\n }\n\n if (path.scope.getBindingIdentifier(object.name)) {\n const result = path.get(\"object\").evaluate();\n if (result.value) {\n instanceType = getType(result.value);\n } else if (result.deopt && result.deopt.isIdentifier()) {\n evaluatedPropType = result.deopt.node.name;\n }\n }\n\n if (has(StaticProperties, evaluatedPropType)) {\n const BuiltInProperties = StaticProperties[evaluatedPropType];\n if (has(BuiltInProperties, propertyName)) {\n const StaticPropertyDependencies = BuiltInProperties[propertyName];\n this.addUnsupported(StaticPropertyDependencies);\n }\n }\n\n if (has(InstanceProperties, propertyName)) {\n let InstancePropertyDependencies = InstanceProperties[propertyName];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n module => module.includes(instanceType),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n }\n },\n\n // Symbol.match\n exit(path: NodePath) {\n const { name } = path.node.object;\n\n if (!has(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n },\n\n // var { repeat, startsWith } = String\n VariableDeclarator(path: NodePath) {\n const { node } = path;\n const { id, init } = node;\n\n if (!t.isObjectPattern(id)) return;\n\n // doesn't reference the global\n if (init && path.scope.getBindingIdentifier(init.name)) return;\n\n for (const { key } of id.properties) {\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n has(InstanceProperties, key.name)\n ) {\n const InstancePropertyDependencies = InstanceProperties[key.name];\n this.addUnsupported(InstancePropertyDependencies);\n }\n }\n },\n };\n\n return {\n name: \"corejs2-usage\",\n pre({ path }: { path: NodePath }) {\n this.polyfillsSet = new Set();\n\n this.addImport = function(builtIn) {\n if (!this.polyfillsSet.has(builtIn)) {\n this.polyfillsSet.add(builtIn);\n createImport(path, builtIn);\n }\n };\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n if (polyfills.has(module)) {\n this.addImport(module);\n }\n }\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.polyfillsSet,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nexport default ([\"esnext.global-this\", \"esnext.string.match-all\"]: string[]);\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parse = (version, options) => {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","'use strict';\nconst cmp = require('semver/functions/cmp');\nconst semver = require('semver/functions/coerce');\n\nconst has = Function.call.bind({}.hasOwnProperty);\n\nfunction compare(a, operator, b) {\n return cmp(semver(a), operator, semver(b));\n}\n\nfunction intersection(list, order) {\n const set = list instanceof Set ? list : new Set(list);\n return order.filter(name => set.has(name));\n}\n\nfunction sortObjectByKey(object, fn) {\n return Object.keys(object).sort(fn).reduce((memo, key) => {\n memo[key] = object[key];\n return memo;\n }, {});\n}\n\nmodule.exports = {\n compare,\n has,\n intersection,\n semver,\n sortObjectByKey,\n};\n","'use strict';\nconst { compare, intersection, semver } = require('./helpers');\nconst modulesByVersions = require('./modules-by-versions');\nconst modules = require('./modules');\n\nmodule.exports = function (raw) {\n const corejs = semver(raw);\n if (corejs.major !== 3) {\n throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');\n }\n const result = [];\n for (const version of Object.keys(modulesByVersions)) {\n if (compare(version, '<=', corejs)) {\n result.push(...modulesByVersions[version]);\n }\n }\n return intersection(result, modules);\n};\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es.array.iterator\",\n \"web.dom-collections.iterator\",\n];\n\nexport const CommonIterators = [\"es.string.iterator\", ...ArrayNatureIterators];\n\nconst ArrayNatureIteratorsWithTag = [\n \"es.object.to-string\",\n ...ArrayNatureIterators,\n];\n\nconst CommonIteratorsWithTag = [\"es.object.to-string\", ...CommonIterators];\n\nconst TypedArrayDependencies = [\n \"es.typed-array.copy-within\",\n \"es.typed-array.every\",\n \"es.typed-array.fill\",\n \"es.typed-array.filter\",\n \"es.typed-array.find\",\n \"es.typed-array.find-index\",\n \"es.typed-array.for-each\",\n \"es.typed-array.includes\",\n \"es.typed-array.index-of\",\n \"es.typed-array.iterator\",\n \"es.typed-array.join\",\n \"es.typed-array.last-index-of\",\n \"es.typed-array.map\",\n \"es.typed-array.reduce\",\n \"es.typed-array.reduce-right\",\n \"es.typed-array.reverse\",\n \"es.typed-array.set\",\n \"es.typed-array.slice\",\n \"es.typed-array.some\",\n \"es.typed-array.sort\",\n \"es.typed-array.subarray\",\n \"es.typed-array.to-locale-string\",\n \"es.typed-array.to-string\",\n \"es.object.to-string\",\n \"es.array.iterator\",\n \"es.array-buffer.slice\",\n];\n\nconst TypedArrayStaticMethods = {\n from: \"es.typed-array.from\",\n of: \"es.typed-array.of\",\n};\n\nexport const PromiseDependencies = [\"es.promise\", \"es.object.to-string\"];\n\nconst PromiseDependenciesWithIterators = [\n ...PromiseDependencies,\n ...CommonIterators,\n];\n\nconst SymbolDependencies = [\n \"es.symbol\",\n \"es.symbol.description\",\n \"es.object.to-string\",\n];\n\nconst MapDependencies = [\n \"es.map\",\n \"esnext.map.delete-all\",\n \"esnext.map.every\",\n \"esnext.map.filter\",\n \"esnext.map.find\",\n \"esnext.map.find-key\",\n \"esnext.map.includes\",\n \"esnext.map.key-of\",\n \"esnext.map.map-keys\",\n \"esnext.map.map-values\",\n \"esnext.map.merge\",\n \"esnext.map.reduce\",\n \"esnext.map.some\",\n \"esnext.map.update\",\n ...CommonIteratorsWithTag,\n];\n\nconst SetDependencies = [\n \"es.set\",\n \"esnext.set.add-all\",\n \"esnext.set.delete-all\",\n \"esnext.set.difference\",\n \"esnext.set.every\",\n \"esnext.set.filter\",\n \"esnext.set.find\",\n \"esnext.set.intersection\",\n \"esnext.set.is-disjoint-from\",\n \"esnext.set.is-subset-of\",\n \"esnext.set.is-superset-of\",\n \"esnext.set.join\",\n \"esnext.set.map\",\n \"esnext.set.reduce\",\n \"esnext.set.some\",\n \"esnext.set.symmetric-difference\",\n \"esnext.set.union\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakMapDependencies = [\n \"es.weak-map\",\n \"esnext.weak-map.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakSetDependencies = [\n \"es.weak-set\",\n \"esnext.weak-set.add-all\",\n \"esnext.weak-set.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst URLSearchParamsDependencies = [\"web.url\", ...CommonIteratorsWithTag];\n\nexport const BuiltIns: ObjectMap = {\n AggregateError: [\"esnext.aggregate-error\", ...CommonIterators],\n ArrayBuffer: [\n \"es.array-buffer.constructor\",\n \"es.array-buffer.slice\",\n \"es.object.to-string\",\n ],\n DataView: [\"es.data-view\", \"es.array-buffer.slice\", \"es.object.to-string\"],\n Date: [\"es.date.to-string\"],\n Float32Array: [\"es.typed-array.float32-array\", ...TypedArrayDependencies],\n Float64Array: [\"es.typed-array.float64-array\", ...TypedArrayDependencies],\n Int8Array: [\"es.typed-array.int8-array\", ...TypedArrayDependencies],\n Int16Array: [\"es.typed-array.int16-array\", ...TypedArrayDependencies],\n Int32Array: [\"es.typed-array.int32-array\", ...TypedArrayDependencies],\n Uint8Array: [\"es.typed-array.uint8-array\", ...TypedArrayDependencies],\n Uint8ClampedArray: [\n \"es.typed-array.uint8-clamped-array\",\n ...TypedArrayDependencies,\n ],\n Uint16Array: [\"es.typed-array.uint16-array\", ...TypedArrayDependencies],\n Uint32Array: [\"es.typed-array.uint32-array\", ...TypedArrayDependencies],\n Map: MapDependencies,\n Number: [\"es.number.constructor\"],\n Observable: [\n \"esnext.observable\",\n \"esnext.symbol.observable\",\n \"es.object.to-string\",\n ...CommonIteratorsWithTag,\n ],\n Promise: PromiseDependencies,\n RegExp: [\"es.regexp.constructor\", \"es.regexp.exec\", \"es.regexp.to-string\"],\n Set: SetDependencies,\n Symbol: SymbolDependencies,\n URL: [\"web.url\", ...URLSearchParamsDependencies],\n URLSearchParams: URLSearchParamsDependencies,\n WeakMap: WeakMapDependencies,\n WeakSet: WeakSetDependencies,\n clearImmediate: [\"web.immediate\"],\n compositeKey: [\"esnext.composite-key\"],\n compositeSymbol: [\"esnext.composite-symbol\", ...SymbolDependencies],\n fetch: PromiseDependencies,\n globalThis: [\"esnext.global-this\"],\n parseFloat: [\"es.parse-float\"],\n parseInt: [\"es.parse-int\"],\n queueMicrotask: [\"web.queue-microtask\"],\n setTimeout: [\"web.timers\"],\n setInterval: [\"web.timers\"],\n setImmediate: [\"web.immediate\"],\n};\n\nexport const InstanceProperties: ObjectMap = {\n at: [\"esnext.string.at\"],\n anchor: [\"es.string.anchor\"],\n big: [\"es.string.big\"],\n bind: [\"es.function.bind\"],\n blink: [\"es.string.blink\"],\n bold: [\"es.string.bold\"],\n codePointAt: [\"es.string.code-point-at\"],\n codePoints: [\"esnext.string.code-points\"],\n concat: [\"es.array.concat\"],\n copyWithin: [\"es.array.copy-within\"],\n description: [\"es.symbol\", \"es.symbol.description\"],\n endsWith: [\"es.string.ends-with\"],\n entries: ArrayNatureIteratorsWithTag,\n every: [\"es.array.every\"],\n exec: [\"es.regexp.exec\"],\n fill: [\"es.array.fill\"],\n filter: [\"es.array.filter\"],\n finally: [\"es.promise.finally\", ...PromiseDependencies],\n find: [\"es.array.find\"],\n findIndex: [\"es.array.find-index\"],\n fixed: [\"es.string.fixed\"],\n flags: [\"es.regexp.flags\"],\n flat: [\"es.array.flat\", \"es.array.unscopables.flat\"],\n flatMap: [\"es.array.flat-map\", \"es.array.unscopables.flat-map\"],\n fontcolor: [\"es.string.fontcolor\"],\n fontsize: [\"es.string.fontsize\"],\n forEach: [\"es.array.for-each\", \"web.dom-collections.for-each\"],\n includes: [\"es.array.includes\", \"es.string.includes\"],\n indexOf: [\"es.array.index-of\"],\n italics: [\"es.string.italics\"],\n join: [\"es.array.join\"],\n keys: ArrayNatureIteratorsWithTag,\n lastIndex: [\"esnext.array.last-index\"],\n lastIndexOf: [\"es.array.last-index-of\"],\n lastItem: [\"esnext.array.last-item\"],\n link: [\"es.string.link\"],\n match: [\"es.string.match\", \"es.regexp.exec\"],\n matchAll: [\"esnext.string.match-all\"],\n map: [\"es.array.map\"],\n name: [\"es.function.name\"],\n padEnd: [\"es.string.pad-end\"],\n padStart: [\"es.string.pad-start\"],\n reduce: [\"es.array.reduce\"],\n reduceRight: [\"es.array.reduce-right\"],\n repeat: [\"es.string.repeat\"],\n replace: [\"es.string.replace\", \"es.regexp.exec\"],\n replaceAll: [\"esnext.string.replace-all\"],\n reverse: [\"es.array.reverse\"],\n search: [\"es.string.search\", \"es.regexp.exec\"],\n slice: [\"es.array.slice\"],\n small: [\"es.string.small\"],\n some: [\"es.array.some\"],\n sort: [\"es.array.sort\"],\n splice: [\"es.array.splice\"],\n split: [\"es.string.split\", \"es.regexp.exec\"],\n startsWith: [\"es.string.starts-with\"],\n strike: [\"es.string.strike\"],\n sub: [\"es.string.sub\"],\n sup: [\"es.string.sup\"],\n toFixed: [\"es.number.to-fixed\"],\n toISOString: [\"es.date.to-iso-string\"],\n toJSON: [\"es.date.to-json\", \"web.url.to-json\"],\n toPrecision: [\"es.number.to-precision\"],\n toString: [\"es.object.to-string\", \"es.regexp.to-string\", \"es.date.to-string\"],\n trim: [\"es.string.trim\"],\n trimEnd: [\"es.string.trim-end\"],\n trimLeft: [\"es.string.trim-start\"],\n trimRight: [\"es.string.trim-end\"],\n trimStart: [\"es.string.trim-start\"],\n values: ArrayNatureIteratorsWithTag,\n __defineGetter__: [\"es.object.define-getter\"],\n __defineSetter__: [\"es.object.define-setter\"],\n __lookupGetter__: [\"es.object.lookup-getter\"],\n __lookupSetter__: [\"es.object.lookup-setter\"],\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es.array.from\", \"es.string.iterator\"],\n isArray: [\"es.array.is-array\"],\n of: [\"es.array.of\"],\n },\n\n Date: {\n now: \"es.date.now\",\n },\n\n Object: {\n assign: \"es.object.assign\",\n create: \"es.object.create\",\n defineProperty: \"es.object.define-property\",\n defineProperties: \"es.object.define-properties\",\n entries: \"es.object.entries\",\n freeze: \"es.object.freeze\",\n fromEntries: [\"es.object.from-entries\", \"es.array.iterator\"],\n getOwnPropertyDescriptor: \"es.object.get-own-property-descriptor\",\n getOwnPropertyDescriptors: \"es.object.get-own-property-descriptors\",\n getOwnPropertyNames: \"es.object.get-own-property-names\",\n getOwnPropertySymbols: \"es.symbol\",\n getPrototypeOf: \"es.object.get-prototype-of\",\n is: \"es.object.is\",\n isExtensible: \"es.object.is-extensible\",\n isFrozen: \"es.object.is-frozen\",\n isSealed: \"es.object.is-sealed\",\n keys: \"es.object.keys\",\n preventExtensions: \"es.object.prevent-extensions\",\n seal: \"es.object.seal\",\n setPrototypeOf: \"es.object.set-prototype-of\",\n values: \"es.object.values\",\n },\n\n Math: {\n DEG_PER_RAD: \"esnext.math.deg-per-rad\",\n RAD_PER_DEG: \"esnext.math.rad-per-deg\",\n acosh: \"es.math.acosh\",\n asinh: \"es.math.asinh\",\n atanh: \"es.math.atanh\",\n cbrt: \"es.math.cbrt\",\n clamp: \"esnext.math.clamp\",\n clz32: \"es.math.clz32\",\n cosh: \"es.math.cosh\",\n degrees: \"esnext.math.degrees\",\n expm1: \"es.math.expm1\",\n fround: \"es.math.fround\",\n fscale: \"esnext.math.fscale\",\n hypot: \"es.math.hypot\",\n iaddh: \"esnext.math.iaddh\",\n imul: \"es.math.imul\",\n imulh: \"esnext.math.imulh\",\n isubh: \"esnext.math.isubh\",\n log1p: \"es.math.log1p\",\n log10: \"es.math.log10\",\n log2: \"es.math.log2\",\n radians: \"esnext.math.radians\",\n scale: \"esnext.math.scale\",\n seededPRNG: \"esnext.math.seeded-prng\",\n sign: \"es.math.sign\",\n signbit: \"esnext.math.signbit\",\n sinh: \"es.math.sinh\",\n tanh: \"es.math.tanh\",\n trunc: \"es.math.trunc\",\n umulh: \"esnext.math.umulh\",\n },\n\n String: {\n fromCodePoint: \"es.string.from-code-point\",\n raw: \"es.string.raw\",\n },\n\n Number: {\n EPSILON: \"es.number.epsilon\",\n MIN_SAFE_INTEGER: \"es.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es.number.max-safe-integer\",\n fromString: \"esnext.number.from-string\",\n isFinite: \"es.number.is-finite\",\n isInteger: \"es.number.is-integer\",\n isSafeInteger: \"es.number.is-safe-integer\",\n isNaN: \"es.number.is-nan\",\n parseFloat: \"es.number.parse-float\",\n parseInt: \"es.number.parse-int\",\n },\n\n Map: {\n from: [\"esnext.map.from\", ...MapDependencies],\n groupBy: [\"esnext.map.group-by\", ...MapDependencies],\n keyBy: [\"esnext.map.key-by\", ...MapDependencies],\n of: [\"esnext.map.of\", ...MapDependencies],\n },\n\n Set: {\n from: [\"esnext.set.from\", ...SetDependencies],\n of: [\"esnext.set.of\", ...SetDependencies],\n },\n\n WeakMap: {\n from: [\"esnext.weak-map.from\", ...WeakMapDependencies],\n of: [\"esnext.weak-map.of\", ...WeakMapDependencies],\n },\n\n WeakSet: {\n from: [\"esnext.weak-set.from\", ...WeakSetDependencies],\n of: [\"esnext.weak-set.of\", ...WeakSetDependencies],\n },\n\n Promise: {\n all: PromiseDependenciesWithIterators,\n allSettled: [\n \"esnext.promise.all-settled\",\n ...PromiseDependenciesWithIterators,\n ],\n any: [\n \"esnext.promise.any\",\n \"esnext.aggregate-error\",\n ...PromiseDependenciesWithIterators,\n ],\n race: PromiseDependenciesWithIterators,\n try: [\"esnext.promise.try\", ...PromiseDependenciesWithIterators],\n },\n\n Reflect: {\n apply: \"es.reflect.apply\",\n construct: \"es.reflect.construct\",\n defineMetadata: \"esnext.reflect.define-metadata\",\n defineProperty: \"es.reflect.define-property\",\n deleteMetadata: \"esnext.reflect.delete-metadata\",\n deleteProperty: \"es.reflect.delete-property\",\n get: \"es.reflect.get\",\n getMetadata: \"esnext.reflect.get-metadata\",\n getMetadataKeys: \"esnext.reflect.get-metadata-keys\",\n getOwnMetadata: \"esnext.reflect.get-own-metadata\",\n getOwnMetadataKeys: \"esnext.reflect.get-own-metadata-keys\",\n getOwnPropertyDescriptor: \"es.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es.reflect.get-prototype-of\",\n has: \"es.reflect.has\",\n hasMetadata: \"esnext.reflect.has-metadata\",\n hasOwnMetadata: \"esnext.reflect.has-own-metadata\",\n isExtensible: \"es.reflect.is-extensible\",\n metadata: \"esnext.reflect.metadata\",\n ownKeys: \"es.reflect.own-keys\",\n preventExtensions: \"es.reflect.prevent-extensions\",\n set: \"es.reflect.set\",\n setPrototypeOf: \"es.reflect.set-prototype-of\",\n },\n\n Symbol: {\n asyncIterator: [\"es.symbol.async-iterator\"],\n dispose: [\"esnext.symbol.dispose\"],\n hasInstance: [\"es.symbol.has-instance\", \"es.function.has-instance\"],\n isConcatSpreadable: [\"es.symbol.is-concat-spreadable\", \"es.array.concat\"],\n iterator: [\"es.symbol.iterator\", ...CommonIteratorsWithTag],\n match: [\"es.symbol.match\", \"es.string.match\"],\n observable: [\"esnext.symbol.observable\"],\n patternMatch: [\"esnext.symbol.pattern-match\"],\n replace: [\"es.symbol.replace\", \"es.string.replace\"],\n search: [\"es.symbol.search\", \"es.string.search\"],\n species: [\"es.symbol.species\", \"es.array.species\"],\n split: [\"es.symbol.split\", \"es.string.split\"],\n toPrimitive: [\"es.symbol.to-primitive\", \"es.date.to-primitive\"],\n toStringTag: [\n \"es.symbol.to-string-tag\",\n \"es.object.to-string\",\n \"es.math.to-string-tag\",\n \"es.json.to-string-tag\",\n ],\n unscopables: [\"es.symbol.unscopables\"],\n },\n\n ArrayBuffer: {\n isView: [\"es.array-buffer.is-view\"],\n },\n\n Int8Array: TypedArrayStaticMethods,\n Uint8Array: TypedArrayStaticMethods,\n Uint8ClampedArray: TypedArrayStaticMethods,\n Int16Array: TypedArrayStaticMethods,\n Uint16Array: TypedArrayStaticMethods,\n Int32Array: TypedArrayStaticMethods,\n Uint32Array: TypedArrayStaticMethods,\n Float32Array: TypedArrayStaticMethods,\n Float64Array: TypedArrayStaticMethods,\n};\n\nexport const CommonInstanceDependencies = new Set([\n \"es.object.to-string\",\n \"es.object.define-getter\",\n \"es.object.define-setter\",\n \"es.object.lookup-getter\",\n \"es.object.lookup-setter\",\n \"es.regexp.exec\",\n]);\n\nexport const PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejs3ShippedProposalsList from \"./shipped-proposals\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n CommonIterators,\n CommonInstanceDependencies,\n PromiseDependencies,\n PossibleGlobalObjects,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n intersection,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the direct import of \\`core-js\\` or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nconst corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)\n .filter(name => !name.startsWith(\"esnext.\"))\n .reduce((memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n }, {});\n\nconst corejs3PolyfillsWithShippedProposals = corejs3ShippedProposalsList.reduce(\n (memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n },\n { ...corejs3PolyfillsWithoutProposals },\n);\n\nexport default function(\n _: any,\n {\n corejs,\n include,\n exclude,\n polyfillTargets,\n proposals,\n shippedProposals,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n proposals\n ? corejs3Polyfills\n : shippedProposals\n ? corejs3PolyfillsWithShippedProposals\n : corejs3PolyfillsWithoutProposals,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function resolveKey(path, computed) {\n const { node, parent, scope } = path;\n if (path.isStringLiteral()) return node.value;\n const { name } = node;\n const isIdentifier = path.isIdentifier();\n if (isIdentifier && !(computed || parent.computed)) return name;\n if (!isIdentifier || scope.getBindingIdentifier(name)) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n }\n\n function resolveSource(path) {\n const { node, scope } = path;\n let builtIn, instanceType;\n if (node) {\n builtIn = node.name;\n if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {\n const { deopt, value } = path.evaluate();\n if (value !== undefined) {\n instanceType = getType(value);\n } else if (deopt && deopt.isIdentifier()) {\n builtIn = deopt.node.name;\n }\n }\n }\n return { builtIn, instanceType, isNamespaced: isNamespaced(path) };\n }\n\n const addAndRemovePolyfillImports = {\n // import 'core-js'\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n // require('core-js')\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n\n // import('something').then(...)\n Import() {\n this.addUnsupported(PromiseDependencies);\n },\n\n Function({ node }: NodePath) {\n // (async function () { }).finally(...)\n if (node.async) {\n this.addUnsupported(PromiseDependencies);\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"() {\n this.addUnsupported(CommonIterators);\n },\n\n // [...spread]\n SpreadElement({ parentPath }: NodePath) {\n if (!parentPath.isObjectExpression()) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // yield*\n YieldExpression({ node }: NodePath) {\n if (node.delegate) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // Symbol(), new Promise\n ReferencedIdentifier({ node: { name }, scope }: NodePath) {\n if (scope.getBindingIdentifier(name)) return;\n\n this.addBuiltInDependencies(name);\n },\n\n MemberExpression(path: NodePath) {\n const source = resolveSource(path.get(\"object\"));\n const key = resolveKey(path.get(\"property\"));\n\n // Object.entries\n // [1, 2, 3].entries\n this.addPropertyDependencies(source, key);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent, key } = path;\n let source;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n source = resolveSource(parentPath.get(\"init\"));\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n source = resolveSource(parentPath.get(\"right\"));\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunctionExpression()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n source = resolveSource(grand.get(\"arguments\")[key]);\n }\n }\n }\n\n for (const property of path.get(\"properties\")) {\n if (property.isObjectProperty()) {\n const key = resolveKey(property.get(\"key\"));\n // const { keys, values } = Object\n // const { keys, values } = [1, 2, 3]\n this.addPropertyDependencies(source, key);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n // 'entries' in Object\n // 'entries' in [1, 2, 3]\n this.addPropertyDependencies(source, key);\n },\n };\n\n return {\n name: \"corejs3-usage\",\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n };\n\n this.addBuiltInDependencies = function(builtIn) {\n if (has(BuiltIns, builtIn)) {\n const BuiltInDependencies = BuiltIns[builtIn];\n this.addUnsupported(BuiltInDependencies);\n }\n };\n\n this.addPropertyDependencies = function(source = {}, key) {\n const { builtIn, instanceType, isNamespaced } = source;\n if (isNamespaced) return;\n if (PossibleGlobalObjects.has(builtIn)) {\n this.addBuiltInDependencies(key);\n } else if (has(StaticProperties, builtIn)) {\n const BuiltInProperties = StaticProperties[builtIn];\n if (has(BuiltInProperties, key)) {\n const StaticPropertyDependencies = BuiltInProperties[key];\n return this.addUnsupported(StaticPropertyDependencies);\n }\n }\n if (!has(InstanceProperties, key)) return;\n let InstancePropertyDependencies = InstanceProperties[key];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n m => m.includes(instanceType) || CommonInstanceDependencies.has(m),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nimport { createImport } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function() {\n return {\n name: \"regenerator-usage\",\n pre() {\n this.usesRegenerator = false;\n },\n visitor: {\n Function(path: NodePath) {\n const { node } = path;\n\n if (!this.usesRegenerator && (node.generator || node.async)) {\n this.usesRegenerator = true;\n createImport(path, \"regenerator-runtime\");\n }\n },\n },\n post() {\n if (this.opts.debug && this.usesRegenerator) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your code and targets, added regenerator-runtime.`,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n createImport,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function(\n _: any,\n {\n include,\n exclude,\n polyfillTargets,\n regenerator,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n this.replaceBySeparateModulesImport(path);\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n this.replaceBySeparateModulesImport(bodyPath);\n }\n });\n },\n };\n\n return {\n name: \"corejs2-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.importPolyfillIncluded = false;\n\n this.replaceBySeparateModulesImport = function(path) {\n this.importPolyfillIncluded = true;\n\n if (regenerator) {\n createImport(path, \"regenerator-runtime\");\n }\n\n const modules = Array.from(polyfills).reverse();\n\n for (const module of modules) {\n createImport(path, module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"@babel/polyfill\",\n this.importPolyfillIncluded,\n polyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejsEntries from \"core-js-compat/entries\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n has,\n intersection,\n createImport,\n getImportSource,\n getRequireSource,\n getModulePath,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isBabelPolyfillSource(source) {\n return source === \"@babel/polyfill\" || source === \"babel-polyfill\";\n}\n\nfunction isCoreJSSource(source) {\n if (typeof source === \"string\") {\n source = source\n .replace(/\\\\/g, \"/\")\n .replace(/(\\/(index)?)?(\\.js)?$/i, \"\")\n .toLowerCase();\n }\n return has(corejsEntries, source) && corejsEntries[source];\n}\n\nconst BABEL_POLYFILL_DEPRECATION = `\n \\`@babel/polyfill\\` is deprecated. Please, use required parts of \\`core-js\\`\n and \\`regenerator-runtime/runtime\\` separately`;\n\nexport default function(\n _: any,\n { corejs, include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs3Polyfills,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function shouldReplace(source, modules) {\n if (!modules) return false;\n if (\n // Don't replace an import with itself to avoid an infinite loop\n modules.length === 1 &&\n polyfills.has(modules[0]) &&\n available.has(modules[0]) &&\n getModulePath(modules[0]) === source\n ) {\n return false;\n }\n return true;\n }\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(path, modules);\n }\n }\n },\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(bodyPath, modules);\n }\n }\n });\n },\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n };\n\n return {\n name: \"corejs3-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.replaceBySeparateModulesImport = function(path, modules) {\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"core-js\",\n this.injectedPolyfills.size > 0,\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport { getImportSource, getRequireSource } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isRegeneratorSource(source) {\n return source === \"regenerator-runtime/runtime\";\n}\n\nexport default function() {\n const visitor = {\n ImportDeclaration(path: NodePath) {\n if (isRegeneratorSource(getImportSource(path))) {\n this.regeneratorImportExcluded = true;\n path.remove();\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isRegeneratorSource(getRequireSource(bodyPath))) {\n this.regeneratorImportExcluded = true;\n bodyPath.remove();\n }\n });\n },\n };\n\n return {\n name: \"regenerator-entry\",\n visitor,\n pre() {\n this.regeneratorImportExcluded = false;\n },\n post() {\n if (this.opts.debug && this.regeneratorImportExcluded) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your targets, regenerator-runtime import excluded.`,\n );\n }\n },\n };\n}\n","export function declare(builder) {\n return (api, options, dirname) => {\n if (!api.assertVersion) {\n // Inject a custom version of 'assertVersion' for Babel 6 and early\n // versions of Babel 7's beta that didn't have it.\n api = Object.assign(copyApiObject(api), {\n assertVersion(range) {\n throwVersionError(range, api.version);\n },\n });\n }\n\n return builder(api, options || {}, dirname);\n };\n}\n\nfunction copyApiObject(api) {\n // Babel >= 7 <= beta.41 passed the API as a new object that had\n // babel/core as the prototype. While slightly faster, it also\n // means that the Object.assign copy below fails. Rather than\n // keep complexity, the Babel 6 behavior has been reverted and this\n // normalizes all that for Babel 7.\n let proto = null;\n if (typeof api.version === \"string\" && /^7\\./.test(api.version)) {\n proto = Object.getPrototypeOf(api);\n if (\n proto &&\n (!has(proto, \"version\") ||\n !has(proto, \"transform\") ||\n !has(proto, \"template\") ||\n !has(proto, \"types\"))\n ) {\n proto = null;\n }\n }\n\n return {\n ...proto,\n ...api,\n };\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction throwVersionError(range, version) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n let err;\n if (version.slice(0, 2) === \"7.\") {\n err = new Error(\n `Requires Babel \"^7.0.0-beta.41\", but was loaded with \"${version}\". ` +\n `You'll need to update your @babel/core version.`,\n );\n } else {\n err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${version}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n }\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version,\n range,\n }: any),\n );\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-json-strings\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsonStrings\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\n\nexport default declare(api => {\n api.assertVersion(7);\n const regex = /(\\\\*)([\\u2028\\u2029])/g;\n function replace(match, escapes, separator) {\n // If there's an odd number, that means the separator itself was escaped.\n // \"\\X\" escapes X.\n // \"\\\\X\" escapes the backslash, so X is unescaped.\n const isEscaped = escapes.length % 2 === 1;\n if (isEscaped) return match;\n\n return `${escapes}\\\\u${separator.charCodeAt(0).toString(16)}`;\n }\n\n return {\n name: \"proposal-json-strings\",\n inherits: syntaxJsonStrings,\n\n visitor: {\n \"DirectiveLiteral|StringLiteral\"({ node }) {\n const { extra } = node;\n if (!extra || !extra.raw) return;\n\n extra.raw = extra.raw.replace(regex, replace);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-dynamic-import\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"dynamicImport\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport { version } from \"../package.json\";\n\nconst SUPPORTED_MODULES = [\"commonjs\", \"amd\", \"systemjs\"];\n\nconst MODULES_NOT_FOUND = `\\\n@babel/plugin-proposal-dynamic-import depends on a modules\ntransform plugin. Supported plugins are:\n - @babel/plugin-transform-modules-commonjs ^7.4.0\n - @babel/plugin-transform-modules-amd ^7.4.0\n - @babel/plugin-transform-modules-systemjs ^7.4.0\n\nIf you are using Webpack or Rollup and thus don't want\nBabel to transpile your imports and exports, you can use\nthe @babel/plugin-syntax-dynamic-import plugin and let your\nbundler handle dynamic imports.\n`;\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-dynamic-import\",\n inherits: syntaxDynamicImport,\n\n pre() {\n this.file.set(\"@babel/plugin-proposal-dynamic-import\", version);\n },\n\n visitor: {\n Program() {\n const modules = this.file.get(\"@babel/plugin-transform-modules-*\");\n\n if (!SUPPORTED_MODULES.includes(modules)) {\n throw new Error(MODULES_NOT_FOUND);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-nullish-coalescing-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"nullishCoalescingOperator\");\n },\n };\n});\n","import type NodePath from \"../index\";\nimport { react } from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\nexport const ReferencedIdentifier = {\n types: [\"Identifier\", \"JSXIdentifier\"],\n checkPath(path: NodePath, opts?: Object): boolean {\n const { node, parent } = path;\n if (!t.isIdentifier(node, opts) && !t.isJSXMemberExpression(parent, opts)) {\n if (t.isJSXIdentifier(node, opts)) {\n if (react.isCompatTag(node.name)) return false;\n } else {\n // not a JSXIdentifier or an Identifier\n return false;\n }\n }\n\n // check if node is referenced\n return t.isReferenced(node, parent, path.parentPath.parent);\n },\n};\n\nexport const ReferencedMemberExpression = {\n types: [\"MemberExpression\"],\n checkPath({ node, parent }) {\n return t.isMemberExpression(node) && t.isReferenced(node, parent);\n },\n};\n\nexport const BindingIdentifier = {\n types: [\"Identifier\"],\n checkPath(path: NodePath): boolean {\n const { node, parent } = path;\n const grandparent = path.parentPath.parent;\n return t.isIdentifier(node) && t.isBinding(node, parent, grandparent);\n },\n};\n\nexport const Statement = {\n types: [\"Statement\"],\n checkPath({ node, parent }: NodePath): boolean {\n if (t.isStatement(node)) {\n if (t.isVariableDeclaration(node)) {\n if (t.isForXStatement(parent, { left: node })) return false;\n if (t.isForStatement(parent, { init: node })) return false;\n }\n\n return true;\n } else {\n return false;\n }\n },\n};\n\nexport const Expression = {\n types: [\"Expression\"],\n checkPath(path: NodePath): boolean {\n if (path.isIdentifier()) {\n return path.isReferencedIdentifier();\n } else {\n return t.isExpression(path.node);\n }\n },\n};\n\nexport const Scope = {\n // When pattern is inside the function params, it is a scope\n types: [\"Scopable\", \"Pattern\"],\n checkPath(path) {\n return t.isScope(path.node, path.parent);\n },\n};\n\nexport const Referenced = {\n checkPath(path: NodePath): boolean {\n return t.isReferenced(path.node, path.parent);\n },\n};\n\nexport const BlockScoped = {\n checkPath(path: NodePath): boolean {\n return t.isBlockScoped(path.node);\n },\n};\n\nexport const Var = {\n types: [\"VariableDeclaration\"],\n checkPath(path: NodePath): boolean {\n return t.isVar(path.node);\n },\n};\n\nexport const User = {\n checkPath(path: NodePath): boolean {\n return path.node && !!path.node.loc;\n },\n};\n\nexport const Generated = {\n checkPath(path: NodePath): boolean {\n return !path.isUser();\n },\n};\n\nexport const Pure = {\n checkPath(path: NodePath, opts?): boolean {\n return path.scope.isPure(path.node, opts);\n },\n};\n\nexport const Flow = {\n types: [\"Flow\", \"ImportDeclaration\", \"ExportDeclaration\", \"ImportSpecifier\"],\n checkPath({ node }: NodePath): boolean {\n if (t.isFlow(node)) {\n return true;\n } else if (t.isImportDeclaration(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else if (t.isExportDeclaration(node)) {\n return node.exportKind === \"type\";\n } else if (t.isImportSpecifier(node)) {\n return node.importKind === \"type\" || node.importKind === \"typeof\";\n } else {\n return false;\n }\n },\n};\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty = {\n types: [\"RestElement\"],\n checkPath(path: NodePath): boolean {\n return path.parentPath && path.parentPath.isObjectPattern();\n },\n};\n\nexport const SpreadProperty = {\n types: [\"RestElement\"],\n checkPath(path: NodePath): boolean {\n return path.parentPath && path.parentPath.isObjectExpression();\n },\n};\n\nexport const ExistentialTypeParam = {\n types: [\"ExistsTypeAnnotation\"],\n};\n\nexport const NumericLiteralTypeAnnotation = {\n types: [\"NumberLiteralTypeAnnotation\"],\n};\n\nexport const ForAwaitStatement = {\n types: [\"ForOfStatement\"],\n checkPath({ node }: NodePath): boolean {\n return node.await === true;\n },\n};\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var toNumber = require('./toNumber');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n MAX_INTEGER = 1.7976931348623157e+308;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n}\n\nmodule.exports = toFinite;\n","var toFinite = require('./toFinite');\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\nmodule.exports = toInteger;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeFloor = Math.floor;\n\n/**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\nfunction baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n}\n\nmodule.exports = baseRepeat;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var baseRepeat = require('./_baseRepeat'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger'),\n toString = require('./toString');\n\n/**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\nfunction repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n}\n\nmodule.exports = repeat;\n","import type NodePath from \"../path\";\n\n/**\n * This class is responsible for a binding inside of a scope.\n *\n * It tracks the following:\n *\n * * Node path.\n * * Amount of times referenced by other nodes.\n * * Paths to nodes that reassign or modify this binding.\n * * The kind of binding. (Is it a parameter, declaration etc)\n */\n\nexport default class Binding {\n constructor({ identifier, scope, path, kind }) {\n this.identifier = identifier;\n this.scope = scope;\n this.path = path;\n this.kind = kind;\n\n this.constantViolations = [];\n this.constant = true;\n\n this.referencePaths = [];\n this.referenced = false;\n this.references = 0;\n\n this.clearValue();\n }\n\n constantViolations: Array;\n constant: boolean;\n\n referencePaths: Array;\n referenced: boolean;\n references: number;\n\n hasDeoptedValue: boolean;\n hasValue: boolean;\n value: any;\n\n deoptValue() {\n this.clearValue();\n this.hasDeoptedValue = true;\n }\n\n setValue(value: any) {\n if (this.hasDeoptedValue) return;\n this.hasValue = true;\n this.value = value;\n }\n\n clearValue() {\n this.hasDeoptedValue = false;\n this.hasValue = false;\n this.value = null;\n }\n\n /**\n * Register a constant violation with the provided `path`.\n */\n\n reassign(path: Object) {\n this.constant = false;\n if (this.constantViolations.indexOf(path) !== -1) {\n return;\n }\n this.constantViolations.push(path);\n }\n\n /**\n * Increment the amount of references to this binding.\n */\n\n reference(path: NodePath) {\n if (this.referencePaths.indexOf(path) !== -1) {\n return;\n }\n this.referenced = true;\n this.references++;\n this.referencePaths.push(path);\n }\n\n /**\n * Decrement the amount of references to this binding.\n */\n\n dereference() {\n this.references--;\n this.referenced = !!this.references;\n }\n}\n","import * as t from \"@babel/types\";\n\nexport default function splitExportDeclaration(exportDeclaration) {\n if (!exportDeclaration.isExportDeclaration()) {\n throw new Error(\"Only export declarations can be splitted.\");\n }\n\n // build specifiers that point back to this export declaration\n const isDefault = exportDeclaration.isExportDefaultDeclaration();\n const declaration = exportDeclaration.get(\"declaration\");\n const isClassDeclaration = declaration.isClassDeclaration();\n\n if (isDefault) {\n const standaloneDeclaration =\n declaration.isFunctionDeclaration() || isClassDeclaration;\n\n const scope = declaration.isScope()\n ? declaration.scope.parent\n : declaration.scope;\n\n let id = declaration.node.id;\n let needBindingRegistration = false;\n\n if (!id) {\n needBindingRegistration = true;\n\n id = scope.generateUidIdentifier(\"default\");\n\n if (\n standaloneDeclaration ||\n declaration.isFunctionExpression() ||\n declaration.isClassExpression()\n ) {\n declaration.node.id = t.cloneNode(id);\n }\n }\n\n const updatedDeclaration = standaloneDeclaration\n ? declaration\n : t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(id), declaration.node),\n ]);\n\n const updatedExportDeclaration = t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(id), t.identifier(\"default\")),\n ]);\n\n exportDeclaration.insertAfter(updatedExportDeclaration);\n exportDeclaration.replaceWith(updatedDeclaration);\n\n if (needBindingRegistration) {\n scope.registerDeclaration(exportDeclaration);\n }\n\n return exportDeclaration;\n }\n\n if (exportDeclaration.get(\"specifiers\").length > 0) {\n throw new Error(\"It doesn't make sense to split exported specifiers.\");\n }\n\n const bindingIdentifiers = declaration.getOuterBindingIdentifiers();\n\n const specifiers = Object.keys(bindingIdentifiers).map(name => {\n return t.exportSpecifier(t.identifier(name), t.identifier(name));\n });\n\n const aliasDeclar = t.exportNamedDeclaration(null, specifiers);\n\n exportDeclaration.insertAfter(aliasDeclar);\n exportDeclaration.replaceWith(declaration.node);\n return exportDeclaration;\n}\n","import Binding from \"../binding\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as t from \"@babel/types\";\n\nconst renameVisitor = {\n ReferencedIdentifier({ node }, state) {\n if (node.name === state.oldName) {\n node.name = state.newName;\n }\n },\n\n Scope(path, state) {\n if (\n !path.scope.bindingIdentifierEquals(\n state.oldName,\n state.binding.identifier,\n )\n ) {\n path.skip();\n }\n },\n\n \"AssignmentExpression|Declaration\"(path, state) {\n const ids = path.getOuterBindingIdentifiers();\n\n for (const name in ids) {\n if (name === state.oldName) ids[name].name = state.newName;\n }\n },\n};\n\nexport default class Renamer {\n constructor(binding: Binding, oldName: string, newName: string) {\n this.newName = newName;\n this.oldName = oldName;\n this.binding = binding;\n }\n\n oldName: string;\n newName: string;\n binding: Binding;\n\n maybeConvertFromExportDeclaration(parentDeclar) {\n const maybeExportDeclar = parentDeclar.parentPath;\n\n if (!maybeExportDeclar.isExportDeclaration()) {\n return;\n }\n\n if (\n maybeExportDeclar.isExportDefaultDeclaration() &&\n !maybeExportDeclar.get(\"declaration\").node.id\n ) {\n return;\n }\n\n splitExportDeclaration(maybeExportDeclar);\n }\n\n maybeConvertFromClassFunctionDeclaration(path) {\n return; // TODO\n\n // retain the `name` of a class/function declaration\n\n if (!path.isFunctionDeclaration() && !path.isClassDeclaration()) return;\n if (this.binding.kind !== \"hoisted\") return;\n\n path.node.id = t.identifier(this.oldName);\n path.node._blockHoist = 3;\n\n path.replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(\n t.identifier(this.newName),\n t.toExpression(path.node),\n ),\n ]),\n );\n }\n\n maybeConvertFromClassFunctionExpression(path) {\n return; // TODO\n\n // retain the `name` of a class/function expression\n\n if (!path.isFunctionExpression() && !path.isClassExpression()) return;\n if (this.binding.kind !== \"local\") return;\n\n path.node.id = t.identifier(this.oldName);\n\n this.binding.scope.parent.push({\n id: t.identifier(this.newName),\n });\n\n path.replaceWith(\n t.assignmentExpression(\"=\", t.identifier(this.newName), path.node),\n );\n }\n\n rename(block?) {\n const { binding, oldName, newName } = this;\n const { scope, path } = binding;\n\n const parentDeclar = path.find(\n path =>\n path.isDeclaration() ||\n path.isFunctionExpression() ||\n path.isClassExpression(),\n );\n if (parentDeclar) {\n const bindingIds = parentDeclar.getOuterBindingIdentifiers();\n if (bindingIds[oldName] === binding.identifier) {\n // When we are renaming an exported identifier, we need to ensure that\n // the exported binding keeps the old name.\n this.maybeConvertFromExportDeclaration(parentDeclar);\n }\n }\n\n scope.traverse(block || scope.block, renameVisitor, this);\n\n if (!block) {\n scope.removeOwnBinding(oldName);\n scope.bindings[newName] = binding;\n this.binding.identifier.name = newName;\n }\n\n if (binding.type === \"hoisted\") {\n // https://github.com/babel/babel/issues/2435\n // todo: hoist and convert function to a let\n }\n\n if (parentDeclar) {\n this.maybeConvertFromClassFunctionDeclaration(parentDeclar);\n this.maybeConvertFromClassFunctionExpression(parentDeclar);\n }\n }\n}\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var baseRest = require('./_baseRest'),\n eq = require('./eq'),\n isIterateeCall = require('./_isIterateeCall'),\n keysIn = require('./keysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nmodule.exports = defaults;\n","'use strict';\nmodule.exports = require('./globals.json');\n","export let path = new WeakMap();\nexport let scope = new WeakMap();\n\nexport function clear() {\n clearPath();\n clearScope();\n}\n\nexport function clearPath() {\n path = new WeakMap();\n}\n\nexport function clearScope() {\n scope = new WeakMap();\n}\n","import includes from \"lodash/includes\";\nimport repeat from \"lodash/repeat\";\nimport Renamer from \"./lib/renamer\";\nimport type NodePath from \"../path\";\nimport traverse from \"../index\";\nimport defaults from \"lodash/defaults\";\nimport Binding from \"./binding\";\nimport globals from \"globals\";\nimport * as t from \"@babel/types\";\nimport { scope as scopeCache } from \"../cache\";\n\n// Recursively gathers the identifying names of a node.\nfunction gatherNodeParts(node: Object, parts: Array) {\n if (t.isModuleDeclaration(node)) {\n if (node.source) {\n gatherNodeParts(node.source, parts);\n } else if (node.specifiers && node.specifiers.length) {\n for (const specifier of (node.specifiers: Array)) {\n gatherNodeParts(specifier, parts);\n }\n } else if (node.declaration) {\n gatherNodeParts(node.declaration, parts);\n }\n } else if (t.isModuleSpecifier(node)) {\n gatherNodeParts(node.local, parts);\n } else if (t.isMemberExpression(node)) {\n gatherNodeParts(node.object, parts);\n gatherNodeParts(node.property, parts);\n } else if (t.isIdentifier(node)) {\n parts.push(node.name);\n } else if (t.isLiteral(node)) {\n parts.push(node.value);\n } else if (t.isCallExpression(node)) {\n gatherNodeParts(node.callee, parts);\n } else if (t.isObjectExpression(node) || t.isObjectPattern(node)) {\n for (const prop of (node.properties: Array)) {\n gatherNodeParts(prop.key || prop.argument, parts);\n }\n } else if (t.isPrivateName(node)) {\n gatherNodeParts(node.id, parts);\n } else if (t.isThisExpression(node)) {\n parts.push(\"this\");\n } else if (t.isSuper(node)) {\n parts.push(\"super\");\n }\n}\n\n//\n\nconst collectorVisitor = {\n For(path) {\n for (const key of (t.FOR_INIT_KEYS: Array)) {\n const declar = path.get(key);\n if (declar.isVar()) {\n const parentScope =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parentScope.registerBinding(\"var\", declar);\n }\n }\n },\n\n Declaration(path) {\n // delegate block scope handling to the `BlockScoped` method\n if (path.isBlockScoped()) return;\n\n // this will be hit again once we traverse into it after this iteration\n if (path.isExportDeclaration() && path.get(\"declaration\").isDeclaration()) {\n return;\n }\n\n // we've ran into a declaration!\n const parent =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parent.registerDeclaration(path);\n },\n\n ReferencedIdentifier(path, state) {\n state.references.push(path);\n },\n\n ForXStatement(path, state) {\n const left = path.get(\"left\");\n if (left.isPattern() || left.isIdentifier()) {\n state.constantViolations.push(path);\n }\n },\n\n ExportDeclaration: {\n exit(path) {\n const { node, scope } = path;\n const declar = node.declaration;\n if (t.isClassDeclaration(declar) || t.isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (!id) return;\n\n const binding = scope.getBinding(id.name);\n if (binding) binding.reference(path);\n } else if (t.isVariableDeclaration(declar)) {\n for (const decl of (declar.declarations: Array)) {\n for (const name of Object.keys(t.getBindingIdentifiers(decl))) {\n const binding = scope.getBinding(name);\n if (binding) binding.reference(path);\n }\n }\n }\n },\n },\n\n LabeledStatement(path) {\n path.scope.getProgramParent().addGlobal(path.node);\n path.scope.getBlockParent().registerDeclaration(path);\n },\n\n AssignmentExpression(path, state) {\n state.assignments.push(path);\n },\n\n UpdateExpression(path, state) {\n state.constantViolations.push(path);\n },\n\n UnaryExpression(path, state) {\n if (path.node.operator === \"delete\") {\n state.constantViolations.push(path);\n }\n },\n\n BlockScoped(path) {\n let scope = path.scope;\n if (scope.path === path) scope = scope.parent;\n scope.getBlockParent().registerDeclaration(path);\n },\n\n ClassDeclaration(path) {\n const id = path.node.id;\n if (!id) return;\n\n const name = id.name;\n path.scope.bindings[name] = path.scope.getBinding(name);\n },\n\n Block(path) {\n const paths = path.get(\"body\");\n for (const bodyPath of (paths: Array)) {\n if (bodyPath.isFunctionDeclaration()) {\n path.scope.getBlockParent().registerDeclaration(bodyPath);\n }\n }\n },\n};\n\nlet uid = 0;\n\nexport default class Scope {\n /**\n * This searches the current \"scope\" and collects all references/bindings\n * within.\n */\n\n constructor(path: NodePath) {\n const { node } = path;\n const cached = scopeCache.get(node);\n // Sometimes, a scopable path is placed higher in the AST tree.\n // In these cases, have to create a new Scope.\n if (cached && cached.path === path) {\n return cached;\n }\n scopeCache.set(node, this);\n\n this.uid = uid++;\n\n this.block = node;\n this.path = path;\n\n this.labels = new Map();\n }\n\n /**\n * Globals.\n */\n\n static globals = Object.keys(globals.builtin);\n\n /**\n * Variables available in current context.\n */\n\n static contextVariables = [\"arguments\", \"undefined\", \"Infinity\", \"NaN\"];\n\n get parent() {\n const parent = this.path.findParent(p => p.isScope());\n return parent && parent.scope;\n }\n\n get parentBlock() {\n return this.path.parent;\n }\n\n get hub() {\n return this.path.hub;\n }\n\n /**\n * Traverse node with current scope and path.\n */\n\n traverse(node: Object, opts: Object, state?) {\n traverse(node, opts, this, state, this.path);\n }\n\n /**\n * Generate a unique identifier and add it to the current scope.\n */\n\n generateDeclaredUidIdentifier(name?: string) {\n const id = this.generateUidIdentifier(name);\n this.push({ id });\n return t.cloneNode(id);\n }\n\n /**\n * Generate a unique identifier.\n */\n\n generateUidIdentifier(name?: string) {\n return t.identifier(this.generateUid(name));\n }\n\n /**\n * Generate a unique `_id1` binding.\n */\n\n generateUid(name: string = \"temp\") {\n name = t\n .toIdentifier(name)\n .replace(/^_+/, \"\")\n .replace(/[0-9]+$/g, \"\");\n\n let uid;\n let i = 0;\n do {\n uid = this._generateUid(name, i);\n i++;\n } while (\n this.hasLabel(uid) ||\n this.hasBinding(uid) ||\n this.hasGlobal(uid) ||\n this.hasReference(uid)\n );\n\n const program = this.getProgramParent();\n program.references[uid] = true;\n program.uids[uid] = true;\n\n return uid;\n }\n\n /**\n * Generate an `_id1`.\n */\n\n _generateUid(name, i) {\n let id = name;\n if (i > 1) id += i;\n return `_${id}`;\n }\n\n generateUidBasedOnNode(parent: Object, defaultName?: String) {\n let node = parent;\n\n if (t.isAssignmentExpression(parent)) {\n node = parent.left;\n } else if (t.isVariableDeclarator(parent)) {\n node = parent.id;\n } else if (t.isObjectProperty(node) || t.isObjectMethod(node)) {\n node = node.key;\n }\n\n const parts = [];\n gatherNodeParts(node, parts);\n\n let id = parts.join(\"$\");\n id = id.replace(/^_/, \"\") || defaultName || \"ref\";\n\n return this.generateUid(id.slice(0, 20));\n }\n\n /**\n * Generate a unique identifier based on a node.\n */\n\n generateUidIdentifierBasedOnNode(\n parent: Object,\n defaultName?: String,\n ): Object {\n return t.identifier(this.generateUidBasedOnNode(parent, defaultName));\n }\n\n /**\n * Determine whether evaluating the specific input `node` is a consequenceless reference. ie.\n * evaluating it wont result in potentially arbitrary code from being ran. The following are\n * whitelisted and determined not to cause side effects:\n *\n * - `this` expressions\n * - `super` expressions\n * - Bound identifiers\n */\n\n isStatic(node: Object): boolean {\n if (t.isThisExpression(node) || t.isSuper(node)) {\n return true;\n }\n\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding) {\n return binding.constant;\n } else {\n return this.hasBinding(node.name);\n }\n }\n\n return false;\n }\n\n /**\n * Possibly generate a memoised identifier if it is not static and has consequences.\n */\n\n maybeGenerateMemoised(node: Object, dontPush?: boolean): ?Object {\n if (this.isStatic(node)) {\n return null;\n } else {\n const id = this.generateUidIdentifierBasedOnNode(node);\n if (!dontPush) {\n this.push({ id });\n return t.cloneNode(id);\n }\n return id;\n }\n }\n\n checkBlockScopedCollisions(local, kind: string, name: string, id: Object) {\n // ignore parameters\n if (kind === \"param\") return;\n\n // Ignore existing binding if it's the name of the current function or\n // class expression\n if (local.kind === \"local\") return;\n\n const duplicate =\n // don't allow duplicate bindings to exist alongside\n kind === \"let\" ||\n local.kind === \"let\" ||\n local.kind === \"const\" ||\n local.kind === \"module\" ||\n // don't allow a local of param with a kind of let\n (local.kind === \"param\" && (kind === \"let\" || kind === \"const\"));\n\n if (duplicate) {\n throw this.hub.buildError(\n id,\n `Duplicate declaration \"${name}\"`,\n TypeError,\n );\n }\n }\n\n rename(oldName: string, newName: string, block?) {\n const binding = this.getBinding(oldName);\n if (binding) {\n newName = newName || this.generateUidIdentifier(oldName).name;\n return new Renamer(binding, oldName, newName).rename(block);\n }\n }\n\n _renameFromMap(map, oldName, newName, value) {\n if (map[oldName]) {\n map[newName] = value;\n map[oldName] = null;\n }\n }\n\n dump() {\n const sep = repeat(\"-\", 60);\n console.log(sep);\n let scope = this;\n do {\n console.log(\"#\", scope.block.type);\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n console.log(\" -\", name, {\n constant: binding.constant,\n references: binding.references,\n violations: binding.constantViolations.length,\n kind: binding.kind,\n });\n }\n } while ((scope = scope.parent));\n console.log(sep);\n }\n\n toArray(node: Object, i?: number) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding && binding.constant && binding.path.isGenericType(\"Array\")) {\n return node;\n }\n }\n\n if (t.isArrayExpression(node)) {\n return node;\n }\n\n if (t.isIdentifier(node, { name: \"arguments\" })) {\n return t.callExpression(\n t.memberExpression(\n t.memberExpression(\n t.memberExpression(\n t.identifier(\"Array\"),\n t.identifier(\"prototype\"),\n ),\n t.identifier(\"slice\"),\n ),\n t.identifier(\"call\"),\n ),\n [node],\n );\n }\n\n let helperName;\n const args = [node];\n if (i === true) {\n // Used in array-spread to create an array.\n helperName = \"toConsumableArray\";\n } else if (i) {\n args.push(t.numericLiteral(i));\n\n // Used in array-rest to create an array from a subset of an iterable.\n helperName = \"slicedToArray\";\n // TODO if (this.hub.isLoose(\"es6.forOf\")) helperName += \"-loose\";\n } else {\n // Used in array-rest to create an array\n helperName = \"toArray\";\n }\n return t.callExpression(this.hub.addHelper(helperName), args);\n }\n\n hasLabel(name: string) {\n return !!this.getLabel(name);\n }\n\n getLabel(name: string) {\n return this.labels.get(name);\n }\n\n registerLabel(path: NodePath) {\n this.labels.set(path.node.label.name, path);\n }\n\n registerDeclaration(path: NodePath) {\n if (path.isLabeledStatement()) {\n this.registerLabel(path);\n } else if (path.isFunctionDeclaration()) {\n this.registerBinding(\"hoisted\", path.get(\"id\"), path);\n } else if (path.isVariableDeclaration()) {\n const declarations = path.get(\"declarations\");\n for (const declar of (declarations: Array)) {\n this.registerBinding(path.node.kind, declar);\n }\n } else if (path.isClassDeclaration()) {\n this.registerBinding(\"let\", path);\n } else if (path.isImportDeclaration()) {\n const specifiers = path.get(\"specifiers\");\n for (const specifier of (specifiers: Array)) {\n this.registerBinding(\"module\", specifier);\n }\n } else if (path.isExportDeclaration()) {\n const declar = path.get(\"declaration\");\n if (\n declar.isClassDeclaration() ||\n declar.isFunctionDeclaration() ||\n declar.isVariableDeclaration()\n ) {\n this.registerDeclaration(declar);\n }\n } else {\n this.registerBinding(\"unknown\", path);\n }\n }\n\n buildUndefinedNode() {\n return t.unaryExpression(\"void\", t.numericLiteral(0), true);\n }\n\n registerConstantViolation(path: NodePath) {\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n const binding = this.getBinding(name);\n if (binding) binding.reassign(path);\n }\n }\n\n registerBinding(kind: string, path: NodePath, bindingPath = path) {\n if (!kind) throw new ReferenceError(\"no `kind`\");\n\n if (path.isVariableDeclaration()) {\n const declarators: Array = path.get(\"declarations\");\n for (const declar of declarators) {\n this.registerBinding(kind, declar);\n }\n return;\n }\n\n const parent = this.getProgramParent();\n const ids = path.getOuterBindingIdentifiers(true);\n\n for (const name of Object.keys(ids)) {\n for (const id of (ids[name]: Array)) {\n const local = this.getOwnBinding(name);\n\n if (local) {\n // same identifier so continue safely as we're likely trying to register it\n // multiple times\n if (local.identifier === id) continue;\n\n this.checkBlockScopedCollisions(local, kind, name, id);\n }\n\n parent.references[name] = true;\n\n // A redeclaration of an existing variable is a modification\n if (local) {\n this.registerConstantViolation(bindingPath);\n } else {\n this.bindings[name] = new Binding({\n identifier: id,\n scope: this,\n path: bindingPath,\n kind: kind,\n });\n }\n }\n }\n }\n\n addGlobal(node: Object) {\n this.globals[node.name] = node;\n }\n\n hasUid(name): boolean {\n let scope = this;\n\n do {\n if (scope.uids[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasGlobal(name: string): boolean {\n let scope = this;\n\n do {\n if (scope.globals[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasReference(name: string): boolean {\n let scope = this;\n\n do {\n if (scope.references[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n isPure(node, constantsOnly?: boolean) {\n if (t.isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (!binding) return false;\n if (constantsOnly) return binding.constant;\n return true;\n } else if (t.isClass(node)) {\n if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {\n return false;\n }\n return this.isPure(node.body, constantsOnly);\n } else if (t.isClassBody(node)) {\n for (const method of node.body) {\n if (!this.isPure(method, constantsOnly)) return false;\n }\n return true;\n } else if (t.isBinary(node)) {\n return (\n this.isPure(node.left, constantsOnly) &&\n this.isPure(node.right, constantsOnly)\n );\n } else if (t.isArrayExpression(node)) {\n for (const elem of (node.elements: Array)) {\n if (!this.isPure(elem, constantsOnly)) return false;\n }\n return true;\n } else if (t.isObjectExpression(node)) {\n for (const prop of (node.properties: Array)) {\n if (!this.isPure(prop, constantsOnly)) return false;\n }\n return true;\n } else if (t.isClassMethod(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.kind === \"get\" || node.kind === \"set\") return false;\n return true;\n } else if (t.isProperty(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n return this.isPure(node.value, constantsOnly);\n } else if (t.isUnaryExpression(node)) {\n return this.isPure(node.argument, constantsOnly);\n } else if (t.isTaggedTemplateExpression(node)) {\n return (\n t.matchesPattern(node.tag, \"String.raw\") &&\n !this.hasBinding(\"String\", true) &&\n this.isPure(node.quasi, constantsOnly)\n );\n } else if (t.isTemplateLiteral(node)) {\n for (const expression of (node.expressions: Array)) {\n if (!this.isPure(expression, constantsOnly)) return false;\n }\n return true;\n } else {\n return t.isPureish(node);\n }\n }\n\n /**\n * Set some arbitrary data on the current scope.\n */\n\n setData(key, val) {\n return (this.data[key] = val);\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key`.\n */\n\n getData(key) {\n let scope = this;\n do {\n const data = scope.data[key];\n if (data != null) return data;\n } while ((scope = scope.parent));\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key` and if it exists,\n * remove it.\n */\n\n removeData(key) {\n let scope = this;\n do {\n const data = scope.data[key];\n if (data != null) scope.data[key] = null;\n } while ((scope = scope.parent));\n }\n\n init() {\n if (!this.references) this.crawl();\n }\n\n crawl() {\n const path = this.path;\n\n this.references = Object.create(null);\n this.bindings = Object.create(null);\n this.globals = Object.create(null);\n this.uids = Object.create(null);\n this.data = Object.create(null);\n\n // ForStatement - left, init\n\n if (path.isLoop()) {\n for (const key of (t.FOR_INIT_KEYS: Array)) {\n const node = path.get(key);\n if (node.isBlockScoped()) this.registerBinding(node.node.kind, node);\n }\n }\n\n // FunctionExpression - id\n\n if (path.isFunctionExpression() && path.has(\"id\")) {\n if (!path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n this.registerBinding(\"local\", path.get(\"id\"), path);\n }\n }\n\n // Class\n\n if (path.isClassExpression() && path.has(\"id\")) {\n if (!path.get(\"id\").node[t.NOT_LOCAL_BINDING]) {\n this.registerBinding(\"local\", path);\n }\n }\n\n // Function - params, rest\n\n if (path.isFunction()) {\n const params: Array = path.get(\"params\");\n for (const param of params) {\n this.registerBinding(\"param\", param);\n }\n }\n\n // CatchClause - param\n\n if (path.isCatchClause()) {\n this.registerBinding(\"let\", path);\n }\n\n // Program\n\n const parent = this.getProgramParent();\n if (parent.crawling) return;\n\n const state = {\n references: [],\n constantViolations: [],\n assignments: [],\n };\n\n this.crawling = true;\n path.traverse(collectorVisitor, state);\n this.crawling = false;\n\n // register assignments\n for (const path of state.assignments) {\n // register undeclared bindings as globals\n const ids = path.getBindingIdentifiers();\n let programParent;\n for (const name of Object.keys(ids)) {\n if (path.scope.getBinding(name)) continue;\n\n programParent = programParent || path.scope.getProgramParent();\n programParent.addGlobal(ids[name]);\n }\n\n // register as constant violation\n path.scope.registerConstantViolation(path);\n }\n\n // register references\n for (const ref of state.references) {\n const binding = ref.scope.getBinding(ref.node.name);\n if (binding) {\n binding.reference(ref);\n } else {\n ref.scope.getProgramParent().addGlobal(ref.node);\n }\n }\n\n // register constant violations\n for (const path of state.constantViolations) {\n path.scope.registerConstantViolation(path);\n }\n }\n\n push(opts: {\n id: Object,\n init: ?Object,\n unique: ?boolean,\n _blockHoist: ?number,\n kind: \"var\" | \"let\",\n }) {\n let path = this.path;\n\n if (!path.isBlockStatement() && !path.isProgram()) {\n path = this.getBlockParent().path;\n }\n\n if (path.isSwitchStatement()) {\n path = (this.getFunctionParent() || this.getProgramParent()).path;\n }\n\n if (path.isLoop() || path.isCatchClause() || path.isFunction()) {\n path.ensureBlock();\n path = path.get(\"body\");\n }\n\n const unique = opts.unique;\n const kind = opts.kind || \"var\";\n const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;\n\n const dataKey = `declaration:${kind}:${blockHoist}`;\n let declarPath = !unique && path.getData(dataKey);\n\n if (!declarPath) {\n const declar = t.variableDeclaration(kind, []);\n declar._blockHoist = blockHoist;\n\n [declarPath] = path.unshiftContainer(\"body\", [declar]);\n if (!unique) path.setData(dataKey, declarPath);\n }\n\n const declarator = t.variableDeclarator(opts.id, opts.init);\n declarPath.node.declarations.push(declarator);\n this.registerBinding(kind, declarPath.get(\"declarations\").pop());\n }\n\n /**\n * Walk up to the top of the scope tree and get the `Program`.\n */\n\n getProgramParent() {\n let scope = this;\n do {\n if (scope.path.isProgram()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\"Couldn't find a Program\");\n }\n\n /**\n * Walk up the scope tree until we hit either a Function or return null.\n */\n\n getFunctionParent() {\n let scope = this;\n do {\n if (scope.path.isFunctionParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n return null;\n }\n\n /**\n * Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the\n * very top and hit Program.\n */\n\n getBlockParent() {\n let scope = this;\n do {\n if (scope.path.isBlockParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walks the scope tree and gathers **all** bindings.\n */\n\n getAllBindings(): Object {\n const ids = Object.create(null);\n\n let scope = this;\n do {\n defaults(ids, scope.bindings);\n scope = scope.parent;\n } while (scope);\n\n return ids;\n }\n\n /**\n * Walks the scope tree and gathers all declarations of `kind`.\n */\n\n getAllBindingsOfKind(): Object {\n const ids = Object.create(null);\n\n for (const kind of (arguments: Array)) {\n let scope = this;\n do {\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind === kind) ids[name] = binding;\n }\n scope = scope.parent;\n } while (scope);\n }\n\n return ids;\n }\n\n bindingIdentifierEquals(name: string, node: Object): boolean {\n return this.getBindingIdentifier(name) === node;\n }\n\n getBinding(name: string) {\n let scope = this;\n let previousPath;\n\n do {\n const binding = scope.getOwnBinding(name);\n if (binding) {\n // Check if a pattern is a part of parameter expressions.\n // 9.2.10.28: The closure created by this expression should not have visibility of\n // declarations in the function body. If the binding is not a `param`-kind,\n // then it must be defined inside the function body, thus it should be skipped\n if (\n previousPath &&\n previousPath.isPattern() &&\n previousPath.parentPath.isFunction() &&\n binding.kind !== \"param\"\n ) {\n // do nothing\n } else {\n return binding;\n }\n }\n previousPath = scope.path;\n } while ((scope = scope.parent));\n }\n\n getOwnBinding(name: string) {\n return this.bindings[name];\n }\n\n getBindingIdentifier(name: string) {\n const info = this.getBinding(name);\n return info && info.identifier;\n }\n\n getOwnBindingIdentifier(name: string) {\n const binding = this.bindings[name];\n return binding && binding.identifier;\n }\n\n hasOwnBinding(name: string) {\n return !!this.getOwnBinding(name);\n }\n\n hasBinding(name: string, noGlobals?) {\n if (!name) return false;\n if (this.hasOwnBinding(name)) return true;\n if (this.parentHasBinding(name, noGlobals)) return true;\n if (this.hasUid(name)) return true;\n if (!noGlobals && includes(Scope.globals, name)) return true;\n if (!noGlobals && includes(Scope.contextVariables, name)) return true;\n return false;\n }\n\n parentHasBinding(name: string, noGlobals?) {\n return this.parent && this.parent.hasBinding(name, noGlobals);\n }\n\n /**\n * Move a binding of `name` to another `scope`.\n */\n\n moveBindingTo(name, scope) {\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n info.scope = scope;\n scope.bindings[name] = info;\n }\n }\n\n removeOwnBinding(name: string) {\n delete this.bindings[name];\n }\n\n removeBinding(name: string) {\n // clear literal binding\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n }\n\n // clear uids with this name - https://github.com/babel/babel/issues/2101\n let scope = this;\n do {\n if (scope.uids[name]) {\n scope.uids[name] = false;\n }\n } while ((scope = scope.parent));\n }\n}\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = require('./base64');\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error(\"Invalid base64 digit: \" + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.ArraySet = ArraySet;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.MappingList = MappingList;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = require('./base64-vlq');\nvar util = require('./util');\nvar ArraySet = require('./array-set').ArraySet;\nvar MappingList = require('./mapping-list').MappingList;\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.quickSort = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = require('./util');\nvar binarySearch = require('./binary-search');\nvar ArraySet = require('./array-set').ArraySet;\nvar base64VLQ = require('./base64-vlq');\nvar quickSort = require('./quick-sort').quickSort;\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\nexports.BasicSourceMapConsumer = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\nexports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;\n","/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\nvar util = require('./util');\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = \"$$$isSourceNode$$$\";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || \"\";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[remainingLinesIndex] || '';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || '';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(\"\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n","/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./lib/source-node').SourceNode;\n","import sourceMap from \"source-map\";\n\n/**\n * Build a sourcemap.\n */\n\nexport default class SourceMap {\n constructor(opts, code) {\n this._cachedMap = null;\n this._code = code;\n this._opts = opts;\n this._rawMappings = [];\n }\n\n /**\n * Get the sourcemap.\n */\n\n get() {\n if (!this._cachedMap) {\n const map = (this._cachedMap = new sourceMap.SourceMapGenerator({\n sourceRoot: this._opts.sourceRoot,\n }));\n\n const code = this._code;\n if (typeof code === \"string\") {\n map.setSourceContent(\n this._opts.sourceFileName.replace(/\\\\/g, \"/\"),\n code,\n );\n } else if (typeof code === \"object\") {\n Object.keys(code).forEach(sourceFileName => {\n map.setSourceContent(\n sourceFileName.replace(/\\\\/g, \"/\"),\n code[sourceFileName],\n );\n });\n }\n\n this._rawMappings.forEach(mapping => map.addMapping(mapping), map);\n }\n\n return this._cachedMap.toJSON();\n }\n\n getRawMappings() {\n return this._rawMappings.slice();\n }\n\n /**\n * Mark the current generated position with a source position. May also be passed null line/column\n * values to insert a mapping to nothing.\n */\n\n mark(\n generatedLine: number,\n generatedColumn: number,\n line: number,\n column: number,\n identifierName: ?string,\n filename: ?string,\n force?: boolean,\n ) {\n // Adding an empty mapping at the start of a generated line just clutters the map.\n if (this._lastGenLine !== generatedLine && line === null) return;\n\n // If this mapping points to the same source location as the last one, we can ignore it since\n // the previous one covers it.\n if (\n !force &&\n this._lastGenLine === generatedLine &&\n this._lastSourceLine === line &&\n this._lastSourceColumn === column\n ) {\n return;\n }\n\n this._cachedMap = null;\n this._lastGenLine = generatedLine;\n this._lastSourceLine = line;\n this._lastSourceColumn = column;\n\n // We are deliberately not using the `source-map` library here to allow\n // callers to use these mappings without any overhead\n this._rawMappings.push({\n // undefined to allow for more compact json serialization\n name: identifierName || undefined,\n generated: {\n line: generatedLine,\n column: generatedColumn,\n },\n source:\n line == null\n ? undefined\n : (filename || this._opts.sourceFileName).replace(/\\\\/g, \"/\"),\n original:\n line == null\n ? undefined\n : {\n line: line,\n column: column,\n },\n });\n }\n}\n","var toInteger = require('./toInteger');\n\n/**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\nfunction isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n}\n\nmodule.exports = isInteger;\n","import type SourceMap from \"./source-map\";\n\nconst SPACES_RE = /^[ \\t]+$/;\n\n/**\n * The Buffer class exists to manage the queue of tokens being pushed onto the output string\n * in such a way that the final string buffer is treated as write-only until the final .get()\n * call. This allows V8 to optimize the output efficiently by not requiring it to store the\n * string in contiguous memory.\n */\n\nexport default class Buffer {\n constructor(map: ?SourceMap) {\n this._map = map;\n }\n\n _map: SourceMap = null;\n _buf: Array = [];\n _last: string = \"\";\n _queue: Array = [];\n\n _position: Object = {\n line: 1,\n column: 0,\n };\n _sourcePosition: Object = {\n identifierName: null,\n line: null,\n column: null,\n filename: null,\n };\n _disallowedPop: Object | null = null;\n\n /**\n * Get the final string output from the buffer, along with the sourcemap if one exists.\n */\n\n get(): Object {\n this._flush();\n\n const map = this._map;\n const result = {\n // Whatever trim is used here should not execute a regex against the\n // source string since it may be arbitrarily large after all transformations\n code: this._buf.join(\"\").trimRight(),\n map: null,\n rawMappings: map && map.getRawMappings(),\n };\n\n if (map) {\n // The `.map` property is lazy to allow callers to use the raw mappings\n // without any overhead\n Object.defineProperty(result, \"map\", {\n configurable: true,\n enumerable: true,\n get() {\n return (this.map = map.get());\n },\n set(value) {\n Object.defineProperty(this, \"map\", { value, writable: true });\n },\n });\n }\n\n return result;\n }\n\n /**\n * Add a string to the buffer that cannot be reverted.\n */\n\n append(str: string): void {\n this._flush();\n const {\n line,\n column,\n filename,\n identifierName,\n force,\n } = this._sourcePosition;\n this._append(str, line, column, identifierName, filename, force);\n }\n\n /**\n * Add a string to the buffer than can be reverted.\n */\n\n queue(str: string): void {\n // Drop trailing spaces when a newline is inserted.\n if (str === \"\\n\") {\n while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {\n this._queue.shift();\n }\n }\n\n const {\n line,\n column,\n filename,\n identifierName,\n force,\n } = this._sourcePosition;\n this._queue.unshift([str, line, column, identifierName, filename, force]);\n }\n\n _flush(): void {\n let item;\n while ((item = this._queue.pop())) this._append(...item);\n }\n\n _append(\n str: string,\n line: number,\n column: number,\n identifierName: ?string,\n filename: ?string,\n force?: boolean,\n ): void {\n // If there the line is ending, adding a new mapping marker is redundant\n if (this._map && str[0] !== \"\\n\") {\n this._map.mark(\n this._position.line,\n this._position.column,\n line,\n column,\n identifierName,\n filename,\n force,\n );\n }\n\n this._buf.push(str);\n this._last = str[str.length - 1];\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === \"\\n\") {\n this._position.line++;\n this._position.column = 0;\n } else {\n this._position.column++;\n }\n }\n }\n\n removeTrailingNewline(): void {\n if (this._queue.length > 0 && this._queue[0][0] === \"\\n\") {\n this._queue.shift();\n }\n }\n\n removeLastSemicolon(): void {\n if (this._queue.length > 0 && this._queue[0][0] === \";\") {\n this._queue.shift();\n }\n }\n\n endsWith(suffix: string): boolean {\n // Fast path to avoid iterating over this._queue.\n if (suffix.length === 1) {\n let last;\n if (this._queue.length > 0) {\n const str = this._queue[0][0];\n last = str[str.length - 1];\n } else {\n last = this._last;\n }\n\n return last === suffix;\n }\n\n const end =\n this._last + this._queue.reduce((acc, item) => item[0] + acc, \"\");\n if (suffix.length <= end.length) {\n return end.slice(-suffix.length) === suffix;\n }\n\n // We assume that everything being matched is at most a single token plus some whitespace,\n // which everything currently is, but otherwise we'd have to expand _last or check _buf.\n return false;\n }\n\n hasContent(): boolean {\n return this._queue.length > 0 || !!this._last;\n }\n\n /**\n * Certain sourcemap usecases expect mappings to be more accurate than\n * Babel's generic sourcemap handling allows. For now, we special-case\n * identifiers to allow for the primary cases to work.\n * The goal of this line is to ensure that the map output from Babel will\n * have an exact range on identifiers in the output code. Without this\n * line, Babel would potentially include some number of trailing tokens\n * that are printed after the identifier, but before another location has\n * been assigned.\n * This allows tooling like Rollup and Webpack to more accurately perform\n * their own transformations. Most importantly, this allows the import/export\n * transformations performed by those tools to loose less information when\n * applying their own transformations on top of the code and map results\n * generated by Babel itself.\n *\n * The primary example of this is the snippet:\n *\n * import mod from \"mod\";\n * mod();\n *\n * With this line, there will be one mapping range over \"mod\" and another\n * over \"();\", where previously it would have been a single mapping.\n */\n exactSource(loc: Object, cb: () => void) {\n // In cases where parent expressions start at the same locations as the\n // identifier itself, the current active location could already be the\n // start of this range. We use 'force' here to explicitly start a new\n // mapping range for this new token.\n this.source(\"start\", loc, true /* force */);\n\n cb();\n\n // In cases where tokens are printed after this item, we want to\n // ensure that they get the location of the _end_ of the identifier.\n // To accomplish this, we assign the location and explicitly disable\n // the standard Buffer withSource previous-position \"reactivation\"\n // logic. This means that if another item calls '.source()' to set\n // the location after the identifier, it is fine, but the position won't\n // be automatically replaced with the previous value.\n this.source(\"end\", loc);\n this._disallowPop(\"start\", loc);\n }\n\n /**\n * Sets a given position as the current source location so generated code after this call\n * will be given this position in the sourcemap.\n */\n\n source(prop: string, loc: Location, force?: boolean): void {\n if (prop && !loc) return;\n\n // Since this is called extremely often, we re-use the same _sourcePosition\n // object for the whole lifetime of the buffer.\n this._normalizePosition(prop, loc, this._sourcePosition, force);\n }\n\n /**\n * Call a callback with a specific source location and restore on completion.\n */\n\n withSource(prop: string, loc: Location, cb: () => void): void {\n if (!this._map) return cb();\n\n // Use the call stack to manage a stack of \"source location\" data because\n // the _sourcePosition object is mutated over the course of code generation,\n // and constantly copying it would be slower.\n const originalLine = this._sourcePosition.line;\n const originalColumn = this._sourcePosition.column;\n const originalFilename = this._sourcePosition.filename;\n const originalIdentifierName = this._sourcePosition.identifierName;\n\n this.source(prop, loc);\n\n cb();\n\n if (\n // If the current active position is forced, we only want to reactivate\n // the old position if it is different from the newest position.\n (!this._sourcePosition.force ||\n this._sourcePosition.line !== originalLine ||\n this._sourcePosition.column !== originalColumn ||\n this._sourcePosition.filename !== originalFilename) &&\n // Verify if reactivating this specific position has been disallowed.\n (!this._disallowedPop ||\n this._disallowedPop.line !== originalLine ||\n this._disallowedPop.column !== originalColumn ||\n this._disallowedPop.filename !== originalFilename)\n ) {\n this._sourcePosition.line = originalLine;\n this._sourcePosition.column = originalColumn;\n this._sourcePosition.filename = originalFilename;\n this._sourcePosition.identifierName = originalIdentifierName;\n this._sourcePosition.force = false;\n this._disallowedPop = null;\n }\n }\n\n /**\n * Allow printers to disable the default location-reset behavior of the\n * sourcemap output, so that certain printers can be sure that the\n * \"end\" location that they set is actually treated as the end position.\n */\n _disallowPop(prop: string, loc: Location) {\n if (prop && !loc) return;\n\n this._disallowedPop = this._normalizePosition(prop, loc);\n }\n\n _normalizePosition(\n prop: string,\n loc: Object,\n targetObj: Object,\n force?: boolean,\n ) {\n const pos = loc ? loc[prop] : null;\n\n if (targetObj === undefined) {\n // Initialize with fields so that the object doesn't change shape.\n targetObj = {\n identifierName: null,\n line: null,\n column: null,\n filename: null,\n force: false,\n };\n }\n\n const origLine = targetObj.line;\n const origColumn = targetObj.column;\n const origFilename = targetObj.filename;\n\n targetObj.identifierName =\n (prop === \"start\" && loc && loc.identifierName) || null;\n targetObj.line = pos ? pos.line : null;\n targetObj.column = pos ? pos.column : null;\n targetObj.filename = (loc && loc.filename) || null;\n\n // We want to skip reassigning `force` if we're re-setting the same position.\n if (\n force ||\n targetObj.line !== origLine ||\n targetObj.column !== origColumn ||\n targetObj.filename !== origFilename\n ) {\n targetObj.force = force;\n }\n\n return targetObj;\n }\n\n getCurrentColumn(): number {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n const lastIndex = extra.lastIndexOf(\"\\n\");\n\n return lastIndex === -1\n ? this._position.column + extra.length\n : extra.length - 1 - lastIndex;\n }\n\n getCurrentLine(): number {\n const extra = this._queue.reduce((acc, item) => item[0] + acc, \"\");\n\n let count = 0;\n for (let i = 0; i < extra.length; i++) {\n if (extra[i] === \"\\n\") count++;\n }\n\n return this._position.line + count;\n }\n}\n","import * as t from \"@babel/types\";\n\ntype WhitespaceObject = {\n before?: boolean,\n after?: boolean,\n};\n\n/**\n * Crawl a node to test if it contains a CallExpression, a Function, or a Helper.\n *\n * @example\n * crawl(node)\n * // { hasCall: false, hasFunction: true, hasHelper: false }\n */\n\nfunction crawl(node, state = {}) {\n if (t.isMemberExpression(node)) {\n crawl(node.object, state);\n if (node.computed) crawl(node.property, state);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n crawl(node.left, state);\n crawl(node.right, state);\n } else if (t.isCallExpression(node)) {\n state.hasCall = true;\n crawl(node.callee, state);\n } else if (t.isFunction(node)) {\n state.hasFunction = true;\n } else if (t.isIdentifier(node)) {\n state.hasHelper = state.hasHelper || isHelper(node.callee);\n }\n\n return state;\n}\n\n/**\n * Test if a node is or has a helper.\n */\n\nfunction isHelper(node) {\n if (t.isMemberExpression(node)) {\n return isHelper(node.object) || isHelper(node.property);\n } else if (t.isIdentifier(node)) {\n return node.name === \"require\" || node.name[0] === \"_\";\n } else if (t.isCallExpression(node)) {\n return isHelper(node.callee);\n } else if (t.isBinary(node) || t.isAssignmentExpression(node)) {\n return (\n (t.isIdentifier(node.left) && isHelper(node.left)) || isHelper(node.right)\n );\n } else {\n return false;\n }\n}\n\nfunction isType(node) {\n return (\n t.isLiteral(node) ||\n t.isObjectExpression(node) ||\n t.isArrayExpression(node) ||\n t.isIdentifier(node) ||\n t.isMemberExpression(node)\n );\n}\n\n/**\n * Tests for node types that need whitespace.\n */\n\nexport const nodes = {\n /**\n * Test if AssignmentExpression needs whitespace.\n */\n\n AssignmentExpression(node: Object): ?WhitespaceObject {\n const state = crawl(node.right);\n if ((state.hasCall && state.hasHelper) || state.hasFunction) {\n return {\n before: state.hasFunction,\n after: true,\n };\n }\n },\n\n /**\n * Test if SwitchCase needs whitespace.\n */\n\n SwitchCase(node: Object, parent: Object): WhitespaceObject {\n return {\n before: node.consequent.length || parent.cases[0] === node,\n after:\n !node.consequent.length &&\n parent.cases[parent.cases.length - 1] === node,\n };\n },\n\n /**\n * Test if LogicalExpression needs whitespace.\n */\n\n LogicalExpression(node: Object): ?WhitespaceObject {\n if (t.isFunction(node.left) || t.isFunction(node.right)) {\n return {\n after: true,\n };\n }\n },\n\n /**\n * Test if Literal needs whitespace.\n */\n\n Literal(node: Object): ?WhitespaceObject {\n if (node.value === \"use strict\") {\n return {\n after: true,\n };\n }\n },\n\n /**\n * Test if CallExpression needs whitespace.\n */\n\n CallExpression(node: Object): ?WhitespaceObject {\n if (t.isFunction(node.callee) || isHelper(node)) {\n return {\n before: true,\n after: true,\n };\n }\n },\n\n /**\n * Test if VariableDeclaration needs whitespace.\n */\n\n VariableDeclaration(node: Object): ?WhitespaceObject {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n\n let enabled = isHelper(declar.id) && !isType(declar.init);\n if (!enabled) {\n const state = crawl(declar.init);\n enabled = (isHelper(declar.init) && state.hasCall) || state.hasFunction;\n }\n\n if (enabled) {\n return {\n before: true,\n after: true,\n };\n }\n }\n },\n\n /**\n * Test if IfStatement needs whitespace.\n */\n\n IfStatement(node: Object): ?WhitespaceObject {\n if (t.isBlockStatement(node.consequent)) {\n return {\n before: true,\n after: true,\n };\n }\n },\n};\n\n/**\n * Test if Property needs whitespace.\n */\n\nnodes.ObjectProperty = nodes.ObjectTypeProperty = nodes.ObjectMethod = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (parent.properties[0] === node) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeCallProperty = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (\n parent.callProperties[0] === node &&\n (!parent.properties || !parent.properties.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeIndexer = function(node: Object, parent): ?WhitespaceObject {\n if (\n parent.indexers[0] === node &&\n (!parent.properties || !parent.properties.length) &&\n (!parent.callProperties || !parent.callProperties.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\nnodes.ObjectTypeInternalSlot = function(\n node: Object,\n parent,\n): ?WhitespaceObject {\n if (\n parent.internalSlots[0] === node &&\n (!parent.properties || !parent.properties.length) &&\n (!parent.callProperties || !parent.callProperties.length) &&\n (!parent.indexers || !parent.indexers.length)\n ) {\n return {\n before: true,\n };\n }\n};\n\n/**\n * Returns lists from node types that need whitespace.\n */\n\nexport const list = {\n /**\n * Return VariableDeclaration declarations init properties.\n */\n\n VariableDeclaration(node: Object): Array {\n return node.declarations.map(decl => decl.init);\n },\n\n /**\n * Return VariableDeclaration elements.\n */\n\n ArrayExpression(node: Object): Array {\n return node.elements;\n },\n\n /**\n * Return VariableDeclaration properties.\n */\n\n ObjectExpression(node: Object): Array {\n return node.properties;\n },\n};\n\n/**\n * Add whitespace tests for nodes and their aliases.\n */\n\n[\n [\"Function\", true],\n [\"Class\", true],\n [\"Loop\", true],\n [\"LabeledStatement\", true],\n [\"SwitchStatement\", true],\n [\"TryStatement\", true],\n].forEach(function([type, amounts]) {\n if (typeof amounts === \"boolean\") {\n amounts = { after: amounts, before: amounts };\n }\n [type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function(type) {\n nodes[type] = function() {\n return amounts;\n };\n });\n});\n","import * as t from \"@babel/types\";\n\nconst PRECEDENCE = {\n \"||\": 0,\n \"&&\": 1,\n \"|\": 2,\n \"^\": 3,\n \"&\": 4,\n \"==\": 5,\n \"===\": 5,\n \"!=\": 5,\n \"!==\": 5,\n \"<\": 6,\n \">\": 6,\n \"<=\": 6,\n \">=\": 6,\n in: 6,\n instanceof: 6,\n \">>\": 7,\n \"<<\": 7,\n \">>>\": 7,\n \"+\": 8,\n \"-\": 8,\n \"*\": 9,\n \"/\": 9,\n \"%\": 9,\n \"**\": 10,\n};\n\nconst isClassExtendsClause = (node: Object, parent: Object): boolean =>\n (t.isClassDeclaration(parent) || t.isClassExpression(parent)) &&\n parent.superClass === node;\n\nexport function NullableTypeAnnotation(node: Object, parent: Object): boolean {\n return t.isArrayTypeAnnotation(parent);\n}\n\nexport function FunctionTypeAnnotation(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return (\n // (() => A) | (() => B)\n t.isUnionTypeAnnotation(parent) ||\n // (() => A) & (() => B)\n t.isIntersectionTypeAnnotation(parent) ||\n // (() => A)[]\n t.isArrayTypeAnnotation(parent) ||\n // (A: T): (T => T[]) => B => [A, B]\n (t.isTypeAnnotation(parent) &&\n // Check grandparent\n t.isArrowFunctionExpression(printStack[printStack.length - 3]))\n );\n}\n\nexport function UpdateExpression(node: Object, parent: Object): boolean {\n return (\n // (foo++).test(), (foo++)[0]\n t.isMemberExpression(parent, { object: node }) ||\n // (foo++)()\n t.isCallExpression(parent, { callee: node }) ||\n // new (foo++)()\n t.isNewExpression(parent, { callee: node }) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function ObjectExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerArrow: true });\n}\n\nexport function DoExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack);\n}\n\nexport function Binary(node: Object, parent: Object): boolean {\n if (\n node.operator === \"**\" &&\n t.isBinaryExpression(parent, { operator: \"**\" })\n ) {\n return parent.left === node;\n }\n\n if (isClassExtendsClause(node, parent)) {\n return true;\n }\n\n if (\n ((t.isCallExpression(parent) || t.isNewExpression(parent)) &&\n parent.callee === node) ||\n t.isUnaryLike(parent) ||\n (t.isMemberExpression(parent) && parent.object === node) ||\n t.isAwaitExpression(parent)\n ) {\n return true;\n }\n\n if (t.isBinary(parent)) {\n const parentOp = parent.operator;\n const parentPos = PRECEDENCE[parentOp];\n\n const nodeOp = node.operator;\n const nodePos = PRECEDENCE[nodeOp];\n\n if (\n // Logical expressions with the same precedence don't need parens.\n (parentPos === nodePos &&\n parent.right === node &&\n !t.isLogicalExpression(parent)) ||\n parentPos > nodePos\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function UnionTypeAnnotation(node: Object, parent: Object): boolean {\n return (\n t.isArrayTypeAnnotation(parent) ||\n t.isNullableTypeAnnotation(parent) ||\n t.isIntersectionTypeAnnotation(parent) ||\n t.isUnionTypeAnnotation(parent)\n );\n}\n\nexport { UnionTypeAnnotation as IntersectionTypeAnnotation };\n\nexport function TSAsExpression() {\n return true;\n}\n\nexport function TSTypeAssertion() {\n return true;\n}\n\nexport function TSUnionType(node: Object, parent: Object): boolean {\n return (\n t.isTSArrayType(parent) ||\n t.isTSOptionalType(parent) ||\n t.isTSIntersectionType(parent) ||\n t.isTSUnionType(parent) ||\n t.isTSRestType(parent)\n );\n}\n\nexport { TSUnionType as TSIntersectionType };\n\nexport function BinaryExpression(node: Object, parent: Object): boolean {\n // let i = (1 in []);\n // for ((1 in []);;);\n return (\n node.operator === \"in\" &&\n (t.isVariableDeclarator(parent) || t.isFor(parent))\n );\n}\n\nexport function SequenceExpression(node: Object, parent: Object): boolean {\n if (\n // Although parentheses wouldn\"t hurt around sequence\n // expressions in the head of for loops, traditional style\n // dictates that e.g. i++, j++ should not be wrapped with\n // parentheses.\n t.isForStatement(parent) ||\n t.isThrowStatement(parent) ||\n t.isReturnStatement(parent) ||\n (t.isIfStatement(parent) && parent.test === node) ||\n (t.isWhileStatement(parent) && parent.test === node) ||\n (t.isForInStatement(parent) && parent.right === node) ||\n (t.isSwitchStatement(parent) && parent.discriminant === node) ||\n (t.isExpressionStatement(parent) && parent.expression === node)\n ) {\n return false;\n }\n\n // Otherwise err on the side of overparenthesization, adding\n // explicit exceptions above if this proves overzealous.\n return true;\n}\n\nexport function YieldExpression(node: Object, parent: Object): boolean {\n return (\n t.isBinary(parent) ||\n t.isUnaryLike(parent) ||\n t.isCallExpression(parent) ||\n t.isMemberExpression(parent) ||\n t.isNewExpression(parent) ||\n (t.isAwaitExpression(parent) && t.isYieldExpression(node)) ||\n (t.isConditionalExpression(parent) && node === parent.test) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport { YieldExpression as AwaitExpression };\n\nexport function ClassExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerDefaultExports: true });\n}\n\nexport function UnaryLike(node: Object, parent: Object): boolean {\n return (\n t.isMemberExpression(parent, { object: node }) ||\n t.isCallExpression(parent, { callee: node }) ||\n t.isNewExpression(parent, { callee: node }) ||\n t.isBinaryExpression(parent, { operator: \"**\", left: node }) ||\n isClassExtendsClause(node, parent)\n );\n}\n\nexport function FunctionExpression(\n node: Object,\n parent: Object,\n printStack: Array,\n): boolean {\n return isFirstInStatement(printStack, { considerDefaultExports: true });\n}\n\nexport function ArrowFunctionExpression(node: Object, parent: Object): boolean {\n return t.isExportDeclaration(parent) || ConditionalExpression(node, parent);\n}\n\nexport function ConditionalExpression(node: Object, parent: Object): boolean {\n if (\n t.isUnaryLike(parent) ||\n t.isBinary(parent) ||\n t.isConditionalExpression(parent, { test: node }) ||\n t.isAwaitExpression(parent) ||\n t.isOptionalMemberExpression(parent) ||\n t.isTaggedTemplateExpression(parent) ||\n t.isTSTypeAssertion(parent) ||\n t.isTSAsExpression(parent)\n ) {\n return true;\n }\n\n return UnaryLike(node, parent);\n}\n\nexport function OptionalMemberExpression(\n node: Object,\n parent: Object,\n): boolean {\n return t.isCallExpression(parent) || t.isMemberExpression(parent);\n}\n\nexport function AssignmentExpression(node: Object): boolean {\n if (t.isObjectPattern(node.left)) {\n return true;\n } else {\n return ConditionalExpression(...arguments);\n }\n}\n\nexport function NewExpression(node: Object, parent: Object): boolean {\n return isClassExtendsClause(node, parent);\n}\n\n// Walk up the print stack to determine if our node can come first\n// in statement.\nfunction isFirstInStatement(\n printStack: Array,\n { considerArrow = false, considerDefaultExports = false } = {},\n): boolean {\n let i = printStack.length - 1;\n let node = printStack[i];\n i--;\n let parent = printStack[i];\n while (i > 0) {\n if (\n t.isExpressionStatement(parent, { expression: node }) ||\n t.isTaggedTemplateExpression(parent) ||\n (considerDefaultExports &&\n t.isExportDefaultDeclaration(parent, { declaration: node })) ||\n (considerArrow && t.isArrowFunctionExpression(parent, { body: node }))\n ) {\n return true;\n }\n\n if (\n t.isCallExpression(parent, { callee: node }) ||\n (t.isSequenceExpression(parent) && parent.expressions[0] === node) ||\n t.isMemberExpression(parent, { object: node }) ||\n t.isConditional(parent, { test: node }) ||\n t.isBinary(parent, { left: node }) ||\n t.isAssignmentExpression(parent, { left: node })\n ) {\n node = parent;\n i--;\n parent = printStack[i];\n } else {\n return false;\n }\n }\n\n return false;\n}\n","import * as whitespace from \"./whitespace\";\nimport * as parens from \"./parentheses\";\nimport * as t from \"@babel/types\";\n\nfunction expandAliases(obj) {\n const newObj = {};\n\n function add(type, func) {\n const fn = newObj[type];\n newObj[type] = fn\n ? function(node, parent, stack) {\n const result = fn(node, parent, stack);\n\n return result == null ? func(node, parent, stack) : result;\n }\n : func;\n }\n\n for (const type of Object.keys(obj)) {\n const aliases = t.FLIPPED_ALIAS_KEYS[type];\n if (aliases) {\n for (const alias of aliases) {\n add(alias, obj[type]);\n }\n } else {\n add(type, obj[type]);\n }\n }\n\n return newObj;\n}\n\n// Rather than using `t.is` on each object property, we pre-expand any type aliases\n// into concrete types so that the 'find' call below can be as fast as possible.\nconst expandedParens = expandAliases(parens);\nconst expandedWhitespaceNodes = expandAliases(whitespace.nodes);\nconst expandedWhitespaceList = expandAliases(whitespace.list);\n\nfunction find(obj, node, parent, printStack) {\n const fn = obj[node.type];\n return fn ? fn(node, parent, printStack) : null;\n}\n\nfunction isOrHasCallExpression(node) {\n if (t.isCallExpression(node)) {\n return true;\n }\n\n if (t.isMemberExpression(node)) {\n return (\n isOrHasCallExpression(node.object) ||\n (!node.computed && isOrHasCallExpression(node.property))\n );\n } else {\n return false;\n }\n}\n\nexport function needsWhitespace(node, parent, type) {\n if (!node) return 0;\n\n if (t.isExpressionStatement(node)) {\n node = node.expression;\n }\n\n let linesInfo = find(expandedWhitespaceNodes, node, parent);\n\n if (!linesInfo) {\n const items = find(expandedWhitespaceList, node, parent);\n if (items) {\n for (let i = 0; i < items.length; i++) {\n linesInfo = needsWhitespace(items[i], node, type);\n if (linesInfo) break;\n }\n }\n }\n\n if (typeof linesInfo === \"object\" && linesInfo !== null) {\n return linesInfo[type] || 0;\n }\n\n return 0;\n}\n\nexport function needsWhitespaceBefore(node, parent) {\n return needsWhitespace(node, parent, \"before\");\n}\n\nexport function needsWhitespaceAfter(node, parent) {\n return needsWhitespace(node, parent, \"after\");\n}\n\nexport function needsParens(node, parent, printStack) {\n if (!parent) return false;\n\n if (t.isNewExpression(parent) && parent.callee === node) {\n if (isOrHasCallExpression(node)) return true;\n }\n\n /* this check is for NullishCoalescing being used with LogicalOperators like && and ||\n * For example when someone creates an ast programmaticaly like this\n * t.logicalExpression(\n * \"??\",\n * t.logicalExpression(\"||\", t.identifier(\"a\"), t.identifier(\"b\")),\n * t.identifier(\"c\"),\n * );\n * In the example above the AST is equivalent to writing a || b ?? c\n * This is incorrect because NullishCoalescing when used with LogicalExpressions should have parenthesis\n * The correct syntax is (a || b) ?? c, that is why we need parenthesis in this case\n */\n if (t.isLogicalExpression(node) && parent.operator === \"??\") return true;\n\n return find(expandedParens, node, parent, printStack);\n}\n","export function TaggedTemplateExpression(node: Object) {\n this.print(node.tag, node);\n this.print(node.typeParameters, node); // TS\n this.print(node.quasi, node);\n}\n\nexport function TemplateElement(node: Object, parent: Object) {\n const isFirst = parent.quasis[0] === node;\n const isLast = parent.quasis[parent.quasis.length - 1] === node;\n\n const value = (isFirst ? \"`\" : \"}\") + node.value.raw + (isLast ? \"`\" : \"${\");\n\n this.token(value);\n}\n\nexport function TemplateLiteral(node: Object) {\n const quasis = node.quasis;\n\n for (let i = 0; i < quasis.length; i++) {\n this.print(quasis[i], node);\n\n if (i + 1 < quasis.length) {\n this.print(node.expressions[i], node);\n }\n }\n}\n","import * as t from \"@babel/types\";\nimport * as n from \"../node\";\n\nexport function UnaryExpression(node: Object) {\n if (\n node.operator === \"void\" ||\n node.operator === \"delete\" ||\n node.operator === \"typeof\" ||\n // throwExpressions\n node.operator === \"throw\"\n ) {\n this.word(node.operator);\n this.space();\n } else {\n this.token(node.operator);\n }\n\n this.print(node.argument, node);\n}\n\nexport function DoExpression(node: Object) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function ParenthesizedExpression(node: Object) {\n this.token(\"(\");\n this.print(node.expression, node);\n this.token(\")\");\n}\n\nexport function UpdateExpression(node: Object) {\n if (node.prefix) {\n this.token(node.operator);\n this.print(node.argument, node);\n } else {\n this.startTerminatorless(true);\n this.print(node.argument, node);\n this.endTerminatorless();\n this.token(node.operator);\n }\n}\n\nexport function ConditionalExpression(node: Object) {\n this.print(node.test, node);\n this.space();\n this.token(\"?\");\n this.space();\n this.print(node.consequent, node);\n this.space();\n this.token(\":\");\n this.space();\n this.print(node.alternate, node);\n}\n\nexport function NewExpression(node: Object, parent: Object) {\n this.word(\"new\");\n this.space();\n this.print(node.callee, node);\n if (\n this.format.minified &&\n node.arguments.length === 0 &&\n !node.optional &&\n !t.isCallExpression(parent, { callee: node }) &&\n !t.isMemberExpression(parent) &&\n !t.isNewExpression(parent)\n ) {\n return;\n }\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function SequenceExpression(node: Object) {\n this.printList(node.expressions, node);\n}\n\nexport function ThisExpression() {\n this.word(\"this\");\n}\n\nexport function Super() {\n this.word(\"super\");\n}\n\nexport function Decorator(node: Object) {\n this.token(\"@\");\n this.print(node.expression, node);\n this.newline();\n}\n\nexport function OptionalMemberExpression(node: Object) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n if (node.optional) {\n this.token(\"?.\");\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n if (!node.optional) {\n this.token(\".\");\n }\n this.print(node.property, node);\n }\n}\n\nexport function OptionalCallExpression(node: Object) {\n this.print(node.callee, node);\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n\n if (node.optional) {\n this.token(\"?.\");\n }\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function CallExpression(node: Object) {\n this.print(node.callee, node);\n\n this.print(node.typeArguments, node); // Flow\n this.print(node.typeParameters, node); // TS\n this.token(\"(\");\n this.printList(node.arguments, node);\n this.token(\")\");\n}\n\nexport function Import() {\n this.word(\"import\");\n}\n\nfunction buildYieldAwait(keyword: string) {\n return function(node: Object) {\n this.word(keyword);\n\n if (node.delegate) {\n this.token(\"*\");\n }\n\n if (node.argument) {\n this.space();\n const terminatorState = this.startTerminatorless();\n this.print(node.argument, node);\n this.endTerminatorless(terminatorState);\n }\n };\n}\n\nexport const YieldExpression = buildYieldAwait(\"yield\");\nexport const AwaitExpression = buildYieldAwait(\"await\");\n\nexport function EmptyStatement() {\n this.semicolon(true /* force */);\n}\n\nexport function ExpressionStatement(node: Object) {\n this.print(node.expression, node);\n this.semicolon();\n}\n\nexport function AssignmentPattern(node: Object) {\n this.print(node.left, node);\n if (node.left.optional) this.token(\"?\");\n this.print(node.left.typeAnnotation, node);\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.right, node);\n}\n\nexport function AssignmentExpression(node: Object, parent: Object) {\n // Somewhere inside a for statement `init` node but doesn't usually\n // needs a paren except for `in` expressions: `for (a in b ? a : b;;)`\n const parens =\n this.inForStatementInitCounter &&\n node.operator === \"in\" &&\n !n.needsParens(node, parent);\n\n if (parens) {\n this.token(\"(\");\n }\n\n this.print(node.left, node);\n\n this.space();\n if (node.operator === \"in\" || node.operator === \"instanceof\") {\n this.word(node.operator);\n } else {\n this.token(node.operator);\n }\n this.space();\n\n this.print(node.right, node);\n\n if (parens) {\n this.token(\")\");\n }\n}\n\nexport function BindExpression(node: Object) {\n this.print(node.object, node);\n this.token(\"::\");\n this.print(node.callee, node);\n}\n\nexport {\n AssignmentExpression as BinaryExpression,\n AssignmentExpression as LogicalExpression,\n};\n\nexport function MemberExpression(node: Object) {\n this.print(node.object, node);\n\n if (!node.computed && t.isMemberExpression(node.property)) {\n throw new TypeError(\"Got a MemberExpression for MemberExpression property\");\n }\n\n let computed = node.computed;\n if (t.isLiteral(node.property) && typeof node.property.value === \"number\") {\n computed = true;\n }\n\n if (computed) {\n this.token(\"[\");\n this.print(node.property, node);\n this.token(\"]\");\n } else {\n this.token(\".\");\n this.print(node.property, node);\n }\n}\n\nexport function MetaProperty(node: Object) {\n this.print(node.meta, node);\n this.token(\".\");\n this.print(node.property, node);\n}\n\nexport function PrivateName(node: Object) {\n this.token(\"#\");\n this.print(node.id, node);\n}\n\nexport function V8IntrinsicIdentifier(node: Object) {\n this.token(\"%\");\n this.word(node.name);\n}\n","import * as t from \"@babel/types\";\n\nexport function WithStatement(node: Object) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function IfStatement(node: Object) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && t.isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent, node);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(\"}\")) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate, node);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement) {\n if (!t.isStatement(statement.body)) return statement;\n return getLastStatement(statement.body);\n}\n\nexport function ForStatement(node: Object) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n this.inForStatementInitCounter++;\n this.print(node.init, node);\n this.inForStatementInitCounter--;\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test, node);\n }\n this.token(\";\");\n\n if (node.update) {\n this.space();\n this.print(node.update, node);\n }\n\n this.token(\")\");\n this.printBlock(node);\n}\n\nexport function WhileStatement(node: Object) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.printBlock(node);\n}\n\nconst buildForXStatement = function(op) {\n return function(node: Object) {\n this.word(\"for\");\n this.space();\n if (op === \"of\" && node.await) {\n this.word(\"await\");\n this.space();\n }\n this.token(\"(\");\n this.print(node.left, node);\n this.space();\n this.word(op);\n this.space();\n this.print(node.right, node);\n this.token(\")\");\n this.printBlock(node);\n };\n};\n\nexport const ForInStatement = buildForXStatement(\"in\");\nexport const ForOfStatement = buildForXStatement(\"of\");\n\nexport function DoWhileStatement(node: Object) {\n this.word(\"do\");\n this.space();\n this.print(node.body, node);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test, node);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction buildLabelStatement(prefix, key = \"label\") {\n return function(node: Object) {\n this.word(prefix);\n\n const label = node[key];\n if (label) {\n this.space();\n const isLabel = key == \"label\";\n const terminatorState = this.startTerminatorless(isLabel);\n this.print(label, node);\n this.endTerminatorless(terminatorState);\n }\n\n this.semicolon();\n };\n}\n\nexport const ContinueStatement = buildLabelStatement(\"continue\");\nexport const ReturnStatement = buildLabelStatement(\"return\", \"argument\");\nexport const BreakStatement = buildLabelStatement(\"break\");\nexport const ThrowStatement = buildLabelStatement(\"throw\", \"argument\");\n\nexport function LabeledStatement(node: Object) {\n this.print(node.label, node);\n this.token(\":\");\n this.space();\n this.print(node.body, node);\n}\n\nexport function TryStatement(node: Object) {\n this.word(\"try\");\n this.space();\n this.print(node.block, node);\n this.space();\n\n // Esprima bug puts the catch clause in a `handlers` array.\n // see https://code.google.com/p/esprima/issues/detail?id=433\n // We run into this from regenerator generated ast.\n if (node.handlers) {\n this.print(node.handlers[0], node);\n } else {\n this.print(node.handler, node);\n }\n\n if (node.finalizer) {\n this.space();\n this.word(\"finally\");\n this.space();\n this.print(node.finalizer, node);\n }\n}\n\nexport function CatchClause(node: Object) {\n this.word(\"catch\");\n this.space();\n if (node.param) {\n this.token(\"(\");\n this.print(node.param, node);\n this.token(\")\");\n this.space();\n }\n this.print(node.body, node);\n}\n\nexport function SwitchStatement(node: Object) {\n this.word(\"switch\");\n this.space();\n this.token(\"(\");\n this.print(node.discriminant, node);\n this.token(\")\");\n this.space();\n this.token(\"{\");\n\n this.printSequence(node.cases, node, {\n indent: true,\n addNewlines(leading, cas) {\n if (!leading && node.cases[node.cases.length - 1] === cas) return -1;\n },\n });\n\n this.token(\"}\");\n}\n\nexport function SwitchCase(node: Object) {\n if (node.test) {\n this.word(\"case\");\n this.space();\n this.print(node.test, node);\n this.token(\":\");\n } else {\n this.word(\"default\");\n this.token(\":\");\n }\n\n if (node.consequent.length) {\n this.newline();\n this.printSequence(node.consequent, node, { indent: true });\n }\n}\n\nexport function DebuggerStatement() {\n this.word(\"debugger\");\n this.semicolon();\n}\n\nfunction variableDeclarationIndent() {\n // \"let \" or \"var \" indentation.\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 4; i++) this.space(true);\n}\n\nfunction constDeclarationIndent() {\n // \"const \" indentation.\n this.token(\",\");\n this.newline();\n if (this.endsWith(\"\\n\")) for (let i = 0; i < 6; i++) this.space(true);\n}\n\nexport function VariableDeclaration(node: Object, parent: Object) {\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n this.word(node.kind);\n this.space();\n\n let hasInits = false;\n // don't add whitespace to loop heads\n if (!t.isFor(parent)) {\n for (const declar of (node.declarations: Array)) {\n if (declar.init) {\n // has an init so let's split it up over multiple lines\n hasInits = true;\n }\n }\n }\n\n //\n // use a pretty separator when we aren't in compact mode, have initializers and don't have retainLines on\n // this will format declarations like:\n //\n // let foo = \"bar\", bar = \"foo\";\n //\n // into\n //\n // let foo = \"bar\",\n // bar = \"foo\";\n //\n\n let separator;\n if (hasInits) {\n separator =\n node.kind === \"const\"\n ? constDeclarationIndent\n : variableDeclarationIndent;\n }\n\n //\n\n this.printList(node.declarations, node, { separator });\n\n if (t.isFor(parent)) {\n // don't give semicolons to these nodes since they'll be inserted in the parent generator\n if (parent.left === node || parent.init === node) return;\n }\n\n this.semicolon();\n}\n\nexport function VariableDeclarator(node: Object) {\n this.print(node.id, node);\n if (node.definite) this.token(\"!\"); // TS\n this.print(node.id.typeAnnotation, node);\n if (node.init) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.init, node);\n }\n}\n","import * as t from \"@babel/types\";\n\nexport function ClassDeclaration(node: Object, parent: Object) {\n if (\n !this.format.decoratorsBeforeExport ||\n (!t.isExportDefaultDeclaration(parent) &&\n !t.isExportNamedDeclaration(parent))\n ) {\n this.printJoin(node.decorators, node);\n }\n\n if (node.declare) {\n // TS\n this.word(\"declare\");\n this.space();\n }\n\n if (node.abstract) {\n // TS\n this.word(\"abstract\");\n this.space();\n }\n\n this.word(\"class\");\n\n if (node.id) {\n this.space();\n this.print(node.id, node);\n }\n\n this.print(node.typeParameters, node);\n\n if (node.superClass) {\n this.space();\n this.word(\"extends\");\n this.space();\n this.print(node.superClass, node);\n this.print(node.superTypeParameters, node);\n }\n\n if (node.implements) {\n this.space();\n this.word(\"implements\");\n this.space();\n this.printList(node.implements, node);\n }\n\n this.space();\n this.print(node.body, node);\n}\n\nexport { ClassDeclaration as ClassExpression };\n\nexport function ClassBody(node: Object) {\n this.token(\"{\");\n this.printInnerComments(node);\n if (node.body.length === 0) {\n this.token(\"}\");\n } else {\n this.newline();\n\n this.indent();\n this.printSequence(node.body, node);\n this.dedent();\n\n if (!this.endsWith(\"\\n\")) this.newline();\n\n this.rightBrace();\n }\n}\n\nexport function ClassProperty(node: Object) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, /* isField */ true);\n\n if (node.computed) {\n this.token(\"[\");\n this.print(node.key, node);\n this.token(\"]\");\n } else {\n this._variance(node);\n this.print(node.key, node);\n }\n\n // TS\n if (node.optional) {\n this.token(\"?\");\n }\n if (node.definite) {\n this.token(\"!\");\n }\n\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassPrivateProperty(node: Object) {\n if (node.static) {\n this.word(\"static\");\n this.space();\n }\n this.print(node.key, node);\n this.print(node.typeAnnotation, node);\n if (node.value) {\n this.space();\n this.token(\"=\");\n this.space();\n this.print(node.value, node);\n }\n this.semicolon();\n}\n\nexport function ClassMethod(node: Object) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function ClassPrivateMethod(node: Object) {\n this._classMethodHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport function _classMethodHead(node) {\n this.printJoin(node.decorators, node);\n this.tsPrintClassMemberModifiers(node, /* isField */ false);\n this._methodHead(node);\n}\n","import * as t from \"@babel/types\";\n\nexport function _params(node: Object) {\n this.print(node.typeParameters, node);\n this.token(\"(\");\n this._parameters(node.params, node);\n this.token(\")\");\n\n this.print(node.returnType, node);\n}\n\nexport function _parameters(parameters, parent) {\n for (let i = 0; i < parameters.length; i++) {\n this._param(parameters[i], parent);\n\n if (i < parameters.length - 1) {\n this.token(\",\");\n this.space();\n }\n }\n}\n\nexport function _param(parameter, parent) {\n this.printJoin(parameter.decorators, parameter);\n this.print(parameter, parent);\n if (parameter.optional) this.token(\"?\"); // TS / flow\n this.print(parameter.typeAnnotation, parameter); // TS / flow\n}\n\nexport function _methodHead(node: Object) {\n const kind = node.kind;\n const key = node.key;\n\n if (kind === \"get\" || kind === \"set\") {\n this.word(kind);\n this.space();\n }\n\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n if (kind === \"method\" || kind === \"init\") {\n if (node.generator) {\n this.token(\"*\");\n }\n }\n\n if (node.computed) {\n this.token(\"[\");\n this.print(key, node);\n this.token(\"]\");\n } else {\n this.print(key, node);\n }\n\n if (node.optional) {\n // TS\n this.token(\"?\");\n }\n\n this._params(node);\n}\n\nexport function _predicate(node: Object) {\n if (node.predicate) {\n if (!node.returnType) {\n this.token(\":\");\n }\n this.space();\n this.print(node.predicate, node);\n }\n}\n\nexport function _functionHead(node: Object) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n this.word(\"function\");\n if (node.generator) this.token(\"*\");\n\n this.space();\n if (node.id) {\n this.print(node.id, node);\n }\n\n this._params(node);\n this._predicate(node);\n}\n\nexport function FunctionExpression(node: Object) {\n this._functionHead(node);\n this.space();\n this.print(node.body, node);\n}\n\nexport { FunctionExpression as FunctionDeclaration };\n\nexport function ArrowFunctionExpression(node: Object) {\n if (node.async) {\n this.word(\"async\");\n this.space();\n }\n\n const firstParam = node.params[0];\n\n if (\n node.params.length === 1 &&\n t.isIdentifier(firstParam) &&\n !hasTypes(node, firstParam)\n ) {\n if (\n this.format.retainLines &&\n node.loc &&\n node.body.loc &&\n node.loc.start.line < node.body.loc.start.line\n ) {\n this.token(\"(\");\n if (firstParam.loc && firstParam.loc.start.line > node.loc.start.line) {\n this.indent();\n this.print(firstParam, node);\n this.dedent();\n this._catchUp(\"start\", node.body.loc);\n } else {\n this.print(firstParam, node);\n }\n this.token(\")\");\n } else {\n this.print(firstParam, node);\n }\n } else {\n this._params(node);\n }\n\n this._predicate(node);\n\n this.space();\n this.token(\"=>\");\n this.space();\n\n this.print(node.body, node);\n}\n\nfunction hasTypes(node, param) {\n return (\n node.typeParameters ||\n node.returnType ||\n param.typeAnnotation ||\n param.optional ||\n param.trailingComments\n );\n}\n","import * as t from \"@babel/types\";\n\nexport function ImportSpecifier(node: Object) {\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n this.print(node.imported, node);\n if (node.local && node.local.name !== node.imported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n }\n}\n\nexport function ImportDefaultSpecifier(node: Object) {\n this.print(node.local, node);\n}\n\nexport function ExportDefaultSpecifier(node: Object) {\n this.print(node.exported, node);\n}\n\nexport function ExportSpecifier(node: Object) {\n this.print(node.local, node);\n if (node.exported && node.local.name !== node.exported.name) {\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n }\n}\n\nexport function ExportNamespaceSpecifier(node: Object) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.exported, node);\n}\n\nexport function ExportAllDeclaration(node: Object) {\n this.word(\"export\");\n this.space();\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n this.token(\"*\");\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n this.semicolon();\n}\n\nexport function ExportNamedDeclaration(node: Object) {\n if (\n this.format.decoratorsBeforeExport &&\n t.isClassDeclaration(node.declaration)\n ) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nexport function ExportDefaultDeclaration(node: Object) {\n if (\n this.format.decoratorsBeforeExport &&\n t.isClassDeclaration(node.declaration)\n ) {\n this.printJoin(node.declaration.decorators, node);\n }\n\n this.word(\"export\");\n this.space();\n this.word(\"default\");\n this.space();\n ExportDeclaration.apply(this, arguments);\n}\n\nfunction ExportDeclaration(node: Object) {\n if (node.declaration) {\n const declar = node.declaration;\n this.print(declar, node);\n if (!t.isStatement(declar)) this.semicolon();\n } else {\n if (node.exportKind === \"type\") {\n this.word(\"type\");\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n\n // print \"special\" specifiers first\n let hasSpecial = false;\n while (true) {\n const first = specifiers[0];\n if (\n t.isExportDefaultSpecifier(first) ||\n t.isExportNamespaceSpecifier(first)\n ) {\n hasSpecial = true;\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length || (!specifiers.length && !hasSpecial)) {\n this.token(\"{\");\n if (specifiers.length) {\n this.space();\n this.printList(specifiers, node);\n this.space();\n }\n this.token(\"}\");\n }\n\n if (node.source) {\n this.space();\n this.word(\"from\");\n this.space();\n this.print(node.source, node);\n }\n\n this.semicolon();\n }\n}\n\nexport function ImportDeclaration(node: Object) {\n this.word(\"import\");\n this.space();\n\n if (node.importKind === \"type\" || node.importKind === \"typeof\") {\n this.word(node.importKind);\n this.space();\n }\n\n const specifiers = node.specifiers.slice(0);\n if (specifiers && specifiers.length) {\n // print \"special\" specifiers first\n while (true) {\n const first = specifiers[0];\n if (\n t.isImportDefaultSpecifier(first) ||\n t.isImportNamespaceSpecifier(first)\n ) {\n this.print(specifiers.shift(), node);\n if (specifiers.length) {\n this.token(\",\");\n this.space();\n }\n } else {\n break;\n }\n }\n\n if (specifiers.length) {\n this.token(\"{\");\n this.space();\n this.printList(specifiers, node);\n this.space();\n this.token(\"}\");\n }\n\n this.space();\n this.word(\"from\");\n this.space();\n }\n\n this.print(node.source, node);\n this.semicolon();\n}\n\nexport function ImportNamespaceSpecifier(node: Object) {\n this.token(\"*\");\n this.space();\n this.word(\"as\");\n this.space();\n this.print(node.local, node);\n}\n","'use strict';\n\nconst object = {};\nconst hasOwnProperty = object.hasOwnProperty;\nconst forOwn = (object, callback) => {\n\tfor (const key in object) {\n\t\tif (hasOwnProperty.call(object, key)) {\n\t\t\tcallback(key, object[key]);\n\t\t}\n\t}\n};\n\nconst extend = (destination, source) => {\n\tif (!source) {\n\t\treturn destination;\n\t}\n\tforOwn(source, (key, value) => {\n\t\tdestination[key] = value;\n\t});\n\treturn destination;\n};\n\nconst forEach = (array, callback) => {\n\tconst length = array.length;\n\tlet index = -1;\n\twhile (++index < length) {\n\t\tcallback(array[index]);\n\t}\n};\n\nconst toString = object.toString;\nconst isArray = Array.isArray;\nconst isBuffer = Buffer.isBuffer;\nconst isObject = (value) => {\n\t// This is a very simple check, but it’s good enough for what we need.\n\treturn toString.call(value) == '[object Object]';\n};\nconst isString = (value) => {\n\treturn typeof value == 'string' ||\n\t\ttoString.call(value) == '[object String]';\n};\nconst isNumber = (value) => {\n\treturn typeof value == 'number' ||\n\t\ttoString.call(value) == '[object Number]';\n};\nconst isFunction = (value) => {\n\treturn typeof value == 'function';\n};\nconst isMap = (value) => {\n\treturn toString.call(value) == '[object Map]';\n};\nconst isSet = (value) => {\n\treturn toString.call(value) == '[object Set]';\n};\n\n/*--------------------------------------------------------------------------*/\n\n// https://mathiasbynens.be/notes/javascript-escapes#single\nconst singleEscapes = {\n\t'\"': '\\\\\"',\n\t'\\'': '\\\\\\'',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t'\n\t// `\\v` is omitted intentionally, because in IE < 9, '\\v' == 'v'.\n\t// '\\v': '\\\\x0B'\n};\nconst regexSingleEscape = /[\"'\\\\\\b\\f\\n\\r\\t]/;\n\nconst regexDigit = /[0-9]/;\nconst regexWhitelist = /[ !#-&\\(-\\[\\]-_a-~]/;\n\nconst jsesc = (argument, options) => {\n\tconst increaseIndentation = () => {\n\t\toldIndent = indent;\n\t\t++options.indentLevel;\n\t\tindent = options.indent.repeat(options.indentLevel)\n\t};\n\t// Handle options\n\tconst defaults = {\n\t\t'escapeEverything': false,\n\t\t'minimal': false,\n\t\t'isScriptContext': false,\n\t\t'quotes': 'single',\n\t\t'wrap': false,\n\t\t'es6': false,\n\t\t'json': false,\n\t\t'compact': true,\n\t\t'lowercaseHex': false,\n\t\t'numbers': 'decimal',\n\t\t'indent': '\\t',\n\t\t'indentLevel': 0,\n\t\t'__inline1__': false,\n\t\t'__inline2__': false\n\t};\n\tconst json = options && options.json;\n\tif (json) {\n\t\tdefaults.quotes = 'double';\n\t\tdefaults.wrap = true;\n\t}\n\toptions = extend(defaults, options);\n\tif (\n\t\toptions.quotes != 'single' &&\n\t\toptions.quotes != 'double' &&\n\t\toptions.quotes != 'backtick'\n\t) {\n\t\toptions.quotes = 'single';\n\t}\n\tconst quote = options.quotes == 'double' ?\n\t\t'\"' :\n\t\t(options.quotes == 'backtick' ?\n\t\t\t'`' :\n\t\t\t'\\''\n\t\t);\n\tconst compact = options.compact;\n\tconst lowercaseHex = options.lowercaseHex;\n\tlet indent = options.indent.repeat(options.indentLevel);\n\tlet oldIndent = '';\n\tconst inline1 = options.__inline1__;\n\tconst inline2 = options.__inline2__;\n\tconst newLine = compact ? '' : '\\n';\n\tlet result;\n\tlet isEmpty = true;\n\tconst useBinNumbers = options.numbers == 'binary';\n\tconst useOctNumbers = options.numbers == 'octal';\n\tconst useDecNumbers = options.numbers == 'decimal';\n\tconst useHexNumbers = options.numbers == 'hexadecimal';\n\n\tif (json && argument && isFunction(argument.toJSON)) {\n\t\targument = argument.toJSON();\n\t}\n\n\tif (!isString(argument)) {\n\t\tif (isMap(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Map()';\n\t\t\t}\n\t\t\tif (!compact) {\n\t\t\t\toptions.__inline1__ = true;\n\t\t\t\toptions.__inline2__ = false;\n\t\t\t}\n\t\t\treturn 'new Map(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isSet(argument)) {\n\t\t\tif (argument.size == 0) {\n\t\t\t\treturn 'new Set()';\n\t\t\t}\n\t\t\treturn 'new Set(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isBuffer(argument)) {\n\t\t\tif (argument.length == 0) {\n\t\t\t\treturn 'Buffer.from([])';\n\t\t\t}\n\t\t\treturn 'Buffer.from(' + jsesc(Array.from(argument), options) + ')';\n\t\t}\n\t\tif (isArray(argument)) {\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tif (inline1) {\n\t\t\t\toptions.__inline1__ = false;\n\t\t\t\toptions.__inline2__ = true;\n\t\t\t}\n\t\t\tif (!inline2) {\n\t\t\t\tincreaseIndentation();\n\t\t\t}\n\t\t\tforEach(argument, (value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tif (inline2) {\n\t\t\t\t\toptions.__inline2__ = false;\n\t\t\t\t}\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact || inline2 ? '' : indent) +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\tif (inline2) {\n\t\t\t\treturn '[' + result.join(', ') + ']';\n\t\t\t}\n\t\t\treturn '[' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + ']';\n\t\t} else if (isNumber(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// Some number values (e.g. `Infinity`) cannot be represented in JSON.\n\t\t\t\treturn JSON.stringify(argument);\n\t\t\t}\n\t\t\tif (useDecNumbers) {\n\t\t\t\treturn String(argument);\n\t\t\t}\n\t\t\tif (useHexNumbers) {\n\t\t\t\tlet hexadecimal = argument.toString(16);\n\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t}\n\t\t\t\treturn '0x' + hexadecimal;\n\t\t\t}\n\t\t\tif (useBinNumbers) {\n\t\t\t\treturn '0b' + argument.toString(2);\n\t\t\t}\n\t\t\tif (useOctNumbers) {\n\t\t\t\treturn '0o' + argument.toString(8);\n\t\t\t}\n\t\t} else if (!isObject(argument)) {\n\t\t\tif (json) {\n\t\t\t\t// For some values (e.g. `undefined`, `function` objects),\n\t\t\t\t// `JSON.stringify(value)` returns `undefined` (which isn’t valid\n\t\t\t\t// JSON) instead of `'null'`.\n\t\t\t\treturn JSON.stringify(argument) || 'null';\n\t\t\t}\n\t\t\treturn String(argument);\n\t\t} else { // it’s an object\n\t\t\tresult = [];\n\t\t\toptions.wrap = true;\n\t\t\tincreaseIndentation();\n\t\t\tforOwn(argument, (key, value) => {\n\t\t\t\tisEmpty = false;\n\t\t\t\tresult.push(\n\t\t\t\t\t(compact ? '' : indent) +\n\t\t\t\t\tjsesc(key, options) + ':' +\n\t\t\t\t\t(compact ? '' : ' ') +\n\t\t\t\t\tjsesc(value, options)\n\t\t\t\t);\n\t\t\t});\n\t\t\tif (isEmpty) {\n\t\t\t\treturn '{}';\n\t\t\t}\n\t\t\treturn '{' + newLine + result.join(',' + newLine) + newLine +\n\t\t\t\t(compact ? '' : oldIndent) + '}';\n\t\t}\n\t}\n\n\tconst string = argument;\n\t// Loop over each code unit in the string and escape it\n\tlet index = -1;\n\tconst length = string.length;\n\tresult = '';\n\twhile (++index < length) {\n\t\tconst character = string.charAt(index);\n\t\tif (options.es6) {\n\t\t\tconst first = string.charCodeAt(index);\n\t\t\tif ( // check if it’s the start of a surrogate pair\n\t\t\t\tfirst >= 0xD800 && first <= 0xDBFF && // high surrogate\n\t\t\t\tlength > index + 1 // there is a next code unit\n\t\t\t) {\n\t\t\t\tconst second = string.charCodeAt(index + 1);\n\t\t\t\tif (second >= 0xDC00 && second <= 0xDFFF) { // low surrogate\n\t\t\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\t\t\tconst codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n\t\t\t\t\tlet hexadecimal = codePoint.toString(16);\n\t\t\t\t\tif (!lowercaseHex) {\n\t\t\t\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t\t\t\t}\n\t\t\t\t\tresult += '\\\\u{' + hexadecimal + '}';\n\t\t\t\t\t++index;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!options.escapeEverything) {\n\t\t\tif (regexWhitelist.test(character)) {\n\t\t\t\t// It’s a printable ASCII character that is not `\"`, `'` or `\\`,\n\t\t\t\t// so don’t escape it.\n\t\t\t\tresult += character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\"') {\n\t\t\t\tresult += quote == character ? '\\\\\"' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '`') {\n\t\t\t\tresult += quote == character ? '\\\\`' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (character == '\\'') {\n\t\t\t\tresult += quote == character ? '\\\\\\'' : character;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (\n\t\t\tcharacter == '\\0' &&\n\t\t\t!json &&\n\t\t\t!regexDigit.test(string.charAt(index + 1))\n\t\t) {\n\t\t\tresult += '\\\\0';\n\t\t\tcontinue;\n\t\t}\n\t\tif (regexSingleEscape.test(character)) {\n\t\t\t// no need for a `hasOwnProperty` check here\n\t\t\tresult += singleEscapes[character];\n\t\t\tcontinue;\n\t\t}\n\t\tconst charCode = character.charCodeAt(0);\n\t\tif (options.minimal && charCode != 0x2028 && charCode != 0x2029) {\n\t\t\tresult += character;\n\t\t\tcontinue;\n\t\t}\n\t\tlet hexadecimal = charCode.toString(16);\n\t\tif (!lowercaseHex) {\n\t\t\thexadecimal = hexadecimal.toUpperCase();\n\t\t}\n\t\tconst longhand = hexadecimal.length > 2 || json;\n\t\tconst escaped = '\\\\' + (longhand ? 'u' : 'x') +\n\t\t\t('0000' + hexadecimal).slice(longhand ? -4 : -2);\n\t\tresult += escaped;\n\t\tcontinue;\n\t}\n\tif (options.wrap) {\n\t\tresult = quote + result + quote;\n\t}\n\tif (quote == '`') {\n\t\tresult = result.replace(/\\$\\{/g, '\\\\\\$\\{');\n\t}\n\tif (options.isScriptContext) {\n\t\t// https://mathiasbynens.be/notes/etago\n\t\treturn result\n\t\t\t.replace(/<\\/(script|style)/gi, '<\\\\/$1')\n\t\t\t.replace(/` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // `` line comment\n this.skipLineComment(3);\n this.skipSpace();\n this.nextToken();\n return;\n }\n this.finishOp(tt.incDec, 2);\n return;\n }\n\n if (next === charCodes.equalsTo) {\n this.finishOp(tt.assign, 2);\n } else {\n this.finishOp(tt.plusMin, 1);\n }\n }\n\n readToken_lt_gt(code: number): void {\n // '<>'\n const next = this.input.charCodeAt(this.state.pos + 1);\n let size = 1;\n\n if (next === code) {\n size =\n code === charCodes.greaterThan &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.greaterThan\n ? 3\n : 2;\n if (this.input.charCodeAt(this.state.pos + size) === charCodes.equalsTo) {\n this.finishOp(tt.assign, size + 1);\n return;\n }\n this.finishOp(tt.bitShift, size);\n return;\n }\n\n if (\n next === charCodes.exclamationMark &&\n code === charCodes.lessThan &&\n !this.inModule &&\n this.input.charCodeAt(this.state.pos + 2) === charCodes.dash &&\n this.input.charCodeAt(this.state.pos + 3) === charCodes.dash\n ) {\n // ` * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(re[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","// @flow\n\nimport * as helpers from \"@babel/helpers\";\nimport { NodePath, Scope, type HubInterface } from \"@babel/traverse\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport traverse from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport semver from \"semver\";\n\nimport type { NormalizedFile } from \"../normalize-file\";\n\nconst errorVisitor = {\n enter(path, state) {\n const loc = path.node.loc;\n if (loc) {\n state.loc = loc;\n path.stop();\n }\n },\n};\n\nexport type NodeLocation = {\n loc?: {\n end?: { line: number, column: number },\n start: { line: number, column: number },\n },\n _loc?: {\n end?: { line: number, column: number },\n start: { line: number, column: number },\n },\n};\n\nexport default class File {\n _map: Map = new Map();\n opts: Object;\n declarations: Object = {};\n path: NodePath = null;\n ast: Object = {};\n scope: Scope;\n metadata: {} = {};\n code: string = \"\";\n inputMap: Object | null = null;\n\n hub: HubInterface = {\n // keep it for the usage in babel-core, ex: path.hub.file.opts.filename\n file: this,\n getCode: () => this.code,\n getScope: () => this.scope,\n addHelper: this.addHelper.bind(this),\n buildError: this.buildCodeFrameError.bind(this),\n };\n\n constructor(options: {}, { code, ast, inputMap }: NormalizedFile) {\n this.opts = options;\n this.code = code;\n this.ast = ast;\n this.inputMap = inputMap;\n\n this.path = NodePath.get({\n hub: this.hub,\n parentPath: null,\n parent: this.ast,\n container: this.ast,\n key: \"program\",\n }).setContext();\n this.scope = this.path.scope;\n }\n\n /**\n * Provide backward-compatible access to the interpreter directive handling\n * in Babel 6.x. If you are writing a plugin for Babel 7.x, it would be\n * best to use 'program.interpreter' directly.\n */\n get shebang(): string {\n const { interpreter } = this.path.node;\n return interpreter ? interpreter.value : \"\";\n }\n set shebang(value: string): void {\n if (value) {\n this.path.get(\"interpreter\").replaceWith(t.interpreterDirective(value));\n } else {\n this.path.get(\"interpreter\").remove();\n }\n }\n\n set(key: mixed, val: mixed) {\n if (key === \"helpersNamespace\") {\n throw new Error(\n \"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility.\" +\n \"If you are using @babel/plugin-external-helpers you will need to use a newer \" +\n \"version than the one you currently have installed. \" +\n \"If you have your own implementation, you'll want to explore using 'helperGenerator' \" +\n \"alongside 'file.availableHelper()'.\",\n );\n }\n\n this._map.set(key, val);\n }\n\n get(key: mixed): any {\n return this._map.get(key);\n }\n\n has(key: mixed): boolean {\n return this._map.has(key);\n }\n\n getModuleName(): ?string {\n const {\n filename,\n filenameRelative = filename,\n\n moduleId,\n moduleIds = !!moduleId,\n\n getModuleId,\n\n sourceRoot: sourceRootTmp,\n moduleRoot = sourceRootTmp,\n sourceRoot = moduleRoot,\n } = this.opts;\n\n if (!moduleIds) return null;\n\n // moduleId is n/a if a `getModuleId()` is provided\n if (moduleId != null && !getModuleId) {\n return moduleId;\n }\n\n let moduleName = moduleRoot != null ? moduleRoot + \"/\" : \"\";\n\n if (filenameRelative) {\n const sourceRootReplacer =\n sourceRoot != null ? new RegExp(\"^\" + sourceRoot + \"/?\") : \"\";\n\n moduleName += filenameRelative\n // remove sourceRoot from filename\n .replace(sourceRootReplacer, \"\")\n // remove extension\n .replace(/\\.(\\w*?)$/, \"\");\n }\n\n // normalize path separators\n moduleName = moduleName.replace(/\\\\/g, \"/\");\n\n if (getModuleId) {\n // If return is falsy, assume they want us to use our generated default name\n return getModuleId(moduleName) || moduleName;\n } else {\n return moduleName;\n }\n }\n\n addImport() {\n throw new Error(\n \"This API has been removed. If you're looking for this \" +\n \"functionality in Babel 7, you should import the \" +\n \"'@babel/helper-module-imports' module and use the functions exposed \" +\n \" from that module, such as 'addNamed' or 'addDefault'.\",\n );\n }\n\n /**\n * Check if a given helper is available in @babel/core's helper list.\n *\n * This _also_ allows you to pass a Babel version specifically. If the\n * helper exists, but was not available for the full given range, it will be\n * considered unavailable.\n */\n availableHelper(name: string, versionRange: ?string): boolean {\n let minVersion;\n try {\n minVersion = helpers.minVersion(name);\n } catch (err) {\n if (err.code !== \"BABEL_HELPER_UNKNOWN\") throw err;\n\n return false;\n }\n\n if (typeof versionRange !== \"string\") return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with preprelease versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // transform-runtime's definitions.js file.\n if (semver.valid(versionRange)) versionRange = `^${versionRange}`;\n\n return (\n !semver.intersects(`<${minVersion}`, versionRange) &&\n !semver.intersects(`>=8.0.0`, versionRange)\n );\n }\n\n addHelper(name: string): Object {\n const declar = this.declarations[name];\n if (declar) return t.cloneNode(declar);\n\n const generator = this.get(\"helperGenerator\");\n if (generator) {\n const res = generator(name);\n if (res) return res;\n }\n\n // make sure that the helper exists\n helpers.ensure(name);\n\n const uid = (this.declarations[name] = this.scope.generateUidIdentifier(\n name,\n ));\n\n const dependencies = {};\n for (const dep of helpers.getDependencies(name)) {\n dependencies[dep] = this.addHelper(dep);\n }\n\n const { nodes, globals } = helpers.get(\n name,\n dep => dependencies[dep],\n uid,\n Object.keys(this.scope.getAllBindings()),\n );\n\n globals.forEach(name => {\n if (this.path.scope.hasBinding(name, true /* noGlobals */)) {\n this.path.scope.rename(name);\n }\n });\n\n nodes.forEach(node => {\n node._compact = true;\n });\n\n this.path.unshiftContainer(\"body\", nodes);\n // TODO: NodePath#unshiftContainer should automatically register new\n // bindings.\n this.path.get(\"body\").forEach(path => {\n if (nodes.indexOf(path.node) === -1) return;\n if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);\n });\n\n return uid;\n }\n\n addTemplateObject() {\n throw new Error(\n \"This function has been moved into the template literal transform itself.\",\n );\n }\n\n buildCodeFrameError(\n node: ?NodeLocation,\n msg: string,\n Error: typeof Error = SyntaxError,\n ): Error {\n let loc = node && (node.loc || node._loc);\n\n if (!loc && node) {\n const state = {\n loc: null,\n };\n traverse(node, errorVisitor, this.scope, state);\n loc = state.loc;\n\n let txt =\n \"This is an error on an internal node. Probably an internal error.\";\n if (loc) txt += \" Location has been estimated.\";\n\n msg += ` (${txt})`;\n }\n\n if (loc) {\n const { highlightCode = true } = this.opts;\n\n msg +=\n \"\\n\" +\n codeFrameColumns(\n this.code,\n {\n start: {\n line: loc.start.line,\n column: loc.start.column + 1,\n },\n end:\n loc.end && loc.start.line === loc.end.line\n ? {\n line: loc.end.line,\n column: loc.end.column + 1,\n }\n : undefined,\n },\n { highlightCode },\n );\n }\n\n return new Error(msg);\n }\n}\n","import * as helpers from \"@babel/helpers\";\nimport generator from \"@babel/generator\";\nimport template from \"@babel/template\";\nimport * as t from \"@babel/types\";\n\n// Wrapped to avoid wasting time parsing this when almost no-one uses\n// build-external-helpers.\nconst buildUmdWrapper = replacements =>\n template`\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n `(replacements);\n\nfunction buildGlobal(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n const container = t.functionExpression(\n null,\n [t.identifier(\"global\")],\n t.blockStatement(body),\n );\n const tree = t.program([\n t.expressionStatement(\n t.callExpression(container, [\n // typeof global === \"undefined\" ? self : global\n t.conditionalExpression(\n t.binaryExpression(\n \"===\",\n t.unaryExpression(\"typeof\", t.identifier(\"global\")),\n t.stringLiteral(\"undefined\"),\n ),\n t.identifier(\"self\"),\n t.identifier(\"global\"),\n ),\n ]),\n ),\n ]);\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(\n namespace,\n t.assignmentExpression(\n \"=\",\n t.memberExpression(t.identifier(\"global\"), namespace),\n t.objectExpression([]),\n ),\n ),\n ]),\n );\n\n buildHelpers(body, namespace, whitelist);\n\n return tree;\n}\n\nfunction buildModule(whitelist) {\n const body = [];\n const refs = buildHelpers(body, null, whitelist);\n\n body.unshift(\n t.exportNamedDeclaration(\n null,\n Object.keys(refs).map(name => {\n return t.exportSpecifier(t.cloneNode(refs[name]), t.identifier(name));\n }),\n ),\n );\n\n return t.program(body, [], \"module\");\n}\n\nfunction buildUmd(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(namespace, t.identifier(\"global\")),\n ]),\n );\n\n buildHelpers(body, namespace, whitelist);\n\n return t.program([\n buildUmdWrapper({\n FACTORY_PARAMETERS: t.identifier(\"global\"),\n BROWSER_ARGUMENTS: t.assignmentExpression(\n \"=\",\n t.memberExpression(t.identifier(\"root\"), namespace),\n t.objectExpression([]),\n ),\n COMMON_ARGUMENTS: t.identifier(\"exports\"),\n AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral(\"exports\")]),\n FACTORY_BODY: body,\n UMD_ROOT: t.identifier(\"this\"),\n }),\n ]);\n}\n\nfunction buildVar(whitelist) {\n const namespace = t.identifier(\"babelHelpers\");\n\n const body = [];\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(namespace, t.objectExpression([])),\n ]),\n );\n const tree = t.program(body);\n buildHelpers(body, namespace, whitelist);\n body.push(t.expressionStatement(namespace));\n return tree;\n}\n\nfunction buildHelpers(body, namespace, whitelist) {\n const getHelperReference = name => {\n return namespace\n ? t.memberExpression(namespace, t.identifier(name))\n : t.identifier(`_${name}`);\n };\n\n const refs = {};\n helpers.list.forEach(function(name) {\n if (whitelist && whitelist.indexOf(name) < 0) return;\n\n const ref = (refs[name] = getHelperReference(name));\n\n const { nodes } = helpers.get(name, getHelperReference, ref);\n\n body.push(...nodes);\n });\n return refs;\n}\nexport default function(\n whitelist?: Array,\n outputType: \"global\" | \"module\" | \"umd\" | \"var\" = \"global\",\n) {\n let tree;\n\n const build = {\n global: buildGlobal,\n module: buildModule,\n umd: buildUmd,\n var: buildVar,\n }[outputType];\n\n if (build) {\n tree = build(whitelist);\n } else {\n throw new Error(`Unsupported output type ${outputType}`);\n }\n\n return generator(tree).code;\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","module.exports = require(\"regenerator-runtime\");\n","// @flow\n\nimport type { Handler } from \"gensync\";\n\nimport type {\n ConfigFile,\n IgnoreFile,\n RelativeConfig,\n FilePackageData,\n} from \"./types\";\n\nimport type { CallerMetadata } from \"../validation/options\";\n\nexport type { ConfigFile, IgnoreFile, RelativeConfig, FilePackageData };\n\n// eslint-disable-next-line require-yield\nexport function* findConfigUpwards(\n rootDir: string, // eslint-disable-line no-unused-vars\n): Handler {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* findPackageData(filepath: string): Handler {\n return {\n filepath,\n directories: [],\n pkg: null,\n isPackage: false,\n };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRelativeConfig(\n pkgData: FilePackageData, // eslint-disable-line no-unused-vars\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n return { pkg: null, config: null, ignore: null };\n}\n\n// eslint-disable-next-line require-yield\nexport function* findRootConfig(\n dirname: string, // eslint-disable-line no-unused-vars\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n return null;\n}\n\n// eslint-disable-next-line require-yield\nexport function* loadConfig(\n name: string,\n dirname: string,\n envName: string, // eslint-disable-line no-unused-vars\n caller: CallerMetadata | void, // eslint-disable-line no-unused-vars\n): Handler {\n throw new Error(`Cannot load ${name} relative to ${dirname} in a browser`);\n}\n\nexport const ROOT_CONFIG_FILENAMES = [];\n\n// eslint-disable-next-line no-unused-vars\nexport function resolvePlugin(name: string, dirname: string): string | null {\n return null;\n}\n\n// eslint-disable-next-line no-unused-vars\nexport function resolvePreset(name: string, dirname: string): string | null {\n return null;\n}\n\nexport function loadPlugin(\n name: string,\n dirname: string,\n): { filepath: string, value: mixed } {\n throw new Error(\n `Cannot load plugin ${name} relative to ${dirname} in a browser`,\n );\n}\n\nexport function loadPreset(\n name: string,\n dirname: string,\n): { filepath: string, value: mixed } {\n throw new Error(\n `Cannot load preset ${name} relative to ${dirname} in a browser`,\n );\n}\n","// @flow\n\nexport function getEnv(defaultValue: string = \"development\"): string {\n return process.env.BABEL_ENV || process.env.NODE_ENV || defaultValue;\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexport function resolve() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : '/';\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexport function normalize(path) {\n var isPathAbsolute = isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isPathAbsolute).join('/');\n\n if (!path && !isPathAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isPathAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexport function isAbsolute(path) {\n return path.charAt(0) === '/';\n}\n\n// posix version\nexport function join() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n}\n\n\n// path.relative(from, to)\n// posix version\nexport function relative(from, to) {\n from = resolve(from).substr(1);\n to = resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n}\n\nexport var sep = '/';\nexport var delimiter = ':';\n\nexport function dirname(path) {\n var result = splitPath(path),\n root = result[0],\n dir = result[1];\n\n if (!root && !dir) {\n // No dirname whatsoever\n return '.';\n }\n\n if (dir) {\n // It has a dirname, strip trailing slash\n dir = dir.substr(0, dir.length - 1);\n }\n\n return root + dir;\n}\n\nexport function basename(path, ext) {\n var f = splitPath(path)[2];\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n}\n\n\nexport function extname(path) {\n return splitPath(path)[3];\n}\nexport default {\n extname: extname,\n basename: basename,\n dirname: dirname,\n sep: sep,\n delimiter: delimiter,\n relative: relative,\n join: join,\n isAbsolute: isAbsolute,\n normalize: normalize,\n resolve: resolve\n};\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b' ?\n function (str, start, len) { return str.substr(start, len) } :\n function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n","\"use strict\";\n\n// These use the global symbol registry so that multiple copies of this\n// library can work together in case they are not deduped.\nconst GENSYNC_START = Symbol.for(\"gensync:v1:start\");\nconst GENSYNC_SUSPEND = Symbol.for(\"gensync:v1:suspend\");\n\nconst GENSYNC_EXPECTED_START = \"GENSYNC_EXPECTED_START\";\nconst GENSYNC_EXPECTED_SUSPEND = \"GENSYNC_EXPECTED_SUSPEND\";\nconst GENSYNC_OPTIONS_ERROR = \"GENSYNC_OPTIONS_ERROR\";\nconst GENSYNC_RACE_NONEMPTY = \"GENSYNC_RACE_NONEMPTY\";\nconst GENSYNC_ERRBACK_NO_CALLBACK = \"GENSYNC_ERRBACK_NO_CALLBACK\";\n\nmodule.exports = Object.assign(\n function gensync(optsOrFn) {\n let genFn = optsOrFn;\n if (typeof optsOrFn !== \"function\") {\n genFn = newGenerator(optsOrFn);\n } else {\n genFn = wrapGenerator(optsOrFn);\n }\n\n return Object.assign(genFn, makeFunctionAPI(genFn));\n },\n {\n all: buildOperation({\n name: \"all\",\n arity: 1,\n sync: function(args) {\n const items = Array.from(args[0]);\n return items.map(item => evaluateSync(item));\n },\n async: function(args, resolve, reject) {\n const items = Array.from(args[0]);\n\n let count = 0;\n const results = items.map(() => undefined);\n items.forEach((item, i) => {\n evaluateAsync(\n item,\n val => {\n results[i] = val;\n count += 1;\n\n if (count === results.length) resolve(results);\n },\n reject\n );\n });\n },\n }),\n race: buildOperation({\n name: \"race\",\n arity: 1,\n sync: function(args) {\n const items = Array.from(args[0]);\n if (items.length === 0) {\n throw makeError(\"Must race at least 1 item\", GENSYNC_RACE_NONEMPTY);\n }\n\n return evaluateSync(items[0]);\n },\n async: function(args, resolve, reject) {\n const items = Array.from(args[0]);\n if (items.length === 0) {\n throw makeError(\"Must race at least 1 item\", GENSYNC_RACE_NONEMPTY);\n }\n\n for (const item of items) {\n evaluateAsync(item, resolve, reject);\n }\n },\n }),\n }\n);\n\n/**\n * Given a generator function, return the standard API object that executes\n * the generator and calls the callbacks.\n */\nfunction makeFunctionAPI(genFn) {\n const fns = {\n sync: function(...args) {\n return evaluateSync(genFn.apply(this, args));\n },\n async: function(...args) {\n return new Promise((resolve, reject) => {\n evaluateAsync(genFn.apply(this, args), resolve, reject);\n });\n },\n errback: function(...args) {\n const cb = args.pop();\n if (typeof cb !== \"function\") {\n throw makeError(\n \"Asynchronous function called without callback\",\n GENSYNC_ERRBACK_NO_CALLBACK\n );\n }\n\n let gen;\n try {\n gen = genFn.apply(this, args);\n } catch (err) {\n cb(err);\n return;\n }\n\n evaluateAsync(gen, val => cb(undefined, val), err => cb(err));\n },\n };\n return fns;\n}\n\nfunction assertTypeof(type, name, value, allowUndefined) {\n if (\n typeof value === type ||\n (allowUndefined && typeof value === \"undefined\")\n ) {\n return;\n }\n\n let msg;\n if (allowUndefined) {\n msg = `Expected opts.${name} to be either a ${type}, or undefined.`;\n } else {\n msg = `Expected opts.${name} to be a ${type}.`;\n }\n\n throw makeError(msg, GENSYNC_OPTIONS_ERROR);\n}\nfunction makeError(msg, code) {\n return Object.assign(new Error(msg), { code });\n}\n\n/**\n * Given an options object, return a new generator that dispatches the\n * correct handler based on sync or async execution.\n */\nfunction newGenerator({ name, arity, sync, async, errback }) {\n assertTypeof(\"string\", \"name\", name, true /* allowUndefined */);\n assertTypeof(\"number\", \"arity\", arity, true /* allowUndefined */);\n assertTypeof(\"function\", \"sync\", sync);\n assertTypeof(\"function\", \"async\", async, true /* allowUndefined */);\n assertTypeof(\"function\", \"errback\", errback, true /* allowUndefined */);\n if (async && errback) {\n throw makeError(\n \"Expected one of either opts.async or opts.errback, but got _both_.\",\n GENSYNC_OPTIONS_ERROR\n );\n }\n\n if (typeof name !== \"string\") {\n let fnName;\n if (errback && errback.name && errback.name !== \"errback\") {\n fnName = errback.name;\n }\n if (async && async.name && async.name !== \"async\") {\n fnName = async.name.replace(/Async$/, \"\");\n }\n if (sync && sync.name && sync.name !== \"sync\") {\n fnName = sync.name.replace(/Sync$/, \"\");\n }\n\n if (typeof fnName === \"string\") {\n name = fnName;\n }\n }\n\n if (typeof arity !== \"number\") {\n arity = sync.length;\n }\n\n return buildOperation({\n name,\n arity,\n sync: function(args) {\n return sync.apply(this, args);\n },\n async: function(args, resolve, reject) {\n if (async) {\n async.apply(this, args).then(resolve, reject);\n } else if (errback) {\n errback.call(this, ...args, (err, value) => {\n if (err == null) resolve(value);\n else reject(err);\n });\n } else {\n resolve(sync.apply(this, args));\n }\n },\n });\n}\n\nfunction wrapGenerator(genFn) {\n return setFunctionMetadata(genFn.name, genFn.length, function(...args) {\n return genFn.apply(this, args);\n });\n}\n\nfunction buildOperation({ name, arity, sync, async }) {\n return setFunctionMetadata(name, arity, function*(...args) {\n const resume = yield GENSYNC_START;\n if (!resume) {\n return sync.call(this, args);\n }\n\n let result;\n try {\n async.call(\n this,\n args,\n value => {\n if (result) return;\n\n result = { value };\n resume();\n },\n err => {\n if (result) return;\n\n result = { err };\n resume();\n }\n );\n } catch (err) {\n result = { err };\n resume();\n }\n\n // Suspend until the callbacks run. Will resume synchronously if the\n // callback was already called.\n yield GENSYNC_SUSPEND;\n\n if (result.hasOwnProperty(\"err\")) {\n throw result.err;\n }\n\n return result.value;\n });\n}\n\nfunction evaluateSync(gen) {\n let value;\n while (!({ value } = gen.next()).done) {\n assertStart(value, gen);\n }\n return value;\n}\n\nfunction evaluateAsync(gen, resolve, reject) {\n (function step() {\n try {\n let value;\n while (!({ value } = gen.next()).done) {\n assertStart(value, gen);\n\n // If this throws, it is considered to have broken the contract\n // established for async handlers. If these handlers are called\n // synchronously, it is also considered bad behavior.\n let sync = true;\n let didSyncResume = false;\n const out = gen.next(() => {\n if (sync) {\n didSyncResume = true;\n } else {\n step();\n }\n });\n sync = false;\n\n assertSuspend(out, gen);\n\n if (!didSyncResume) {\n // Callback wasn't called synchronously, so break out of the loop\n // and let it call 'step' later.\n return;\n }\n }\n\n return resolve(value);\n } catch (err) {\n return reject(err);\n }\n })();\n}\n\nfunction assertStart(value, gen) {\n if (value === GENSYNC_START) return;\n\n throwError(\n gen,\n makeError(\n `Got unexpected yielded value in gensync generator: ${JSON.stringify(\n value\n )}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,\n GENSYNC_EXPECTED_START\n )\n );\n}\nfunction assertSuspend({ value, done }, gen) {\n if (!done && value === GENSYNC_SUSPEND) return;\n\n throwError(\n gen,\n makeError(\n done\n ? \"Unexpected generator completion. If you get this, it is probably a gensync bug.\"\n : `Expected GENSYNC_SUSPEND, got ${JSON.stringify(\n value\n )}. If you get this, it is probably a gensync bug.`,\n GENSYNC_EXPECTED_SUSPEND\n )\n );\n}\n\nfunction throwError(gen, err) {\n // Call `.throw` so that users can step in a debugger to easily see which\n // 'yield' passed an unexpected value. If the `.throw` call didn't throw\n // back to the generator, we explicitly do it to stop the error\n // from being swallowed by user code try/catches.\n if (gen.throw) gen.throw(err);\n throw err;\n}\n\nfunction isIterable(value) {\n return (\n !!value &&\n (typeof value === \"object\" || typeof value === \"function\") &&\n !value[Symbol.iterator]\n );\n}\n\nfunction setFunctionMetadata(name, arity, fn) {\n if (typeof name === \"string\") {\n // This should always work on the supported Node versions, but for the\n // sake of users that are compiling to older versions, we check for\n // configurability so we don't throw.\n const nameDesc = Object.getOwnPropertyDescriptor(fn, \"name\");\n if (!nameDesc || nameDesc.configurable) {\n Object.defineProperty(\n fn,\n \"name\",\n Object.assign(nameDesc || {}, {\n configurable: true,\n value: name,\n })\n );\n }\n }\n\n if (typeof arity === \"number\") {\n const lengthDesc = Object.getOwnPropertyDescriptor(fn, \"length\");\n if (!lengthDesc || lengthDesc.configurable) {\n Object.defineProperty(\n fn,\n \"length\",\n Object.assign(lengthDesc || {}, {\n configurable: true,\n value: arity,\n })\n );\n }\n }\n\n return fn;\n}\n","// @flow\n\nimport gensync, { type Gensync, type Handler } from \"gensync\";\n\ntype MaybePromise = T | Promise;\n\nconst id = x => x;\n\nconst runGenerator = gensync(function*(item) {\n return yield* item;\n});\n\n// This Gensync returns true if the current execution contect is\n// asynchronous, otherwise it returns false.\nexport const isAsync = gensync<[], boolean>({\n sync: () => false,\n errback: cb => cb(null, true),\n});\n\n// This function wraps any functions (which could be either synchronous or\n// asynchronous) with a Gensync. If the wrapped function returns a promise\n// but the current execution context is synchronous, it will throw the\n// provided error.\n// This is used to handle user-provided functions which could be asynchronous.\nexport function maybeAsync(\n fn: (...args: Args) => T,\n message: string,\n): Gensync {\n return gensync({\n sync(...args) {\n const result = fn.apply(this, args);\n if (isThenable(result)) throw new Error(message);\n return result;\n },\n async(...args) {\n return Promise.resolve(fn.apply(this, args));\n },\n });\n}\n\nconst withKind = (gensync<[any], any>({\n sync: cb => cb(\"sync\"),\n async: cb => cb(\"async\"),\n}): (cb: (kind: \"sync\" | \"async\") => MaybePromise) => Handler);\n\n// This function wraps a generator (or a Gensync) into another function which,\n// when called, will run the provided generator in a sync or async way, depending\n// on the execution context where this forwardAsync function is called.\n// This is useful, for example, when passing a callback to a function which isn't\n// aware of gensync, but it only knows about synchronous and asynchronous functions.\n// An example is cache.using, which being exposed to the user must be as simple as\n// possible:\n// yield* forwardAsync(gensyncFn, wrappedFn =>\n// cache.using(x => {\n// // Here we don't know about gensync. wrappedFn is a\n// // normal sync or async function\n// return wrappedFn(x);\n// })\n// )\nexport function forwardAsync(\n action: (...args: ActionArgs) => Handler,\n cb: (\n adapted: (...args: ActionArgs) => MaybePromise,\n ) => MaybePromise,\n): Handler {\n const g = gensync(action);\n return withKind(kind => {\n const adapted = g[kind];\n return cb(adapted);\n });\n}\n\n// If the given generator is executed asynchronously, the first time that it\n// is paused (i.e. When it yields a gensync generator which can't be run\n// synchronously), call the \"firstPause\" callback.\nexport const onFirstPause = (gensync<[any, any], any>({\n name: \"onFirstPause\",\n arity: 2,\n sync: function(item) {\n return runGenerator.sync(item);\n },\n errback: function(item, firstPause, cb) {\n let completed = false;\n\n runGenerator.errback(item, (err, value) => {\n completed = true;\n cb(err, value);\n });\n\n if (!completed) {\n firstPause();\n }\n },\n}): (gen: Generator<*, T, *>, cb: Function) => Handler);\n\n// Wait for the given promise to be resolved\nexport const waitFor = (gensync<[any], any>({\n sync: id,\n async: id,\n}): (p: T | Promise) => Handler);\n\nexport function isThenable(val: mixed): boolean %checks {\n return (\n /*:: val instanceof Promise && */\n !!val &&\n (typeof val === \"object\" || typeof val === \"function\") &&\n !!val.then &&\n typeof val.then === \"function\"\n );\n}\n","// @flow\n\nimport type { ValidatedOptions } from \"./validation/options\";\n\nexport function mergeOptions(\n target: ValidatedOptions,\n source: ValidatedOptions,\n): void {\n for (const k of Object.keys(source)) {\n if (k === \"parserOpts\" && source.parserOpts) {\n const parserOpts = source.parserOpts;\n const targetObj = (target.parserOpts = target.parserOpts || {});\n mergeDefaultFields(targetObj, parserOpts);\n } else if (k === \"generatorOpts\" && source.generatorOpts) {\n const generatorOpts = source.generatorOpts;\n const targetObj = (target.generatorOpts = target.generatorOpts || {});\n mergeDefaultFields(targetObj, generatorOpts);\n } else {\n const val = source[k];\n if (val !== undefined) target[k] = (val: any);\n }\n }\n}\n\nfunction mergeDefaultFields(target: T, source: T) {\n for (const k of Object.keys(source)) {\n const val = source[k];\n if (val !== undefined) target[k] = (val: any);\n }\n}\n\nexport function isIterableIterator(value: mixed): boolean %checks {\n return (\n /*:: value instanceof Generator && */\n // /*:: \"@@iterator\" in value && */\n !!value &&\n typeof value.next === \"function\" &&\n // $FlowIgnore\n typeof value[Symbol.iterator] === \"function\"\n );\n}\n","// @flow\n\nimport gensync, { type Handler } from \"gensync\";\nimport {\n maybeAsync,\n isAsync,\n onFirstPause,\n waitFor,\n isThenable,\n} from \"../gensync-utils/async\";\nimport { isIterableIterator } from \"./util\";\n\nexport type { CacheConfigurator };\n\nexport type SimpleCacheConfigurator = SimpleCacheConfiguratorFn &\n SimpleCacheConfiguratorObj;\n\ntype SimpleCacheConfiguratorFn = {\n (boolean): void,\n (handler: () => T): T,\n};\ntype SimpleCacheConfiguratorObj = {\n forever: () => void,\n never: () => void,\n using: (handler: () => T) => T,\n invalidate: (handler: () => T) => T,\n};\n\nexport type CacheEntry = Array<{\n value: ResultT,\n valid: SideChannel => Handler,\n}>;\n\nconst synchronize = (\n gen: (...ArgsT) => Handler,\n // $FlowIssue https://github.com/facebook/flow/issues/7279\n): ((...args: ArgsT) => ResultT) => {\n return gensync(gen).sync;\n};\n\n// eslint-disable-next-line require-yield, no-unused-vars\nfunction* genTrue(data: any) {\n return true;\n}\n\nexport function makeWeakCache(\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n return makeCachedFunction(WeakMap, handler);\n}\n\nexport function makeWeakCacheSync(\n handler: (ArgT, CacheConfigurator) => ResultT,\n): (ArgT, SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeWeakCache(handler),\n );\n}\n\nexport function makeStrongCache(\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n return makeCachedFunction(Map, handler);\n}\n\nexport function makeStrongCacheSync(\n handler: (ArgT, CacheConfigurator) => ResultT,\n): (ArgT, SideChannel) => ResultT {\n return synchronize<[ArgT, SideChannel], ResultT>(\n makeStrongCache(handler),\n );\n}\n\n/* NOTE: Part of the logic explained in this comment is explained in the\n * getCachedValueOrWait and setupAsyncLocks functions.\n *\n * > There are only two hard things in Computer Science: cache invalidation and naming things.\n * > -- Phil Karlton\n *\n * I don't know if Phil was also thinking about handling a cache whose invalidation function is\n * defined asynchronously is considered, but it is REALLY hard to do correctly.\n *\n * The implemented logic (only when gensync is run asynchronously) is the following:\n * 1. If there is a valid cache associated to the current \"arg\" parameter,\n * a. RETURN the cached value\n * 3. If there is a FinishLock associated to the current \"arg\" parameter representing a valid cache,\n * a. Wait for that lock to be released\n * b. RETURN the value associated with that lock\n * 5. Start executing the function to be cached\n * a. If it pauses on a promise, then\n * i. Let FinishLock be a new lock\n * ii. Store FinishLock as associated to the current \"arg\" parameter\n * iii. Wait for the function to finish executing\n * iv. Release FinishLock\n * v. Send the function result to anyone waiting on FinishLock\n * 6. Store the result in the cache\n * 7. RETURN the result\n */\nfunction makeCachedFunction(\n CallCache: Class,\n handler: (ArgT, CacheConfigurator) => Handler | ResultT,\n): (ArgT, SideChannel) => Handler {\n const callCacheSync = new CallCache();\n const callCacheAsync = new CallCache();\n const futureCache = new CallCache();\n\n return function* cachedFunction(arg: ArgT, data: SideChannel) {\n const asyncContext = yield* isAsync();\n const callCache = asyncContext ? callCacheAsync : callCacheSync;\n\n const cached = yield* getCachedValueOrWait(\n asyncContext,\n callCache,\n futureCache,\n arg,\n data,\n );\n if (cached.valid) return cached.value;\n\n const cache = new CacheConfigurator(data);\n\n const handlerResult = handler(arg, cache);\n\n let finishLock: ?Lock;\n let value: ResultT;\n\n if (isIterableIterator(handlerResult)) {\n // Flow refines handlerResult to Generator\n const gen = (handlerResult: Generator<*, ResultT, *>);\n\n value = yield* onFirstPause(gen, () => {\n finishLock = setupAsyncLocks(cache, futureCache, arg);\n });\n } else {\n // $FlowIgnore doesn't refine handlerResult to ResultT\n value = (handlerResult: ResultT);\n }\n\n updateFunctionCache(callCache, cache, arg, value);\n\n if (finishLock) {\n futureCache.delete(arg);\n finishLock.release(value);\n }\n\n return value;\n };\n}\n\ntype CacheMap =\n | Map>\n | WeakMap>;\n\nfunction* getCachedValue<\n ArgT,\n ResultT,\n SideChannel,\n // $FlowIssue https://github.com/facebook/flow/issues/4528\n Cache: CacheMap,\n>(\n cache: Cache,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> {\n const cachedValue: CacheEntry | void = cache.get(arg);\n\n if (cachedValue) {\n for (const { value, valid } of cachedValue) {\n if (yield* valid(data)) return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction* getCachedValueOrWait(\n asyncContext: boolean,\n callCache: CacheMap,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n data: SideChannel,\n): Handler<{ valid: true, value: ResultT } | { valid: false, value: null }> {\n const cached = yield* getCachedValue(callCache, arg, data);\n if (cached.valid) {\n return cached;\n }\n\n if (asyncContext) {\n const cached = yield* getCachedValue(futureCache, arg, data);\n if (cached.valid) {\n const value = yield* waitFor(cached.value.promise);\n return { valid: true, value };\n }\n }\n\n return { valid: false, value: null };\n}\n\nfunction setupAsyncLocks(\n config: CacheConfigurator,\n futureCache: CacheMap, SideChannel>,\n arg: ArgT,\n): Lock {\n const finishLock = new Lock();\n\n updateFunctionCache(futureCache, config, arg, finishLock);\n\n return finishLock;\n}\n\nfunction updateFunctionCache<\n ArgT,\n ResultT,\n SideChannel,\n // $FlowIssue https://github.com/facebook/flow/issues/4528\n Cache: CacheMap,\n>(\n cache: Cache,\n config: CacheConfigurator,\n arg: ArgT,\n value: ResultT,\n) {\n if (!config.configured()) config.forever();\n\n let cachedValue: CacheEntry | void = cache.get(arg);\n\n config.deactivate();\n\n switch (config.mode()) {\n case \"forever\":\n cachedValue = [{ value, valid: genTrue }];\n cache.set(arg, cachedValue);\n break;\n case \"invalidate\":\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n break;\n case \"valid\":\n if (cachedValue) {\n cachedValue.push({ value, valid: config.validator() });\n } else {\n cachedValue = [{ value, valid: config.validator() }];\n cache.set(arg, cachedValue);\n }\n }\n}\n\nclass CacheConfigurator {\n _active: boolean = true;\n _never: boolean = false;\n _forever: boolean = false;\n _invalidate: boolean = false;\n\n _configured: boolean = false;\n\n _pairs: Array<[mixed, (SideChannel) => Handler]> = [];\n\n _data: SideChannel;\n\n constructor(data: SideChannel) {\n this._data = data;\n }\n\n simple() {\n return makeSimpleConfigurator(this);\n }\n\n mode() {\n if (this._never) return \"never\";\n if (this._forever) return \"forever\";\n if (this._invalidate) return \"invalidate\";\n return \"valid\";\n }\n\n forever() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never) {\n throw new Error(\"Caching has already been configured with .never()\");\n }\n this._forever = true;\n this._configured = true;\n }\n\n never() {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._forever) {\n throw new Error(\"Caching has already been configured with .forever()\");\n }\n this._never = true;\n this._configured = true;\n }\n\n using(handler: SideChannel => T): T {\n if (!this._active) {\n throw new Error(\"Cannot change caching after evaluation has completed.\");\n }\n if (this._never || this._forever) {\n throw new Error(\n \"Caching has already been configured with .never or .forever()\",\n );\n }\n this._configured = true;\n\n const key = handler(this._data);\n\n const fn = maybeAsync(\n handler,\n `You appear to be using an async cache handler, but Babel has been called synchronously`,\n );\n\n if (isThenable(key)) {\n return key.then(key => {\n this._pairs.push([key, fn]);\n return key;\n });\n }\n\n this._pairs.push([key, fn]);\n return key;\n }\n\n invalidate(handler: SideChannel => T): T {\n this._invalidate = true;\n return this.using(handler);\n }\n\n validator(): SideChannel => Handler {\n const pairs = this._pairs;\n return function*(data: SideChannel) {\n for (const [key, fn] of pairs) {\n if (key !== (yield* fn(data))) return false;\n }\n return true;\n };\n }\n\n deactivate() {\n this._active = false;\n }\n\n configured() {\n return this._configured;\n }\n}\n\nfunction makeSimpleConfigurator(\n cache: CacheConfigurator,\n): SimpleCacheConfigurator {\n function cacheFn(val) {\n if (typeof val === \"boolean\") {\n if (val) cache.forever();\n else cache.never();\n return;\n }\n\n return cache.using(() => assertSimpleType(val()));\n }\n cacheFn.forever = () => cache.forever();\n cacheFn.never = () => cache.never();\n cacheFn.using = cb => cache.using(() => assertSimpleType(cb()));\n cacheFn.invalidate = cb => cache.invalidate(() => assertSimpleType(cb()));\n\n return (cacheFn: any);\n}\n\n// Types are limited here so that in the future these values can be used\n// as part of Babel's caching logic.\ntype SimpleType = string | boolean | number | null | void | Promise;\nexport function assertSimpleType(value: mixed): SimpleType {\n if (isThenable(value)) {\n throw new Error(\n `You appear to be using an async cache handler, ` +\n `which your current version of Babel does not support. ` +\n `We may add support for this in the future, ` +\n `but if you're on the most recent version of @babel/core and still ` +\n `seeing this error, then you'll need to synchronously handle your caching logic.`,\n );\n }\n\n if (\n value != null &&\n typeof value !== \"string\" &&\n typeof value !== \"boolean\" &&\n typeof value !== \"number\"\n ) {\n throw new Error(\n \"Cache keys must be either string, boolean, number, null, or undefined.\",\n );\n }\n return value;\n}\n\nclass Lock {\n released: boolean = false;\n promise: Promise;\n _resolve: (value: T) => void;\n\n constructor() {\n this.promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n }\n\n release(value: T) {\n this.released = true;\n this._resolve(value);\n }\n}\n","// @flow\n\nimport { loadPlugin, loadPreset } from \"./files\";\n\nimport { getItemDescriptor } from \"./item\";\n\nimport {\n makeWeakCacheSync,\n makeStrongCacheSync,\n type CacheConfigurator,\n} from \"./caching\";\n\nimport type {\n ValidatedOptions,\n PluginList,\n PluginItem,\n} from \"./validation/options\";\n\n// Represents a config object and functions to lazily load the descriptors\n// for the plugins and presets so we don't load the plugins/presets unless\n// the options object actually ends up being applicable.\nexport type OptionsAndDescriptors = {\n options: ValidatedOptions,\n plugins: () => Array,\n presets: () => Array,\n};\n\n// Represents a plugin or presets at a given location in a config object.\n// At this point these have been resolved to a specific object or function,\n// but have not yet been executed to call functions with options.\nexport type UnloadedDescriptor = {\n name: string | void,\n value: {} | Function,\n options: {} | void | false,\n dirname: string,\n alias: string,\n ownPass?: boolean,\n file?: {\n request: string,\n resolved: string,\n } | void,\n};\n\nfunction isEqualDescriptor(\n a: UnloadedDescriptor,\n b: UnloadedDescriptor,\n): boolean {\n return (\n a.name === b.name &&\n a.value === b.value &&\n a.options === b.options &&\n a.dirname === b.dirname &&\n a.alias === b.alias &&\n a.ownPass === b.ownPass &&\n (a.file && a.file.request) === (b.file && b.file.request) &&\n (a.file && a.file.resolved) === (b.file && b.file.resolved)\n );\n}\n\nexport type ValidatedFile = {\n filepath: string,\n dirname: string,\n options: ValidatedOptions,\n};\n\n/**\n * Create a set of descriptors from a given options object, preserving\n * descriptor identity based on the identity of the plugin/preset arrays\n * themselves, and potentially on the identity of the plugins/presets + options.\n */\nexport function createCachedDescriptors(\n dirname: string,\n options: ValidatedOptions,\n alias: string,\n): OptionsAndDescriptors {\n const { plugins, presets, passPerPreset } = options;\n return {\n options,\n plugins: plugins\n ? () => createCachedPluginDescriptors(plugins, dirname)(alias)\n : () => [],\n presets: presets\n ? () =>\n createCachedPresetDescriptors(presets, dirname)(alias)(\n !!passPerPreset,\n )\n : () => [],\n };\n}\n\n/**\n * Create a set of descriptors from a given options object, with consistent\n * identity for the descriptors, but not caching based on any specific identity.\n */\nexport function createUncachedDescriptors(\n dirname: string,\n options: ValidatedOptions,\n alias: string,\n): OptionsAndDescriptors {\n // The returned result here is cached to represent a config object in\n // memory, so we build and memoize the descriptors to ensure the same\n // values are returned consistently.\n let plugins;\n let presets;\n\n return {\n options,\n plugins: () => {\n if (!plugins) {\n plugins = createPluginDescriptors(\n options.plugins || [],\n dirname,\n alias,\n );\n }\n return plugins;\n },\n presets: () => {\n if (!presets) {\n presets = createPresetDescriptors(\n options.presets || [],\n dirname,\n alias,\n !!options.passPerPreset,\n );\n }\n return presets;\n },\n };\n}\n\nconst PRESET_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPresetDescriptors = makeWeakCacheSync(\n (items: PluginList, cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n makeStrongCacheSync((passPerPreset: boolean) =>\n createPresetDescriptors(items, dirname, alias, passPerPreset).map(\n // Items are cached using the overall preset array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PRESET_DESCRIPTOR_CACHE, desc),\n ),\n ),\n );\n },\n);\n\nconst PLUGIN_DESCRIPTOR_CACHE = new WeakMap();\nconst createCachedPluginDescriptors = makeWeakCacheSync(\n (items: PluginList, cache: CacheConfigurator) => {\n const dirname = cache.using(dir => dir);\n return makeStrongCacheSync((alias: string) =>\n createPluginDescriptors(items, dirname, alias).map(\n // Items are cached using the overall plugin array identity when\n // possibly, but individual descriptors are also cached if a match\n // can be found in the previously-used descriptor lists.\n desc => loadCachedDescriptor(PLUGIN_DESCRIPTOR_CACHE, desc),\n ),\n );\n },\n);\n\n/**\n * When no options object is given in a descriptor, this object is used\n * as a WeakMap key in order to have consistent identity.\n */\nconst DEFAULT_OPTIONS = {};\n\n/**\n * Given the cache and a descriptor, returns a matching descriptor from the\n * cache, or else returns the input descriptor and adds it to the cache for\n * next time.\n */\nfunction loadCachedDescriptor(\n cache: WeakMap<{} | Function, WeakMap<{}, Array>>,\n desc: UnloadedDescriptor,\n) {\n const { value, options = DEFAULT_OPTIONS } = desc;\n if (options === false) return desc;\n\n let cacheByOptions = cache.get(value);\n if (!cacheByOptions) {\n cacheByOptions = new WeakMap();\n cache.set(value, cacheByOptions);\n }\n\n let possibilities = cacheByOptions.get(options);\n if (!possibilities) {\n possibilities = [];\n cacheByOptions.set(options, possibilities);\n }\n\n if (possibilities.indexOf(desc) === -1) {\n const matches = possibilities.filter(possibility =>\n isEqualDescriptor(possibility, desc),\n );\n if (matches.length > 0) {\n return matches[0];\n }\n\n possibilities.push(desc);\n }\n\n return desc;\n}\n\nfunction createPresetDescriptors(\n items: PluginList,\n dirname: string,\n alias: string,\n passPerPreset: boolean,\n): Array {\n return createDescriptors(\"preset\", items, dirname, alias, passPerPreset);\n}\n\nfunction createPluginDescriptors(\n items: PluginList,\n dirname: string,\n alias: string,\n): Array {\n return createDescriptors(\"plugin\", items, dirname, alias);\n}\n\nfunction createDescriptors(\n type: \"plugin\" | \"preset\",\n items: PluginList,\n dirname: string,\n alias: string,\n ownPass?: boolean,\n): Array {\n const descriptors = items.map((item, index) =>\n createDescriptor(item, dirname, {\n type,\n alias: `${alias}$${index}`,\n ownPass: !!ownPass,\n }),\n );\n\n assertNoDuplicates(descriptors);\n\n return descriptors;\n}\n\n/**\n * Given a plugin/preset item, resolve it into a standard format.\n */\nexport function createDescriptor(\n pair: PluginItem,\n dirname: string,\n {\n type,\n alias,\n ownPass,\n }: {\n type?: \"plugin\" | \"preset\",\n alias: string,\n ownPass?: boolean,\n },\n): UnloadedDescriptor {\n const desc = getItemDescriptor(pair);\n if (desc) {\n return desc;\n }\n\n let name;\n let options;\n let value = pair;\n if (Array.isArray(value)) {\n if (value.length === 3) {\n // $FlowIgnore - Flow doesn't like the multiple tuple types.\n [value, options, name] = value;\n } else {\n [value, options] = value;\n }\n }\n\n let file = undefined;\n let filepath = null;\n if (typeof value === \"string\") {\n if (typeof type !== \"string\") {\n throw new Error(\n \"To resolve a string-based item, the type of item must be given\",\n );\n }\n const resolver = type === \"plugin\" ? loadPlugin : loadPreset;\n const request = value;\n\n ({ filepath, value } = resolver(value, dirname));\n\n file = {\n request,\n resolved: filepath,\n };\n }\n\n if (!value) {\n throw new Error(`Unexpected falsy value: ${String(value)}`);\n }\n\n if (typeof value === \"object\" && value.__esModule) {\n if (value.default) {\n value = value.default;\n } else {\n throw new Error(\"Must export a default export when using ES6 modules.\");\n }\n }\n\n if (typeof value !== \"object\" && typeof value !== \"function\") {\n throw new Error(\n `Unsupported format: ${typeof value}. Expected an object or a function.`,\n );\n }\n\n if (filepath !== null && typeof value === \"object\" && value) {\n // We allow object values for plugins/presets nested directly within a\n // config object, because it can be useful to define them in nested\n // configuration contexts.\n throw new Error(\n `Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`,\n );\n }\n\n return {\n name,\n alias: filepath || alias,\n value,\n options,\n dirname,\n ownPass,\n file,\n };\n}\n\nfunction assertNoDuplicates(items: Array): void {\n const map = new Map();\n\n for (const item of items) {\n if (typeof item.value !== \"function\") continue;\n\n let nameMap = map.get(item.value);\n if (!nameMap) {\n nameMap = new Set();\n map.set(item.value, nameMap);\n }\n\n if (nameMap.has(item.name)) {\n const conflicts = items.filter(i => i.value === item.value);\n throw new Error(\n [\n `Duplicate plugin/preset detected.`,\n `If you'd like to use two separate instances of a plugin,`,\n `they need separate names, e.g.`,\n ``,\n ` plugins: [`,\n ` ['some-plugin', {}],`,\n ` ['some-plugin', {}, 'some unique name'],`,\n ` ]`,\n ``,\n `Duplicates detected are:`,\n `${JSON.stringify(conflicts, null, 2)}`,\n ].join(\"\\n\"),\n );\n }\n\n nameMap.add(item.name);\n }\n}\n","// @flow\n\nimport type { PluginTarget, PluginOptions } from \"./validation/options\";\n\nimport path from \"path\";\nimport {\n createDescriptor,\n type UnloadedDescriptor,\n} from \"./config-descriptors\";\n\nexport function createItemFromDescriptor(desc: UnloadedDescriptor): ConfigItem {\n return new ConfigItem(desc);\n}\n\n/**\n * Create a config item using the same value format used in Babel's config\n * files. Items returned from this function should be cached by the caller\n * ideally, as recreating the config item will mean re-resolving the item\n * and re-evaluating the plugin/preset function.\n */\nexport function createConfigItem(\n value:\n | PluginTarget\n | [PluginTarget, PluginOptions]\n | [PluginTarget, PluginOptions, string | void],\n {\n dirname = \".\",\n type,\n }: {\n dirname?: string,\n type?: \"preset\" | \"plugin\",\n } = {},\n): ConfigItem {\n const descriptor = createDescriptor(value, path.resolve(dirname), {\n type,\n alias: \"programmatic item\",\n });\n\n return createItemFromDescriptor(descriptor);\n}\n\nexport function getItemDescriptor(item: mixed): UnloadedDescriptor | void {\n if (item instanceof ConfigItem) {\n return item._descriptor;\n }\n\n return undefined;\n}\n\nexport type { ConfigItem };\n\n/**\n * A public representation of a plugin/preset that will _eventually_ be load.\n * Users can use this to interact with the results of a loaded Babel\n * configuration.\n *\n * Any changes to public properties of this class should be considered a\n * breaking change to Babel's API.\n */\nclass ConfigItem {\n /**\n * The private underlying descriptor that Babel actually cares about.\n * If you access this, you are a bad person.\n */\n _descriptor: UnloadedDescriptor;\n\n /**\n * The resolved value of the item itself.\n */\n value: {} | Function;\n\n /**\n * The options, if any, that were passed to the item.\n * Mutating this will lead to undefined behavior.\n *\n * \"false\" means that this item has been disabled.\n */\n options: {} | void | false;\n\n /**\n * The directory that the options for this item are relative to.\n */\n dirname: string;\n\n /**\n * Get the name of the plugin, if the user gave it one.\n */\n name: string | void;\n\n /**\n * Data about the file that the item was loaded from, if Babel knows it.\n */\n file: {\n // The requested path, e.g. \"@babel/env\".\n request: string,\n\n // The resolved absolute path of the file.\n resolved: string,\n } | void;\n\n constructor(descriptor: UnloadedDescriptor) {\n // Make people less likely to stumble onto this if they are exploring\n // programmatically, and also make sure that if people happen to\n // pass the item through JSON.stringify, it doesn't show up.\n this._descriptor = descriptor;\n Object.defineProperty(this, \"_descriptor\", ({ enumerable: false }: any));\n\n this.value = this._descriptor.value;\n this.options = this._descriptor.options;\n this.dirname = this._descriptor.dirname;\n this.name = this._descriptor.name;\n this.file = this._descriptor.file\n ? {\n request: this._descriptor.file.request,\n resolved: this._descriptor.file.resolved,\n }\n : undefined;\n\n // Freeze the object to make it clear that people shouldn't expect mutating\n // this object to do anything. A new item should be created if they want\n // to change something.\n Object.freeze(this);\n }\n}\n\nObject.freeze(ConfigItem.prototype);\n","// @flow\n\nimport type { PluginObject } from \"./validation/plugins\";\n\nexport default class Plugin {\n key: ?string;\n manipulateOptions: Function | void;\n post: Function | void;\n pre: Function | void;\n visitor: {};\n\n parserOverride: Function | void;\n generatorOverride: Function | void;\n\n options: {};\n\n constructor(plugin: PluginObject, options: {}, key?: string) {\n this.key = plugin.name || key;\n\n this.manipulateOptions = plugin.manipulateOptions;\n this.post = plugin.post;\n this.pre = plugin.pre;\n this.visitor = plugin.visitor || {};\n this.parserOverride = plugin.parserOverride;\n this.generatorOverride = plugin.generatorOverride;\n\n this.options = options;\n }\n}\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","// @flow\n\nexport default {\n auxiliaryComment: {\n message: \"Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`\",\n },\n blacklist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n breakConfig: {\n message: \"This is not a necessary option in Babel 6\",\n },\n experimental: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n externalHelpers: {\n message:\n \"Use the `external-helpers` plugin instead. \" +\n \"Check out http://babeljs.io/docs/plugins/external-helpers/\",\n },\n extra: {\n message: \"\",\n },\n jsxPragma: {\n message:\n \"use the `pragma` option in the `react-jsx` plugin. \" +\n \"Check out http://babeljs.io/docs/plugins/transform-react-jsx/\",\n },\n loose: {\n message:\n \"Specify the `loose` option for the relevant plugin you are using \" +\n \"or use a preset that sets the option.\",\n },\n metadataUsedHelpers: {\n message: \"Not required anymore as this is enabled by default\",\n },\n modules: {\n message:\n \"Use the corresponding module transform plugin in the `plugins` option. \" +\n \"Check out http://babeljs.io/docs/plugins/#modules\",\n },\n nonStandard: {\n message:\n \"Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. \" +\n \"Also check out the react preset http://babeljs.io/docs/plugins/preset-react/\",\n },\n optional: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n sourceMapName: {\n message:\n \"The `sourceMapName` option has been removed because it makes more sense for the \" +\n \"tooling that calls Babel to assign `map.file` themselves.\",\n },\n stage: {\n message:\n \"Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets\",\n },\n whitelist: {\n message: \"Put the specific transforms you want in the `plugins` option\",\n },\n\n resolveModuleSource: {\n version: 6,\n message: \"Use `babel-plugin-module-resolver@3`'s 'resolvePath' options\",\n },\n\n metadata: {\n version: 6,\n message:\n \"Generated plugin metadata is always included in the output result\",\n },\n\n sourceMapTarget: {\n version: 6,\n message:\n \"The `sourceMapTarget` option has been removed because it makes more sense for the tooling \" +\n \"that calls Babel to assign `map.file` themselves.\",\n },\n};\n","// @flow\n\nimport type {\n ConfigFileSearch,\n BabelrcSearch,\n IgnoreList,\n IgnoreItem,\n PluginList,\n PluginItem,\n PluginTarget,\n ConfigApplicableTest,\n SourceMapsOption,\n SourceTypeOption,\n CompactOption,\n RootInputSourceMapOption,\n NestingPath,\n CallerMetadata,\n RootMode,\n} from \"./options\";\n\nexport type ValidatorSet = {\n [string]: Validator,\n};\n\nexport type Validator = (OptionPath, mixed) => T;\n\nexport function msg(loc: NestingPath | GeneralPath) {\n switch (loc.type) {\n case \"root\":\n return ``;\n case \"env\":\n return `${msg(loc.parent)}.env[\"${loc.name}\"]`;\n case \"overrides\":\n return `${msg(loc.parent)}.overrides[${loc.index}]`;\n case \"option\":\n return `${msg(loc.parent)}.${loc.name}`;\n case \"access\":\n return `${msg(loc.parent)}[${JSON.stringify(loc.name)}]`;\n default:\n throw new Error(`Assertion failure: Unknown type ${loc.type}`);\n }\n}\n\nexport function access(loc: GeneralPath, name: string | number): AccessPath {\n return {\n type: \"access\",\n name,\n parent: loc,\n };\n}\n\nexport type OptionPath = $ReadOnly<{\n type: \"option\",\n name: string,\n parent: NestingPath,\n}>;\ntype AccessPath = $ReadOnly<{\n type: \"access\",\n name: string | number,\n parent: GeneralPath,\n}>;\ntype GeneralPath = OptionPath | AccessPath;\n\nexport function assertRootMode(loc: OptionPath, value: mixed): RootMode | void {\n if (\n value !== undefined &&\n value !== \"root\" &&\n value !== \"upward\" &&\n value !== \"upward-optional\"\n ) {\n throw new Error(\n `${msg(loc)} must be a \"root\", \"upward\", \"upward-optional\" or undefined`,\n );\n }\n return value;\n}\n\nexport function assertSourceMaps(\n loc: OptionPath,\n value: mixed,\n): SourceMapsOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n value !== \"inline\" &&\n value !== \"both\"\n ) {\n throw new Error(\n `${msg(loc)} must be a boolean, \"inline\", \"both\", or undefined`,\n );\n }\n return value;\n}\n\nexport function assertCompact(\n loc: OptionPath,\n value: mixed,\n): CompactOption | void {\n if (value !== undefined && typeof value !== \"boolean\" && value !== \"auto\") {\n throw new Error(`${msg(loc)} must be a boolean, \"auto\", or undefined`);\n }\n return value;\n}\n\nexport function assertSourceType(\n loc: OptionPath,\n value: mixed,\n): SourceTypeOption | void {\n if (\n value !== undefined &&\n value !== \"module\" &&\n value !== \"script\" &&\n value !== \"unambiguous\"\n ) {\n throw new Error(\n `${msg(loc)} must be \"module\", \"script\", \"unambiguous\", or undefined`,\n );\n }\n return value;\n}\n\nexport function assertCallerMetadata(\n loc: OptionPath,\n value: mixed,\n): CallerMetadata | void {\n const obj = assertObject(loc, value);\n if (obj) {\n if (typeof obj[(\"name\": string)] !== \"string\") {\n throw new Error(\n `${msg(loc)} set but does not contain \"name\" property string`,\n );\n }\n\n for (const prop of Object.keys(obj)) {\n const propLoc = access(loc, prop);\n const value = obj[prop];\n if (\n value != null &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\" &&\n typeof value !== \"number\"\n ) {\n // NOTE(logan): I'm limiting the type here so that we can guarantee that\n // the \"caller\" value will serialize to JSON nicely. We can always\n // allow more complex structures later though.\n throw new Error(\n `${msg(\n propLoc,\n )} must be null, undefined, a boolean, a string, or a number.`,\n );\n }\n }\n }\n return (value: any);\n}\n\nexport function assertInputSourceMap(\n loc: OptionPath,\n value: mixed,\n): RootInputSourceMapOption | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n (typeof value !== \"object\" || !value)\n ) {\n throw new Error(`${msg(loc)} must be a boolean, object, or undefined`);\n }\n return value;\n}\n\nexport function assertString(loc: GeneralPath, value: mixed): string | void {\n if (value !== undefined && typeof value !== \"string\") {\n throw new Error(`${msg(loc)} must be a string, or undefined`);\n }\n return value;\n}\n\nexport function assertFunction(\n loc: GeneralPath,\n value: mixed,\n): Function | void {\n if (value !== undefined && typeof value !== \"function\") {\n throw new Error(`${msg(loc)} must be a function, or undefined`);\n }\n return value;\n}\n\nexport function assertBoolean(loc: GeneralPath, value: mixed): boolean | void {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new Error(`${msg(loc)} must be a boolean, or undefined`);\n }\n return value;\n}\n\nexport function assertObject(loc: GeneralPath, value: mixed): {} | void {\n if (\n value !== undefined &&\n (typeof value !== \"object\" || Array.isArray(value) || !value)\n ) {\n throw new Error(`${msg(loc)} must be an object, or undefined`);\n }\n return value;\n}\n\nexport function assertArray(\n loc: GeneralPath,\n value: mixed,\n): ?$ReadOnlyArray {\n if (value != null && !Array.isArray(value)) {\n throw new Error(`${msg(loc)} must be an array, or undefined`);\n }\n return value;\n}\n\nexport function assertIgnoreList(\n loc: OptionPath,\n value: mixed,\n): IgnoreList | void {\n const arr = assertArray(loc, value);\n if (arr) {\n arr.forEach((item, i) => assertIgnoreItem(access(loc, i), item));\n }\n return (arr: any);\n}\nfunction assertIgnoreItem(loc: GeneralPath, value: mixed): IgnoreItem {\n if (\n typeof value !== \"string\" &&\n typeof value !== \"function\" &&\n !(value instanceof RegExp)\n ) {\n throw new Error(\n `${msg(\n loc,\n )} must be an array of string/Function/RegExp values, or undefined`,\n );\n }\n return value;\n}\n\nexport function assertConfigApplicableTest(\n loc: OptionPath,\n value: mixed,\n): ConfigApplicableTest | void {\n if (value === undefined) return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a string/Function/RegExp, or an array of those`,\n );\n }\n return (value: any);\n}\n\nfunction checkValidTest(value: mixed): boolean {\n return (\n typeof value === \"string\" ||\n typeof value === \"function\" ||\n value instanceof RegExp\n );\n}\n\nexport function assertConfigFileSearch(\n loc: OptionPath,\n value: mixed,\n): ConfigFileSearch | void {\n if (\n value !== undefined &&\n typeof value !== \"boolean\" &&\n typeof value !== \"string\"\n ) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string, ` +\n `got ${JSON.stringify((value: any))}`,\n );\n }\n\n return value;\n}\n\nexport function assertBabelrcSearch(\n loc: OptionPath,\n value: mixed,\n): BabelrcSearch | void {\n if (value === undefined || typeof value === \"boolean\") return value;\n\n if (Array.isArray(value)) {\n value.forEach((item, i) => {\n if (!checkValidTest(item)) {\n throw new Error(\n `${msg(access(loc, i))} must be a string/Function/RegExp.`,\n );\n }\n });\n } else if (!checkValidTest(value)) {\n throw new Error(\n `${msg(loc)} must be a undefined, a boolean, a string/Function/RegExp ` +\n `or an array of those, got ${JSON.stringify((value: any))}`,\n );\n }\n return (value: any);\n}\n\nexport function assertPluginList(\n loc: OptionPath,\n value: mixed,\n): PluginList | void {\n const arr = assertArray(loc, value);\n if (arr) {\n // Loop instead of using `.map` in order to preserve object identity\n // for plugin array for use during config chain processing.\n arr.forEach((item, i) => assertPluginItem(access(loc, i), item));\n }\n return (arr: any);\n}\nfunction assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n throw new Error(`${msg(loc)} must include an object`);\n }\n\n if (value.length > 3) {\n throw new Error(`${msg(loc)} may only be a two-tuple or three-tuple`);\n }\n\n assertPluginTarget(access(loc, 0), value[0]);\n\n if (value.length > 1) {\n const opts = value[1];\n if (\n opts !== undefined &&\n opts !== false &&\n (typeof opts !== \"object\" || Array.isArray(opts) || opts === null)\n ) {\n throw new Error(\n `${msg(access(loc, 1))} must be an object, false, or undefined`,\n );\n }\n }\n if (value.length === 3) {\n const name = value[2];\n if (name !== undefined && typeof name !== \"string\") {\n throw new Error(\n `${msg(access(loc, 2))} must be a string, or undefined`,\n );\n }\n }\n } else {\n assertPluginTarget(loc, value);\n }\n\n return (value: any);\n}\nfunction assertPluginTarget(loc: GeneralPath, value: mixed): PluginTarget {\n if (\n (typeof value !== \"object\" || !value) &&\n typeof value !== \"string\" &&\n typeof value !== \"function\"\n ) {\n throw new Error(`${msg(loc)} must be a string, object, function`);\n }\n return value;\n}\n","// @flow\n\nimport type { ConfigItem } from \"../item\";\nimport Plugin from \"../plugin\";\n\nimport removed from \"./removed\";\nimport {\n msg,\n access,\n assertString,\n assertBoolean,\n assertObject,\n assertArray,\n assertCallerMetadata,\n assertInputSourceMap,\n assertIgnoreList,\n assertPluginList,\n assertConfigApplicableTest,\n assertConfigFileSearch,\n assertBabelrcSearch,\n assertFunction,\n assertRootMode,\n assertSourceMaps,\n assertCompact,\n assertSourceType,\n type ValidatorSet,\n type Validator,\n type OptionPath,\n} from \"./option-assertions\";\n\nconst ROOT_VALIDATORS: ValidatorSet = {\n cwd: (assertString: Validator<$PropertyType>),\n root: (assertString: Validator<$PropertyType>),\n rootMode: (assertRootMode: Validator<\n $PropertyType,\n >),\n configFile: (assertConfigFileSearch: Validator<\n $PropertyType,\n >),\n\n caller: (assertCallerMetadata: Validator<\n $PropertyType,\n >),\n filename: (assertString: Validator<\n $PropertyType,\n >),\n filenameRelative: (assertString: Validator<\n $PropertyType,\n >),\n code: (assertBoolean: Validator<$PropertyType>),\n ast: (assertBoolean: Validator<$PropertyType>),\n\n envName: (assertString: Validator<\n $PropertyType,\n >),\n};\n\nconst BABELRC_VALIDATORS: ValidatorSet = {\n babelrc: (assertBoolean: Validator<\n $PropertyType,\n >),\n babelrcRoots: (assertBabelrcSearch: Validator<\n $PropertyType,\n >),\n};\n\nconst NONPRESET_VALIDATORS: ValidatorSet = {\n extends: (assertString: Validator<\n $PropertyType,\n >),\n ignore: (assertIgnoreList: Validator<\n $PropertyType,\n >),\n only: (assertIgnoreList: Validator<$PropertyType>),\n};\n\nconst COMMON_VALIDATORS: ValidatorSet = {\n // TODO: Should 'inputSourceMap' be moved to be a root-only option?\n // We may want a boolean-only version to be a common option, with the\n // object only allowed as a root config argument.\n inputSourceMap: (assertInputSourceMap: Validator<\n $PropertyType,\n >),\n presets: (assertPluginList: Validator<\n $PropertyType,\n >),\n plugins: (assertPluginList: Validator<\n $PropertyType,\n >),\n passPerPreset: (assertBoolean: Validator<\n $PropertyType,\n >),\n\n env: (assertEnvSet: Validator<$PropertyType>),\n overrides: (assertOverridesList: Validator<\n $PropertyType,\n >),\n\n // We could limit these to 'overrides' blocks, but it's not clear why we'd\n // bother, when the ability to limit a config to a specific set of files\n // is a fairly general useful feature.\n test: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n include: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n exclude: (assertConfigApplicableTest: Validator<\n $PropertyType,\n >),\n\n retainLines: (assertBoolean: Validator<\n $PropertyType,\n >),\n comments: (assertBoolean: Validator<\n $PropertyType,\n >),\n shouldPrintComment: (assertFunction: Validator<\n $PropertyType,\n >),\n compact: (assertCompact: Validator<\n $PropertyType,\n >),\n minified: (assertBoolean: Validator<\n $PropertyType,\n >),\n auxiliaryCommentBefore: (assertString: Validator<\n $PropertyType,\n >),\n auxiliaryCommentAfter: (assertString: Validator<\n $PropertyType,\n >),\n sourceType: (assertSourceType: Validator<\n $PropertyType,\n >),\n wrapPluginVisitorMethod: (assertFunction: Validator<\n $PropertyType,\n >),\n highlightCode: (assertBoolean: Validator<\n $PropertyType,\n >),\n sourceMaps: (assertSourceMaps: Validator<\n $PropertyType,\n >),\n sourceMap: (assertSourceMaps: Validator<\n $PropertyType,\n >),\n sourceFileName: (assertString: Validator<\n $PropertyType,\n >),\n sourceRoot: (assertString: Validator<\n $PropertyType,\n >),\n getModuleId: (assertFunction: Validator<\n $PropertyType,\n >),\n moduleRoot: (assertString: Validator<\n $PropertyType,\n >),\n moduleIds: (assertBoolean: Validator<\n $PropertyType,\n >),\n moduleId: (assertString: Validator<\n $PropertyType,\n >),\n parserOpts: (assertObject: Validator<\n $PropertyType,\n >),\n generatorOpts: (assertObject: Validator<\n $PropertyType,\n >),\n};\nexport type InputOptions = ValidatedOptions;\n\nexport type ValidatedOptions = {\n cwd?: string,\n filename?: string,\n filenameRelative?: string,\n babelrc?: boolean,\n babelrcRoots?: BabelrcSearch,\n configFile?: ConfigFileSearch,\n root?: string,\n rootMode?: RootMode,\n code?: boolean,\n ast?: boolean,\n inputSourceMap?: RootInputSourceMapOption,\n envName?: string,\n caller?: CallerMetadata,\n\n extends?: string,\n env?: EnvSet,\n ignore?: IgnoreList,\n only?: IgnoreList,\n overrides?: OverridesList,\n\n // Generally verify if a given config object should be applied to the given file.\n test?: ConfigApplicableTest,\n include?: ConfigApplicableTest,\n exclude?: ConfigApplicableTest,\n\n presets?: PluginList,\n plugins?: PluginList,\n passPerPreset?: boolean,\n\n // Options for @babel/generator\n retainLines?: boolean,\n comments?: boolean,\n shouldPrintComment?: Function,\n compact?: CompactOption,\n minified?: boolean,\n auxiliaryCommentBefore?: string,\n auxiliaryCommentAfter?: string,\n\n // Parser\n sourceType?: SourceTypeOption,\n\n wrapPluginVisitorMethod?: Function,\n highlightCode?: boolean,\n\n // Sourcemap generation options.\n sourceMaps?: SourceMapsOption,\n sourceMap?: SourceMapsOption,\n sourceFileName?: string,\n sourceRoot?: string,\n\n // AMD/UMD/SystemJS module naming options.\n getModuleId?: Function,\n moduleRoot?: string,\n moduleIds?: boolean,\n moduleId?: string,\n\n // Deprecate top level parserOpts\n parserOpts?: {},\n // Deprecate top level generatorOpts\n generatorOpts?: {},\n};\n\nexport type CallerMetadata = {\n // If 'caller' is specified, require that the name is given for debugging\n // messages.\n name: string,\n};\nexport type EnvSet = {\n [string]: ?T,\n};\nexport type IgnoreItem = string | Function | RegExp;\nexport type IgnoreList = $ReadOnlyArray;\n\nexport type PluginOptions = {} | void | false;\nexport type PluginTarget = string | {} | Function;\nexport type PluginItem =\n | ConfigItem\n | Plugin\n | PluginTarget\n | [PluginTarget, PluginOptions]\n | [PluginTarget, PluginOptions, string | void];\nexport type PluginList = $ReadOnlyArray;\n\nexport type OverridesList = Array;\nexport type ConfigApplicableTest = IgnoreItem | Array;\n\nexport type ConfigFileSearch = string | boolean;\nexport type BabelrcSearch = boolean | IgnoreItem | IgnoreList;\nexport type SourceMapsOption = boolean | \"inline\" | \"both\";\nexport type SourceTypeOption = \"module\" | \"script\" | \"unambiguous\";\nexport type CompactOption = boolean | \"auto\";\nexport type RootInputSourceMapOption = {} | boolean;\nexport type RootMode = \"root\" | \"upward\" | \"upward-optional\";\n\nexport type OptionsSource =\n | \"arguments\"\n | \"configfile\"\n | \"babelrcfile\"\n | \"extendsfile\"\n | \"preset\"\n | \"plugin\";\n\ntype RootPath = $ReadOnly<{\n type: \"root\",\n source: OptionsSource,\n}>;\ntype OverridesPath = $ReadOnly<{\n type: \"overrides\",\n index: number,\n parent: RootPath,\n}>;\ntype EnvPath = $ReadOnly<{\n type: \"env\",\n name: string,\n parent: RootPath | OverridesPath,\n}>;\nexport type NestingPath = RootPath | OverridesPath | EnvPath;\n\nfunction getSource(loc: NestingPath): OptionsSource {\n return loc.type === \"root\" ? loc.source : getSource(loc.parent);\n}\n\nexport function validate(type: OptionsSource, opts: {}): ValidatedOptions {\n return validateNested(\n {\n type: \"root\",\n source: type,\n },\n opts,\n );\n}\n\nfunction validateNested(loc: NestingPath, opts: {}) {\n const type = getSource(loc);\n\n assertNoDuplicateSourcemap(opts);\n\n Object.keys(opts).forEach(key => {\n const optLoc = {\n type: \"option\",\n name: key,\n parent: loc,\n };\n\n if (type === \"preset\" && NONPRESET_VALIDATORS[key]) {\n throw new Error(`${msg(optLoc)} is not allowed in preset options`);\n }\n if (type !== \"arguments\" && ROOT_VALIDATORS[key]) {\n throw new Error(\n `${msg(optLoc)} is only allowed in root programmatic options`,\n );\n }\n if (\n type !== \"arguments\" &&\n type !== \"configfile\" &&\n BABELRC_VALIDATORS[key]\n ) {\n if (type === \"babelrcfile\" || type === \"extendsfile\") {\n throw new Error(\n `${msg(\n optLoc,\n )} is not allowed in .babelrc or \"extends\"ed files, only in root programmatic options, ` +\n `or babel.config.js/config file options`,\n );\n }\n\n throw new Error(\n `${msg(\n optLoc,\n )} is only allowed in root programmatic options, or babel.config.js/config file options`,\n );\n }\n\n const validator =\n COMMON_VALIDATORS[key] ||\n NONPRESET_VALIDATORS[key] ||\n BABELRC_VALIDATORS[key] ||\n ROOT_VALIDATORS[key] ||\n (throwUnknownError: Validator);\n\n validator(optLoc, opts[key]);\n });\n\n return (opts: any);\n}\n\nfunction throwUnknownError(loc: OptionPath) {\n const key = loc.name;\n\n if (removed[key]) {\n const { message, version = 5 } = removed[key];\n\n throw new ReferenceError(\n `Using removed Babel ${version} option: ${msg(loc)} - ${message}`,\n );\n } else {\n // eslint-disable-next-line max-len\n const unknownOptErr = `Unknown option: ${msg(\n loc,\n )}. Check out https://babeljs.io/docs/en/babel-core/#options for more information about options.`;\n\n throw new ReferenceError(unknownOptErr);\n }\n}\n\nfunction has(obj: {}, key: string) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction assertNoDuplicateSourcemap(opts: {}): void {\n if (has(opts, \"sourceMap\") && has(opts, \"sourceMaps\")) {\n throw new Error(\".sourceMap is an alias for .sourceMaps, cannot use both\");\n }\n}\n\nfunction assertEnvSet(loc: OptionPath, value: mixed): EnvSet {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside of another .env block`);\n }\n const parent: RootPath | OverridesPath = loc.parent;\n\n const obj = assertObject(loc, value);\n if (obj) {\n // Validate but don't copy the .env object in order to preserve\n // object identity for use during config chain processing.\n for (const envName of Object.keys(obj)) {\n const env = assertObject(access(loc, envName), obj[envName]);\n if (!env) continue;\n\n const envLoc = {\n type: \"env\",\n name: envName,\n parent,\n };\n validateNested(envLoc, env);\n }\n }\n return (obj: any);\n}\n\nfunction assertOverridesList(loc: OptionPath, value: mixed): OverridesList {\n if (loc.parent.type === \"env\") {\n throw new Error(`${msg(loc)} is not allowed inside an .env block`);\n }\n if (loc.parent.type === \"overrides\") {\n throw new Error(`${msg(loc)} is not allowed inside an .overrides block`);\n }\n const parent: RootPath = loc.parent;\n\n const arr = assertArray(loc, value);\n if (arr) {\n for (const [index, item] of arr.entries()) {\n const objLoc = access(loc, index);\n const env = assertObject(objLoc, item);\n if (!env) throw new Error(`${msg(objLoc)} must be an object`);\n\n const overridesLoc = {\n type: \"overrides\",\n index,\n parent,\n };\n validateNested(overridesLoc, env);\n }\n }\n return (arr: any);\n}\n","var toString = require('./toString');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n/**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\nfunction escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n}\n\nmodule.exports = escapeRegExp;\n","// @flow\nimport path from \"path\";\nimport escapeRegExp from \"lodash/escapeRegExp\";\n\nconst sep = `\\\\${path.sep}`;\nconst endSep = `(?:${sep}|$)`;\n\nconst substitution = `[^${sep}]+`;\n\nconst starPat = `(?:${substitution}${sep})`;\nconst starPatLast = `(?:${substitution}${endSep})`;\n\nconst starStarPat = `${starPat}*?`;\nconst starStarPatLast = `${starPat}*?${starPatLast}?`;\n\n/**\n * Implement basic pattern matching that will allow users to do the simple\n * tests with * and **. If users want full complex pattern matching, then can\n * always use regex matching, or function validation.\n */\nexport default function pathToPattern(\n pattern: string,\n dirname: string,\n): RegExp {\n const parts = path.resolve(dirname, pattern).split(path.sep);\n\n return new RegExp(\n [\n \"^\",\n ...parts.map((part, i) => {\n const last = i === parts.length - 1;\n\n // ** matches 0 or more path parts.\n if (part === \"**\") return last ? starStarPatLast : starStarPat;\n\n // * matches 1 path part.\n if (part === \"*\") return last ? starPatLast : starPat;\n\n // *.ext matches a wildcard with an extension.\n if (part.indexOf(\"*.\") === 0) {\n return (\n substitution + escapeRegExp(part.slice(1)) + (last ? endSep : sep)\n );\n }\n\n // Otherwise match the pattern text.\n return escapeRegExp(part) + (last ? endSep : sep);\n }),\n ].join(\"\"),\n );\n}\n","// @flow\n\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport type { Handler } from \"gensync\";\nimport {\n validate,\n type ValidatedOptions,\n type IgnoreList,\n type ConfigApplicableTest,\n type BabelrcSearch,\n type CallerMetadata,\n} from \"./validation/options\";\nimport pathPatternToRegex from \"./pattern-to-regex\";\n\nconst debug = buildDebug(\"babel:config:config-chain\");\n\nimport {\n findPackageData,\n findRelativeConfig,\n findRootConfig,\n loadConfig,\n type ConfigFile,\n type IgnoreFile,\n type FilePackageData,\n} from \"./files\";\n\nimport { makeWeakCacheSync, makeStrongCacheSync } from \"./caching\";\n\nimport {\n createCachedDescriptors,\n createUncachedDescriptors,\n type UnloadedDescriptor,\n type OptionsAndDescriptors,\n type ValidatedFile,\n} from \"./config-descriptors\";\n\nexport type ConfigChain = {\n plugins: Array,\n presets: Array,\n options: Array,\n};\n\nexport type PresetInstance = {\n options: ValidatedOptions,\n alias: string,\n dirname: string,\n};\n\nexport type ConfigContext = {\n filename: string | void,\n cwd: string,\n root: string,\n envName: string,\n caller: CallerMetadata | void,\n};\n\n/**\n * Build a config chain for a given preset.\n */\nexport function* buildPresetChain(\n arg: PresetInstance,\n context: *,\n): Handler {\n const chain = yield* buildPresetChainWalker(arg, context);\n if (!chain) return null;\n\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => normalizeOptions(o)),\n };\n}\n\nexport const buildPresetChainWalker: (\n arg: PresetInstance,\n context: *,\n) => * = makeChainWalker({\n init: arg => arg,\n root: preset => loadPresetDescriptors(preset),\n env: (preset, envName) => loadPresetEnvDescriptors(preset)(envName),\n overrides: (preset, index) => loadPresetOverridesDescriptors(preset)(index),\n overridesEnv: (preset, index, envName) =>\n loadPresetOverridesEnvDescriptors(preset)(index)(envName),\n});\nconst loadPresetDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n buildRootDescriptors(preset, preset.alias, createUncachedDescriptors),\n);\nconst loadPresetEnvDescriptors = makeWeakCacheSync((preset: PresetInstance) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadPresetOverridesDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadPresetOverridesEnvDescriptors = makeWeakCacheSync(\n (preset: PresetInstance) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n preset,\n preset.alias,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nexport type RootConfigChain = ConfigChain & {\n babelrc: ConfigFile | void,\n config: ConfigFile | void,\n ignore: IgnoreFile | void,\n};\n\n/**\n * Build a config chain for Babel's full root configuration.\n */\nexport function* buildRootChain(\n opts: ValidatedOptions,\n context: ConfigContext,\n): Handler {\n const programmaticChain = yield* loadProgrammaticChain(\n {\n options: opts,\n dirname: context.cwd,\n },\n context,\n );\n if (!programmaticChain) return null;\n\n let configFile;\n if (typeof opts.configFile === \"string\") {\n configFile = yield* loadConfig(\n opts.configFile,\n context.cwd,\n context.envName,\n context.caller,\n );\n } else if (opts.configFile !== false) {\n configFile = yield* findRootConfig(\n context.root,\n context.envName,\n context.caller,\n );\n }\n\n let { babelrc, babelrcRoots } = opts;\n let babelrcRootsDirectory = context.cwd;\n\n const configFileChain = emptyChain();\n if (configFile) {\n const validatedFile = validateConfigFile(configFile);\n const result = yield* loadFileChain(validatedFile, context);\n if (!result) return null;\n\n // Allow config files to toggle `.babelrc` resolution on and off and\n // specify where the roots are.\n if (babelrc === undefined) {\n babelrc = validatedFile.options.babelrc;\n }\n if (babelrcRoots === undefined) {\n babelrcRootsDirectory = validatedFile.dirname;\n babelrcRoots = validatedFile.options.babelrcRoots;\n }\n\n mergeChain(configFileChain, result);\n }\n\n const pkgData =\n typeof context.filename === \"string\"\n ? yield* findPackageData(context.filename)\n : null;\n\n let ignoreFile, babelrcFile;\n const fileChain = emptyChain();\n // resolve all .babelrc files\n if (\n (babelrc === true || babelrc === undefined) &&\n pkgData &&\n babelrcLoadEnabled(context, pkgData, babelrcRoots, babelrcRootsDirectory)\n ) {\n ({ ignore: ignoreFile, config: babelrcFile } = yield* findRelativeConfig(\n pkgData,\n context.envName,\n context.caller,\n ));\n\n if (\n ignoreFile &&\n shouldIgnore(context, ignoreFile.ignore, null, ignoreFile.dirname)\n ) {\n return null;\n }\n\n if (babelrcFile) {\n const result = yield* loadFileChain(\n validateBabelrcFile(babelrcFile),\n context,\n );\n if (!result) return null;\n\n mergeChain(fileChain, result);\n }\n }\n\n // Insert file chain in front so programmatic options have priority\n // over configuration file chain items.\n const chain = mergeChain(\n mergeChain(mergeChain(emptyChain(), configFileChain), fileChain),\n programmaticChain,\n );\n\n return {\n plugins: dedupDescriptors(chain.plugins),\n presets: dedupDescriptors(chain.presets),\n options: chain.options.map(o => normalizeOptions(o)),\n ignore: ignoreFile || undefined,\n babelrc: babelrcFile || undefined,\n config: configFile || undefined,\n };\n}\n\nfunction babelrcLoadEnabled(\n context: ConfigContext,\n pkgData: FilePackageData,\n babelrcRoots: BabelrcSearch | void,\n babelrcRootsDirectory: string,\n): boolean {\n if (typeof babelrcRoots === \"boolean\") return babelrcRoots;\n\n const absoluteRoot = context.root;\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcRoots === undefined) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n let babelrcPatterns = babelrcRoots;\n if (!Array.isArray(babelrcPatterns)) babelrcPatterns = [babelrcPatterns];\n babelrcPatterns = babelrcPatterns.map(pat => {\n return typeof pat === \"string\"\n ? path.resolve(babelrcRootsDirectory, pat)\n : pat;\n });\n\n // Fast path to avoid having to match patterns if the babelrc is just\n // loading in the standard root directory.\n if (babelrcPatterns.length === 1 && babelrcPatterns[0] === absoluteRoot) {\n return pkgData.directories.indexOf(absoluteRoot) !== -1;\n }\n\n return babelrcPatterns.some(pat => {\n if (typeof pat === \"string\") {\n pat = pathPatternToRegex(pat, babelrcRootsDirectory);\n }\n\n return pkgData.directories.some(directory => {\n return matchPattern(pat, babelrcRootsDirectory, directory, context);\n });\n });\n}\n\nconst validateConfigFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"configfile\", file.options),\n }),\n);\n\nconst validateBabelrcFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"babelrcfile\", file.options),\n }),\n);\n\nconst validateExtendFile = makeWeakCacheSync(\n (file: ConfigFile): ValidatedFile => ({\n filepath: file.filepath,\n dirname: file.dirname,\n options: validate(\"extendsfile\", file.options),\n }),\n);\n\n/**\n * Build a config chain for just the programmatic options passed into Babel.\n */\nconst loadProgrammaticChain = makeChainWalker({\n root: input => buildRootDescriptors(input, \"base\", createCachedDescriptors),\n env: (input, envName) =>\n buildEnvDescriptors(input, \"base\", createCachedDescriptors, envName),\n overrides: (input, index) =>\n buildOverrideDescriptors(input, \"base\", createCachedDescriptors, index),\n overridesEnv: (input, index, envName) =>\n buildOverrideEnvDescriptors(\n input,\n \"base\",\n createCachedDescriptors,\n index,\n envName,\n ),\n});\n\n/**\n * Build a config chain for a given file.\n */\nconst loadFileChain = makeChainWalker({\n root: file => loadFileDescriptors(file),\n env: (file, envName) => loadFileEnvDescriptors(file)(envName),\n overrides: (file, index) => loadFileOverridesDescriptors(file)(index),\n overridesEnv: (file, index, envName) =>\n loadFileOverridesEnvDescriptors(file)(index)(envName),\n});\nconst loadFileDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n buildRootDescriptors(file, file.filepath, createUncachedDescriptors),\n);\nconst loadFileEnvDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((envName: string) =>\n buildEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n envName,\n ),\n ),\n);\nconst loadFileOverridesDescriptors = makeWeakCacheSync((file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n buildOverrideDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n ),\n ),\n);\nconst loadFileOverridesEnvDescriptors = makeWeakCacheSync(\n (file: ValidatedFile) =>\n makeStrongCacheSync((index: number) =>\n makeStrongCacheSync((envName: string) =>\n buildOverrideEnvDescriptors(\n file,\n file.filepath,\n createUncachedDescriptors,\n index,\n envName,\n ),\n ),\n ),\n);\n\nfunction buildRootDescriptors({ dirname, options }, alias, descriptors) {\n return descriptors(dirname, options, alias);\n}\n\nfunction buildEnvDescriptors(\n { dirname, options },\n alias,\n descriptors,\n envName,\n) {\n const opts = options.env && options.env[envName];\n return opts ? descriptors(dirname, opts, `${alias}.env[\"${envName}\"]`) : null;\n}\n\nfunction buildOverrideDescriptors(\n { dirname, options },\n alias,\n descriptors,\n index,\n) {\n const opts = options.overrides && options.overrides[index];\n if (!opts) throw new Error(\"Assertion failure - missing override\");\n\n return descriptors(dirname, opts, `${alias}.overrides[${index}]`);\n}\n\nfunction buildOverrideEnvDescriptors(\n { dirname, options },\n alias,\n descriptors,\n index,\n envName,\n) {\n const override = options.overrides && options.overrides[index];\n if (!override) throw new Error(\"Assertion failure - missing override\");\n\n const opts = override.env && override.env[envName];\n return opts\n ? descriptors(\n dirname,\n opts,\n `${alias}.overrides[${index}].env[\"${envName}\"]`,\n )\n : null;\n}\n\nfunction makeChainWalker({\n root,\n env,\n overrides,\n overridesEnv,\n}: {\n root: ArgT => OptionsAndDescriptors,\n env: (ArgT, string) => OptionsAndDescriptors | null,\n overrides: (ArgT, number) => OptionsAndDescriptors,\n overridesEnv: (ArgT, number, string) => OptionsAndDescriptors | null,\n}): (\n ArgT,\n ConfigContext,\n Set | void,\n) => Handler {\n return function*(input, context, files = new Set()) {\n const { dirname } = input;\n\n const flattenedConfigs = [];\n\n const rootOpts = root(input);\n if (configIsApplicable(rootOpts, dirname, context)) {\n flattenedConfigs.push(rootOpts);\n\n const envOpts = env(input, context.envName);\n if (envOpts && configIsApplicable(envOpts, dirname, context)) {\n flattenedConfigs.push(envOpts);\n }\n\n (rootOpts.options.overrides || []).forEach((_, index) => {\n const overrideOps = overrides(input, index);\n if (configIsApplicable(overrideOps, dirname, context)) {\n flattenedConfigs.push(overrideOps);\n\n const overrideEnvOpts = overridesEnv(input, index, context.envName);\n if (\n overrideEnvOpts &&\n configIsApplicable(overrideEnvOpts, dirname, context)\n ) {\n flattenedConfigs.push(overrideEnvOpts);\n }\n }\n });\n }\n\n // Process 'ignore' and 'only' before 'extends' items are processed so\n // that we don't do extra work loading extended configs if a file is\n // ignored.\n if (\n flattenedConfigs.some(({ options: { ignore, only } }) =>\n shouldIgnore(context, ignore, only, dirname),\n )\n ) {\n return null;\n }\n\n const chain = emptyChain();\n\n for (const op of flattenedConfigs) {\n if (\n !(yield* mergeExtendsChain(chain, op.options, dirname, context, files))\n ) {\n return null;\n }\n\n mergeChainOpts(chain, op);\n }\n return chain;\n };\n}\n\nfunction* mergeExtendsChain(\n chain: ConfigChain,\n opts: ValidatedOptions,\n dirname: string,\n context: ConfigContext,\n files: Set,\n): Handler {\n if (opts.extends === undefined) return true;\n\n const file = yield* loadConfig(\n opts.extends,\n dirname,\n context.envName,\n context.caller,\n );\n\n if (files.has(file)) {\n throw new Error(\n `Configuration cycle detected loading ${file.filepath}.\\n` +\n `File already loaded following the config chain:\\n` +\n Array.from(files, file => ` - ${file.filepath}`).join(\"\\n\"),\n );\n }\n\n files.add(file);\n const fileChain = yield* loadFileChain(\n validateExtendFile(file),\n context,\n files,\n );\n files.delete(file);\n\n if (!fileChain) return false;\n\n mergeChain(chain, fileChain);\n\n return true;\n}\n\nfunction mergeChain(target: ConfigChain, source: ConfigChain): ConfigChain {\n target.options.push(...source.options);\n target.plugins.push(...source.plugins);\n target.presets.push(...source.presets);\n\n return target;\n}\n\nfunction mergeChainOpts(\n target: ConfigChain,\n { options, plugins, presets }: OptionsAndDescriptors,\n): ConfigChain {\n target.options.push(options);\n target.plugins.push(...plugins());\n target.presets.push(...presets());\n\n return target;\n}\n\nfunction emptyChain(): ConfigChain {\n return {\n options: [],\n presets: [],\n plugins: [],\n };\n}\n\nfunction normalizeOptions(opts: ValidatedOptions): ValidatedOptions {\n const options = {\n ...opts,\n };\n delete options.extends;\n delete options.env;\n delete options.overrides;\n delete options.plugins;\n delete options.presets;\n delete options.passPerPreset;\n delete options.ignore;\n delete options.only;\n delete options.test;\n delete options.include;\n delete options.exclude;\n\n // \"sourceMap\" is just aliased to sourceMap, so copy it over as\n // we merge the options together.\n if (Object.prototype.hasOwnProperty.call(options, \"sourceMap\")) {\n options.sourceMaps = options.sourceMap;\n delete options.sourceMap;\n }\n return options;\n}\n\nfunction dedupDescriptors(\n items: Array,\n): Array {\n const map: Map<\n Function,\n Map,\n > = new Map();\n\n const descriptors = [];\n\n for (const item of items) {\n if (typeof item.value === \"function\") {\n const fnKey = item.value;\n let nameMap = map.get(fnKey);\n if (!nameMap) {\n nameMap = new Map();\n map.set(fnKey, nameMap);\n }\n let desc = nameMap.get(item.name);\n if (!desc) {\n desc = { value: item };\n descriptors.push(desc);\n\n // Treat passPerPreset presets as unique, skipping them\n // in the merge processing steps.\n if (!item.ownPass) nameMap.set(item.name, desc);\n } else {\n desc.value = item;\n }\n } else {\n descriptors.push({ value: item });\n }\n }\n\n return descriptors.reduce((acc, desc) => {\n acc.push(desc.value);\n return acc;\n }, []);\n}\n\nfunction configIsApplicable(\n { options }: OptionsAndDescriptors,\n dirname: string,\n context: ConfigContext,\n): boolean {\n return (\n (options.test === undefined ||\n configFieldIsApplicable(context, options.test, dirname)) &&\n (options.include === undefined ||\n configFieldIsApplicable(context, options.include, dirname)) &&\n (options.exclude === undefined ||\n !configFieldIsApplicable(context, options.exclude, dirname))\n );\n}\n\nfunction configFieldIsApplicable(\n context: ConfigContext,\n test: ConfigApplicableTest,\n dirname: string,\n): boolean {\n const patterns = Array.isArray(test) ? test : [test];\n\n return matchesPatterns(context, patterns, dirname);\n}\n\n/**\n * Tests if a filename should be ignored based on \"ignore\" and \"only\" options.\n */\nfunction shouldIgnore(\n context: ConfigContext,\n ignore: ?IgnoreList,\n only: ?IgnoreList,\n dirname: string,\n): boolean {\n if (ignore && matchesPatterns(context, ignore, dirname)) {\n debug(\n \"Ignored %o because it matched one of %O from %o\",\n context.filename,\n ignore,\n dirname,\n );\n return true;\n }\n\n if (only && !matchesPatterns(context, only, dirname)) {\n debug(\n \"Ignored %o because it failed to match one of %O from %o\",\n context.filename,\n only,\n dirname,\n );\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns result of calling function with filename if pattern is a function.\n * Otherwise returns result of matching pattern Regex with filename.\n */\nfunction matchesPatterns(\n context: ConfigContext,\n patterns: IgnoreList,\n dirname: string,\n): boolean {\n return patterns.some(pattern =>\n matchPattern(pattern, dirname, context.filename, context),\n );\n}\n\nfunction matchPattern(\n pattern,\n dirname,\n pathToTest,\n context: ConfigContext,\n): boolean {\n if (typeof pattern === \"function\") {\n return !!pattern(pathToTest, {\n dirname,\n envName: context.envName,\n caller: context.caller,\n });\n }\n\n if (typeof pathToTest !== \"string\") {\n throw new Error(\n `Configuration contains string/RegExp pattern, but no filename was passed to Babel`,\n );\n }\n\n if (typeof pattern === \"string\") {\n pattern = pathPatternToRegex(pattern, dirname);\n }\n return pattern.test(pathToTest);\n}\n","import {\n assertString,\n assertFunction,\n assertObject,\n type ValidatorSet,\n type Validator,\n} from \"./option-assertions\";\n\n// Note: The casts here are just meant to be static assertions to make sure\n// that the assertion functions actually assert that the value's type matches\n// the declared types.\nconst VALIDATORS: ValidatorSet = {\n name: (assertString: Validator<$PropertyType>),\n manipulateOptions: (assertFunction: Validator<\n $PropertyType,\n >),\n pre: (assertFunction: Validator<$PropertyType>),\n post: (assertFunction: Validator<$PropertyType>),\n inherits: (assertFunction: Validator<\n $PropertyType,\n >),\n visitor: (assertVisitorMap: Validator<\n $PropertyType,\n >),\n\n parserOverride: (assertFunction: Validator<\n $PropertyType,\n >),\n generatorOverride: (assertFunction: Validator<\n $PropertyType,\n >),\n};\n\nfunction assertVisitorMap(key: string, value: mixed): VisitorMap {\n const obj = assertObject(key, value);\n if (obj) {\n Object.keys(obj).forEach(prop => assertVisitorHandler(prop, obj[prop]));\n\n if (obj.enter || obj.exit) {\n throw new Error(\n `.${key} cannot contain catch-all \"enter\" or \"exit\" handlers. Please target individual nodes.`,\n );\n }\n }\n return (obj: any);\n}\n\nfunction assertVisitorHandler(\n key: string,\n value: mixed,\n): VisitorHandler | void {\n if (value && typeof value === \"object\") {\n Object.keys(value).forEach(handler => {\n if (handler !== \"enter\" && handler !== \"exit\") {\n throw new Error(\n `.visitor[\"${key}\"] may only have .enter and/or .exit handlers.`,\n );\n }\n });\n } else if (typeof value !== \"function\") {\n throw new Error(`.visitor[\"${key}\"] must be a function`);\n }\n\n return (value: any);\n}\n\ntype VisitorHandler = Function | { enter?: Function, exit?: Function };\nexport type VisitorMap = {\n [string]: VisitorHandler,\n};\n\nexport type PluginObject = {\n name?: string,\n manipulateOptions?: Function,\n\n pre?: Function,\n post?: Function,\n\n inherits?: Function,\n visitor?: VisitorMap,\n\n parserOverride?: Function,\n generatorOverride?: Function,\n};\n\nexport function validatePluginObject(obj: {}): PluginObject {\n const rootPath: RootPath = {\n type: \"root\",\n source: \"plugin\",\n };\n Object.keys(obj).forEach(key => {\n const validator = VALIDATORS[key];\n const optLoc = {\n type: \"option\",\n name: key,\n parent: rootPath,\n };\n\n if (validator) validator(optLoc, obj[key]);\n else throw new Error(`.${key} is not a valid Plugin property`);\n });\n\n return (obj: any);\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { version as coreVersion } from \"../../\";\nimport {\n assertSimpleType,\n type CacheConfigurator,\n type SimpleCacheConfigurator,\n} from \"../caching\";\n\nimport type { CallerMetadata } from \"../validation/options\";\n\ntype EnvFunction = {\n (): string,\n ((string) => T): T,\n (string): boolean,\n (Array): boolean,\n};\n\nexport type PluginAPI = {\n version: string,\n cache: SimpleCacheConfigurator,\n env: EnvFunction,\n async: () => boolean,\n assertVersion: typeof assertVersion,\n};\n\nexport default function makeAPI(\n cache: CacheConfigurator<{ envName: string, caller: CallerMetadata | void }>,\n): PluginAPI {\n const env: any = value =>\n cache.using(data => {\n if (typeof value === \"undefined\") return data.envName;\n if (typeof value === \"function\") {\n return assertSimpleType(value(data.envName));\n }\n if (!Array.isArray(value)) value = [value];\n\n return value.some(entry => {\n if (typeof entry !== \"string\") {\n throw new Error(\"Unexpected non-string value\");\n }\n return entry === data.envName;\n });\n });\n\n const caller: any = cb =>\n cache.using(data => assertSimpleType(cb(data.caller)));\n\n return {\n version: coreVersion,\n cache: cache.simple(),\n // Expose \".env()\" so people can easily get the same env that we expose using the \"env\" key.\n env,\n async: () => false,\n caller,\n assertVersion,\n tokTypes: undefined,\n };\n}\n\nfunction assertVersion(range: string | number): void {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n if (semver.satisfies(coreVersion, range)) return;\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n const err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${coreVersion}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version: coreVersion,\n range,\n }: any),\n );\n}\n","// @flow\n\nimport path from \"path\";\nimport gensync, { type Handler } from \"gensync\";\nimport Plugin from \"./plugin\";\nimport { mergeOptions } from \"./util\";\nimport { createItemFromDescriptor } from \"./item\";\nimport { buildRootChain, type ConfigContext } from \"./config-chain\";\nimport { getEnv } from \"./helpers/environment\";\nimport {\n validate,\n type ValidatedOptions,\n type RootMode,\n} from \"./validation/options\";\n\nimport {\n findConfigUpwards,\n ROOT_CONFIG_FILENAMES,\n type ConfigFile,\n type IgnoreFile,\n} from \"./files\";\n\nfunction* resolveRootMode(\n rootDir: string,\n rootMode: RootMode,\n): Handler {\n switch (rootMode) {\n case \"root\":\n return rootDir;\n\n case \"upward-optional\": {\n const upwardRootDir = yield* findConfigUpwards(rootDir);\n return upwardRootDir === null ? rootDir : upwardRootDir;\n }\n\n case \"upward\": {\n const upwardRootDir = yield* findConfigUpwards(rootDir);\n if (upwardRootDir !== null) return upwardRootDir;\n\n throw Object.assign(\n (new Error(\n `Babel was run with rootMode:\"upward\" but a root could not ` +\n `be found when searching upward from \"${rootDir}\".\\n` +\n `One of the following config files must be in the directory tree: ` +\n `\"${ROOT_CONFIG_FILENAMES.join(\", \")}\".`,\n ): any),\n {\n code: \"BABEL_ROOT_NOT_FOUND\",\n dirname: rootDir,\n },\n );\n }\n default:\n throw new Error(`Assertion failure - unknown rootMode value.`);\n }\n}\n\ntype PrivPartialConfig = {\n options: ValidatedOptions,\n context: ConfigContext,\n ignore: IgnoreFile | void,\n babelrc: ConfigFile | void,\n config: ConfigFile | void,\n};\n\nexport default function* loadPrivatePartialConfig(\n inputOpts: mixed,\n): Handler {\n if (\n inputOpts != null &&\n (typeof inputOpts !== \"object\" || Array.isArray(inputOpts))\n ) {\n throw new Error(\"Babel options must be an object, null, or undefined\");\n }\n\n const args = inputOpts ? validate(\"arguments\", inputOpts) : {};\n\n const {\n envName = getEnv(),\n cwd = \".\",\n root: rootDir = \".\",\n rootMode = \"root\",\n caller,\n } = args;\n const absoluteCwd = path.resolve(cwd);\n const absoluteRootDir = yield* resolveRootMode(\n path.resolve(absoluteCwd, rootDir),\n rootMode,\n );\n\n const context: ConfigContext = {\n filename:\n typeof args.filename === \"string\"\n ? path.resolve(cwd, args.filename)\n : undefined,\n cwd: absoluteCwd,\n root: absoluteRootDir,\n envName,\n caller,\n };\n\n const configChain = yield* buildRootChain(args, context);\n if (!configChain) return null;\n\n const options = {};\n configChain.options.forEach(opts => {\n mergeOptions(options, opts);\n });\n\n // Tack the passes onto the object itself so that, if this object is\n // passed back to Babel a second time, it will be in the right structure\n // to not change behavior.\n options.babelrc = false;\n options.configFile = false;\n options.passPerPreset = false;\n options.envName = context.envName;\n options.cwd = context.cwd;\n options.root = context.root;\n options.filename =\n typeof context.filename === \"string\" ? context.filename : undefined;\n\n options.plugins = configChain.plugins.map(descriptor =>\n createItemFromDescriptor(descriptor),\n );\n options.presets = configChain.presets.map(descriptor =>\n createItemFromDescriptor(descriptor),\n );\n\n return {\n options,\n context,\n ignore: configChain.ignore,\n babelrc: configChain.babelrc,\n config: configChain.config,\n };\n}\n\nexport const loadPartialConfig = gensync<[any], PartialConfig | null>(function*(\n inputOpts: mixed,\n): Handler {\n const result: ?PrivPartialConfig = yield* loadPrivatePartialConfig(inputOpts);\n if (!result) return null;\n\n const { options, babelrc, ignore, config } = result;\n\n (options.plugins || []).forEach(item => {\n if (item.value instanceof Plugin) {\n throw new Error(\n \"Passing cached plugin instances is not supported in \" +\n \"babel.loadPartialConfig()\",\n );\n }\n });\n\n return new PartialConfig(\n options,\n babelrc ? babelrc.filepath : undefined,\n ignore ? ignore.filepath : undefined,\n config ? config.filepath : undefined,\n );\n});\n\nexport type { PartialConfig };\n\nclass PartialConfig {\n /**\n * These properties are public, so any changes to them should be considered\n * a breaking change to Babel's API.\n */\n options: ValidatedOptions;\n babelrc: string | void;\n babelignore: string | void;\n config: string | void;\n\n constructor(\n options: ValidatedOptions,\n babelrc: string | void,\n ignore: string | void,\n config: string | void,\n ) {\n this.options = options;\n this.babelignore = ignore;\n this.babelrc = babelrc;\n this.config = config;\n\n // Freeze since this is a public API and it should be extremely obvious that\n // reassigning properties on here does nothing.\n Object.freeze(this);\n }\n\n /**\n * Returns true if their is a config file in the filesystem for this config.\n *\n * While this only means .babelrc(.mjs)?/package.json#babel right now, it\n * may well expand in the future, so using this is recommended vs checking\n * this.babelrc directly.\n */\n hasFilesystemConfig(): boolean {\n return this.babelrc !== undefined || this.config !== undefined;\n }\n}\nObject.freeze(PartialConfig.prototype);\n","// @flow\n\nimport gensync, { type Handler } from \"gensync\";\nimport { forwardAsync } from \"../gensync-utils/async\";\n\nimport { mergeOptions } from \"./util\";\nimport * as context from \"../index\";\nimport Plugin from \"./plugin\";\nimport { getItemDescriptor } from \"./item\";\nimport {\n buildPresetChain,\n type ConfigContext,\n type ConfigChain,\n type PresetInstance,\n} from \"./config-chain\";\nimport type { UnloadedDescriptor } from \"./config-descriptors\";\nimport traverse from \"@babel/traverse\";\nimport {\n makeWeakCache,\n makeWeakCacheSync,\n type CacheConfigurator,\n} from \"./caching\";\nimport { validate, type CallerMetadata } from \"./validation/options\";\nimport { validatePluginObject } from \"./validation/plugins\";\nimport makeAPI from \"./helpers/config-api\";\n\nimport loadPrivatePartialConfig from \"./partial\";\nimport type { ValidatedOptions } from \"./validation/options\";\n\ntype LoadedDescriptor = {\n value: {},\n options: {},\n dirname: string,\n alias: string,\n};\n\nexport type { InputOptions } from \"./validation/options\";\n\nexport type ResolvedConfig = {\n options: Object,\n passes: PluginPasses,\n};\n\nexport type { Plugin };\nexport type PluginPassList = Array;\nexport type PluginPasses = Array;\n\n// Context not including filename since it is used in places that cannot\n// process 'ignore'/'only' and other filename-based logic.\ntype SimpleContext = {\n envName: string,\n caller: CallerMetadata | void,\n};\n\nexport default gensync<[any], ResolvedConfig | null>(function* loadFullConfig(\n inputOpts: mixed,\n): Handler {\n const result = yield* loadPrivatePartialConfig(inputOpts);\n if (!result) {\n return null;\n }\n const { options, context } = result;\n\n const optionDefaults = {};\n const passes = [[]];\n try {\n const { plugins, presets } = options;\n\n if (!plugins || !presets) {\n throw new Error(\"Assertion failure - plugins and presets exist\");\n }\n\n const ignored = yield* (function* recurseDescriptors(\n config: {\n plugins: Array,\n presets: Array,\n },\n pass: Array,\n ) {\n const plugins = [];\n for (const descriptor of config.plugins) {\n if (descriptor.options !== false) {\n plugins.push(yield* loadPluginDescriptor(descriptor, context));\n }\n }\n\n const presets = [];\n for (const descriptor of config.presets) {\n if (descriptor.options !== false) {\n presets.push({\n preset: yield* loadPresetDescriptor(descriptor, context),\n pass: descriptor.ownPass ? [] : pass,\n });\n }\n }\n\n // resolve presets\n if (presets.length > 0) {\n // The passes are created in the same order as the preset list, but are inserted before any\n // existing additional passes.\n passes.splice(\n 1,\n 0,\n ...presets.map(o => o.pass).filter(p => p !== pass),\n );\n\n for (const { preset, pass } of presets) {\n if (!preset) return true;\n\n const ignored = yield* recurseDescriptors(\n {\n plugins: preset.plugins,\n presets: preset.presets,\n },\n pass,\n );\n if (ignored) return true;\n\n preset.options.forEach(opts => {\n mergeOptions(optionDefaults, opts);\n });\n }\n }\n\n // resolve plugins\n if (plugins.length > 0) {\n pass.unshift(...plugins);\n }\n })(\n {\n plugins: plugins.map(item => {\n const desc = getItemDescriptor(item);\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n }),\n presets: presets.map(item => {\n const desc = getItemDescriptor(item);\n if (!desc) {\n throw new Error(\"Assertion failure - must be config item\");\n }\n\n return desc;\n }),\n },\n passes[0],\n );\n\n if (ignored) return null;\n } catch (e) {\n // There are a few case where thrown errors will try to annotate themselves multiple times, so\n // to keep things simple we just bail out if re-wrapping the message.\n if (!/^\\[BABEL\\]/.test(e.message)) {\n e.message = `[BABEL] ${context.filename || \"unknown\"}: ${e.message}`;\n }\n\n throw e;\n }\n\n const opts: Object = optionDefaults;\n mergeOptions(opts, options);\n\n opts.plugins = passes[0];\n opts.presets = passes\n .slice(1)\n .filter(plugins => plugins.length > 0)\n .map(plugins => ({ plugins }));\n opts.passPerPreset = opts.presets.length > 0;\n\n return {\n options: opts,\n passes: passes,\n };\n});\n\n/**\n * Load a generic plugin/preset from the given descriptor loaded from the config object.\n */\nconst loadDescriptor = makeWeakCache(function*(\n { value, options, dirname, alias }: UnloadedDescriptor,\n cache: CacheConfigurator,\n): Handler {\n // Disabled presets should already have been filtered out\n if (options === false) throw new Error(\"Assertion failure\");\n\n options = options || {};\n\n let item = value;\n if (typeof value === \"function\") {\n const api = {\n ...context,\n ...makeAPI(cache),\n };\n try {\n item = value(api, options, dirname);\n } catch (e) {\n if (alias) {\n e.message += ` (While processing: ${JSON.stringify(alias)})`;\n }\n throw e;\n }\n }\n\n if (!item || typeof item !== \"object\") {\n throw new Error(\"Plugin/Preset did not return an object.\");\n }\n\n if (typeof item.then === \"function\") {\n yield* []; // if we want to support async plugins\n\n throw new Error(\n `You appear to be using an async plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version.`,\n );\n }\n\n return { value: item, options, dirname, alias };\n});\n\n/**\n * Instantiate a plugin for the given descriptor, returning the plugin/options pair.\n */\nfunction* loadPluginDescriptor(\n descriptor: UnloadedDescriptor,\n context: SimpleContext,\n): Handler {\n if (descriptor.value instanceof Plugin) {\n if (descriptor.options) {\n throw new Error(\n \"Passed options to an existing Plugin instance will not work.\",\n );\n }\n\n return descriptor.value;\n }\n\n return yield* instantiatePlugin(\n yield* loadDescriptor(descriptor, context),\n context,\n );\n}\n\nconst instantiatePlugin = makeWeakCache(function*(\n { value, options, dirname, alias }: LoadedDescriptor,\n cache: CacheConfigurator,\n): Handler {\n const pluginObj = validatePluginObject(value);\n\n const plugin = {\n ...pluginObj,\n };\n if (plugin.visitor) {\n plugin.visitor = traverse.explode({\n ...plugin.visitor,\n });\n }\n\n if (plugin.inherits) {\n const inheritsDescriptor = {\n name: undefined,\n alias: `${alias}$inherits`,\n value: plugin.inherits,\n options,\n dirname,\n };\n\n const inherits = yield* forwardAsync(loadPluginDescriptor, run => {\n // If the inherited plugin changes, reinstantiate this plugin.\n return cache.invalidate(data => run(inheritsDescriptor, data));\n });\n\n plugin.pre = chain(inherits.pre, plugin.pre);\n plugin.post = chain(inherits.post, plugin.post);\n plugin.manipulateOptions = chain(\n inherits.manipulateOptions,\n plugin.manipulateOptions,\n );\n plugin.visitor = traverse.visitors.merge([\n inherits.visitor || {},\n plugin.visitor || {},\n ]);\n }\n\n return new Plugin(plugin, options, alias);\n});\n\nconst validateIfOptionNeedsFilename = (\n options: ValidatedOptions,\n descriptor: UnloadedDescriptor,\n): void => {\n if (options.test || options.include || options.exclude) {\n const formattedPresetName = descriptor.name\n ? `\"${descriptor.name}\"`\n : \"/* your preset */\";\n throw new Error(\n [\n `Preset ${formattedPresetName} requires a filename to be set when babel is called directly,`,\n `\\`\\`\\``,\n `babel.transform(code, { filename: 'file.ts', presets: [${formattedPresetName}] });`,\n `\\`\\`\\``,\n `See https://babeljs.io/docs/en/options#filename for more information.`,\n ].join(\"\\n\"),\n );\n }\n};\n\nconst validatePreset = (\n preset: PresetInstance,\n context: ConfigContext,\n descriptor: UnloadedDescriptor,\n): void => {\n if (!context.filename) {\n const { options } = preset;\n validateIfOptionNeedsFilename(options, descriptor);\n if (options.overrides) {\n options.overrides.forEach(overrideOptions =>\n validateIfOptionNeedsFilename(overrideOptions, descriptor),\n );\n }\n }\n};\n\n/**\n * Generate a config object that will act as the root of a new nested config.\n */\nfunction* loadPresetDescriptor(\n descriptor: UnloadedDescriptor,\n context: ConfigContext,\n): Handler {\n const preset = instantiatePreset(yield* loadDescriptor(descriptor, context));\n validatePreset(preset, context, descriptor);\n return yield* buildPresetChain(preset, context);\n}\n\nconst instantiatePreset = makeWeakCacheSync(\n ({ value, dirname, alias }: LoadedDescriptor): PresetInstance => {\n return {\n options: validate(\"preset\", value),\n alias,\n dirname,\n };\n },\n);\n\nfunction chain(a, b) {\n const fns = [a, b].filter(Boolean);\n if (fns.length <= 1) return fns[0];\n\n return function(...args) {\n for (const fn of fns) {\n fn.apply(this, args);\n }\n };\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nexport type {\n ResolvedConfig,\n InputOptions,\n PluginPasses,\n Plugin,\n} from \"./full\";\n\nimport loadFullConfig from \"./full\";\nimport { loadPartialConfig as loadPartialConfigRunner } from \"./partial\";\n\nexport { loadFullConfig as default };\nexport type { PartialConfig } from \"./partial\";\n\nconst loadOptionsRunner = gensync<[mixed], Object | null>(function*(opts) {\n const config = yield* loadFullConfig(opts);\n return config ? config.options : null;\n});\n\nconst maybeErrback = runner => (opts: mixed, callback: Function) => {\n if (callback === undefined && typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n return callback ? runner.errback(opts, callback) : runner.sync(opts);\n};\n\nexport const loadPartialConfig = maybeErrback(loadPartialConfigRunner);\nexport const loadPartialConfigSync = loadPartialConfigRunner.sync;\nexport const loadPartialConfigAsync = loadPartialConfigRunner.async;\n\nexport const loadOptions = maybeErrback(loadOptionsRunner);\nexport const loadOptionsSync = loadOptionsRunner.sync;\nexport const loadOptionsAsync = loadOptionsRunner.async;\n","// @flow\n\nimport type File from \"./file/file\";\nimport type NodeLocation from \"./file/file\";\n\nexport default class PluginPass {\n _map: Map = new Map();\n key: ?string;\n file: File;\n opts: Object;\n\n // The working directory that Babel's programmatic options are loaded\n // relative to.\n cwd: string;\n\n // The absolute path of the file being compiled.\n filename: string | void;\n\n constructor(file: File, key: ?string, options: ?Object) {\n this.key = key;\n this.file = file;\n this.opts = options || {};\n this.cwd = file.opts.cwd;\n this.filename = file.opts.filename;\n }\n\n set(key: mixed, val: mixed) {\n this._map.set(key, val);\n }\n\n get(key: mixed): any {\n return this._map.get(key);\n }\n\n availableHelper(name: string, versionRange: ?string) {\n return this.file.availableHelper(name, versionRange);\n }\n\n addHelper(name: string) {\n return this.file.addHelper(name);\n }\n\n addImport() {\n return this.file.addImport();\n }\n\n getModuleName(): ?string {\n return this.file.getModuleName();\n }\n\n buildCodeFrameError(node: ?NodeLocation, msg: string, Error?: typeof Error) {\n return this.file.buildCodeFrameError(node, msg, Error);\n }\n}\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var baseFlatten = require('./_baseFlatten'),\n baseOrderBy = require('./_baseOrderBy'),\n baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\nmodule.exports = sortBy;\n","// @flow\n\nimport sortBy from \"lodash/sortBy\";\n\nimport loadConfig, { type Plugin } from \"../config\";\n\nlet LOADED_PLUGIN: Plugin | void;\n\nexport default function loadBlockHoistPlugin(): Plugin {\n if (!LOADED_PLUGIN) {\n // Lazy-init the internal plugin to remove the init-time circular\n // dependency between plugins being passed @babel/core's export object,\n // which loads this file, and this 'loadConfig' loading plugins.\n const config = loadConfig.sync({\n babelrc: false,\n configFile: false,\n plugins: [blockHoistPlugin],\n });\n LOADED_PLUGIN = config ? config.passes[0][0] : undefined;\n if (!LOADED_PLUGIN) throw new Error(\"Assertion failure\");\n }\n\n return LOADED_PLUGIN;\n}\n\nconst blockHoistPlugin = {\n /**\n * [Please add a description.]\n *\n * Priority:\n *\n * - 0 We want this to be at the **very** bottom\n * - 1 Default node position\n * - 2 Priority over normal nodes\n * - 3 We want this to be at the **very** top\n * - 4 Reserved for the helpers used to implement module imports.\n */\n\n name: \"internal.blockHoist\",\n\n visitor: {\n Block: {\n exit({ node }) {\n let hasChange = false;\n for (let i = 0; i < node.body.length; i++) {\n const bodyNode = node.body[i];\n if (bodyNode && bodyNode._blockHoist != null) {\n hasChange = true;\n break;\n }\n }\n if (!hasChange) return;\n\n node.body = sortBy(node.body, function(bodyNode) {\n let priority = bodyNode && bodyNode._blockHoist;\n if (priority == null) priority = 1;\n if (priority === true) priority = 2;\n\n // Higher priorities should move toward the top.\n return -1 * priority;\n });\n },\n },\n },\n};\n","// @flow\n\nimport path from \"path\";\nimport type { ResolvedConfig } from \"../config\";\n\nexport default function normalizeOptions(config: ResolvedConfig): {} {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\"\n ? path.relative(cwd, filename)\n : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n\n moduleRoot,\n sourceRoot = moduleRoot,\n\n sourceFileName = path.basename(filenameRelative),\n\n comments = true,\n compact = \"auto\",\n } = config.options;\n\n const opts = config.options;\n\n const options = {\n ...opts,\n\n parserOpts: {\n sourceType:\n path.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n\n sourceFileName: filename,\n plugins: [],\n ...opts.parserOpts,\n },\n\n generatorOpts: {\n // General generator flags.\n filename,\n\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n\n // Source-map generation flags.\n sourceMaps,\n\n sourceRoot,\n sourceFileName,\n ...opts.generatorOpts,\n },\n };\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}\n","export default {};\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n","/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","'use strict';\nvar fs = require('fs');\nvar path = require('path');\nvar SafeBuffer = require('safe-buffer');\n\nObject.defineProperty(exports, 'commentRegex', {\n get: function getCommentRegex () {\n return /^\\s*\\/(?:\\/|\\*)[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(?:.*)$/mg;\n }\n});\n\nObject.defineProperty(exports, 'mapFileCommentRegex', {\n get: function getMapFileCommentRegex () {\n // Matches sourceMappingURL in either // or /* comment styles.\n return /(?:\\/\\/[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+?)[ \\t]*$)|(?:\\/\\*[@#][ \\t]+sourceMappingURL=([^\\*]+?)[ \\t]*(?:\\*\\/){1}[ \\t]*$)/mg;\n }\n});\n\n\nfunction decodeBase64(base64) {\n return SafeBuffer.Buffer.from(base64, 'base64').toString();\n}\n\nfunction stripComment(sm) {\n return sm.split(',').pop();\n}\n\nfunction readFromFileMap(sm, dir) {\n // NOTE: this will only work on the server since it attempts to read the map file\n\n var r = exports.mapFileCommentRegex.exec(sm);\n\n // for some odd reason //# .. captures in 1 and /* .. */ in 2\n var filename = r[1] || r[2];\n var filepath = path.resolve(dir, filename);\n\n try {\n return fs.readFileSync(filepath, 'utf8');\n } catch (e) {\n throw new Error('An error occurred while trying to read the map file at ' + filepath + '\\n' + e);\n }\n}\n\nfunction Converter (sm, opts) {\n opts = opts || {};\n\n if (opts.isFileComment) sm = readFromFileMap(sm, opts.commentFileDir);\n if (opts.hasComment) sm = stripComment(sm);\n if (opts.isEncoded) sm = decodeBase64(sm);\n if (opts.isJSON || opts.isEncoded) sm = JSON.parse(sm);\n\n this.sourcemap = sm;\n}\n\nConverter.prototype.toJSON = function (space) {\n return JSON.stringify(this.sourcemap, null, space);\n};\n\nConverter.prototype.toBase64 = function () {\n var json = this.toJSON();\n return SafeBuffer.Buffer.from(json, 'utf8').toString('base64');\n};\n\nConverter.prototype.toComment = function (options) {\n var base64 = this.toBase64();\n var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;\n};\n\n// returns copy instead of original\nConverter.prototype.toObject = function () {\n return JSON.parse(this.toJSON());\n};\n\nConverter.prototype.addProperty = function (key, value) {\n if (this.sourcemap.hasOwnProperty(key)) throw new Error('property \"' + key + '\" already exists on the sourcemap, use set property instead');\n return this.setProperty(key, value);\n};\n\nConverter.prototype.setProperty = function (key, value) {\n this.sourcemap[key] = value;\n return this;\n};\n\nConverter.prototype.getProperty = function (key) {\n return this.sourcemap[key];\n};\n\nexports.fromObject = function (obj) {\n return new Converter(obj);\n};\n\nexports.fromJSON = function (json) {\n return new Converter(json, { isJSON: true });\n};\n\nexports.fromBase64 = function (base64) {\n return new Converter(base64, { isEncoded: true });\n};\n\nexports.fromComment = function (comment) {\n comment = comment\n .replace(/^\\/\\*/g, '//')\n .replace(/\\*\\/$/g, '');\n\n return new Converter(comment, { isEncoded: true, hasComment: true });\n};\n\nexports.fromMapFileComment = function (comment, dir) {\n return new Converter(comment, { commentFileDir: dir, isFileComment: true, isJSON: true });\n};\n\n// Finds last sourcemap comment in file or returns null if none was found\nexports.fromSource = function (content) {\n var m = content.match(exports.commentRegex);\n return m ? exports.fromComment(m.pop()) : null;\n};\n\n// Finds last sourcemap comment in file or returns null if none was found\nexports.fromMapFileSource = function (content, dir) {\n var m = content.match(exports.mapFileCommentRegex);\n return m ? exports.fromMapFileComment(m.pop(), dir) : null;\n};\n\nexports.removeComments = function (src) {\n return src.replace(exports.commentRegex, '');\n};\n\nexports.removeMapFileComments = function (src) {\n return src.replace(exports.mapFileCommentRegex, '');\n};\n\nexports.generateMapFileComment = function (file, options) {\n var data = 'sourceMappingURL=' + file;\n return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;\n};\n","// @flow\n\nconst pluginNameMap = {\n classProperties: {\n syntax: {\n name: \"@babel/plugin-syntax-class-properties\",\n url: \"https://git.io/vb4yQ\",\n },\n transform: {\n name: \"@babel/plugin-proposal-class-properties\",\n url: \"https://git.io/vb4SL\",\n },\n },\n decorators: {\n syntax: {\n name: \"@babel/plugin-syntax-decorators\",\n url: \"https://git.io/vb4y9\",\n },\n transform: {\n name: \"@babel/plugin-proposal-decorators\",\n url: \"https://git.io/vb4ST\",\n },\n },\n doExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-do-expressions\",\n url: \"https://git.io/vb4yh\",\n },\n transform: {\n name: \"@babel/plugin-proposal-do-expressions\",\n url: \"https://git.io/vb4S3\",\n },\n },\n dynamicImport: {\n syntax: {\n name: \"@babel/plugin-syntax-dynamic-import\",\n url: \"https://git.io/vb4Sv\",\n },\n },\n exportDefaultFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-default-from\",\n url: \"https://git.io/vb4SO\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-default-from\",\n url: \"https://git.io/vb4yH\",\n },\n },\n exportNamespaceFrom: {\n syntax: {\n name: \"@babel/plugin-syntax-export-namespace-from\",\n url: \"https://git.io/vb4Sf\",\n },\n transform: {\n name: \"@babel/plugin-proposal-export-namespace-from\",\n url: \"https://git.io/vb4SG\",\n },\n },\n flow: {\n syntax: {\n name: \"@babel/plugin-syntax-flow\",\n url: \"https://git.io/vb4yb\",\n },\n transform: {\n name: \"@babel/plugin-transform-flow-strip-types\",\n url: \"https://git.io/vb49g\",\n },\n },\n functionBind: {\n syntax: {\n name: \"@babel/plugin-syntax-function-bind\",\n url: \"https://git.io/vb4y7\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-bind\",\n url: \"https://git.io/vb4St\",\n },\n },\n functionSent: {\n syntax: {\n name: \"@babel/plugin-syntax-function-sent\",\n url: \"https://git.io/vb4yN\",\n },\n transform: {\n name: \"@babel/plugin-proposal-function-sent\",\n url: \"https://git.io/vb4SZ\",\n },\n },\n importMeta: {\n syntax: {\n name: \"@babel/plugin-syntax-import-meta\",\n url: \"https://git.io/vbKK6\",\n },\n },\n jsx: {\n syntax: {\n name: \"@babel/plugin-syntax-jsx\",\n url: \"https://git.io/vb4yA\",\n },\n transform: {\n name: \"@babel/plugin-transform-react-jsx\",\n url: \"https://git.io/vb4yd\",\n },\n },\n logicalAssignment: {\n syntax: {\n name: \"@babel/plugin-syntax-logical-assignment-operators\",\n url: \"https://git.io/vAlBp\",\n },\n transform: {\n name: \"@babel/plugin-proposal-logical-assignment-operators\",\n url: \"https://git.io/vAlRe\",\n },\n },\n numericSeparator: {\n syntax: {\n name: \"@babel/plugin-syntax-numeric-separator\",\n url: \"https://git.io/vb4Sq\",\n },\n transform: {\n name: \"@babel/plugin-proposal-numeric-separator\",\n url: \"https://git.io/vb4yS\",\n },\n },\n optionalChaining: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-chaining\",\n url: \"https://git.io/vb4Sc\",\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-chaining\",\n url: \"https://git.io/vb4Sk\",\n },\n },\n pipelineOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-pipeline-operator\",\n url: \"https://git.io/vb4yj\",\n },\n transform: {\n name: \"@babel/plugin-proposal-pipeline-operator\",\n url: \"https://git.io/vb4SU\",\n },\n },\n throwExpressions: {\n syntax: {\n name: \"@babel/plugin-syntax-throw-expressions\",\n url: \"https://git.io/vb4SJ\",\n },\n transform: {\n name: \"@babel/plugin-proposal-throw-expressions\",\n url: \"https://git.io/vb4yF\",\n },\n },\n typescript: {\n syntax: {\n name: \"@babel/plugin-syntax-typescript\",\n url: \"https://git.io/vb4SC\",\n },\n transform: {\n name: \"@babel/plugin-transform-typescript\",\n url: \"https://git.io/vb4Sm\",\n },\n },\n\n // TODO: This plugins are now supported by default by @babel/parser: they can\n // be removed from this list. Although removing them isn't a breaking change,\n // it's better to keep a nice error message for users using older versions of\n // the parser. They can be removed in Babel 8.\n asyncGenerators: {\n syntax: {\n name: \"@babel/plugin-syntax-async-generators\",\n url: \"https://git.io/vb4SY\",\n },\n transform: {\n name: \"@babel/plugin-proposal-async-generator-functions\",\n url: \"https://git.io/vb4yp\",\n },\n },\n nullishCoalescingOperator: {\n syntax: {\n name: \"@babel/plugin-syntax-nullish-coalescing-operator\",\n url: \"https://git.io/vb4yx\",\n },\n transform: {\n name: \"@babel/plugin-proposal-nullish-coalescing-operator\",\n url: \"https://git.io/vb4Se\",\n },\n },\n objectRestSpread: {\n syntax: {\n name: \"@babel/plugin-syntax-object-rest-spread\",\n url: \"https://git.io/vb4y5\",\n },\n transform: {\n name: \"@babel/plugin-proposal-object-rest-spread\",\n url: \"https://git.io/vb4Ss\",\n },\n },\n optionalCatchBinding: {\n syntax: {\n name: \"@babel/plugin-syntax-optional-catch-binding\",\n url: \"https://git.io/vb4Sn\",\n },\n transform: {\n name: \"@babel/plugin-proposal-optional-catch-binding\",\n url: \"https://git.io/vb4SI\",\n },\n },\n};\n\nconst getNameURLCombination = ({ name, url }) => `${name} (${url})`;\n\n/*\nReturns a string of the format:\nSupport for the experimental syntax [@babel/parser plugin name] isn't currently enabled ([loc]):\n\n[code frame]\n\nAdd [npm package name] ([url]) to the 'plugins' section of your Babel config\nto enable [parsing|transformation].\n*/\nexport default function generateMissingPluginMessage(\n missingPluginName: string,\n loc: { line: number, column: number },\n codeFrame: string,\n): string {\n let helpMessage =\n `Support for the experimental syntax '${missingPluginName}' isn't currently enabled ` +\n `(${loc.line}:${loc.column + 1}):\\n\\n` +\n codeFrame;\n const pluginInfo = pluginNameMap[missingPluginName];\n if (pluginInfo) {\n const { syntax: syntaxPlugin, transform: transformPlugin } = pluginInfo;\n if (syntaxPlugin) {\n if (transformPlugin) {\n const transformPluginInfo = getNameURLCombination(transformPlugin);\n helpMessage +=\n `\\n\\nAdd ${transformPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable transformation.`;\n } else {\n const syntaxPluginInfo = getNameURLCombination(syntaxPlugin);\n helpMessage +=\n `\\n\\nAdd ${syntaxPluginInfo} to the 'plugins' section of your Babel config ` +\n `to enable parsing.`;\n }\n }\n }\n return helpMessage;\n}\n","import type { Handler } from \"gensync\";\nimport { parse } from \"@babel/parser\";\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport generateMissingPluginMessage from \"./util/missing-plugin-helper\";\n\ntype AstRoot = BabelNodeFile | BabelNodeProgram;\n\nexport type ParseResult = AstRoot;\n\nexport default function* parser(\n pluginPasses: PluginPasses,\n { parserOpts, highlightCode = true, filename = \"unknown\" }: Object,\n code: string,\n): Handler {\n try {\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { parserOverride } = plugin;\n if (parserOverride) {\n const ast = parserOverride(code, parserOpts, parse);\n\n if (ast !== undefined) results.push(ast);\n }\n }\n }\n\n if (results.length === 0) {\n return parse(code, parserOpts);\n } else if (results.length === 1) {\n yield* []; // If we want to allow async parsers\n if (typeof results[0].then === \"function\") {\n throw new Error(\n `You appear to be using an async parser plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n return results[0];\n }\n throw new Error(\"More than one plugin attempted to override parsing.\");\n } catch (err) {\n if (err.code === \"BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED\") {\n err.message +=\n \"\\nConsider renaming the file to '.mjs', or setting sourceType:module \" +\n \"or sourceType:unambiguous in your Babel config for this file.\";\n // err.code will be changed to BABEL_PARSE_ERROR later.\n }\n\n const { loc, missingPlugin } = err;\n if (loc) {\n const codeFrame = codeFrameColumns(\n code,\n {\n start: {\n line: loc.line,\n column: loc.column + 1,\n },\n },\n {\n highlightCode,\n },\n );\n if (missingPlugin) {\n err.message =\n `${filename}: ` +\n generateMissingPluginMessage(missingPlugin[0], loc, codeFrame);\n } else {\n err.message = `${filename}: ${err.message}\\n\\n` + codeFrame;\n }\n err.code = \"BABEL_PARSE_ERROR\";\n }\n throw err;\n }\n}\n","// @flow\n\nimport fs from \"fs\";\nimport path from \"path\";\nimport buildDebug from \"debug\";\nimport cloneDeep from \"lodash/cloneDeep\";\nimport type { Handler } from \"gensync\";\nimport * as t from \"@babel/types\";\nimport type { PluginPasses } from \"../config\";\nimport convertSourceMap, { typeof Converter } from \"convert-source-map\";\nimport File from \"./file/file\";\nimport parser from \"../parser\";\n\nconst debug = buildDebug(\"babel:transform:file\");\nconst LARGE_INPUT_SOURCEMAP_THRESHOLD = 1_000_000;\n\nexport type NormalizedFile = {\n code: string,\n ast: {},\n inputMap: Converter | null,\n};\n\nexport default function* normalizeFile(\n pluginPasses: PluginPasses,\n options: Object,\n code: string,\n ast: ?(BabelNodeFile | BabelNodeProgram),\n): Handler {\n code = `${code || \"\"}`;\n\n if (ast) {\n if (ast.type === \"Program\") {\n ast = t.file(ast, [], []);\n } else if (ast.type !== \"File\") {\n throw new Error(\"AST root must be a Program or File node\");\n }\n ast = cloneDeep(ast);\n } else {\n ast = yield* parser(pluginPasses, options, code);\n }\n\n let inputMap = null;\n if (options.inputSourceMap !== false) {\n // If an explicit object is passed in, it overrides the processing of\n // source maps that may be in the file itself.\n if (typeof options.inputSourceMap === \"object\") {\n inputMap = convertSourceMap.fromObject(options.inputSourceMap);\n }\n\n if (!inputMap) {\n const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast);\n if (lastComment) {\n try {\n inputMap = convertSourceMap.fromComment(lastComment);\n } catch (err) {\n debug(\"discarding unknown inline input sourcemap\", err);\n }\n }\n }\n\n if (!inputMap) {\n const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast);\n if (typeof options.filename === \"string\" && lastComment) {\n try {\n // when `lastComment` is non-null, EXTERNAL_SOURCEMAP_REGEX must have matches\n const match: [string, string] = (EXTERNAL_SOURCEMAP_REGEX.exec(\n lastComment,\n ): any);\n const inputMapContent: Buffer = fs.readFileSync(\n path.resolve(path.dirname(options.filename), match[1]),\n );\n if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) {\n debug(\"skip merging input map > 1 MB\");\n } else {\n inputMap = convertSourceMap.fromJSON(inputMapContent);\n }\n } catch (err) {\n debug(\"discarding unknown file input sourcemap\", err);\n }\n } else if (lastComment) {\n debug(\"discarding un-loadable file input sourcemap\");\n }\n }\n }\n\n return new File(options, {\n code,\n ast,\n inputMap,\n });\n}\n\n// These regexps are copied from the convert-source-map package,\n// but without // or /* at the beginning of the comment.\n\n// eslint-disable-next-line max-len\nconst INLINE_SOURCEMAP_REGEX = /^[@#]\\s+sourceMappingURL=data:(?:application|text)\\/json;(?:charset[:=]\\S+?;)?base64,(?:.*)$/;\nconst EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \\t]+sourceMappingURL=([^\\s'\"`]+)[ \\t]*$/;\n\nfunction extractCommentsFromList(regex, comments, lastComment) {\n if (comments) {\n comments = comments.filter(({ value }) => {\n if (regex.test(value)) {\n lastComment = value;\n return false;\n }\n return true;\n });\n }\n return [comments, lastComment];\n}\n\nfunction extractComments(regex, ast) {\n let lastComment = null;\n t.traverseFast(ast, node => {\n // $FlowIgnore destructuring with expressions is not supported\n [node.leadingComments, lastComment] = extractCommentsFromList(\n regex,\n node.leadingComments,\n lastComment,\n );\n // $FlowIgnore destructuring with expressions is not supported\n [node.innerComments, lastComment] = extractCommentsFromList(\n regex,\n node.innerComments,\n lastComment,\n );\n // $FlowIgnore destructuring with expressions is not supported\n [node.trailingComments, lastComment] = extractCommentsFromList(\n regex,\n node.trailingComments,\n lastComment,\n );\n });\n return lastComment;\n}\n","// @flow\n\nimport typeof { SourceMap } from \"convert-source-map\";\nimport sourceMap from \"source-map\";\n\nexport default function mergeSourceMap(\n inputMap: SourceMap,\n map: SourceMap,\n): SourceMap {\n const input = buildMappingData(inputMap);\n const output = buildMappingData(map);\n\n const mergedGenerator = new sourceMap.SourceMapGenerator();\n for (const { source } of input.sources) {\n if (typeof source.content === \"string\") {\n mergedGenerator.setSourceContent(source.path, source.content);\n }\n }\n\n if (output.sources.length === 1) {\n const defaultSource = output.sources[0];\n\n const insertedMappings = new Map();\n\n // Process each generated range in the input map, e.g. each range over the\n // code that Babel was originally given.\n eachInputGeneratedRange(input, (generated, original, source) => {\n // Then pick out each range over Babel's _output_ that corresponds with\n // the given range on the code given to Babel.\n eachOverlappingGeneratedOutputRange(defaultSource, generated, item => {\n // It's possible that multiple input ranges will overlap the same\n // generated range. Since sourcemap don't traditionally represent\n // generated locations with multiple original locations, we explicitly\n // skip generated locations once we've seen them the first time.\n const key = makeMappingKey(item);\n if (insertedMappings.has(key)) return;\n insertedMappings.set(key, item);\n\n mergedGenerator.addMapping({\n source: source.path,\n original: {\n line: original.line,\n column: original.columnStart,\n },\n generated: {\n line: item.line,\n column: item.columnStart,\n },\n name: original.name,\n });\n });\n });\n\n // Since mappings are manipulated using single locations, but are interpreted\n // as ranges, the insertions above may not actually have their ending\n // locations mapped yet. Here be go through each one and ensure that it has\n // a well-defined ending location, if one wasn't already created by the start\n // of a different range.\n for (const item of insertedMappings.values()) {\n if (item.columnEnd === Infinity) {\n continue;\n }\n\n const clearItem = {\n line: item.line,\n columnStart: item.columnEnd,\n };\n\n const key = makeMappingKey(clearItem);\n if (insertedMappings.has(key)) {\n continue;\n }\n\n // Insert mappings with no original position to terminate any mappings\n // that were found above, so that they don't expand beyond their correct\n // range.\n mergedGenerator.addMapping({\n generated: {\n line: clearItem.line,\n column: clearItem.columnStart,\n },\n });\n }\n }\n\n const result = mergedGenerator.toJSON();\n // addMapping expects a relative path, and setSourceContent expects an\n // absolute path. To avoid this whole confusion, we leave the root out\n // entirely, and add it at the end here.\n if (typeof input.sourceRoot === \"string\") {\n result.sourceRoot = input.sourceRoot;\n }\n return result;\n}\n\nfunction makeMappingKey(item: { line: number, columnStart: number }) {\n return `${item.line}/${item.columnStart}`;\n}\n\nfunction eachOverlappingGeneratedOutputRange(\n outputFile: ResolvedFileMappings,\n inputGeneratedRange: ResolvedGeneratedRange,\n callback: ResolvedGeneratedRange => mixed,\n) {\n // Find the Babel-generated mappings that overlap with this range in the\n // input sourcemap. Generated locations within the input sourcemap\n // correspond with the original locations in the map Babel generates.\n const overlappingOriginal = filterApplicableOriginalRanges(\n outputFile,\n inputGeneratedRange,\n );\n\n for (const { generated } of overlappingOriginal) {\n for (const item of generated) {\n callback(item);\n }\n }\n}\n\nfunction filterApplicableOriginalRanges(\n { mappings }: ResolvedFileMappings,\n { line, columnStart, columnEnd }: ResolvedGeneratedRange,\n): OriginalMappings {\n // The mapping array is sorted by original location, so we can\n // binary-search it for the overlapping ranges.\n return filterSortedArray(mappings, ({ original: outOriginal }) => {\n if (line > outOriginal.line) return -1;\n if (line < outOriginal.line) return 1;\n\n if (columnStart >= outOriginal.columnEnd) return -1;\n if (columnEnd <= outOriginal.columnStart) return 1;\n\n return 0;\n });\n}\n\nfunction eachInputGeneratedRange(\n map: ResolvedMappings,\n callback: (\n ResolvedGeneratedRange,\n ResolvedOriginalRange,\n ResolvedSource,\n ) => mixed,\n) {\n for (const { source, mappings } of map.sources) {\n for (const { original, generated } of mappings) {\n for (const item of generated) {\n callback(item, original, source);\n }\n }\n }\n}\n\ntype ResolvedMappings = {|\n file: ?string,\n sourceRoot: ?string,\n sources: Array,\n|};\ntype ResolvedFileMappings = {|\n source: ResolvedSource,\n mappings: OriginalMappings,\n|};\ntype OriginalMappings = Array<{|\n original: ResolvedOriginalRange,\n generated: Array,\n|}>;\ntype ResolvedSource = {|\n path: string,\n content: string | null,\n|};\ntype ResolvedOriginalRange = {|\n line: number,\n columnStart: number,\n columnEnd: number,\n name: string | null,\n|};\ntype ResolvedGeneratedRange = {|\n line: number,\n columnStart: number,\n columnEnd: number,\n|};\n\nfunction buildMappingData(map: SourceMap): ResolvedMappings {\n const consumer = new sourceMap.SourceMapConsumer({\n ...map,\n\n // This is a bit hack. .addMapping expects source values to be relative,\n // but eachMapping returns mappings with absolute paths. To avoid that\n // incompatibility, we leave the sourceRoot out here and add it to the\n // final map at the end instead.\n sourceRoot: null,\n });\n\n const sources = new Map();\n const mappings = new Map();\n\n let last = null;\n\n consumer.computeColumnSpans();\n\n consumer.eachMapping(\n m => {\n if (m.originalLine === null) return;\n\n let source = sources.get(m.source);\n if (!source) {\n source = {\n path: m.source,\n content: consumer.sourceContentFor(m.source, true),\n };\n sources.set(m.source, source);\n }\n\n let sourceData = mappings.get(source);\n if (!sourceData) {\n sourceData = {\n source,\n mappings: [],\n };\n mappings.set(source, sourceData);\n }\n\n const obj = {\n line: m.originalLine,\n columnStart: m.originalColumn,\n columnEnd: Infinity,\n name: m.name,\n };\n\n if (\n last &&\n last.source === source &&\n last.mapping.line === m.originalLine\n ) {\n last.mapping.columnEnd = m.originalColumn;\n }\n\n last = {\n source,\n mapping: obj,\n };\n\n sourceData.mappings.push({\n original: obj,\n generated: consumer\n .allGeneratedPositionsFor({\n source: m.source,\n line: m.originalLine,\n column: m.originalColumn,\n })\n .map(item => ({\n line: item.line,\n columnStart: item.column,\n // source-map's lastColumn is inclusive, not exclusive, so we need\n // to add 1 to it.\n columnEnd: item.lastColumn + 1,\n })),\n });\n },\n null,\n sourceMap.SourceMapConsumer.ORIGINAL_ORDER,\n );\n\n return {\n file: map.file,\n sourceRoot: map.sourceRoot,\n sources: Array.from(mappings.values()),\n };\n}\n\nfunction findInsertionLocation(\n array: Array,\n callback: T => number,\n): number {\n let left = 0;\n let right = array.length;\n while (left < right) {\n const mid = Math.floor((left + right) / 2);\n const item = array[mid];\n\n const result = callback(item);\n if (result === 0) {\n left = mid;\n break;\n }\n if (result >= 0) {\n right = mid;\n } else {\n left = mid + 1;\n }\n }\n\n // Ensure the value is the start of any set of matches.\n let i = left;\n if (i < array.length) {\n while (i >= 0 && callback(array[i]) >= 0) {\n i--;\n }\n return i + 1;\n }\n\n return i;\n}\n\nfunction filterSortedArray(\n array: Array,\n callback: T => number,\n): Array {\n const start = findInsertionLocation(array, callback);\n\n const results = [];\n for (let i = start; i < array.length && callback(array[i]) === 0; i++) {\n results.push(array[i]);\n }\n\n return results;\n}\n","// @flow\n\nimport type { PluginPasses } from \"../../config\";\nimport convertSourceMap, { typeof SourceMap } from \"convert-source-map\";\nimport generate from \"@babel/generator\";\n\nimport type File from \"./file\";\nimport mergeSourceMap from \"./merge-map\";\n\nexport default function generateCode(\n pluginPasses: PluginPasses,\n file: File,\n): {\n outputCode: string,\n outputMap: SourceMap | null,\n} {\n const { opts, ast, code, inputMap } = file;\n\n const results = [];\n for (const plugins of pluginPasses) {\n for (const plugin of plugins) {\n const { generatorOverride } = plugin;\n if (generatorOverride) {\n const result = generatorOverride(\n ast,\n opts.generatorOpts,\n code,\n generate,\n );\n\n if (result !== undefined) results.push(result);\n }\n }\n }\n\n let result;\n if (results.length === 0) {\n result = generate(ast, opts.generatorOpts, code);\n } else if (results.length === 1) {\n result = results[0];\n\n if (typeof result.then === \"function\") {\n throw new Error(\n `You appear to be using an async codegen plugin, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, ` +\n `you may need to upgrade your @babel/core version.`,\n );\n }\n } else {\n throw new Error(\"More than one plugin attempted to override codegen.\");\n }\n\n let { code: outputCode, map: outputMap } = result;\n\n if (outputMap && inputMap) {\n outputMap = mergeSourceMap(inputMap.toObject(), outputMap);\n }\n\n if (opts.sourceMaps === \"inline\" || opts.sourceMaps === \"both\") {\n outputCode += \"\\n\" + convertSourceMap.fromObject(outputMap).toComment();\n }\n\n if (opts.sourceMaps === \"inline\") {\n outputMap = null;\n }\n\n return { outputCode, outputMap };\n}\n","// @flow\nimport traverse from \"@babel/traverse\";\nimport typeof { SourceMap } from \"convert-source-map\";\nimport type { Handler } from \"gensync\";\n\nimport type { ResolvedConfig, PluginPasses } from \"../config\";\n\nimport PluginPass from \"./plugin-pass\";\nimport loadBlockHoistPlugin from \"./block-hoist-plugin\";\nimport normalizeOptions from \"./normalize-opts\";\nimport normalizeFile from \"./normalize-file\";\n\nimport generateCode from \"./file/generate\";\nimport type File from \"./file/file\";\n\nexport type FileResultCallback = {\n (Error, null): any,\n (null, FileResult | null): any,\n};\n\nexport type FileResult = {\n metadata: {},\n options: {},\n ast: {} | null,\n code: string | null,\n map: SourceMap | null,\n};\n\nexport function* run(\n config: ResolvedConfig,\n code: string,\n ast: ?(BabelNodeFile | BabelNodeProgram),\n): Handler {\n const file = yield* normalizeFile(\n config.passes,\n normalizeOptions(config),\n code,\n ast,\n );\n\n const opts = file.opts;\n try {\n yield* transformFile(file, config.passes);\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_TRANSFORM_ERROR\";\n }\n throw e;\n }\n\n let outputCode, outputMap;\n try {\n if (opts.code !== false) {\n ({ outputCode, outputMap } = generateCode(config.passes, file));\n }\n } catch (e) {\n e.message = `${opts.filename ?? \"unknown\"}: ${e.message}`;\n if (!e.code) {\n e.code = \"BABEL_GENERATE_ERROR\";\n }\n throw e;\n }\n\n return {\n metadata: file.metadata,\n options: opts,\n ast: opts.ast === true ? file.ast : null,\n code: outputCode === undefined ? null : outputCode,\n map: outputMap === undefined ? null : outputMap,\n sourceType: file.ast.program.sourceType,\n };\n}\n\nfunction* transformFile(file: File, pluginPasses: PluginPasses): Handler {\n for (const pluginPairs of pluginPasses) {\n const passPairs = [];\n const passes = [];\n const visitors = [];\n\n for (const plugin of pluginPairs.concat([loadBlockHoistPlugin()])) {\n const pass = new PluginPass(file, plugin.key, plugin.options);\n\n passPairs.push([plugin, pass]);\n passes.push(pass);\n visitors.push(plugin.visitor);\n }\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.pre;\n if (fn) {\n const result = fn.call(pass, file);\n\n yield* [];\n if (isThenable(result)) {\n throw new Error(\n `You appear to be using an plugin with an async .pre, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n }\n }\n\n // merge all plugin visitors into a single visitor\n const visitor = traverse.visitors.merge(\n visitors,\n passes,\n file.opts.wrapPluginVisitorMethod,\n );\n traverse(file.ast, visitor, file.scope);\n\n for (const [plugin, pass] of passPairs) {\n const fn = plugin.post;\n if (fn) {\n const result = fn.call(pass, file);\n\n yield* [];\n if (isThenable(result)) {\n throw new Error(\n `You appear to be using an plugin with an async .post, ` +\n `which your current version of Babel does not support. ` +\n `If you're using a published plugin, you may need to upgrade ` +\n `your @babel/core version.`,\n );\n }\n }\n }\n }\n}\n\nfunction isThenable(val: mixed): boolean {\n return (\n !!val &&\n (typeof val === \"object\" || typeof val === \"function\") &&\n !!val.then &&\n typeof val.then === \"function\"\n );\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions, type ResolvedConfig } from \"./config\";\nimport {\n run,\n type FileResult,\n type FileResultCallback,\n} from \"./transformation\";\n\ntype Transform = {\n (code: string, callback: FileResultCallback): void,\n (code: string, opts: ?InputOptions, callback: FileResultCallback): void,\n\n // Here for backward-compatibility. Ideally use \".transformSync\" if you want\n // a synchronous API.\n (code: string, opts: ?InputOptions): FileResult | null,\n};\n\nconst transformRunner = gensync<[string, ?InputOptions], FileResult | null>(\n function* transform(code, opts) {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n return yield* run(config, code);\n },\n);\n\nexport const transform: Transform = (function transform(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 6, we allow sync transformation when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) return transformRunner.sync(code, opts);\n\n transformRunner.errback(code, opts, callback);\n}: Function);\n\nexport const transformSync = transformRunner.sync;\nexport const transformAsync = transformRunner.async;\n","// @flow\n\n// duplicated from transform-file so we do not have to import anything here\ntype TransformFile = {\n (filename: string, callback: Function): void,\n (filename: string, opts: ?Object, callback: Function): void,\n};\n\nexport const transformFile: TransformFile = (function transformFile(\n filename,\n opts,\n callback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n }\n\n callback(new Error(\"Transforming files is not supported in browsers\"), null);\n}: Function);\n\nexport function transformFileSync() {\n throw new Error(\"Transforming files is not supported in browsers\");\n}\n\nexport function transformFileAsync() {\n return Promise.reject(\n new Error(\"Transforming files is not supported in browsers\"),\n );\n}\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions, type ResolvedConfig } from \"./config\";\nimport {\n run,\n type FileResult,\n type FileResultCallback,\n} from \"./transformation\";\n\ntype AstRoot = BabelNodeFile | BabelNodeProgram;\n\ntype TransformFromAst = {\n (ast: AstRoot, code: string, callback: FileResultCallback): void,\n (\n ast: AstRoot,\n code: string,\n opts: ?InputOptions,\n callback: FileResultCallback,\n ): void,\n\n // Here for backward-compatibility. Ideally use \".transformSync\" if you want\n // a synchronous API.\n (ast: AstRoot, code: string, opts: ?InputOptions): FileResult | null,\n};\n\nconst transformFromAstRunner = gensync<\n [AstRoot, string, ?InputOptions],\n FileResult | null,\n>(function*(ast, code, opts) {\n const config: ResolvedConfig | null = yield* loadConfig(opts);\n if (config === null) return null;\n\n if (!ast) throw new Error(\"No AST given\");\n\n return yield* run(config, code, ast);\n});\n\nexport const transformFromAst: TransformFromAst = (function transformFromAst(\n ast,\n code,\n opts,\n callback,\n) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 6, we allow sync transformation when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) {\n return transformFromAstRunner.sync(ast, code, opts);\n }\n\n transformFromAstRunner.errback(ast, code, opts, callback);\n}: Function);\n\nexport const transformFromAstSync = transformFromAstRunner.sync;\nexport const transformFromAstAsync = transformFromAstRunner.async;\n","// @flow\n\nimport gensync from \"gensync\";\n\nimport loadConfig, { type InputOptions } from \"./config\";\nimport parser from \"./parser\";\nimport type { ParseResult } from \"./parser\";\nimport normalizeOptions from \"./transformation/normalize-opts\";\n\ntype FileParseCallback = {\n (Error, null): any,\n (null, ParseResult | null): any,\n};\n\ntype Parse = {\n (code: string, callback: FileParseCallback): void,\n (code: string, opts: ?InputOptions, callback: FileParseCallback): void,\n\n // Here for backward-compatibility. Ideally use \".parseSync\" if you want\n // a synchronous API.\n (code: string, opts: ?InputOptions): ParseResult | null,\n};\n\nconst parseRunner = gensync<[string, ?InputOptions], ParseResult | null>(\n function* parse(code, opts) {\n const config = yield* loadConfig(opts);\n\n if (config === null) {\n return null;\n }\n\n return yield* parser(config.passes, normalizeOptions(config), code);\n },\n);\n\nexport const parse: Parse = (function parse(code, opts, callback) {\n if (typeof opts === \"function\") {\n callback = opts;\n opts = undefined;\n }\n\n // For backward-compat with Babel 7's early betas, we allow sync parsing when\n // no callback is given. Will be dropped in some future Babel major version.\n if (callback === undefined) return parseRunner.sync(code, opts);\n\n parseRunner.errback(code, opts, callback);\n}: Function);\n\nexport const parseSync = parseRunner.sync;\nexport const parseAsync = parseRunner.async;\n","// @flow\n\nexport { default as File } from \"./transformation/file/file\";\nexport { default as buildExternalHelpers } from \"./tools/build-external-helpers\";\nexport { resolvePlugin, resolvePreset } from \"./config/files\";\n\nexport { version } from \"../package.json\";\nexport { getEnv } from \"./config/helpers/environment\";\n\nexport * as types from \"@babel/types\";\nexport { tokTypes } from \"@babel/parser\";\n\nexport { default as traverse } from \"@babel/traverse\";\nexport { default as template } from \"@babel/template\";\n\nexport { createConfigItem } from \"./config/item\";\n\nexport {\n loadPartialConfig,\n loadPartialConfigSync,\n loadPartialConfigAsync,\n loadOptions,\n loadOptionsSync,\n loadOptionsAsync,\n} from \"./config\";\n\nexport { transform, transformSync, transformAsync } from \"./transform\";\nexport {\n transformFile,\n transformFileSync,\n transformFileAsync,\n} from \"./transform-file\";\nexport {\n transformFromAst,\n transformFromAstSync,\n transformFromAstAsync,\n} from \"./transform-ast\";\nexport { parse, parseSync, parseAsync } from \"./parse\";\n\n/**\n * Recommended set of compilable extensions. Not used in @babel/core directly, but meant as\n * as an easy source for tooling making use of @babel/core.\n */\nexport const DEFAULT_EXTENSIONS = Object.freeze([\n \".js\",\n \".jsx\",\n \".es6\",\n \".es\",\n \".mjs\",\n]);\n\n// For easier backward-compatibility, provide an API like the one we exposed in Babel 6.\nimport { loadOptions } from \"./config\";\nexport class OptionManager {\n init(opts: {}) {\n return loadOptions(opts);\n }\n}\n\nexport function Plugin(alias: string) {\n throw new Error(\n `The (${alias}) Babel 5 plugin is being run with an unsupported Babel version.`,\n );\n}\n","export function declare(builder) {\n return (api, options, dirname) => {\n if (!api.assertVersion) {\n // Inject a custom version of 'assertVersion' for Babel 6 and early\n // versions of Babel 7's beta that didn't have it.\n api = Object.assign(copyApiObject(api), {\n assertVersion(range) {\n throwVersionError(range, api.version);\n },\n });\n }\n\n return builder(api, options || {}, dirname);\n };\n}\n\nfunction copyApiObject(api) {\n // Babel >= 7 <= beta.41 passed the API as a new object that had\n // babel/core as the prototype. While slightly faster, it also\n // means that the Object.assign copy below fails. Rather than\n // keep complexity, the Babel 6 behavior has been reverted and this\n // normalizes all that for Babel 7.\n let proto = null;\n if (typeof api.version === \"string\" && /^7\\./.test(api.version)) {\n proto = Object.getPrototypeOf(api);\n if (\n proto &&\n (!has(proto, \"version\") ||\n !has(proto, \"transform\") ||\n !has(proto, \"template\") ||\n !has(proto, \"types\"))\n ) {\n proto = null;\n }\n }\n\n return {\n ...proto,\n ...api,\n };\n}\n\nfunction has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nfunction throwVersionError(range, version) {\n if (typeof range === \"number\") {\n if (!Number.isInteger(range)) {\n throw new Error(\"Expected string or integer value.\");\n }\n range = `^${range}.0.0-0`;\n }\n if (typeof range !== \"string\") {\n throw new Error(\"Expected string or integer value.\");\n }\n\n const limit = Error.stackTraceLimit;\n\n if (typeof limit === \"number\" && limit < 25) {\n // Bump up the limit if needed so that users are more likely\n // to be able to see what is calling Babel.\n Error.stackTraceLimit = 25;\n }\n\n let err;\n if (version.slice(0, 2) === \"7.\") {\n err = new Error(\n `Requires Babel \"^7.0.0-beta.41\", but was loaded with \"${version}\". ` +\n `You'll need to update your @babel/core version.`,\n );\n } else {\n err = new Error(\n `Requires Babel \"${range}\", but was loaded with \"${version}\". ` +\n `If you are sure you have a compatible version of @babel/core, ` +\n `it is likely that something in your build process is loading the ` +\n `wrong version. Inspect the stack trace of this error to look for ` +\n `the first entry that doesn't mention \"@babel/core\" or \"babel-core\" ` +\n `to see what is calling Babel.`,\n );\n }\n\n if (typeof limit === \"number\") {\n Error.stackTraceLimit = limit;\n }\n\n throw Object.assign(\n err,\n ({\n code: \"BABEL_VERSION_UNSUPPORTED\",\n version,\n range,\n }: any),\n );\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { helperVersion = \"7.0.0-beta.0\", whitelist = false } = options;\n\n if (\n whitelist !== false &&\n (!Array.isArray(whitelist) || whitelist.some(w => typeof w !== \"string\"))\n ) {\n throw new Error(\n \".whitelist must be undefined, false, or an array of strings\",\n );\n }\n\n const helperWhitelist = whitelist ? new Set(whitelist) : null;\n\n return {\n name: \"external-helpers\",\n pre(file) {\n file.set(\"helperGenerator\", name => {\n // If the helper didn't exist yet at the version given, we bail\n // out and let Babel either insert it directly, or throw an error\n // so that plugins can handle that case properly.\n if (\n file.availableHelper &&\n !file.availableHelper(name, helperVersion)\n ) {\n return;\n }\n\n // babelCore.buildExternalHelpers() allows a whitelist of helpers that\n // will be inserted into the external helpers list. That same whitelist\n // should be passed into the plugin here in that case, so that we can\n // avoid referencing 'babelHelpers.XX' when the helper does not exist.\n if (helperWhitelist && !helperWhitelist.has(name)) return;\n\n return t.memberExpression(\n t.identifier(\"babelHelpers\"),\n t.identifier(name),\n );\n });\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-async-generators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"asyncGenerators\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-class-properties\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\n \"classProperties\",\n \"classPrivateProperties\",\n \"classPrivateMethods\",\n );\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { legacy = false } = options;\n if (typeof legacy !== \"boolean\") {\n throw new Error(\"'legacy' must be a boolean.\");\n }\n\n const { decoratorsBeforeExport } = options;\n if (decoratorsBeforeExport === undefined) {\n if (!legacy) {\n throw new Error(\n \"The '@babel/plugin-syntax-decorators' plugin requires a\" +\n \" 'decoratorsBeforeExport' option, whose value must be a boolean.\" +\n \" If you want to use the legacy decorators semantics, you can set\" +\n \" the 'legacy: true' option.\",\n );\n }\n } else {\n if (legacy) {\n throw new Error(\n \"'decoratorsBeforeExport' can't be used with legacy decorators.\",\n );\n }\n if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n return {\n name: \"syntax-decorators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\n legacy\n ? \"decorators-legacy\"\n : [\"decorators\", { decoratorsBeforeExport }],\n );\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-do-expressions\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"doExpressions\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-dynamic-import\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"dynamicImport\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-export-default-from\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"exportDefaultFrom\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-export-namespace-from\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"exportNamespaceFrom\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n // When enabled and plugins includes flow, all files should be parsed as if\n // the @flow pragma was provided.\n const { all, enums } = options;\n\n if (typeof all !== \"boolean\" && typeof all !== \"undefined\") {\n throw new Error(\".all must be a boolean, or undefined\");\n }\n\n if (typeof enums !== \"boolean\" && typeof enums !== \"undefined\") {\n throw new Error(\".enums must be a boolean, or undefined\");\n }\n\n return {\n name: \"syntax-flow\",\n\n manipulateOptions(opts, parserOpts) {\n // If the file has already enabled TS, assume that this is not a\n // valid Flowtype file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n\n parserOpts.plugins.push([\"flow\", { all, enums }]);\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-function-bind\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"functionBind\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-function-sent\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"functionSent\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-import-meta\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"importMeta\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-jsx\",\n\n manipulateOptions(opts, parserOpts) {\n // If the Typescript plugin already ran, it will have decided whether\n // or not this is a TSX file.\n if (\n parserOpts.plugins.some(\n p => (Array.isArray(p) ? p[0] : p) === \"typescript\",\n )\n ) {\n return;\n }\n\n parserOpts.plugins.push(\"jsx\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-object-rest-spread\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"objectRestSpread\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-optional-catch-binding\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"optionalCatchBinding\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport const proposals = [\"minimal\", \"smart\", \"fsharp\"];\n\nexport default declare((api, { proposal }) => {\n api.assertVersion(7);\n\n if (typeof proposal !== \"string\" || !proposals.includes(proposal)) {\n throw new Error(\n \"The pipeline operator plugin requires a 'proposal' option.\" +\n \"'proposal' must be one of: \" +\n proposals.join(\", \") +\n \". More details: https://babeljs.io/docs/en/next/babel-plugin-proposal-pipeline-operator\",\n );\n }\n\n return {\n name: \"syntax-pipeline-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push([\"pipelineOperator\", { proposal }]);\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-top-level-await\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"topLevelAwait\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nfunction removePlugin(plugins, name) {\n const indices = [];\n plugins.forEach((plugin, i) => {\n const n = Array.isArray(plugin) ? plugin[0] : plugin;\n\n if (n === name) {\n indices.unshift(i);\n }\n });\n\n for (const i of indices) {\n plugins.splice(i, 1);\n }\n}\n\nexport default declare((api, { isTSX }) => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-typescript\",\n\n manipulateOptions(opts, parserOpts) {\n const { plugins } = parserOpts;\n // If the Flow syntax plugin already ran, remove it since Typescript\n // takes priority.\n removePlugin(plugins, \"flow\");\n\n // If the JSX syntax plugin already ran, remove it because JSX handling\n // in TS depends on the extensions, and is purely dependent on 'isTSX'.\n removePlugin(plugins, \"jsx\");\n\n parserOpts.plugins.push(\n \"typescript\",\n \"classProperties\",\n // TODO: This is enabled by default now, remove in Babel 8\n \"objectRestSpread\",\n );\n\n if (isTSX) {\n parserOpts.plugins.push(\"jsx\");\n }\n },\n };\n});\n","import type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport template from \"@babel/template\";\nimport * as t from \"@babel/types\";\n\nconst buildAnonymousExpressionWrapper = template.expression(`\n (function () {\n var REF = FUNCTION;\n return function NAME(PARAMS) {\n return REF.apply(this, arguments);\n };\n })()\n`);\n\nconst buildNamedExpressionWrapper = template.expression(`\n (function () {\n var REF = FUNCTION;\n function NAME(PARAMS) {\n return REF.apply(this, arguments);\n }\n return NAME;\n })()\n`);\n\nconst buildDeclarationWrapper = template(`\n function NAME(PARAMS) { return REF.apply(this, arguments); }\n function REF() {\n REF = FUNCTION;\n return REF.apply(this, arguments);\n }\n`);\n\nfunction classOrObjectMethod(path: NodePath, callId: Object) {\n const node = path.node;\n const body = node.body;\n\n const container = t.functionExpression(\n null,\n [],\n t.blockStatement(body.body),\n true,\n );\n body.body = [\n t.returnStatement(\n t.callExpression(t.callExpression(callId, [container]), []),\n ),\n ];\n\n // Regardless of whether or not the wrapped function is a an async method\n // or generator the outer function should not be\n node.async = false;\n node.generator = false;\n\n // Unwrap the wrapper IIFE's environment so super and this and such still work.\n path\n .get(\"body.body.0.argument.callee.arguments.0\")\n .unwrapFunctionEnvironment();\n}\n\nfunction plainFunction(path: NodePath, callId: Object) {\n const node = path.node;\n const isDeclaration = path.isFunctionDeclaration();\n const functionId = node.id;\n const wrapper = isDeclaration\n ? buildDeclarationWrapper\n : functionId\n ? buildNamedExpressionWrapper\n : buildAnonymousExpressionWrapper;\n\n if (path.isArrowFunctionExpression()) {\n path.arrowFunctionToExpression();\n }\n\n node.id = null;\n\n if (isDeclaration) {\n node.type = \"FunctionExpression\";\n }\n\n const built = t.callExpression(callId, [node]);\n const container = wrapper({\n NAME: functionId || null,\n REF: path.scope.generateUidIdentifier(functionId ? functionId.name : \"ref\"),\n FUNCTION: built,\n PARAMS: node.params.reduce(\n (acc, param) => {\n acc.done =\n acc.done || t.isAssignmentPattern(param) || t.isRestElement(param);\n\n if (!acc.done) {\n acc.params.push(path.scope.generateUidIdentifier(\"x\"));\n }\n\n return acc;\n },\n {\n params: [],\n done: false,\n },\n ).params,\n });\n\n if (isDeclaration) {\n path.replaceWith(container[0]);\n path.insertAfter(container[1]);\n } else {\n const retFunction = container.callee.body.body[1].argument;\n if (!functionId) {\n nameFunction({\n node: retFunction,\n parent: path.parent,\n scope: path.scope,\n });\n }\n\n if (!retFunction || retFunction.id || node.params.length) {\n // we have an inferred function id or params so we need this wrapper\n path.replaceWith(container);\n } else {\n // we can omit this wrapper as the conditions it protects for do not apply\n path.replaceWith(built);\n }\n }\n}\n\nexport default function wrapFunction(path: NodePath, callId: Object) {\n if (path.isClassMethod() || path.isObjectMethod()) {\n classOrObjectMethod(path, callId);\n } else {\n plainFunction(path, callId);\n }\n}\n","import * as t from \"@babel/types\";\n\nconst PURE_ANNOTATION = \"#__PURE__\";\n\nconst isPureAnnotated = ({ leadingComments }) =>\n !!leadingComments &&\n leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));\n\nexport default function annotateAsPure(pathOrNode) {\n const node = pathOrNode.node || pathOrNode;\n if (isPureAnnotated(node)) {\n return;\n }\n t.addComment(node, \"leading\", PURE_ANNOTATION);\n}\n","/* @noflow */\n\nimport type { NodePath } from \"@babel/traverse\";\nimport wrapFunction from \"@babel/helper-wrap-function\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport * as t from \"@babel/types\";\n\nconst awaitVisitor = {\n Function(path) {\n path.skip();\n },\n\n AwaitExpression(path, { wrapAwait }) {\n const argument = path.get(\"argument\");\n\n if (path.parentPath.isYieldExpression()) {\n path.replaceWith(argument.node);\n return;\n }\n\n path.replaceWith(\n t.yieldExpression(\n wrapAwait\n ? t.callExpression(t.cloneNode(wrapAwait), [argument.node])\n : argument.node,\n ),\n );\n },\n};\n\nexport default function(\n path: NodePath,\n helpers: { wrapAsync: Object, wrapAwait: Object },\n) {\n path.traverse(awaitVisitor, {\n wrapAwait: helpers.wrapAwait,\n });\n\n const isIIFE = checkIsIIFE(path);\n\n path.node.async = false;\n path.node.generator = true;\n\n wrapFunction(path, t.cloneNode(helpers.wrapAsync));\n\n const isProperty =\n path.isObjectMethod() ||\n path.isClassMethod() ||\n path.parentPath.isObjectProperty() ||\n path.parentPath.isClassProperty();\n\n if (!isProperty && !isIIFE && path.isExpression()) {\n annotateAsPure(path);\n }\n\n function checkIsIIFE(path: NodePath) {\n if (path.parentPath.isCallExpression({ callee: path.node })) {\n return true;\n }\n\n // try to catch calls to Function#bind, as emitted by arrowFunctionToExpression in spec mode\n // this may also catch .bind(this) written by users, but does it matter? 🤔\n const { parentPath } = path;\n if (\n parentPath.isMemberExpression() &&\n t.isIdentifier(parentPath.node.property, { name: \"bind\" })\n ) {\n const { parentPath: bindCall } = parentPath;\n\n // (function () { ... }).bind(this)()\n\n return (\n // first, check if the .bind is actually being called\n bindCall.isCallExpression() &&\n // and whether its sole argument is 'this'\n bindCall.node.arguments.length === 1 &&\n t.isThisExpression(bindCall.node.arguments[0]) &&\n // and whether the result of the .bind(this) is being called\n bindCall.parentPath.isCallExpression({ callee: bindCall.node })\n );\n }\n\n return false;\n }\n}\n","import { types as t, template } from \"@babel/core\";\n\nconst buildForAwait = template(`\n async function wrapper() {\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY;\n try {\n for (\n var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE;\n (\n STEP_KEY = await ITERATOR_KEY.next(),\n ITERATOR_COMPLETION = STEP_KEY.done,\n STEP_VALUE = await STEP_KEY.value,\n !ITERATOR_COMPLETION\n );\n ITERATOR_COMPLETION = true) {\n }\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n await ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n }\n`);\n\nexport default function(path, { getAsyncIterator }) {\n const { node, scope, parent } = path;\n\n const stepKey = scope.generateUidIdentifier(\"step\");\n const stepValue = scope.generateUidIdentifier(\"value\");\n const left = node.left;\n let declar;\n\n if (t.isIdentifier(left) || t.isPattern(left) || t.isMemberExpression(left)) {\n // for await (i of test), for await ({ i } of test)\n declar = t.expressionStatement(\n t.assignmentExpression(\"=\", left, stepValue),\n );\n } else if (t.isVariableDeclaration(left)) {\n // for await (let i of test)\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, stepValue),\n ]);\n }\n let template = buildForAwait({\n ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier(\"didIteratorError\"),\n ITERATOR_COMPLETION: scope.generateUidIdentifier(\n \"iteratorNormalCompletion\",\n ),\n ITERATOR_ERROR_KEY: scope.generateUidIdentifier(\"iteratorError\"),\n ITERATOR_KEY: scope.generateUidIdentifier(\"iterator\"),\n GET_ITERATOR: getAsyncIterator,\n OBJECT: node.right,\n STEP_VALUE: stepValue,\n STEP_KEY: stepKey,\n });\n\n // remove async function wrapper\n template = template.body.body;\n\n const isLabeledParent = t.isLabeledStatement(parent);\n const tryBody = template[3].block.body;\n const loop = tryBody[0];\n\n if (isLabeledParent) {\n tryBody[0] = t.labeledStatement(parent.label, loop);\n }\n\n return {\n replaceParent: isLabeledParent,\n node: template,\n declar,\n loop,\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport remapAsyncToGenerator from \"@babel/helper-remap-async-to-generator\";\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport { types as t } from \"@babel/core\";\nimport rewriteForAwait from \"./for-await\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const yieldStarVisitor = {\n Function(path) {\n path.skip();\n },\n\n YieldExpression({ node }, state) {\n if (!node.delegate) return;\n const callee = state.addHelper(\"asyncGeneratorDelegate\");\n node.argument = t.callExpression(callee, [\n t.callExpression(state.addHelper(\"asyncIterator\"), [node.argument]),\n state.addHelper(\"awaitAsyncGenerator\"),\n ]);\n },\n };\n\n const forAwaitVisitor = {\n Function(path) {\n path.skip();\n },\n\n ForOfStatement(path, { file }) {\n const { node } = path;\n if (!node.await) return;\n\n const build = rewriteForAwait(path, {\n getAsyncIterator: file.addHelper(\"asyncIterator\"),\n });\n\n const { declar, loop } = build;\n const block = loop.body;\n\n // ensure that it's a block so we can take all its statements\n path.ensureBlock();\n\n // add the value declaration to the new loop body\n if (declar) {\n block.body.push(declar);\n }\n\n // push the rest of the original loop body onto our new body\n block.body = block.body.concat(node.body.body);\n\n t.inherits(loop, node);\n t.inherits(loop.body, node.body);\n\n if (build.replaceParent) {\n path.parentPath.replaceWithMultiple(build.node);\n } else {\n path.replaceWithMultiple(build.node);\n }\n },\n };\n\n const visitor = {\n Function(path, state) {\n if (!path.node.async) return;\n\n path.traverse(forAwaitVisitor, state);\n\n if (!path.node.generator) return;\n\n path.traverse(yieldStarVisitor, state);\n\n remapAsyncToGenerator(path, {\n wrapAsync: state.addHelper(\"wrapAsyncGenerator\"),\n wrapAwait: state.addHelper(\"awaitAsyncGenerator\"),\n });\n },\n };\n\n return {\n name: \"proposal-async-generator-functions\",\n inherits: syntaxAsyncGenerators,\n\n visitor: {\n Program(path, state) {\n // We need to traverse the ast here (instead of just vising Function\n // in the top level visitor) because for-await needs to run before the\n // async-to-generator plugin. This is because for-await is transpiled\n // using \"await\" expressions, which are then converted to \"yield\".\n //\n // This is bad for performance, but plugin ordering will allow as to\n // directly visit Function in the top level visitor.\n path.traverse(visitor, state);\n },\n },\n };\n});\n","import * as t from \"@babel/types\";\n\nclass AssignmentMemoiser {\n constructor() {\n this._map = new WeakMap();\n }\n\n has(key) {\n return this._map.has(key);\n }\n\n get(key) {\n if (!this.has(key)) return;\n\n const record = this._map.get(key);\n const { value } = record;\n\n record.count--;\n if (record.count === 0) {\n // The `count` access is the outermost function call (hopefully), so it\n // does the assignment.\n return t.assignmentExpression(\"=\", value, key);\n }\n return value;\n }\n\n set(key, value, count) {\n return this._map.set(key, { count, value });\n }\n}\n\nconst handle = {\n memoise() {\n // noop.\n },\n\n handle(member) {\n const { node, parent, parentPath } = member;\n\n // MEMBER++ -> _set(MEMBER, (_ref = (+_get(MEMBER))) + 1), _ref\n // ++MEMBER -> _set(MEMBER, (+_get(MEMBER)) + 1)\n if (parentPath.isUpdateExpression({ argument: node })) {\n const { operator, prefix } = parent;\n\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n const value = t.binaryExpression(\n operator[0],\n t.unaryExpression(\"+\", this.get(member)),\n t.numericLiteral(1),\n );\n\n if (prefix) {\n parentPath.replaceWith(this.set(member, value));\n } else {\n const { scope } = member;\n const ref = scope.generateUidIdentifierBasedOnNode(node);\n scope.push({ id: ref });\n\n value.left = t.assignmentExpression(\"=\", t.cloneNode(ref), value.left);\n\n parentPath.replaceWith(\n t.sequenceExpression([this.set(member, value), t.cloneNode(ref)]),\n );\n }\n return;\n }\n\n // MEMBER = VALUE -> _set(MEMBER, VALUE)\n // MEMBER += VALUE -> _set(MEMBER, _get(MEMBER) + VALUE)\n if (parentPath.isAssignmentExpression({ left: node })) {\n const { operator, right } = parent;\n let value = right;\n\n if (operator !== \"=\") {\n // Give the state handler a chance to memoise the member, since we'll\n // reference it twice. The second access (the set) should do the memo\n // assignment.\n this.memoise(member, 2);\n\n value = t.binaryExpression(\n operator.slice(0, -1),\n this.get(member),\n value,\n );\n }\n\n parentPath.replaceWith(this.set(member, value));\n return;\n }\n\n // MEMBER(ARGS) -> _call(MEMBER, ARGS)\n if (parentPath.isCallExpression({ callee: node })) {\n const { arguments: args } = parent;\n\n parentPath.replaceWith(this.call(member, args));\n return;\n }\n\n // { KEY: MEMBER } = OBJ -> { KEY: _destructureSet(MEMBER) } = OBJ\n // { KEY: MEMBER = _VALUE } = OBJ -> { KEY: _destructureSet(MEMBER) = _VALUE } = OBJ\n // {...MEMBER} -> {..._destructureSet(MEMBER)}\n //\n // [MEMBER] = ARR -> [_destructureSet(MEMBER)] = ARR\n // [MEMBER = _VALUE] = ARR -> [_destructureSet(MEMBER) = _VALUE] = ARR\n // [...MEMBER] -> [..._destructureSet(MEMBER)]\n if (\n // { KEY: MEMBER } = OBJ\n (parentPath.isObjectProperty({ value: node }) &&\n parentPath.parentPath.isObjectPattern()) ||\n // { KEY: MEMBER = _VALUE } = OBJ\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isObjectProperty({ value: parent }) &&\n parentPath.parentPath.parentPath.isObjectPattern()) ||\n // [MEMBER] = ARR\n parentPath.isArrayPattern() ||\n // [MEMBER = _VALUE] = ARR\n (parentPath.isAssignmentPattern({ left: node }) &&\n parentPath.parentPath.isArrayPattern()) ||\n // {...MEMBER}\n // [...MEMBER]\n parentPath.isRestElement()\n ) {\n member.replaceWith(this.destructureSet(member));\n return;\n }\n\n // MEMBER -> _get(MEMBER)\n member.replaceWith(this.get(member));\n },\n};\n\n// We do not provide a default traversal visitor\n// Instead, caller passes one, and must call `state.handle` on the members\n// it wishes to be transformed.\n// Additionally, the caller must pass in a state object with at least\n// get, set, and call methods.\n// Optionally, a memoise method may be defined on the state, which will be\n// called when the member is a self-referential update.\nexport default function memberExpressionToFunctions(path, visitor, state) {\n path.traverse(visitor, {\n ...handle,\n ...state,\n memoiser: new AssignmentMemoiser(),\n });\n}\n","import * as t from \"@babel/types\";\n\nexport default function(callee, thisNode, args) {\n if (\n args.length === 1 &&\n t.isSpreadElement(args[0]) &&\n t.isIdentifier(args[0].argument, { name: \"arguments\" })\n ) {\n // eg. super(...arguments);\n return t.callExpression(t.memberExpression(callee, t.identifier(\"apply\")), [\n thisNode,\n args[0].argument,\n ]);\n } else {\n return t.callExpression(t.memberExpression(callee, t.identifier(\"call\")), [\n thisNode,\n ...args,\n ]);\n }\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport traverse from \"@babel/traverse\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport * as t from \"@babel/types\";\n\n/**\n * Creates an expression which result is the proto of objectRef.\n *\n * @example isStatic === true\n *\n * helpers.getPrototypeOf(CLASS)\n *\n * @example isStatic === false\n *\n * helpers.getPrototypeOf(CLASS.prototype)\n */\nfunction getPrototypeOfExpression(objectRef, isStatic, file, isPrivateMethod) {\n objectRef = t.cloneNode(objectRef);\n const targetRef =\n isStatic || isPrivateMethod\n ? objectRef\n : t.memberExpression(objectRef, t.identifier(\"prototype\"));\n\n return t.callExpression(file.addHelper(\"getPrototypeOf\"), [targetRef]);\n}\n\nfunction skipAllButComputedKey(path) {\n // If the path isn't computed, just skip everything.\n if (!path.node.computed) {\n path.skip();\n return;\n }\n\n // So it's got a computed key. Make sure to skip every other key the\n // traversal would visit.\n const keys = t.VISITOR_KEYS[path.type];\n for (const key of keys) {\n if (key !== \"key\") path.skipKey(key);\n }\n}\n\nexport const environmentVisitor = {\n TypeAnnotation(path) {\n path.skip();\n },\n Function(path) {\n // Methods will be handled by the Method visit\n if (path.isMethod()) return;\n // Arrow functions inherit their parent's environment\n if (path.isArrowFunctionExpression()) return;\n path.skip();\n },\n\n \"Method|ClassProperty|ClassPrivateProperty\"(path) {\n skipAllButComputedKey(path);\n },\n};\n\nconst visitor = traverse.visitors.merge([\n environmentVisitor,\n {\n Super(path, state) {\n const { node, parentPath } = path;\n if (!parentPath.isMemberExpression({ object: node })) return;\n state.handle(parentPath);\n },\n },\n]);\n\nconst specHandlers = {\n memoise(superMember, count) {\n const { scope, node } = superMember;\n const { computed, property } = node;\n if (!computed) {\n return;\n }\n\n const memo = scope.maybeGenerateMemoised(property);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(property, memo, count);\n },\n\n prop(superMember) {\n const { computed, property } = superMember.node;\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n if (computed) {\n return t.cloneNode(property);\n }\n\n return t.stringLiteral(property.name);\n },\n\n get(superMember) {\n return t.callExpression(this.file.addHelper(\"get\"), [\n getPrototypeOfExpression(\n this.getObjectRef(),\n this.isStatic,\n this.file,\n this.isPrivateMethod,\n ),\n this.prop(superMember),\n t.thisExpression(),\n ]);\n },\n\n set(superMember, value) {\n return t.callExpression(this.file.addHelper(\"set\"), [\n getPrototypeOfExpression(\n this.getObjectRef(),\n this.isStatic,\n this.file,\n this.isPrivateMethod,\n ),\n this.prop(superMember),\n value,\n t.thisExpression(),\n t.booleanLiteral(superMember.isInStrictMode()),\n ]);\n },\n\n destructureSet(superMember) {\n throw superMember.buildCodeFrameError(\n `Destructuring to a super field is not supported yet.`,\n );\n },\n\n call(superMember, args) {\n return optimiseCall(this.get(superMember), t.thisExpression(), args);\n },\n};\n\nconst looseHandlers = {\n ...specHandlers,\n\n prop(superMember) {\n const { property } = superMember.node;\n if (this.memoiser.has(property)) {\n return t.cloneNode(this.memoiser.get(property));\n }\n\n return t.cloneNode(property);\n },\n\n get(superMember) {\n const { isStatic, superRef } = this;\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n let object;\n if (isStatic) {\n object = superRef\n ? t.cloneNode(superRef)\n : t.memberExpression(\n t.identifier(\"Function\"),\n t.identifier(\"prototype\"),\n );\n } else {\n object = superRef\n ? t.memberExpression(t.cloneNode(superRef), t.identifier(\"prototype\"))\n : t.memberExpression(t.identifier(\"Object\"), t.identifier(\"prototype\"));\n }\n\n return t.memberExpression(object, prop, computed);\n },\n\n set(superMember, value) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(t.thisExpression(), prop, computed),\n value,\n );\n },\n\n destructureSet(superMember) {\n const { computed } = superMember.node;\n const prop = this.prop(superMember);\n\n return t.memberExpression(t.thisExpression(), prop, computed);\n },\n};\n\nexport default class ReplaceSupers {\n constructor(opts: Object) {\n const path = opts.methodPath;\n\n this.methodPath = path;\n this.isStatic = path.isObjectMethod() || path.node.static;\n this.isPrivateMethod = path.isPrivate() && path.isMethod();\n\n this.file = opts.file;\n this.superRef = opts.superRef;\n this.isLoose = opts.isLoose;\n this.opts = opts;\n }\n\n methodPath: NodePath;\n superRef: Object;\n isStatic: boolean;\n isLoose: boolean;\n file;\n opts: {\n getObjetRef: Function,\n methodPath: NodePath,\n superRef: Object,\n isLoose: boolean,\n file: any,\n };\n\n getObjectRef() {\n return t.cloneNode(this.opts.objectRef || this.opts.getObjectRef());\n }\n\n replace() {\n const handler = this.isLoose ? looseHandlers : specHandlers;\n\n memberExpressionToFunctions(this.methodPath, visitor, {\n file: this.file,\n isStatic: this.isStatic,\n isPrivateMethod: this.isPrivateMethod,\n getObjectRef: this.getObjectRef.bind(this),\n superRef: this.superRef,\n ...handler,\n });\n }\n}\n","// @flow\n\nimport type { NodePath } from \"@babel/traverse\";\n\nexport function assertFieldTransformed(path: NodePath) {\n // TODO (Babel 8): Also check path.node.definite\n\n if (path.node.declare) {\n throw path.buildCodeFrameError(\n `TypeScript 'declare' fields must first be transformed by ` +\n `@babel/plugin-transform-typescript.\\n` +\n `If you have already enabled that plugin (or '@babel/preset-typescript'), make sure ` +\n `that it runs before any plugin related to additional class features:\\n` +\n ` - @babel/plugin-proposal-class-properties\\n` +\n ` - @babel/plugin-proposal-private-methods\\n` +\n ` - @babel/plugin-proposal-decorators`,\n );\n }\n}\n","import { template, traverse, types as t } from \"@babel/core\";\nimport ReplaceSupers, {\n environmentVisitor,\n} from \"@babel/helper-replace-supers\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\n\nimport * as ts from \"./typescript\";\n\nexport function buildPrivateNamesMap(props) {\n const privateNamesMap = new Map();\n for (const prop of props) {\n const isPrivate = prop.isPrivate();\n const isMethod = !prop.isProperty();\n const isInstance = !prop.node.static;\n if (isPrivate) {\n const { name } = prop.node.key.id;\n const update = privateNamesMap.has(name)\n ? privateNamesMap.get(name)\n : {\n id: prop.scope.generateUidIdentifier(name),\n static: !isInstance,\n method: isMethod,\n };\n if (prop.node.kind === \"get\") {\n update.getId = prop.scope.generateUidIdentifier(`get_${name}`);\n } else if (prop.node.kind === \"set\") {\n update.setId = prop.scope.generateUidIdentifier(`set_${name}`);\n } else if (prop.node.kind === \"method\") {\n update.methodId = prop.scope.generateUidIdentifier(name);\n }\n privateNamesMap.set(name, update);\n }\n }\n return privateNamesMap;\n}\n\nexport function buildPrivateNamesNodes(privateNamesMap, loose, state) {\n const initNodes = [];\n\n for (const [name, value] of privateNamesMap) {\n // In loose mode, both static and instance fields are transpiled using a\n // secret non-enumerable property. Hence, we also need to generate that\n // key (using the classPrivateFieldLooseKey helper).\n // In spec mode, only instance fields need a \"private name\" initializer\n // because static fields are directly assigned to a variable in the\n // buildPrivateStaticFieldInitSpec function.\n const { id, static: isStatic, method: isMethod, getId, setId } = value;\n const isAccessor = getId || setId;\n if (loose) {\n initNodes.push(\n template.statement.ast`\n var ${id} = ${state.addHelper(\"classPrivateFieldLooseKey\")}(\"${name}\")\n `,\n );\n } else if (isMethod && !isStatic) {\n if (isAccessor) {\n initNodes.push(template.statement.ast`var ${id} = new WeakMap();`);\n } else {\n initNodes.push(template.statement.ast`var ${id} = new WeakSet();`);\n }\n } else if (!isStatic) {\n initNodes.push(template.statement.ast`var ${id} = new WeakMap();`);\n }\n }\n\n return initNodes;\n}\n\n// Traverses the class scope, handling private name references. If an inner\n// class redeclares the same private name, it will hand off traversal to the\n// restricted visitor (which doesn't traverse the inner class's inner scope).\nconst privateNameVisitor = {\n PrivateName(path) {\n const { privateNamesMap } = this;\n const { node, parentPath } = path;\n\n if (!parentPath.isMemberExpression({ property: node })) return;\n if (!privateNamesMap.has(node.id.name)) return;\n\n this.handle(parentPath);\n },\n\n Class(path) {\n const { privateNamesMap } = this;\n const body = path.get(\"body.body\");\n\n for (const prop of body) {\n if (!prop.isPrivate()) {\n continue;\n }\n if (!privateNamesMap.has(prop.node.key.id.name)) continue;\n\n // This class redeclares the private name.\n // So, we can only evaluate the things in the outer scope.\n path.traverse(privateNameInnerVisitor, this);\n path.skip();\n break;\n }\n },\n};\n\n// Traverses the outer portion of a class, without touching the class's inner\n// scope, for private names.\nconst privateNameInnerVisitor = traverse.visitors.merge([\n {\n PrivateName: privateNameVisitor.PrivateName,\n },\n environmentVisitor,\n]);\n\nconst privateNameHandlerSpec = {\n memoise(member, count) {\n const { scope } = member;\n const { object } = member.node;\n\n const memo = scope.maybeGenerateMemoised(object);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(object, memo, count);\n },\n\n receiver(member) {\n const { object } = member.node;\n\n if (this.memoiser.has(object)) {\n return t.cloneNode(this.memoiser.get(object));\n }\n\n return t.cloneNode(object);\n },\n\n get(member) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n methodId,\n getId,\n setId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodGet\"\n : \"classStaticPrivateFieldSpecGet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]);\n }\n\n if (isMethod) {\n if (isAccessor) {\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n t.cloneNode(methodId),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n },\n\n set(member, value) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n getId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodSet\"\n : \"classStaticPrivateFieldSpecSet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n value,\n ]);\n }\n if (isMethod) {\n if (setId) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodSet\"), []);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n },\n\n destructureSet(member) {\n const { privateNamesMap, file } = this;\n const { name } = member.node.property.id;\n const { id } = privateNamesMap.get(name);\n return t.memberExpression(\n t.callExpression(file.addHelper(\"classPrivateFieldDestructureSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n },\n\n call(member, args) {\n // The first access (the get) should do the memo assignment.\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args);\n },\n};\n\nconst privateNameHandlerLoose = {\n handle(member) {\n const { privateNamesMap, file } = this;\n const { object } = member.node;\n const { name } = member.node.property.id;\n\n member.replaceWith(\n template.expression`BASE(REF, PROP)[PROP]`({\n BASE: file.addHelper(\"classPrivateFieldLooseBase\"),\n REF: object,\n PROP: privateNamesMap.get(name).id,\n }),\n );\n },\n};\n\nexport function transformPrivateNamesUsage(\n ref,\n path,\n privateNamesMap,\n loose,\n state,\n) {\n const body = path.get(\"body\");\n\n if (loose) {\n body.traverse(privateNameVisitor, {\n privateNamesMap,\n file: state,\n ...privateNameHandlerLoose,\n });\n } else {\n memberExpressionToFunctions(body, privateNameVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n ...privateNameHandlerSpec,\n });\n }\n}\n\nfunction buildPrivateFieldInitLoose(ref, prop, privateNamesMap) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n });\n `;\n}\n\nfunction buildPrivateInstanceFieldInitSpec(ref, prop, privateNamesMap) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return template.statement.ast`${id}.set(${ref}, {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ${value},\n })`;\n}\n\nfunction buildPrivateStaticFieldInitSpec(prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n const isAccessor = getId || setId;\n\n if (!prop.isProperty() && (initAdded || !isAccessor)) return;\n\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n var ${id.name} = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n }\n `;\n }\n\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n return template.statement.ast`\n var ${id} = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n };\n `;\n}\n\nfunction buildPrivateMethodInitLoose(ref, prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { methodId, id, getId, setId, initAdded } = privateName;\n if (initAdded) return;\n\n if (methodId) {\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `;\n }\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `;\n }\n}\n\nfunction buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n ${id}.set(${ref}, {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n `;\n }\n return template.statement.ast`${id}.add(${ref})`;\n}\n\nfunction buildPublicFieldInitLoose(ref, prop) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(ref, key, computed || t.isLiteral(key)),\n value,\n ),\n );\n}\n\nfunction buildPublicFieldInitSpec(ref, prop, state) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n ref,\n computed || t.isLiteral(key) ? key : t.stringLiteral(key.name),\n value,\n ]),\n );\n}\n\nfunction buildPrivateStaticMethodInitLoose(ref, prop, state, privateNamesMap) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, methodId, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n })\n `;\n }\n\n return template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `;\n}\n\nfunction buildPrivateMethodDeclaration(prop, privateNamesMap, loose = false) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const {\n id,\n methodId,\n getId,\n setId,\n getterDeclared,\n setterDeclared,\n static: isStatic,\n } = privateName;\n const { params, body, generator, async } = prop.node;\n const methodValue = t.functionExpression(\n methodId,\n params,\n body,\n generator,\n async,\n );\n const isGetter = getId && !getterDeclared && params.length === 0;\n const isSetter = setId && !setterDeclared && params.length > 0;\n\n if (isGetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n getterDeclared: true,\n });\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(getId, methodValue),\n ]);\n }\n if (isSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n setterDeclared: true,\n });\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(setId, methodValue),\n ]);\n }\n if (isStatic && !loose) {\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(\n id,\n t.functionExpression(id, params, body, generator, async),\n ),\n ]);\n }\n\n return t.variableDeclaration(\"var\", [\n t.variableDeclarator(methodId, methodValue),\n ]);\n}\n\nconst thisContextVisitor = traverse.visitors.merge([\n {\n ThisExpression(path, state) {\n state.needsClassRef = true;\n path.replaceWith(t.cloneNode(state.classRef));\n },\n },\n environmentVisitor,\n]);\n\nfunction replaceThisContext(path, ref, superRef, file, loose) {\n const state = { classRef: ref, needsClassRef: false };\n\n const replacer = new ReplaceSupers({\n methodPath: path,\n isLoose: loose,\n superRef,\n file,\n getObjectRef() {\n state.needsClassRef = true;\n return path.node.static\n ? ref\n : t.memberExpression(ref, t.identifier(\"prototype\"));\n },\n });\n replacer.replace();\n if (path.isProperty()) {\n path.traverse(thisContextVisitor, state);\n }\n return state.needsClassRef;\n}\n\nexport function buildFieldsInitNodes(\n ref,\n superRef,\n props,\n privateNamesMap,\n state,\n loose,\n) {\n const staticNodes = [];\n const instanceNodes = [];\n let needsClassRef = false;\n\n for (const prop of props) {\n ts.assertFieldTransformed(prop);\n\n const isStatic = prop.node.static;\n const isInstance = !isStatic;\n const isPrivate = prop.isPrivate();\n const isPublic = !isPrivate;\n const isField = prop.isProperty();\n const isMethod = !isField;\n\n if (isStatic || (isMethod && isPrivate)) {\n const replaced = replaceThisContext(prop, ref, superRef, state, loose);\n needsClassRef = needsClassRef || replaced;\n }\n\n switch (true) {\n case isStatic && isPrivate && isField && loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),\n );\n break;\n case isStatic && isPrivate && isField && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n break;\n case isStatic && isPublic && isField && loose:\n needsClassRef = true;\n staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));\n break;\n case isStatic && isPublic && isField && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPublicFieldInitSpec(t.cloneNode(ref), prop, state),\n );\n break;\n case isInstance && isPrivate && isField && loose:\n instanceNodes.push(\n buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),\n );\n break;\n case isInstance && isPrivate && isField && !loose:\n instanceNodes.push(\n buildPrivateInstanceFieldInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && loose:\n instanceNodes.unshift(\n buildPrivateMethodInitLoose(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n staticNodes.push(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isInstance && isPrivate && isMethod && !loose:\n instanceNodes.unshift(\n buildPrivateInstanceMethodInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n ),\n );\n staticNodes.push(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isStatic && isPrivate && isMethod && !loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n staticNodes.unshift(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isStatic && isPrivate && isMethod && loose:\n needsClassRef = true;\n staticNodes.push(\n buildPrivateStaticMethodInitLoose(\n t.cloneNode(ref),\n prop,\n state,\n privateNamesMap,\n ),\n );\n staticNodes.unshift(\n buildPrivateMethodDeclaration(prop, privateNamesMap, loose),\n );\n break;\n case isInstance && isPublic && isField && loose:\n instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));\n break;\n case isInstance && isPublic && isField && !loose:\n instanceNodes.push(\n buildPublicFieldInitSpec(t.thisExpression(), prop, state),\n );\n break;\n default:\n throw new Error(\"Unreachable.\");\n }\n }\n\n return {\n staticNodes: staticNodes.filter(Boolean),\n instanceNodes: instanceNodes.filter(Boolean),\n wrapClass(path) {\n for (const prop of props) {\n prop.remove();\n }\n\n if (!needsClassRef) return path;\n\n if (path.isClassExpression()) {\n path.scope.push({ id: ref });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(ref), path.node),\n );\n } else if (!path.node.id) {\n // Anonymous class declaration\n path.node.id = ref;\n }\n\n return path;\n },\n };\n}\n","import { types as t, template } from \"@babel/core\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport nameFunction from \"@babel/helper-function-name\";\n\nexport function hasOwnDecorators(node) {\n return !!(node.decorators && node.decorators.length);\n}\n\nexport function hasDecorators(node) {\n return hasOwnDecorators(node) || node.body.body.some(hasOwnDecorators);\n}\n\nfunction prop(key, value) {\n if (!value) return null;\n return t.objectProperty(t.identifier(key), value);\n}\n\nfunction method(key, body) {\n return t.objectMethod(\n \"method\",\n t.identifier(key),\n [],\n t.blockStatement(body),\n );\n}\n\nfunction takeDecorators(node) {\n let result;\n if (node.decorators && node.decorators.length > 0) {\n result = t.arrayExpression(\n node.decorators.map(decorator => decorator.expression),\n );\n }\n node.decorators = undefined;\n return result;\n}\n\nfunction getKey(node) {\n if (node.computed) {\n return node.key;\n } else if (t.isIdentifier(node.key)) {\n return t.stringLiteral(node.key.name);\n } else {\n return t.stringLiteral(String(node.key.value));\n }\n}\n\n// NOTE: This function can be easily bound as .bind(file, classRef, superRef)\n// to make it easier to use it in a loop.\nfunction extractElementDescriptor(/* this: File, */ classRef, superRef, path) {\n const { node, scope } = path;\n const isMethod = path.isClassMethod();\n\n if (path.isPrivate()) {\n throw path.buildCodeFrameError(\n `Private ${\n isMethod ? \"methods\" : \"fields\"\n } in decorated classes are not supported yet.`,\n );\n }\n\n new ReplaceSupers(\n {\n methodPath: path,\n methodNode: node,\n objectRef: classRef,\n isStatic: node.static,\n superRef,\n scope,\n file: this,\n },\n true,\n ).replace();\n\n const properties = [\n prop(\"kind\", t.stringLiteral(isMethod ? node.kind : \"field\")),\n prop(\"decorators\", takeDecorators(node)),\n prop(\"static\", node.static && t.booleanLiteral(true)),\n prop(\"key\", getKey(node)),\n ].filter(Boolean);\n\n if (isMethod) {\n const id = node.computed ? null : node.key;\n t.toExpression(node);\n properties.push(prop(\"value\", nameFunction({ node, id, scope }) || node));\n } else if (node.value) {\n properties.push(\n method(\"value\", template.statements.ast`return ${node.value}`),\n );\n } else {\n properties.push(prop(\"value\", scope.buildUndefinedNode()));\n }\n\n path.remove();\n\n return t.objectExpression(properties);\n}\n\nfunction addDecorateHelper(file) {\n try {\n return file.addHelper(\"decorate\");\n } catch (err) {\n if (err.code === \"BABEL_HELPER_UNKNOWN\") {\n err.message +=\n \"\\n '@babel/plugin-transform-decorators' in non-legacy mode\" +\n \" requires '@babel/core' version ^7.0.2 and you appear to be using\" +\n \" an older version.\";\n }\n throw err;\n }\n}\n\nexport function buildDecoratedClass(ref, path, elements, file) {\n const { node, scope } = path;\n const initializeId = scope.generateUidIdentifier(\"initialize\");\n const isDeclaration = node.id && path.isDeclaration();\n const isStrict = path.isInStrictMode();\n const { superClass } = node;\n\n node.type = \"ClassDeclaration\";\n if (!node.id) node.id = t.cloneNode(ref);\n\n let superId;\n if (superClass) {\n superId = scope.generateUidIdentifierBasedOnNode(node.superClass, \"super\");\n node.superClass = superId;\n }\n\n const classDecorators = takeDecorators(node);\n const definitions = t.arrayExpression(\n elements.map(extractElementDescriptor.bind(file, node.id, superId)),\n );\n\n let replacement = template.expression.ast`\n ${addDecorateHelper(file)}(\n ${classDecorators || t.nullLiteral()},\n function (${initializeId}, ${superClass ? superId : null}) {\n ${node}\n return { F: ${t.cloneNode(node.id)}, d: ${definitions} };\n },\n ${superClass}\n )\n `;\n let classPathDesc = \"arguments.1.body.body.0\";\n\n if (!isStrict) {\n replacement.arguments[1].body.directives.push(\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n\n if (isDeclaration) {\n replacement = template.ast`let ${ref} = ${replacement}`;\n classPathDesc = \"declarations.0.init.\" + classPathDesc;\n }\n\n return {\n instanceNodes: [template.statement.ast`${initializeId}(this)`],\n wrapClass(path) {\n path.replaceWith(replacement);\n return path.get(classPathDesc);\n },\n };\n}\n","import { template, traverse, types as t } from \"@babel/core\";\nimport { environmentVisitor } from \"@babel/helper-replace-supers\";\n\nconst findBareSupers = traverse.visitors.merge([\n {\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n this.push(parentPath);\n }\n },\n },\n environmentVisitor,\n]);\n\nconst referenceVisitor = {\n \"TSTypeAnnotation|TypeAnnotation\"(path) {\n path.skip();\n },\n\n ReferencedIdentifier(path) {\n if (this.scope.hasOwnBinding(path.node.name)) {\n this.scope.rename(path.node.name);\n path.skip();\n }\n },\n};\n\nconst classFieldDefinitionEvaluationTDZVisitor = traverse.visitors.merge([\n {\n ReferencedIdentifier(path) {\n if (\n this.classBinding &&\n this.classBinding === path.scope.getBinding(path.node.name)\n ) {\n const classNameTDZError = this.file.addHelper(\"classNameTDZError\");\n const throwNode = t.callExpression(classNameTDZError, [\n t.stringLiteral(path.node.name),\n ]);\n\n path.replaceWith(t.sequenceExpression([throwNode, path.node]));\n path.skip();\n }\n },\n },\n environmentVisitor,\n]);\n\nexport function injectInitialization(path, constructor, nodes, renamer) {\n if (!nodes.length) return;\n\n const isDerived = !!path.node.superClass;\n\n if (!constructor) {\n const newConstructor = t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n [],\n t.blockStatement([]),\n );\n\n if (isDerived) {\n newConstructor.params = [t.restElement(t.identifier(\"args\"))];\n newConstructor.body.body.push(template.statement.ast`super(...args)`);\n }\n\n [constructor] = path.get(\"body\").unshiftContainer(\"body\", newConstructor);\n }\n\n if (renamer) {\n renamer(referenceVisitor, { scope: constructor.scope });\n }\n\n if (isDerived) {\n const bareSupers = [];\n constructor.traverse(findBareSupers, bareSupers);\n for (const bareSuper of bareSupers) {\n bareSuper.insertAfter(nodes);\n }\n } else {\n constructor.get(\"body\").unshiftContainer(\"body\", nodes);\n }\n}\n\nexport function extractComputedKeys(ref, path, computedPaths, file) {\n const declarations = [];\n\n for (const computedPath of computedPaths) {\n computedPath.traverse(classFieldDefinitionEvaluationTDZVisitor, {\n classBinding: path.node.id && path.scope.getBinding(path.node.id.name),\n file,\n });\n\n const computedNode = computedPath.node;\n // Make sure computed property names are only evaluated once (upon class definition)\n // and in the right order in combination with static properties\n if (!computedPath.get(\"key\").isConstantExpression()) {\n const ident = path.scope.generateUidIdentifierBasedOnNode(\n computedNode.key,\n );\n // Declaring in the same block scope\n // Ref: https://github.com/babel/babel/pull/10029/files#diff-fbbdd83e7a9c998721c1484529c2ce92\n path.scope.push({\n id: ident,\n kind: \"let\",\n });\n declarations.push(\n t.expressionStatement(\n t.assignmentExpression(\"=\", t.cloneNode(ident), computedNode.key),\n ),\n );\n computedNode.key = t.cloneNode(ident);\n }\n }\n\n return declarations;\n}\n","import { hasOwnDecorators } from \"./decorators\";\n\nexport const FEATURES = Object.freeze({\n //classes: 1 << 0,\n fields: 1 << 1,\n privateMethods: 1 << 2,\n decorators: 1 << 3,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-class-features\n// - @babel/plugin-proposal-decorators\n// - node_modules\n// - @babel-plugin-class-features\nconst featuresKey = \"@babel/plugin-class-features/featuresKey\";\nconst looseKey = \"@babel/plugin-class-features/looseKey\";\n\nexport function enableFeature(file, feature, loose) {\n // We can't blindly enable the feature because, if it was already set,\n // \"loose\" can't be changed, so that\n // @babel/plugin-class-properties { loose: true }\n // @babel/plugin-class-properties { loose: false }\n // is transformed in loose mode.\n // We only enabled the feature if it was previously disabled.\n if (!hasFeature(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n if (loose) file.set(looseKey, file.get(looseKey) | feature);\n }\n}\n\nfunction hasFeature(file, feature) {\n return !!(file.get(featuresKey) & feature);\n}\n\nexport function isLoose(file, feature) {\n return !!(file.get(looseKey) & feature);\n}\n\nexport function verifyUsedFeatures(path, file) {\n if (hasOwnDecorators(path.node)) {\n if (!hasFeature(file, FEATURES.decorators)) {\n throw path.buildCodeFrameError(\n \"Decorators are not enabled.\" +\n \"\\nIf you are using \" +\n '[\"@babel/plugin-proposal-decorators\", { \"legacy\": true }], ' +\n 'make sure it comes *before* \"@babel/plugin-proposal-class-properties\" ' +\n \"and enable loose mode, like so:\\n\" +\n '\\t[\"@babel/plugin-proposal-decorators\", { \"legacy\": true }]\\n' +\n '\\t[\"@babel/plugin-proposal-class-properties\", { \"loose\": true }]',\n );\n }\n\n if (path.isPrivate()) {\n throw path.buildCodeFrameError(\n `Private ${\n path.isClassMethod() ? \"methods\" : \"fields\"\n } in decorated classes are not supported yet.`,\n );\n }\n }\n\n // NOTE: We can't use path.isPrivateMethod() because it isn't supported in <7.2.0\n if (path.isPrivate() && path.isMethod()) {\n if (!hasFeature(file, FEATURES.privateMethods)) {\n throw path.buildCodeFrameError(\"Class private methods are not enabled.\");\n }\n }\n\n if (\n hasFeature(file, FEATURES.privateMethods) &&\n hasFeature(file, FEATURES.fields) &&\n isLoose(file, FEATURES.privateMethods) !== isLoose(file, FEATURES.fields)\n ) {\n throw path.buildCodeFrameError(\n \"'loose' mode configuration must be the same for both @babel/plugin-proposal-class-properties \" +\n \"and @babel/plugin-proposal-private-methods\",\n );\n }\n\n if (path.isProperty()) {\n if (!hasFeature(file, FEATURES.fields)) {\n throw path.buildCodeFrameError(\"Class fields are not enabled.\");\n }\n }\n}\n","import nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n} from \"./fields\";\nimport {\n hasOwnDecorators,\n buildDecoratedClass,\n hasDecorators,\n} from \"./decorators\";\nimport { injectInitialization, extractComputedKeys } from \"./misc\";\nimport {\n enableFeature,\n verifyUsedFeatures,\n FEATURES,\n isLoose,\n} from \"./features\";\n\nimport pkg from \"../package.json\";\n\nexport { FEATURES, injectInitialization };\n\n// Note: Versions are represented as an integer. e.g. 7.1.5 is represented\n// as 70000100005. This method is easier than using a semver-parsing\n// package, but it breaks if we release x.y.z where x, y or z are\n// greater than 99_999.\nconst version = pkg.version.split(\".\").reduce((v, x) => v * 1e5 + +x, 0);\nconst versionKey = \"@babel/plugin-class-features/version\";\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n}) {\n return {\n name,\n manipulateOptions,\n\n pre() {\n enableFeature(this.file, feature, loose);\n\n if (!this.file.get(versionKey) || this.file.get(versionKey) < version) {\n this.file.set(versionKey, version);\n }\n },\n\n visitor: {\n Class(path, state) {\n if (this.file.get(versionKey) !== version) return;\n\n verifyUsedFeatures(path, this.file);\n\n const loose = isLoose(this.file, feature);\n\n let constructor;\n let isDecorated = hasOwnDecorators(path.node);\n const props = [];\n const elements = [];\n const computedPaths = [];\n const privateNames = new Set();\n const body = path.get(\"body\");\n\n for (const path of body.get(\"body\")) {\n verifyUsedFeatures(path, this.file);\n\n if (path.node.computed) {\n computedPaths.push(path);\n }\n\n if (path.isPrivate()) {\n const { name } = path.node.key.id;\n const getName = `get ${name}`;\n const setName = `set ${name}`;\n\n if (path.node.kind === \"get\") {\n if (\n privateNames.has(getName) ||\n (privateNames.has(name) && !privateNames.has(setName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(getName).add(name);\n } else if (path.node.kind === \"set\") {\n if (\n privateNames.has(setName) ||\n (privateNames.has(name) && !privateNames.has(getName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(setName).add(name);\n } else {\n if (\n (privateNames.has(name) &&\n !privateNames.has(getName) &&\n !privateNames.has(setName)) ||\n (privateNames.has(name) &&\n (privateNames.has(getName) || privateNames.has(setName)))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(name);\n }\n }\n\n if (path.isClassMethod({ kind: \"constructor\" })) {\n constructor = path;\n } else {\n elements.push(path);\n if (path.isProperty() || path.isPrivate()) {\n props.push(path);\n }\n }\n\n if (!isDecorated) isDecorated = hasOwnDecorators(path.node);\n }\n\n if (!props.length && !isDecorated) return;\n\n let ref;\n\n if (path.isClassExpression() || !path.node.id) {\n nameFunction(path);\n ref = path.scope.generateUidIdentifier(\"class\");\n } else {\n ref = path.node.id;\n }\n\n // NODE: These three functions don't support decorators yet,\n // but verifyUsedFeatures throws if there are both\n // decorators and private fields.\n const privateNamesMap = buildPrivateNamesMap(props);\n const privateNamesNodes = buildPrivateNamesNodes(\n privateNamesMap,\n loose,\n state,\n );\n\n transformPrivateNamesUsage(ref, path, privateNamesMap, loose, state);\n\n let keysNodes, staticNodes, instanceNodes, wrapClass;\n\n if (isDecorated) {\n staticNodes = keysNodes = [];\n ({ instanceNodes, wrapClass } = buildDecoratedClass(\n ref,\n path,\n elements,\n this.file,\n ));\n } else {\n keysNodes = extractComputedKeys(ref, path, computedPaths, this.file);\n ({ staticNodes, instanceNodes, wrapClass } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n state,\n loose,\n ));\n }\n\n if (instanceNodes.length > 0) {\n injectInitialization(\n path,\n constructor,\n instanceNodes,\n (referenceVisitor, state) => {\n if (isDecorated) return;\n for (const prop of props) {\n if (prop.node.static) continue;\n prop.traverse(referenceVisitor, state);\n }\n },\n );\n }\n\n path = wrapClass(path);\n path.insertBefore(keysNodes);\n path.insertAfter([...privateNamesNodes, ...staticNodes]);\n },\n\n PrivateName(path) {\n if (this.file.get(versionKey) !== version) return;\n\n throw path.buildCodeFrameError(`Unknown PrivateName \"${path}\"`);\n },\n\n ExportDefaultDeclaration(path) {\n if (this.file.get(versionKey) !== version) return;\n\n const decl = path.get(\"declaration\");\n\n if (decl.isClassDeclaration() && hasDecorators(decl.node)) {\n if (decl.node.id) {\n // export default class Foo {}\n // -->\n // class Foo {} export { Foo as default }\n splitExportDeclaration(path);\n } else {\n // Annyms class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n },\n },\n };\n}\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return createClassFeaturePlugin({\n name: \"proposal-class-properties\",\n\n feature: FEATURES.fields,\n loose: options.loose,\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"classProperties\", \"classPrivateProperties\");\n },\n });\n});\n","// Fork of https://github.com/loganfsmyth/babel-plugin-proposal-decorators-legacy\n\nimport { template, types as t } from \"@babel/core\";\n\nconst buildClassDecorator = template(`\n DECORATOR(CLASS_REF = INNER) || CLASS_REF;\n`);\n\nconst buildClassPrototype = template(`\n CLASS_REF.prototype;\n`);\n\nconst buildGetDescriptor = template(`\n Object.getOwnPropertyDescriptor(TARGET, PROPERTY);\n`);\n\nconst buildGetObjectInitializer = template(`\n (TEMP = Object.getOwnPropertyDescriptor(TARGET, PROPERTY), (TEMP = TEMP ? TEMP.value : undefined), {\n enumerable: true,\n configurable: true,\n writable: true,\n initializer: function(){\n return TEMP;\n }\n })\n`);\n\nconst WARNING_CALLS = new WeakSet();\n\n/**\n * If the decorator expressions are non-identifiers, hoist them to before the class so we can be sure\n * that they are evaluated in order.\n */\nfunction applyEnsureOrdering(path) {\n // TODO: This should probably also hoist computed properties.\n const decorators = (path.isClass()\n ? [path].concat(path.get(\"body.body\"))\n : path.get(\"properties\")\n ).reduce((acc, prop) => acc.concat(prop.node.decorators || []), []);\n\n const identDecorators = decorators.filter(\n decorator => !t.isIdentifier(decorator.expression),\n );\n if (identDecorators.length === 0) return;\n\n return t.sequenceExpression(\n identDecorators\n .map(decorator => {\n const expression = decorator.expression;\n const id = (decorator.expression = path.scope.generateDeclaredUidIdentifier(\n \"dec\",\n ));\n return t.assignmentExpression(\"=\", id, expression);\n })\n .concat([path.node]),\n );\n}\n\n/**\n * Given a class expression with class-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyClassDecorators(classPath) {\n if (!hasClassDecorators(classPath.node)) return;\n\n const decorators = classPath.node.decorators || [];\n classPath.node.decorators = null;\n\n const name = classPath.scope.generateDeclaredUidIdentifier(\"class\");\n\n return decorators\n .map(dec => dec.expression)\n .reverse()\n .reduce(function(acc, decorator) {\n return buildClassDecorator({\n CLASS_REF: t.cloneNode(name),\n DECORATOR: t.cloneNode(decorator),\n INNER: acc,\n }).expression;\n }, classPath.node);\n}\n\nfunction hasClassDecorators(classNode) {\n return !!(classNode.decorators && classNode.decorators.length);\n}\n\n/**\n * Given a class expression with method-level decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyMethodDecorators(path, state) {\n if (!hasMethodDecorators(path.node.body.body)) return;\n\n return applyTargetDecorators(path, state, path.node.body.body);\n}\n\nfunction hasMethodDecorators(body) {\n return body.some(node => node.decorators && node.decorators.length);\n}\n\n/**\n * Given an object expression with property decorators, create a new expression\n * with the proper decorated behavior.\n */\nfunction applyObjectDecorators(path, state) {\n if (!hasMethodDecorators(path.node.properties)) return;\n\n return applyTargetDecorators(path, state, path.node.properties);\n}\n\n/**\n * A helper to pull out property decorators into a sequence expression.\n */\nfunction applyTargetDecorators(path, state, decoratedProps) {\n const name = path.scope.generateDeclaredUidIdentifier(\n path.isClass() ? \"class\" : \"obj\",\n );\n\n const exprs = decoratedProps.reduce(function(acc, node) {\n const decorators = node.decorators || [];\n node.decorators = null;\n\n if (decorators.length === 0) return acc;\n\n if (node.computed) {\n throw path.buildCodeFrameError(\n \"Computed method/property decorators are not yet supported.\",\n );\n }\n\n const property = t.isLiteral(node.key)\n ? node.key\n : t.stringLiteral(node.key.name);\n\n const target =\n path.isClass() && !node.static\n ? buildClassPrototype({\n CLASS_REF: name,\n }).expression\n : name;\n\n if (t.isClassProperty(node, { static: false })) {\n const descriptor = path.scope.generateDeclaredUidIdentifier(\"descriptor\");\n\n const initializer = node.value\n ? t.functionExpression(\n null,\n [],\n t.blockStatement([t.returnStatement(node.value)]),\n )\n : t.nullLiteral();\n\n node.value = t.callExpression(\n state.addHelper(\"initializerWarningHelper\"),\n [descriptor, t.thisExpression()],\n );\n\n WARNING_CALLS.add(node.value);\n\n acc = acc.concat([\n t.assignmentExpression(\n \"=\",\n descriptor,\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(\n decorators.map(dec => t.cloneNode(dec.expression)),\n ),\n t.objectExpression([\n t.objectProperty(\n t.identifier(\"configurable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"enumerable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(\n t.identifier(\"writable\"),\n t.booleanLiteral(true),\n ),\n t.objectProperty(t.identifier(\"initializer\"), initializer),\n ]),\n ]),\n ),\n ]);\n } else {\n acc = acc.concat(\n t.callExpression(state.addHelper(\"applyDecoratedDescriptor\"), [\n t.cloneNode(target),\n t.cloneNode(property),\n t.arrayExpression(decorators.map(dec => t.cloneNode(dec.expression))),\n t.isObjectProperty(node) || t.isClassProperty(node, { static: true })\n ? buildGetObjectInitializer({\n TEMP: path.scope.generateDeclaredUidIdentifier(\"init\"),\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression\n : buildGetDescriptor({\n TARGET: t.cloneNode(target),\n PROPERTY: t.cloneNode(property),\n }).expression,\n t.cloneNode(target),\n ]),\n );\n }\n\n return acc;\n }, []);\n\n return t.sequenceExpression([\n t.assignmentExpression(\"=\", t.cloneNode(name), path.node),\n t.sequenceExpression(exprs),\n t.cloneNode(name),\n ]);\n}\n\nfunction decoratedClassToExpression({ node, scope }) {\n if (!hasClassDecorators(node) && !hasMethodDecorators(node.body.body)) {\n return;\n }\n\n const ref = node.id\n ? t.cloneNode(node.id)\n : scope.generateUidIdentifier(\"class\");\n\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]);\n}\n\nexport default {\n ExportDefaultDeclaration(path) {\n const decl = path.get(\"declaration\");\n if (!decl.isClassDeclaration()) return;\n\n const replacement = decoratedClassToExpression(decl);\n if (replacement) {\n const [varDeclPath] = path.replaceWithMultiple([\n replacement,\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(\n t.cloneNode(replacement.declarations[0].id),\n t.identifier(\"default\"),\n ),\n ]),\n ]);\n\n if (!decl.node.id) {\n path.scope.registerDeclaration(varDeclPath);\n }\n }\n },\n ClassDeclaration(path) {\n const replacement = decoratedClassToExpression(path);\n if (replacement) {\n path.replaceWith(replacement);\n }\n },\n ClassExpression(path, state) {\n // Create a replacement for the class node if there is one. We do one pass to replace classes with\n // class decorators, and a second pass to process method decorators.\n const decoratedClass =\n applyEnsureOrdering(path) ||\n applyClassDecorators(path, state) ||\n applyMethodDecorators(path, state);\n\n if (decoratedClass) path.replaceWith(decoratedClass);\n },\n ObjectExpression(path, state) {\n const decoratedObject =\n applyEnsureOrdering(path) || applyObjectDecorators(path, state);\n\n if (decoratedObject) path.replaceWith(decoratedObject);\n },\n\n AssignmentExpression(path, state) {\n if (!WARNING_CALLS.has(path.node.right)) return;\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n t.cloneNode(path.get(\"left.object\").node),\n t.stringLiteral(\n path.get(\"left.property\").node.name ||\n path.get(\"left.property\").node.value,\n ),\n t.cloneNode(path.get(\"right.arguments\")[0].node),\n t.cloneNode(path.get(\"right.arguments\")[1].node),\n ]),\n );\n },\n\n CallExpression(path, state) {\n if (path.node.arguments.length !== 3) return;\n if (!WARNING_CALLS.has(path.node.arguments[2])) return;\n\n // If the class properties plugin isn't enabled, this line will add an unused helper\n // to the code. It's not ideal, but it's ok since the configuration is not valid anyway.\n if (path.node.callee.name !== state.addHelper(\"defineProperty\").name) {\n return;\n }\n\n path.replaceWith(\n t.callExpression(state.addHelper(\"initializerDefineProperty\"), [\n t.cloneNode(path.get(\"arguments\")[0].node),\n t.cloneNode(path.get(\"arguments\")[1].node),\n t.cloneNode(path.get(\"arguments.2.arguments\")[0].node),\n t.cloneNode(path.get(\"arguments.2.arguments\")[1].node),\n ]),\n );\n },\n};\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDecorators from \"@babel/plugin-syntax-decorators\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\nimport legacyVisitor from \"./transformer-legacy\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { legacy = false } = options;\n if (typeof legacy !== \"boolean\") {\n throw new Error(\"'legacy' must be a boolean.\");\n }\n\n const { decoratorsBeforeExport } = options;\n if (decoratorsBeforeExport === undefined) {\n if (!legacy) {\n throw new Error(\n \"The decorators plugin requires a 'decoratorsBeforeExport' option,\" +\n \" whose value must be a boolean. If you want to use the legacy\" +\n \" decorators semantics, you can set the 'legacy: true' option.\",\n );\n }\n } else {\n if (legacy) {\n throw new Error(\n \"'decoratorsBeforeExport' can't be used with legacy decorators.\",\n );\n }\n if (typeof decoratorsBeforeExport !== \"boolean\") {\n throw new Error(\"'decoratorsBeforeExport' must be a boolean.\");\n }\n }\n\n if (legacy) {\n return {\n name: \"proposal-decorators\",\n inherits: syntaxDecorators,\n manipulateOptions({ generatorOpts }) {\n generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;\n },\n visitor: legacyVisitor,\n };\n }\n\n return createClassFeaturePlugin({\n name: \"proposal-decorators\",\n\n feature: FEATURES.decorators,\n // loose: options.loose, Not supported\n\n manipulateOptions({ generatorOpts, parserOpts }) {\n parserOpts.plugins.push([\"decorators\", { decoratorsBeforeExport }]);\n generatorOpts.decoratorsBeforeExport = decoratorsBeforeExport;\n },\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDoExpressions from \"@babel/plugin-syntax-do-expressions\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-do-expressions\",\n inherits: syntaxDoExpressions,\n\n visitor: {\n DoExpression: {\n exit(path) {\n const body = path.node.body.body;\n if (body.length) {\n path.replaceExpressionWithStatements(body);\n } else {\n path.replaceWith(path.scope.buildUndefinedNode());\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport { version } from \"../package.json\";\n\nconst SUPPORTED_MODULES = [\"commonjs\", \"amd\", \"systemjs\"];\n\nconst MODULES_NOT_FOUND = `\\\n@babel/plugin-proposal-dynamic-import depends on a modules\ntransform plugin. Supported plugins are:\n - @babel/plugin-transform-modules-commonjs ^7.4.0\n - @babel/plugin-transform-modules-amd ^7.4.0\n - @babel/plugin-transform-modules-systemjs ^7.4.0\n\nIf you are using Webpack or Rollup and thus don't want\nBabel to transpile your imports and exports, you can use\nthe @babel/plugin-syntax-dynamic-import plugin and let your\nbundler handle dynamic imports.\n`;\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-dynamic-import\",\n inherits: syntaxDynamicImport,\n\n pre() {\n this.file.set(\"@babel/plugin-proposal-dynamic-import\", version);\n },\n\n visitor: {\n Program() {\n const modules = this.file.get(\"@babel/plugin-transform-modules-*\");\n\n if (!SUPPORTED_MODULES.includes(modules)) {\n throw new Error(MODULES_NOT_FOUND);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxExportDefaultFrom from \"@babel/plugin-syntax-export-default-from\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-export-default-from\",\n inherits: syntaxExportDefaultFrom,\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n if (!t.isExportDefaultSpecifier(specifiers[0])) return;\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(exported.name);\n\n const nodes = [\n t.importDeclaration(\n [t.importDefaultSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n ];\n\n if (specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxExportNamespaceFrom from \"@babel/plugin-syntax-export-namespace-from\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-export-namespace-from\",\n inherits: syntaxExportNamespaceFrom,\n\n visitor: {\n ExportNamedDeclaration(path) {\n const { node, scope } = path;\n const { specifiers } = node;\n\n const index = t.isExportDefaultSpecifier(specifiers[0]) ? 1 : 0;\n if (!t.isExportNamespaceSpecifier(specifiers[index])) return;\n\n const nodes = [];\n\n if (index === 1) {\n nodes.push(\n t.exportNamedDeclaration(null, [specifiers.shift()], node.source),\n );\n }\n\n const specifier = specifiers.shift();\n const { exported } = specifier;\n const uid = scope.generateUidIdentifier(exported.name);\n\n nodes.push(\n t.importDeclaration(\n [t.importNamespaceSpecifier(uid)],\n t.cloneNode(node.source),\n ),\n t.exportNamedDeclaration(null, [\n t.exportSpecifier(t.cloneNode(uid), exported),\n ]),\n );\n\n if (node.specifiers.length >= 1) {\n nodes.push(node);\n }\n\n const [importDeclaration] = path.replaceWithMultiple(nodes);\n path.scope.registerDeclaration(importDeclaration);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFunctionBind from \"@babel/plugin-syntax-function-bind\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function getTempId(scope) {\n let id = scope.path.getData(\"functionBind\");\n if (id) return id;\n\n id = scope.generateDeclaredUidIdentifier(\"context\");\n return scope.path.setData(\"functionBind\", id);\n }\n\n function getStaticContext(bind, scope) {\n const object = bind.object || bind.callee.object;\n return scope.isStatic(object) && object;\n }\n\n function inferBindContext(bind, scope) {\n const staticContext = getStaticContext(bind, scope);\n if (staticContext) return t.cloneNode(staticContext);\n\n const tempId = getTempId(scope);\n if (bind.object) {\n bind.callee = t.sequenceExpression([\n t.assignmentExpression(\"=\", tempId, bind.object),\n bind.callee,\n ]);\n } else {\n bind.callee.object = t.assignmentExpression(\n \"=\",\n tempId,\n bind.callee.object,\n );\n }\n return tempId;\n }\n\n return {\n name: \"proposal-function-bind\",\n inherits: syntaxFunctionBind,\n\n visitor: {\n CallExpression({ node, scope }) {\n const bind = node.callee;\n if (!t.isBindExpression(bind)) return;\n\n const context = inferBindContext(bind, scope);\n node.callee = t.memberExpression(bind.callee, t.identifier(\"call\"));\n node.arguments.unshift(context);\n },\n\n BindExpression(path) {\n const { node, scope } = path;\n const context = inferBindContext(node, scope);\n path.replaceWith(\n t.callExpression(\n t.memberExpression(node.callee, t.identifier(\"bind\")),\n [context],\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFunctionSent from \"@babel/plugin-syntax-function-sent\";\nimport wrapFunction from \"@babel/helper-wrap-function\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const isFunctionSent = node =>\n t.isIdentifier(node.meta, { name: \"function\" }) &&\n t.isIdentifier(node.property, { name: \"sent\" });\n\n const hasBeenReplaced = (node, sentId) =>\n t.isAssignmentExpression(node) &&\n t.isIdentifier(node.left, { name: sentId });\n\n const yieldVisitor = {\n Function(path) {\n path.skip();\n },\n\n YieldExpression(path) {\n if (!hasBeenReplaced(path.parent, this.sentId)) {\n path.replaceWith(\n t.assignmentExpression(\"=\", t.identifier(this.sentId), path.node),\n );\n }\n },\n\n MetaProperty(path) {\n if (isFunctionSent(path.node)) {\n path.replaceWith(t.identifier(this.sentId));\n }\n },\n };\n\n return {\n name: \"proposal-function-sent\",\n inherits: syntaxFunctionSent,\n\n visitor: {\n MetaProperty(path, state) {\n if (!isFunctionSent(path.node)) return;\n\n const fnPath = path.getFunctionParent();\n\n if (!fnPath.node.generator) {\n throw new Error(\"Parent generator function not found\");\n }\n\n const sentId = path.scope.generateUid(\"function.sent\");\n\n fnPath.traverse(yieldVisitor, { sentId });\n fnPath.node.body.body.unshift(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.identifier(sentId), t.yieldExpression()),\n ]),\n );\n\n wrapFunction(fnPath, state.addHelper(\"skipFirstGeneratorNext\"));\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-json-strings\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsonStrings\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\n\nexport default declare(api => {\n api.assertVersion(7);\n const regex = /(\\\\*)([\\u2028\\u2029])/g;\n function replace(match, escapes, separator) {\n // If there's an odd number, that means the separator itself was escaped.\n // \"\\X\" escapes X.\n // \"\\\\X\" escapes the backslash, so X is unescaped.\n const isEscaped = escapes.length % 2 === 1;\n if (isEscaped) return match;\n\n return `${escapes}\\\\u${separator.charCodeAt(0).toString(16)}`;\n }\n\n return {\n name: \"proposal-json-strings\",\n inherits: syntaxJsonStrings,\n\n visitor: {\n \"DirectiveLiteral|StringLiteral\"({ node }) {\n const { extra } = node;\n if (!extra || !extra.raw) return;\n\n extra.raw = extra.raw.replace(regex, replace);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-logical-assignment-operators\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"logicalAssignment\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxLogicalAssignmentOperators from \"@babel/plugin-syntax-logical-assignment-operators\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-logical-assignment-operators\",\n inherits: syntaxLogicalAssignmentOperators,\n\n visitor: {\n AssignmentExpression(path) {\n const { node, scope } = path;\n const { operator, left, right } = node;\n if (operator !== \"||=\" && operator !== \"&&=\" && operator !== \"??=\") {\n return;\n }\n\n const lhs = t.cloneNode(left);\n if (t.isMemberExpression(left)) {\n const { object, property, computed } = left;\n const memo = scope.maybeGenerateMemoised(object);\n if (memo) {\n left.object = memo;\n lhs.object = t.assignmentExpression(\"=\", t.cloneNode(memo), object);\n }\n\n if (computed) {\n const memo = scope.maybeGenerateMemoised(property);\n if (memo) {\n left.property = memo;\n lhs.property = t.assignmentExpression(\n \"=\",\n t.cloneNode(memo),\n property,\n );\n }\n }\n }\n\n path.replaceWith(\n t.logicalExpression(\n operator.slice(0, -1),\n lhs,\n t.assignmentExpression(\"=\", left, right),\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-nullish-coalescing-operator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"nullishCoalescingOperator\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxNullishCoalescingOperator from \"@babel/plugin-syntax-nullish-coalescing-operator\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, { loose = false }) => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-nullish-coalescing-operator\",\n inherits: syntaxNullishCoalescingOperator,\n\n visitor: {\n LogicalExpression(path) {\n const { node, scope } = path;\n if (node.operator !== \"??\") {\n return;\n }\n\n let ref = scope.maybeGenerateMemoised(node.left);\n let assignment;\n // skip creating extra reference when `left` is static\n if (ref === null) {\n ref = node.left;\n assignment = t.cloneNode(node.left);\n } else {\n assignment = t.assignmentExpression(\"=\", ref, node.left);\n }\n\n path.replaceWith(\n t.conditionalExpression(\n // We cannot use `!= null` in spec mode because\n // `document.all == null` and `document.all` is not \"nullish\".\n loose\n ? t.binaryExpression(\"!=\", assignment, t.nullLiteral())\n : t.logicalExpression(\n \"&&\",\n t.binaryExpression(\"!==\", assignment, t.nullLiteral()),\n t.binaryExpression(\n \"!==\",\n t.cloneNode(ref),\n scope.buildUndefinedNode(),\n ),\n ),\n t.cloneNode(ref),\n node.right,\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-numeric-separator\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"numericSeparator\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxNumericSeparator from \"@babel/plugin-syntax-numeric-separator\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-numeric-separator\",\n inherits: syntaxNumericSeparator,\n\n visitor: {\n NumericLiteral({ node }) {\n const { extra } = node;\n if (extra && /_/.test(extra.raw)) {\n extra.raw = extra.raw.replace(/_/g, \"\");\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport { types as t } from \"@babel/core\";\n\n// TODO: Remove in Babel 8\n// @babel/types <=7.3.3 counts FOO as referenced in var { x: FOO }.\n// We need to detect this bug to know if \"unused\" means 0 or 1 references.\nconst ZERO_REFS = (() => {\n const node = t.identifier(\"a\");\n const property = t.objectProperty(t.identifier(\"key\"), node);\n const pattern = t.objectPattern([property]);\n\n return t.isReferenced(node, property, pattern) ? 1 : 0;\n})();\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const { useBuiltIns = false, loose = false } = opts;\n\n if (typeof loose !== \"boolean\") {\n throw new Error(\".loose must be a boolean, or undefined\");\n }\n\n function getExtendsHelper(file) {\n return useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n }\n\n function hasRestElement(path) {\n let foundRestElement = false;\n visitRestElements(path, restElement => {\n foundRestElement = true;\n restElement.stop();\n });\n return foundRestElement;\n }\n\n function hasObjectPatternRestElement(path) {\n let foundRestElement = false;\n visitRestElements(path, restElement => {\n if (restElement.parentPath.isObjectPattern()) {\n foundRestElement = true;\n restElement.stop();\n }\n });\n return foundRestElement;\n }\n\n function visitRestElements(path, visitor) {\n path.traverse({\n Expression(path) {\n const parentType = path.parent.type;\n if (\n (parentType === \"AssignmentPattern\" && path.key === \"right\") ||\n (parentType === \"ObjectProperty\" &&\n path.parent.computed &&\n path.key === \"key\")\n ) {\n path.skip();\n }\n },\n RestElement: visitor,\n });\n }\n\n function hasSpread(node) {\n for (const prop of node.properties) {\n if (t.isSpreadElement(prop)) {\n return true;\n }\n }\n return false;\n }\n\n // returns an array of all keys of an object, and a status flag indicating if all extracted keys\n // were converted to stringLiterals or not\n // e.g. extracts {keys: [\"a\", \"b\", \"3\", ++x], allLiteral: false }\n // from ast of {a: \"foo\", b, 3: \"bar\", [++x]: \"baz\"}\n function extractNormalizedKeys(path) {\n const props = path.node.properties;\n const keys = [];\n let allLiteral = true;\n\n for (const prop of props) {\n if (t.isIdentifier(prop.key) && !prop.computed) {\n // since a key {a: 3} is equivalent to {\"a\": 3}, use the latter\n keys.push(t.stringLiteral(prop.key.name));\n } else if (t.isTemplateLiteral(prop.key)) {\n keys.push(t.cloneNode(prop.key));\n } else if (t.isLiteral(prop.key)) {\n keys.push(t.stringLiteral(String(prop.key.value)));\n } else {\n keys.push(t.cloneNode(prop.key));\n allLiteral = false;\n }\n }\n\n return { keys, allLiteral };\n }\n\n // replaces impure computed keys with new identifiers\n // and returns variable declarators of these new identifiers\n function replaceImpureComputedKeys(properties, scope) {\n const impureComputedPropertyDeclarators = [];\n for (const propPath of properties) {\n const key = propPath.get(\"key\");\n if (propPath.node.computed && !key.isPure()) {\n const name = scope.generateUidBasedOnNode(key.node);\n const declarator = t.variableDeclarator(t.identifier(name), key.node);\n impureComputedPropertyDeclarators.push(declarator);\n key.replaceWith(t.identifier(name));\n }\n }\n return impureComputedPropertyDeclarators;\n }\n\n function removeUnusedExcludedKeys(path) {\n const bindings = path.getOuterBindingIdentifierPaths();\n\n Object.keys(bindings).forEach(bindingName => {\n const bindingParentPath = bindings[bindingName].parentPath;\n if (\n path.scope.getBinding(bindingName).references > ZERO_REFS ||\n !bindingParentPath.isObjectProperty()\n ) {\n return;\n }\n bindingParentPath.remove();\n });\n }\n\n //expects path to an object pattern\n function createObjectSpread(path, file, objRef) {\n const props = path.get(\"properties\");\n const last = props[props.length - 1];\n t.assertRestElement(last.node);\n const restElement = t.cloneNode(last.node);\n last.remove();\n\n const impureComputedPropertyDeclarators = replaceImpureComputedKeys(\n path.get(\"properties\"),\n path.scope,\n );\n const { keys, allLiteral } = extractNormalizedKeys(path);\n\n if (keys.length === 0) {\n return [\n impureComputedPropertyDeclarators,\n restElement.argument,\n t.callExpression(getExtendsHelper(file), [\n t.objectExpression([]),\n t.cloneNode(objRef),\n ]),\n ];\n }\n\n let keyExpression;\n if (!allLiteral) {\n // map to toPropertyKey to handle the possible non-string values\n keyExpression = t.callExpression(\n t.memberExpression(t.arrayExpression(keys), t.identifier(\"map\")),\n [file.addHelper(\"toPropertyKey\")],\n );\n } else {\n keyExpression = t.arrayExpression(keys);\n }\n\n return [\n impureComputedPropertyDeclarators,\n restElement.argument,\n t.callExpression(\n file.addHelper(`objectWithoutProperties${loose ? \"Loose\" : \"\"}`),\n [t.cloneNode(objRef), keyExpression],\n ),\n ];\n }\n\n function replaceRestElement(parentPath, paramPath) {\n if (paramPath.isAssignmentPattern()) {\n replaceRestElement(parentPath, paramPath.get(\"left\"));\n return;\n }\n\n if (paramPath.isArrayPattern() && hasRestElement(paramPath)) {\n const elements = paramPath.get(\"elements\");\n\n for (let i = 0; i < elements.length; i++) {\n replaceRestElement(parentPath, elements[i]);\n }\n }\n\n if (paramPath.isObjectPattern() && hasRestElement(paramPath)) {\n const uid = parentPath.scope.generateUidIdentifier(\"ref\");\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(paramPath.node, uid),\n ]);\n\n parentPath.ensureBlock();\n parentPath.get(\"body\").unshiftContainer(\"body\", declar);\n paramPath.replaceWith(t.cloneNode(uid));\n }\n }\n\n return {\n name: \"proposal-object-rest-spread\",\n inherits: syntaxObjectRestSpread,\n\n visitor: {\n // taken from transform-parameters/src/destructuring.js\n // function a({ b, ...c }) {}\n Function(path) {\n const params = path.get(\"params\");\n for (let i = params.length - 1; i >= 0; i--) {\n replaceRestElement(params[i].parentPath, params[i]);\n }\n },\n // adapted from transform-destructuring/src/index.js#pushObjectRest\n // const { a, ...b } = c;\n VariableDeclarator(path, file) {\n if (!path.get(\"id\").isObjectPattern()) {\n return;\n }\n\n let insertionPath = path;\n const originalPath = path;\n\n visitRestElements(path.get(\"id\"), path => {\n if (!path.parentPath.isObjectPattern()) {\n // Return early if the parent is not an ObjectPattern, but\n // (for example) an ArrayPattern or Function, because that\n // means this RestElement is an not an object property.\n return;\n }\n\n if (\n // skip single-property case, e.g.\n // const { ...x } = foo();\n // since the RHS will not be duplicated\n originalPath.node.id.properties.length > 1 &&\n !t.isIdentifier(originalPath.node.init)\n ) {\n // const { a, ...b } = foo();\n // to avoid calling foo() twice, as a first step convert it to:\n // const _foo = foo(),\n // { a, ...b } = _foo;\n const initRef = path.scope.generateUidIdentifierBasedOnNode(\n originalPath.node.init,\n \"ref\",\n );\n // insert _foo = foo()\n originalPath.insertBefore(\n t.variableDeclarator(initRef, originalPath.node.init),\n );\n // replace foo() with _foo\n originalPath.replaceWith(\n t.variableDeclarator(originalPath.node.id, t.cloneNode(initRef)),\n );\n\n return;\n }\n\n let ref = originalPath.node.init;\n const refPropertyPath = [];\n let kind;\n\n path.findParent(path => {\n if (path.isObjectProperty()) {\n refPropertyPath.unshift(path);\n } else if (path.isVariableDeclarator()) {\n kind = path.parentPath.node.kind;\n return true;\n }\n });\n\n const impureObjRefComputedDeclarators = replaceImpureComputedKeys(\n refPropertyPath,\n path.scope,\n );\n refPropertyPath.forEach(prop => {\n const { node } = prop;\n ref = t.memberExpression(ref, t.cloneNode(node.key), node.computed);\n });\n\n const objectPatternPath = path.findParent(path =>\n path.isObjectPattern(),\n );\n\n const [\n impureComputedPropertyDeclarators,\n argument,\n callExpression,\n ] = createObjectSpread(objectPatternPath, file, ref);\n\n if (loose) {\n removeUnusedExcludedKeys(objectPatternPath);\n }\n\n t.assertIdentifier(argument);\n\n insertionPath.insertBefore(impureComputedPropertyDeclarators);\n\n insertionPath.insertBefore(impureObjRefComputedDeclarators);\n\n insertionPath.insertAfter(\n t.variableDeclarator(argument, callExpression),\n );\n\n insertionPath = insertionPath.getSibling(insertionPath.key + 1);\n\n path.scope.registerBinding(kind, insertionPath);\n\n if (objectPatternPath.node.properties.length === 0) {\n objectPatternPath\n .findParent(\n path => path.isObjectProperty() || path.isVariableDeclarator(),\n )\n .remove();\n }\n });\n },\n // taken from transform-destructuring/src/index.js#visitor\n // export var { a, ...b } = c;\n ExportNamedDeclaration(path) {\n const declaration = path.get(\"declaration\");\n if (!declaration.isVariableDeclaration()) return;\n\n const hasRest = declaration\n .get(\"declarations\")\n .some(path => hasRestElement(path.get(\"id\")));\n if (!hasRest) return;\n\n const specifiers = [];\n\n for (const name of Object.keys(path.getOuterBindingIdentifiers(path))) {\n specifiers.push(\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\n );\n }\n\n // Split the declaration and export list into two declarations so that the variable\n // declaration can be split up later without needing to worry about not being a\n // top-level statement.\n path.replaceWith(declaration.node);\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\n },\n // try {} catch ({a, ...b}) {}\n CatchClause(path) {\n const paramPath = path.get(\"param\");\n replaceRestElement(paramPath.parentPath, paramPath);\n },\n // ({a, ...b} = c);\n AssignmentExpression(path, file) {\n const leftPath = path.get(\"left\");\n if (leftPath.isObjectPattern() && hasRestElement(leftPath)) {\n const nodes = [];\n\n const refName = path.scope.generateUidBasedOnNode(\n path.node.right,\n \"ref\",\n );\n\n nodes.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(refName), path.node.right),\n ]),\n );\n\n const [\n impureComputedPropertyDeclarators,\n argument,\n callExpression,\n ] = createObjectSpread(leftPath, file, t.identifier(refName));\n\n if (impureComputedPropertyDeclarators.length > 0) {\n nodes.push(\n t.variableDeclaration(\"var\", impureComputedPropertyDeclarators),\n );\n }\n\n const nodeWithoutSpread = t.cloneNode(path.node);\n nodeWithoutSpread.right = t.identifier(refName);\n nodes.push(t.expressionStatement(nodeWithoutSpread));\n nodes.push(\n t.toStatement(\n t.assignmentExpression(\"=\", argument, callExpression),\n ),\n );\n nodes.push(t.expressionStatement(t.identifier(refName)));\n\n path.replaceWithMultiple(nodes);\n }\n },\n // taken from transform-destructuring/src/index.js#visitor\n ForXStatement(path) {\n const { node, scope } = path;\n const leftPath = path.get(\"left\");\n const left = node.left;\n\n if (!hasObjectPatternRestElement(leftPath)) {\n return;\n }\n\n if (!t.isVariableDeclaration(left)) {\n // for ({a, ...b} of []) {}\n const temp = scope.generateUidIdentifier(\"ref\");\n\n node.left = t.variableDeclaration(\"var\", [\n t.variableDeclarator(temp),\n ]);\n\n path.ensureBlock();\n\n if (node.body.body.length === 0 && path.isCompletionRecord()) {\n node.body.body.unshift(\n t.expressionStatement(scope.buildUndefinedNode()),\n );\n }\n\n node.body.body.unshift(\n t.expressionStatement(\n t.assignmentExpression(\"=\", left, t.cloneNode(temp)),\n ),\n );\n } else {\n // for (var {a, ...b} of []) {}\n const pattern = left.declarations[0].id;\n\n const key = scope.generateUidIdentifier(\"ref\");\n node.left = t.variableDeclaration(left.kind, [\n t.variableDeclarator(key, null),\n ]);\n\n path.ensureBlock();\n\n node.body.body.unshift(\n t.variableDeclaration(node.left.kind, [\n t.variableDeclarator(pattern, t.cloneNode(key)),\n ]),\n );\n }\n },\n // [{a, ...b}] = c;\n ArrayPattern(path) {\n const objectPatterns = [];\n\n visitRestElements(path, path => {\n if (!path.parentPath.isObjectPattern()) {\n // Return early if the parent is not an ObjectPattern, but\n // (for example) an ArrayPattern or Function, because that\n // means this RestElement is an not an object property.\n return;\n }\n\n const objectPattern = path.parentPath;\n\n const uid = path.scope.generateUidIdentifier(\"ref\");\n objectPatterns.push(t.variableDeclarator(objectPattern.node, uid));\n\n objectPattern.replaceWith(t.cloneNode(uid));\n path.skip();\n });\n\n if (objectPatterns.length > 0) {\n const statementPath = path.getStatementParent();\n statementPath.insertAfter(\n t.variableDeclaration(\n statementPath.node.kind || \"var\",\n objectPatterns,\n ),\n );\n }\n },\n // var a = { ...b, ...c }\n ObjectExpression(path, file) {\n if (!hasSpread(path.node)) return;\n\n const args = [];\n let props = [];\n\n function push() {\n args.push(t.objectExpression(props));\n props = [];\n }\n\n for (const prop of (path.node.properties: Array)) {\n if (t.isSpreadElement(prop)) {\n push();\n args.push(prop.argument);\n } else {\n props.push(prop);\n }\n }\n\n if (props.length) {\n push();\n }\n\n let helper;\n if (loose) {\n helper = getExtendsHelper(file);\n } else {\n try {\n helper = file.addHelper(\"objectSpread2\");\n } catch {\n // TODO: This is needed to workaround https://github.com/babel/babel/issues/10187\n // and https://github.com/babel/babel/issues/10179 for older @babel/core versions\n // where #10187 isn't fixed.\n this.file.declarations[\"objectSpread2\"] = null;\n\n // objectSpread2 has been introduced in v7.5.0\n // We have to maintain backward compatibility.\n helper = file.addHelper(\"objectSpread\");\n }\n }\n\n path.replaceWith(t.callExpression(helper, args));\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-optional-catch-binding\",\n inherits: syntaxOptionalCatchBinding,\n\n visitor: {\n CatchClause(path) {\n if (!path.node.param) {\n const uid = path.scope.generateUidIdentifier(\"unused\");\n const paramPath = path.get(\"param\");\n paramPath.replaceWith(uid);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-optional-chaining\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"optionalChaining\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxOptionalChaining from \"@babel/plugin-syntax-optional-chaining\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose = false } = options;\n\n return {\n name: \"proposal-optional-chaining\",\n inherits: syntaxOptionalChaining,\n\n visitor: {\n \"OptionalCallExpression|OptionalMemberExpression\"(path) {\n const { parentPath, scope } = path;\n let isDeleteOperation = false;\n const optionals = [];\n\n let optionalPath = path;\n while (\n optionalPath.isOptionalMemberExpression() ||\n optionalPath.isOptionalCallExpression()\n ) {\n const { node } = optionalPath;\n if (node.optional) {\n optionals.push(node);\n }\n\n if (optionalPath.isOptionalMemberExpression()) {\n optionalPath.node.type = \"MemberExpression\";\n optionalPath = optionalPath.get(\"object\");\n } else if (optionalPath.isOptionalCallExpression()) {\n optionalPath.node.type = \"CallExpression\";\n optionalPath = optionalPath.get(\"callee\");\n }\n }\n\n let replacementPath = path;\n if (parentPath.isUnaryExpression({ operator: \"delete\" })) {\n replacementPath = parentPath;\n isDeleteOperation = true;\n }\n for (let i = optionals.length - 1; i >= 0; i--) {\n const node = optionals[i];\n\n const isCall = t.isCallExpression(node);\n const replaceKey = isCall ? \"callee\" : \"object\";\n const chain = node[replaceKey];\n\n let ref;\n let check;\n if (loose && isCall) {\n // If we are using a loose transform (avoiding a Function#call) and we are at the call,\n // we can avoid a needless memoize.\n check = ref = chain;\n } else {\n ref = scope.maybeGenerateMemoised(chain);\n if (ref) {\n check = t.assignmentExpression(\n \"=\",\n t.cloneNode(ref),\n // Here `chain` MUST NOT be cloned because it could be updated\n // when generating the memoised context of a call espression\n chain,\n );\n node[replaceKey] = ref;\n } else {\n check = ref = chain;\n }\n }\n\n // Ensure call expressions have the proper `this`\n // `foo.bar()` has context `foo`.\n if (isCall && t.isMemberExpression(chain)) {\n if (loose) {\n // To avoid a Function#call, we can instead re-grab the property from the context object.\n // `a.?b.?()` translates roughly to `_a.b != null && _a.b()`\n node.callee = chain;\n } else {\n // Otherwise, we need to memoize the context object, and change the call into a Function#call.\n // `a.?b.?()` translates roughly to `(_b = _a.b) != null && _b.call(_a)`\n const { object } = chain;\n let context = scope.maybeGenerateMemoised(object);\n if (context) {\n chain.object = t.assignmentExpression(\"=\", context, object);\n } else if (t.isSuper(object)) {\n context = t.thisExpression();\n } else {\n context = object;\n }\n\n node.arguments.unshift(t.cloneNode(context));\n node.callee = t.memberExpression(\n node.callee,\n t.identifier(\"call\"),\n );\n }\n }\n\n replacementPath.replaceWith(\n t.conditionalExpression(\n loose\n ? t.binaryExpression(\"==\", t.cloneNode(check), t.nullLiteral())\n : t.logicalExpression(\n \"||\",\n t.binaryExpression(\n \"===\",\n t.cloneNode(check),\n t.nullLiteral(),\n ),\n t.binaryExpression(\n \"===\",\n t.cloneNode(ref),\n scope.buildUndefinedNode(),\n ),\n ),\n isDeleteOperation\n ? t.booleanLiteral(true)\n : scope.buildUndefinedNode(),\n replacementPath.node,\n ),\n );\n\n replacementPath = replacementPath.get(\"alternate\");\n }\n },\n },\n };\n});\n","import { types as t } from \"@babel/core\";\n\n// tries to optimize sequence expressions in the format\n// (a = b, ((c) => d + e)(a))\n// to\n// (a = b, a + e)\nconst buildOptimizedSequenceExpression = ({ assign, call, path }) => {\n const { left: placeholderNode, right: pipelineLeft } = assign;\n const { callee: calledExpression } = call;\n\n let optimizeArrow =\n t.isArrowFunctionExpression(calledExpression) &&\n t.isExpression(calledExpression.body) &&\n !calledExpression.async &&\n !calledExpression.generator;\n let param;\n\n if (optimizeArrow) {\n const { params } = calledExpression;\n if (params.length === 1 && t.isIdentifier(params[0])) {\n param = params[0];\n } else if (params.length > 0) {\n optimizeArrow = false;\n }\n } else if (t.isIdentifier(calledExpression, { name: \"eval\" })) {\n const evalSequence = t.sequenceExpression([\n t.numericLiteral(0),\n calledExpression,\n ]);\n\n call.callee = evalSequence;\n\n path.scope.push({ id: placeholderNode });\n\n return t.sequenceExpression([assign, call]);\n }\n\n if (optimizeArrow && !param) {\n // Arrow function with 0 arguments\n return t.sequenceExpression([pipelineLeft, calledExpression.body]);\n }\n\n path.scope.push({ id: placeholderNode });\n\n if (param) {\n path.get(\"right\").scope.rename(param.name, placeholderNode.name);\n\n return t.sequenceExpression([assign, calledExpression.body]);\n }\n\n return t.sequenceExpression([assign, call]);\n};\n\nexport default buildOptimizedSequenceExpression;\n","import { types as t } from \"@babel/core\";\nimport buildOptimizedSequenceExpression from \"./buildOptimizedSequenceExpression\";\n\nconst minimalVisitor = {\n BinaryExpression(path) {\n const { scope, node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n\n const call = t.callExpression(right, [t.cloneNode(placeholder)]);\n path.replaceWith(\n buildOptimizedSequenceExpression({\n assign: t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n path,\n }),\n );\n },\n};\n\nexport default minimalVisitor;\n","import { types as t } from \"@babel/core\";\n\nconst updateTopicReferenceVisitor = {\n PipelinePrimaryTopicReference(path) {\n path.replaceWith(this.topicId);\n },\n PipelineTopicExpression(path) {\n path.skip();\n },\n};\n\nconst smartVisitor = {\n BinaryExpression(path) {\n const { scope } = path;\n const { node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n scope.push({ id: placeholder });\n\n let call;\n if (t.isPipelineTopicExpression(right)) {\n path\n .get(\"right\")\n .traverse(updateTopicReferenceVisitor, { topicId: placeholder });\n\n call = right.expression;\n } else {\n // PipelineBareFunction\n let callee = right.callee;\n if (t.isIdentifier(callee, { name: \"eval\" })) {\n callee = t.sequenceExpression([t.numericLiteral(0), callee]);\n }\n\n call = t.callExpression(callee, [t.cloneNode(placeholder)]);\n }\n\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n ]),\n );\n },\n};\n\nexport default smartVisitor;\n","import { types as t } from \"@babel/core\";\nimport buildOptimizedSequenceExpression from \"./buildOptimizedSequenceExpression\";\n\nconst fsharpVisitor = {\n BinaryExpression(path) {\n const { scope, node } = path;\n const { operator, left, right } = node;\n if (operator !== \"|>\") return;\n\n const placeholder = scope.generateUidIdentifierBasedOnNode(left);\n\n const call =\n right.type === \"AwaitExpression\"\n ? t.awaitExpression(t.cloneNode(placeholder))\n : t.callExpression(right, [t.cloneNode(placeholder)]);\n const sequence = buildOptimizedSequenceExpression({\n assign: t.assignmentExpression(\"=\", t.cloneNode(placeholder), left),\n call,\n path,\n });\n path.replaceWith(sequence);\n },\n};\n\nexport default fsharpVisitor;\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxPipelineOperator from \"@babel/plugin-syntax-pipeline-operator\";\nimport minimalVisitor from \"./minimalVisitor\";\nimport smartVisitor from \"./smartVisitor\";\nimport fsharpVisitor from \"./fsharpVisitor\";\n\nconst visitorsPerProposal = {\n minimal: minimalVisitor,\n smart: smartVisitor,\n fsharp: fsharpVisitor,\n};\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-pipeline-operator\",\n inherits: syntaxPipelineOperator,\n visitor: visitorsPerProposal[options.proposal],\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\n\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport {\n createClassFeaturePlugin,\n FEATURES,\n} from \"@babel/helper-create-class-features-plugin\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n return createClassFeaturePlugin({\n name: \"proposal-private-methods\",\n\n feature: FEATURES.privateMethods,\n loose: options.loose,\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"classPrivateMethods\");\n },\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"syntax-throw-expressions\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"throwExpressions\");\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxThrowExpressions from \"@babel/plugin-syntax-throw-expressions\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"proposal-throw-expressions\",\n inherits: syntaxThrowExpressions,\n\n visitor: {\n UnaryExpression(path) {\n const { operator, argument } = path.node;\n if (operator !== \"throw\") return;\n\n const arrow = t.functionExpression(\n null,\n [t.identifier(\"e\")],\n t.blockStatement([t.throwStatement(t.identifier(\"e\"))]),\n );\n\n path.replaceWith(t.callExpression(arrow, [argument]));\n },\n },\n };\n});\n","/*!\n * regjsgen 0.5.1\n * Copyright 2014-2019 Benjamin Tan \n * Available under MIT license \n */\n;(function() {\n 'use strict';\n\n // Used to determine if values are of the language type `Object`.\n var objectTypes = {\n 'function': true,\n 'object': true\n };\n\n // Used as a reference to the global object.\n var root = (objectTypes[typeof window] && window) || this;\n\n // Detect free variable `exports`.\n var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n // Detect free variable `module`.\n var hasFreeModule = objectTypes[typeof module] && module && !module.nodeType;\n\n // Detect free variable `global` from Node.js or Browserified code and use it as `root`.\n var freeGlobal = freeExports && hasFreeModule && typeof global == 'object' && global;\n if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) {\n root = freeGlobal;\n }\n\n // Used to check objects for own properties.\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a string based on the given code point.\n // Based on https://mths.be/fromcodepoint by @mathias.\n function fromCodePoint() {\n var codePoint = Number(arguments[0]);\n\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xFFFF) {\n // BMP code point\n return String.fromCharCode(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n var highSurrogate = (codePoint >> 10) + 0xD800;\n var lowSurrogate = (codePoint % 0x400) + 0xDC00;\n return String.fromCharCode(highSurrogate, lowSurrogate);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Ensures that nodes have the correct types.\n var assertTypeRegexMap = {};\n function assertType(type, expected) {\n if (expected.indexOf('|') == -1) {\n if (type == expected) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected type: ' + expected);\n }\n\n expected = hasOwnProperty.call(assertTypeRegexMap, expected)\n ? assertTypeRegexMap[expected]\n : (assertTypeRegexMap[expected] = RegExp('^(?:' + expected + ')$'));\n\n if (expected.test(type)) {\n return;\n }\n\n throw Error('Invalid node type: ' + type + '; expected types: ' + expected);\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Generates a regular expression string based on an AST.\n function generate(node) {\n var type = node.type;\n\n if (hasOwnProperty.call(generators, type)) {\n return generators[type](node);\n }\n\n throw Error('Invalid node type: ' + type);\n }\n\n /*--------------------------------------------------------------------------*/\n\n function generateAlternative(node) {\n assertType(node.type, 'alternative');\n\n var terms = node.body,\n i = -1,\n length = terms.length,\n result = '';\n\n while (++i < length) {\n result += generateTerm(terms[i]);\n }\n\n return result;\n }\n\n function generateAnchor(node) {\n assertType(node.type, 'anchor');\n\n switch (node.kind) {\n case 'start':\n return '^';\n case 'end':\n return '$';\n case 'boundary':\n return '\\\\b';\n case 'not-boundary':\n return '\\\\B';\n default:\n throw Error('Invalid assertion');\n }\n }\n\n function generateAtom(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value');\n\n return generate(node);\n }\n\n function generateCharacterClass(node) {\n assertType(node.type, 'characterClass');\n\n var classRanges = node.body,\n i = -1,\n length = classRanges.length,\n result = '';\n\n if (node.negative) {\n result += '^';\n }\n\n while (++i < length) {\n result += generateClassAtom(classRanges[i]);\n }\n\n return '[' + result + ']';\n }\n\n function generateCharacterClassEscape(node) {\n assertType(node.type, 'characterClassEscape');\n\n return '\\\\' + node.value;\n }\n\n function generateUnicodePropertyEscape(node) {\n assertType(node.type, 'unicodePropertyEscape');\n\n return '\\\\' + (node.negative ? 'P' : 'p') + '{' + node.value + '}';\n }\n\n function generateCharacterClassRange(node) {\n assertType(node.type, 'characterClassRange');\n\n var min = node.min,\n max = node.max;\n\n if (min.type == 'characterClassRange' || max.type == 'characterClassRange') {\n throw Error('Invalid character class range');\n }\n\n return generateClassAtom(min) + '-' + generateClassAtom(max);\n }\n\n function generateClassAtom(node) {\n assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value');\n\n return generate(node);\n }\n\n function generateDisjunction(node) {\n assertType(node.type, 'disjunction');\n\n var body = node.body,\n i = -1,\n length = body.length,\n result = '';\n\n while (++i < length) {\n if (i != 0) {\n result += '|';\n }\n result += generate(body[i]);\n }\n\n return result;\n }\n\n function generateDot(node) {\n assertType(node.type, 'dot');\n\n return '.';\n }\n\n function generateGroup(node) {\n assertType(node.type, 'group');\n\n var result = '';\n\n switch (node.behavior) {\n case 'normal':\n if (node.name) {\n result += '?<' + generateIdentifier(node.name) + '>';\n }\n break;\n case 'ignore':\n result += '?:';\n break;\n case 'lookahead':\n result += '?=';\n break;\n case 'negativeLookahead':\n result += '?!';\n break;\n case 'lookbehind':\n result += '?<=';\n break;\n case 'negativeLookbehind':\n result += '?';\n }\n\n throw new Error('Unknown reference type');\n }\n\n function generateTerm(node) {\n assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|unicodePropertyEscape|value|dot');\n\n return generate(node);\n }\n\n function generateValue(node) {\n assertType(node.type, 'value');\n\n var kind = node.kind,\n codePoint = node.codePoint;\n\n if (typeof codePoint != 'number') {\n throw new Error('Invalid code point: ' + codePoint);\n }\n\n switch (kind) {\n case 'controlLetter':\n return '\\\\c' + fromCodePoint(codePoint + 64);\n case 'hexadecimalEscape':\n return '\\\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2);\n case 'identifier':\n return '\\\\' + fromCodePoint(codePoint);\n case 'null':\n return '\\\\' + codePoint;\n case 'octal':\n return '\\\\' + codePoint.toString(8);\n case 'singleEscape':\n switch (codePoint) {\n case 0x0008:\n return '\\\\b';\n case 0x0009:\n return '\\\\t';\n case 0x000A:\n return '\\\\n';\n case 0x000B:\n return '\\\\v';\n case 0x000C:\n return '\\\\f';\n case 0x000D:\n return '\\\\r';\n default:\n throw Error('Invalid code point: ' + codePoint);\n }\n case 'symbol':\n return fromCodePoint(codePoint);\n case 'unicodeEscape':\n return '\\\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4);\n case 'unicodeCodePointEscape':\n return '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n default:\n throw Error('Unsupported node kind: ' + kind);\n }\n }\n\n /*--------------------------------------------------------------------------*/\n\n // Used to generate strings for each node type.\n var generators = {\n 'alternative': generateAlternative,\n 'anchor': generateAnchor,\n 'characterClass': generateCharacterClass,\n 'characterClassEscape': generateCharacterClassEscape,\n 'characterClassRange': generateCharacterClassRange,\n 'unicodePropertyEscape': generateUnicodePropertyEscape,\n 'disjunction': generateDisjunction,\n 'dot': generateDot,\n 'group': generateGroup,\n 'quantifier': generateQuantifier,\n 'reference': generateReference,\n 'value': generateValue\n };\n\n /*--------------------------------------------------------------------------*/\n\n // Export regjsgen.\n var regjsgen = {\n 'generate': generate\n };\n\n // Some AMD build optimizers, like r.js, check for condition patterns like the following:\n if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {\n // Define as an anonymous module so it can be aliased through path mapping.\n define(function() {\n return regjsgen;\n });\n\n root.regjsgen = regjsgen;\n }\n // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\n else if (freeExports && hasFreeModule) {\n // Export for CommonJS support.\n freeExports.generate = generate;\n }\n else {\n // Export to the global object.\n root.regjsgen = regjsgen;\n }\n}.call(this));\n","// regjsparser\n//\n// ==================================================================\n//\n// See ECMA-262 Standard: 15.10.1\n//\n// NOTE: The ECMA-262 standard uses the term \"Assertion\" for /^/. Here the\n// term \"Anchor\" is used.\n//\n// Pattern ::\n// Disjunction\n//\n// Disjunction ::\n// Alternative\n// Alternative | Disjunction\n//\n// Alternative ::\n// [empty]\n// Alternative Term\n//\n// Term ::\n// Anchor\n// Atom\n// Atom Quantifier\n//\n// Anchor ::\n// ^\n// $\n// \\ b\n// \\ B\n// ( ? = Disjunction )\n// ( ? ! Disjunction )\n// ( ? < = Disjunction )\n// ( ? < ! Disjunction )\n//\n// Quantifier ::\n// QuantifierPrefix\n// QuantifierPrefix ?\n//\n// QuantifierPrefix ::\n// *\n// +\n// ?\n// { DecimalDigits }\n// { DecimalDigits , }\n// { DecimalDigits , DecimalDigits }\n//\n// Atom ::\n// PatternCharacter\n// .\n// \\ AtomEscape\n// CharacterClass\n// ( GroupSpecifier Disjunction )\n// ( ? : Disjunction )\n//\n// PatternCharacter ::\n// SourceCharacter but not any of: ^ $ \\ . * + ? ( ) [ ] { } |\n//\n// AtomEscape ::\n// DecimalEscape\n// CharacterEscape\n// CharacterClassEscape\n// k GroupName\n//\n// CharacterEscape[U] ::\n// ControlEscape\n// c ControlLetter\n// HexEscapeSequence\n// RegExpUnicodeEscapeSequence[?U] (ES6)\n// IdentityEscape[?U]\n//\n// ControlEscape ::\n// one of f n r t v\n// ControlLetter ::\n// one of\n// a b c d e f g h i j k l m n o p q r s t u v w x y z\n// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z\n//\n// IdentityEscape ::\n// SourceCharacter but not c\n//\n// DecimalEscape ::\n// DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n//\n// CharacterClassEscape ::\n// one of d D s S w W\n//\n// CharacterClass ::\n// [ [lookahead ∉ {^}] ClassRanges ]\n// [ ^ ClassRanges ]\n//\n// ClassRanges ::\n// [empty]\n// NonemptyClassRanges\n//\n// NonemptyClassRanges ::\n// ClassAtom\n// ClassAtom NonemptyClassRangesNoDash\n// ClassAtom - ClassAtom ClassRanges\n//\n// NonemptyClassRangesNoDash ::\n// ClassAtom\n// ClassAtomNoDash NonemptyClassRangesNoDash\n// ClassAtomNoDash - ClassAtom ClassRanges\n//\n// ClassAtom ::\n// -\n// ClassAtomNoDash\n//\n// ClassAtomNoDash ::\n// SourceCharacter but not one of \\ or ] or -\n// \\ ClassEscape\n//\n// ClassEscape ::\n// DecimalEscape\n// b\n// CharacterEscape\n// CharacterClassEscape\n//\n// GroupSpecifier ::\n// [empty]\n// ? GroupName\n//\n// GroupName ::\n// < RegExpIdentifierName >\n//\n// RegExpIdentifierName ::\n// RegExpIdentifierStart\n// RegExpIdentifierName RegExpIdentifierContinue\n//\n// RegExpIdentifierStart ::\n// UnicodeIDStart\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n//\n// RegExpIdentifierContinue ::\n// UnicodeIDContinue\n// $\n// _\n// \\ RegExpUnicodeEscapeSequence\n// \n// \n\n(function() {\n\n var fromCodePoint = String.fromCodePoint || (function() {\n // Implementation taken from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n\n var stringFromCharCode = String.fromCharCode;\n var floor = Math.floor;\n\n return function fromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n if (!length) {\n return '';\n }\n var result = '';\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n if (\n !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10FFFF || // not a valid Unicode code point\n floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n if (codePoint <= 0xFFFF) { // BMP code point\n codeUnits.push(codePoint);\n } else { // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xD800;\n lowSurrogate = (codePoint % 0x400) + 0xDC00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n if (index + 1 == length || codeUnits.length > MAX_SIZE) {\n result += stringFromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n }());\n\n function parse(str, flags, features) {\n if (!features) {\n features = {};\n }\n function addRaw(node) {\n node.raw = str.substring(node.range[0], node.range[1]);\n return node;\n }\n\n function updateRawStart(node, start) {\n node.range[0] = start;\n return addRaw(node);\n }\n\n function createAnchor(kind, rawLength) {\n return addRaw({\n type: 'anchor',\n kind: kind,\n range: [\n pos - rawLength,\n pos\n ]\n });\n }\n\n function createValue(kind, codePoint, from, to) {\n return addRaw({\n type: 'value',\n kind: kind,\n codePoint: codePoint,\n range: [from, to]\n });\n }\n\n function createEscaped(kind, codePoint, value, fromOffset) {\n fromOffset = fromOffset || 0;\n return createValue(kind, codePoint, pos - (value.length + fromOffset), pos);\n }\n\n function createCharacter(matches) {\n var _char = matches[0];\n var first = _char.charCodeAt(0);\n if (hasUnicodeFlag) {\n var second;\n if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) {\n second = lookahead().charCodeAt(0);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n pos++;\n return createValue(\n 'symbol',\n (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000,\n pos - 2, pos);\n }\n }\n }\n return createValue('symbol', first, pos - 1, pos);\n }\n\n function createDisjunction(alternatives, from, to) {\n return addRaw({\n type: 'disjunction',\n body: alternatives,\n range: [\n from,\n to\n ]\n });\n }\n\n function createDot() {\n return addRaw({\n type: 'dot',\n range: [\n pos - 1,\n pos\n ]\n });\n }\n\n function createCharacterClassEscape(value) {\n return addRaw({\n type: 'characterClassEscape',\n value: value,\n range: [\n pos - 2,\n pos\n ]\n });\n }\n\n function createReference(matchIndex) {\n return addRaw({\n type: 'reference',\n matchIndex: parseInt(matchIndex, 10),\n range: [\n pos - 1 - matchIndex.length,\n pos\n ]\n });\n }\n\n function createNamedReference(name) {\n return addRaw({\n type: 'reference',\n name: name,\n range: [\n name.range[0] - 3,\n pos\n ]\n });\n }\n\n function createGroup(behavior, disjunction, from, to) {\n return addRaw({\n type: 'group',\n behavior: behavior,\n body: disjunction,\n range: [\n from,\n to\n ]\n });\n }\n\n function createQuantifier(min, max, from, to) {\n if (to == null) {\n from = pos - 1;\n to = pos;\n }\n\n return addRaw({\n type: 'quantifier',\n min: min,\n max: max,\n greedy: true,\n body: null, // set later on\n range: [\n from,\n to\n ]\n });\n }\n\n function createAlternative(terms, from, to) {\n return addRaw({\n type: 'alternative',\n body: terms,\n range: [\n from,\n to\n ]\n });\n }\n\n function createCharacterClass(classRanges, negative, from, to) {\n return addRaw({\n type: 'characterClass',\n body: classRanges,\n negative: negative,\n range: [\n from,\n to\n ]\n });\n }\n\n function createClassRange(min, max, from, to) {\n // See 15.10.2.15:\n if (min.codePoint > max.codePoint) {\n bail('invalid range in character class', min.raw + '-' + max.raw, from, to);\n }\n\n return addRaw({\n type: 'characterClassRange',\n min: min,\n max: max,\n range: [\n from,\n to\n ]\n });\n }\n\n function flattenBody(body) {\n if (body.type === 'alternative') {\n return body.body;\n } else {\n return [body];\n }\n }\n\n function isEmpty(obj) {\n return obj.type === 'empty';\n }\n\n function incr(amount) {\n amount = (amount || 1);\n var res = str.substring(pos, pos + amount);\n pos += (amount || 1);\n return res;\n }\n\n function skip(value) {\n if (!match(value)) {\n bail('character', value);\n }\n }\n\n function match(value) {\n if (str.indexOf(value, pos) === pos) {\n return incr(value.length);\n }\n }\n\n function lookahead() {\n return str[pos];\n }\n\n function current(value) {\n return str.indexOf(value, pos) === pos;\n }\n\n function next(value) {\n return str[pos + 1] === value;\n }\n\n function matchReg(regExp) {\n var subStr = str.substring(pos);\n var res = subStr.match(regExp);\n if (res) {\n res.range = [];\n res.range[0] = pos;\n incr(res[0].length);\n res.range[1] = pos;\n }\n return res;\n }\n\n function parseDisjunction() {\n // Disjunction ::\n // Alternative\n // Alternative | Disjunction\n var res = [], from = pos;\n res.push(parseAlternative());\n\n while (match('|')) {\n res.push(parseAlternative());\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createDisjunction(res, from, pos);\n }\n\n function parseAlternative() {\n var res = [], from = pos;\n var term;\n\n // Alternative ::\n // [empty]\n // Alternative Term\n while (term = parseTerm()) {\n res.push(term);\n }\n\n if (res.length === 1) {\n return res[0];\n }\n\n return createAlternative(res, from, pos);\n }\n\n function parseTerm() {\n // Term ::\n // Anchor\n // Atom\n // Atom Quantifier\n\n if (pos >= str.length || current('|') || current(')')) {\n return null; /* Means: The term is empty */\n }\n\n var anchor = parseAnchor();\n\n if (anchor) {\n return anchor;\n }\n\n var atom = parseAtom();\n if (!atom) {\n bail('Expected atom');\n }\n var quantifier = parseQuantifier() || false;\n if (quantifier) {\n quantifier.body = flattenBody(atom);\n // The quantifier contains the atom. Therefore, the beginning of the\n // quantifier range is given by the beginning of the atom.\n updateRawStart(quantifier, atom.range[0]);\n return quantifier;\n }\n return atom;\n }\n\n function parseGroup(matchA, typeA, matchB, typeB) {\n var type = null, from = pos;\n\n if (match(matchA)) {\n type = typeA;\n } else if (match(matchB)) {\n type = typeB;\n } else {\n return false;\n }\n\n return finishGroup(type, from);\n }\n\n function finishGroup(type, from) {\n var body = parseDisjunction();\n if (!body) {\n bail('Expected disjunction');\n }\n skip(')');\n var group = createGroup(type, flattenBody(body), from, pos);\n\n if (type == 'normal') {\n // Keep track of the number of closed groups. This is required for\n // parseDecimalEscape(). In case the string is parsed a second time the\n // value already holds the total count and no incrementation is required.\n if (firstIteration) {\n closedCaptureCounter++;\n }\n }\n return group;\n }\n\n function parseAnchor() {\n // Anchor ::\n // ^\n // $\n // \\ b\n // \\ B\n // ( ? = Disjunction )\n // ( ? ! Disjunction )\n var res, from = pos;\n\n if (match('^')) {\n return createAnchor('start', 1 /* rawLength */);\n } else if (match('$')) {\n return createAnchor('end', 1 /* rawLength */);\n } else if (match('\\\\b')) {\n return createAnchor('boundary', 2 /* rawLength */);\n } else if (match('\\\\B')) {\n return createAnchor('not-boundary', 2 /* rawLength */);\n } else {\n return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead');\n }\n }\n\n function parseQuantifier() {\n // Quantifier ::\n // QuantifierPrefix\n // QuantifierPrefix ?\n //\n // QuantifierPrefix ::\n // *\n // +\n // ?\n // { DecimalDigits }\n // { DecimalDigits , }\n // { DecimalDigits , DecimalDigits }\n\n var res, from = pos;\n var quantifier;\n var min, max;\n\n if (match('*')) {\n quantifier = createQuantifier(0);\n }\n else if (match('+')) {\n quantifier = createQuantifier(1);\n }\n else if (match('?')) {\n quantifier = createQuantifier(0, 1);\n }\n else if (res = matchReg(/^\\{([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, min, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),\\}/)) {\n min = parseInt(res[1], 10);\n quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]);\n }\n else if (res = matchReg(/^\\{([0-9]+),([0-9]+)\\}/)) {\n min = parseInt(res[1], 10);\n max = parseInt(res[2], 10);\n if (min > max) {\n bail('numbers out of order in {} quantifier', '', from, pos);\n }\n quantifier = createQuantifier(min, max, res.range[0], res.range[1]);\n }\n\n if (quantifier) {\n if (match('?')) {\n quantifier.greedy = false;\n quantifier.range[1] += 1;\n }\n }\n\n return quantifier;\n }\n\n function parseAtom() {\n // Atom ::\n // PatternCharacter\n // .\n // \\ AtomEscape\n // CharacterClass\n // ( GroupSpecifier Disjunction )\n // ( ? : Disjunction )\n\n var res;\n\n // jviereck: allow ']', '}' here as well to be compatible with browser's\n // implementations: ']'.match(/]/);\n // if (res = matchReg(/^[^^$\\\\.*+?()[\\]{}|]/)) {\n if (res = matchReg(/^[^^$\\\\.*+?(){[|]/)) {\n // PatternCharacter\n return createCharacter(res);\n }\n else if (match('.')) {\n // .\n return createDot();\n }\n else if (match('\\\\')) {\n // \\ AtomEscape\n res = parseAtomEscape();\n if (!res) {\n if (!hasUnicodeFlag && lookahead() == 'c') {\n // B.1.4 ExtendedAtom\n // \\[lookahead = c]\n return createValue('symbol', 92, pos - 1, pos);\n }\n bail('atomEscape');\n }\n return res;\n }\n else if (res = parseCharacterClass()) {\n return res;\n }\n else if (features.lookbehind && (res = parseGroup('(?<=', 'lookbehind', '(?\");\n var group = finishGroup(\"normal\", name.range[0] - 3);\n group.name = name;\n return group;\n }\n else {\n // ( Disjunction )\n // ( ? : Disjunction )\n return parseGroup('(?:', 'ignore', '(', 'normal');\n }\n }\n\n function parseUnicodeSurrogatePairEscape(firstEscape) {\n if (hasUnicodeFlag) {\n var first, second;\n if (firstEscape.kind == 'unicodeEscape' &&\n (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF &&\n current('\\\\') && next('u') ) {\n var prevPos = pos;\n pos++;\n var secondEscape = parseClassEscape();\n if (secondEscape.kind == 'unicodeEscape' &&\n (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n firstEscape.range[1] = secondEscape.range[1];\n firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n firstEscape.type = 'value';\n firstEscape.kind = 'unicodeCodePointEscape';\n addRaw(firstEscape);\n }\n else {\n pos = prevPos;\n }\n }\n }\n return firstEscape;\n }\n\n function parseClassEscape() {\n return parseAtomEscape(true);\n }\n\n function parseAtomEscape(insideCharacterClass) {\n // AtomEscape ::\n // DecimalEscape\n // CharacterEscape\n // CharacterClassEscape\n // k GroupName\n\n var res, from = pos;\n\n res = parseDecimalEscape() || parseNamedReference();\n if (res) {\n return res;\n }\n\n // For ClassEscape\n if (insideCharacterClass) {\n // b\n if (match('b')) {\n // 15.10.2.19\n // The production ClassEscape :: b evaluates by returning the\n // CharSet containing the one character (Unicode value 0008).\n return createEscaped('singleEscape', 0x0008, '\\\\b');\n } else if (match('B')) {\n bail('\\\\B not possible inside of CharacterClass', '', from);\n } else if (!hasUnicodeFlag && (res = matchReg(/^c([0-9])/))) {\n // B.1.4\n // c ClassControlLetter\n return createEscaped('controlLetter', res[1] + 16, res[1], 2);\n }\n // [+U] -\n if (match('-') && hasUnicodeFlag) {\n return createEscaped('singleEscape', 0x002d, '\\\\-');\n }\n }\n\n res = parseCharacterEscape();\n\n return res;\n }\n\n\n function parseDecimalEscape() {\n // DecimalEscape ::\n // DecimalIntegerLiteral [lookahead ∉ DecimalDigit]\n // CharacterClassEscape :: one of d D s S w W\n\n var res, match;\n\n if (res = matchReg(/^(?!0)\\d+/)) {\n match = res[0];\n var refIdx = parseInt(res[0], 10);\n if (refIdx <= closedCaptureCounter) {\n // If the number is smaller than the normal-groups found so\n // far, then it is a reference...\n return createReference(res[0]);\n } else {\n // ... otherwise it needs to be interpreted as a octal (if the\n // number is in an octal format). If it is NOT octal format,\n // then the slash is ignored and the number is matched later\n // as normal characters.\n\n // Recall the negative decision to decide if the input must be parsed\n // a second time with the total normal-groups.\n backrefDenied.push(refIdx);\n\n // Reset the position again, as maybe only parts of the previous\n // matched numbers are actual octal numbers. E.g. in '019' only\n // the '01' should be matched.\n incr(-res[0].length);\n if (res = matchReg(/^[0-7]{1,3}/)) {\n return createEscaped('octal', parseInt(res[0], 8), res[0], 1);\n } else {\n // If we end up here, we have a case like /\\91/. Then the\n // first slash is to be ignored and the 9 & 1 to be treated\n // like ordinary characters. Create a character for the\n // first number only here - other number-characters\n // (if available) will be matched later.\n res = createCharacter(matchReg(/^[89]/));\n return updateRawStart(res, res.range[0] - 1);\n }\n }\n }\n // Only allow octal numbers in the following. All matched numbers start\n // with a zero (if the do not, the previous if-branch is executed).\n // If the number is not octal format and starts with zero (e.g. `091`)\n // then only the zeros `0` is treated here and the `91` are ordinary\n // characters.\n // Example:\n // /\\091/.exec('\\091')[0].length === 3\n else if (res = matchReg(/^[0-7]{1,3}/)) {\n match = res[0];\n if (/^0{1,3}$/.test(match)) {\n // If they are all zeros, then only take the first one.\n return createEscaped('null', 0x0000, '0', match.length + 1);\n } else {\n return createEscaped('octal', parseInt(match, 8), match, 1);\n }\n } else if (res = matchReg(/^[dDsSwW]/)) {\n return createCharacterClassEscape(res[0]);\n }\n return false;\n }\n\n function parseNamedReference() {\n if (features.namedGroups && matchReg(/^k<(?=.*?>)/)) {\n var name = parseIdentifier();\n skip('>');\n return createNamedReference(name);\n }\n }\n\n function parseRegExpUnicodeEscapeSequence() {\n var res;\n if (res = matchReg(/^u([0-9a-fA-F]{4})/)) {\n // UnicodeEscapeSequence\n return parseUnicodeSurrogatePairEscape(\n createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2)\n );\n } else if (hasUnicodeFlag && (res = matchReg(/^u\\{([0-9a-fA-F]+)\\}/))) {\n // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape)\n return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4);\n }\n }\n\n function parseCharacterEscape() {\n // CharacterEscape ::\n // ControlEscape\n // c ControlLetter\n // HexEscapeSequence\n // UnicodeEscapeSequence\n // IdentityEscape\n\n var res;\n var from = pos;\n if (res = matchReg(/^[fnrtv]/)) {\n // ControlEscape\n var codePoint = 0;\n switch (res[0]) {\n case 't': codePoint = 0x009; break;\n case 'n': codePoint = 0x00A; break;\n case 'v': codePoint = 0x00B; break;\n case 'f': codePoint = 0x00C; break;\n case 'r': codePoint = 0x00D; break;\n }\n return createEscaped('singleEscape', codePoint, '\\\\' + res[0]);\n } else if (res = matchReg(/^c([a-zA-Z])/)) {\n // c ControlLetter\n return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2);\n } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) {\n // HexEscapeSequence\n return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2);\n } else if (res = parseRegExpUnicodeEscapeSequence()) {\n if (!res || res.codePoint > 0x10FFFF) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return res;\n } else if (features.unicodePropertyEscape && hasUnicodeFlag && (res = matchReg(/^([pP])\\{([^\\}]+)\\}/))) {\n // https://github.com/jviereck/regjsparser/issues/77\n return addRaw({\n type: 'unicodePropertyEscape',\n negative: res[1] === 'P',\n value: res[2],\n range: [res.range[0] - 1, res.range[1]],\n raw: res[0]\n });\n } else {\n // IdentityEscape\n return parseIdentityEscape();\n }\n }\n\n function parseIdentifierAtom(check) {\n var ch = lookahead();\n var from = pos;\n if (ch === '\\\\') {\n incr();\n var esc = parseRegExpUnicodeEscapeSequence();\n if (!esc || !check(esc.codePoint)) {\n bail('Invalid escape sequence', null, from, pos);\n }\n return fromCodePoint(esc.codePoint);\n }\n var code = ch.charCodeAt(0);\n if (code >= 0xD800 && code <= 0xDBFF) {\n ch += str[pos + 1];\n var second = ch.charCodeAt(1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // Unicode surrogate pair\n code = (code - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n if (!check(code)) return;\n incr();\n if (code > 0xFFFF) incr();\n return ch;\n }\n\n function parseIdentifier() {\n // RegExpIdentifierName ::\n // RegExpIdentifierStart\n // RegExpIdentifierName RegExpIdentifierContinue\n //\n // RegExpIdentifierStart ::\n // UnicodeIDStart\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n //\n // RegExpIdentifierContinue ::\n // UnicodeIDContinue\n // $\n // _\n // \\ RegExpUnicodeEscapeSequence\n // \n // \n\n var start = pos;\n var res = parseIdentifierAtom(isIdentifierStart);\n if (!res) {\n bail('Invalid identifier');\n }\n\n var ch;\n while (ch = parseIdentifierAtom(isIdentifierPart)) {\n res += ch;\n }\n\n return addRaw({\n type: 'identifier',\n value: res,\n range: [start, pos]\n });\n }\n\n function isIdentifierStart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierStart = /[\\$A-Z_a-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u08A0-\\u08B4\\u08B6-\\u08BD\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C88\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2118-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309B-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FEF\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7B9\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB65\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]|\\uD800[\\uDC00-\\uDC0B\\uDC0D-\\uDC26\\uDC28-\\uDC3A\\uDC3C\\uDC3D\\uDC3F-\\uDC4D\\uDC50-\\uDC5D\\uDC80-\\uDCFA\\uDD40-\\uDD74\\uDE80-\\uDE9C\\uDEA0-\\uDED0\\uDF00-\\uDF1F\\uDF2D-\\uDF4A\\uDF50-\\uDF75\\uDF80-\\uDF9D\\uDFA0-\\uDFC3\\uDFC8-\\uDFCF\\uDFD1-\\uDFD5]|\\uD801[\\uDC00-\\uDC9D\\uDCB0-\\uDCD3\\uDCD8-\\uDCFB\\uDD00-\\uDD27\\uDD30-\\uDD63\\uDE00-\\uDF36\\uDF40-\\uDF55\\uDF60-\\uDF67]|\\uD802[\\uDC00-\\uDC05\\uDC08\\uDC0A-\\uDC35\\uDC37\\uDC38\\uDC3C\\uDC3F-\\uDC55\\uDC60-\\uDC76\\uDC80-\\uDC9E\\uDCE0-\\uDCF2\\uDCF4\\uDCF5\\uDD00-\\uDD15\\uDD20-\\uDD39\\uDD80-\\uDDB7\\uDDBE\\uDDBF\\uDE00\\uDE10-\\uDE13\\uDE15-\\uDE17\\uDE19-\\uDE35\\uDE60-\\uDE7C\\uDE80-\\uDE9C\\uDEC0-\\uDEC7\\uDEC9-\\uDEE4\\uDF00-\\uDF35\\uDF40-\\uDF55\\uDF60-\\uDF72\\uDF80-\\uDF91]|\\uD803[\\uDC00-\\uDC48\\uDC80-\\uDCB2\\uDCC0-\\uDCF2\\uDD00-\\uDD23\\uDF00-\\uDF1C\\uDF27\\uDF30-\\uDF45]|\\uD804[\\uDC03-\\uDC37\\uDC83-\\uDCAF\\uDCD0-\\uDCE8\\uDD03-\\uDD26\\uDD44\\uDD50-\\uDD72\\uDD76\\uDD83-\\uDDB2\\uDDC1-\\uDDC4\\uDDDA\\uDDDC\\uDE00-\\uDE11\\uDE13-\\uDE2B\\uDE80-\\uDE86\\uDE88\\uDE8A-\\uDE8D\\uDE8F-\\uDE9D\\uDE9F-\\uDEA8\\uDEB0-\\uDEDE\\uDF05-\\uDF0C\\uDF0F\\uDF10\\uDF13-\\uDF28\\uDF2A-\\uDF30\\uDF32\\uDF33\\uDF35-\\uDF39\\uDF3D\\uDF50\\uDF5D-\\uDF61]|\\uD805[\\uDC00-\\uDC34\\uDC47-\\uDC4A\\uDC80-\\uDCAF\\uDCC4\\uDCC5\\uDCC7\\uDD80-\\uDDAE\\uDDD8-\\uDDDB\\uDE00-\\uDE2F\\uDE44\\uDE80-\\uDEAA\\uDF00-\\uDF1A]|\\uD806[\\uDC00-\\uDC2B\\uDCA0-\\uDCDF\\uDCFF\\uDE00\\uDE0B-\\uDE32\\uDE3A\\uDE50\\uDE5C-\\uDE83\\uDE86-\\uDE89\\uDE9D\\uDEC0-\\uDEF8]|\\uD807[\\uDC00-\\uDC08\\uDC0A-\\uDC2E\\uDC40\\uDC72-\\uDC8F\\uDD00-\\uDD06\\uDD08\\uDD09\\uDD0B-\\uDD30\\uDD46\\uDD60-\\uDD65\\uDD67\\uDD68\\uDD6A-\\uDD89\\uDD98\\uDEE0-\\uDEF2]|\\uD808[\\uDC00-\\uDF99]|\\uD809[\\uDC00-\\uDC6E\\uDC80-\\uDD43]|[\\uD80C\\uD81C-\\uD820\\uD840-\\uD868\\uD86A-\\uD86C\\uD86F-\\uD872\\uD874-\\uD879][\\uDC00-\\uDFFF]|\\uD80D[\\uDC00-\\uDC2E]|\\uD811[\\uDC00-\\uDE46]|\\uD81A[\\uDC00-\\uDE38\\uDE40-\\uDE5E\\uDED0-\\uDEED\\uDF00-\\uDF2F\\uDF40-\\uDF43\\uDF63-\\uDF77\\uDF7D-\\uDF8F]|\\uD81B[\\uDE40-\\uDE7F\\uDF00-\\uDF44\\uDF50\\uDF93-\\uDF9F\\uDFE0\\uDFE1]|\\uD821[\\uDC00-\\uDFF1]|\\uD822[\\uDC00-\\uDEF2]|\\uD82C[\\uDC00-\\uDD1E\\uDD70-\\uDEFB]|\\uD82F[\\uDC00-\\uDC6A\\uDC70-\\uDC7C\\uDC80-\\uDC88\\uDC90-\\uDC99]|\\uD835[\\uDC00-\\uDC54\\uDC56-\\uDC9C\\uDC9E\\uDC9F\\uDCA2\\uDCA5\\uDCA6\\uDCA9-\\uDCAC\\uDCAE-\\uDCB9\\uDCBB\\uDCBD-\\uDCC3\\uDCC5-\\uDD05\\uDD07-\\uDD0A\\uDD0D-\\uDD14\\uDD16-\\uDD1C\\uDD1E-\\uDD39\\uDD3B-\\uDD3E\\uDD40-\\uDD44\\uDD46\\uDD4A-\\uDD50\\uDD52-\\uDEA5\\uDEA8-\\uDEC0\\uDEC2-\\uDEDA\\uDEDC-\\uDEFA\\uDEFC-\\uDF14\\uDF16-\\uDF34\\uDF36-\\uDF4E\\uDF50-\\uDF6E\\uDF70-\\uDF88\\uDF8A-\\uDFA8\\uDFAA-\\uDFC2\\uDFC4-\\uDFCB]|\\uD83A[\\uDC00-\\uDCC4\\uDD00-\\uDD43]|\\uD83B[\\uDE00-\\uDE03\\uDE05-\\uDE1F\\uDE21\\uDE22\\uDE24\\uDE27\\uDE29-\\uDE32\\uDE34-\\uDE37\\uDE39\\uDE3B\\uDE42\\uDE47\\uDE49\\uDE4B\\uDE4D-\\uDE4F\\uDE51\\uDE52\\uDE54\\uDE57\\uDE59\\uDE5B\\uDE5D\\uDE5F\\uDE61\\uDE62\\uDE64\\uDE67-\\uDE6A\\uDE6C-\\uDE72\\uDE74-\\uDE77\\uDE79-\\uDE7C\\uDE7E\\uDE80-\\uDE89\\uDE8B-\\uDE9B\\uDEA1-\\uDEA3\\uDEA5-\\uDEA9\\uDEAB-\\uDEBB]|\\uD869[\\uDC00-\\uDED6\\uDF00-\\uDFFF]|\\uD86D[\\uDC00-\\uDF34\\uDF40-\\uDFFF]|\\uD86E[\\uDC00-\\uDC1D\\uDC20-\\uDFFF]|\\uD873[\\uDC00-\\uDEA1\\uDEB0-\\uDFFF]|\\uD87A[\\uDC00-\\uDFE0]|\\uD87E[\\uDC00-\\uDE1D]/;\n\n return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore)\n (ch >= 65 && ch <= 90) || // A..Z\n (ch >= 97 && ch <= 122) || // a..z\n ((ch >= 0x80) && NonAsciiIdentifierStart.test(fromCodePoint(ch)));\n }\n\n // Taken from the Esprima parser.\n function isIdentifierPart(ch) {\n // Generated by `tools/generate-identifier-regex.js`.\n var NonAsciiIdentifierPartOnly = /[0-9_\\xB7\\u0300-\\u036F\\u0387\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u0669\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u06F0-\\u06F9\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07C0-\\u07C9\\u07EB-\\u07F3\\u07FD\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08D3-\\u08E1\\u08E3-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096F\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u09E6-\\u09EF\\u09FE\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A66-\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0AE6-\\u0AEF\\u0AFA-\\u0AFF\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B66-\\u0B6F\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C04\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0CE6-\\u0CEF\\u0D00-\\u0D03\\u0D3B\\u0D3C\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D66-\\u0D6F\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0E50-\\u0E59\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1040-\\u1049\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F-\\u109D\\u135D-\\u135F\\u1369-\\u1371\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u194F\\u19D0-\\u19DA\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AB0-\\u1ABD\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BB0-\\u1BB9\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1C40-\\u1C49\\u1C50-\\u1C59\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF7-\\u1CF9\\u1DC0-\\u1DF9\\u1DFB-\\u1DFF\\u200C\\u200D\\u203F\\u2040\\u2054\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA620-\\uA629\\uA66F\\uA674-\\uA67D\\uA69E\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C5\\uA8D0-\\uA8D9\\uA8E0-\\uA8F1\\uA8FF-\\uA909\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9D0-\\uA9D9\\uA9E5\\uA9F0-\\uA9F9\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA50-\\uAA59\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2F\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF10-\\uFF19\\uFF3F]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD801[\\uDCA0-\\uDCA9]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD803[\\uDD24-\\uDD27\\uDD30-\\uDD39\\uDF46-\\uDF50]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC66-\\uDC6F\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDCF0-\\uDCF9\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD36-\\uDD3F\\uDD45\\uDD46\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDDC9-\\uDDCC\\uDDD0-\\uDDD9\\uDE2C-\\uDE37\\uDE3E\\uDEDF-\\uDEEA\\uDEF0-\\uDEF9\\uDF00-\\uDF03\\uDF3B\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDC35-\\uDC46\\uDC50-\\uDC59\\uDC5E\\uDCB0-\\uDCC3\\uDCD0-\\uDCD9\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDDDC\\uDDDD\\uDE30-\\uDE40\\uDE50-\\uDE59\\uDEAB-\\uDEB7\\uDEC0-\\uDEC9\\uDF1D-\\uDF2B\\uDF30-\\uDF39]|\\uD806[\\uDC2C-\\uDC3A\\uDCE0-\\uDCE9\\uDE01-\\uDE0A\\uDE33-\\uDE39\\uDE3B-\\uDE3E\\uDE47\\uDE51-\\uDE5B\\uDE8A-\\uDE99]|\\uD807[\\uDC2F-\\uDC36\\uDC38-\\uDC3F\\uDC50-\\uDC59\\uDC92-\\uDCA7\\uDCA9-\\uDCB6\\uDD31-\\uDD36\\uDD3A\\uDD3C\\uDD3D\\uDD3F-\\uDD45\\uDD47\\uDD50-\\uDD59\\uDD8A-\\uDD8E\\uDD90\\uDD91\\uDD93-\\uDD97\\uDDA0-\\uDDA9\\uDEF3-\\uDEF6]|\\uD81A[\\uDE60-\\uDE69\\uDEF0-\\uDEF4\\uDF30-\\uDF36\\uDF50-\\uDF59]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD835[\\uDFCE-\\uDFFF]|\\uD836[\\uDE00-\\uDE36\\uDE3B-\\uDE6C\\uDE75\\uDE84\\uDE9B-\\uDE9F\\uDEA1-\\uDEAF]|\\uD838[\\uDC00-\\uDC06\\uDC08-\\uDC18\\uDC1B-\\uDC21\\uDC23\\uDC24\\uDC26-\\uDC2A]|\\uD83A[\\uDCD0-\\uDCD6\\uDD44-\\uDD4A\\uDD50-\\uDD59]|\\uDB40[\\uDD00-\\uDDEF]/;\n\n return isIdentifierStart(ch) ||\n (ch >= 48 && ch <= 57) || // 0..9\n ((ch >= 0x80) && NonAsciiIdentifierPartOnly.test(fromCodePoint(ch)));\n }\n\n function parseIdentityEscape() {\n // IdentityEscape ::\n // [+U] SyntaxCharacter\n // [+U] /\n // [~U] SourceCharacterIdentityEscape[?N]\n // SourceCharacterIdentityEscape[?N] ::\n // [~N] SourceCharacter but not c\n // [+N] SourceCharacter but not one of c or k\n\n\n var tmp;\n var l = lookahead();\n if (\n (hasUnicodeFlag && /[\\^\\$\\.\\*\\+\\?\\(\\)\\\\\\[\\]\\{\\}\\|\\/]/.test(l)) ||\n (!hasUnicodeFlag && l !== \"c\")\n ) {\n if (l === \"k\" && features.lookbehind) {\n return null;\n }\n tmp = incr();\n return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1);\n }\n\n return null;\n }\n\n function parseCharacterClass() {\n // CharacterClass ::\n // [ [lookahead ∉ {^}] ClassRanges ]\n // [ ^ ClassRanges ]\n\n var res, from = pos;\n if (res = matchReg(/^\\[\\^/)) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, true, from, pos);\n } else if (match('[')) {\n res = parseClassRanges();\n skip(']');\n return createCharacterClass(res, false, from, pos);\n }\n\n return null;\n }\n\n function parseClassRanges() {\n // ClassRanges ::\n // [empty]\n // NonemptyClassRanges\n\n var res;\n if (current(']')) {\n // Empty array means nothing insinde of the ClassRange.\n return [];\n } else {\n res = parseNonemptyClassRanges();\n if (!res) {\n bail('nonEmptyClassRanges');\n }\n return res;\n }\n }\n\n function parseHelperClassRanges(atom) {\n var from, to, res;\n if (current('-') && !next(']')) {\n // ClassAtom - ClassAtom ClassRanges\n skip('-');\n\n res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n to = pos;\n var classRanges = parseClassRanges();\n if (!classRanges) {\n bail('classRanges');\n }\n from = atom.range[0];\n if (classRanges.type === 'empty') {\n return [createClassRange(atom, res, from, to)];\n }\n return [createClassRange(atom, res, from, to)].concat(classRanges);\n }\n\n res = parseNonemptyClassRangesNoDash();\n if (!res) {\n bail('nonEmptyClassRangesNoDash');\n }\n\n return [atom].concat(res);\n }\n\n function parseNonemptyClassRanges() {\n // NonemptyClassRanges ::\n // ClassAtom\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n\n var atom = parseClassAtom();\n if (!atom) {\n bail('classAtom');\n }\n\n if (current(']')) {\n // ClassAtom\n return [atom];\n }\n\n // ClassAtom NonemptyClassRangesNoDash\n // ClassAtom - ClassAtom ClassRanges\n return parseHelperClassRanges(atom);\n }\n\n function parseNonemptyClassRangesNoDash() {\n // NonemptyClassRangesNoDash ::\n // ClassAtom\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n\n var res = parseClassAtom();\n if (!res) {\n bail('classAtom');\n }\n if (current(']')) {\n // ClassAtom\n return res;\n }\n\n // ClassAtomNoDash NonemptyClassRangesNoDash\n // ClassAtomNoDash - ClassAtom ClassRanges\n return parseHelperClassRanges(res);\n }\n\n function parseClassAtom() {\n // ClassAtom ::\n // -\n // ClassAtomNoDash\n if (match('-')) {\n return createCharacter('-');\n } else {\n return parseClassAtomNoDash();\n }\n }\n\n function parseClassAtomNoDash() {\n // ClassAtomNoDash ::\n // SourceCharacter but not one of \\ or ] or -\n // \\ ClassEscape\n\n var res;\n if (res = matchReg(/^[^\\\\\\]-]/)) {\n return createCharacter(res[0]);\n } else if (match('\\\\')) {\n res = parseClassEscape();\n if (!res) {\n bail('classEscape');\n }\n\n return parseUnicodeSurrogatePairEscape(res);\n }\n }\n\n function bail(message, details, from, to) {\n from = from == null ? pos : from;\n to = to == null ? from : to;\n\n var contextStart = Math.max(0, from - 10);\n var contextEnd = Math.min(to + 10, str.length);\n\n // Output a bit of context and a line pointing to where our error is.\n //\n // We are assuming that there are no actual newlines in the content as this is a regular expression.\n var context = ' ' + str.substring(contextStart, contextEnd);\n var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^';\n\n throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\\n' + context + '\\n' + pointer);\n }\n\n var backrefDenied = [];\n var closedCaptureCounter = 0;\n var firstIteration = true;\n var hasUnicodeFlag = (flags || \"\").indexOf(\"u\") !== -1;\n var pos = 0;\n\n // Convert the input to a string and treat the empty string special.\n str = String(str);\n if (str === '') {\n str = '(?:)';\n }\n\n var result = parseDisjunction();\n\n if (result.range[1] !== str.length) {\n bail('Could not parse entire input - got stuck', '', result.range[1]);\n }\n\n // The spec requires to interpret the `\\2` in `/\\2()()/` as backreference.\n // As the parser collects the number of capture groups as the string is\n // parsed it is impossible to make these decisions at the point when the\n // `\\2` is handled. In case the local decision turns out to be wrong after\n // the parsing has finished, the input string is parsed a second time with\n // the total number of capture groups set.\n //\n // SEE: https://github.com/jviereck/regjsparser/issues/70\n for (var i = 0; i < backrefDenied.length; i++) {\n if (backrefDenied[i] <= closedCaptureCounter) {\n // Parse the input a second time.\n pos = 0;\n firstIteration = false;\n return parseDisjunction();\n }\n }\n\n return result;\n }\n\n var regjsparser = {\n parse: parse\n };\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = regjsparser;\n } else {\n window.regjsparser = regjsparser;\n }\n\n}());\n","/*! https://mths.be/regenerate v1.3.3 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js/io.js or Browserified code,\n\t// and use it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar ERRORS = {\n\t\t'rangeOrder': 'A range\\u2019s `stop` value must be greater than or equal ' +\n\t\t\t'to the `start` value.',\n\t\t'codePointRange': 'Invalid code point value. Code points range from ' +\n\t\t\t'U+000000 to U+10FFFF.'\n\t};\n\n\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs\n\tvar HIGH_SURROGATE_MIN = 0xD800;\n\tvar HIGH_SURROGATE_MAX = 0xDBFF;\n\tvar LOW_SURROGATE_MIN = 0xDC00;\n\tvar LOW_SURROGATE_MAX = 0xDFFF;\n\n\t// In Regenerate output, `\\0` is never preceded by `\\` because we sort by\n\t// code point value, so let’s keep this regular expression simple.\n\tvar regexNull = /\\\\x00([^0123456789]|$)/g;\n\n\tvar object = {};\n\tvar hasOwnProperty = object.hasOwnProperty;\n\tvar extend = function(destination, source) {\n\t\tvar key;\n\t\tfor (key in source) {\n\t\t\tif (hasOwnProperty.call(source, key)) {\n\t\t\t\tdestination[key] = source[key];\n\t\t\t}\n\t\t}\n\t\treturn destination;\n\t};\n\n\tvar forEach = function(array, callback) {\n\t\tvar index = -1;\n\t\tvar length = array.length;\n\t\twhile (++index < length) {\n\t\t\tcallback(array[index], index);\n\t\t}\n\t};\n\n\tvar toString = object.toString;\n\tvar isArray = function(value) {\n\t\treturn toString.call(value) == '[object Array]';\n\t};\n\tvar isNumber = function(value) {\n\t\treturn typeof value == 'number' ||\n\t\t\ttoString.call(value) == '[object Number]';\n\t};\n\n\t// This assumes that `number` is a positive integer that `toString()`s nicely\n\t// (which is the case for all code point values).\n\tvar zeroes = '0000';\n\tvar pad = function(number, totalCharacters) {\n\t\tvar string = String(number);\n\t\treturn string.length < totalCharacters\n\t\t\t? (zeroes + string).slice(-totalCharacters)\n\t\t\t: string;\n\t};\n\n\tvar hex = function(number) {\n\t\treturn Number(number).toString(16).toUpperCase();\n\t};\n\n\tvar slice = [].slice;\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar dataFromCodePoints = function(codePoints) {\n\t\tvar index = -1;\n\t\tvar length = codePoints.length;\n\t\tvar max = length - 1;\n\t\tvar result = [];\n\t\tvar isStart = true;\n\t\tvar tmp;\n\t\tvar previous = 0;\n\t\twhile (++index < length) {\n\t\t\ttmp = codePoints[index];\n\t\t\tif (isStart) {\n\t\t\t\tresult.push(tmp);\n\t\t\t\tprevious = tmp;\n\t\t\t\tisStart = false;\n\t\t\t} else {\n\t\t\t\tif (tmp == previous + 1) {\n\t\t\t\t\tif (index != max) {\n\t\t\t\t\t\tprevious = tmp;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisStart = true;\n\t\t\t\t\t\tresult.push(tmp + 1);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// End the previous range and start a new one.\n\t\t\t\t\tresult.push(previous + 1, tmp);\n\t\t\t\t\tprevious = tmp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!isStart) {\n\t\t\tresult.push(tmp + 1);\n\t\t}\n\t\treturn result;\n\t};\n\n\tvar dataRemove = function(data, codePoint) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\t// Modify this pair.\n\t\t\t\tif (codePoint == start) {\n\t\t\t\t\tif (end == start + 1) {\n\t\t\t\t\t\t// Just remove `start` and `end`.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\t\t\tdata[index] = codePoint + 1;\n\t\t\t\t\t\treturn data;\n\t\t\t\t\t}\n\t\t\t\t} else if (codePoint == end - 1) {\n\t\t\t\t\t// Just replace `end` with a new value.\n\t\t\t\t\tdata[index + 1] = codePoint;\n\t\t\t\t\treturn data;\n\t\t\t\t} else {\n\t\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\t\tdata.splice(index, 2, start, codePoint, codePoint + 1, end);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\twhile (index < data.length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\t// Exit as soon as no more matching pairs can be found.\n\t\t\tif (start > rangeEnd) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if this range pair is equal to, or forms a subset of, the range\n\t\t\t// to be removed.\n\t\t\t// E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`.\n\t\t\t// E.g. we have `[40, 51]` and want to remove 0-100 → `[]`.\n\t\t\tif (rangeStart <= start && rangeEnd >= end) {\n\t\t\t\t// Remove this pair.\n\t\t\t\tdata.splice(index, 2);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check if both `rangeStart` and `rangeEnd` are within the bounds of\n\t\t\t// this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`.\n\t\t\tif (rangeStart >= start && rangeEnd < end) {\n\t\t\t\tif (rangeStart == start) {\n\t\t\t\t\t// Replace `[start, end]` with `[startB, endB]`.\n\t\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\t\tdata[index + 1] = end + 1;\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Replace `[start, end]` with `[startA, endA, startB, endB]`.\n\t\t\t\tdata.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if only `rangeStart` is within the bounds of this pair.\n\t\t\t// E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`.\n\t\t\tif (rangeStart >= start && rangeStart <= end) {\n\t\t\t\t// Replace `end` with `rangeStart`.\n\t\t\t\tdata[index + 1] = rangeStart;\n\t\t\t\t// Note: we cannot `return` just yet, in case any following pairs still\n\t\t\t\t// contain matching code points.\n\t\t\t\t// E.g. we have `[0, 11, 14, 31]` and want to remove 4-20\n\t\t\t\t// → `[0, 4, 21, 31]`.\n\t\t\t}\n\n\t\t\t// Check if only `rangeEnd` is within the bounds of this pair.\n\t\t\t// E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`.\n\t\t\telse if (rangeEnd >= start && rangeEnd <= end) {\n\t\t\t\t// Just replace `start`.\n\t\t\t\tdata[index] = rangeEnd + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\t var dataAdd = function(data, codePoint) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar lastIndex = null;\n\t\tvar length = data.length;\n\t\tif (codePoint < 0x0 || codePoint > 0x10FFFF) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\t// Check if the code point is already in the set.\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == start - 1) {\n\t\t\t\t// Just replace `start` with a new value.\n\t\t\t\tdata[index] = codePoint;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// At this point, if `start` is `greater` than `codePoint`, insert a new\n\t\t\t// `[start, end]` pair before the current pair, or after the current pair\n\t\t\t// if there is a known `lastIndex`.\n\t\t\tif (start > codePoint) {\n\t\t\t\tdata.splice(\n\t\t\t\t\tlastIndex != null ? lastIndex + 2 : 0,\n\t\t\t\t\t0,\n\t\t\t\t\tcodePoint,\n\t\t\t\t\tcodePoint + 1\n\t\t\t\t);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tif (codePoint == end) {\n\t\t\t\t// Check if adding this code point causes two separate ranges to become\n\t\t\t\t// a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`.\n\t\t\t\tif (codePoint + 1 == data[index + 2]) {\n\t\t\t\t\tdata.splice(index, 4, start, data[index + 3]);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\t\t\t\t// Else, just replace `end` with a new value.\n\t\t\t\tdata[index + 1] = codePoint + 1;\n\t\t\t\treturn data;\n\t\t\t}\n\t\t\tlastIndex = index;\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished; add the new pair to the end of the data set.\n\t\tdata.push(codePoint, codePoint + 1);\n\t\treturn data;\n\t};\n\n\tvar dataAddData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataAdd(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataAddRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataRemoveData = function(dataA, dataB) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar data = dataA.slice();\n\t\tvar length = dataB.length;\n\t\twhile (index < length) {\n\t\t\tstart = dataB[index];\n\t\t\tend = dataB[index + 1] - 1;\n\t\t\tif (start == end) {\n\t\t\t\tdata = dataRemove(data, start);\n\t\t\t} else {\n\t\t\t\tdata = dataRemoveRange(data, start, end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataAddRange = function(data, rangeStart, rangeEnd) {\n\t\tif (rangeEnd < rangeStart) {\n\t\t\tthrow Error(ERRORS.rangeOrder);\n\t\t}\n\t\tif (\n\t\t\trangeStart < 0x0 || rangeStart > 0x10FFFF ||\n\t\t\trangeEnd < 0x0 || rangeEnd > 0x10FFFF\n\t\t) {\n\t\t\tthrow RangeError(ERRORS.codePointRange);\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar added = false;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\n\t\t\tif (added) {\n\t\t\t\t// The range has already been added to the set; at this point, we just\n\t\t\t\t// need to get rid of the following ranges in case they overlap.\n\n\t\t\t\t// Check if this range can be combined with the previous range.\n\t\t\t\tif (start == rangeEnd + 1) {\n\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Exit as soon as no more possibly overlapping pairs can be found.\n\t\t\t\tif (start > rangeEnd) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have\n\t\t\t\t// `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the\n\t\t\t\t// `0,16` range that was previously added.\n\t\t\t\tif (start >= rangeStart && start <= rangeEnd) {\n\t\t\t\t\t// `start` lies within the range that was previously added.\n\n\t\t\t\t\tif (end > rangeStart && end - 1 <= rangeEnd) {\n\t\t\t\t\t\t// `end` lies within the range that was previously added as well,\n\t\t\t\t\t\t// so remove this pair.\n\t\t\t\t\t\tdata.splice(index, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t\t// Note: we cannot `return` just yet, as there may still be other\n\t\t\t\t\t\t// overlapping pairs.\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// `start` lies within the range that was previously added, but\n\t\t\t\t\t\t// `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so\n\t\t\t\t\t\t// now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`.\n\t\t\t\t\t\t// Remove the previously added `end` and the current `start`.\n\t\t\t\t\t\tdata.splice(index - 1, 2);\n\t\t\t\t\t\tindex -= 2;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Note: we cannot return yet.\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse if (start == rangeEnd + 1) {\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\t// Check if a new pair must be inserted *before* the current one.\n\t\t\telse if (start > rangeEnd) {\n\t\t\t\tdata.splice(index, 0, rangeStart, rangeEnd + 1);\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) {\n\t\t\t\t// The new range lies entirely within an existing range pair. No action\n\t\t\t\t// needed.\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\telse if (\n\t\t\t\t// E.g. `[0, 11]` and you add 5-15 → `[0, 16]`.\n\t\t\t\t(rangeStart >= start && rangeStart < end) ||\n\t\t\t\t// E.g. `[0, 3]` and you add 3-6 → `[0, 7]`.\n\t\t\t\tend == rangeStart\n\t\t\t) {\n\t\t\t\t// Replace `end` with the new value.\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\t// Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]`\n\t\t\t\t// and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part.\n\t\t\t\tadded = true;\n\t\t\t\t// Note: we cannot `return` just yet.\n\t\t\t}\n\n\t\t\telse if (rangeStart <= start && rangeEnd + 1 >= end) {\n\t\t\t\t// The new range is a superset of the old range.\n\t\t\t\tdata[index] = rangeStart;\n\t\t\t\tdata[index + 1] = rangeEnd + 1;\n\t\t\t\tadded = true;\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\t// The loop has finished without doing anything; add the new pair to the end\n\t\t// of the data set.\n\t\tif (!added) {\n\t\t\tdata.push(rangeStart, rangeEnd + 1);\n\t\t}\n\t\treturn data;\n\t};\n\n\tvar dataContains = function(data, codePoint) {\n\t\tvar index = 0;\n\t\tvar length = data.length;\n\t\t// Exit early if `codePoint` is not within `data`’s overall range.\n\t\tvar start = data[index];\n\t\tvar end = data[length - 1];\n\t\tif (length >= 2) {\n\t\t\tif (codePoint < start || codePoint > end) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\tif (codePoint >= start && codePoint < end) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn false;\n\t};\n\n\tvar dataIntersection = function(data, codePoints) {\n\t\tvar index = 0;\n\t\tvar length = codePoints.length;\n\t\tvar codePoint;\n\t\tvar result = [];\n\t\twhile (index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tif (dataContains(data, codePoint)) {\n\t\t\t\tresult.push(codePoint);\n\t\t\t}\n\t\t\t++index;\n\t\t}\n\t\treturn dataFromCodePoints(result);\n\t};\n\n\tvar dataIsEmpty = function(data) {\n\t\treturn !data.length;\n\t};\n\n\tvar dataIsSingleton = function(data) {\n\t\t// Check if the set only represents a single code point.\n\t\treturn data.length == 2 && data[0] + 1 == data[1];\n\t};\n\n\tvar dataToArray = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar result = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1];\n\t\t\twhile (start < end) {\n\t\t\t\tresult.push(start);\n\t\t\t\t++start;\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn result;\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\tvar floor = Math.floor;\n\tvar highSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\tfloor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar lowSurrogate = function(codePoint) {\n\t\treturn parseInt(\n\t\t\t(codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN,\n\t\t\t10\n\t\t);\n\t};\n\n\tvar stringFromCharCode = String.fromCharCode;\n\tvar codePointToString = function(codePoint) {\n\t\tvar string;\n\t\t// https://mathiasbynens.be/notes/javascript-escapes#single\n\t\t// Note: the `\\b` escape sequence for U+0008 BACKSPACE in strings has a\n\t\t// different meaning in regular expressions (word boundary), so it cannot\n\t\t// be used here.\n\t\tif (codePoint == 0x09) {\n\t\t\tstring = '\\\\t';\n\t\t}\n\t\t// Note: IE < 9 treats `'\\v'` as `'v'`, so avoid using it.\n\t\t// else if (codePoint == 0x0B) {\n\t\t// \tstring = '\\\\v';\n\t\t// }\n\t\telse if (codePoint == 0x0A) {\n\t\t\tstring = '\\\\n';\n\t\t}\n\t\telse if (codePoint == 0x0C) {\n\t\t\tstring = '\\\\f';\n\t\t}\n\t\telse if (codePoint == 0x0D) {\n\t\t\tstring = '\\\\r';\n\t\t}\n\t\telse if (codePoint == 0x2D) {\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#hexadecimal\n\t\t\t// Note: `-` (U+002D HYPHEN-MINUS) is escaped in this way rather\n\t\t\t// than by backslash-escaping, in case the output is used outside\n\t\t\t// of a character class in a `u` RegExp. /\\-/u throws, but\n\t\t\t// /\\x2D/u is fine.\n\t\t\tstring = '\\\\x2D';\n\t\t}\n\t\telse if (codePoint == 0x5C) {\n\t\t\tstring = '\\\\\\\\';\n\t\t}\n\t\telse if (\n\t\t\tcodePoint == 0x24 ||\n\t\t\t(codePoint >= 0x28 && codePoint <= 0x2B) ||\n\t\t\tcodePoint == 0x2E || codePoint == 0x2F ||\n\t\t\tcodePoint == 0x3F ||\n\t\t\t(codePoint >= 0x5B && codePoint <= 0x5E) ||\n\t\t\t(codePoint >= 0x7B && codePoint <= 0x7D)\n\t\t) {\n\t\t\t// The code point maps to an unsafe printable ASCII character;\n\t\t\t// backslash-escape it. Here’s the list of those symbols:\n\t\t\t//\n\t\t\t// $()*+./?[\\]^{|}\n\t\t\t//\n\t\t\t// This matches SyntaxCharacters as well as `/` (U+002F SOLIDUS).\n\t\t\t// https://tc39.github.io/ecma262/#prod-SyntaxCharacter\n\t\t\tstring = '\\\\' + stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint >= 0x20 && codePoint <= 0x7E) {\n\t\t\t// The code point maps to one of these printable ASCII symbols\n\t\t\t// (including the space character):\n\t\t\t//\n\t\t\t// !\"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO\n\t\t\t// PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~\n\t\t\t//\n\t\t\t// These can safely be used directly.\n\t\t\tstring = stringFromCharCode(codePoint);\n\t\t}\n\t\telse if (codePoint <= 0xFF) {\n\t\t\tstring = '\\\\x' + pad(hex(codePoint), 2);\n\t\t}\n\t\telse { // `codePoint <= 0xFFFF` holds true.\n\t\t\t// https://mathiasbynens.be/notes/javascript-escapes#unicode\n\t\t\tstring = '\\\\u' + pad(hex(codePoint), 4);\n\t\t}\n\n\t\t// There’s no need to account for astral symbols / surrogate pairs here,\n\t\t// since `codePointToString` is private and only used for BMP code points.\n\t\t// But if that’s what you need, just add an `else` block with this code:\n\t\t//\n\t\t// string = '\\\\u' + pad(hex(highSurrogate(codePoint)), 4)\n\t\t// \t+ '\\\\u' + pad(hex(lowSurrogate(codePoint)), 4);\n\n\t\treturn string;\n\t};\n\n\tvar codePointToStringUnicode = function(codePoint) {\n\t\tif (codePoint <= 0xFFFF) {\n\t\t\treturn codePointToString(codePoint);\n\t\t}\n\t\treturn '\\\\u{' + codePoint.toString(16).toUpperCase() + '}';\n\t};\n\n\tvar symbolToCodePoint = function(symbol) {\n\t\tvar length = symbol.length;\n\t\tvar first = symbol.charCodeAt(0);\n\t\tvar second;\n\t\tif (\n\t\t\tfirst >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX &&\n\t\t\tlength > 1 // There is a next code unit.\n\t\t) {\n\t\t\t// `first` is a high surrogate, and there is a next character. Assume\n\t\t\t// it’s a low surrogate (else it’s invalid usage of Regenerate anyway).\n\t\t\tsecond = symbol.charCodeAt(1);\n\t\t\t// https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n\t\t\treturn (first - HIGH_SURROGATE_MIN) * 0x400 +\n\t\t\t\tsecond - LOW_SURROGATE_MIN + 0x10000;\n\t\t}\n\t\treturn first;\n\t};\n\n\tvar createBMPCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToString(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToString(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToString(start) + codePointToString(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToString(start) + '-' + codePointToString(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar createUnicodeCharacterClasses = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar result = '';\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\tif (dataIsSingleton(data)) {\n\t\t\treturn codePointToStringUnicode(data[0]);\n\t\t}\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\t\t\tif (start == end) {\n\t\t\t\tresult += codePointToStringUnicode(start);\n\t\t\t} else if (start + 1 == end) {\n\t\t\t\tresult += codePointToStringUnicode(start) + codePointToStringUnicode(end);\n\t\t\t} else {\n\t\t\t\tresult += codePointToStringUnicode(start) + '-' + codePointToStringUnicode(end);\n\t\t\t}\n\t\t\tindex += 2;\n\t\t}\n\t\treturn '[' + result + ']';\n\t};\n\n\tvar splitAtBMP = function(data) {\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar loneHighSurrogates = [];\n\t\tvar loneLowSurrogates = [];\n\t\tvar bmp = [];\n\t\tvar astral = [];\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.\n\n\t\t\tif (start < HIGH_SURROGATE_MIN) {\n\n\t\t\t\t// The range starts and ends before the high surrogate range.\n\t\t\t\t// E.g. (0, 0x10).\n\t\t\t\tif (end < HIGH_SURROGATE_MIN) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends within it.\n\t\t\t\t// E.g. (0, 0xD855).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts before the high surrogate range and ends after the\n\t\t\t\t// low surrogate range. E.g. (0, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tbmp.push(start, HIGH_SURROGATE_MIN);\n\t\t\t\t\tloneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the high surrogate range.\n\t\t\t\t// E.g. (0xD855, 0xD866).\n\t\t\t\tif (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends in the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0xDCFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the high surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xD855, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1);\n\t\t\t\t\tloneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) {\n\n\t\t\t\t// The range starts and ends in the low surrogate range.\n\t\t\t\t// E.g. (0xDCFF, 0xDDFF).\n\t\t\t\tif (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, end + 1);\n\t\t\t\t}\n\n\t\t\t\t// The range starts in the low surrogate range and ends after the low\n\t\t\t\t// surrogate range. E.g. (0xDCFF, 0x10FFFF).\n\t\t\t\tif (end > LOW_SURROGATE_MAX) {\n\t\t\t\t\tloneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1);\n\t\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, end + 1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1);\n\t\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) {\n\n\t\t\t\t// The range starts and ends after the low surrogate range.\n\t\t\t\t// E.g. (0xFFAA, 0x10FFFF).\n\t\t\t\tif (end <= 0xFFFF) {\n\t\t\t\t\tbmp.push(start, end + 1);\n\t\t\t\t} else {\n\t\t\t\t\tbmp.push(start, 0xFFFF + 1);\n\t\t\t\t\tastral.push(0xFFFF + 1, end + 1);\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// The range starts and ends in the astral range.\n\t\t\t\tastral.push(start, end + 1);\n\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\t\treturn {\n\t\t\t'loneHighSurrogates': loneHighSurrogates,\n\t\t\t'loneLowSurrogates': loneLowSurrogates,\n\t\t\t'bmp': bmp,\n\t\t\t'astral': astral\n\t\t};\n\t};\n\n\tvar optimizeSurrogateMappings = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tvar tmpLow = [];\n\t\tvar addLow = false;\n\t\tvar mapping;\n\t\tvar nextMapping;\n\t\tvar highSurrogates;\n\t\tvar lowSurrogates;\n\t\tvar nextHighSurrogates;\n\t\tvar nextLowSurrogates;\n\t\tvar index = -1;\n\t\tvar length = surrogateMappings.length;\n\t\twhile (++index < length) {\n\t\t\tmapping = surrogateMappings[index];\n\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\tif (!nextMapping) {\n\t\t\t\tresult.push(mapping);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\thighSurrogates = mapping[0];\n\t\t\tlowSurrogates = mapping[1];\n\t\t\tnextHighSurrogates = nextMapping[0];\n\t\t\tnextLowSurrogates = nextMapping[1];\n\n\t\t\t// Check for identical high surrogate ranges.\n\t\t\ttmpLow = lowSurrogates;\n\t\t\twhile (\n\t\t\t\tnextHighSurrogates &&\n\t\t\t\thighSurrogates[0] == nextHighSurrogates[0] &&\n\t\t\t\thighSurrogates[1] == nextHighSurrogates[1]\n\t\t\t) {\n\t\t\t\t// Merge with the next item.\n\t\t\t\tif (dataIsSingleton(nextLowSurrogates)) {\n\t\t\t\t\ttmpLow = dataAdd(tmpLow, nextLowSurrogates[0]);\n\t\t\t\t} else {\n\t\t\t\t\ttmpLow = dataAddRange(\n\t\t\t\t\t\ttmpLow,\n\t\t\t\t\t\tnextLowSurrogates[0],\n\t\t\t\t\t\tnextLowSurrogates[1] - 1\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t++index;\n\t\t\t\tmapping = surrogateMappings[index];\n\t\t\t\thighSurrogates = mapping[0];\n\t\t\t\tlowSurrogates = mapping[1];\n\t\t\t\tnextMapping = surrogateMappings[index + 1];\n\t\t\t\tnextHighSurrogates = nextMapping && nextMapping[0];\n\t\t\t\tnextLowSurrogates = nextMapping && nextMapping[1];\n\t\t\t\taddLow = true;\n\t\t\t}\n\t\t\tresult.push([\n\t\t\t\thighSurrogates,\n\t\t\t\taddLow ? tmpLow : lowSurrogates\n\t\t\t]);\n\t\t\taddLow = false;\n\t\t}\n\t\treturn optimizeByLowSurrogates(result);\n\t};\n\n\tvar optimizeByLowSurrogates = function(surrogateMappings) {\n\t\tif (surrogateMappings.length == 1) {\n\t\t\treturn surrogateMappings;\n\t\t}\n\t\tvar index = -1;\n\t\tvar innerIndex = -1;\n\t\twhile (++index < surrogateMappings.length) {\n\t\t\tvar mapping = surrogateMappings[index];\n\t\t\tvar lowSurrogates = mapping[1];\n\t\t\tvar lowSurrogateStart = lowSurrogates[0];\n\t\t\tvar lowSurrogateEnd = lowSurrogates[1];\n\t\t\tinnerIndex = index; // Note: the loop starts at the next index.\n\t\t\twhile (++innerIndex < surrogateMappings.length) {\n\t\t\t\tvar otherMapping = surrogateMappings[innerIndex];\n\t\t\t\tvar otherLowSurrogates = otherMapping[1];\n\t\t\t\tvar otherLowSurrogateStart = otherLowSurrogates[0];\n\t\t\t\tvar otherLowSurrogateEnd = otherLowSurrogates[1];\n\t\t\t\tif (\n\t\t\t\t\tlowSurrogateStart == otherLowSurrogateStart &&\n\t\t\t\t\tlowSurrogateEnd == otherLowSurrogateEnd\n\t\t\t\t) {\n\t\t\t\t\t// Add the code points in the other item to this one.\n\t\t\t\t\tif (dataIsSingleton(otherMapping[0])) {\n\t\t\t\t\t\tmapping[0] = dataAdd(mapping[0], otherMapping[0][0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapping[0] = dataAddRange(\n\t\t\t\t\t\t\tmapping[0],\n\t\t\t\t\t\t\totherMapping[0][0],\n\t\t\t\t\t\t\totherMapping[0][1] - 1\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t// Remove the other, now redundant, item.\n\t\t\t\t\tsurrogateMappings.splice(innerIndex, 1);\n\t\t\t\t\t--innerIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn surrogateMappings;\n\t};\n\n\tvar surrogateSet = function(data) {\n\t\t// Exit early if `data` is an empty set.\n\t\tif (!data.length) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Iterate over the data per `(start, end)` pair.\n\t\tvar index = 0;\n\t\tvar start;\n\t\tvar end;\n\t\tvar startHigh;\n\t\tvar startLow;\n\t\tvar endHigh;\n\t\tvar endLow;\n\t\tvar surrogateMappings = [];\n\t\tvar length = data.length;\n\t\twhile (index < length) {\n\t\t\tstart = data[index];\n\t\t\tend = data[index + 1] - 1;\n\n\t\t\tstartHigh = highSurrogate(start);\n\t\t\tstartLow = lowSurrogate(start);\n\t\t\tendHigh = highSurrogate(end);\n\t\t\tendLow = lowSurrogate(end);\n\n\t\t\tvar startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN;\n\t\t\tvar endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX;\n\t\t\tvar complete = false;\n\n\t\t\t// Append the previous high-surrogate-to-low-surrogate mappings.\n\t\t\t// Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`.\n\t\t\tif (\n\t\t\t\tstartHigh == endHigh ||\n\t\t\t\tstartsWithLowestLowSurrogate && endsWithHighestLowSurrogate\n\t\t\t) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, endHigh + 1],\n\t\t\t\t\t[startLow, endLow + 1]\n\t\t\t\t]);\n\t\t\t\tcomplete = true;\n\t\t\t} else {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[startHigh, startHigh + 1],\n\t\t\t\t\t[startLow, LOW_SURROGATE_MAX + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t// Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to\n\t\t\t// `(endHigh - 1, LOW_SURROGATE_MAX)`.\n\t\t\tif (!complete && startHigh + 1 < endHigh) {\n\t\t\t\tif (endsWithHighestLowSurrogate) {\n\t\t\t\t\t// Combine step 2 and step 3.\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh + 1],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t\t]);\n\t\t\t\t\tcomplete = true;\n\t\t\t\t} else {\n\t\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t\t[startHigh + 1, endHigh],\n\t\t\t\t\t\t[LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1]\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`.\n\t\t\tif (!complete) {\n\t\t\t\tsurrogateMappings.push([\n\t\t\t\t\t[endHigh, endHigh + 1],\n\t\t\t\t\t[LOW_SURROGATE_MIN, endLow + 1]\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\tindex += 2;\n\t\t}\n\n\t\t// The format of `surrogateMappings` is as follows:\n\t\t//\n\t\t// [ surrogateMapping1, surrogateMapping2 ]\n\t\t//\n\t\t// i.e.:\n\t\t//\n\t\t// [\n\t\t// [ highSurrogates1, lowSurrogates1 ],\n\t\t// [ highSurrogates2, lowSurrogates2 ]\n\t\t// ]\n\t\treturn optimizeSurrogateMappings(surrogateMappings);\n\t};\n\n\tvar createSurrogateCharacterClasses = function(surrogateMappings) {\n\t\tvar result = [];\n\t\tforEach(surrogateMappings, function(surrogateMapping) {\n\t\t\tvar highSurrogates = surrogateMapping[0];\n\t\t\tvar lowSurrogates = surrogateMapping[1];\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(highSurrogates) +\n\t\t\t\tcreateBMPCharacterClasses(lowSurrogates)\n\t\t\t);\n\t\t});\n\t\treturn result.join('|');\n\t};\n\n\tvar createCharacterClassesFromData = function(data, bmpOnly, hasUnicodeFlag) {\n\t\tif (hasUnicodeFlag) {\n\t\t\treturn createUnicodeCharacterClasses(data);\n\t\t}\n\t\tvar result = [];\n\n\t\tvar parts = splitAtBMP(data);\n\t\tvar loneHighSurrogates = parts.loneHighSurrogates;\n\t\tvar loneLowSurrogates = parts.loneLowSurrogates;\n\t\tvar bmp = parts.bmp;\n\t\tvar astral = parts.astral;\n\t\tvar hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates);\n\t\tvar hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates);\n\n\t\tvar surrogateMappings = surrogateSet(astral);\n\n\t\tif (bmpOnly) {\n\t\t\tbmp = dataAddData(bmp, loneHighSurrogates);\n\t\t\thasLoneHighSurrogates = false;\n\t\t\tbmp = dataAddData(bmp, loneLowSurrogates);\n\t\t\thasLoneLowSurrogates = false;\n\t\t}\n\n\t\tif (!dataIsEmpty(bmp)) {\n\t\t\t// The data set contains BMP code points that are not high surrogates\n\t\t\t// needed for astral code points in the set.\n\t\t\tresult.push(createBMPCharacterClasses(bmp));\n\t\t}\n\t\tif (surrogateMappings.length) {\n\t\t\t// The data set contains astral code points; append character classes\n\t\t\t// based on their surrogate pairs.\n\t\t\tresult.push(createSurrogateCharacterClasses(surrogateMappings));\n\t\t}\n\t\t// https://gist.github.com/mathiasbynens/bbe7f870208abcfec860\n\t\tif (hasLoneHighSurrogates) {\n\t\t\tresult.push(\n\t\t\t\tcreateBMPCharacterClasses(loneHighSurrogates) +\n\t\t\t\t// Make sure the high surrogates aren’t part of a surrogate pair.\n\t\t\t\t'(?![\\\\uDC00-\\\\uDFFF])'\n\t\t\t);\n\t\t}\n\t\tif (hasLoneLowSurrogates) {\n\t\t\tresult.push(\n\t\t\t\t// It is not possible to accurately assert the low surrogates aren’t\n\t\t\t\t// part of a surrogate pair, since JavaScript regular expressions do\n\t\t\t\t// not support lookbehind.\n\t\t\t\t'(?:[^\\\\uD800-\\\\uDBFF]|^)' +\n\t\t\t\tcreateBMPCharacterClasses(loneLowSurrogates)\n\t\t\t);\n\t\t}\n\t\treturn result.join('|');\n\t};\n\n\t/*--------------------------------------------------------------------------*/\n\n\t// `regenerate` can be used as a constructor (and new methods can be added to\n\t// its prototype) but also as a regular function, the latter of which is the\n\t// documented and most common usage. For that reason, it’s not capitalized.\n\tvar regenerate = function(value) {\n\t\tif (arguments.length > 1) {\n\t\t\tvalue = slice.call(arguments);\n\t\t}\n\t\tif (this instanceof regenerate) {\n\t\t\tthis.data = [];\n\t\t\treturn value ? this.add(value) : this;\n\t\t}\n\t\treturn (new regenerate).add(value);\n\t};\n\n\tregenerate.version = '1.3.3';\n\n\tvar proto = regenerate.prototype;\n\textend(proto, {\n\t\t'add': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataAddData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.add(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataAdd(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'remove': function(value) {\n\t\t\tvar $this = this;\n\t\t\tif (value == null) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (value instanceof regenerate) {\n\t\t\t\t// Allow passing other Regenerate instances.\n\t\t\t\t$this.data = dataRemoveData($this.data, value.data);\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tvalue = slice.call(arguments);\n\t\t\t}\n\t\t\tif (isArray(value)) {\n\t\t\t\tforEach(value, function(item) {\n\t\t\t\t\t$this.remove(item);\n\t\t\t\t});\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\t$this.data = dataRemove(\n\t\t\t\t$this.data,\n\t\t\t\tisNumber(value) ? value : symbolToCodePoint(value)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'addRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\t$this.data = dataAddRange($this.data,\n\t\t\t\tisNumber(start) ? start : symbolToCodePoint(start),\n\t\t\t\tisNumber(end) ? end : symbolToCodePoint(end)\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'removeRange': function(start, end) {\n\t\t\tvar $this = this;\n\t\t\tvar startCodePoint = isNumber(start) ? start : symbolToCodePoint(start);\n\t\t\tvar endCodePoint = isNumber(end) ? end : symbolToCodePoint(end);\n\t\t\t$this.data = dataRemoveRange(\n\t\t\t\t$this.data,\n\t\t\t\tstartCodePoint,\n\t\t\t\tendCodePoint\n\t\t\t);\n\t\t\treturn $this;\n\t\t},\n\t\t'intersection': function(argument) {\n\t\t\tvar $this = this;\n\t\t\t// Allow passing other Regenerate instances.\n\t\t\t// TODO: Optimize this by writing and using `dataIntersectionData()`.\n\t\t\tvar array = argument instanceof regenerate ?\n\t\t\t\tdataToArray(argument.data) :\n\t\t\t\targument;\n\t\t\t$this.data = dataIntersection($this.data, array);\n\t\t\treturn $this;\n\t\t},\n\t\t'contains': function(codePoint) {\n\t\t\treturn dataContains(\n\t\t\t\tthis.data,\n\t\t\t\tisNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint)\n\t\t\t);\n\t\t},\n\t\t'clone': function() {\n\t\t\tvar set = new regenerate;\n\t\t\tset.data = this.data.slice(0);\n\t\t\treturn set;\n\t\t},\n\t\t'toString': function(options) {\n\t\t\tvar result = createCharacterClassesFromData(\n\t\t\t\tthis.data,\n\t\t\t\toptions ? options.bmpOnly : false,\n\t\t\t\toptions ? options.hasUnicodeFlag : false\n\t\t\t);\n\t\t\tif (!result) {\n\t\t\t\t// For an empty set, return something that can be inserted `/here/` to\n\t\t\t\t// form a valid regular expression. Avoid `(?:)` since that matches the\n\t\t\t\t// empty string.\n\t\t\t\treturn '[]';\n\t\t\t}\n\t\t\t// Use `\\0` instead of `\\x00` where possible.\n\t\t\treturn result.replace(regexNull, '\\\\0$1');\n\t\t},\n\t\t'toRegExp': function(flags) {\n\t\t\tvar pattern = this.toString(\n\t\t\t\tflags && flags.indexOf('u') != -1 ?\n\t\t\t\t\t{ 'hasUnicodeFlag': true } :\n\t\t\t\t\tnull\n\t\t\t);\n\t\t\treturn RegExp(pattern, flags || '');\n\t\t},\n\t\t'valueOf': function() { // Note: `valueOf` is aliased as `toArray`.\n\t\t\treturn dataToArray(this.data);\n\t\t}\n\t});\n\n\tproto.toArray = proto.valueOf;\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn regenerate;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = regenerate;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfreeExports.regenerate = regenerate;\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.regenerate = regenerate;\n\t}\n\n}(this));\n","module.exports = new Set([\n\t// Non-binary properties:\n\t'General_Category',\n\t'Script',\n\t'Script_Extensions',\n\t// Binary properties:\n\t'Alphabetic',\n\t'Any',\n\t'ASCII',\n\t'ASCII_Hex_Digit',\n\t'Assigned',\n\t'Bidi_Control',\n\t'Bidi_Mirrored',\n\t'Case_Ignorable',\n\t'Cased',\n\t'Changes_When_Casefolded',\n\t'Changes_When_Casemapped',\n\t'Changes_When_Lowercased',\n\t'Changes_When_NFKC_Casefolded',\n\t'Changes_When_Titlecased',\n\t'Changes_When_Uppercased',\n\t'Dash',\n\t'Default_Ignorable_Code_Point',\n\t'Deprecated',\n\t'Diacritic',\n\t'Emoji',\n\t'Emoji_Component',\n\t'Emoji_Modifier',\n\t'Emoji_Modifier_Base',\n\t'Emoji_Presentation',\n\t'Extended_Pictographic',\n\t'Extender',\n\t'Grapheme_Base',\n\t'Grapheme_Extend',\n\t'Hex_Digit',\n\t'ID_Continue',\n\t'ID_Start',\n\t'Ideographic',\n\t'IDS_Binary_Operator',\n\t'IDS_Trinary_Operator',\n\t'Join_Control',\n\t'Logical_Order_Exception',\n\t'Lowercase',\n\t'Math',\n\t'Noncharacter_Code_Point',\n\t'Pattern_Syntax',\n\t'Pattern_White_Space',\n\t'Quotation_Mark',\n\t'Radical',\n\t'Regional_Indicator',\n\t'Sentence_Terminal',\n\t'Soft_Dotted',\n\t'Terminal_Punctuation',\n\t'Unified_Ideograph',\n\t'Uppercase',\n\t'Variation_Selector',\n\t'White_Space',\n\t'XID_Continue',\n\t'XID_Start'\n]);\n","// Generated using `npm run build`. Do not edit!\nmodule.exports = new Map([\n\t['scx', 'Script_Extensions'],\n\t['sc', 'Script'],\n\t['gc', 'General_Category'],\n\t['AHex', 'ASCII_Hex_Digit'],\n\t['Alpha', 'Alphabetic'],\n\t['Bidi_C', 'Bidi_Control'],\n\t['Bidi_M', 'Bidi_Mirrored'],\n\t['Cased', 'Cased'],\n\t['CI', 'Case_Ignorable'],\n\t['CWCF', 'Changes_When_Casefolded'],\n\t['CWCM', 'Changes_When_Casemapped'],\n\t['CWKCF', 'Changes_When_NFKC_Casefolded'],\n\t['CWL', 'Changes_When_Lowercased'],\n\t['CWT', 'Changes_When_Titlecased'],\n\t['CWU', 'Changes_When_Uppercased'],\n\t['Dash', 'Dash'],\n\t['Dep', 'Deprecated'],\n\t['DI', 'Default_Ignorable_Code_Point'],\n\t['Dia', 'Diacritic'],\n\t['Ext', 'Extender'],\n\t['Gr_Base', 'Grapheme_Base'],\n\t['Gr_Ext', 'Grapheme_Extend'],\n\t['Hex', 'Hex_Digit'],\n\t['IDC', 'ID_Continue'],\n\t['Ideo', 'Ideographic'],\n\t['IDS', 'ID_Start'],\n\t['IDSB', 'IDS_Binary_Operator'],\n\t['IDST', 'IDS_Trinary_Operator'],\n\t['Join_C', 'Join_Control'],\n\t['LOE', 'Logical_Order_Exception'],\n\t['Lower', 'Lowercase'],\n\t['Math', 'Math'],\n\t['NChar', 'Noncharacter_Code_Point'],\n\t['Pat_Syn', 'Pattern_Syntax'],\n\t['Pat_WS', 'Pattern_White_Space'],\n\t['QMark', 'Quotation_Mark'],\n\t['Radical', 'Radical'],\n\t['RI', 'Regional_Indicator'],\n\t['SD', 'Soft_Dotted'],\n\t['STerm', 'Sentence_Terminal'],\n\t['Term', 'Terminal_Punctuation'],\n\t['UIdeo', 'Unified_Ideograph'],\n\t['Upper', 'Uppercase'],\n\t['VS', 'Variation_Selector'],\n\t['WSpace', 'White_Space'],\n\t['space', 'White_Space'],\n\t['XIDC', 'XID_Continue'],\n\t['XIDS', 'XID_Start']\n]);\n","'use strict';\n\nconst canonicalProperties = require('unicode-canonical-property-names-ecmascript');\nconst propertyAliases = require('unicode-property-aliases-ecmascript');\n\nconst matchProperty = function(property) {\n\tif (canonicalProperties.has(property)) {\n\t\treturn property;\n\t}\n\tif (propertyAliases.has(property)) {\n\t\treturn propertyAliases.get(property);\n\t}\n\tthrow new Error(`Unknown property: ${ property }`);\n};\n\nmodule.exports = matchProperty;\n","module.exports = new Map([\n\t['General_Category', new Map([\n\t\t['C', 'Other'],\n\t\t['Cc', 'Control'],\n\t\t['cntrl', 'Control'],\n\t\t['Cf', 'Format'],\n\t\t['Cn', 'Unassigned'],\n\t\t['Co', 'Private_Use'],\n\t\t['Cs', 'Surrogate'],\n\t\t['L', 'Letter'],\n\t\t['LC', 'Cased_Letter'],\n\t\t['Ll', 'Lowercase_Letter'],\n\t\t['Lm', 'Modifier_Letter'],\n\t\t['Lo', 'Other_Letter'],\n\t\t['Lt', 'Titlecase_Letter'],\n\t\t['Lu', 'Uppercase_Letter'],\n\t\t['M', 'Mark'],\n\t\t['Combining_Mark', 'Mark'],\n\t\t['Mc', 'Spacing_Mark'],\n\t\t['Me', 'Enclosing_Mark'],\n\t\t['Mn', 'Nonspacing_Mark'],\n\t\t['N', 'Number'],\n\t\t['Nd', 'Decimal_Number'],\n\t\t['digit', 'Decimal_Number'],\n\t\t['Nl', 'Letter_Number'],\n\t\t['No', 'Other_Number'],\n\t\t['P', 'Punctuation'],\n\t\t['punct', 'Punctuation'],\n\t\t['Pc', 'Connector_Punctuation'],\n\t\t['Pd', 'Dash_Punctuation'],\n\t\t['Pe', 'Close_Punctuation'],\n\t\t['Pf', 'Final_Punctuation'],\n\t\t['Pi', 'Initial_Punctuation'],\n\t\t['Po', 'Other_Punctuation'],\n\t\t['Ps', 'Open_Punctuation'],\n\t\t['S', 'Symbol'],\n\t\t['Sc', 'Currency_Symbol'],\n\t\t['Sk', 'Modifier_Symbol'],\n\t\t['Sm', 'Math_Symbol'],\n\t\t['So', 'Other_Symbol'],\n\t\t['Z', 'Separator'],\n\t\t['Zl', 'Line_Separator'],\n\t\t['Zp', 'Paragraph_Separator'],\n\t\t['Zs', 'Space_Separator'],\n\t\t['Other', 'Other'],\n\t\t['Control', 'Control'],\n\t\t['Format', 'Format'],\n\t\t['Unassigned', 'Unassigned'],\n\t\t['Private_Use', 'Private_Use'],\n\t\t['Surrogate', 'Surrogate'],\n\t\t['Letter', 'Letter'],\n\t\t['Cased_Letter', 'Cased_Letter'],\n\t\t['Lowercase_Letter', 'Lowercase_Letter'],\n\t\t['Modifier_Letter', 'Modifier_Letter'],\n\t\t['Other_Letter', 'Other_Letter'],\n\t\t['Titlecase_Letter', 'Titlecase_Letter'],\n\t\t['Uppercase_Letter', 'Uppercase_Letter'],\n\t\t['Mark', 'Mark'],\n\t\t['Spacing_Mark', 'Spacing_Mark'],\n\t\t['Enclosing_Mark', 'Enclosing_Mark'],\n\t\t['Nonspacing_Mark', 'Nonspacing_Mark'],\n\t\t['Number', 'Number'],\n\t\t['Decimal_Number', 'Decimal_Number'],\n\t\t['Letter_Number', 'Letter_Number'],\n\t\t['Other_Number', 'Other_Number'],\n\t\t['Punctuation', 'Punctuation'],\n\t\t['Connector_Punctuation', 'Connector_Punctuation'],\n\t\t['Dash_Punctuation', 'Dash_Punctuation'],\n\t\t['Close_Punctuation', 'Close_Punctuation'],\n\t\t['Final_Punctuation', 'Final_Punctuation'],\n\t\t['Initial_Punctuation', 'Initial_Punctuation'],\n\t\t['Other_Punctuation', 'Other_Punctuation'],\n\t\t['Open_Punctuation', 'Open_Punctuation'],\n\t\t['Symbol', 'Symbol'],\n\t\t['Currency_Symbol', 'Currency_Symbol'],\n\t\t['Modifier_Symbol', 'Modifier_Symbol'],\n\t\t['Math_Symbol', 'Math_Symbol'],\n\t\t['Other_Symbol', 'Other_Symbol'],\n\t\t['Separator', 'Separator'],\n\t\t['Line_Separator', 'Line_Separator'],\n\t\t['Paragraph_Separator', 'Paragraph_Separator'],\n\t\t['Space_Separator', 'Space_Separator']\n\t])],\n\t['Script', new Map([\n\t\t['Adlm', 'Adlam'],\n\t\t['Aghb', 'Caucasian_Albanian'],\n\t\t['Ahom', 'Ahom'],\n\t\t['Arab', 'Arabic'],\n\t\t['Armi', 'Imperial_Aramaic'],\n\t\t['Armn', 'Armenian'],\n\t\t['Avst', 'Avestan'],\n\t\t['Bali', 'Balinese'],\n\t\t['Bamu', 'Bamum'],\n\t\t['Bass', 'Bassa_Vah'],\n\t\t['Batk', 'Batak'],\n\t\t['Beng', 'Bengali'],\n\t\t['Bhks', 'Bhaiksuki'],\n\t\t['Bopo', 'Bopomofo'],\n\t\t['Brah', 'Brahmi'],\n\t\t['Brai', 'Braille'],\n\t\t['Bugi', 'Buginese'],\n\t\t['Buhd', 'Buhid'],\n\t\t['Cakm', 'Chakma'],\n\t\t['Cans', 'Canadian_Aboriginal'],\n\t\t['Cari', 'Carian'],\n\t\t['Cham', 'Cham'],\n\t\t['Cher', 'Cherokee'],\n\t\t['Copt', 'Coptic'],\n\t\t['Qaac', 'Coptic'],\n\t\t['Cprt', 'Cypriot'],\n\t\t['Cyrl', 'Cyrillic'],\n\t\t['Deva', 'Devanagari'],\n\t\t['Dogr', 'Dogra'],\n\t\t['Dsrt', 'Deseret'],\n\t\t['Dupl', 'Duployan'],\n\t\t['Egyp', 'Egyptian_Hieroglyphs'],\n\t\t['Elba', 'Elbasan'],\n\t\t['Elym', 'Elymaic'],\n\t\t['Ethi', 'Ethiopic'],\n\t\t['Geor', 'Georgian'],\n\t\t['Glag', 'Glagolitic'],\n\t\t['Gong', 'Gunjala_Gondi'],\n\t\t['Gonm', 'Masaram_Gondi'],\n\t\t['Goth', 'Gothic'],\n\t\t['Gran', 'Grantha'],\n\t\t['Grek', 'Greek'],\n\t\t['Gujr', 'Gujarati'],\n\t\t['Guru', 'Gurmukhi'],\n\t\t['Hang', 'Hangul'],\n\t\t['Hani', 'Han'],\n\t\t['Hano', 'Hanunoo'],\n\t\t['Hatr', 'Hatran'],\n\t\t['Hebr', 'Hebrew'],\n\t\t['Hira', 'Hiragana'],\n\t\t['Hluw', 'Anatolian_Hieroglyphs'],\n\t\t['Hmng', 'Pahawh_Hmong'],\n\t\t['Hmnp', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Hrkt', 'Katakana_Or_Hiragana'],\n\t\t['Hung', 'Old_Hungarian'],\n\t\t['Ital', 'Old_Italic'],\n\t\t['Java', 'Javanese'],\n\t\t['Kali', 'Kayah_Li'],\n\t\t['Kana', 'Katakana'],\n\t\t['Khar', 'Kharoshthi'],\n\t\t['Khmr', 'Khmer'],\n\t\t['Khoj', 'Khojki'],\n\t\t['Knda', 'Kannada'],\n\t\t['Kthi', 'Kaithi'],\n\t\t['Lana', 'Tai_Tham'],\n\t\t['Laoo', 'Lao'],\n\t\t['Latn', 'Latin'],\n\t\t['Lepc', 'Lepcha'],\n\t\t['Limb', 'Limbu'],\n\t\t['Lina', 'Linear_A'],\n\t\t['Linb', 'Linear_B'],\n\t\t['Lisu', 'Lisu'],\n\t\t['Lyci', 'Lycian'],\n\t\t['Lydi', 'Lydian'],\n\t\t['Mahj', 'Mahajani'],\n\t\t['Maka', 'Makasar'],\n\t\t['Mand', 'Mandaic'],\n\t\t['Mani', 'Manichaean'],\n\t\t['Marc', 'Marchen'],\n\t\t['Medf', 'Medefaidrin'],\n\t\t['Mend', 'Mende_Kikakui'],\n\t\t['Merc', 'Meroitic_Cursive'],\n\t\t['Mero', 'Meroitic_Hieroglyphs'],\n\t\t['Mlym', 'Malayalam'],\n\t\t['Modi', 'Modi'],\n\t\t['Mong', 'Mongolian'],\n\t\t['Mroo', 'Mro'],\n\t\t['Mtei', 'Meetei_Mayek'],\n\t\t['Mult', 'Multani'],\n\t\t['Mymr', 'Myanmar'],\n\t\t['Nand', 'Nandinagari'],\n\t\t['Narb', 'Old_North_Arabian'],\n\t\t['Nbat', 'Nabataean'],\n\t\t['Newa', 'Newa'],\n\t\t['Nkoo', 'Nko'],\n\t\t['Nshu', 'Nushu'],\n\t\t['Ogam', 'Ogham'],\n\t\t['Olck', 'Ol_Chiki'],\n\t\t['Orkh', 'Old_Turkic'],\n\t\t['Orya', 'Oriya'],\n\t\t['Osge', 'Osage'],\n\t\t['Osma', 'Osmanya'],\n\t\t['Palm', 'Palmyrene'],\n\t\t['Pauc', 'Pau_Cin_Hau'],\n\t\t['Perm', 'Old_Permic'],\n\t\t['Phag', 'Phags_Pa'],\n\t\t['Phli', 'Inscriptional_Pahlavi'],\n\t\t['Phlp', 'Psalter_Pahlavi'],\n\t\t['Phnx', 'Phoenician'],\n\t\t['Plrd', 'Miao'],\n\t\t['Prti', 'Inscriptional_Parthian'],\n\t\t['Rjng', 'Rejang'],\n\t\t['Rohg', 'Hanifi_Rohingya'],\n\t\t['Runr', 'Runic'],\n\t\t['Samr', 'Samaritan'],\n\t\t['Sarb', 'Old_South_Arabian'],\n\t\t['Saur', 'Saurashtra'],\n\t\t['Sgnw', 'SignWriting'],\n\t\t['Shaw', 'Shavian'],\n\t\t['Shrd', 'Sharada'],\n\t\t['Sidd', 'Siddham'],\n\t\t['Sind', 'Khudawadi'],\n\t\t['Sinh', 'Sinhala'],\n\t\t['Sogd', 'Sogdian'],\n\t\t['Sogo', 'Old_Sogdian'],\n\t\t['Sora', 'Sora_Sompeng'],\n\t\t['Soyo', 'Soyombo'],\n\t\t['Sund', 'Sundanese'],\n\t\t['Sylo', 'Syloti_Nagri'],\n\t\t['Syrc', 'Syriac'],\n\t\t['Tagb', 'Tagbanwa'],\n\t\t['Takr', 'Takri'],\n\t\t['Tale', 'Tai_Le'],\n\t\t['Talu', 'New_Tai_Lue'],\n\t\t['Taml', 'Tamil'],\n\t\t['Tang', 'Tangut'],\n\t\t['Tavt', 'Tai_Viet'],\n\t\t['Telu', 'Telugu'],\n\t\t['Tfng', 'Tifinagh'],\n\t\t['Tglg', 'Tagalog'],\n\t\t['Thaa', 'Thaana'],\n\t\t['Thai', 'Thai'],\n\t\t['Tibt', 'Tibetan'],\n\t\t['Tirh', 'Tirhuta'],\n\t\t['Ugar', 'Ugaritic'],\n\t\t['Vaii', 'Vai'],\n\t\t['Wara', 'Warang_Citi'],\n\t\t['Wcho', 'Wancho'],\n\t\t['Xpeo', 'Old_Persian'],\n\t\t['Xsux', 'Cuneiform'],\n\t\t['Yiii', 'Yi'],\n\t\t['Zanb', 'Zanabazar_Square'],\n\t\t['Zinh', 'Inherited'],\n\t\t['Qaai', 'Inherited'],\n\t\t['Zyyy', 'Common'],\n\t\t['Zzzz', 'Unknown'],\n\t\t['Adlam', 'Adlam'],\n\t\t['Caucasian_Albanian', 'Caucasian_Albanian'],\n\t\t['Arabic', 'Arabic'],\n\t\t['Imperial_Aramaic', 'Imperial_Aramaic'],\n\t\t['Armenian', 'Armenian'],\n\t\t['Avestan', 'Avestan'],\n\t\t['Balinese', 'Balinese'],\n\t\t['Bamum', 'Bamum'],\n\t\t['Bassa_Vah', 'Bassa_Vah'],\n\t\t['Batak', 'Batak'],\n\t\t['Bengali', 'Bengali'],\n\t\t['Bhaiksuki', 'Bhaiksuki'],\n\t\t['Bopomofo', 'Bopomofo'],\n\t\t['Brahmi', 'Brahmi'],\n\t\t['Braille', 'Braille'],\n\t\t['Buginese', 'Buginese'],\n\t\t['Buhid', 'Buhid'],\n\t\t['Chakma', 'Chakma'],\n\t\t['Canadian_Aboriginal', 'Canadian_Aboriginal'],\n\t\t['Carian', 'Carian'],\n\t\t['Cherokee', 'Cherokee'],\n\t\t['Coptic', 'Coptic'],\n\t\t['Cypriot', 'Cypriot'],\n\t\t['Cyrillic', 'Cyrillic'],\n\t\t['Devanagari', 'Devanagari'],\n\t\t['Dogra', 'Dogra'],\n\t\t['Deseret', 'Deseret'],\n\t\t['Duployan', 'Duployan'],\n\t\t['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'],\n\t\t['Elbasan', 'Elbasan'],\n\t\t['Elymaic', 'Elymaic'],\n\t\t['Ethiopic', 'Ethiopic'],\n\t\t['Georgian', 'Georgian'],\n\t\t['Glagolitic', 'Glagolitic'],\n\t\t['Gunjala_Gondi', 'Gunjala_Gondi'],\n\t\t['Masaram_Gondi', 'Masaram_Gondi'],\n\t\t['Gothic', 'Gothic'],\n\t\t['Grantha', 'Grantha'],\n\t\t['Greek', 'Greek'],\n\t\t['Gujarati', 'Gujarati'],\n\t\t['Gurmukhi', 'Gurmukhi'],\n\t\t['Hangul', 'Hangul'],\n\t\t['Han', 'Han'],\n\t\t['Hanunoo', 'Hanunoo'],\n\t\t['Hatran', 'Hatran'],\n\t\t['Hebrew', 'Hebrew'],\n\t\t['Hiragana', 'Hiragana'],\n\t\t['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'],\n\t\t['Pahawh_Hmong', 'Pahawh_Hmong'],\n\t\t['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'],\n\t\t['Old_Hungarian', 'Old_Hungarian'],\n\t\t['Old_Italic', 'Old_Italic'],\n\t\t['Javanese', 'Javanese'],\n\t\t['Kayah_Li', 'Kayah_Li'],\n\t\t['Katakana', 'Katakana'],\n\t\t['Kharoshthi', 'Kharoshthi'],\n\t\t['Khmer', 'Khmer'],\n\t\t['Khojki', 'Khojki'],\n\t\t['Kannada', 'Kannada'],\n\t\t['Kaithi', 'Kaithi'],\n\t\t['Tai_Tham', 'Tai_Tham'],\n\t\t['Lao', 'Lao'],\n\t\t['Latin', 'Latin'],\n\t\t['Lepcha', 'Lepcha'],\n\t\t['Limbu', 'Limbu'],\n\t\t['Linear_A', 'Linear_A'],\n\t\t['Linear_B', 'Linear_B'],\n\t\t['Lycian', 'Lycian'],\n\t\t['Lydian', 'Lydian'],\n\t\t['Mahajani', 'Mahajani'],\n\t\t['Makasar', 'Makasar'],\n\t\t['Mandaic', 'Mandaic'],\n\t\t['Manichaean', 'Manichaean'],\n\t\t['Marchen', 'Marchen'],\n\t\t['Medefaidrin', 'Medefaidrin'],\n\t\t['Mende_Kikakui', 'Mende_Kikakui'],\n\t\t['Meroitic_Cursive', 'Meroitic_Cursive'],\n\t\t['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'],\n\t\t['Malayalam', 'Malayalam'],\n\t\t['Mongolian', 'Mongolian'],\n\t\t['Mro', 'Mro'],\n\t\t['Meetei_Mayek', 'Meetei_Mayek'],\n\t\t['Multani', 'Multani'],\n\t\t['Myanmar', 'Myanmar'],\n\t\t['Nandinagari', 'Nandinagari'],\n\t\t['Old_North_Arabian', 'Old_North_Arabian'],\n\t\t['Nabataean', 'Nabataean'],\n\t\t['Nko', 'Nko'],\n\t\t['Nushu', 'Nushu'],\n\t\t['Ogham', 'Ogham'],\n\t\t['Ol_Chiki', 'Ol_Chiki'],\n\t\t['Old_Turkic', 'Old_Turkic'],\n\t\t['Oriya', 'Oriya'],\n\t\t['Osage', 'Osage'],\n\t\t['Osmanya', 'Osmanya'],\n\t\t['Palmyrene', 'Palmyrene'],\n\t\t['Pau_Cin_Hau', 'Pau_Cin_Hau'],\n\t\t['Old_Permic', 'Old_Permic'],\n\t\t['Phags_Pa', 'Phags_Pa'],\n\t\t['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'],\n\t\t['Psalter_Pahlavi', 'Psalter_Pahlavi'],\n\t\t['Phoenician', 'Phoenician'],\n\t\t['Miao', 'Miao'],\n\t\t['Inscriptional_Parthian', 'Inscriptional_Parthian'],\n\t\t['Rejang', 'Rejang'],\n\t\t['Hanifi_Rohingya', 'Hanifi_Rohingya'],\n\t\t['Runic', 'Runic'],\n\t\t['Samaritan', 'Samaritan'],\n\t\t['Old_South_Arabian', 'Old_South_Arabian'],\n\t\t['Saurashtra', 'Saurashtra'],\n\t\t['SignWriting', 'SignWriting'],\n\t\t['Shavian', 'Shavian'],\n\t\t['Sharada', 'Sharada'],\n\t\t['Siddham', 'Siddham'],\n\t\t['Khudawadi', 'Khudawadi'],\n\t\t['Sinhala', 'Sinhala'],\n\t\t['Sogdian', 'Sogdian'],\n\t\t['Old_Sogdian', 'Old_Sogdian'],\n\t\t['Sora_Sompeng', 'Sora_Sompeng'],\n\t\t['Soyombo', 'Soyombo'],\n\t\t['Sundanese', 'Sundanese'],\n\t\t['Syloti_Nagri', 'Syloti_Nagri'],\n\t\t['Syriac', 'Syriac'],\n\t\t['Tagbanwa', 'Tagbanwa'],\n\t\t['Takri', 'Takri'],\n\t\t['Tai_Le', 'Tai_Le'],\n\t\t['New_Tai_Lue', 'New_Tai_Lue'],\n\t\t['Tamil', 'Tamil'],\n\t\t['Tangut', 'Tangut'],\n\t\t['Tai_Viet', 'Tai_Viet'],\n\t\t['Telugu', 'Telugu'],\n\t\t['Tifinagh', 'Tifinagh'],\n\t\t['Tagalog', 'Tagalog'],\n\t\t['Thaana', 'Thaana'],\n\t\t['Tibetan', 'Tibetan'],\n\t\t['Tirhuta', 'Tirhuta'],\n\t\t['Ugaritic', 'Ugaritic'],\n\t\t['Vai', 'Vai'],\n\t\t['Warang_Citi', 'Warang_Citi'],\n\t\t['Wancho', 'Wancho'],\n\t\t['Old_Persian', 'Old_Persian'],\n\t\t['Cuneiform', 'Cuneiform'],\n\t\t['Yi', 'Yi'],\n\t\t['Zanabazar_Square', 'Zanabazar_Square'],\n\t\t['Inherited', 'Inherited'],\n\t\t['Common', 'Common'],\n\t\t['Unknown', 'Unknown']\n\t])],\n\t['Script_Extensions', new Map([\n\t\t['Adlm', 'Adlam'],\n\t\t['Aghb', 'Caucasian_Albanian'],\n\t\t['Ahom', 'Ahom'],\n\t\t['Arab', 'Arabic'],\n\t\t['Armi', 'Imperial_Aramaic'],\n\t\t['Armn', 'Armenian'],\n\t\t['Avst', 'Avestan'],\n\t\t['Bali', 'Balinese'],\n\t\t['Bamu', 'Bamum'],\n\t\t['Bass', 'Bassa_Vah'],\n\t\t['Batk', 'Batak'],\n\t\t['Beng', 'Bengali'],\n\t\t['Bhks', 'Bhaiksuki'],\n\t\t['Bopo', 'Bopomofo'],\n\t\t['Brah', 'Brahmi'],\n\t\t['Brai', 'Braille'],\n\t\t['Bugi', 'Buginese'],\n\t\t['Buhd', 'Buhid'],\n\t\t['Cakm', 'Chakma'],\n\t\t['Cans', 'Canadian_Aboriginal'],\n\t\t['Cari', 'Carian'],\n\t\t['Cham', 'Cham'],\n\t\t['Cher', 'Cherokee'],\n\t\t['Copt', 'Coptic'],\n\t\t['Qaac', 'Coptic'],\n\t\t['Cprt', 'Cypriot'],\n\t\t['Cyrl', 'Cyrillic'],\n\t\t['Deva', 'Devanagari'],\n\t\t['Dogr', 'Dogra'],\n\t\t['Dsrt', 'Deseret'],\n\t\t['Dupl', 'Duployan'],\n\t\t['Egyp', 'Egyptian_Hieroglyphs'],\n\t\t['Elba', 'Elbasan'],\n\t\t['Elym', 'Elymaic'],\n\t\t['Ethi', 'Ethiopic'],\n\t\t['Geor', 'Georgian'],\n\t\t['Glag', 'Glagolitic'],\n\t\t['Gong', 'Gunjala_Gondi'],\n\t\t['Gonm', 'Masaram_Gondi'],\n\t\t['Goth', 'Gothic'],\n\t\t['Gran', 'Grantha'],\n\t\t['Grek', 'Greek'],\n\t\t['Gujr', 'Gujarati'],\n\t\t['Guru', 'Gurmukhi'],\n\t\t['Hang', 'Hangul'],\n\t\t['Hani', 'Han'],\n\t\t['Hano', 'Hanunoo'],\n\t\t['Hatr', 'Hatran'],\n\t\t['Hebr', 'Hebrew'],\n\t\t['Hira', 'Hiragana'],\n\t\t['Hluw', 'Anatolian_Hieroglyphs'],\n\t\t['Hmng', 'Pahawh_Hmong'],\n\t\t['Hmnp', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Hrkt', 'Katakana_Or_Hiragana'],\n\t\t['Hung', 'Old_Hungarian'],\n\t\t['Ital', 'Old_Italic'],\n\t\t['Java', 'Javanese'],\n\t\t['Kali', 'Kayah_Li'],\n\t\t['Kana', 'Katakana'],\n\t\t['Khar', 'Kharoshthi'],\n\t\t['Khmr', 'Khmer'],\n\t\t['Khoj', 'Khojki'],\n\t\t['Knda', 'Kannada'],\n\t\t['Kthi', 'Kaithi'],\n\t\t['Lana', 'Tai_Tham'],\n\t\t['Laoo', 'Lao'],\n\t\t['Latn', 'Latin'],\n\t\t['Lepc', 'Lepcha'],\n\t\t['Limb', 'Limbu'],\n\t\t['Lina', 'Linear_A'],\n\t\t['Linb', 'Linear_B'],\n\t\t['Lisu', 'Lisu'],\n\t\t['Lyci', 'Lycian'],\n\t\t['Lydi', 'Lydian'],\n\t\t['Mahj', 'Mahajani'],\n\t\t['Maka', 'Makasar'],\n\t\t['Mand', 'Mandaic'],\n\t\t['Mani', 'Manichaean'],\n\t\t['Marc', 'Marchen'],\n\t\t['Medf', 'Medefaidrin'],\n\t\t['Mend', 'Mende_Kikakui'],\n\t\t['Merc', 'Meroitic_Cursive'],\n\t\t['Mero', 'Meroitic_Hieroglyphs'],\n\t\t['Mlym', 'Malayalam'],\n\t\t['Modi', 'Modi'],\n\t\t['Mong', 'Mongolian'],\n\t\t['Mroo', 'Mro'],\n\t\t['Mtei', 'Meetei_Mayek'],\n\t\t['Mult', 'Multani'],\n\t\t['Mymr', 'Myanmar'],\n\t\t['Nand', 'Nandinagari'],\n\t\t['Narb', 'Old_North_Arabian'],\n\t\t['Nbat', 'Nabataean'],\n\t\t['Newa', 'Newa'],\n\t\t['Nkoo', 'Nko'],\n\t\t['Nshu', 'Nushu'],\n\t\t['Ogam', 'Ogham'],\n\t\t['Olck', 'Ol_Chiki'],\n\t\t['Orkh', 'Old_Turkic'],\n\t\t['Orya', 'Oriya'],\n\t\t['Osge', 'Osage'],\n\t\t['Osma', 'Osmanya'],\n\t\t['Palm', 'Palmyrene'],\n\t\t['Pauc', 'Pau_Cin_Hau'],\n\t\t['Perm', 'Old_Permic'],\n\t\t['Phag', 'Phags_Pa'],\n\t\t['Phli', 'Inscriptional_Pahlavi'],\n\t\t['Phlp', 'Psalter_Pahlavi'],\n\t\t['Phnx', 'Phoenician'],\n\t\t['Plrd', 'Miao'],\n\t\t['Prti', 'Inscriptional_Parthian'],\n\t\t['Rjng', 'Rejang'],\n\t\t['Rohg', 'Hanifi_Rohingya'],\n\t\t['Runr', 'Runic'],\n\t\t['Samr', 'Samaritan'],\n\t\t['Sarb', 'Old_South_Arabian'],\n\t\t['Saur', 'Saurashtra'],\n\t\t['Sgnw', 'SignWriting'],\n\t\t['Shaw', 'Shavian'],\n\t\t['Shrd', 'Sharada'],\n\t\t['Sidd', 'Siddham'],\n\t\t['Sind', 'Khudawadi'],\n\t\t['Sinh', 'Sinhala'],\n\t\t['Sogd', 'Sogdian'],\n\t\t['Sogo', 'Old_Sogdian'],\n\t\t['Sora', 'Sora_Sompeng'],\n\t\t['Soyo', 'Soyombo'],\n\t\t['Sund', 'Sundanese'],\n\t\t['Sylo', 'Syloti_Nagri'],\n\t\t['Syrc', 'Syriac'],\n\t\t['Tagb', 'Tagbanwa'],\n\t\t['Takr', 'Takri'],\n\t\t['Tale', 'Tai_Le'],\n\t\t['Talu', 'New_Tai_Lue'],\n\t\t['Taml', 'Tamil'],\n\t\t['Tang', 'Tangut'],\n\t\t['Tavt', 'Tai_Viet'],\n\t\t['Telu', 'Telugu'],\n\t\t['Tfng', 'Tifinagh'],\n\t\t['Tglg', 'Tagalog'],\n\t\t['Thaa', 'Thaana'],\n\t\t['Thai', 'Thai'],\n\t\t['Tibt', 'Tibetan'],\n\t\t['Tirh', 'Tirhuta'],\n\t\t['Ugar', 'Ugaritic'],\n\t\t['Vaii', 'Vai'],\n\t\t['Wara', 'Warang_Citi'],\n\t\t['Wcho', 'Wancho'],\n\t\t['Xpeo', 'Old_Persian'],\n\t\t['Xsux', 'Cuneiform'],\n\t\t['Yiii', 'Yi'],\n\t\t['Zanb', 'Zanabazar_Square'],\n\t\t['Zinh', 'Inherited'],\n\t\t['Qaai', 'Inherited'],\n\t\t['Zyyy', 'Common'],\n\t\t['Zzzz', 'Unknown'],\n\t\t['Adlam', 'Adlam'],\n\t\t['Caucasian_Albanian', 'Caucasian_Albanian'],\n\t\t['Arabic', 'Arabic'],\n\t\t['Imperial_Aramaic', 'Imperial_Aramaic'],\n\t\t['Armenian', 'Armenian'],\n\t\t['Avestan', 'Avestan'],\n\t\t['Balinese', 'Balinese'],\n\t\t['Bamum', 'Bamum'],\n\t\t['Bassa_Vah', 'Bassa_Vah'],\n\t\t['Batak', 'Batak'],\n\t\t['Bengali', 'Bengali'],\n\t\t['Bhaiksuki', 'Bhaiksuki'],\n\t\t['Bopomofo', 'Bopomofo'],\n\t\t['Brahmi', 'Brahmi'],\n\t\t['Braille', 'Braille'],\n\t\t['Buginese', 'Buginese'],\n\t\t['Buhid', 'Buhid'],\n\t\t['Chakma', 'Chakma'],\n\t\t['Canadian_Aboriginal', 'Canadian_Aboriginal'],\n\t\t['Carian', 'Carian'],\n\t\t['Cherokee', 'Cherokee'],\n\t\t['Coptic', 'Coptic'],\n\t\t['Cypriot', 'Cypriot'],\n\t\t['Cyrillic', 'Cyrillic'],\n\t\t['Devanagari', 'Devanagari'],\n\t\t['Dogra', 'Dogra'],\n\t\t['Deseret', 'Deseret'],\n\t\t['Duployan', 'Duployan'],\n\t\t['Egyptian_Hieroglyphs', 'Egyptian_Hieroglyphs'],\n\t\t['Elbasan', 'Elbasan'],\n\t\t['Elymaic', 'Elymaic'],\n\t\t['Ethiopic', 'Ethiopic'],\n\t\t['Georgian', 'Georgian'],\n\t\t['Glagolitic', 'Glagolitic'],\n\t\t['Gunjala_Gondi', 'Gunjala_Gondi'],\n\t\t['Masaram_Gondi', 'Masaram_Gondi'],\n\t\t['Gothic', 'Gothic'],\n\t\t['Grantha', 'Grantha'],\n\t\t['Greek', 'Greek'],\n\t\t['Gujarati', 'Gujarati'],\n\t\t['Gurmukhi', 'Gurmukhi'],\n\t\t['Hangul', 'Hangul'],\n\t\t['Han', 'Han'],\n\t\t['Hanunoo', 'Hanunoo'],\n\t\t['Hatran', 'Hatran'],\n\t\t['Hebrew', 'Hebrew'],\n\t\t['Hiragana', 'Hiragana'],\n\t\t['Anatolian_Hieroglyphs', 'Anatolian_Hieroglyphs'],\n\t\t['Pahawh_Hmong', 'Pahawh_Hmong'],\n\t\t['Nyiakeng_Puachue_Hmong', 'Nyiakeng_Puachue_Hmong'],\n\t\t['Katakana_Or_Hiragana', 'Katakana_Or_Hiragana'],\n\t\t['Old_Hungarian', 'Old_Hungarian'],\n\t\t['Old_Italic', 'Old_Italic'],\n\t\t['Javanese', 'Javanese'],\n\t\t['Kayah_Li', 'Kayah_Li'],\n\t\t['Katakana', 'Katakana'],\n\t\t['Kharoshthi', 'Kharoshthi'],\n\t\t['Khmer', 'Khmer'],\n\t\t['Khojki', 'Khojki'],\n\t\t['Kannada', 'Kannada'],\n\t\t['Kaithi', 'Kaithi'],\n\t\t['Tai_Tham', 'Tai_Tham'],\n\t\t['Lao', 'Lao'],\n\t\t['Latin', 'Latin'],\n\t\t['Lepcha', 'Lepcha'],\n\t\t['Limbu', 'Limbu'],\n\t\t['Linear_A', 'Linear_A'],\n\t\t['Linear_B', 'Linear_B'],\n\t\t['Lycian', 'Lycian'],\n\t\t['Lydian', 'Lydian'],\n\t\t['Mahajani', 'Mahajani'],\n\t\t['Makasar', 'Makasar'],\n\t\t['Mandaic', 'Mandaic'],\n\t\t['Manichaean', 'Manichaean'],\n\t\t['Marchen', 'Marchen'],\n\t\t['Medefaidrin', 'Medefaidrin'],\n\t\t['Mende_Kikakui', 'Mende_Kikakui'],\n\t\t['Meroitic_Cursive', 'Meroitic_Cursive'],\n\t\t['Meroitic_Hieroglyphs', 'Meroitic_Hieroglyphs'],\n\t\t['Malayalam', 'Malayalam'],\n\t\t['Mongolian', 'Mongolian'],\n\t\t['Mro', 'Mro'],\n\t\t['Meetei_Mayek', 'Meetei_Mayek'],\n\t\t['Multani', 'Multani'],\n\t\t['Myanmar', 'Myanmar'],\n\t\t['Nandinagari', 'Nandinagari'],\n\t\t['Old_North_Arabian', 'Old_North_Arabian'],\n\t\t['Nabataean', 'Nabataean'],\n\t\t['Nko', 'Nko'],\n\t\t['Nushu', 'Nushu'],\n\t\t['Ogham', 'Ogham'],\n\t\t['Ol_Chiki', 'Ol_Chiki'],\n\t\t['Old_Turkic', 'Old_Turkic'],\n\t\t['Oriya', 'Oriya'],\n\t\t['Osage', 'Osage'],\n\t\t['Osmanya', 'Osmanya'],\n\t\t['Palmyrene', 'Palmyrene'],\n\t\t['Pau_Cin_Hau', 'Pau_Cin_Hau'],\n\t\t['Old_Permic', 'Old_Permic'],\n\t\t['Phags_Pa', 'Phags_Pa'],\n\t\t['Inscriptional_Pahlavi', 'Inscriptional_Pahlavi'],\n\t\t['Psalter_Pahlavi', 'Psalter_Pahlavi'],\n\t\t['Phoenician', 'Phoenician'],\n\t\t['Miao', 'Miao'],\n\t\t['Inscriptional_Parthian', 'Inscriptional_Parthian'],\n\t\t['Rejang', 'Rejang'],\n\t\t['Hanifi_Rohingya', 'Hanifi_Rohingya'],\n\t\t['Runic', 'Runic'],\n\t\t['Samaritan', 'Samaritan'],\n\t\t['Old_South_Arabian', 'Old_South_Arabian'],\n\t\t['Saurashtra', 'Saurashtra'],\n\t\t['SignWriting', 'SignWriting'],\n\t\t['Shavian', 'Shavian'],\n\t\t['Sharada', 'Sharada'],\n\t\t['Siddham', 'Siddham'],\n\t\t['Khudawadi', 'Khudawadi'],\n\t\t['Sinhala', 'Sinhala'],\n\t\t['Sogdian', 'Sogdian'],\n\t\t['Old_Sogdian', 'Old_Sogdian'],\n\t\t['Sora_Sompeng', 'Sora_Sompeng'],\n\t\t['Soyombo', 'Soyombo'],\n\t\t['Sundanese', 'Sundanese'],\n\t\t['Syloti_Nagri', 'Syloti_Nagri'],\n\t\t['Syriac', 'Syriac'],\n\t\t['Tagbanwa', 'Tagbanwa'],\n\t\t['Takri', 'Takri'],\n\t\t['Tai_Le', 'Tai_Le'],\n\t\t['New_Tai_Lue', 'New_Tai_Lue'],\n\t\t['Tamil', 'Tamil'],\n\t\t['Tangut', 'Tangut'],\n\t\t['Tai_Viet', 'Tai_Viet'],\n\t\t['Telugu', 'Telugu'],\n\t\t['Tifinagh', 'Tifinagh'],\n\t\t['Tagalog', 'Tagalog'],\n\t\t['Thaana', 'Thaana'],\n\t\t['Tibetan', 'Tibetan'],\n\t\t['Tirhuta', 'Tirhuta'],\n\t\t['Ugaritic', 'Ugaritic'],\n\t\t['Vai', 'Vai'],\n\t\t['Warang_Citi', 'Warang_Citi'],\n\t\t['Wancho', 'Wancho'],\n\t\t['Old_Persian', 'Old_Persian'],\n\t\t['Cuneiform', 'Cuneiform'],\n\t\t['Yi', 'Yi'],\n\t\t['Zanabazar_Square', 'Zanabazar_Square'],\n\t\t['Inherited', 'Inherited'],\n\t\t['Common', 'Common'],\n\t\t['Unknown', 'Unknown']\n\t])]\n]);\n","'use strict';\n\nconst propertyToValueAliases = require('./data/mappings.js');\n\nconst matchPropertyValue = function(property, value) {\n\tconst aliasToValue = propertyToValueAliases.get(property);\n\tif (!aliasToValue) {\n\t\tthrow new Error(`Unknown property \\`${ property }\\`.`);\n\t}\n\tconst canonicalValue = aliasToValue.get(value);\n\tif (canonicalValue) {\n\t\treturn canonicalValue;\n\t}\n\tthrow new Error(\n\t\t`Unknown value \\`${ value }\\` for property \\`${ property }\\`.`\n\t);\n};\n\nmodule.exports = matchPropertyValue;\n","module.exports = new Map([\n\t[0x4B, 0x212A],\n\t[0x53, 0x17F],\n\t[0x6B, 0x212A],\n\t[0x73, 0x17F],\n\t[0xB5, 0x39C],\n\t[0xC5, 0x212B],\n\t[0xDF, 0x1E9E],\n\t[0xE5, 0x212B],\n\t[0x17F, 0x53],\n\t[0x1C4, 0x1C5],\n\t[0x1C5, 0x1C4],\n\t[0x1C7, 0x1C8],\n\t[0x1C8, 0x1C7],\n\t[0x1CA, 0x1CB],\n\t[0x1CB, 0x1CA],\n\t[0x1F1, 0x1F2],\n\t[0x1F2, 0x1F1],\n\t[0x26A, 0xA7AE],\n\t[0x282, 0xA7C5],\n\t[0x29D, 0xA7B2],\n\t[0x345, 0x1FBE],\n\t[0x392, 0x3D0],\n\t[0x395, 0x3F5],\n\t[0x398, 0x3F4],\n\t[0x399, 0x1FBE],\n\t[0x39A, 0x3F0],\n\t[0x39C, 0xB5],\n\t[0x3A0, 0x3D6],\n\t[0x3A1, 0x3F1],\n\t[0x3A3, 0x3C2],\n\t[0x3A6, 0x3D5],\n\t[0x3A9, 0x2126],\n\t[0x3B8, 0x3F4],\n\t[0x3C2, 0x3A3],\n\t[0x3C9, 0x2126],\n\t[0x3D0, 0x392],\n\t[0x3D1, 0x3F4],\n\t[0x3D5, 0x3A6],\n\t[0x3D6, 0x3A0],\n\t[0x3F0, 0x39A],\n\t[0x3F1, 0x3A1],\n\t[0x3F4, [\n\t\t0x398,\n\t\t0x3D1,\n\t\t0x3B8\n\t]],\n\t[0x3F5, 0x395],\n\t[0x412, 0x1C80],\n\t[0x414, 0x1C81],\n\t[0x41E, 0x1C82],\n\t[0x421, 0x1C83],\n\t[0x422, 0x1C85],\n\t[0x42A, 0x1C86],\n\t[0x432, 0x1C80],\n\t[0x434, 0x1C81],\n\t[0x43E, 0x1C82],\n\t[0x441, 0x1C83],\n\t[0x442, [\n\t\t0x1C84,\n\t\t0x1C85\n\t]],\n\t[0x44A, 0x1C86],\n\t[0x462, 0x1C87],\n\t[0x463, 0x1C87],\n\t[0x10D0, 0x1C90],\n\t[0x10D1, 0x1C91],\n\t[0x10D2, 0x1C92],\n\t[0x10D3, 0x1C93],\n\t[0x10D4, 0x1C94],\n\t[0x10D5, 0x1C95],\n\t[0x10D6, 0x1C96],\n\t[0x10D7, 0x1C97],\n\t[0x10D8, 0x1C98],\n\t[0x10D9, 0x1C99],\n\t[0x10DA, 0x1C9A],\n\t[0x10DB, 0x1C9B],\n\t[0x10DC, 0x1C9C],\n\t[0x10DD, 0x1C9D],\n\t[0x10DE, 0x1C9E],\n\t[0x10DF, 0x1C9F],\n\t[0x10E0, 0x1CA0],\n\t[0x10E1, 0x1CA1],\n\t[0x10E2, 0x1CA2],\n\t[0x10E3, 0x1CA3],\n\t[0x10E4, 0x1CA4],\n\t[0x10E5, 0x1CA5],\n\t[0x10E6, 0x1CA6],\n\t[0x10E7, 0x1CA7],\n\t[0x10E8, 0x1CA8],\n\t[0x10E9, 0x1CA9],\n\t[0x10EA, 0x1CAA],\n\t[0x10EB, 0x1CAB],\n\t[0x10EC, 0x1CAC],\n\t[0x10ED, 0x1CAD],\n\t[0x10EE, 0x1CAE],\n\t[0x10EF, 0x1CAF],\n\t[0x10F0, 0x1CB0],\n\t[0x10F1, 0x1CB1],\n\t[0x10F2, 0x1CB2],\n\t[0x10F3, 0x1CB3],\n\t[0x10F4, 0x1CB4],\n\t[0x10F5, 0x1CB5],\n\t[0x10F6, 0x1CB6],\n\t[0x10F7, 0x1CB7],\n\t[0x10F8, 0x1CB8],\n\t[0x10F9, 0x1CB9],\n\t[0x10FA, 0x1CBA],\n\t[0x10FD, 0x1CBD],\n\t[0x10FE, 0x1CBE],\n\t[0x10FF, 0x1CBF],\n\t[0x13A0, 0xAB70],\n\t[0x13A1, 0xAB71],\n\t[0x13A2, 0xAB72],\n\t[0x13A3, 0xAB73],\n\t[0x13A4, 0xAB74],\n\t[0x13A5, 0xAB75],\n\t[0x13A6, 0xAB76],\n\t[0x13A7, 0xAB77],\n\t[0x13A8, 0xAB78],\n\t[0x13A9, 0xAB79],\n\t[0x13AA, 0xAB7A],\n\t[0x13AB, 0xAB7B],\n\t[0x13AC, 0xAB7C],\n\t[0x13AD, 0xAB7D],\n\t[0x13AE, 0xAB7E],\n\t[0x13AF, 0xAB7F],\n\t[0x13B0, 0xAB80],\n\t[0x13B1, 0xAB81],\n\t[0x13B2, 0xAB82],\n\t[0x13B3, 0xAB83],\n\t[0x13B4, 0xAB84],\n\t[0x13B5, 0xAB85],\n\t[0x13B6, 0xAB86],\n\t[0x13B7, 0xAB87],\n\t[0x13B8, 0xAB88],\n\t[0x13B9, 0xAB89],\n\t[0x13BA, 0xAB8A],\n\t[0x13BB, 0xAB8B],\n\t[0x13BC, 0xAB8C],\n\t[0x13BD, 0xAB8D],\n\t[0x13BE, 0xAB8E],\n\t[0x13BF, 0xAB8F],\n\t[0x13C0, 0xAB90],\n\t[0x13C1, 0xAB91],\n\t[0x13C2, 0xAB92],\n\t[0x13C3, 0xAB93],\n\t[0x13C4, 0xAB94],\n\t[0x13C5, 0xAB95],\n\t[0x13C6, 0xAB96],\n\t[0x13C7, 0xAB97],\n\t[0x13C8, 0xAB98],\n\t[0x13C9, 0xAB99],\n\t[0x13CA, 0xAB9A],\n\t[0x13CB, 0xAB9B],\n\t[0x13CC, 0xAB9C],\n\t[0x13CD, 0xAB9D],\n\t[0x13CE, 0xAB9E],\n\t[0x13CF, 0xAB9F],\n\t[0x13D0, 0xABA0],\n\t[0x13D1, 0xABA1],\n\t[0x13D2, 0xABA2],\n\t[0x13D3, 0xABA3],\n\t[0x13D4, 0xABA4],\n\t[0x13D5, 0xABA5],\n\t[0x13D6, 0xABA6],\n\t[0x13D7, 0xABA7],\n\t[0x13D8, 0xABA8],\n\t[0x13D9, 0xABA9],\n\t[0x13DA, 0xABAA],\n\t[0x13DB, 0xABAB],\n\t[0x13DC, 0xABAC],\n\t[0x13DD, 0xABAD],\n\t[0x13DE, 0xABAE],\n\t[0x13DF, 0xABAF],\n\t[0x13E0, 0xABB0],\n\t[0x13E1, 0xABB1],\n\t[0x13E2, 0xABB2],\n\t[0x13E3, 0xABB3],\n\t[0x13E4, 0xABB4],\n\t[0x13E5, 0xABB5],\n\t[0x13E6, 0xABB6],\n\t[0x13E7, 0xABB7],\n\t[0x13E8, 0xABB8],\n\t[0x13E9, 0xABB9],\n\t[0x13EA, 0xABBA],\n\t[0x13EB, 0xABBB],\n\t[0x13EC, 0xABBC],\n\t[0x13ED, 0xABBD],\n\t[0x13EE, 0xABBE],\n\t[0x13EF, 0xABBF],\n\t[0x13F0, 0x13F8],\n\t[0x13F1, 0x13F9],\n\t[0x13F2, 0x13FA],\n\t[0x13F3, 0x13FB],\n\t[0x13F4, 0x13FC],\n\t[0x13F5, 0x13FD],\n\t[0x13F8, 0x13F0],\n\t[0x13F9, 0x13F1],\n\t[0x13FA, 0x13F2],\n\t[0x13FB, 0x13F3],\n\t[0x13FC, 0x13F4],\n\t[0x13FD, 0x13F5],\n\t[0x1C80, [\n\t\t0x412,\n\t\t0x432\n\t]],\n\t[0x1C81, [\n\t\t0x414,\n\t\t0x434\n\t]],\n\t[0x1C82, [\n\t\t0x41E,\n\t\t0x43E\n\t]],\n\t[0x1C83, [\n\t\t0x421,\n\t\t0x441\n\t]],\n\t[0x1C84, [\n\t\t0x1C85,\n\t\t0x442\n\t]],\n\t[0x1C85, [\n\t\t0x422,\n\t\t0x1C84,\n\t\t0x442\n\t]],\n\t[0x1C86, [\n\t\t0x42A,\n\t\t0x44A\n\t]],\n\t[0x1C87, [\n\t\t0x462,\n\t\t0x463\n\t]],\n\t[0x1C88, [\n\t\t0xA64A,\n\t\t0xA64B\n\t]],\n\t[0x1C90, 0x10D0],\n\t[0x1C91, 0x10D1],\n\t[0x1C92, 0x10D2],\n\t[0x1C93, 0x10D3],\n\t[0x1C94, 0x10D4],\n\t[0x1C95, 0x10D5],\n\t[0x1C96, 0x10D6],\n\t[0x1C97, 0x10D7],\n\t[0x1C98, 0x10D8],\n\t[0x1C99, 0x10D9],\n\t[0x1C9A, 0x10DA],\n\t[0x1C9B, 0x10DB],\n\t[0x1C9C, 0x10DC],\n\t[0x1C9D, 0x10DD],\n\t[0x1C9E, 0x10DE],\n\t[0x1C9F, 0x10DF],\n\t[0x1CA0, 0x10E0],\n\t[0x1CA1, 0x10E1],\n\t[0x1CA2, 0x10E2],\n\t[0x1CA3, 0x10E3],\n\t[0x1CA4, 0x10E4],\n\t[0x1CA5, 0x10E5],\n\t[0x1CA6, 0x10E6],\n\t[0x1CA7, 0x10E7],\n\t[0x1CA8, 0x10E8],\n\t[0x1CA9, 0x10E9],\n\t[0x1CAA, 0x10EA],\n\t[0x1CAB, 0x10EB],\n\t[0x1CAC, 0x10EC],\n\t[0x1CAD, 0x10ED],\n\t[0x1CAE, 0x10EE],\n\t[0x1CAF, 0x10EF],\n\t[0x1CB0, 0x10F0],\n\t[0x1CB1, 0x10F1],\n\t[0x1CB2, 0x10F2],\n\t[0x1CB3, 0x10F3],\n\t[0x1CB4, 0x10F4],\n\t[0x1CB5, 0x10F5],\n\t[0x1CB6, 0x10F6],\n\t[0x1CB7, 0x10F7],\n\t[0x1CB8, 0x10F8],\n\t[0x1CB9, 0x10F9],\n\t[0x1CBA, 0x10FA],\n\t[0x1CBD, 0x10FD],\n\t[0x1CBE, 0x10FE],\n\t[0x1CBF, 0x10FF],\n\t[0x1D8E, 0xA7C6],\n\t[0x1E60, 0x1E9B],\n\t[0x1E9B, 0x1E60],\n\t[0x1E9E, 0xDF],\n\t[0x1F80, 0x1F88],\n\t[0x1F81, 0x1F89],\n\t[0x1F82, 0x1F8A],\n\t[0x1F83, 0x1F8B],\n\t[0x1F84, 0x1F8C],\n\t[0x1F85, 0x1F8D],\n\t[0x1F86, 0x1F8E],\n\t[0x1F87, 0x1F8F],\n\t[0x1F88, 0x1F80],\n\t[0x1F89, 0x1F81],\n\t[0x1F8A, 0x1F82],\n\t[0x1F8B, 0x1F83],\n\t[0x1F8C, 0x1F84],\n\t[0x1F8D, 0x1F85],\n\t[0x1F8E, 0x1F86],\n\t[0x1F8F, 0x1F87],\n\t[0x1F90, 0x1F98],\n\t[0x1F91, 0x1F99],\n\t[0x1F92, 0x1F9A],\n\t[0x1F93, 0x1F9B],\n\t[0x1F94, 0x1F9C],\n\t[0x1F95, 0x1F9D],\n\t[0x1F96, 0x1F9E],\n\t[0x1F97, 0x1F9F],\n\t[0x1F98, 0x1F90],\n\t[0x1F99, 0x1F91],\n\t[0x1F9A, 0x1F92],\n\t[0x1F9B, 0x1F93],\n\t[0x1F9C, 0x1F94],\n\t[0x1F9D, 0x1F95],\n\t[0x1F9E, 0x1F96],\n\t[0x1F9F, 0x1F97],\n\t[0x1FA0, 0x1FA8],\n\t[0x1FA1, 0x1FA9],\n\t[0x1FA2, 0x1FAA],\n\t[0x1FA3, 0x1FAB],\n\t[0x1FA4, 0x1FAC],\n\t[0x1FA5, 0x1FAD],\n\t[0x1FA6, 0x1FAE],\n\t[0x1FA7, 0x1FAF],\n\t[0x1FA8, 0x1FA0],\n\t[0x1FA9, 0x1FA1],\n\t[0x1FAA, 0x1FA2],\n\t[0x1FAB, 0x1FA3],\n\t[0x1FAC, 0x1FA4],\n\t[0x1FAD, 0x1FA5],\n\t[0x1FAE, 0x1FA6],\n\t[0x1FAF, 0x1FA7],\n\t[0x1FB3, 0x1FBC],\n\t[0x1FBC, 0x1FB3],\n\t[0x1FBE, [\n\t\t0x345,\n\t\t0x399\n\t]],\n\t[0x1FC3, 0x1FCC],\n\t[0x1FCC, 0x1FC3],\n\t[0x1FF3, 0x1FFC],\n\t[0x1FFC, 0x1FF3],\n\t[0x2126, [\n\t\t0x3A9,\n\t\t0x3C9\n\t]],\n\t[0x212A, 0x4B],\n\t[0x212B, [\n\t\t0xC5,\n\t\t0xE5\n\t]],\n\t[0xA64A, 0x1C88],\n\t[0xA64B, 0x1C88],\n\t[0xA794, 0xA7C4],\n\t[0xA7AE, 0x26A],\n\t[0xA7B2, 0x29D],\n\t[0xA7B3, 0xAB53],\n\t[0xA7B4, 0xA7B5],\n\t[0xA7B5, 0xA7B4],\n\t[0xA7B6, 0xA7B7],\n\t[0xA7B7, 0xA7B6],\n\t[0xA7B8, 0xA7B9],\n\t[0xA7B9, 0xA7B8],\n\t[0xA7BA, 0xA7BB],\n\t[0xA7BB, 0xA7BA],\n\t[0xA7BC, 0xA7BD],\n\t[0xA7BD, 0xA7BC],\n\t[0xA7BE, 0xA7BF],\n\t[0xA7BF, 0xA7BE],\n\t[0xA7C2, 0xA7C3],\n\t[0xA7C3, 0xA7C2],\n\t[0xA7C4, 0xA794],\n\t[0xA7C5, 0x282],\n\t[0xA7C6, 0x1D8E],\n\t[0xAB53, 0xA7B3],\n\t[0xAB70, 0x13A0],\n\t[0xAB71, 0x13A1],\n\t[0xAB72, 0x13A2],\n\t[0xAB73, 0x13A3],\n\t[0xAB74, 0x13A4],\n\t[0xAB75, 0x13A5],\n\t[0xAB76, 0x13A6],\n\t[0xAB77, 0x13A7],\n\t[0xAB78, 0x13A8],\n\t[0xAB79, 0x13A9],\n\t[0xAB7A, 0x13AA],\n\t[0xAB7B, 0x13AB],\n\t[0xAB7C, 0x13AC],\n\t[0xAB7D, 0x13AD],\n\t[0xAB7E, 0x13AE],\n\t[0xAB7F, 0x13AF],\n\t[0xAB80, 0x13B0],\n\t[0xAB81, 0x13B1],\n\t[0xAB82, 0x13B2],\n\t[0xAB83, 0x13B3],\n\t[0xAB84, 0x13B4],\n\t[0xAB85, 0x13B5],\n\t[0xAB86, 0x13B6],\n\t[0xAB87, 0x13B7],\n\t[0xAB88, 0x13B8],\n\t[0xAB89, 0x13B9],\n\t[0xAB8A, 0x13BA],\n\t[0xAB8B, 0x13BB],\n\t[0xAB8C, 0x13BC],\n\t[0xAB8D, 0x13BD],\n\t[0xAB8E, 0x13BE],\n\t[0xAB8F, 0x13BF],\n\t[0xAB90, 0x13C0],\n\t[0xAB91, 0x13C1],\n\t[0xAB92, 0x13C2],\n\t[0xAB93, 0x13C3],\n\t[0xAB94, 0x13C4],\n\t[0xAB95, 0x13C5],\n\t[0xAB96, 0x13C6],\n\t[0xAB97, 0x13C7],\n\t[0xAB98, 0x13C8],\n\t[0xAB99, 0x13C9],\n\t[0xAB9A, 0x13CA],\n\t[0xAB9B, 0x13CB],\n\t[0xAB9C, 0x13CC],\n\t[0xAB9D, 0x13CD],\n\t[0xAB9E, 0x13CE],\n\t[0xAB9F, 0x13CF],\n\t[0xABA0, 0x13D0],\n\t[0xABA1, 0x13D1],\n\t[0xABA2, 0x13D2],\n\t[0xABA3, 0x13D3],\n\t[0xABA4, 0x13D4],\n\t[0xABA5, 0x13D5],\n\t[0xABA6, 0x13D6],\n\t[0xABA7, 0x13D7],\n\t[0xABA8, 0x13D8],\n\t[0xABA9, 0x13D9],\n\t[0xABAA, 0x13DA],\n\t[0xABAB, 0x13DB],\n\t[0xABAC, 0x13DC],\n\t[0xABAD, 0x13DD],\n\t[0xABAE, 0x13DE],\n\t[0xABAF, 0x13DF],\n\t[0xABB0, 0x13E0],\n\t[0xABB1, 0x13E1],\n\t[0xABB2, 0x13E2],\n\t[0xABB3, 0x13E3],\n\t[0xABB4, 0x13E4],\n\t[0xABB5, 0x13E5],\n\t[0xABB6, 0x13E6],\n\t[0xABB7, 0x13E7],\n\t[0xABB8, 0x13E8],\n\t[0xABB9, 0x13E9],\n\t[0xABBA, 0x13EA],\n\t[0xABBB, 0x13EB],\n\t[0xABBC, 0x13EC],\n\t[0xABBD, 0x13ED],\n\t[0xABBE, 0x13EE],\n\t[0xABBF, 0x13EF],\n\t[0x10400, 0x10428],\n\t[0x10401, 0x10429],\n\t[0x10402, 0x1042A],\n\t[0x10403, 0x1042B],\n\t[0x10404, 0x1042C],\n\t[0x10405, 0x1042D],\n\t[0x10406, 0x1042E],\n\t[0x10407, 0x1042F],\n\t[0x10408, 0x10430],\n\t[0x10409, 0x10431],\n\t[0x1040A, 0x10432],\n\t[0x1040B, 0x10433],\n\t[0x1040C, 0x10434],\n\t[0x1040D, 0x10435],\n\t[0x1040E, 0x10436],\n\t[0x1040F, 0x10437],\n\t[0x10410, 0x10438],\n\t[0x10411, 0x10439],\n\t[0x10412, 0x1043A],\n\t[0x10413, 0x1043B],\n\t[0x10414, 0x1043C],\n\t[0x10415, 0x1043D],\n\t[0x10416, 0x1043E],\n\t[0x10417, 0x1043F],\n\t[0x10418, 0x10440],\n\t[0x10419, 0x10441],\n\t[0x1041A, 0x10442],\n\t[0x1041B, 0x10443],\n\t[0x1041C, 0x10444],\n\t[0x1041D, 0x10445],\n\t[0x1041E, 0x10446],\n\t[0x1041F, 0x10447],\n\t[0x10420, 0x10448],\n\t[0x10421, 0x10449],\n\t[0x10422, 0x1044A],\n\t[0x10423, 0x1044B],\n\t[0x10424, 0x1044C],\n\t[0x10425, 0x1044D],\n\t[0x10426, 0x1044E],\n\t[0x10427, 0x1044F],\n\t[0x10428, 0x10400],\n\t[0x10429, 0x10401],\n\t[0x1042A, 0x10402],\n\t[0x1042B, 0x10403],\n\t[0x1042C, 0x10404],\n\t[0x1042D, 0x10405],\n\t[0x1042E, 0x10406],\n\t[0x1042F, 0x10407],\n\t[0x10430, 0x10408],\n\t[0x10431, 0x10409],\n\t[0x10432, 0x1040A],\n\t[0x10433, 0x1040B],\n\t[0x10434, 0x1040C],\n\t[0x10435, 0x1040D],\n\t[0x10436, 0x1040E],\n\t[0x10437, 0x1040F],\n\t[0x10438, 0x10410],\n\t[0x10439, 0x10411],\n\t[0x1043A, 0x10412],\n\t[0x1043B, 0x10413],\n\t[0x1043C, 0x10414],\n\t[0x1043D, 0x10415],\n\t[0x1043E, 0x10416],\n\t[0x1043F, 0x10417],\n\t[0x10440, 0x10418],\n\t[0x10441, 0x10419],\n\t[0x10442, 0x1041A],\n\t[0x10443, 0x1041B],\n\t[0x10444, 0x1041C],\n\t[0x10445, 0x1041D],\n\t[0x10446, 0x1041E],\n\t[0x10447, 0x1041F],\n\t[0x10448, 0x10420],\n\t[0x10449, 0x10421],\n\t[0x1044A, 0x10422],\n\t[0x1044B, 0x10423],\n\t[0x1044C, 0x10424],\n\t[0x1044D, 0x10425],\n\t[0x1044E, 0x10426],\n\t[0x1044F, 0x10427],\n\t[0x104B0, 0x104D8],\n\t[0x104B1, 0x104D9],\n\t[0x104B2, 0x104DA],\n\t[0x104B3, 0x104DB],\n\t[0x104B4, 0x104DC],\n\t[0x104B5, 0x104DD],\n\t[0x104B6, 0x104DE],\n\t[0x104B7, 0x104DF],\n\t[0x104B8, 0x104E0],\n\t[0x104B9, 0x104E1],\n\t[0x104BA, 0x104E2],\n\t[0x104BB, 0x104E3],\n\t[0x104BC, 0x104E4],\n\t[0x104BD, 0x104E5],\n\t[0x104BE, 0x104E6],\n\t[0x104BF, 0x104E7],\n\t[0x104C0, 0x104E8],\n\t[0x104C1, 0x104E9],\n\t[0x104C2, 0x104EA],\n\t[0x104C3, 0x104EB],\n\t[0x104C4, 0x104EC],\n\t[0x104C5, 0x104ED],\n\t[0x104C6, 0x104EE],\n\t[0x104C7, 0x104EF],\n\t[0x104C8, 0x104F0],\n\t[0x104C9, 0x104F1],\n\t[0x104CA, 0x104F2],\n\t[0x104CB, 0x104F3],\n\t[0x104CC, 0x104F4],\n\t[0x104CD, 0x104F5],\n\t[0x104CE, 0x104F6],\n\t[0x104CF, 0x104F7],\n\t[0x104D0, 0x104F8],\n\t[0x104D1, 0x104F9],\n\t[0x104D2, 0x104FA],\n\t[0x104D3, 0x104FB],\n\t[0x104D8, 0x104B0],\n\t[0x104D9, 0x104B1],\n\t[0x104DA, 0x104B2],\n\t[0x104DB, 0x104B3],\n\t[0x104DC, 0x104B4],\n\t[0x104DD, 0x104B5],\n\t[0x104DE, 0x104B6],\n\t[0x104DF, 0x104B7],\n\t[0x104E0, 0x104B8],\n\t[0x104E1, 0x104B9],\n\t[0x104E2, 0x104BA],\n\t[0x104E3, 0x104BB],\n\t[0x104E4, 0x104BC],\n\t[0x104E5, 0x104BD],\n\t[0x104E6, 0x104BE],\n\t[0x104E7, 0x104BF],\n\t[0x104E8, 0x104C0],\n\t[0x104E9, 0x104C1],\n\t[0x104EA, 0x104C2],\n\t[0x104EB, 0x104C3],\n\t[0x104EC, 0x104C4],\n\t[0x104ED, 0x104C5],\n\t[0x104EE, 0x104C6],\n\t[0x104EF, 0x104C7],\n\t[0x104F0, 0x104C8],\n\t[0x104F1, 0x104C9],\n\t[0x104F2, 0x104CA],\n\t[0x104F3, 0x104CB],\n\t[0x104F4, 0x104CC],\n\t[0x104F5, 0x104CD],\n\t[0x104F6, 0x104CE],\n\t[0x104F7, 0x104CF],\n\t[0x104F8, 0x104D0],\n\t[0x104F9, 0x104D1],\n\t[0x104FA, 0x104D2],\n\t[0x104FB, 0x104D3],\n\t[0x10C80, 0x10CC0],\n\t[0x10C81, 0x10CC1],\n\t[0x10C82, 0x10CC2],\n\t[0x10C83, 0x10CC3],\n\t[0x10C84, 0x10CC4],\n\t[0x10C85, 0x10CC5],\n\t[0x10C86, 0x10CC6],\n\t[0x10C87, 0x10CC7],\n\t[0x10C88, 0x10CC8],\n\t[0x10C89, 0x10CC9],\n\t[0x10C8A, 0x10CCA],\n\t[0x10C8B, 0x10CCB],\n\t[0x10C8C, 0x10CCC],\n\t[0x10C8D, 0x10CCD],\n\t[0x10C8E, 0x10CCE],\n\t[0x10C8F, 0x10CCF],\n\t[0x10C90, 0x10CD0],\n\t[0x10C91, 0x10CD1],\n\t[0x10C92, 0x10CD2],\n\t[0x10C93, 0x10CD3],\n\t[0x10C94, 0x10CD4],\n\t[0x10C95, 0x10CD5],\n\t[0x10C96, 0x10CD6],\n\t[0x10C97, 0x10CD7],\n\t[0x10C98, 0x10CD8],\n\t[0x10C99, 0x10CD9],\n\t[0x10C9A, 0x10CDA],\n\t[0x10C9B, 0x10CDB],\n\t[0x10C9C, 0x10CDC],\n\t[0x10C9D, 0x10CDD],\n\t[0x10C9E, 0x10CDE],\n\t[0x10C9F, 0x10CDF],\n\t[0x10CA0, 0x10CE0],\n\t[0x10CA1, 0x10CE1],\n\t[0x10CA2, 0x10CE2],\n\t[0x10CA3, 0x10CE3],\n\t[0x10CA4, 0x10CE4],\n\t[0x10CA5, 0x10CE5],\n\t[0x10CA6, 0x10CE6],\n\t[0x10CA7, 0x10CE7],\n\t[0x10CA8, 0x10CE8],\n\t[0x10CA9, 0x10CE9],\n\t[0x10CAA, 0x10CEA],\n\t[0x10CAB, 0x10CEB],\n\t[0x10CAC, 0x10CEC],\n\t[0x10CAD, 0x10CED],\n\t[0x10CAE, 0x10CEE],\n\t[0x10CAF, 0x10CEF],\n\t[0x10CB0, 0x10CF0],\n\t[0x10CB1, 0x10CF1],\n\t[0x10CB2, 0x10CF2],\n\t[0x10CC0, 0x10C80],\n\t[0x10CC1, 0x10C81],\n\t[0x10CC2, 0x10C82],\n\t[0x10CC3, 0x10C83],\n\t[0x10CC4, 0x10C84],\n\t[0x10CC5, 0x10C85],\n\t[0x10CC6, 0x10C86],\n\t[0x10CC7, 0x10C87],\n\t[0x10CC8, 0x10C88],\n\t[0x10CC9, 0x10C89],\n\t[0x10CCA, 0x10C8A],\n\t[0x10CCB, 0x10C8B],\n\t[0x10CCC, 0x10C8C],\n\t[0x10CCD, 0x10C8D],\n\t[0x10CCE, 0x10C8E],\n\t[0x10CCF, 0x10C8F],\n\t[0x10CD0, 0x10C90],\n\t[0x10CD1, 0x10C91],\n\t[0x10CD2, 0x10C92],\n\t[0x10CD3, 0x10C93],\n\t[0x10CD4, 0x10C94],\n\t[0x10CD5, 0x10C95],\n\t[0x10CD6, 0x10C96],\n\t[0x10CD7, 0x10C97],\n\t[0x10CD8, 0x10C98],\n\t[0x10CD9, 0x10C99],\n\t[0x10CDA, 0x10C9A],\n\t[0x10CDB, 0x10C9B],\n\t[0x10CDC, 0x10C9C],\n\t[0x10CDD, 0x10C9D],\n\t[0x10CDE, 0x10C9E],\n\t[0x10CDF, 0x10C9F],\n\t[0x10CE0, 0x10CA0],\n\t[0x10CE1, 0x10CA1],\n\t[0x10CE2, 0x10CA2],\n\t[0x10CE3, 0x10CA3],\n\t[0x10CE4, 0x10CA4],\n\t[0x10CE5, 0x10CA5],\n\t[0x10CE6, 0x10CA6],\n\t[0x10CE7, 0x10CA7],\n\t[0x10CE8, 0x10CA8],\n\t[0x10CE9, 0x10CA9],\n\t[0x10CEA, 0x10CAA],\n\t[0x10CEB, 0x10CAB],\n\t[0x10CEC, 0x10CAC],\n\t[0x10CED, 0x10CAD],\n\t[0x10CEE, 0x10CAE],\n\t[0x10CEF, 0x10CAF],\n\t[0x10CF0, 0x10CB0],\n\t[0x10CF1, 0x10CB1],\n\t[0x10CF2, 0x10CB2],\n\t[0x118A0, 0x118C0],\n\t[0x118A1, 0x118C1],\n\t[0x118A2, 0x118C2],\n\t[0x118A3, 0x118C3],\n\t[0x118A4, 0x118C4],\n\t[0x118A5, 0x118C5],\n\t[0x118A6, 0x118C6],\n\t[0x118A7, 0x118C7],\n\t[0x118A8, 0x118C8],\n\t[0x118A9, 0x118C9],\n\t[0x118AA, 0x118CA],\n\t[0x118AB, 0x118CB],\n\t[0x118AC, 0x118CC],\n\t[0x118AD, 0x118CD],\n\t[0x118AE, 0x118CE],\n\t[0x118AF, 0x118CF],\n\t[0x118B0, 0x118D0],\n\t[0x118B1, 0x118D1],\n\t[0x118B2, 0x118D2],\n\t[0x118B3, 0x118D3],\n\t[0x118B4, 0x118D4],\n\t[0x118B5, 0x118D5],\n\t[0x118B6, 0x118D6],\n\t[0x118B7, 0x118D7],\n\t[0x118B8, 0x118D8],\n\t[0x118B9, 0x118D9],\n\t[0x118BA, 0x118DA],\n\t[0x118BB, 0x118DB],\n\t[0x118BC, 0x118DC],\n\t[0x118BD, 0x118DD],\n\t[0x118BE, 0x118DE],\n\t[0x118BF, 0x118DF],\n\t[0x118C0, 0x118A0],\n\t[0x118C1, 0x118A1],\n\t[0x118C2, 0x118A2],\n\t[0x118C3, 0x118A3],\n\t[0x118C4, 0x118A4],\n\t[0x118C5, 0x118A5],\n\t[0x118C6, 0x118A6],\n\t[0x118C7, 0x118A7],\n\t[0x118C8, 0x118A8],\n\t[0x118C9, 0x118A9],\n\t[0x118CA, 0x118AA],\n\t[0x118CB, 0x118AB],\n\t[0x118CC, 0x118AC],\n\t[0x118CD, 0x118AD],\n\t[0x118CE, 0x118AE],\n\t[0x118CF, 0x118AF],\n\t[0x118D0, 0x118B0],\n\t[0x118D1, 0x118B1],\n\t[0x118D2, 0x118B2],\n\t[0x118D3, 0x118B3],\n\t[0x118D4, 0x118B4],\n\t[0x118D5, 0x118B5],\n\t[0x118D6, 0x118B6],\n\t[0x118D7, 0x118B7],\n\t[0x118D8, 0x118B8],\n\t[0x118D9, 0x118B9],\n\t[0x118DA, 0x118BA],\n\t[0x118DB, 0x118BB],\n\t[0x118DC, 0x118BC],\n\t[0x118DD, 0x118BD],\n\t[0x118DE, 0x118BE],\n\t[0x118DF, 0x118BF],\n\t[0x16E40, 0x16E60],\n\t[0x16E41, 0x16E61],\n\t[0x16E42, 0x16E62],\n\t[0x16E43, 0x16E63],\n\t[0x16E44, 0x16E64],\n\t[0x16E45, 0x16E65],\n\t[0x16E46, 0x16E66],\n\t[0x16E47, 0x16E67],\n\t[0x16E48, 0x16E68],\n\t[0x16E49, 0x16E69],\n\t[0x16E4A, 0x16E6A],\n\t[0x16E4B, 0x16E6B],\n\t[0x16E4C, 0x16E6C],\n\t[0x16E4D, 0x16E6D],\n\t[0x16E4E, 0x16E6E],\n\t[0x16E4F, 0x16E6F],\n\t[0x16E50, 0x16E70],\n\t[0x16E51, 0x16E71],\n\t[0x16E52, 0x16E72],\n\t[0x16E53, 0x16E73],\n\t[0x16E54, 0x16E74],\n\t[0x16E55, 0x16E75],\n\t[0x16E56, 0x16E76],\n\t[0x16E57, 0x16E77],\n\t[0x16E58, 0x16E78],\n\t[0x16E59, 0x16E79],\n\t[0x16E5A, 0x16E7A],\n\t[0x16E5B, 0x16E7B],\n\t[0x16E5C, 0x16E7C],\n\t[0x16E5D, 0x16E7D],\n\t[0x16E5E, 0x16E7E],\n\t[0x16E5F, 0x16E7F],\n\t[0x16E60, 0x16E40],\n\t[0x16E61, 0x16E41],\n\t[0x16E62, 0x16E42],\n\t[0x16E63, 0x16E43],\n\t[0x16E64, 0x16E44],\n\t[0x16E65, 0x16E45],\n\t[0x16E66, 0x16E46],\n\t[0x16E67, 0x16E47],\n\t[0x16E68, 0x16E48],\n\t[0x16E69, 0x16E49],\n\t[0x16E6A, 0x16E4A],\n\t[0x16E6B, 0x16E4B],\n\t[0x16E6C, 0x16E4C],\n\t[0x16E6D, 0x16E4D],\n\t[0x16E6E, 0x16E4E],\n\t[0x16E6F, 0x16E4F],\n\t[0x16E70, 0x16E50],\n\t[0x16E71, 0x16E51],\n\t[0x16E72, 0x16E52],\n\t[0x16E73, 0x16E53],\n\t[0x16E74, 0x16E54],\n\t[0x16E75, 0x16E55],\n\t[0x16E76, 0x16E56],\n\t[0x16E77, 0x16E57],\n\t[0x16E78, 0x16E58],\n\t[0x16E79, 0x16E59],\n\t[0x16E7A, 0x16E5A],\n\t[0x16E7B, 0x16E5B],\n\t[0x16E7C, 0x16E5C],\n\t[0x16E7D, 0x16E5D],\n\t[0x16E7E, 0x16E5E],\n\t[0x16E7F, 0x16E5F],\n\t[0x1E900, 0x1E922],\n\t[0x1E901, 0x1E923],\n\t[0x1E902, 0x1E924],\n\t[0x1E903, 0x1E925],\n\t[0x1E904, 0x1E926],\n\t[0x1E905, 0x1E927],\n\t[0x1E906, 0x1E928],\n\t[0x1E907, 0x1E929],\n\t[0x1E908, 0x1E92A],\n\t[0x1E909, 0x1E92B],\n\t[0x1E90A, 0x1E92C],\n\t[0x1E90B, 0x1E92D],\n\t[0x1E90C, 0x1E92E],\n\t[0x1E90D, 0x1E92F],\n\t[0x1E90E, 0x1E930],\n\t[0x1E90F, 0x1E931],\n\t[0x1E910, 0x1E932],\n\t[0x1E911, 0x1E933],\n\t[0x1E912, 0x1E934],\n\t[0x1E913, 0x1E935],\n\t[0x1E914, 0x1E936],\n\t[0x1E915, 0x1E937],\n\t[0x1E916, 0x1E938],\n\t[0x1E917, 0x1E939],\n\t[0x1E918, 0x1E93A],\n\t[0x1E919, 0x1E93B],\n\t[0x1E91A, 0x1E93C],\n\t[0x1E91B, 0x1E93D],\n\t[0x1E91C, 0x1E93E],\n\t[0x1E91D, 0x1E93F],\n\t[0x1E91E, 0x1E940],\n\t[0x1E91F, 0x1E941],\n\t[0x1E920, 0x1E942],\n\t[0x1E921, 0x1E943],\n\t[0x1E922, 0x1E900],\n\t[0x1E923, 0x1E901],\n\t[0x1E924, 0x1E902],\n\t[0x1E925, 0x1E903],\n\t[0x1E926, 0x1E904],\n\t[0x1E927, 0x1E905],\n\t[0x1E928, 0x1E906],\n\t[0x1E929, 0x1E907],\n\t[0x1E92A, 0x1E908],\n\t[0x1E92B, 0x1E909],\n\t[0x1E92C, 0x1E90A],\n\t[0x1E92D, 0x1E90B],\n\t[0x1E92E, 0x1E90C],\n\t[0x1E92F, 0x1E90D],\n\t[0x1E930, 0x1E90E],\n\t[0x1E931, 0x1E90F],\n\t[0x1E932, 0x1E910],\n\t[0x1E933, 0x1E911],\n\t[0x1E934, 0x1E912],\n\t[0x1E935, 0x1E913],\n\t[0x1E936, 0x1E914],\n\t[0x1E937, 0x1E915],\n\t[0x1E938, 0x1E916],\n\t[0x1E939, 0x1E917],\n\t[0x1E93A, 0x1E918],\n\t[0x1E93B, 0x1E919],\n\t[0x1E93C, 0x1E91A],\n\t[0x1E93D, 0x1E91B],\n\t[0x1E93E, 0x1E91C],\n\t[0x1E93F, 0x1E91D],\n\t[0x1E940, 0x1E91E],\n\t[0x1E941, 0x1E91F],\n\t[0x1E942, 0x1E920],\n\t[0x1E943, 0x1E921]\n]);\n","// Generated using `npm run build`. Do not edit.\n'use strict';\n\nconst regenerate = require('regenerate');\n\nexports.REGULAR = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0xFFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0xFFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0xFFFF)]\n]);\n\nexports.UNICODE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x10FFFF)]\n]);\n\nexports.UNICODE_IGNORE_CASE = new Map([\n\t['d', regenerate()\n\t\t.addRange(0x30, 0x39)],\n\t['D', regenerate()\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x10FFFF)],\n\t['s', regenerate(0x20, 0xA0, 0x1680, 0x202F, 0x205F, 0x3000, 0xFEFF)\n\t\t.addRange(0x9, 0xD)\n\t\t.addRange(0x2000, 0x200A)\n\t\t.addRange(0x2028, 0x2029)],\n\t['S', regenerate()\n\t\t.addRange(0x0, 0x8)\n\t\t.addRange(0xE, 0x1F)\n\t\t.addRange(0x21, 0x9F)\n\t\t.addRange(0xA1, 0x167F)\n\t\t.addRange(0x1681, 0x1FFF)\n\t\t.addRange(0x200B, 0x2027)\n\t\t.addRange(0x202A, 0x202E)\n\t\t.addRange(0x2030, 0x205E)\n\t\t.addRange(0x2060, 0x2FFF)\n\t\t.addRange(0x3001, 0xFEFE)\n\t\t.addRange(0xFF00, 0x10FFFF)],\n\t['w', regenerate(0x5F, 0x17F, 0x212A)\n\t\t.addRange(0x30, 0x39)\n\t\t.addRange(0x41, 0x5A)\n\t\t.addRange(0x61, 0x7A)],\n\t['W', regenerate(0x60)\n\t\t.addRange(0x0, 0x2F)\n\t\t.addRange(0x3A, 0x40)\n\t\t.addRange(0x5B, 0x5E)\n\t\t.addRange(0x7B, 0x17E)\n\t\t.addRange(0x180, 0x2129)\n\t\t.addRange(0x212B, 0x10FFFF)]\n]);\n","'use strict';\n\nconst generate = require('regjsgen').generate;\nconst parse = require('regjsparser').parse;\nconst regenerate = require('regenerate');\nconst unicodeMatchProperty = require('unicode-match-property-ecmascript');\nconst unicodeMatchPropertyValue = require('unicode-match-property-value-ecmascript');\nconst iuMappings = require('./data/iu-mappings.js');\nconst ESCAPE_SETS = require('./data/character-class-escape-sets.js');\n\n// Prepare a Regenerate set containing all code points, used for negative\n// character classes (if any).\nconst UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF);\n// Without the `u` flag, the range stops at 0xFFFF.\n// https://mths.be/es6#sec-pattern-semantics\nconst BMP_SET = regenerate().addRange(0x0, 0xFFFF);\n\n// Prepare a Regenerate set containing all code points that are supposed to be\n// matched by `/./u`. https://mths.be/es6#sec-atom\nconst DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points\n\t.remove(\n\t\t// minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators):\n\t\t0x000A, // Line Feed \n\t\t0x000D, // Carriage Return \n\t\t0x2028, // Line Separator \n\t\t0x2029 // Paragraph Separator \n\t);\n\nconst getCharacterClassEscapeSet = (character, unicode, ignoreCase) => {\n\tif (unicode) {\n\t\tif (ignoreCase) {\n\t\t\treturn ESCAPE_SETS.UNICODE_IGNORE_CASE.get(character);\n\t\t}\n\t\treturn ESCAPE_SETS.UNICODE.get(character);\n\t}\n\treturn ESCAPE_SETS.REGULAR.get(character);\n};\n\nconst getUnicodeDotSet = (dotAll) => {\n\treturn dotAll ? UNICODE_SET : DOT_SET_UNICODE;\n};\n\nconst getUnicodePropertyValueSet = (property, value) => {\n\tconst path = value ?\n\t\t`${ property }/${ value }` :\n\t\t`Binary_Property/${ property }`;\n\ttry {\n\t\treturn require(`regenerate-unicode-properties/${ path }.js`);\n\t} catch (exception) {\n\t\tthrow new Error(\n\t\t\t`Failed to recognize value \\`${ value }\\` for property ` +\n\t\t\t`\\`${ property }\\`.`\n\t\t);\n\t}\n};\n\nconst handleLoneUnicodePropertyNameOrValue = (value) => {\n\t// It could be a `General_Category` value or a binary property.\n\t// Note: `unicodeMatchPropertyValue` throws on invalid values.\n\ttry {\n\t\tconst property = 'General_Category';\n\t\tconst category = unicodeMatchPropertyValue(property, value);\n\t\treturn getUnicodePropertyValueSet(property, category);\n\t} catch (exception) {}\n\t// It’s not a `General_Category` value, so check if it’s a binary\n\t// property. Note: `unicodeMatchProperty` throws on invalid properties.\n\tconst property = unicodeMatchProperty(value);\n\treturn getUnicodePropertyValueSet(property);\n};\n\nconst getUnicodePropertyEscapeSet = (value, isNegative) => {\n\tconst parts = value.split('=');\n\tconst firstPart = parts[0];\n\tlet set;\n\tif (parts.length == 1) {\n\t\tset = handleLoneUnicodePropertyNameOrValue(firstPart);\n\t} else {\n\t\t// The pattern consists of two parts, i.e. `Property=Value`.\n\t\tconst property = unicodeMatchProperty(firstPart);\n\t\tconst value = unicodeMatchPropertyValue(property, parts[1]);\n\t\tset = getUnicodePropertyValueSet(property, value);\n\t}\n\tif (isNegative) {\n\t\treturn UNICODE_SET.clone().remove(set);\n\t}\n\treturn set.clone();\n};\n\n// Given a range of code points, add any case-folded code points in that range\n// to a set.\nregenerate.prototype.iuAddRange = function(min, max) {\n\tconst $this = this;\n\tdo {\n\t\tconst folded = caseFold(min);\n\t\tif (folded) {\n\t\t\t$this.add(folded);\n\t\t}\n\t} while (++min <= max);\n\treturn $this;\n};\n\nconst update = (item, pattern) => {\n\tlet tree = parse(pattern, config.useUnicodeFlag ? 'u' : '');\n\tswitch (tree.type) {\n\t\tcase 'characterClass':\n\t\tcase 'group':\n\t\tcase 'value':\n\t\t\t// No wrapping needed.\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// Wrap the pattern in a non-capturing group.\n\t\t\ttree = wrap(tree, pattern);\n\t}\n\tObject.assign(item, tree);\n};\n\nconst wrap = (tree, pattern) => {\n\t// Wrap the pattern in a non-capturing group.\n\treturn {\n\t\t'type': 'group',\n\t\t'behavior': 'ignore',\n\t\t'body': [tree],\n\t\t'raw': `(?:${ pattern })`\n\t};\n};\n\nconst caseFold = (codePoint) => {\n\treturn iuMappings.get(codePoint) || false;\n};\n\nconst processCharacterClass = (characterClassItem, regenerateOptions) => {\n\tlet set = regenerate();\n\tfor (const item of characterClassItem.body) {\n\t\tswitch (item.type) {\n\t\t\tcase 'value':\n\t\t\t\tset.add(item.codePoint);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tconst folded = caseFold(item.codePoint);\n\t\t\t\t\tif (folded) {\n\t\t\t\t\t\tset.add(folded);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassRange':\n\t\t\t\tconst min = item.min.codePoint;\n\t\t\t\tconst max = item.max.codePoint;\n\t\t\t\tset.addRange(min, max);\n\t\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\t\tset.iuAddRange(min, max);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'characterClassEscape':\n\t\t\t\tset.add(getCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t));\n\t\t\t\tbreak;\n\t\t\tcase 'unicodePropertyEscape':\n\t\t\t\tset.add(getUnicodePropertyEscapeSet(item.value, item.negative));\n\t\t\t\tbreak;\n\t\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t\t// reached. Code coverage tools should ignore it.\n\t\t\t/* istanbul ignore next */\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t\t}\n\t}\n\tif (characterClassItem.negative) {\n\t\tset = (config.unicode ? UNICODE_SET : BMP_SET).clone().remove(set);\n\t}\n\tupdate(characterClassItem, set.toString(regenerateOptions));\n\treturn characterClassItem;\n};\n\nconst updateNamedReference = (item, index) => {\n\tdelete item.name;\n\titem.matchIndex = index;\n};\n\nconst assertNoUnmatchedReferences = (groups) => {\n\tconst unmatchedReferencesNames = Object.keys(groups.unmatchedReferences);\n\tif (unmatchedReferencesNames.length > 0) {\n\t\tthrow new Error(`Unknown group names: ${unmatchedReferencesNames}`);\n\t}\n};\n\nconst processTerm = (item, regenerateOptions, groups) => {\n\tswitch (item.type) {\n\t\tcase 'dot':\n\t\t\tif (config.unicode) {\n\t\t\t\tupdate(\n\t\t\t\t\titem,\n\t\t\t\t\tgetUnicodeDotSet(config.dotAll).toString(regenerateOptions)\n\t\t\t\t);\n\t\t\t} else if (config.dotAll) {\n\t\t\t\t// TODO: consider changing this at the regenerate level.\n\t\t\t\tupdate(item, '[\\\\s\\\\S]');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'characterClass':\n\t\t\titem = processCharacterClass(item, regenerateOptions);\n\t\t\tbreak;\n\t\tcase 'unicodePropertyEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetUnicodePropertyEscapeSet(item.value, item.negative)\n\t\t\t\t\t.toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'characterClassEscape':\n\t\t\tupdate(\n\t\t\t\titem,\n\t\t\t\tgetCharacterClassEscapeSet(\n\t\t\t\t\titem.value,\n\t\t\t\t\tconfig.unicode,\n\t\t\t\t\tconfig.ignoreCase\n\t\t\t\t).toString(regenerateOptions)\n\t\t\t);\n\t\t\tbreak;\n\t\tcase 'group':\n\t\t\tif (item.behavior == 'normal') {\n\t\t\t\tgroups.lastIndex++;\n\t\t\t}\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\n\t\t\t\tif (groups.names[name]) {\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t`Multiple groups with the same name (${ name }) are not allowed.`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst index = groups.lastIndex;\n\t\t\t\tdelete item.name;\n\n\t\t\t\tgroups.names[name] = index;\n\t\t\t\tif (groups.onNamedGroup) {\n\t\t\t\t\tgroups.onNamedGroup.call(null, name, index);\n\t\t\t\t}\n\n\t\t\t\tif (groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name].forEach(reference => {\n\t\t\t\t\t\tupdateNamedReference(reference, index);\n\t\t\t\t\t});\n\t\t\t\t\tdelete groups.unmatchedReferences[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* falls through */\n\t\tcase 'alternative':\n\t\tcase 'disjunction':\n\t\tcase 'quantifier':\n\t\t\titem.body = item.body.map(term => {\n\t\t\t\treturn processTerm(term, regenerateOptions, groups);\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'value':\n\t\t\tconst codePoint = item.codePoint;\n\t\t\tconst set = regenerate(codePoint);\n\t\t\tif (config.ignoreCase && config.unicode && !config.useUnicodeFlag) {\n\t\t\t\tconst folded = caseFold(codePoint);\n\t\t\t\tif (folded) {\n\t\t\t\t\tset.add(folded);\n\t\t\t\t}\n\t\t\t}\n\t\t\tupdate(item, set.toString(regenerateOptions));\n\t\t\tbreak;\n\t\tcase 'reference':\n\t\t\tif (item.name) {\n\t\t\t\tconst name = item.name.value;\n\t\t\t\tconst index = groups.names[name];\n\t\t\t\tif (index) {\n\t\t\t\t\tupdateNamedReference(item, index);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (!groups.unmatchedReferences[name]) {\n\t\t\t\t\tgroups.unmatchedReferences[name] = [];\n\t\t\t\t}\n\t\t\t\t// Keep track of references used before the corresponding group.\n\t\t\t\tgroups.unmatchedReferences[name].push(item);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'anchor':\n\t\tcase 'empty':\n\t\tcase 'group':\n\t\t\t// Nothing to do here.\n\t\t\tbreak;\n\t\t// The `default` clause is only here as a safeguard; it should never be\n\t\t// reached. Code coverage tools should ignore it.\n\t\t/* istanbul ignore next */\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown term type: ${ item.type }`);\n\t}\n\treturn item;\n};\n\nconst config = {\n\t'ignoreCase': false,\n\t'unicode': false,\n\t'dotAll': false,\n\t'useUnicodeFlag': false\n};\nconst rewritePattern = (pattern, flags, options) => {\n\tconst regjsparserFeatures = {\n\t\t'unicodePropertyEscape': options && options.unicodePropertyEscape,\n\t\t'namedGroups': options && options.namedGroup,\n\t\t'lookbehind': options && options.lookbehind\n\t};\n\tconfig.ignoreCase = flags && flags.includes('i');\n\tconfig.unicode = flags && flags.includes('u');\n\tconst supportDotAllFlag = options && options.dotAllFlag;\n\tconfig.dotAll = supportDotAllFlag && flags && flags.includes('s');\n\tconfig.useUnicodeFlag = options && options.useUnicodeFlag;\n\tconst regenerateOptions = {\n\t\t'hasUnicodeFlag': config.useUnicodeFlag,\n\t\t'bmpOnly': !config.unicode\n\t};\n\tconst groups = {\n\t\t'onNamedGroup': options && options.onNamedGroup,\n\t\t'lastIndex': 0,\n\t\t'names': Object.create(null), // { [name]: index }\n\t\t'unmatchedReferences': Object.create(null) // { [name]: Array }\n\t};\n\tconst tree = parse(pattern, flags, regjsparserFeatures);\n\t// Note: `processTerm` mutates `tree` and `groups`.\n\tprocessTerm(tree, regenerateOptions, groups);\n\tassertNoUnmatchedReferences(groups);\n\treturn generate(tree);\n};\n\nmodule.exports = rewritePattern;\n","// @flow\nexport const FEATURES = Object.freeze({\n unicodeFlag: 1 << 0,\n dotAllFlag: 1 << 1,\n unicodePropertyEscape: 1 << 2,\n namedCaptureGroups: 1 << 3,\n});\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-regexp-features\n// - @babel/plugin-proposal-unicode-property-regex\n// - node_modules\n// - @babel-plugin-regexp-features\nexport const featuresKey = \"@babel/plugin-regexp-features/featuresKey\";\nexport const runtimeKey = \"@babel/plugin-regexp-features/runtimeKey\";\n\ntype FeatureType = $Values;\n\nexport function enableFeature(features: number, feature: FeatureType): number {\n return features | feature;\n}\n\nexport function hasFeature(features: number, feature: FeatureType) {\n return !!(features & feature);\n}\n","import { FEATURES, hasFeature } from \"./features\";\n\nexport function generateRegexpuOptions(node, features) {\n let useUnicodeFlag = false,\n dotAllFlag = false,\n unicodePropertyEscape = false,\n namedGroup = false;\n const { flags, pattern } = node;\n const flagsIncludesU = flags.includes(\"u\");\n\n if (flagsIncludesU) {\n if (!hasFeature(features, FEATURES.unicodeFlag)) {\n useUnicodeFlag = true;\n }\n if (\n hasFeature(features, FEATURES.unicodePropertyEscape) &&\n /\\\\[pP]{/.test(pattern)\n ) {\n unicodePropertyEscape = true;\n }\n }\n\n if (hasFeature(features, FEATURES.dotAllFlag) && flags.indexOf(\"s\") >= 0) {\n dotAllFlag = true;\n }\n if (\n hasFeature(features, FEATURES.namedCaptureGroups) &&\n /\\(\\?<(?![=!])/.test(pattern)\n ) {\n namedGroup = true;\n }\n if (\n !namedGroup &&\n !unicodePropertyEscape &&\n !dotAllFlag &&\n (!flagsIncludesU || useUnicodeFlag)\n ) {\n return null;\n }\n // Now we have to feed regexpu-core the regex\n if (flagsIncludesU && flags.indexOf(\"s\") >= 0) {\n // When flags includes u, `config.unicode` will be enabled even if `u` is supported natively.\n // In this case we have to enable dotAllFlag, otherwise `rewritePattern(/./su)` will return\n // incorrect result\n // https://github.com/mathiasbynens/regexpu-core/blob/v4.6.0/rewrite-pattern.js#L191\n dotAllFlag = true;\n }\n return {\n useUnicodeFlag,\n onNamedGroup: () => {},\n namedGroup,\n unicodePropertyEscape,\n dotAllFlag,\n lookbehind: true,\n };\n}\n","/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseIndexOfWith;\n","var arrayMap = require('./_arrayMap'),\n baseIndexOf = require('./_baseIndexOf'),\n baseIndexOfWith = require('./_baseIndexOfWith'),\n baseUnary = require('./_baseUnary'),\n copyArray = require('./_copyArray');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n}\n\nmodule.exports = basePullAll;\n","var basePullAll = require('./_basePullAll');\n\n/**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\nfunction pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n}\n\nmodule.exports = pullAll;\n","var baseRest = require('./_baseRest'),\n pullAll = require('./pullAll');\n\n/**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\nvar pull = baseRest(pullAll);\n\nmodule.exports = pull;\n","import pull from \"lodash/pull\";\n\nexport function is(node: Object, flag: string): boolean {\n return node.type === \"RegExpLiteral\" && node.flags.indexOf(flag) >= 0;\n}\n\nexport function pullFlag(node: Object, flag: string) {\n const flags = node.flags.split(\"\");\n if (node.flags.indexOf(flag) < 0) return;\n pull(flags, flag);\n node.flags = flags.join(\"\");\n}\n","import rewritePattern from \"regexpu-core\";\nimport {\n featuresKey,\n FEATURES,\n enableFeature,\n runtimeKey,\n hasFeature,\n} from \"./features\";\nimport { generateRegexpuOptions } from \"./util\";\n\nimport pkg from \"../package.json\";\nimport { types as t } from \"@babel/core\";\nimport { pullFlag } from \"@babel/helper-regex\";\n\n// Note: Versions are represented as an integer. e.g. 7.1.5 is represented\n// as 70000100005. This method is easier than using a semver-parsing\n// package, but it breaks if we release x.y.z where x, y or z are\n// greater than 99_999.\nconst version = pkg.version.split(\".\").reduce((v, x) => v * 1e5 + +x, 0);\nconst versionKey = \"@babel/plugin-regexp-features/version\";\n\nexport function createRegExpFeaturePlugin({ name, feature, options = {} }) {\n return {\n name,\n pre() {\n const { file } = this;\n const features = file.get(featuresKey) ?? 0;\n let newFeatures = enableFeature(features, FEATURES[feature]);\n\n const { useUnicodeFlag, runtime = true } = options;\n if (useUnicodeFlag === false) {\n newFeatures = enableFeature(newFeatures, FEATURES.unicodeFlag);\n }\n if (newFeatures !== features) {\n file.set(featuresKey, newFeatures);\n }\n\n if (!runtime) {\n file.set(runtimeKey, false);\n }\n\n if (!file.has(versionKey) || file.get(versionKey) < version) {\n file.set(versionKey, version);\n }\n },\n\n visitor: {\n RegExpLiteral(path) {\n const { node } = path;\n const { file } = this;\n const features = file.get(featuresKey);\n const runtime = file.get(runtimeKey) ?? true;\n const regexpuOptions = generateRegexpuOptions(node, features);\n if (regexpuOptions === null) {\n return;\n }\n const namedCaptureGroups = {};\n if (regexpuOptions.namedGroup) {\n regexpuOptions.onNamedGroup = (name, index) => {\n namedCaptureGroups[name] = index;\n };\n }\n node.pattern = rewritePattern(node.pattern, node.flags, regexpuOptions);\n\n if (\n regexpuOptions.namedGroup &&\n Object.keys(namedCaptureGroups).length > 0 &&\n runtime &&\n !isRegExpTest(path)\n ) {\n path.replaceWith(\n t.callExpression(this.addHelper(\"wrapRegExp\"), [\n node,\n t.valueToNode(namedCaptureGroups),\n ]),\n );\n }\n if (hasFeature(features, FEATURES.unicodeFlag)) {\n pullFlag(node, \"u\");\n }\n if (hasFeature(features, FEATURES.dotAllFlag)) {\n pullFlag(node, \"s\");\n }\n },\n },\n };\n}\n\nfunction isRegExpTest(path) {\n return (\n path.parentPath.isMemberExpression({\n object: path.node,\n computed: false,\n }) && path.parentPath.get(\"property\").isIdentifier({ name: \"test\" })\n );\n}\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { useUnicodeFlag = true } = options;\n if (typeof useUnicodeFlag !== \"boolean\") {\n throw new Error(\".useUnicodeFlag must be a boolean, or undefined\");\n }\n\n return createRegExpFeaturePlugin({\n name: \"proposal-unicode-property-regex\",\n feature: \"unicodePropertyEscape\",\n options: { useUnicodeFlag },\n });\n});\n","\nvar inherits;\nif (typeof Object.create === 'function'){\n inherits = function inherits(ctor, superCtor) {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n inherits = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\nexport default inherits;\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport process from 'process';\nvar formatRegExp = /%[sdj%]/g;\nexport function format(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexport function deprecate(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexport function debuglog(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = 0;\n debugs[set] = function() {\n var msg = format.apply(null, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nexport function inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n _extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nexport function isArray(ar) {\n return Array.isArray(ar);\n}\n\nexport function isBoolean(arg) {\n return typeof arg === 'boolean';\n}\n\nexport function isNull(arg) {\n return arg === null;\n}\n\nexport function isNullOrUndefined(arg) {\n return arg == null;\n}\n\nexport function isNumber(arg) {\n return typeof arg === 'number';\n}\n\nexport function isString(arg) {\n return typeof arg === 'string';\n}\n\nexport function isSymbol(arg) {\n return typeof arg === 'symbol';\n}\n\nexport function isUndefined(arg) {\n return arg === void 0;\n}\n\nexport function isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\n\nexport function isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\n\nexport function isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\n\nexport function isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\n\nexport function isFunction(arg) {\n return typeof arg === 'function';\n}\n\nexport function isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\n\nexport function isBuffer(maybeBuf) {\n return Buffer.isBuffer(maybeBuf);\n}\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexport function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nimport inherits from './inherits';\nexport {inherits}\n\nexport function _extend(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nexport default {\n inherits: inherits,\n _extend: _extend,\n log: log,\n isBuffer: isBuffer,\n isPrimitive: isPrimitive,\n isFunction: isFunction,\n isError: isError,\n isDate: isDate,\n isObject: isObject,\n isRegExp: isRegExp,\n isUndefined: isUndefined,\n isSymbol: isSymbol,\n isString: isString,\n isNumber: isNumber,\n isNullOrUndefined: isNullOrUndefined,\n isNull: isNull,\n isBoolean: isBoolean,\n isArray: isArray,\n inspect: inspect,\n deprecate: deprecate,\n format: format,\n debuglog: debuglog\n}\n","\nfunction compare(a, b) {\n if (a === b) {\n return 0;\n }\n\n var x = a.length;\n var y = b.length;\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i];\n y = b[i];\n break;\n }\n }\n\n if (x < y) {\n return -1;\n }\n if (y < x) {\n return 1;\n }\n return 0;\n}\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nvar objectKeys = Object.keys || function (obj) {\n var keys = [];\n for (var key in obj) {\n if (hasOwn.call(obj, key)) keys.push(key);\n }\n return keys;\n};\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\nimport {isBuffer} from 'buffer';\nimport {isPrimitive, inherits, isError, isFunction, isRegExp, isDate, inspect as utilInspect} from 'util';\nvar pSlice = Array.prototype.slice;\nvar _functionsHaveNames;\nfunction functionsHaveNames() {\n if (typeof _functionsHaveNames !== 'undefined') {\n return _functionsHaveNames;\n }\n return _functionsHaveNames = (function () {\n return function foo() {}.name === 'foo';\n }());\n}\nfunction pToString (obj) {\n return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n if (isBuffer(arrbuf)) {\n return false;\n }\n if (typeof global.ArrayBuffer !== 'function') {\n return false;\n }\n if (typeof ArrayBuffer.isView === 'function') {\n return ArrayBuffer.isView(arrbuf);\n }\n if (!arrbuf) {\n return false;\n }\n if (arrbuf instanceof DataView) {\n return true;\n }\n if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n return true;\n }\n return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nfunction assert(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nexport default assert;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n// actual: actual,\n// expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n if (!isFunction(func)) {\n return;\n }\n if (functionsHaveNames()) {\n return func.name;\n }\n var str = func.toString();\n var match = str.match(regex);\n return match && match[1];\n}\nassert.AssertionError = AssertionError;\nexport function AssertionError(options) {\n this.name = 'AssertionError';\n this.actual = options.actual;\n this.expected = options.expected;\n this.operator = options.operator;\n if (options.message) {\n this.message = options.message;\n this.generatedMessage = false;\n } else {\n this.message = getMessage(this);\n this.generatedMessage = true;\n }\n var stackStartFunction = options.stackStartFunction || fail;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, stackStartFunction);\n } else {\n // non v8 browsers so we can have a stacktrace\n var err = new Error();\n if (err.stack) {\n var out = err.stack;\n\n // try to strip useless frames\n var fn_name = getName(stackStartFunction);\n var idx = out.indexOf('\\n' + fn_name);\n if (idx >= 0) {\n // once we have located the function frame\n // we need to strip out everything before it (and its line)\n var next_line = out.indexOf('\\n', idx + 1);\n out = out.substring(next_line + 1);\n }\n\n this.stack = out;\n }\n }\n}\n\n// assert.AssertionError instanceof Error\ninherits(AssertionError, Error);\n\nfunction truncate(s, n) {\n if (typeof s === 'string') {\n return s.length < n ? s : s.slice(0, n);\n } else {\n return s;\n }\n}\nfunction inspect(something) {\n if (functionsHaveNames() || !isFunction(something)) {\n return utilInspect(something);\n }\n var rawname = getName(something);\n var name = rawname ? ': ' + rawname : '';\n return '[Function' + name + ']';\n}\nfunction getMessage(self) {\n return truncate(inspect(self.actual), 128) + ' ' +\n self.operator + ' ' +\n truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided. All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nexport function fail(actual, expected, message, operator, stackStartFunction) {\n throw new AssertionError({\n message: message,\n actual: actual,\n expected: expected,\n operator: operator,\n stackStartFunction: stackStartFunction\n });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nexport function ok(value, message) {\n if (!value) fail(value, true, message, '==', ok);\n}\nassert.ok = ok;\nexport {ok as assert};\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\nassert.equal = equal;\nexport function equal(actual, expected, message) {\n if (actual != expected) fail(actual, expected, message, '==', equal);\n}\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\nassert.notEqual = notEqual;\nexport function notEqual(actual, expected, message) {\n if (actual == expected) {\n fail(actual, expected, message, '!=', notEqual);\n }\n}\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\nassert.deepEqual = deepEqual;\nexport function deepEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'deepEqual', deepEqual);\n }\n}\nassert.deepStrictEqual = deepStrictEqual;\nexport function deepStrictEqual(actual, expected, message) {\n if (!_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'deepStrictEqual', deepStrictEqual);\n }\n}\n\nfunction _deepEqual(actual, expected, strict, memos) {\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n } else if (isBuffer(actual) && isBuffer(expected)) {\n return compare(actual, expected) === 0;\n\n // 7.2. If the expected value is a Date object, the actual value is\n // equivalent if it is also a Date object that refers to the same time.\n } else if (isDate(actual) && isDate(expected)) {\n return actual.getTime() === expected.getTime();\n\n // 7.3 If the expected value is a RegExp object, the actual value is\n // equivalent if it is also a RegExp object with the same source and\n // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n } else if (isRegExp(actual) && isRegExp(expected)) {\n return actual.source === expected.source &&\n actual.global === expected.global &&\n actual.multiline === expected.multiline &&\n actual.lastIndex === expected.lastIndex &&\n actual.ignoreCase === expected.ignoreCase;\n\n // 7.4. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if ((actual === null || typeof actual !== 'object') &&\n (expected === null || typeof expected !== 'object')) {\n return strict ? actual === expected : actual == expected;\n\n // If both values are instances of typed arrays, wrap their underlying\n // ArrayBuffers in a Buffer each to increase performance\n // This optimization requires the arrays to have the same type as checked by\n // Object.prototype.toString (aka pToString). Never perform binary\n // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n // bit patterns are not identical.\n } else if (isView(actual) && isView(expected) &&\n pToString(actual) === pToString(expected) &&\n !(actual instanceof Float32Array ||\n actual instanceof Float64Array)) {\n return compare(new Uint8Array(actual.buffer),\n new Uint8Array(expected.buffer)) === 0;\n\n // 7.5 For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else if (isBuffer(actual) !== isBuffer(expected)) {\n return false;\n } else {\n memos = memos || {actual: [], expected: []};\n\n var actualIndex = memos.actual.indexOf(actual);\n if (actualIndex !== -1) {\n if (actualIndex === memos.expected.indexOf(expected)) {\n return true;\n }\n }\n\n memos.actual.push(actual);\n memos.expected.push(expected);\n\n return objEquiv(actual, expected, strict, memos);\n }\n}\n\nfunction isArguments(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n if (a === null || a === undefined || b === null || b === undefined)\n return false;\n // if one is a primitive, the other must be same\n if (isPrimitive(a) || isPrimitive(b))\n return a === b;\n if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n return false;\n var aIsArgs = isArguments(a);\n var bIsArgs = isArguments(b);\n if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n return false;\n if (aIsArgs) {\n a = pSlice.call(a);\n b = pSlice.call(b);\n return _deepEqual(a, b, strict);\n }\n var ka = objectKeys(a);\n var kb = objectKeys(b);\n var key, i;\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length !== kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] !== kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n return false;\n }\n return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\nassert.notDeepEqual = notDeepEqual;\nexport function notDeepEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, false)) {\n fail(actual, expected, message, 'notDeepEqual', notDeepEqual);\n }\n}\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nexport function notDeepStrictEqual(actual, expected, message) {\n if (_deepEqual(actual, expected, true)) {\n fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\nassert.strictEqual = strictEqual;\nexport function strictEqual(actual, expected, message) {\n if (actual !== expected) {\n fail(actual, expected, message, '===', strictEqual);\n }\n}\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==. assert.notStrictEqual(actual, expected, message_opt);\nassert.notStrictEqual = notStrictEqual;\nexport function notStrictEqual(actual, expected, message) {\n if (actual === expected) {\n fail(actual, expected, message, '!==', notStrictEqual);\n }\n}\n\nfunction expectedException(actual, expected) {\n if (!actual || !expected) {\n return false;\n }\n\n if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n return expected.test(actual);\n }\n\n try {\n if (actual instanceof expected) {\n return true;\n }\n } catch (e) {\n // Ignore. The instanceof check doesn't work for arrow functions.\n }\n\n if (Error.isPrototypeOf(expected)) {\n return false;\n }\n\n return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n var error;\n try {\n block();\n } catch (e) {\n error = e;\n }\n return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n var actual;\n\n if (typeof block !== 'function') {\n throw new TypeError('\"block\" argument must be a function');\n }\n\n if (typeof expected === 'string') {\n message = expected;\n expected = null;\n }\n\n actual = _tryBlock(block);\n\n message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n (message ? ' ' + message : '.');\n\n if (shouldThrow && !actual) {\n fail(actual, expected, 'Missing expected exception' + message);\n }\n\n var userProvidedMessage = typeof message === 'string';\n var isUnwantedException = !shouldThrow && isError(actual);\n var isUnexpectedException = !shouldThrow && actual && !expected;\n\n if ((isUnwantedException &&\n userProvidedMessage &&\n expectedException(actual, expected)) ||\n isUnexpectedException) {\n fail(actual, expected, 'Got unwanted exception' + message);\n }\n\n if ((shouldThrow && actual && expected &&\n !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n throw actual;\n }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\nassert.throws = throws;\nexport function throws(block, /*optional*/error, /*optional*/message) {\n _throws(true, block, error, message);\n}\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = doesNotThrow;\nexport function doesNotThrow(block, /*optional*/error, /*optional*/message) {\n _throws(false, block, error, message);\n}\n\nassert.ifError = ifError;\nexport function ifError(err) {\n if (err) throw err;\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\n/**\n * A class to track and accumulate mutations to the AST that will eventually\n * output a new require/import statement list.\n */\nexport default class ImportBuilder {\n _statements = [];\n _resultName = null;\n\n _scope = null;\n _hub = null;\n\n constructor(importedSource, scope, hub) {\n this._scope = scope;\n this._hub = hub;\n this._importedSource = importedSource;\n }\n\n done() {\n return {\n statements: this._statements,\n resultName: this._resultName,\n };\n }\n\n import() {\n this._statements.push(\n t.importDeclaration([], t.stringLiteral(this._importedSource)),\n );\n return this;\n }\n\n require() {\n this._statements.push(\n t.expressionStatement(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(this._importedSource),\n ]),\n ),\n );\n return this;\n }\n\n namespace(name = \"namespace\") {\n name = this._scope.generateUidIdentifier(name);\n\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importNamespaceSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n default(name) {\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importDefaultSpecifier(name)];\n this._resultName = t.cloneNode(name);\n return this;\n }\n named(name, importName) {\n if (importName === \"default\") return this.default(name);\n\n name = this._scope.generateUidIdentifier(name);\n const statement = this._statements[this._statements.length - 1];\n assert(statement.type === \"ImportDeclaration\");\n assert(statement.specifiers.length === 0);\n statement.specifiers = [t.importSpecifier(name, t.identifier(importName))];\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n var(name) {\n name = this._scope.generateUidIdentifier(name);\n let statement = this._statements[this._statements.length - 1];\n if (statement.type !== \"ExpressionStatement\") {\n assert(this._resultName);\n statement = t.expressionStatement(this._resultName);\n this._statements.push(statement);\n }\n this._statements[this._statements.length - 1] = t.variableDeclaration(\n \"var\",\n [t.variableDeclarator(name, statement.expression)],\n );\n this._resultName = t.cloneNode(name);\n return this;\n }\n\n defaultInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireDefault\"));\n }\n wildcardInterop() {\n return this._interop(this._hub.addHelper(\"interopRequireWildcard\"));\n }\n\n _interop(callee) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.callExpression(callee, [statement.expression]);\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.callExpression(callee, [\n statement.declarations[0].init,\n ]);\n } else {\n assert.fail(\"Unexpected type.\");\n }\n return this;\n }\n\n prop(name) {\n const statement = this._statements[this._statements.length - 1];\n if (statement.type === \"ExpressionStatement\") {\n statement.expression = t.memberExpression(\n statement.expression,\n t.identifier(name),\n );\n } else if (statement.type === \"VariableDeclaration\") {\n assert(statement.declarations.length === 1);\n statement.declarations[0].init = t.memberExpression(\n statement.declarations[0].init,\n t.identifier(name),\n );\n } else {\n assert.fail(\"Unexpected type:\" + statement.type);\n }\n return this;\n }\n\n read(name) {\n this._resultName = t.memberExpression(this._resultName, t.identifier(name));\n }\n}\n","/**\n * A small utility to check if a file qualifies as a module.\n */\nexport default function isModule(path: NodePath) {\n const { sourceType } = path.node;\n if (sourceType !== \"module\" && sourceType !== \"script\") {\n throw path.buildCodeFrameError(\n `Unknown sourceType \"${sourceType}\", cannot transform.`,\n );\n }\n\n return path.node.sourceType === \"module\";\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\n\nimport ImportBuilder from \"./import-builder\";\nimport isModule from \"./is-module\";\n\nexport type ImportOptions = {\n /**\n * The module being referenced.\n */\n importedSource: string | null,\n\n /**\n * The type of module being imported:\n *\n * * 'es6' - An ES6 module.\n * * 'commonjs' - A CommonJS module. (Default)\n */\n importedType: \"es6\" | \"commonjs\",\n\n /**\n * The type of interop behavior for namespace/default/named when loading\n * CommonJS modules.\n *\n * ## 'babel' (Default)\n *\n * Load using Babel's interop.\n *\n * If '.__esModule' is true, treat as 'compiled', else:\n *\n * * Namespace: A copy of the module.exports with .default\n * populated by the module.exports object.\n * * Default: The module.exports value.\n * * Named: The .named property of module.exports.\n *\n * The 'ensureLiveReference' has no effect on the liveness of these.\n *\n * ## 'compiled'\n *\n * Assume the module is ES6 compiled to CommonJS. Useful to avoid injecting\n * interop logic if you are confident that the module is a certain format.\n *\n * * Namespace: The root module.exports object.\n * * Default: The .default property of the namespace.\n * * Named: The .named property of the namespace.\n *\n * Will return erroneous results if the imported module is _not_ compiled\n * from ES6 with Babel.\n *\n * ## 'uncompiled'\n *\n * Assume the module is _not_ ES6 compiled to CommonJS. Used a simplified\n * access pattern that doesn't require additional function calls.\n *\n * Will return erroneous results if the imported module _is_ compiled\n * from ES6 with Babel.\n *\n * * Namespace: The module.exports object.\n * * Default: The module.exports object.\n * * Named: The .named property of module.exports.\n */\n importedInterop: \"babel\" | \"node\" | \"compiled\" | \"uncompiled\",\n\n /**\n * The type of CommonJS interop included in the environment that will be\n * loading the output code.\n *\n * * 'babel' - CommonJS modules load with Babel's interop. (Default)\n * * 'node' - CommonJS modules load with Node's interop.\n *\n * See descriptions in 'importedInterop' for more details.\n */\n importingInterop: \"babel\" | \"node\",\n\n /**\n * Define whether we explicitly care that the import be a live reference.\n * Only applies when importing default and named imports, not the namespace.\n *\n * * true - Force imported values to be live references.\n * * false - No particular requirements. Keeps the code simplest. (Default)\n */\n ensureLiveReference: boolean,\n\n /**\n * Define if we explicitly care that the result not be a property reference.\n *\n * * true - Force calls to exclude context. Useful if the value is going to\n * be used as function callee.\n * * false - No particular requirements for context of the access. (Default)\n */\n ensureNoContext: boolean,\n};\n\n/**\n * A general helper classes add imports via transforms. See README for usage.\n */\nexport default class ImportInjector {\n /**\n * The path used for manipulation.\n */\n _programPath: NodePath;\n\n /**\n * The scope used to generate unique variable names.\n */\n _programScope;\n\n /**\n * The file used to inject helpers and resolve paths.\n */\n _hub;\n\n /**\n * The default options to use with this instance when imports are added.\n */\n _defaultOpts: ImportOptions = {\n importedSource: null,\n importedType: \"commonjs\",\n importedInterop: \"babel\",\n importingInterop: \"babel\",\n ensureLiveReference: false,\n ensureNoContext: false,\n };\n\n constructor(path, importedSource, opts) {\n const programPath = path.find(p => p.isProgram());\n\n this._programPath = programPath;\n this._programScope = programPath.scope;\n this._hub = programPath.hub;\n\n this._defaultOpts = this._applyDefaults(importedSource, opts, true);\n }\n\n addDefault(importedSourceIn, opts) {\n return this.addNamed(\"default\", importedSourceIn, opts);\n }\n\n addNamed(importName, importedSourceIn, opts) {\n assert(typeof importName === \"string\");\n\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n importName,\n );\n }\n\n addNamespace(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n null,\n );\n }\n\n addSideEffect(importedSourceIn, opts) {\n return this._generateImport(\n this._applyDefaults(importedSourceIn, opts),\n false,\n );\n }\n\n _applyDefaults(importedSource, opts, isInit = false) {\n const optsList = [];\n if (typeof importedSource === \"string\") {\n optsList.push({ importedSource });\n optsList.push(opts);\n } else {\n assert(!opts, \"Unexpected secondary arguments.\");\n\n optsList.push(importedSource);\n }\n\n const newOpts = {\n ...this._defaultOpts,\n };\n for (const opts of optsList) {\n if (!opts) continue;\n Object.keys(newOpts).forEach(key => {\n if (opts[key] !== undefined) newOpts[key] = opts[key];\n });\n\n if (!isInit) {\n if (opts.nameHint !== undefined) newOpts.nameHint = opts.nameHint;\n if (opts.blockHoist !== undefined) newOpts.blockHoist = opts.blockHoist;\n }\n }\n return newOpts;\n }\n\n _generateImport(opts, importName) {\n const isDefault = importName === \"default\";\n const isNamed = !!importName && !isDefault;\n const isNamespace = importName === null;\n\n const {\n importedSource,\n importedType,\n importedInterop,\n importingInterop,\n ensureLiveReference,\n ensureNoContext,\n nameHint,\n\n // Not meant for public usage. Allows code that absolutely must control\n // ordering to set a specific hoist value on the import nodes.\n blockHoist,\n } = opts;\n\n // Provide a hint for generateUidIdentifier for the local variable name\n // to use for the import, if the code will generate a simple assignment\n // to a variable.\n let name = nameHint || importName;\n\n const isMod = isModule(this._programPath);\n const isModuleForNode = isMod && importingInterop === \"node\";\n const isModuleForBabel = isMod && importingInterop === \"babel\";\n\n const builder = new ImportBuilder(\n importedSource,\n this._programScope,\n this._hub,\n );\n\n if (importedType === \"es6\") {\n if (!isModuleForNode && !isModuleForBabel) {\n throw new Error(\"Cannot import an ES6 module from CommonJS\");\n }\n\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(nameHint || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else if (importedType !== \"commonjs\") {\n throw new Error(`Unexpected interopType \"${importedType}\"`);\n } else if (importedInterop === \"babel\") {\n if (isModuleForNode) {\n // import _tmp from ''; var namespace = interopRequireWildcard(_tmp); namespace\n // import _tmp from ''; var def = interopRequireDefault(_tmp).default; def\n // import _tmp from ''; _tmp.named\n name = name !== \"default\" ? name : importedSource;\n const es6Default = `${importedSource}$es6Default`;\n\n builder.import();\n if (isNamespace) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .wildcardInterop();\n } else if (isDefault) {\n if (ensureLiveReference) {\n builder\n .default(es6Default)\n .var(name || importedSource)\n .defaultInterop()\n .read(\"default\");\n } else {\n builder\n .default(es6Default)\n .var(name)\n .defaultInterop()\n .prop(importName);\n }\n } else if (isNamed) {\n builder.default(es6Default).read(importName);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = interopRequireWildcard(require(''));\n // var def = interopRequireDefault(require('')).default; def\n // var named = require('').named; named\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource).wildcardInterop();\n } else if ((isDefault || isNamed) && ensureLiveReference) {\n if (isDefault) {\n name = name !== \"default\" ? name : importedSource;\n builder.var(name).read(importName);\n builder.defaultInterop();\n } else {\n builder.var(importedSource).read(importName);\n }\n } else if (isDefault) {\n builder\n .var(name)\n .defaultInterop()\n .prop(importName);\n } else if (isNamed) {\n builder.var(name).prop(importName);\n }\n }\n } else if (importedInterop === \"compiled\") {\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import namespace from ''; namespace.default\n // import namespace from ''; namespace.named\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import * as namespace from ''; namespace\n // import def from ''; def\n // import { named } from ''; named\n // Note: These lookups will break if the module has no __esModule set,\n // hence the warning that 'compiled' will not work on standard CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.namespace(name || importedSource);\n } else if (isDefault || isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var namespace = require(''); namespace.default\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault || isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.prop(importName).var(name);\n }\n }\n }\n } else if (importedInterop === \"uncompiled\") {\n if (isDefault && ensureLiveReference) {\n throw new Error(\"No live reference for commonjs default\");\n }\n\n if (isModuleForNode) {\n // import namespace from ''; namespace\n // import def from ''; def;\n // import namespace from ''; namespace.named\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.default(importedSource).read(name);\n }\n } else if (isModuleForBabel) {\n // import namespace from '';\n // import def from '';\n // import { named } from ''; named;\n // Note: These lookups will break if the module has __esModule set,\n // hence the warning that 'uncompiled' will not work on ES6 transpiled\n // to CommonJS.\n\n builder.import();\n if (isNamespace) {\n builder.default(name || importedSource);\n } else if (isDefault) {\n builder.default(name);\n } else if (isNamed) {\n builder.named(name, importName);\n }\n } else {\n // var namespace = require(''); namespace\n // var def = require(''); def\n // var namespace = require(''); namespace.named\n // var named = require('').named;\n builder.require();\n if (isNamespace) {\n builder.var(name || importedSource);\n } else if (isDefault) {\n builder.var(name);\n } else if (isNamed) {\n if (ensureLiveReference) {\n builder.var(importedSource).read(name);\n } else {\n builder.var(name).prop(importName);\n }\n }\n }\n } else {\n throw new Error(`Unknown importedInterop \"${importedInterop}\".`);\n }\n\n const { statements, resultName } = builder.done();\n\n this._insertStatements(statements, blockHoist);\n\n if (\n (isDefault || isNamed) &&\n ensureNoContext &&\n resultName.type !== \"Identifier\"\n ) {\n return t.sequenceExpression([t.numericLiteral(0), resultName]);\n }\n return resultName;\n }\n\n _insertStatements(statements, blockHoist = 3) {\n statements.forEach(node => {\n node._blockHoist = blockHoist;\n });\n\n const targetPath = this._programPath.get(\"body\").find(p => {\n const val = p.node._blockHoist;\n return Number.isFinite(val) && val < 4;\n });\n\n if (targetPath) {\n targetPath.insertBefore(statements);\n } else {\n this._programPath.unshiftContainer(\"body\", statements);\n }\n }\n}\n","import ImportInjector from \"./import-injector\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module\";\n\nexport function addDefault(path, importedSource, opts) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nexport function addNamed(path, name, importedSource, opts) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\n\nexport function addNamespace(path, importedSource, opts) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(path, importedSource, opts) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport remapAsyncToGenerator from \"@babel/helper-remap-async-to-generator\";\nimport { addNamed } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { method, module } = options;\n\n if (method && module) {\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n let wrapAsync = state.methodWrapper;\n if (wrapAsync) {\n wrapAsync = t.cloneNode(wrapAsync);\n } else {\n wrapAsync = state.methodWrapper = addNamed(path, method, module);\n }\n\n remapAsyncToGenerator(path, { wrapAsync });\n },\n },\n };\n }\n\n return {\n name: \"transform-async-to-generator\",\n\n visitor: {\n Function(path, state) {\n if (!path.node.async || path.node.generator) return;\n\n remapAsyncToGenerator(path, {\n wrapAsync: state.addHelper(\"asyncToGenerator\"),\n });\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type NodePath from \"@babel/traverse\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { spec } = options;\n return {\n name: \"transform-arrow-functions\",\n\n visitor: {\n ArrowFunctionExpression(\n path: NodePath,\n ) {\n // In some conversion cases, it may have already been converted to a function while this callback\n // was queued up.\n if (!path.isArrowFunctionExpression()) return;\n\n path.arrowFunctionToExpression({\n // While other utils may be fine inserting other arrows to make more transforms possible,\n // the arrow transform itself absolutely cannot insert new arrow functions.\n allowInsertArrow: false,\n specCompliant: !!spec,\n });\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function statementList(key, path) {\n const paths: Array = path.get(key);\n\n for (const path of paths) {\n const func = path.node;\n if (!path.isFunctionDeclaration()) continue;\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(func.id, t.toExpression(func)),\n ]);\n\n // hoist it up above everything else\n declar._blockHoist = 2;\n\n // todo: name this\n func.id = null;\n\n path.replaceWith(declar);\n }\n }\n\n return {\n name: \"transform-block-scoped-functions\",\n\n visitor: {\n BlockStatement(path) {\n const { node, parent } = path;\n if (\n t.isFunction(parent, { body: node }) ||\n t.isExportDeclaration(parent)\n ) {\n return;\n }\n\n statementList(\"body\", path);\n },\n\n SwitchCase(path) {\n statementList(\"consequent\", path);\n },\n },\n };\n});\n","import { types as t, template } from \"@babel/core\";\n\nfunction getTDZStatus(refPath, bindingPath) {\n const executionStatus = bindingPath._guessExecutionStatusRelativeTo(refPath);\n\n if (executionStatus === \"before\") {\n return \"outside\";\n } else if (executionStatus === \"after\") {\n return \"inside\";\n } else {\n return \"maybe\";\n }\n}\n\nfunction buildTDZAssert(node, state) {\n return t.callExpression(state.addHelper(\"temporalRef\"), [\n node,\n t.stringLiteral(node.name),\n ]);\n}\n\nfunction isReference(node, scope, state) {\n const declared = state.letReferences[node.name];\n if (!declared) return false;\n\n // declared node is different in this scope\n return scope.getBindingIdentifier(node.name) === declared;\n}\n\nexport const visitor = {\n ReferencedIdentifier(path, state) {\n if (!state.tdzEnabled) return;\n\n const { node, parent, scope } = path;\n\n if (path.parentPath.isFor({ left: node })) return;\n if (!isReference(node, scope, state)) return;\n\n const bindingPath = scope.getBinding(node.name).path;\n\n if (bindingPath.isFunctionDeclaration()) return;\n\n const status = getTDZStatus(path, bindingPath);\n if (status === \"outside\") return;\n\n if (status === \"maybe\") {\n const assert = buildTDZAssert(node, state);\n\n // add tdzThis to parent variable declarator so it's exploded\n bindingPath.parent._tdzThis = true;\n\n path.skip();\n\n if (path.parentPath.isUpdateExpression()) {\n if (parent._ignoreBlockScopingTDZ) return;\n path.parentPath.replaceWith(t.sequenceExpression([assert, parent]));\n } else {\n path.replaceWith(assert);\n }\n } else if (status === \"inside\") {\n path.replaceWith(template.ast`${state.addHelper(\"tdz\")}(\"${node.name}\")`);\n }\n },\n\n AssignmentExpression: {\n exit(path, state) {\n if (!state.tdzEnabled) return;\n\n const { node } = path;\n if (node._ignoreBlockScopingTDZ) return;\n\n const nodes = [];\n const ids = path.getBindingIdentifiers();\n\n for (const name of Object.keys(ids)) {\n const id = ids[name];\n\n if (isReference(id, path.scope, state)) {\n nodes.push(id);\n }\n }\n\n if (nodes.length) {\n node._ignoreBlockScopingTDZ = true;\n nodes.push(node);\n path.replaceWithMultiple(nodes.map(n => t.expressionStatement(n)));\n }\n },\n },\n};\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var copyObject = require('./_copyObject'),\n createAssigner = require('./_createAssigner'),\n keysIn = require('./keysIn');\n\n/**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\nvar assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n});\n\nmodule.exports = assignIn;\n","module.exports = require('./assignIn');\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport type NodePath from \"@babel/traverse\";\nimport type Scope from \"@babel/traverse\";\nimport { visitor as tdzVisitor } from \"./tdz\";\nimport values from \"lodash/values\";\nimport extend from \"lodash/extend\";\nimport { traverse, template, types as t } from \"@babel/core\";\n\nconst DONE = new WeakSet();\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const { throwIfClosureRequired = false, tdz: tdzEnabled = false } = opts;\n if (typeof throwIfClosureRequired !== \"boolean\") {\n throw new Error(`.throwIfClosureRequired must be a boolean, or undefined`);\n }\n if (typeof tdzEnabled !== \"boolean\") {\n throw new Error(`.tdz must be a boolean, or undefined`);\n }\n\n return {\n name: \"transform-block-scoping\",\n\n visitor: {\n VariableDeclaration(path) {\n const { node, parent, scope } = path;\n if (!isBlockScoped(node)) return;\n convertBlockScopedToVar(path, null, parent, scope, true);\n\n if (node._tdzThis) {\n const nodes = [node];\n\n for (let i = 0; i < node.declarations.length; i++) {\n const decl = node.declarations[i];\n const assign = t.assignmentExpression(\n \"=\",\n decl.id,\n decl.init || scope.buildUndefinedNode(),\n );\n assign._ignoreBlockScopingTDZ = true;\n nodes.push(t.expressionStatement(assign));\n decl.init = this.addHelper(\"temporalUndefined\");\n }\n\n node._blockHoist = 2;\n\n if (path.isCompletionRecord()) {\n // ensure we don't break completion record semantics by returning\n // the initialiser of the last declarator\n nodes.push(t.expressionStatement(scope.buildUndefinedNode()));\n }\n\n path.replaceWithMultiple(nodes);\n }\n },\n\n Loop(path, state) {\n const { parent, scope } = path;\n path.ensureBlock();\n const blockScoping = new BlockScoping(\n path,\n path.get(\"body\"),\n parent,\n scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n const replace = blockScoping.run();\n if (replace) path.replaceWith(replace);\n },\n\n CatchClause(path, state) {\n const { parent, scope } = path;\n const blockScoping = new BlockScoping(\n null,\n path.get(\"body\"),\n parent,\n scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n blockScoping.run();\n },\n\n \"BlockStatement|SwitchStatement|Program\"(path, state) {\n if (!ignoreBlock(path)) {\n const blockScoping = new BlockScoping(\n null,\n path,\n path.parent,\n path.scope,\n throwIfClosureRequired,\n tdzEnabled,\n state,\n );\n blockScoping.run();\n }\n },\n },\n };\n});\n\nfunction ignoreBlock(path) {\n return t.isLoop(path.parent) || t.isCatchClause(path.parent);\n}\n\nconst buildRetCheck = template(`\n if (typeof RETURN === \"object\") return RETURN.v;\n`);\n\nfunction isBlockScoped(node) {\n if (!t.isVariableDeclaration(node)) return false;\n if (node[t.BLOCK_SCOPED_SYMBOL]) return true;\n if (node.kind !== \"let\" && node.kind !== \"const\") return false;\n return true;\n}\n\n/**\n * If there is a loop ancestor closer than the closest function, we\n * consider ourselves to be in a loop.\n */\nfunction isInLoop(path) {\n const loopOrFunctionParent = path.find(\n path => path.isLoop() || path.isFunction(),\n );\n\n return loopOrFunctionParent && loopOrFunctionParent.isLoop();\n}\n\nfunction convertBlockScopedToVar(\n path,\n node,\n parent,\n scope,\n moveBindingsToParent = false,\n) {\n if (!node) {\n node = path.node;\n }\n\n // https://github.com/babel/babel/issues/255\n if (isInLoop(path) && !t.isFor(parent)) {\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n declar.init = declar.init || scope.buildUndefinedNode();\n }\n }\n\n node[t.BLOCK_SCOPED_SYMBOL] = true;\n node.kind = \"var\";\n\n // Move bindings from current block scope to function scope.\n if (moveBindingsToParent) {\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n const binding = scope.getOwnBinding(name);\n if (binding) binding.kind = \"var\";\n scope.moveBindingTo(name, parentScope);\n }\n }\n}\n\nfunction isVar(node) {\n return t.isVariableDeclaration(node, { kind: \"var\" }) && !isBlockScoped(node);\n}\n\nconst letReferenceBlockVisitor = traverse.visitors.merge([\n {\n Loop: {\n enter(path, state) {\n state.loopDepth++;\n },\n exit(path, state) {\n state.loopDepth--;\n },\n },\n Function(path, state) {\n // References to block-scoped variables only require added closures if it's\n // possible for the code to run more than once -- otherwise it is safe to\n // simply rename the variables.\n if (state.loopDepth > 0) {\n path.traverse(letReferenceFunctionVisitor, state);\n } else {\n path.traverse(tdzVisitor, state);\n }\n return path.skip();\n },\n },\n tdzVisitor,\n]);\n\nconst letReferenceFunctionVisitor = traverse.visitors.merge([\n {\n ReferencedIdentifier(path, state) {\n const ref = state.letReferences[path.node.name];\n\n // not a part of our scope\n if (!ref) return;\n\n // this scope has a variable with the same name so it couldn't belong\n // to our let scope\n const localBinding = path.scope.getBindingIdentifier(path.node.name);\n if (localBinding && localBinding !== ref) return;\n\n state.closurify = true;\n },\n },\n tdzVisitor,\n]);\n\nconst hoistVarDeclarationsVisitor = {\n enter(path, self) {\n const { node, parent } = path;\n\n if (path.isForStatement()) {\n if (isVar(node.init, node)) {\n const nodes = self.pushDeclar(node.init);\n if (nodes.length === 1) {\n node.init = nodes[0];\n } else {\n node.init = t.sequenceExpression(nodes);\n }\n }\n } else if (path.isFor()) {\n if (isVar(node.left, node)) {\n self.pushDeclar(node.left);\n node.left = node.left.declarations[0].id;\n }\n } else if (isVar(node, parent)) {\n path.replaceWithMultiple(\n self.pushDeclar(node).map(expr => t.expressionStatement(expr)),\n );\n } else if (path.isFunction()) {\n return path.skip();\n }\n },\n};\n\nconst loopLabelVisitor = {\n LabeledStatement({ node }, state) {\n state.innerLabels.push(node.label.name);\n },\n};\n\nconst continuationVisitor = {\n enter(path, state) {\n if (path.isAssignmentExpression() || path.isUpdateExpression()) {\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n if (\n state.outsideReferences[name] !==\n path.scope.getBindingIdentifier(name)\n ) {\n continue;\n }\n state.reassignments[name] = true;\n }\n } else if (path.isReturnStatement()) {\n state.returnStatements.push(path);\n }\n },\n};\n\nfunction loopNodeTo(node) {\n if (t.isBreakStatement(node)) {\n return \"break\";\n } else if (t.isContinueStatement(node)) {\n return \"continue\";\n }\n}\n\nconst loopVisitor = {\n Loop(path, state) {\n const oldIgnoreLabeless = state.ignoreLabeless;\n state.ignoreLabeless = true;\n path.traverse(loopVisitor, state);\n state.ignoreLabeless = oldIgnoreLabeless;\n path.skip();\n },\n\n Function(path) {\n path.skip();\n },\n\n SwitchCase(path, state) {\n const oldInSwitchCase = state.inSwitchCase;\n state.inSwitchCase = true;\n path.traverse(loopVisitor, state);\n state.inSwitchCase = oldInSwitchCase;\n path.skip();\n },\n\n \"BreakStatement|ContinueStatement|ReturnStatement\"(path, state) {\n const { node, scope } = path;\n if (node[this.LOOP_IGNORE]) return;\n\n let replace;\n let loopText = loopNodeTo(node);\n\n if (loopText) {\n if (node.label) {\n // we shouldn't be transforming this because it exists somewhere inside\n if (state.innerLabels.indexOf(node.label.name) >= 0) {\n return;\n }\n\n loopText = `${loopText}|${node.label.name}`;\n } else {\n // we shouldn't be transforming these statements because\n // they don't refer to the actual loop we're scopifying\n if (state.ignoreLabeless) return;\n\n // break statements mean something different in this context\n if (t.isBreakStatement(node) && state.inSwitchCase) return;\n }\n\n state.hasBreakContinue = true;\n state.map[loopText] = node;\n replace = t.stringLiteral(loopText);\n }\n\n if (path.isReturnStatement()) {\n state.hasReturn = true;\n replace = t.objectExpression([\n t.objectProperty(\n t.identifier(\"v\"),\n node.argument || scope.buildUndefinedNode(),\n ),\n ]);\n }\n\n if (replace) {\n replace = t.returnStatement(replace);\n replace[this.LOOP_IGNORE] = true;\n path.skip();\n path.replaceWith(t.inherits(replace, node));\n }\n },\n};\n\nclass BlockScoping {\n constructor(\n loopPath?: NodePath,\n blockPath: NodePath,\n parent: Object,\n scope: Scope,\n throwIfClosureRequired: boolean,\n tdzEnabled: boolean,\n state: Object,\n ) {\n this.parent = parent;\n this.scope = scope;\n this.state = state;\n this.throwIfClosureRequired = throwIfClosureRequired;\n this.tdzEnabled = tdzEnabled;\n\n this.blockPath = blockPath;\n this.block = blockPath.node;\n\n this.outsideLetReferences = Object.create(null);\n this.hasLetReferences = false;\n this.letReferences = Object.create(null);\n this.body = [];\n\n if (loopPath) {\n this.loopParent = loopPath.parent;\n this.loopLabel =\n t.isLabeledStatement(this.loopParent) && this.loopParent.label;\n this.loopPath = loopPath;\n this.loop = loopPath.node;\n }\n }\n\n /**\n * Start the ball rolling.\n */\n\n run() {\n const block = this.block;\n if (DONE.has(block)) return;\n DONE.add(block);\n\n const needsClosure = this.getLetReferences();\n\n this.checkConstants();\n\n // this is a block within a `Function/Program` so we can safely leave it be\n if (t.isFunction(this.parent) || t.isProgram(this.block)) {\n this.updateScopeInfo();\n return;\n }\n\n // we can skip everything\n if (!this.hasLetReferences) return;\n\n if (needsClosure) {\n this.wrapClosure();\n } else {\n this.remap();\n }\n\n this.updateScopeInfo(needsClosure);\n\n if (this.loopLabel && !t.isLabeledStatement(this.loopParent)) {\n return t.labeledStatement(this.loopLabel, this.loop);\n }\n }\n\n checkConstants() {\n const scope = this.scope;\n const state = this.state;\n\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind !== \"const\") continue;\n\n for (const violation of (binding.constantViolations: Array)) {\n const readOnlyError = state.addHelper(\"readOnlyError\");\n const throwNode = t.callExpression(readOnlyError, [\n t.stringLiteral(name),\n ]);\n\n if (violation.isAssignmentExpression()) {\n violation\n .get(\"right\")\n .replaceWith(\n t.sequenceExpression([throwNode, violation.get(\"right\").node]),\n );\n } else if (violation.isUpdateExpression()) {\n violation.replaceWith(\n t.sequenceExpression([throwNode, violation.node]),\n );\n } else if (violation.isForXStatement()) {\n violation.ensureBlock();\n violation.node.body.body.unshift(t.expressionStatement(throwNode));\n }\n }\n }\n }\n\n updateScopeInfo(wrappedInClosure) {\n const blockScope = this.blockPath.scope;\n\n const parentScope =\n blockScope.getFunctionParent() || blockScope.getProgramParent();\n const letRefs = this.letReferences;\n\n for (const key of Object.keys(letRefs)) {\n const ref = letRefs[key];\n const binding = blockScope.getBinding(ref.name);\n if (!binding) continue;\n if (binding.kind === \"let\" || binding.kind === \"const\") {\n binding.kind = \"var\";\n\n if (wrappedInClosure) {\n if (blockScope.hasOwnBinding(ref.name)) {\n blockScope.removeBinding(ref.name);\n }\n } else {\n blockScope.moveBindingTo(ref.name, parentScope);\n }\n }\n }\n }\n\n remap() {\n const letRefs = this.letReferences;\n const outsideLetRefs = this.outsideLetReferences;\n const scope = this.scope;\n const blockPathScope = this.blockPath.scope;\n\n // alright, so since we aren't wrapping this block in a closure\n // we have to check if any of our let variables collide with\n // those in upper scopes and then if they do, generate a uid\n // for them and replace all references with it\n\n for (const key of Object.keys(letRefs)) {\n // just an Identifier node we collected in `getLetReferences`\n // this is the defining identifier of a declaration\n const ref = letRefs[key];\n\n // todo: could skip this if the colliding binding is in another function\n if (scope.parentHasBinding(key) || scope.hasGlobal(key)) {\n // The same identifier might have been bound separately in the block scope and\n // the enclosing scope (e.g. loop or catch statement), so we should handle both\n // individually\n if (scope.hasOwnBinding(key)) {\n scope.rename(ref.name);\n }\n\n if (blockPathScope.hasOwnBinding(key)) {\n blockPathScope.rename(ref.name);\n }\n }\n }\n\n for (const key of Object.keys(outsideLetRefs)) {\n const ref = letRefs[key];\n // check for collisions with a for loop's init variable and the enclosing scope's bindings\n // https://github.com/babel/babel/issues/8498\n if (isInLoop(this.blockPath) && blockPathScope.hasOwnBinding(key)) {\n blockPathScope.rename(ref.name);\n }\n }\n }\n\n wrapClosure() {\n if (this.throwIfClosureRequired) {\n throw this.blockPath.buildCodeFrameError(\n \"Compiling let/const in this block would add a closure \" +\n \"(throwIfClosureRequired).\",\n );\n }\n const block = this.block;\n\n const outsideRefs = this.outsideLetReferences;\n\n // remap loop heads with colliding variables\n if (this.loop) {\n for (const name of Object.keys(outsideRefs)) {\n const id = outsideRefs[name];\n\n if (\n this.scope.hasGlobal(id.name) ||\n this.scope.parentHasBinding(id.name)\n ) {\n delete outsideRefs[id.name];\n delete this.letReferences[id.name];\n\n this.scope.rename(id.name);\n\n this.letReferences[id.name] = id;\n outsideRefs[id.name] = id;\n }\n }\n }\n\n // if we're inside of a for loop then we search to see if there are any\n // `break`s, `continue`s, `return`s etc\n this.has = this.checkLoop();\n\n // hoist let references to retain scope\n this.hoistVarDeclarations();\n\n // turn outsideLetReferences into an array\n const args = values(outsideRefs).map(id => t.cloneNode(id));\n const params = args.map(id => t.cloneNode(id));\n\n const isSwitch = this.blockPath.isSwitchStatement();\n\n // build the closure that we're going to wrap the block with, possible wrapping switch(){}\n const fn = t.functionExpression(\n null,\n params,\n t.blockStatement(isSwitch ? [block] : block.body),\n );\n\n // continuation\n this.addContinuations(fn);\n\n let call = t.callExpression(t.nullLiteral(), args);\n let basePath = \".callee\";\n\n // handle generators\n const hasYield = traverse.hasType(\n fn.body,\n \"YieldExpression\",\n t.FUNCTION_TYPES,\n );\n if (hasYield) {\n fn.generator = true;\n call = t.yieldExpression(call, true);\n basePath = \".argument\" + basePath;\n }\n\n // handlers async functions\n const hasAsync = traverse.hasType(\n fn.body,\n \"AwaitExpression\",\n t.FUNCTION_TYPES,\n );\n if (hasAsync) {\n fn.async = true;\n call = t.awaitExpression(call);\n basePath = \".argument\" + basePath;\n }\n\n let placeholderPath;\n let index;\n if (this.has.hasReturn || this.has.hasBreakContinue) {\n const ret = this.scope.generateUid(\"ret\");\n\n this.body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(ret), call),\n ]),\n );\n placeholderPath = \"declarations.0.init\" + basePath;\n index = this.body.length - 1;\n\n this.buildHas(ret);\n } else {\n this.body.push(t.expressionStatement(call));\n placeholderPath = \"expression\" + basePath;\n index = this.body.length - 1;\n }\n\n let callPath;\n // replace the current block body with the one we're going to build\n if (isSwitch) {\n const { parentPath, listKey, key } = this.blockPath;\n\n this.blockPath.replaceWithMultiple(this.body);\n callPath = parentPath.get(listKey)[key + index];\n } else {\n block.body = this.body;\n callPath = this.blockPath.get(\"body\")[index];\n }\n\n const placeholder = callPath.get(placeholderPath);\n\n let fnPath;\n if (this.loop) {\n const loopId = this.scope.generateUid(\"loop\");\n const p = this.loopPath.insertBefore(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(loopId), fn),\n ]),\n );\n\n placeholder.replaceWith(t.identifier(loopId));\n fnPath = p[0].get(\"declarations.0.init\");\n } else {\n placeholder.replaceWith(fn);\n fnPath = placeholder;\n }\n\n // Ensure \"this\", \"arguments\", and \"super\" continue to work in the wrapped function.\n fnPath.unwrapFunctionEnvironment();\n }\n\n /**\n * If any of the outer let variables are reassigned then we need to rename them in\n * the closure so we can get direct access to the outer variable to continue the\n * iteration with bindings based on each iteration.\n *\n * Reference: https://github.com/babel/babel/issues/1078\n */\n\n addContinuations(fn) {\n const state = {\n reassignments: {},\n returnStatements: [],\n outsideReferences: this.outsideLetReferences,\n };\n\n this.scope.traverse(fn, continuationVisitor, state);\n\n for (let i = 0; i < fn.params.length; i++) {\n const param = fn.params[i];\n if (!state.reassignments[param.name]) continue;\n\n const paramName = param.name;\n const newParamName = this.scope.generateUid(param.name);\n fn.params[i] = t.identifier(newParamName);\n\n this.scope.rename(paramName, newParamName, fn);\n\n state.returnStatements.forEach(returnStatement => {\n returnStatement.insertBefore(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(paramName),\n t.identifier(newParamName),\n ),\n ),\n );\n });\n\n // assign outer reference as it's been modified internally and needs to be retained\n fn.body.body.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(paramName),\n t.identifier(newParamName),\n ),\n ),\n );\n }\n }\n\n getLetReferences() {\n const block = this.block;\n\n let declarators = [];\n\n if (this.loop) {\n const init = this.loop.left || this.loop.init;\n if (isBlockScoped(init)) {\n declarators.push(init);\n extend(this.outsideLetReferences, t.getBindingIdentifiers(init));\n }\n }\n\n const addDeclarationsFromChild = (path, node) => {\n node = node || path.node;\n if (\n t.isClassDeclaration(node) ||\n t.isFunctionDeclaration(node) ||\n isBlockScoped(node)\n ) {\n if (isBlockScoped(node)) {\n convertBlockScopedToVar(path, node, block, this.scope);\n }\n declarators = declarators.concat(node.declarations || node);\n }\n if (t.isLabeledStatement(node)) {\n addDeclarationsFromChild(path.get(\"body\"), node.body);\n }\n };\n\n //\n if (block.body) {\n const declarPaths = this.blockPath.get(\"body\");\n for (let i = 0; i < block.body.length; i++) {\n addDeclarationsFromChild(declarPaths[i]);\n }\n }\n\n if (block.cases) {\n const declarPaths = this.blockPath.get(\"cases\");\n for (let i = 0; i < block.cases.length; i++) {\n const consequents = block.cases[i].consequent;\n\n for (let j = 0; j < consequents.length; j++) {\n const declar = consequents[j];\n addDeclarationsFromChild(declarPaths[i], declar);\n }\n }\n }\n\n //\n for (let i = 0; i < declarators.length; i++) {\n const declar = declarators[i];\n // Passing true as the third argument causes t.getBindingIdentifiers\n // to return only the *outer* binding identifiers of this\n // declaration, rather than (for example) mistakenly including the\n // parameters of a function declaration. Fixes #4880.\n const keys = t.getBindingIdentifiers(declar, false, true);\n extend(this.letReferences, keys);\n this.hasLetReferences = true;\n }\n\n // no let references so we can just quit\n if (!this.hasLetReferences) return;\n\n const state = {\n letReferences: this.letReferences,\n closurify: false,\n loopDepth: 0,\n tdzEnabled: this.tdzEnabled,\n addHelper: name => this.state.addHelper(name),\n };\n\n if (isInLoop(this.blockPath)) {\n state.loopDepth++;\n }\n\n // traverse through this block, stopping on functions and checking if they\n // contain any local let references\n this.blockPath.traverse(letReferenceBlockVisitor, state);\n\n return state.closurify;\n }\n\n /**\n * If we're inside of a loop then traverse it and check if it has one of\n * the following node types `ReturnStatement`, `BreakStatement`,\n * `ContinueStatement` and replace it with a return value that we can track\n * later on.\n */\n\n checkLoop(): Object {\n const state = {\n hasBreakContinue: false,\n ignoreLabeless: false,\n inSwitchCase: false,\n innerLabels: [],\n hasReturn: false,\n isLoop: !!this.loop,\n map: {},\n LOOP_IGNORE: Symbol(),\n };\n\n this.blockPath.traverse(loopLabelVisitor, state);\n this.blockPath.traverse(loopVisitor, state);\n\n return state;\n }\n\n /**\n * Hoist all let declarations in this block to before it so they retain scope\n * once we wrap everything in a closure.\n */\n\n hoistVarDeclarations() {\n this.blockPath.traverse(hoistVarDeclarationsVisitor, this);\n }\n\n /**\n * Turn a `VariableDeclaration` into an array of `AssignmentExpressions` with\n * their declarations hoisted to before the closure wrapper.\n */\n\n pushDeclar(node: { type: \"VariableDeclaration\" }): Array {\n const declars = [];\n const names = t.getBindingIdentifiers(node);\n for (const name of Object.keys(names)) {\n declars.push(t.variableDeclarator(names[name]));\n }\n\n this.body.push(t.variableDeclaration(node.kind, declars));\n\n const replace = [];\n\n for (let i = 0; i < node.declarations.length; i++) {\n const declar = node.declarations[i];\n if (!declar.init) continue;\n\n const expr = t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.id),\n t.cloneNode(declar.init),\n );\n replace.push(t.inherits(expr, declar));\n }\n\n return replace;\n }\n\n buildHas(ret: string) {\n const body = this.body;\n\n let retCheck;\n const has = this.has;\n const cases = [];\n\n if (has.hasReturn) {\n // typeof ret === \"object\"\n retCheck = buildRetCheck({\n RETURN: t.identifier(ret),\n });\n }\n\n if (has.hasBreakContinue) {\n for (const key of Object.keys(has.map)) {\n cases.push(t.switchCase(t.stringLiteral(key), [has.map[key]]));\n }\n\n if (has.hasReturn) {\n cases.push(t.switchCase(null, [retCheck]));\n }\n\n if (cases.length === 1) {\n const single = cases[0];\n body.push(\n t.ifStatement(\n t.binaryExpression(\"===\", t.identifier(ret), single.test),\n single.consequent[0],\n ),\n );\n } else {\n if (this.loop) {\n // https://github.com/babel/babel/issues/998\n for (let i = 0; i < cases.length; i++) {\n const caseConsequent = cases[i].consequent[0];\n if (t.isBreakStatement(caseConsequent) && !caseConsequent.label) {\n if (!this.loopLabel) {\n this.loopLabel = this.scope.generateUidIdentifier(\"loop\");\n }\n caseConsequent.label = t.cloneNode(this.loopLabel);\n }\n }\n }\n\n body.push(t.switchStatement(t.identifier(ret), cases));\n }\n } else {\n if (has.hasReturn) {\n body.push(retCheck);\n }\n }\n }\n}\n","'use strict';\nmodule.exports = require('./globals.json');\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n","var baseHas = require('./_baseHas'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n","import nameFunction from \"@babel/helper-function-name\";\nimport has from \"lodash/has\";\nimport * as t from \"@babel/types\";\n\nfunction toKind(node: Object) {\n if (t.isClassMethod(node) || t.isObjectMethod(node)) {\n if (node.kind === \"get\" || node.kind === \"set\") {\n return node.kind;\n }\n }\n\n return \"value\";\n}\n\nexport function push(\n mutatorMap: Object,\n node: Object,\n kind: string,\n file,\n scope?,\n): Object {\n const alias = t.toKeyAlias(node);\n\n //\n\n let map = {};\n if (has(mutatorMap, alias)) map = mutatorMap[alias];\n mutatorMap[alias] = map;\n\n //\n\n map._inherits = map._inherits || [];\n map._inherits.push(node);\n\n map._key = node.key;\n\n if (node.computed) {\n map._computed = true;\n }\n\n if (node.decorators) {\n const decorators = (map.decorators =\n map.decorators || t.arrayExpression([]));\n decorators.elements = decorators.elements.concat(\n node.decorators.map(dec => dec.expression).reverse(),\n );\n }\n\n if (map.value || map.initializer) {\n throw file.buildCodeFrameError(node, \"Key conflict with sibling node\");\n }\n\n let key, value;\n\n // save the key so we can possibly do function name inferences\n if (\n t.isObjectProperty(node) ||\n t.isObjectMethod(node) ||\n t.isClassMethod(node)\n ) {\n key = t.toComputedKey(node, node.key);\n }\n\n if (t.isProperty(node)) {\n value = node.value;\n } else if (t.isObjectMethod(node) || t.isClassMethod(node)) {\n value = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n value.returnType = node.returnType;\n }\n\n const inheritedKind = toKind(node);\n if (!kind || inheritedKind !== \"value\") {\n kind = inheritedKind;\n }\n\n // infer function name\n if (\n scope &&\n t.isStringLiteral(key) &&\n (kind === \"value\" || kind === \"initializer\") &&\n t.isFunctionExpression(value)\n ) {\n value = nameFunction({ id: key, node: value, scope });\n }\n\n if (value) {\n t.inheritsComments(value, node);\n map[kind] = value;\n }\n\n return map;\n}\n\nexport function hasComputed(mutatorMap: Object): boolean {\n for (const key of Object.keys(mutatorMap)) {\n if (mutatorMap[key]._computed) {\n return true;\n }\n }\n return false;\n}\n\nexport function toComputedObjectFromClass(obj: Object): Object {\n const objExpr = t.arrayExpression([]);\n\n for (let i = 0; i < obj.properties.length; i++) {\n const prop = obj.properties[i];\n const val = prop.value;\n val.properties.unshift(\n t.objectProperty(t.identifier(\"key\"), t.toComputedKey(prop)),\n );\n objExpr.elements.push(val);\n }\n\n return objExpr;\n}\n\nexport function toClassObject(mutatorMap: Object): Object {\n const objExpr = t.objectExpression([]);\n\n Object.keys(mutatorMap).forEach(function(mutatorMapKey) {\n const map = mutatorMap[mutatorMapKey];\n const mapNode = t.objectExpression([]);\n\n const propNode = t.objectProperty(map._key, mapNode, map._computed);\n\n Object.keys(map).forEach(function(key) {\n const node = map[key];\n if (key[0] === \"_\") return;\n\n const prop = t.objectProperty(t.identifier(key), node);\n t.inheritsComments(prop, node);\n t.removeComments(node);\n\n mapNode.properties.push(prop);\n });\n\n objExpr.properties.push(propNode);\n });\n\n return objExpr;\n}\n\nexport function toDefineObject(mutatorMap: Object): Object {\n Object.keys(mutatorMap).forEach(function(key) {\n const map = mutatorMap[key];\n if (map.value) map.writable = t.booleanLiteral(true);\n map.configurable = t.booleanLiteral(true);\n map.enumerable = t.booleanLiteral(true);\n });\n\n return toClassObject(mutatorMap);\n}\n","import type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport ReplaceSupers, {\n environmentVisitor,\n} from \"@babel/helper-replace-supers\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport * as defineMap from \"@babel/helper-define-map\";\nimport { traverse, template, types as t } from \"@babel/core\";\n\ntype ReadonlySet = Set | { has(val: T): boolean };\n\nfunction buildConstructor(classRef, constructorBody, node) {\n const func = t.functionDeclaration(\n t.cloneNode(classRef),\n [],\n constructorBody,\n );\n t.inherits(func, node);\n return func;\n}\n\nexport default function transformClass(\n path: NodePath,\n file: any,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n) {\n const classState = {\n parent: undefined,\n scope: undefined,\n node: undefined,\n path: undefined,\n file: undefined,\n\n classId: undefined,\n classRef: undefined,\n superName: undefined,\n superReturns: [],\n isDerived: false,\n extendsNative: false,\n\n construct: undefined,\n constructorBody: undefined,\n userConstructor: undefined,\n userConstructorPath: undefined,\n hasConstructor: false,\n\n instancePropBody: [],\n instancePropRefs: {},\n staticPropBody: [],\n body: [],\n superThises: [],\n pushedConstructor: false,\n pushedInherits: false,\n protoAlias: null,\n isLoose: false,\n\n hasInstanceDescriptors: false,\n hasStaticDescriptors: false,\n instanceMutatorMap: {},\n staticMutatorMap: {},\n };\n\n const setState = newState => {\n Object.assign(classState, newState);\n };\n\n const findThisesVisitor = traverse.visitors.merge([\n environmentVisitor,\n {\n ThisExpression(path) {\n classState.superThises.push(path);\n },\n },\n ]);\n\n function pushToMap(node, enumerable, kind = \"value\", scope?) {\n let mutatorMap;\n if (node.static) {\n setState({ hasStaticDescriptors: true });\n mutatorMap = classState.staticMutatorMap;\n } else {\n setState({ hasInstanceDescriptors: true });\n mutatorMap = classState.instanceMutatorMap;\n }\n\n const map = defineMap.push(mutatorMap, node, kind, classState.file, scope);\n\n if (enumerable) {\n map.enumerable = t.booleanLiteral(true);\n }\n\n return map;\n }\n\n /**\n * Creates a class constructor or bail out if there is none\n */\n function maybeCreateConstructor() {\n let hasConstructor = false;\n const paths = classState.path.get(\"body.body\");\n for (const path of paths) {\n hasConstructor = path.equals(\"kind\", \"constructor\");\n if (hasConstructor) break;\n }\n if (hasConstructor) return;\n\n let params, body;\n\n if (classState.isDerived) {\n const constructor = template.expression.ast`\n (function () {\n super(...arguments);\n })\n `;\n params = constructor.params;\n body = constructor.body;\n } else {\n params = [];\n body = t.blockStatement([]);\n }\n\n classState.path\n .get(\"body\")\n .unshiftContainer(\n \"body\",\n t.classMethod(\"constructor\", t.identifier(\"constructor\"), params, body),\n );\n }\n\n function buildBody() {\n maybeCreateConstructor();\n pushBody();\n verifyConstructor();\n\n if (classState.userConstructor) {\n const { constructorBody, userConstructor, construct } = classState;\n constructorBody.body = constructorBody.body.concat(\n userConstructor.body.body,\n );\n t.inherits(construct, userConstructor);\n t.inherits(constructorBody, userConstructor.body);\n }\n\n pushDescriptors();\n }\n\n function pushBody() {\n const classBodyPaths: Array = classState.path.get(\"body.body\");\n\n for (const path of classBodyPaths) {\n const node = path.node;\n\n if (path.isClassProperty()) {\n throw path.buildCodeFrameError(\"Missing class properties transform.\");\n }\n\n if (node.decorators) {\n throw path.buildCodeFrameError(\n \"Method has decorators, put the decorator plugin before the classes one.\",\n );\n }\n\n if (t.isClassMethod(node)) {\n const isConstructor = node.kind === \"constructor\";\n\n const replaceSupers = new ReplaceSupers({\n methodPath: path,\n objectRef: classState.classRef,\n superRef: classState.superName,\n isLoose: classState.isLoose,\n file: classState.file,\n });\n\n replaceSupers.replace();\n\n const superReturns = [];\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n ReturnStatement(path) {\n if (!path.getFunctionParent().isArrowFunctionExpression()) {\n superReturns.push(path);\n }\n },\n },\n ]),\n );\n\n if (isConstructor) {\n pushConstructor(superReturns, node, path);\n } else {\n pushMethod(node, path);\n }\n }\n }\n }\n\n function clearDescriptors() {\n setState({\n hasInstanceDescriptors: false,\n hasStaticDescriptors: false,\n instanceMutatorMap: {},\n staticMutatorMap: {},\n });\n }\n\n function pushDescriptors() {\n pushInheritsToBody();\n\n const { body } = classState;\n\n let instanceProps;\n let staticProps;\n\n if (classState.hasInstanceDescriptors) {\n instanceProps = defineMap.toClassObject(classState.instanceMutatorMap);\n }\n\n if (classState.hasStaticDescriptors) {\n staticProps = defineMap.toClassObject(classState.staticMutatorMap);\n }\n\n if (instanceProps || staticProps) {\n if (instanceProps) {\n instanceProps = defineMap.toComputedObjectFromClass(instanceProps);\n }\n if (staticProps) {\n staticProps = defineMap.toComputedObjectFromClass(staticProps);\n }\n\n let args = [\n t.cloneNode(classState.classRef), // Constructor\n t.nullLiteral(), // instanceDescriptors\n t.nullLiteral(), // staticDescriptors\n ];\n\n if (instanceProps) args[1] = instanceProps;\n if (staticProps) args[2] = staticProps;\n\n let lastNonNullIndex = 0;\n for (let i = 0; i < args.length; i++) {\n if (!t.isNullLiteral(args[i])) lastNonNullIndex = i;\n }\n args = args.slice(0, lastNonNullIndex + 1);\n\n body.push(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"createClass\"), args),\n ),\n );\n }\n\n clearDescriptors();\n }\n\n function wrapSuperCall(bareSuper, superRef, thisRef, body) {\n let bareSuperNode = bareSuper.node;\n let call;\n\n if (classState.isLoose) {\n bareSuperNode.arguments.unshift(t.thisExpression());\n if (\n bareSuperNode.arguments.length === 2 &&\n t.isSpreadElement(bareSuperNode.arguments[1]) &&\n t.isIdentifier(bareSuperNode.arguments[1].argument, {\n name: \"arguments\",\n })\n ) {\n // special case single arguments spread\n bareSuperNode.arguments[1] = bareSuperNode.arguments[1].argument;\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"apply\"),\n );\n } else {\n bareSuperNode.callee = t.memberExpression(\n t.cloneNode(superRef),\n t.identifier(\"call\"),\n );\n }\n\n call = t.logicalExpression(\"||\", bareSuperNode, t.thisExpression());\n } else {\n bareSuperNode = optimiseCall(\n t.callExpression(classState.file.addHelper(\"getPrototypeOf\"), [\n t.cloneNode(classState.classRef),\n ]),\n t.thisExpression(),\n bareSuperNode.arguments,\n );\n\n call = t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n [t.thisExpression(), bareSuperNode],\n );\n }\n\n if (\n bareSuper.parentPath.isExpressionStatement() &&\n bareSuper.parentPath.container === body.node.body &&\n body.node.body.length - 1 === bareSuper.parentPath.key\n ) {\n // this super call is the last statement in the body so we can just straight up\n // turn it into a return\n\n if (classState.superThises.length) {\n call = t.assignmentExpression(\"=\", thisRef(), call);\n }\n\n bareSuper.parentPath.replaceWith(t.returnStatement(call));\n } else {\n bareSuper.replaceWith(t.assignmentExpression(\"=\", thisRef(), call));\n }\n }\n\n function verifyConstructor() {\n if (!classState.isDerived) return;\n\n const path = classState.userConstructorPath;\n const body = path.get(\"body\");\n\n path.traverse(findThisesVisitor);\n\n let thisRef = function() {\n const ref = path.scope.generateDeclaredUidIdentifier(\"this\");\n thisRef = () => t.cloneNode(ref);\n return ref;\n };\n\n for (const thisPath of classState.superThises) {\n const { node, parentPath } = thisPath;\n if (parentPath.isMemberExpression({ object: node })) {\n thisPath.replaceWith(thisRef());\n continue;\n }\n thisPath.replaceWith(\n t.callExpression(classState.file.addHelper(\"assertThisInitialized\"), [\n thisRef(),\n ]),\n );\n }\n\n const bareSupers = new Set();\n path.traverse(\n traverse.visitors.merge([\n environmentVisitor,\n {\n Super(path) {\n const { node, parentPath } = path;\n if (parentPath.isCallExpression({ callee: node })) {\n bareSupers.add(parentPath);\n }\n },\n },\n ]),\n );\n\n let guaranteedSuperBeforeFinish = !!bareSupers.size;\n\n for (const bareSuper of bareSupers) {\n wrapSuperCall(bareSuper, classState.superName, thisRef, body);\n\n if (guaranteedSuperBeforeFinish) {\n bareSuper.find(function(parentPath) {\n // hit top so short circuit\n if (parentPath === path) {\n return true;\n }\n\n if (\n parentPath.isLoop() ||\n parentPath.isConditional() ||\n parentPath.isArrowFunctionExpression()\n ) {\n guaranteedSuperBeforeFinish = false;\n return true;\n }\n });\n }\n }\n\n let wrapReturn;\n\n if (classState.isLoose) {\n wrapReturn = returnArg => {\n const thisExpr = t.callExpression(\n classState.file.addHelper(\"assertThisInitialized\"),\n [thisRef()],\n );\n return returnArg\n ? t.logicalExpression(\"||\", returnArg, thisExpr)\n : thisExpr;\n };\n } else {\n wrapReturn = returnArg =>\n t.callExpression(\n classState.file.addHelper(\"possibleConstructorReturn\"),\n [thisRef()].concat(returnArg || []),\n );\n }\n\n // if we have a return as the last node in the body then we've already caught that\n // return\n const bodyPaths = body.get(\"body\");\n if (!bodyPaths.length || !bodyPaths.pop().isReturnStatement()) {\n body.pushContainer(\n \"body\",\n t.returnStatement(\n guaranteedSuperBeforeFinish ? thisRef() : wrapReturn(),\n ),\n );\n }\n\n for (const returnPath of classState.superReturns) {\n returnPath\n .get(\"argument\")\n .replaceWith(wrapReturn(returnPath.node.argument));\n }\n }\n\n /**\n * Push a method to its respective mutatorMap.\n */\n function pushMethod(node: { type: \"ClassMethod\" }, path?: NodePath) {\n const scope = path ? path.scope : classState.scope;\n\n if (node.kind === \"method\") {\n if (processMethod(node, scope)) return;\n }\n\n pushToMap(node, false, null, scope);\n }\n\n function processMethod(node, scope) {\n if (classState.isLoose && !node.decorators) {\n // use assignments instead of define properties for loose classes\n let { classRef } = classState;\n if (!node.static) {\n insertProtoAliasOnce();\n classRef = classState.protoAlias;\n }\n const methodName = t.memberExpression(\n t.cloneNode(classRef),\n node.key,\n node.computed || t.isLiteral(node.key),\n );\n\n let func = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n t.inherits(func, node);\n\n const key = t.toComputedKey(node, node.key);\n if (t.isStringLiteral(key)) {\n func = nameFunction({\n node: func,\n id: key,\n scope,\n });\n }\n\n const expr = t.expressionStatement(\n t.assignmentExpression(\"=\", methodName, func),\n );\n t.inheritsComments(expr, node);\n classState.body.push(expr);\n return true;\n }\n\n return false;\n }\n\n function insertProtoAliasOnce() {\n if (classState.protoAlias === null) {\n setState({ protoAlias: classState.scope.generateUidIdentifier(\"proto\") });\n const classProto = t.memberExpression(\n classState.classRef,\n t.identifier(\"prototype\"),\n );\n const protoDeclaration = t.variableDeclaration(\"var\", [\n t.variableDeclarator(classState.protoAlias, classProto),\n ]);\n\n classState.body.push(protoDeclaration);\n }\n }\n\n /**\n * Replace the constructor body of our class.\n */\n function pushConstructor(\n superReturns,\n method: { type: \"ClassMethod\" },\n path: NodePath,\n ) {\n // https://github.com/babel/babel/issues/1077\n if (path.scope.hasOwnBinding(classState.classRef.name)) {\n path.scope.rename(classState.classRef.name);\n }\n\n setState({\n userConstructorPath: path,\n userConstructor: method,\n hasConstructor: true,\n superReturns,\n });\n\n const { construct } = classState;\n\n t.inheritsComments(construct, method);\n\n construct.params = method.params;\n\n t.inherits(construct.body, method.body);\n construct.body.directives = method.body.directives;\n\n pushConstructorToBody();\n }\n\n function pushConstructorToBody() {\n if (classState.pushedConstructor) return;\n classState.pushedConstructor = true;\n\n // we haven't pushed any descriptors yet\n if (classState.hasInstanceDescriptors || classState.hasStaticDescriptors) {\n pushDescriptors();\n }\n\n classState.body.push(classState.construct);\n\n pushInheritsToBody();\n }\n\n /**\n * Push inherits helper to body.\n */\n function pushInheritsToBody() {\n if (!classState.isDerived || classState.pushedInherits) return;\n\n setState({ pushedInherits: true });\n\n // Unshift to ensure that the constructor inheritance is set up before\n // any properties can be assigned to the prototype.\n classState.body.unshift(\n t.expressionStatement(\n t.callExpression(\n classState.file.addHelper(\n classState.isLoose ? \"inheritsLoose\" : \"inherits\",\n ),\n [t.cloneNode(classState.classRef), t.cloneNode(classState.superName)],\n ),\n ),\n );\n }\n\n function setupClosureParamsArgs() {\n const { superName } = classState;\n const closureParams = [];\n const closureArgs = [];\n\n if (classState.isDerived) {\n const arg = classState.extendsNative\n ? t.callExpression(classState.file.addHelper(\"wrapNativeSuper\"), [\n t.cloneNode(superName),\n ])\n : t.cloneNode(superName);\n const param = classState.scope.generateUidIdentifierBasedOnNode(\n superName,\n );\n\n closureParams.push(param);\n closureArgs.push(arg);\n\n setState({ superName: t.cloneNode(param) });\n }\n\n return { closureParams, closureArgs };\n }\n\n function classTransformer(\n path: NodePath,\n file,\n builtinClasses: ReadonlySet,\n isLoose: boolean,\n ) {\n setState({\n parent: path.parent,\n scope: path.scope,\n node: path.node,\n path,\n file,\n isLoose,\n });\n\n setState({\n classId: classState.node.id,\n // this is the name of the binding that will **always** reference the class we've constructed\n classRef: classState.node.id\n ? t.identifier(classState.node.id.name)\n : classState.scope.generateUidIdentifier(\"class\"),\n superName: classState.node.superClass,\n isDerived: !!classState.node.superClass,\n constructorBody: t.blockStatement([]),\n });\n\n setState({\n extendsNative:\n classState.isDerived &&\n builtinClasses.has(classState.superName.name) &&\n !classState.scope.hasBinding(\n classState.superName.name,\n /* noGlobals */ true,\n ),\n });\n\n const { classRef, node, constructorBody } = classState;\n\n setState({\n construct: buildConstructor(classRef, constructorBody, node),\n });\n\n let { body } = classState;\n const { closureParams, closureArgs } = setupClosureParamsArgs();\n\n buildBody();\n\n // make sure this class isn't directly called (with A() instead new A())\n if (!classState.isLoose) {\n constructorBody.body.unshift(\n t.expressionStatement(\n t.callExpression(classState.file.addHelper(\"classCallCheck\"), [\n t.thisExpression(),\n t.cloneNode(classState.classRef),\n ]),\n ),\n );\n }\n\n body = body.concat(\n classState.staticPropBody.map(fn => fn(t.cloneNode(classState.classRef))),\n );\n\n const isStrict = path.isInStrictMode();\n let constructorOnly = classState.classId && body.length === 1;\n if (constructorOnly && !isStrict) {\n for (const param of classState.construct.params) {\n // It's illegal to put a use strict directive into the body of a function\n // with non-simple parameters for some reason. So, we have to use a strict\n // wrapper function.\n if (!t.isIdentifier(param)) {\n constructorOnly = false;\n break;\n }\n }\n }\n\n const directives = constructorOnly ? body[0].body.directives : [];\n if (!isStrict) {\n directives.push(t.directive(t.directiveLiteral(\"use strict\")));\n }\n\n if (constructorOnly) {\n // named class with only a constructor\n return t.toExpression(body[0]);\n }\n\n body.push(t.returnStatement(t.cloneNode(classState.classRef)));\n const container = t.arrowFunctionExpression(\n closureParams,\n t.blockStatement(body, directives),\n );\n return t.callExpression(container, closureArgs);\n }\n\n return classTransformer(path, file, builtinClasses, isLoose);\n}\n","// @flow\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport { types as t } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport globals from \"globals\";\nimport transformClass from \"./transformClass\";\n\nconst getBuiltinClasses = category =>\n Object.keys(globals[category]).filter(name => /^[A-Z]/.test(name));\n\nconst builtinClasses = new Set([\n ...getBuiltinClasses(\"builtin\"),\n ...getBuiltinClasses(\"browser\"),\n]);\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n\n // todo: investigate traversal requeueing\n const VISITED = Symbol();\n\n return {\n name: \"transform-classes\",\n\n visitor: {\n ExportDefaultDeclaration(path: NodePath) {\n if (!path.get(\"declaration\").isClassDeclaration()) return;\n splitExportDeclaration(path);\n },\n\n ClassDeclaration(path: NodePath) {\n const { node } = path;\n\n const ref = node.id || path.scope.generateUidIdentifier(\"class\");\n\n path.replaceWith(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(ref, t.toExpression(node)),\n ]),\n );\n },\n\n ClassExpression(path: NodePath, state: any) {\n const { node } = path;\n if (node[VISITED]) return;\n\n const inferred = nameFunction(path);\n if (inferred && inferred !== node) {\n path.replaceWith(inferred);\n return;\n }\n\n node[VISITED] = true;\n\n path.replaceWith(\n transformClass(path, state.file, builtinClasses, loose),\n );\n\n if (path.isCallExpression()) {\n annotateAsPure(path);\n if (path.get(\"callee\").isArrowFunctionExpression()) {\n path.get(\"callee\").arrowFunctionToExpression();\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n const pushComputedProps = loose\n ? pushComputedPropsLoose\n : pushComputedPropsSpec;\n\n const buildMutatorMapAssign = template(`\n MUTATOR_MAP_REF[KEY] = MUTATOR_MAP_REF[KEY] || {};\n MUTATOR_MAP_REF[KEY].KIND = VALUE;\n `);\n\n function getValue(prop) {\n if (t.isObjectProperty(prop)) {\n return prop.value;\n } else if (t.isObjectMethod(prop)) {\n return t.functionExpression(\n null,\n prop.params,\n prop.body,\n prop.generator,\n prop.async,\n );\n }\n }\n\n function pushAssign(objId, prop, body) {\n if (prop.kind === \"get\" && prop.kind === \"set\") {\n pushMutatorDefine(objId, prop, body);\n } else {\n body.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.cloneNode(objId),\n prop.key,\n prop.computed || t.isLiteral(prop.key),\n ),\n getValue(prop),\n ),\n ),\n );\n }\n }\n\n function pushMutatorDefine({ body, getMutatorId, scope }, prop) {\n let key =\n !prop.computed && t.isIdentifier(prop.key)\n ? t.stringLiteral(prop.key.name)\n : prop.key;\n\n const maybeMemoise = scope.maybeGenerateMemoised(key);\n if (maybeMemoise) {\n body.push(\n t.expressionStatement(t.assignmentExpression(\"=\", maybeMemoise, key)),\n );\n key = maybeMemoise;\n }\n\n body.push(\n ...buildMutatorMapAssign({\n MUTATOR_MAP_REF: getMutatorId(),\n KEY: t.cloneNode(key),\n VALUE: getValue(prop),\n KIND: t.identifier(prop.kind),\n }),\n );\n }\n\n function pushComputedPropsLoose(info) {\n for (const prop of info.computedProps) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n pushMutatorDefine(info, prop);\n } else {\n pushAssign(t.cloneNode(info.objId), prop, info.body);\n }\n }\n }\n\n function pushComputedPropsSpec(info) {\n const { objId, body, computedProps, state } = info;\n\n for (const prop of computedProps) {\n const key = t.toComputedKey(prop);\n\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n pushMutatorDefine(info, prop);\n } else if (t.isStringLiteral(key, { value: \"__proto__\" })) {\n pushAssign(objId, prop, body);\n } else {\n if (computedProps.length === 1) {\n return t.callExpression(state.addHelper(\"defineProperty\"), [\n info.initPropExpression,\n key,\n getValue(prop),\n ]);\n } else {\n body.push(\n t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n t.cloneNode(objId),\n key,\n getValue(prop),\n ]),\n ),\n );\n }\n }\n }\n }\n\n return {\n name: \"transform-computed-properties\",\n\n visitor: {\n ObjectExpression: {\n exit(path, state) {\n const { node, parent, scope } = path;\n let hasComputed = false;\n for (const prop of (node.properties: Array)) {\n hasComputed = prop.computed === true;\n if (hasComputed) break;\n }\n if (!hasComputed) return;\n\n // put all getters/setters into the first object expression as well as all initialisers up\n // to the first computed property\n\n const initProps = [];\n const computedProps = [];\n let foundComputed = false;\n\n for (const prop of node.properties) {\n if (prop.computed) {\n foundComputed = true;\n }\n\n if (foundComputed) {\n computedProps.push(prop);\n } else {\n initProps.push(prop);\n }\n }\n\n const objId = scope.generateUidIdentifierBasedOnNode(parent);\n const initPropExpression = t.objectExpression(initProps);\n const body = [];\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(objId, initPropExpression),\n ]),\n );\n\n let mutatorRef;\n\n const getMutatorId = function() {\n if (!mutatorRef) {\n mutatorRef = scope.generateUidIdentifier(\"mutatorMap\");\n\n body.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(mutatorRef, t.objectExpression([])),\n ]),\n );\n }\n\n return t.cloneNode(mutatorRef);\n };\n\n const single = pushComputedProps({\n scope,\n objId,\n body,\n computedProps,\n initPropExpression,\n getMutatorId,\n state,\n });\n\n if (mutatorRef) {\n body.push(\n t.expressionStatement(\n t.callExpression(\n state.addHelper(\"defineEnumerableProperties\"),\n [t.cloneNode(objId), t.cloneNode(mutatorRef)],\n ),\n ),\n );\n }\n\n if (single) {\n path.replaceWith(single);\n } else {\n body.push(t.expressionStatement(t.cloneNode(objId)));\n path.replaceWithMultiple(body);\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose = false, useBuiltIns = false } = options;\n\n if (typeof loose !== \"boolean\") {\n throw new Error(`.loose must be a boolean or undefined`);\n }\n\n const arrayOnlySpread = loose;\n\n function getExtendsHelper(file) {\n return useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n }\n\n /**\n * Test if a VariableDeclaration's declarations contains any Patterns.\n */\n\n function variableDeclarationHasPattern(node) {\n for (const declar of (node.declarations: Array)) {\n if (t.isPattern(declar.id)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Test if an ArrayPattern's elements contain any RestElements.\n */\n\n function hasRest(pattern) {\n for (const elem of (pattern.elements: Array)) {\n if (t.isRestElement(elem)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Test if an ObjectPattern's elements contain any RestElements.\n */\n\n function hasObjectRest(pattern) {\n for (const elem of (pattern.properties: Array)) {\n if (t.isRestElement(elem)) {\n return true;\n }\n }\n return false;\n }\n\n const STOP_TRAVERSAL = {};\n\n // NOTE: This visitor is meant to be used via t.traverse\n const arrayUnpackVisitor = (node, ancestors, state) => {\n if (!ancestors.length) {\n // Top-level node: this is the array literal.\n return;\n }\n\n if (\n t.isIdentifier(node) &&\n t.isReferenced(node, ancestors[ancestors.length - 1]) &&\n state.bindings[node.name]\n ) {\n state.deopt = true;\n throw STOP_TRAVERSAL;\n }\n };\n\n class DestructuringTransformer {\n constructor(opts) {\n this.blockHoist = opts.blockHoist;\n this.operator = opts.operator;\n this.arrays = {};\n this.nodes = opts.nodes || [];\n this.scope = opts.scope;\n this.kind = opts.kind;\n this.arrayOnlySpread = opts.arrayOnlySpread;\n this.addHelper = opts.addHelper;\n }\n\n buildVariableAssignment(id, init) {\n let op = this.operator;\n if (t.isMemberExpression(id)) op = \"=\";\n\n let node;\n\n if (op) {\n node = t.expressionStatement(\n t.assignmentExpression(\n op,\n id,\n t.cloneNode(init) || this.scope.buildUndefinedNode(),\n ),\n );\n } else {\n node = t.variableDeclaration(this.kind, [\n t.variableDeclarator(id, t.cloneNode(init)),\n ]);\n }\n\n node._blockHoist = this.blockHoist;\n\n return node;\n }\n\n buildVariableDeclaration(id, init) {\n const declar = t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(id), t.cloneNode(init)),\n ]);\n declar._blockHoist = this.blockHoist;\n return declar;\n }\n\n push(id, _init) {\n const init = t.cloneNode(_init);\n if (t.isObjectPattern(id)) {\n this.pushObjectPattern(id, init);\n } else if (t.isArrayPattern(id)) {\n this.pushArrayPattern(id, init);\n } else if (t.isAssignmentPattern(id)) {\n this.pushAssignmentPattern(id, init);\n } else {\n this.nodes.push(this.buildVariableAssignment(id, init));\n }\n }\n\n toArray(node, count) {\n if (\n this.arrayOnlySpread ||\n (t.isIdentifier(node) && this.arrays[node.name])\n ) {\n return node;\n } else {\n return this.scope.toArray(node, count);\n }\n }\n\n pushAssignmentPattern({ left, right }, valueRef) {\n // we need to assign the current value of the assignment to avoid evaluating\n // it more than once\n const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef);\n\n this.nodes.push(this.buildVariableDeclaration(tempId, valueRef));\n\n const tempConditional = t.conditionalExpression(\n t.binaryExpression(\n \"===\",\n t.cloneNode(tempId),\n this.scope.buildUndefinedNode(),\n ),\n right,\n t.cloneNode(tempId),\n );\n\n if (t.isPattern(left)) {\n let patternId;\n let node;\n\n if (this.kind === \"const\") {\n patternId = this.scope.generateUidIdentifier(tempId.name);\n node = this.buildVariableDeclaration(patternId, tempConditional);\n } else {\n patternId = tempId;\n\n node = t.expressionStatement(\n t.assignmentExpression(\"=\", t.cloneNode(tempId), tempConditional),\n );\n }\n\n this.nodes.push(node);\n this.push(left, patternId);\n } else {\n this.nodes.push(this.buildVariableAssignment(left, tempConditional));\n }\n }\n\n pushObjectRest(pattern, objRef, spreadProp, spreadPropIndex) {\n // get all the keys that appear in this object before the current spread\n\n const keys = [];\n let allLiteral = true;\n\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n\n // we've exceeded the index of the spread property to all properties to the\n // right need to be ignored\n if (i >= spreadPropIndex) break;\n\n // ignore other spread properties\n if (t.isRestElement(prop)) continue;\n\n const key = prop.key;\n if (t.isIdentifier(key) && !prop.computed) {\n keys.push(t.stringLiteral(key.name));\n } else if (t.isTemplateLiteral(prop.key)) {\n keys.push(t.cloneNode(prop.key));\n } else if (t.isLiteral(key)) {\n keys.push(t.stringLiteral(String(key.value)));\n } else {\n keys.push(t.cloneNode(key));\n allLiteral = false;\n }\n }\n\n let value;\n if (keys.length === 0) {\n value = t.callExpression(getExtendsHelper(this), [\n t.objectExpression([]),\n t.cloneNode(objRef),\n ]);\n } else {\n let keyExpression = t.arrayExpression(keys);\n\n if (!allLiteral) {\n keyExpression = t.callExpression(\n t.memberExpression(keyExpression, t.identifier(\"map\")),\n [this.addHelper(\"toPropertyKey\")],\n );\n }\n\n value = t.callExpression(\n this.addHelper(`objectWithoutProperties${loose ? \"Loose\" : \"\"}`),\n [t.cloneNode(objRef), keyExpression],\n );\n }\n\n this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value));\n }\n\n pushObjectProperty(prop, propRef) {\n if (t.isLiteral(prop.key)) prop.computed = true;\n\n const pattern = prop.value;\n const objRef = t.memberExpression(\n t.cloneNode(propRef),\n prop.key,\n prop.computed,\n );\n\n if (t.isPattern(pattern)) {\n this.push(pattern, objRef);\n } else {\n this.nodes.push(this.buildVariableAssignment(pattern, objRef));\n }\n }\n\n pushObjectPattern(pattern, objRef) {\n // https://github.com/babel/babel/issues/681\n\n if (!pattern.properties.length) {\n this.nodes.push(\n t.expressionStatement(\n t.callExpression(this.addHelper(\"objectDestructuringEmpty\"), [\n objRef,\n ]),\n ),\n );\n }\n\n // if we have more than one properties in this pattern and the objectRef is a\n // member expression then we need to assign it to a temporary variable so it's\n // only evaluated once\n\n if (pattern.properties.length > 1 && !this.scope.isStatic(objRef)) {\n const temp = this.scope.generateUidIdentifierBasedOnNode(objRef);\n this.nodes.push(this.buildVariableDeclaration(temp, objRef));\n objRef = temp;\n }\n\n // Replace impure computed key expressions if we have a rest parameter\n if (hasObjectRest(pattern)) {\n let copiedPattern;\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n break;\n }\n const key = prop.key;\n if (prop.computed && !this.scope.isPure(key)) {\n const name = this.scope.generateUidIdentifierBasedOnNode(key);\n this.nodes.push(this.buildVariableDeclaration(name, key));\n if (!copiedPattern) {\n copiedPattern = pattern = {\n ...pattern,\n properties: pattern.properties.slice(),\n };\n }\n copiedPattern.properties[i] = {\n ...copiedPattern.properties[i],\n key: name,\n };\n }\n }\n }\n //\n\n for (let i = 0; i < pattern.properties.length; i++) {\n const prop = pattern.properties[i];\n if (t.isRestElement(prop)) {\n this.pushObjectRest(pattern, objRef, prop, i);\n } else {\n this.pushObjectProperty(prop, objRef);\n }\n }\n }\n\n canUnpackArrayPattern(pattern, arr) {\n // not an array so there's no way we can deal with this\n if (!t.isArrayExpression(arr)) return false;\n\n // pattern has less elements than the array and doesn't have a rest so some\n // elements wont be evaluated\n if (pattern.elements.length > arr.elements.length) return;\n if (pattern.elements.length < arr.elements.length && !hasRest(pattern)) {\n return false;\n }\n\n for (const elem of (pattern.elements: Array)) {\n // deopt on holes\n if (!elem) return false;\n\n // deopt on member expressions as they may be included in the RHS\n if (t.isMemberExpression(elem)) return false;\n }\n\n for (const elem of (arr.elements: Array)) {\n // deopt on spread elements\n if (t.isSpreadElement(elem)) return false;\n\n // deopt call expressions as they might change values of LHS variables\n if (t.isCallExpression(elem)) return false;\n\n // deopt on member expressions as they may be getter/setters and have side-effects\n if (t.isMemberExpression(elem)) return false;\n }\n\n // deopt on reference to left side identifiers\n const bindings = t.getBindingIdentifiers(pattern);\n const state = { deopt: false, bindings };\n\n try {\n t.traverse(arr, arrayUnpackVisitor, state);\n } catch (e) {\n if (e !== STOP_TRAVERSAL) throw e;\n }\n\n return !state.deopt;\n }\n\n pushUnpackedArrayPattern(pattern, arr) {\n for (let i = 0; i < pattern.elements.length; i++) {\n const elem = pattern.elements[i];\n if (t.isRestElement(elem)) {\n this.push(elem.argument, t.arrayExpression(arr.elements.slice(i)));\n } else {\n this.push(elem, arr.elements[i]);\n }\n }\n }\n\n pushArrayPattern(pattern, arrayRef) {\n if (!pattern.elements) return;\n\n // optimise basic array destructuring of an array expression\n //\n // we can't do this to a pattern of unequal size to it's right hand\n // array expression as then there will be values that wont be evaluated\n //\n // eg: let [a, b] = [1, 2];\n\n if (this.canUnpackArrayPattern(pattern, arrayRef)) {\n return this.pushUnpackedArrayPattern(pattern, arrayRef);\n }\n\n // if we have a rest then we need all the elements so don't tell\n // `scope.toArray` to only get a certain amount\n\n const count = !hasRest(pattern) && pattern.elements.length;\n\n // so we need to ensure that the `arrayRef` is an array, `scope.toArray` will\n // return a locally bound identifier if it's been inferred to be an array,\n // otherwise it'll be a call to a helper that will ensure it's one\n\n const toArray = this.toArray(arrayRef, count);\n\n if (t.isIdentifier(toArray)) {\n // we've been given an identifier so it must have been inferred to be an\n // array\n arrayRef = toArray;\n } else {\n arrayRef = this.scope.generateUidIdentifierBasedOnNode(arrayRef);\n this.arrays[arrayRef.name] = true;\n this.nodes.push(this.buildVariableDeclaration(arrayRef, toArray));\n }\n\n //\n\n for (let i = 0; i < pattern.elements.length; i++) {\n let elem = pattern.elements[i];\n\n // hole\n if (!elem) continue;\n\n let elemRef;\n\n if (t.isRestElement(elem)) {\n elemRef = this.toArray(arrayRef);\n elemRef = t.callExpression(\n t.memberExpression(elemRef, t.identifier(\"slice\")),\n [t.numericLiteral(i)],\n );\n\n // set the element to the rest element argument since we've dealt with it\n // being a rest already\n elem = elem.argument;\n } else {\n elemRef = t.memberExpression(arrayRef, t.numericLiteral(i), true);\n }\n\n this.push(elem, elemRef);\n }\n }\n\n init(pattern, ref) {\n // trying to destructure a value that we can't evaluate more than once so we\n // need to save it to a variable\n\n if (!t.isArrayExpression(ref) && !t.isMemberExpression(ref)) {\n const memo = this.scope.maybeGenerateMemoised(ref, true);\n if (memo) {\n this.nodes.push(\n this.buildVariableDeclaration(memo, t.cloneNode(ref)),\n );\n ref = memo;\n }\n }\n\n //\n\n this.push(pattern, ref);\n\n return this.nodes;\n }\n }\n\n return {\n name: \"transform-destructuring\",\n\n visitor: {\n ExportNamedDeclaration(path) {\n const declaration = path.get(\"declaration\");\n if (!declaration.isVariableDeclaration()) return;\n if (!variableDeclarationHasPattern(declaration.node)) return;\n\n const specifiers = [];\n\n for (const name of Object.keys(path.getOuterBindingIdentifiers(path))) {\n specifiers.push(\n t.exportSpecifier(t.identifier(name), t.identifier(name)),\n );\n }\n\n // Split the declaration and export list into two declarations so that the variable\n // declaration can be split up later without needing to worry about not being a\n // top-level statement.\n path.replaceWith(declaration.node);\n path.insertAfter(t.exportNamedDeclaration(null, specifiers));\n },\n\n ForXStatement(path) {\n const { node, scope } = path;\n const left = node.left;\n\n if (t.isPattern(left)) {\n // for ({ length: k } in { abc: 3 });\n\n const temp = scope.generateUidIdentifier(\"ref\");\n\n node.left = t.variableDeclaration(\"var\", [\n t.variableDeclarator(temp),\n ]);\n\n path.ensureBlock();\n\n if (node.body.body.length === 0 && path.isCompletionRecord()) {\n node.body.body.unshift(\n t.expressionStatement(scope.buildUndefinedNode()),\n );\n }\n\n node.body.body.unshift(\n t.expressionStatement(t.assignmentExpression(\"=\", left, temp)),\n );\n\n return;\n }\n\n if (!t.isVariableDeclaration(left)) return;\n\n const pattern = left.declarations[0].id;\n if (!t.isPattern(pattern)) return;\n\n const key = scope.generateUidIdentifier(\"ref\");\n node.left = t.variableDeclaration(left.kind, [\n t.variableDeclarator(key, null),\n ]);\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: left.kind,\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n destructuring.init(pattern, key);\n\n path.ensureBlock();\n\n const block = node.body;\n block.body = nodes.concat(block.body);\n },\n\n CatchClause({ node, scope }) {\n const pattern = node.param;\n if (!t.isPattern(pattern)) return;\n\n const ref = scope.generateUidIdentifier(\"ref\");\n node.param = ref;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n kind: \"let\",\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n destructuring.init(pattern, ref);\n\n node.body.body = nodes.concat(node.body.body);\n },\n\n AssignmentExpression(path) {\n const { node, scope } = path;\n if (!t.isPattern(node.left)) return;\n\n const nodes = [];\n\n const destructuring = new DestructuringTransformer({\n operator: node.operator,\n scope: scope,\n nodes: nodes,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n let ref;\n if (\n path.isCompletionRecord() ||\n !path.parentPath.isExpressionStatement()\n ) {\n ref = scope.generateUidIdentifierBasedOnNode(node.right, \"ref\");\n\n nodes.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(ref, node.right),\n ]),\n );\n\n if (t.isArrayExpression(node.right)) {\n destructuring.arrays[ref.name] = true;\n }\n }\n\n destructuring.init(node.left, ref || node.right);\n\n if (ref) {\n if (path.parentPath.isArrowFunctionExpression()) {\n path.replaceWith(t.blockStatement([]));\n nodes.push(t.returnStatement(t.cloneNode(ref)));\n } else {\n nodes.push(t.expressionStatement(t.cloneNode(ref)));\n }\n }\n\n path.replaceWithMultiple(nodes);\n },\n\n VariableDeclaration(path) {\n const { node, scope, parent } = path;\n if (t.isForXStatement(parent)) return;\n if (!parent || !path.container) return; // i don't know why this is necessary - TODO\n if (!variableDeclarationHasPattern(node)) return;\n\n const nodeKind = node.kind;\n const nodes = [];\n let declar;\n\n for (let i = 0; i < node.declarations.length; i++) {\n declar = node.declarations[i];\n\n const patternId = declar.init;\n const pattern = declar.id;\n\n const destructuring = new DestructuringTransformer({\n blockHoist: node._blockHoist,\n nodes: nodes,\n scope: scope,\n kind: node.kind,\n arrayOnlySpread,\n addHelper: name => this.addHelper(name),\n });\n\n if (t.isPattern(pattern)) {\n destructuring.init(pattern, patternId);\n\n if (+i !== node.declarations.length - 1) {\n // we aren't the last declarator so let's just make the\n // last transformed node inherit from us\n t.inherits(nodes[nodes.length - 1], declar);\n }\n } else {\n nodes.push(\n t.inherits(\n destructuring.buildVariableAssignment(\n declar.id,\n t.cloneNode(declar.init),\n ),\n declar,\n ),\n );\n }\n }\n\n let tail = null;\n const nodesOut = [];\n for (const node of nodes) {\n if (tail !== null && t.isVariableDeclaration(node)) {\n // Create a single compound declarations\n tail.declarations.push(...node.declarations);\n } else {\n // Make sure the original node kind is used for each compound declaration\n node.kind = nodeKind;\n nodesOut.push(node);\n tail = t.isVariableDeclaration(node) ? node : null;\n }\n }\n\n // Need to unmark the current binding to this var as a param, or other hoists\n // could be placed above this ref.\n // https://github.com/babel/babel/issues/4516\n for (const nodeOut of nodesOut) {\n if (!nodeOut.declarations) continue;\n for (const declaration of nodeOut.declarations) {\n const { name } = declaration.id;\n if (scope.bindings[name]) {\n scope.bindings[name].kind = nodeOut.kind;\n }\n }\n }\n\n if (nodesOut.length === 1) {\n path.replaceWith(nodesOut[0]);\n } else {\n path.replaceWithMultiple(nodesOut);\n }\n },\n },\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return createRegExpFeaturePlugin({\n name: \"transform-dotall-regex\",\n feature: \"dotAllFlag\",\n });\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nfunction getName(key) {\n if (t.isIdentifier(key)) {\n return key.name;\n }\n return key.value.toString();\n}\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-duplicate-keys\",\n\n visitor: {\n ObjectExpression(path) {\n const { node } = path;\n const plainProps = node.properties.filter(\n prop => !t.isSpreadElement(prop) && !prop.computed,\n );\n\n // A property is a duplicate key if:\n // * the property is a data property, and is preceded by a data,\n // getter, or setter property of the same name.\n // * the property is a getter property, and is preceded by a data or\n // getter property of the same name.\n // * the property is a setter property, and is preceded by a data or\n // setter property of the same name.\n\n const alreadySeenData = Object.create(null);\n const alreadySeenGetters = Object.create(null);\n const alreadySeenSetters = Object.create(null);\n\n for (const prop of plainProps) {\n const name = getName(prop.key);\n let isDuplicate = false;\n switch (prop.kind) {\n case \"get\":\n if (alreadySeenData[name] || alreadySeenGetters[name]) {\n isDuplicate = true;\n }\n alreadySeenGetters[name] = true;\n break;\n case \"set\":\n if (alreadySeenData[name] || alreadySeenSetters[name]) {\n isDuplicate = true;\n }\n alreadySeenSetters[name] = true;\n break;\n default:\n if (\n alreadySeenData[name] ||\n alreadySeenGetters[name] ||\n alreadySeenSetters[name]\n ) {\n isDuplicate = true;\n }\n alreadySeenData[name] = true;\n }\n\n if (isDuplicate) {\n // Rely on the computed properties transform to split the property\n // assignment out of the object literal.\n prop.computed = true;\n prop.key = t.stringLiteral(name);\n }\n }\n },\n },\n };\n});\n","import type { Scope } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\n\nfunction getObjRef(node, nodes, file, scope) {\n let ref;\n if (t.isSuper(node)) {\n // Super cannot be directly assigned so lets return it directly\n return node;\n } else if (t.isIdentifier(node)) {\n if (scope.hasBinding(node.name)) {\n // this variable is declared in scope so we can be 100% sure\n // that evaluating it multiple times wont trigger a getter\n // or something else\n return node;\n } else {\n // could possibly trigger a getter so we need to only evaluate\n // it once\n ref = node;\n }\n } else if (t.isMemberExpression(node)) {\n ref = node.object;\n\n if (t.isSuper(ref) || (t.isIdentifier(ref) && scope.hasBinding(ref.name))) {\n // the object reference that we need to save is locally declared\n // so as per the previous comment we can be 100% sure evaluating\n // it multiple times will be safe\n // Super cannot be directly assigned so lets return it also\n return ref;\n }\n } else {\n throw new Error(`We can't explode this node type ${node.type}`);\n }\n\n const temp = scope.generateUidIdentifierBasedOnNode(ref);\n scope.push({ id: temp });\n nodes.push(t.assignmentExpression(\"=\", t.cloneNode(temp), t.cloneNode(ref)));\n return temp;\n}\n\nfunction getPropRef(node, nodes, file, scope) {\n const prop = node.property;\n const key = t.toComputedKey(node, prop);\n if (t.isLiteral(key) && t.isPureish(key)) return key;\n\n const temp = scope.generateUidIdentifierBasedOnNode(prop);\n scope.push({ id: temp });\n nodes.push(t.assignmentExpression(\"=\", t.cloneNode(temp), t.cloneNode(prop)));\n return temp;\n}\n\nexport default function(\n node: Object,\n nodes: Array,\n file,\n scope: Scope,\n allowedSingleIdent?: boolean,\n): {\n uid: Object,\n ref: Object,\n} {\n let obj;\n if (t.isIdentifier(node) && allowedSingleIdent) {\n obj = node;\n } else {\n obj = getObjRef(node, nodes, file, scope);\n }\n\n let ref, uid;\n\n if (t.isIdentifier(node)) {\n ref = t.cloneNode(node);\n uid = obj;\n } else {\n const prop = getPropRef(node, nodes, file, scope);\n const computed = node.computed || t.isLiteral(prop);\n uid = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);\n ref = t.memberExpression(t.cloneNode(obj), t.cloneNode(prop), computed);\n }\n\n return {\n uid: uid,\n ref: ref,\n };\n}\n","import explode from \"@babel/helper-explode-assignable-expression\";\nimport * as t from \"@babel/types\";\n\nexport default function(opts: { build: Function, operator: string }): Object {\n const { build, operator } = opts;\n\n return {\n AssignmentExpression(path) {\n const { node, scope } = path;\n if (node.operator !== operator + \"=\") return;\n\n const nodes = [];\n const exploded = explode(node.left, nodes, this, scope);\n nodes.push(\n t.assignmentExpression(\n \"=\",\n exploded.ref,\n build(exploded.uid, node.right),\n ),\n );\n path.replaceWith(t.sequenceExpression(nodes));\n },\n\n BinaryExpression(path) {\n const { node } = path;\n if (node.operator === operator) {\n path.replaceWith(build(node.left, node.right));\n }\n },\n };\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport build from \"@babel/helper-builder-binary-assignment-operator-visitor\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-exponentiation-operator\",\n\n visitor: build({\n operator: \"**\",\n\n build(left, right) {\n return t.callExpression(\n t.memberExpression(t.identifier(\"Math\"), t.identifier(\"pow\")),\n [left, right],\n );\n },\n }),\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport { types as t } from \"@babel/core\";\nimport generateCode from \"@babel/generator\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function commentFromString(comment) {\n return typeof comment === \"string\"\n ? { type: \"CommentBlock\", value: comment }\n : comment;\n }\n\n function attachComment({\n ofPath,\n toPath,\n where = \"trailing\",\n optional = false,\n comments = generateComment(ofPath, optional),\n keepType = false,\n }) {\n if (!toPath || !toPath.node) {\n toPath = ofPath.getPrevSibling();\n where = \"trailing\";\n }\n if (!toPath.node) {\n toPath = ofPath.getNextSibling();\n where = \"leading\";\n }\n if (!toPath.node) {\n toPath = ofPath.parentPath;\n where = \"inner\";\n }\n if (!Array.isArray(comments)) {\n comments = [comments];\n }\n comments = comments.map(commentFromString);\n if (!keepType && ofPath && ofPath.node) {\n // Removes the node at `ofPath` while conserving the comments attached\n // to it.\n const node = ofPath.node;\n const parent = ofPath.parentPath;\n const prev = ofPath.getPrevSibling();\n const next = ofPath.getNextSibling();\n const isSingleChild = !(prev.node || next.node);\n const leading = node.leadingComments;\n const trailing = node.trailingComments;\n\n if (isSingleChild && leading) {\n parent.addComments(\"inner\", leading);\n }\n toPath.addComments(where, comments);\n ofPath.remove();\n if (isSingleChild && trailing) {\n parent.addComments(\"inner\", trailing);\n }\n } else {\n toPath.addComments(where, comments);\n }\n }\n\n function wrapInFlowComment(path) {\n attachComment({\n ofPath: path,\n comments: generateComment(path, path.parent.optional),\n });\n }\n\n function generateComment(path, optional) {\n let comment = path\n .getSource()\n .replace(/\\*-\\//g, \"*-ESCAPED/\")\n .replace(/\\*\\//g, \"*-/\");\n if (optional) comment = \"?\" + comment;\n if (comment[0] !== \":\") comment = \":: \" + comment;\n return comment;\n }\n\n function isTypeImport(importKind) {\n return importKind === \"type\" || importKind === \"typeof\";\n }\n\n return {\n name: \"transform-flow-comments\",\n inherits: syntaxFlow,\n\n visitor: {\n TypeCastExpression(path) {\n const { node } = path;\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path.get(\"expression\"),\n keepType: true,\n });\n path.replaceWith(t.parenthesizedExpression(node.expression));\n },\n\n // support function a(b?) {}\n Identifier(path) {\n if (path.parentPath.isFlow()) return;\n const { node } = path;\n if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path,\n optional: node.optional || node.typeAnnotation.optional,\n });\n if (node.optional) {\n node.optional = false;\n }\n } else if (node.optional) {\n attachComment({\n toPath: path,\n comments: \":: ?\",\n });\n node.optional = false;\n }\n },\n\n AssignmentPattern: {\n exit({ node }) {\n const { left } = node;\n if (left.optional) {\n left.optional = false;\n }\n },\n },\n\n // strip optional property from function params - facebook/fbjs#17\n Function(path) {\n if (path.isDeclareFunction()) return;\n const { node } = path;\n if (node.typeParameters) {\n attachComment({\n ofPath: path.get(\"typeParameters\"),\n toPath: path.get(\"id\"),\n optional: node.typeParameters.optional,\n });\n }\n if (node.returnType) {\n attachComment({\n ofPath: path.get(\"returnType\"),\n toPath: path.get(\"body\"),\n where: \"leading\",\n optional: node.returnType.typeAnnotation.optional,\n });\n }\n },\n\n // support for `class X { foo: string }` - #4622\n ClassProperty(path) {\n const { node } = path;\n if (!node.value) {\n wrapInFlowComment(path);\n } else if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path.get(\"key\"),\n optional: node.typeAnnotation.optional,\n });\n }\n },\n\n // support `export type a = {}` - #8 Error: You passed path.replaceWith() a falsy node\n ExportNamedDeclaration(path) {\n const { node } = path;\n if (node.exportKind !== \"type\" && !t.isFlow(node.declaration)) {\n return;\n }\n wrapInFlowComment(path);\n },\n\n // support `import type A` and `import typeof A` #10\n ImportDeclaration(path) {\n const { node } = path;\n if (isTypeImport(node.importKind)) {\n wrapInFlowComment(path);\n return;\n }\n\n const typeSpecifiers = node.specifiers.filter(specifier =>\n isTypeImport(specifier.importKind),\n );\n\n const nonTypeSpecifiers = node.specifiers.filter(\n specifier => !isTypeImport(specifier.importKind),\n );\n node.specifiers = nonTypeSpecifiers;\n\n if (typeSpecifiers.length > 0) {\n const typeImportNode = t.cloneNode(node);\n typeImportNode.specifiers = typeSpecifiers;\n const comment = `:: ${generateCode(typeImportNode).code}`;\n\n if (nonTypeSpecifiers.length > 0) {\n attachComment({ toPath: path, comments: comment });\n } else {\n attachComment({ ofPath: path, comments: comment });\n }\n }\n },\n ObjectPattern(path) {\n const { node } = path;\n if (node.typeAnnotation) {\n attachComment({\n ofPath: path.get(\"typeAnnotation\"),\n toPath: path,\n optional: node.optional || node.typeAnnotation.optional,\n });\n }\n },\n\n Flow(path) {\n wrapInFlowComment(path);\n },\n\n Class(path) {\n const { node } = path;\n let comments = [];\n if (node.typeParameters) {\n const typeParameters = path.get(\"typeParameters\");\n comments.push(\n generateComment(typeParameters, node.typeParameters.optional),\n );\n const trailingComments = node.typeParameters.trailingComments;\n if (trailingComments) {\n comments.push(...trailingComments);\n }\n typeParameters.remove();\n }\n\n if (node.superClass) {\n if (comments.length > 0) {\n attachComment({\n toPath: path.get(\"id\"),\n comments: comments,\n });\n comments = [];\n }\n\n if (node.superTypeParameters) {\n const superTypeParameters = path.get(\"superTypeParameters\");\n comments.push(\n generateComment(\n superTypeParameters,\n superTypeParameters.node.optional,\n ),\n );\n superTypeParameters.remove();\n }\n }\n\n if (node.implements) {\n const impls = path.get(\"implements\");\n const comment =\n \"implements \" +\n impls\n .map(impl => generateComment(impl).replace(/^:: /, \"\"))\n .join(\", \");\n delete node[\"implements\"];\n\n if (comments.length === 1) {\n comments[0] += ` ${comment}`;\n } else {\n comments.push(`:: ${comment}`);\n }\n }\n\n if (comments.length > 0) {\n attachComment({\n toPath: path.get(\"body\"),\n where: \"leading\",\n comments: comments,\n });\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const FLOW_DIRECTIVE = /(@flow(\\s+(strict(-local)?|weak))?|@noflow)/;\n\n let skipStrip = false;\n\n return {\n name: \"transform-flow-strip-types\",\n inherits: syntaxFlow,\n\n visitor: {\n Program(\n path,\n {\n file: {\n ast: { comments },\n },\n opts,\n },\n ) {\n skipStrip = false;\n let directiveFound = false;\n\n if (comments) {\n for (const comment of (comments: Array)) {\n if (FLOW_DIRECTIVE.test(comment.value)) {\n directiveFound = true;\n\n // remove flow directive\n comment.value = comment.value.replace(FLOW_DIRECTIVE, \"\");\n\n // remove the comment completely if it only consists of whitespace and/or stars\n if (!comment.value.replace(/\\*/g, \"\").trim()) {\n comment.ignore = true;\n }\n }\n }\n }\n\n if (!directiveFound && opts.requireDirective) {\n skipStrip = true;\n }\n },\n ImportDeclaration(path) {\n if (skipStrip) return;\n if (!path.node.specifiers.length) return;\n\n let typeCount = 0;\n\n path.node.specifiers.forEach(({ importKind }) => {\n if (importKind === \"type\" || importKind === \"typeof\") {\n typeCount++;\n }\n });\n\n if (typeCount === path.node.specifiers.length) {\n path.remove();\n }\n },\n\n Flow(path) {\n if (skipStrip) {\n throw path.buildCodeFrameError(\n \"A @flow directive is required when using Flow annotations with \" +\n \"the `requireDirective` option.\",\n );\n }\n\n path.remove();\n },\n\n ClassProperty(path) {\n if (skipStrip) return;\n path.node.variance = null;\n path.node.typeAnnotation = null;\n if (!path.node.value) path.remove();\n },\n\n ClassPrivateProperty(path) {\n if (skipStrip) return;\n path.node.typeAnnotation = null;\n },\n\n Class(path) {\n if (skipStrip) return;\n path.node.implements = null;\n\n // We do this here instead of in a `ClassProperty` visitor because the class transform\n // would transform the class before we reached the class property.\n path.get(\"body.body\").forEach(child => {\n if (child.isClassProperty()) {\n child.node.typeAnnotation = null;\n if (!child.node.value) child.remove();\n }\n });\n },\n\n AssignmentPattern({ node }) {\n if (skipStrip) return;\n node.left.optional = false;\n },\n\n Function({ node }) {\n if (skipStrip) return;\n for (let i = 0; i < node.params.length; i++) {\n const param = node.params[i];\n param.optional = false;\n if (param.type === \"AssignmentPattern\") {\n param.left.optional = false;\n }\n }\n\n node.predicate = null;\n },\n\n TypeCastExpression(path) {\n if (skipStrip) return;\n let { node } = path;\n do {\n node = node.expression;\n } while (t.isTypeCastExpression(node));\n path.replaceWith(node);\n },\n\n CallExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n\n OptionalCallExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n\n NewExpression({ node }) {\n if (skipStrip) return;\n node.typeArguments = null;\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose, assumeArray } = options;\n\n if (loose === true && assumeArray === true) {\n throw new Error(\n `The loose and assumeArray options cannot be used together in @babel/plugin-transform-for-of`,\n );\n }\n\n if (assumeArray) {\n return {\n name: \"transform-for-of\",\n\n visitor: {\n ForOfStatement(path) {\n const { scope } = path;\n const { left, right, body } = path.node;\n const i = scope.generateUidIdentifier(\"i\");\n let array = scope.maybeGenerateMemoised(right, true);\n\n const inits = [t.variableDeclarator(i, t.numericLiteral(0))];\n if (array) {\n inits.push(t.variableDeclarator(array, right));\n } else {\n array = right;\n }\n\n const item = t.memberExpression(\n t.cloneNode(array),\n t.cloneNode(i),\n true,\n );\n let assignment;\n if (t.isVariableDeclaration(left)) {\n assignment = left;\n assignment.declarations[0].init = item;\n } else {\n assignment = t.expressionStatement(\n t.assignmentExpression(\"=\", left, item),\n );\n }\n\n const block = t.toBlock(body);\n block.body.unshift(assignment);\n\n path.replaceWith(\n t.forStatement(\n t.variableDeclaration(\"let\", inits),\n t.binaryExpression(\n \"<\",\n t.cloneNode(i),\n t.memberExpression(t.cloneNode(array), t.identifier(\"length\")),\n ),\n t.updateExpression(\"++\", t.cloneNode(i)),\n block,\n ),\n );\n },\n },\n };\n }\n\n const pushComputedProps = loose\n ? pushComputedPropsLoose\n : pushComputedPropsSpec;\n\n const buildForOfArray = template(`\n for (var KEY = 0, NAME = ARR; KEY < NAME.length; KEY++) BODY;\n `);\n\n const buildForOfLoose = template(`\n for (var LOOP_OBJECT = OBJECT,\n IS_ARRAY = Array.isArray(LOOP_OBJECT),\n INDEX = 0,\n LOOP_OBJECT = IS_ARRAY ? LOOP_OBJECT : LOOP_OBJECT[Symbol.iterator]();;) {\n INTERMEDIATE;\n if (IS_ARRAY) {\n if (INDEX >= LOOP_OBJECT.length) break;\n ID = LOOP_OBJECT[INDEX++];\n } else {\n INDEX = LOOP_OBJECT.next();\n if (INDEX.done) break;\n ID = INDEX.value;\n }\n }\n `);\n\n const buildForOf = template(`\n var ITERATOR_COMPLETION = true;\n var ITERATOR_HAD_ERROR_KEY = false;\n var ITERATOR_ERROR_KEY = undefined;\n try {\n for (\n var ITERATOR_KEY = OBJECT[Symbol.iterator](), STEP_KEY;\n !(ITERATOR_COMPLETION = (STEP_KEY = ITERATOR_KEY.next()).done);\n ITERATOR_COMPLETION = true\n ) {}\n } catch (err) {\n ITERATOR_HAD_ERROR_KEY = true;\n ITERATOR_ERROR_KEY = err;\n } finally {\n try {\n if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) {\n ITERATOR_KEY.return();\n }\n } finally {\n if (ITERATOR_HAD_ERROR_KEY) {\n throw ITERATOR_ERROR_KEY;\n }\n }\n }\n `);\n\n function _ForOfStatementArray(path) {\n const { node, scope } = path;\n\n const right = scope.generateUidIdentifierBasedOnNode(node.right, \"arr\");\n const iterationKey = scope.generateUidIdentifier(\"i\");\n\n let loop = buildForOfArray({\n BODY: node.body,\n KEY: iterationKey,\n NAME: right,\n ARR: node.right,\n });\n\n t.inherits(loop, node);\n t.ensureBlock(loop);\n\n const iterationValue = t.memberExpression(\n t.cloneNode(right),\n t.cloneNode(iterationKey),\n true,\n );\n\n const left = node.left;\n if (t.isVariableDeclaration(left)) {\n left.declarations[0].init = iterationValue;\n loop.body.body.unshift(left);\n } else {\n loop.body.body.unshift(\n t.expressionStatement(\n t.assignmentExpression(\"=\", left, iterationValue),\n ),\n );\n }\n\n if (path.parentPath.isLabeledStatement()) {\n loop = t.labeledStatement(path.parentPath.node.label, loop);\n }\n\n return [loop];\n }\n\n function replaceWithArray(path) {\n if (path.parentPath.isLabeledStatement()) {\n path.parentPath.replaceWithMultiple(_ForOfStatementArray(path));\n } else {\n path.replaceWithMultiple(_ForOfStatementArray(path));\n }\n }\n\n return {\n name: \"transform-for-of\",\n visitor: {\n ForOfStatement(path, state) {\n const right = path.get(\"right\");\n if (\n right.isArrayExpression() ||\n right.isGenericType(\"Array\") ||\n t.isArrayTypeAnnotation(right.getTypeAnnotation())\n ) {\n replaceWithArray(path);\n return;\n }\n\n const { node } = path;\n const build = pushComputedProps(path, state);\n const declar = build.declar;\n const loop = build.loop;\n const block = loop.body;\n\n // ensure that it's a block so we can take all its statements\n path.ensureBlock();\n\n // add the value declaration to the new loop body\n if (declar) {\n block.body.push(declar);\n }\n\n // push the rest of the original loop body onto our new body\n block.body = block.body.concat(node.body.body);\n\n t.inherits(loop, node);\n t.inherits(loop.body, node.body);\n\n if (build.replaceParent) {\n path.parentPath.replaceWithMultiple(build.node);\n path.remove();\n } else {\n path.replaceWithMultiple(build.node);\n }\n },\n },\n };\n\n function pushComputedPropsLoose(path, file) {\n const { node, scope, parent } = path;\n const { left } = node;\n let declar, id, intermediate;\n\n if (\n t.isIdentifier(left) ||\n t.isPattern(left) ||\n t.isMemberExpression(left)\n ) {\n // for (i of test), for ({ i } of test)\n id = left;\n intermediate = null;\n } else if (t.isVariableDeclaration(left)) {\n // for (let i of test)\n id = scope.generateUidIdentifier(\"ref\");\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, t.identifier(id.name)),\n ]);\n intermediate = t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(id.name)),\n ]);\n } else {\n throw file.buildCodeFrameError(\n left,\n `Unknown node type ${left.type} in ForStatement`,\n );\n }\n\n const iteratorKey = scope.generateUidIdentifier(\"iterator\");\n const isArrayKey = scope.generateUidIdentifier(\"isArray\");\n\n const loop = buildForOfLoose({\n LOOP_OBJECT: iteratorKey,\n IS_ARRAY: isArrayKey,\n OBJECT: node.right,\n INDEX: scope.generateUidIdentifier(\"i\"),\n ID: id,\n INTERMEDIATE: intermediate,\n });\n\n //\n const isLabeledParent = t.isLabeledStatement(parent);\n let labeled;\n\n if (isLabeledParent) {\n labeled = t.labeledStatement(parent.label, loop);\n }\n\n return {\n replaceParent: isLabeledParent,\n declar: declar,\n node: labeled || loop,\n loop: loop,\n };\n }\n\n function pushComputedPropsSpec(path, file) {\n const { node, scope, parent } = path;\n const left = node.left;\n let declar;\n\n const stepKey = scope.generateUid(\"step\");\n const stepValue = t.memberExpression(\n t.identifier(stepKey),\n t.identifier(\"value\"),\n );\n\n if (\n t.isIdentifier(left) ||\n t.isPattern(left) ||\n t.isMemberExpression(left)\n ) {\n // for (i of test), for ({ i } of test)\n declar = t.expressionStatement(\n t.assignmentExpression(\"=\", left, stepValue),\n );\n } else if (t.isVariableDeclaration(left)) {\n // for (let i of test)\n declar = t.variableDeclaration(left.kind, [\n t.variableDeclarator(left.declarations[0].id, stepValue),\n ]);\n } else {\n throw file.buildCodeFrameError(\n left,\n `Unknown node type ${left.type} in ForStatement`,\n );\n }\n\n const template = buildForOf({\n ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier(\"didIteratorError\"),\n ITERATOR_COMPLETION: scope.generateUidIdentifier(\n \"iteratorNormalCompletion\",\n ),\n ITERATOR_ERROR_KEY: scope.generateUidIdentifier(\"iteratorError\"),\n ITERATOR_KEY: scope.generateUidIdentifier(\"iterator\"),\n STEP_KEY: t.identifier(stepKey),\n OBJECT: node.right,\n });\n\n const isLabeledParent = t.isLabeledStatement(parent);\n\n const tryBody = template[3].block.body;\n const loop = tryBody[0];\n\n if (isLabeledParent) {\n tryBody[0] = t.labeledStatement(parent.label, loop);\n }\n\n //\n\n return {\n replaceParent: isLabeledParent,\n declar: declar,\n loop: loop,\n node: template,\n };\n }\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport nameFunction from \"@babel/helper-function-name\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-function-name\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n if (path.key !== \"value\" && !path.parentPath.isObjectProperty()) {\n const replacement = nameFunction(path);\n if (replacement) path.replaceWith(replacement);\n }\n },\n },\n\n ObjectProperty(path) {\n const value = path.get(\"value\");\n if (value.isFunction()) {\n const newNode = nameFunction(value);\n if (newNode) value.replaceWith(newNode);\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-instanceof\",\n\n visitor: {\n BinaryExpression(path) {\n const { node } = path;\n if (node.operator === \"instanceof\") {\n const helper = this.addHelper(\"instanceof\");\n const isUnderHelper = path.findParent(path => {\n return (\n (path.isVariableDeclarator() && path.node.id === helper) ||\n (path.isFunctionDeclaration() &&\n path.node.id &&\n path.node.id.name === helper.name)\n );\n });\n\n if (isUnderHelper) {\n return;\n } else {\n path.replaceWith(t.callExpression(helper, [node.left, node.right]));\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-jscript\",\n\n visitor: {\n FunctionExpression: {\n exit(path) {\n const { node } = path;\n if (!node.id) return;\n\n path.replaceWith(\n t.callExpression(\n t.functionExpression(\n null,\n [],\n t.blockStatement([\n t.toStatement(node),\n t.returnStatement(t.cloneNode(node.id)),\n ]),\n ),\n [],\n ),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-literals\",\n\n visitor: {\n NumericLiteral({ node }) {\n // number octal like 0b10 or 0o70\n if (node.extra && /^0[ob]/i.test(node.extra.raw)) {\n node.extra = undefined;\n }\n },\n\n StringLiteral({ node }) {\n // unicode escape\n if (node.extra && /\\\\[u]/gi.test(node.extra.raw)) {\n node.extra = undefined;\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-member-expression-literals\",\n\n visitor: {\n MemberExpression: {\n exit({ node }) {\n const prop = node.property;\n if (\n !node.computed &&\n t.isIdentifier(prop) &&\n !t.isValidES3Identifier(prop.name)\n ) {\n // foo.default -> foo[\"default\"]\n node.property = t.stringLiteral(prop.name);\n node.computed = true;\n }\n },\n },\n },\n };\n});\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var baseSlice = require('./_baseSlice'),\n isIterateeCall = require('./_isIterateeCall'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\nfunction chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n}\n\nmodule.exports = chunk;\n","export default function rewriteThis(programPath: NodePath) {\n // Rewrite \"this\" to be \"undefined\".\n programPath.traverse(rewriteThisVisitor);\n}\n\n/**\n * A visitor to walk the tree, rewriting all `this` references in the top-level scope to be\n * `undefined`.\n */\nconst rewriteThisVisitor = {\n ThisExpression(path) {\n path.replaceWith(path.scope.buildUndefinedNode());\n },\n Function(path) {\n if (!path.isArrowFunctionExpression()) path.skip();\n },\n ClassProperty(path) {\n path.skip();\n },\n ClassPrivateProperty(path) {\n path.skip();\n },\n};\n","import * as t from \"@babel/types\";\n\nexport default function simplifyAccess(path: NodePath, bindingNames) {\n path.traverse(simpleAssignmentVisitor, {\n scope: path.scope,\n bindingNames,\n seen: new WeakSet(),\n });\n}\n\nconst simpleAssignmentVisitor = {\n UpdateExpression: {\n exit(path) {\n const { scope, bindingNames } = this;\n\n const arg = path.get(\"argument\");\n if (!arg.isIdentifier()) return;\n const localName = arg.node.name;\n\n if (!bindingNames.has(localName)) return;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n if (\n path.parentPath.isExpressionStatement() &&\n !path.isCompletionRecord()\n ) {\n // ++i => (i += 1);\n const operator = path.node.operator == \"++\" ? \"+=\" : \"-=\";\n path.replaceWith(\n t.assignmentExpression(operator, arg.node, t.numericLiteral(1)),\n );\n } else if (path.node.prefix) {\n // ++i => (i = (+i) + 1);\n path.replaceWith(\n t.assignmentExpression(\n \"=\",\n t.identifier(localName),\n t.binaryExpression(\n path.node.operator[0],\n t.unaryExpression(\"+\", arg.node),\n t.numericLiteral(1),\n ),\n ),\n );\n } else {\n const old = path.scope.generateUidIdentifierBasedOnNode(\n arg.node,\n \"old\",\n );\n const varName = old.name;\n path.scope.push({ id: old });\n\n const binary = t.binaryExpression(\n path.node.operator[0],\n t.identifier(varName),\n t.numericLiteral(1),\n );\n\n // i++ => (_old = (+i), i = _old + 1, _old)\n path.replaceWith(\n t.sequenceExpression([\n t.assignmentExpression(\n \"=\",\n t.identifier(varName),\n t.unaryExpression(\"+\", arg.node),\n ),\n t.assignmentExpression(\"=\", t.cloneNode(arg.node), binary),\n t.identifier(varName),\n ]),\n );\n }\n },\n },\n\n AssignmentExpression: {\n exit(path) {\n const { scope, seen, bindingNames } = this;\n\n if (path.node.operator === \"=\") return;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n if (!left.isIdentifier()) return;\n\n // Simple update-assign foo += 1;\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n if (!bindingNames.has(localName)) return;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n path.node.right = t.binaryExpression(\n path.node.operator.slice(0, -1),\n t.cloneNode(path.node.left),\n path.node.right,\n );\n path.node.operator = \"=\";\n },\n },\n};\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\nimport template from \"@babel/template\";\nimport simplifyAccess from \"@babel/helper-simple-access\";\n\nimport type { ModuleMetadata } from \"./\";\n\nexport default function rewriteLiveReferences(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const imported = new Map();\n const exported = new Map();\n const requeueInParent = path => {\n // Manualy re-queue `exports.default =` expressions so that the ES3\n // transform has an opportunity to convert them. Ideally this would\n // happen automatically from the replaceWith above. See #4140 for\n // more info.\n programPath.requeue(path);\n };\n\n for (const [source, data] of metadata.source) {\n for (const [localName, importName] of data.imports) {\n imported.set(localName, [source, importName, null]);\n }\n for (const localName of data.importsNamespace) {\n imported.set(localName, [source, null, localName]);\n }\n }\n\n for (const [local, data] of metadata.local) {\n let exportMeta = exported.get(local);\n if (!exportMeta) {\n exportMeta = [];\n exported.set(local, exportMeta);\n }\n\n exportMeta.push(...data.names);\n }\n\n // Rewrite initialization of bindings to update exports.\n programPath.traverse(rewriteBindingInitVisitor, {\n metadata,\n requeueInParent,\n scope: programPath.scope,\n exported, // local name => exported name list\n });\n\n simplifyAccess(\n programPath,\n // NOTE(logan): The 'Array.from' calls are to make this code with in loose mode.\n new Set([...Array.from(imported.keys()), ...Array.from(exported.keys())]),\n );\n\n // Rewrite reads/writes from imports and exports to have the correct behavior.\n programPath.traverse(rewriteReferencesVisitor, {\n seen: new WeakSet(),\n metadata,\n requeueInParent,\n scope: programPath.scope,\n imported, // local / import\n exported, // local name => exported name list\n buildImportReference: ([source, importName, localName], identNode) => {\n const meta = metadata.source.get(source);\n\n if (localName) {\n if (meta.lazy) identNode = t.callExpression(identNode, []);\n return identNode;\n }\n\n let namespace = t.identifier(meta.name);\n if (meta.lazy) namespace = t.callExpression(namespace, []);\n\n return t.memberExpression(namespace, t.identifier(importName));\n },\n });\n}\n\n/**\n * A visitor to inject export update statements during binding initialization.\n */\nconst rewriteBindingInitVisitor = {\n Scope(path) {\n path.skip();\n },\n ClassDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n const { id } = path.node;\n if (!id) throw new Error(\"Expected class to have a name\");\n const localName = id.name;\n\n const exportNames = exported.get(localName) || [];\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n ),\n );\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n },\n VariableDeclaration(path) {\n const { requeueInParent, exported, metadata } = this;\n\n Object.keys(path.getOuterBindingIdentifiers()).forEach(localName => {\n const exportNames = exported.get(localName) || [];\n\n if (exportNames.length > 0) {\n const statement = t.expressionStatement(\n buildBindingExportAssignmentExpression(\n metadata,\n exportNames,\n t.identifier(localName),\n ),\n );\n statement._blockHoist = path.node._blockHoist;\n\n requeueInParent(path.insertAfter(statement)[0]);\n }\n });\n },\n};\n\nconst buildBindingExportAssignmentExpression = (\n metadata,\n exportNames,\n localExpr,\n) => {\n return (exportNames || []).reduce((expr, exportName) => {\n // class Foo {} export { Foo, Foo as Bar };\n // as\n // class Foo {} exports.Foo = exports.Bar = Foo;\n return t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(metadata.exportName),\n t.identifier(exportName),\n ),\n expr,\n );\n }, localExpr);\n};\n\nconst buildImportThrow = localName => {\n return template.expression.ast`\n (function() {\n throw new Error('\"' + '${localName}' + '\" is read-only.');\n })()\n `;\n};\n\nconst rewriteReferencesVisitor = {\n ReferencedIdentifier(path) {\n const {\n seen,\n buildImportReference,\n scope,\n imported,\n requeueInParent,\n } = this;\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const localName = path.node.name;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const importData = imported.get(localName);\n if (importData) {\n const ref = buildImportReference(importData, path.node);\n\n // Preserve the binding location so that sourcemaps are nicer.\n ref.loc = path.node.loc;\n\n if (\n (path.parentPath.isCallExpression({ callee: path.node }) ||\n path.parentPath.isOptionalCallExpression({ callee: path.node }) ||\n path.parentPath.isTaggedTemplateExpression({ tag: path.node })) &&\n t.isMemberExpression(ref)\n ) {\n path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref]));\n } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) {\n const { object, property } = ref;\n path.replaceWith(\n t.JSXMemberExpression(\n t.JSXIdentifier(object.name),\n t.JSXIdentifier(property.name),\n ),\n );\n } else {\n path.replaceWith(ref);\n }\n\n requeueInParent(path);\n\n // The path could have been replaced with an identifier that would\n // otherwise be re-visited, so we skip processing its children.\n path.skip();\n }\n },\n\n AssignmentExpression: {\n exit(path) {\n const {\n scope,\n seen,\n imported,\n exported,\n requeueInParent,\n buildImportReference,\n } = this;\n\n if (seen.has(path.node)) return;\n seen.add(path.node);\n\n const left = path.get(\"left\");\n\n // No change needed\n if (left.isMemberExpression()) return;\n\n if (left.isIdentifier()) {\n // Simple update-assign foo += 1; export { foo };\n // => exports.foo = (foo += 1);\n const localName = left.node.name;\n\n // redeclared in this scope\n if (scope.getBinding(localName) !== path.scope.getBinding(localName)) {\n return;\n }\n\n const exportedNames = exported.get(localName);\n const importData = imported.get(localName);\n if (exportedNames?.length > 0 || importData) {\n assert(path.node.operator === \"=\", \"Path was not simplified\");\n\n const assignment = path.node;\n\n if (importData) {\n assignment.left = buildImportReference(importData, assignment.left);\n\n assignment.right = t.sequenceExpression([\n assignment.right,\n buildImportThrow(localName),\n ]);\n }\n\n path.replaceWith(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n assignment,\n ),\n );\n requeueInParent(path);\n }\n } else {\n const ids = left.getOuterBindingIdentifiers();\n const programScopeIds = Object.keys(ids).filter(\n localName =>\n scope.getBinding(localName) === path.scope.getBinding(localName),\n );\n const id = programScopeIds.find(localName => imported.has(localName));\n\n if (id) {\n path.node.right = t.sequenceExpression([\n path.node.right,\n buildImportThrow(id),\n ]);\n }\n\n // Complex ({a, b, c} = {}); export { a, c };\n // => ({a, b, c} = {}), (exports.a = a, exports.c = c);\n const items = [];\n programScopeIds.forEach(localName => {\n const exportedNames = exported.get(localName) || [];\n if (exportedNames.length > 0) {\n items.push(\n buildBindingExportAssignmentExpression(\n this.metadata,\n exportedNames,\n t.identifier(localName),\n ),\n );\n }\n });\n\n if (items.length > 0) {\n let node = t.sequenceExpression(items);\n if (path.parentPath.isExpressionStatement()) {\n node = t.expressionStatement(node);\n node._blockHoist = path.parentPath.node._blockHoist;\n }\n\n const statement = path.insertAfter(node)[0];\n requeueInParent(statement);\n }\n }\n },\n },\n};\n","import { basename, extname } from \"path\";\n\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\n\nexport type ModuleMetadata = {\n exportName: string,\n\n // The name of the variable that will reference an object containing export names.\n exportNameListName: null | string,\n\n hasExports: boolean,\n\n // Lookup from local binding to export information.\n local: Map,\n\n // Lookup of source file to source file metadata.\n source: Map,\n};\n\nexport type InteropType = \"default\" | \"namespace\" | \"none\";\n\nexport type SourceModuleMetadata = {\n // A unique variable name to use for this namespace object. Centralized for simplicity.\n name: string,\n\n loc: ?BabelNodeSourceLocation,\n\n interop: InteropType,\n\n // Local binding to reference from this source namespace. Key: Local name, value: Import name\n imports: Map,\n\n // Local names that reference namespace object.\n importsNamespace: Set,\n\n // Reexports to create for namespace. Key: Export name, value: Import name\n reexports: Map,\n\n // List of names to re-export namespace as.\n reexportNamespace: Set,\n\n // Tracks if the source should be re-exported.\n reexportAll: null | {\n loc: ?BabelNodeSourceLocation,\n },\n};\n\nexport type LocalExportMetadata = {\n name: Array, // names of exports\n kind: \"import\" | \"hoisted\" | \"block\" | \"var\",\n};\n\n/**\n * Check if the module has any exports that need handling.\n */\nexport function hasExports(metadata: ModuleMetadata) {\n return metadata.hasExports;\n}\n\n/**\n * Check if a given source is an anonymous import, e.g. \"import 'foo';\"\n */\nexport function isSideEffectImport(source: SourceModuleMetadata) {\n return (\n source.imports.size === 0 &&\n source.importsNamespace.size === 0 &&\n source.reexports.size === 0 &&\n source.reexportNamespace.size === 0 &&\n !source.reexportAll\n );\n}\n\n/**\n * Remove all imports and exports from the file, and return all metadata\n * needed to reconstruct the module's behavior.\n */\nexport default function normalizeModuleAndLoadMetadata(\n programPath: NodePath,\n exportName?: string,\n {\n noInterop = false,\n loose = false,\n lazy = false,\n esNamespaceOnly = false,\n } = {},\n): ModuleMetadata {\n if (!exportName) {\n exportName = programPath.scope.generateUidIdentifier(\"exports\").name;\n }\n\n nameAnonymousExports(programPath);\n\n const { local, source, hasExports } = getModuleMetadata(programPath, {\n loose,\n lazy,\n });\n\n removeModuleDeclarations(programPath);\n\n // Reuse the imported namespace name if there is one.\n for (const [, metadata] of source) {\n if (metadata.importsNamespace.size > 0) {\n // This is kind of gross. If we stop using `loose: true` we should\n // just make this destructuring assignment.\n metadata.name = metadata.importsNamespace.values().next().value;\n }\n\n if (noInterop) metadata.interop = \"none\";\n else if (esNamespaceOnly) {\n // Both the default and namespace interops pass through __esModule\n // objects, but the namespace interop is used to enable Babel's\n // destructuring-like interop behavior for normal CommonJS.\n // Since some tooling has started to remove that behavior, we expose\n // it as the `esNamespace` option.\n if (metadata.interop === \"namespace\") {\n metadata.interop = \"default\";\n }\n }\n }\n\n return {\n exportName,\n exportNameListName: null,\n hasExports,\n local,\n source,\n };\n}\n\n/**\n * Get metadata about the imports and exports present in this module.\n */\nfunction getModuleMetadata(\n programPath: NodePath,\n { loose, lazy }: { loose: boolean, lazy: boolean },\n) {\n const localData = getLocalExportMetadata(programPath, loose);\n\n const sourceData = new Map();\n const getData = sourceNode => {\n const source = sourceNode.value;\n\n let data = sourceData.get(source);\n if (!data) {\n data = {\n name: programPath.scope.generateUidIdentifier(\n basename(source, extname(source)),\n ).name,\n\n interop: \"none\",\n\n loc: null,\n\n // Data about the requested sources and names.\n imports: new Map(),\n importsNamespace: new Set(),\n\n // Metadata about data that is passed directly from source to export.\n reexports: new Map(),\n reexportNamespace: new Set(),\n reexportAll: null,\n\n lazy: false,\n };\n sourceData.set(source, data);\n }\n return data;\n };\n let hasExports = false;\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (spec.isImportDefaultSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, \"default\");\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, \"default\");\n });\n }\n } else if (spec.isImportNamespaceSpecifier()) {\n const localName = spec.get(\"local\").node.name;\n\n data.importsNamespace.add(localName);\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexportNamespace.add(name);\n });\n }\n } else if (spec.isImportSpecifier()) {\n const importName = spec.get(\"imported\").node.name;\n const localName = spec.get(\"local\").node.name;\n\n data.imports.set(localName, importName);\n\n const reexport = localData.get(localName);\n if (reexport) {\n localData.delete(localName);\n\n reexport.names.forEach(name => {\n data.reexports.set(name, importName);\n });\n }\n }\n });\n } else if (child.isExportAllDeclaration()) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n data.reexportAll = {\n loc: child.node.loc,\n };\n } else if (child.isExportNamedDeclaration() && child.node.source) {\n hasExports = true;\n const data = getData(child.node.source);\n if (!data.loc) data.loc = child.node.loc;\n\n child.get(\"specifiers\").forEach(spec => {\n if (!spec.isExportSpecifier()) {\n throw spec.buildCodeFrameError(\"Unexpected export specifier type\");\n }\n const importName = spec.get(\"local\").node.name;\n const exportName = spec.get(\"exported\").node.name;\n\n data.reexports.set(exportName, importName);\n\n if (exportName === \"__esModule\") {\n throw exportName.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n });\n } else if (\n child.isExportNamedDeclaration() ||\n child.isExportDefaultDeclaration()\n ) {\n hasExports = true;\n }\n });\n\n for (const metadata of sourceData.values()) {\n let needsDefault = false;\n let needsNamed = false;\n\n if (metadata.importsNamespace.size > 0) {\n needsDefault = true;\n needsNamed = true;\n }\n\n if (metadata.reexportAll) {\n needsNamed = true;\n }\n\n for (const importName of metadata.imports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n for (const importName of metadata.reexports.values()) {\n if (importName === \"default\") needsDefault = true;\n else needsNamed = true;\n }\n\n if (needsDefault && needsNamed) {\n // TODO(logan): Using the namespace interop here is unfortunate. Revisit.\n metadata.interop = \"namespace\";\n } else if (needsDefault) {\n metadata.interop = \"default\";\n }\n }\n\n for (const [source, metadata] of sourceData) {\n if (\n lazy !== false &&\n !(isSideEffectImport(metadata) || metadata.reexportAll)\n ) {\n if (lazy === true) {\n // 'true' means that local relative files are eagerly loaded and\n // dependency modules are loaded lazily.\n metadata.lazy = !/\\./.test(source);\n } else if (Array.isArray(lazy)) {\n metadata.lazy = lazy.indexOf(source) !== -1;\n } else if (typeof lazy === \"function\") {\n metadata.lazy = lazy(source);\n } else {\n throw new Error(`.lazy must be a boolean, string array, or function`);\n }\n }\n }\n\n return {\n hasExports,\n local: localData,\n source: sourceData,\n };\n}\n\n/**\n * Get metadata about local variables that are exported.\n */\nfunction getLocalExportMetadata(\n programPath: NodePath,\n loose: boolean,\n): Map {\n const bindingKindLookup = new Map();\n\n programPath.get(\"body\").forEach(child => {\n let kind;\n if (child.isImportDeclaration()) {\n kind = \"import\";\n } else {\n if (child.isExportDefaultDeclaration()) child = child.get(\"declaration\");\n if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child = child.get(\"declaration\");\n } else if (\n loose &&\n child.node.source &&\n child.get(\"source\").isStringLiteral()\n ) {\n child.node.specifiers.forEach(specifier => {\n bindingKindLookup.set(specifier.local.name, \"block\");\n });\n return;\n }\n }\n\n if (child.isFunctionDeclaration()) {\n kind = \"hoisted\";\n } else if (child.isClassDeclaration()) {\n kind = \"block\";\n } else if (child.isVariableDeclaration({ kind: \"var\" })) {\n kind = \"var\";\n } else if (child.isVariableDeclaration()) {\n kind = \"block\";\n } else {\n return;\n }\n }\n\n Object.keys(child.getOuterBindingIdentifiers()).forEach(name => {\n bindingKindLookup.set(name, kind);\n });\n });\n\n const localMetadata = new Map();\n const getLocalMetadata = idPath => {\n const localName = idPath.node.name;\n let metadata = localMetadata.get(localName);\n\n if (!metadata) {\n const kind = bindingKindLookup.get(localName);\n\n if (kind === undefined) {\n throw idPath.buildCodeFrameError(\n `Exporting local \"${localName}\", which is not declared.`,\n );\n }\n\n metadata = {\n names: [],\n kind,\n };\n localMetadata.set(localName, metadata);\n }\n return metadata;\n };\n\n programPath.get(\"body\").forEach(child => {\n if (child.isExportNamedDeclaration() && (loose || !child.node.source)) {\n if (child.node.declaration) {\n const declaration = child.get(\"declaration\");\n const ids = declaration.getOuterBindingIdentifierPaths();\n Object.keys(ids).forEach(name => {\n if (name === \"__esModule\") {\n throw declaration.buildCodeFrameError(\n 'Illegal export \"__esModule\".',\n );\n }\n getLocalMetadata(ids[name]).names.push(name);\n });\n } else {\n child.get(\"specifiers\").forEach(spec => {\n const local = spec.get(\"local\");\n const exported = spec.get(\"exported\");\n\n if (exported.node.name === \"__esModule\") {\n throw exported.buildCodeFrameError('Illegal export \"__esModule\".');\n }\n getLocalMetadata(local).names.push(exported.node.name);\n });\n }\n } else if (child.isExportDefaultDeclaration()) {\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n getLocalMetadata(declaration.get(\"id\")).names.push(\"default\");\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n }\n });\n return localMetadata;\n}\n\n/**\n * Ensure that all exported values have local binding names.\n */\nfunction nameAnonymousExports(programPath: NodePath) {\n // Name anonymous exported locals.\n programPath.get(\"body\").forEach(child => {\n if (!child.isExportDefaultDeclaration()) return;\n splitExportDeclaration(child);\n });\n}\n\nfunction removeModuleDeclarations(programPath: NodePath) {\n programPath.get(\"body\").forEach(child => {\n if (child.isImportDeclaration()) {\n child.remove();\n } else if (child.isExportNamedDeclaration()) {\n if (child.node.declaration) {\n child.node.declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(child.node.declaration);\n } else {\n child.remove();\n }\n } else if (child.isExportDefaultDeclaration()) {\n // export default foo;\n const declaration = child.get(\"declaration\");\n if (\n declaration.isFunctionDeclaration() ||\n declaration.isClassDeclaration()\n ) {\n declaration._blockHoist = child.node._blockHoist;\n child.replaceWith(declaration);\n } else {\n // These should have been removed by the nameAnonymousExports() call.\n throw declaration.buildCodeFrameError(\n \"Unexpected default expression export.\",\n );\n }\n } else if (child.isExportAllDeclaration()) {\n child.remove();\n }\n });\n}\n","import assert from \"assert\";\nimport * as t from \"@babel/types\";\nimport template from \"@babel/template\";\nimport chunk from \"lodash/chunk\";\n\nimport { isModule } from \"@babel/helper-module-imports\";\n\nimport rewriteThis from \"./rewrite-this\";\nimport rewriteLiveReferences from \"./rewrite-live-references\";\nimport normalizeAndLoadModuleMetadata, {\n hasExports,\n isSideEffectImport,\n} from \"./normalize-and-load-metadata\";\n\nexport { hasExports, isSideEffectImport, isModule, rewriteThis };\n\n/**\n * Perform all of the generic ES6 module rewriting needed to handle initial\n * module processing. This function will rewrite the majority of the given\n * program to reference the modules described by the returned metadata,\n * and returns a list of statements for use when initializing the module.\n */\nexport function rewriteModuleStatementsAndPrepareHeader(\n path: NodePath,\n {\n exportName,\n strict,\n allowTopLevelThis,\n strictMode,\n loose,\n noInterop,\n lazy,\n esNamespaceOnly,\n },\n) {\n assert(isModule(path), \"Cannot process module statements in a script\");\n path.node.sourceType = \"script\";\n\n const meta = normalizeAndLoadModuleMetadata(path, exportName, {\n noInterop,\n loose,\n lazy,\n esNamespaceOnly,\n });\n\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n\n rewriteLiveReferences(path, meta);\n\n if (strictMode !== false) {\n const hasStrict = path.node.directives.some(directive => {\n return directive.value.value === \"use strict\";\n });\n if (!hasStrict) {\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n }\n }\n\n const headers = [];\n if (hasExports(meta) && !strict) {\n headers.push(buildESModuleHeader(meta, loose /* enumerable */));\n }\n\n const nameList = buildExportNameListDeclaration(path, meta);\n\n if (nameList) {\n meta.exportNameListName = nameList.name;\n headers.push(nameList.statement);\n }\n\n // Create all of the statically known named exports.\n headers.push(...buildExportInitializationStatements(path, meta, loose));\n\n return { meta, headers };\n}\n\n/**\n * Flag a set of statements as hoisted above all else so that module init\n * statements all run before user code.\n */\nexport function ensureStatementsHoisted(statements) {\n // Force all of the header fields to be at the top of the file.\n statements.forEach(header => {\n header._blockHoist = 3;\n });\n}\n\n/**\n * Given an expression for a standard import object, like \"require('foo')\",\n * wrap it in a call to the interop helpers based on the type.\n */\nexport function wrapInterop(\n programPath: NodePath,\n expr: Node,\n type: InteropType,\n): Node {\n if (type === \"none\") {\n return null;\n }\n\n let helper;\n if (type === \"default\") {\n helper = \"interopRequireDefault\";\n } else if (type === \"namespace\") {\n helper = \"interopRequireWildcard\";\n } else {\n throw new Error(`Unknown interop: ${type}`);\n }\n\n return t.callExpression(programPath.hub.addHelper(helper), [expr]);\n}\n\n/**\n * Create the runtime initialization statements for a given requested source.\n * These will initialize all of the runtime import/export logic that\n * can't be handled statically by the statements created by\n * buildExportInitializationStatements().\n */\nexport function buildNamespaceInitStatements(\n metadata: ModuleMetadata,\n sourceMetadata: SourceModuleMetadata,\n loose: boolean = false,\n) {\n const statements = [];\n\n let srcNamespace = t.identifier(sourceMetadata.name);\n if (sourceMetadata.lazy) srcNamespace = t.callExpression(srcNamespace, []);\n\n for (const localName of sourceMetadata.importsNamespace) {\n if (localName === sourceMetadata.name) continue;\n\n // Create and assign binding to namespace object\n statements.push(\n template.statement`var NAME = SOURCE;`({\n NAME: localName,\n SOURCE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (loose) {\n statements.push(...buildReexportsFromMeta(metadata, sourceMetadata, loose));\n }\n for (const exportName of sourceMetadata.reexportNamespace) {\n // Assign export to namespace object.\n statements.push(\n (sourceMetadata.lazy\n ? template.statement`\n Object.defineProperty(EXPORTS, \"NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE;\n }\n });\n `\n : template.statement`EXPORTS.NAME = NAMESPACE;`)({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n NAMESPACE: t.cloneNode(srcNamespace),\n }),\n );\n }\n if (sourceMetadata.reexportAll) {\n const statement = buildNamespaceReexport(\n metadata,\n t.cloneNode(srcNamespace),\n loose,\n );\n statement.loc = sourceMetadata.reexportAll.loc;\n\n // Iterate props creating getter for each prop.\n statements.push(statement);\n }\n return statements;\n}\n\nconst getTemplateForReexport = loose => {\n return loose\n ? template.statement`EXPORTS.EXPORT_NAME = NAMESPACE.IMPORT_NAME;`\n : template`\n Object.defineProperty(EXPORTS, \"EXPORT_NAME\", {\n enumerable: true,\n get: function() {\n return NAMESPACE.IMPORT_NAME;\n },\n });\n `;\n};\n\nconst buildReexportsFromMeta = (meta, metadata, loose) => {\n const namespace = metadata.lazy\n ? t.callExpression(t.identifier(metadata.name), [])\n : t.identifier(metadata.name);\n\n const templateForCurrentMode = getTemplateForReexport(loose);\n return Array.from(metadata.reexports, ([exportName, importName]) =>\n templateForCurrentMode({\n EXPORTS: meta.exportName,\n EXPORT_NAME: exportName,\n NAMESPACE: t.cloneNode(namespace),\n IMPORT_NAME: importName,\n }),\n );\n};\n\n/**\n * Build an \"__esModule\" header statement setting the property on a given object.\n */\nfunction buildESModuleHeader(\n metadata: ModuleMetadata,\n enumerable: boolean = false,\n) {\n return (enumerable\n ? template.statement`\n EXPORTS.__esModule = true;\n `\n : template.statement`\n Object.defineProperty(EXPORTS, \"__esModule\", {\n value: true,\n });\n `)({ EXPORTS: metadata.exportName });\n}\n\n/**\n * Create a re-export initialization loop for a specific imported namespace.\n */\nfunction buildNamespaceReexport(metadata, namespace, loose) {\n return (loose\n ? template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n EXPORTS[key] = NAMESPACE[key];\n });\n `\n : template.statement`\n Object.keys(NAMESPACE).forEach(function(key) {\n if (key === \"default\" || key === \"__esModule\") return;\n VERIFY_NAME_LIST;\n\n Object.defineProperty(EXPORTS, key, {\n enumerable: true,\n get: function() {\n return NAMESPACE[key];\n },\n });\n });\n `)({\n NAMESPACE: namespace,\n EXPORTS: metadata.exportName,\n VERIFY_NAME_LIST: metadata.exportNameListName\n ? template`\n if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;\n `({ EXPORTS_LIST: metadata.exportNameListName })\n : null,\n });\n}\n\n/**\n * Build a statement declaring a variable that contains all of the exported\n * variable names in an object so they can easily be referenced from an\n * export * from statement to check for conflicts.\n */\nfunction buildExportNameListDeclaration(\n programPath: NodePath,\n metadata: ModuleMetadata,\n) {\n const exportedVars = Object.create(null);\n for (const data of metadata.local.values()) {\n for (const name of data.names) {\n exportedVars[name] = true;\n }\n }\n\n let hasReexport = false;\n for (const data of metadata.source.values()) {\n for (const exportName of data.reexports.keys()) {\n exportedVars[exportName] = true;\n }\n for (const exportName of data.reexportNamespace) {\n exportedVars[exportName] = true;\n }\n\n hasReexport = hasReexport || data.reexportAll;\n }\n\n if (!hasReexport || Object.keys(exportedVars).length === 0) return null;\n\n const name = programPath.scope.generateUidIdentifier(\"exportNames\");\n\n delete exportedVars.default;\n\n return {\n name: name.name,\n statement: t.variableDeclaration(\"var\", [\n t.variableDeclarator(name, t.valueToNode(exportedVars)),\n ]),\n };\n}\n\n/**\n * Create a set of statements that will initialize all of the statically-known\n * export names with their expected values.\n */\nfunction buildExportInitializationStatements(\n programPath: NodePath,\n metadata: ModuleMetadata,\n loose: boolean = false,\n) {\n const initStatements = [];\n\n const exportNames = [];\n for (const [localName, data] of metadata.local) {\n if (data.kind === \"import\") {\n // No-open since these are explicitly set with the \"reexports\" block.\n } else if (data.kind === \"hoisted\") {\n initStatements.push(\n buildInitStatement(metadata, data.names, t.identifier(localName)),\n );\n } else {\n exportNames.push(...data.names);\n }\n }\n\n for (const data of metadata.source.values()) {\n if (!loose) {\n initStatements.push(...buildReexportsFromMeta(metadata, data, loose));\n }\n for (const exportName of data.reexportNamespace) {\n exportNames.push(exportName);\n }\n }\n\n initStatements.push(\n ...chunk(exportNames, 100).map(members => {\n return buildInitStatement(\n metadata,\n members,\n programPath.scope.buildUndefinedNode(),\n );\n }),\n );\n\n return initStatements;\n}\n\n/**\n * Given a set of export names, create a set of nested assignments to\n * initialize them all to a given expression.\n */\nfunction buildInitStatement(metadata, exportNames, initExpr) {\n return t.expressionStatement(\n exportNames.reduce(\n (acc, exportName) =>\n template.expression`EXPORTS.NAME = VALUE`({\n EXPORTS: metadata.exportName,\n NAME: exportName,\n VALUE: acc,\n }),\n initExpr,\n ),\n );\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getImportSource = getImportSource;\nexports.createDynamicImportTransform = createDynamicImportTransform;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction getImportSource(t, callNode) {\n var importArguments = callNode.arguments;\n\n var _importArguments = _slicedToArray(importArguments, 1),\n importPath = _importArguments[0];\n\n var isString = t.isStringLiteral(importPath) || t.isTemplateLiteral(importPath);\n\n if (isString) {\n t.removeComments(importPath);\n return importPath;\n }\n\n return t.templateLiteral([t.templateElement({\n raw: '',\n cooked: ''\n }), t.templateElement({\n raw: '',\n cooked: ''\n }, true)], importArguments);\n}\n\nfunction createDynamicImportTransform(_ref) {\n var template = _ref.template,\n t = _ref.types;\n var buildImport = template('Promise.resolve().then(() => MODULE)');\n return function (context, path) {\n var requireCall = t.callExpression(t.identifier('require'), [getImportSource(t, path.parent)]);\n var _context$opts$noInter = context.opts.noInterop,\n noInterop = _context$opts$noInter === undefined ? false : _context$opts$noInter;\n var MODULE = noInterop === true ? requireCall : t.callExpression(context.addHelper('interopRequireWildcard'), [requireCall]);\n var newImport = buildImport({\n MODULE: MODULE\n });\n path.parentPath.replaceWith(newImport);\n };\n}","// Re-export lib/utils, so that consumers can import\n// babel-plugin-dynamic-import-node/utils instead of\n// babel-plugin-dynamic-import-node/lib/utils\n\n// eslint-disable-next-line import/no-unresolved\nmodule.exports = require('./lib/utils');\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n hasExports,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport { template, types as t } from \"@babel/core\";\nimport { getImportSource } from \"babel-plugin-dynamic-import-node/utils\";\n\nconst buildWrapper = template(`\n define(MODULE_NAME, AMD_ARGUMENTS, function(IMPORT_NAMES) {\n })\n`);\n\nconst buildAnonymousWrapper = template(`\n define([\"require\"], function(REQUIRE) {\n })\n`);\n\nfunction injectWrapper(path, wrapper) {\n const { body, directives } = path.node;\n path.node.directives = [];\n path.node.body = [];\n const amdWrapper = path.pushContainer(\"body\", wrapper)[0];\n const amdFactory = amdWrapper\n .get(\"expression.arguments\")\n .filter(arg => arg.isFunctionExpression())[0]\n .get(\"body\");\n amdFactory.pushContainer(\"directives\", directives);\n amdFactory.pushContainer(\"body\", body);\n}\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose, allowTopLevelThis, strict, strictMode, noInterop } = options;\n return {\n name: \"transform-modules-amd\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"amd\");\n },\n\n visitor: {\n CallExpression(path, state) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) return;\n if (!path.get(\"callee\").isImport()) return;\n\n let { requireId, resolveId, rejectId } = state;\n if (!requireId) {\n requireId = path.scope.generateUidIdentifier(\"require\");\n state.requireId = requireId;\n }\n if (!resolveId || !rejectId) {\n resolveId = path.scope.generateUidIdentifier(\"resolve\");\n rejectId = path.scope.generateUidIdentifier(\"reject\");\n state.resolveId = resolveId;\n state.rejectId = rejectId;\n }\n\n let result = t.identifier(\"imported\");\n if (!noInterop) result = wrapInterop(path, result, \"namespace\");\n\n path.replaceWith(\n template.expression.ast`\n new Promise((${resolveId}, ${rejectId}) =>\n ${requireId}(\n [${getImportSource(t, path.node)}],\n imported => ${resolveId}(${result}),\n ${rejectId}\n )\n )`,\n );\n },\n\n Program: {\n exit(path, { requireId }) {\n if (!isModule(path)) {\n if (requireId) {\n injectWrapper(\n path,\n buildAnonymousWrapper({ REQUIRE: requireId }),\n );\n }\n return;\n }\n\n const amdArgs = [];\n const importNames = [];\n if (requireId) {\n amdArgs.push(t.stringLiteral(\"require\"));\n importNames.push(requireId);\n }\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n },\n );\n\n if (hasExports(meta)) {\n amdArgs.push(t.stringLiteral(\"exports\"));\n\n importNames.push(t.identifier(meta.exportName));\n }\n\n for (const [source, metadata] of meta.source) {\n amdArgs.push(t.stringLiteral(source));\n importNames.push(t.identifier(metadata.name));\n\n if (!isSideEffectImport(metadata)) {\n const interop = wrapInterop(\n path,\n t.identifier(metadata.name),\n metadata.interop,\n );\n if (interop) {\n const header = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(metadata.name),\n interop,\n ),\n );\n header.loc = metadata.loc;\n headers.push(header);\n }\n }\n\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n\n injectWrapper(\n path,\n buildWrapper({\n MODULE_NAME: moduleName,\n\n AMD_ARGUMENTS: t.arrayExpression(amdArgs),\n IMPORT_NAMES: importNames,\n }),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport simplifyAccess from \"@babel/helper-simple-access\";\nimport { template, types as t } from \"@babel/core\";\n\nimport { createDynamicImportTransform } from \"babel-plugin-dynamic-import-node/utils\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const transformImportCall = createDynamicImportTransform(api);\n\n const {\n loose,\n\n // 'true' for non-mjs files to strictly have .default, instead of having\n // destructuring-like behavior for their properties.\n strictNamespace = false,\n\n // 'true' for mjs files to strictly have .default, instead of having\n // destructuring-like behavior for their properties.\n mjsStrictNamespace = true,\n allowTopLevelThis,\n strict,\n strictMode,\n noInterop,\n lazy = false,\n // Defaulting to 'true' for now. May change before 7.x major.\n allowCommonJSExports = true,\n } = options;\n\n if (\n typeof lazy !== \"boolean\" &&\n typeof lazy !== \"function\" &&\n (!Array.isArray(lazy) || !lazy.every(item => typeof item === \"string\"))\n ) {\n throw new Error(`.lazy must be a boolean, array of strings, or a function`);\n }\n\n if (typeof strictNamespace !== \"boolean\") {\n throw new Error(`.strictNamespace must be a boolean, or undefined`);\n }\n if (typeof mjsStrictNamespace !== \"boolean\") {\n throw new Error(`.mjsStrictNamespace must be a boolean, or undefined`);\n }\n\n const getAssertion = localName => template.expression.ast`\n (function(){\n throw new Error(\n \"The CommonJS '\" + \"${localName}\" + \"' variable is not available in ES6 modules.\" +\n \"Consider setting setting sourceType:script or sourceType:unambiguous in your \" +\n \"Babel config for this file.\");\n })()\n `;\n\n const moduleExportsVisitor = {\n ReferencedIdentifier(path) {\n const localName = path.node.name;\n if (localName !== \"module\" && localName !== \"exports\") return;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = this.scope.getBinding(localName);\n\n if (\n // redeclared in this scope\n rootBinding !== localBinding ||\n (path.parentPath.isObjectProperty({ value: path.node }) &&\n path.parentPath.parentPath.isObjectPattern()) ||\n path.parentPath.isAssignmentExpression({ left: path.node }) ||\n path.isAssignmentExpression({ left: path.node })\n ) {\n return;\n }\n\n path.replaceWith(getAssertion(localName));\n },\n\n AssignmentExpression(path) {\n const left = path.get(\"left\");\n if (left.isIdentifier()) {\n const localName = path.node.name;\n if (localName !== \"module\" && localName !== \"exports\") return;\n\n const localBinding = path.scope.getBinding(localName);\n const rootBinding = this.scope.getBinding(localName);\n\n // redeclared in this scope\n if (rootBinding !== localBinding) return;\n\n const right = path.get(\"right\");\n right.replaceWith(\n t.sequenceExpression([right.node, getAssertion(localName)]),\n );\n } else if (left.isPattern()) {\n const ids = left.getOuterBindingIdentifiers();\n const localName = Object.keys(ids).filter(localName => {\n if (localName !== \"module\" && localName !== \"exports\") return false;\n\n return (\n this.scope.getBinding(localName) ===\n path.scope.getBinding(localName)\n );\n })[0];\n\n if (localName) {\n const right = path.get(\"right\");\n right.replaceWith(\n t.sequenceExpression([right.node, getAssertion(localName)]),\n );\n }\n }\n },\n };\n\n return {\n name: \"transform-modules-commonjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"commonjs\");\n },\n\n visitor: {\n CallExpression(path) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) return;\n if (!path.get(\"callee\").isImport()) return;\n\n let { scope } = path;\n do {\n scope.rename(\"require\");\n } while ((scope = scope.parent));\n\n transformImportCall(this, path.get(\"callee\"));\n },\n\n Program: {\n exit(path, state) {\n if (!isModule(path)) return;\n\n // Rename the bindings auto-injected into the scope so there is no\n // risk of conflict between the bindings.\n path.scope.rename(\"exports\");\n path.scope.rename(\"module\");\n path.scope.rename(\"require\");\n path.scope.rename(\"__filename\");\n path.scope.rename(\"__dirname\");\n\n // Rewrite references to 'module' and 'exports' to throw exceptions.\n // These objects are specific to CommonJS and are not available in\n // real ES6 implementations.\n if (!allowCommonJSExports) {\n simplifyAccess(path, new Set([\"module\", \"exports\"]));\n path.traverse(moduleExportsVisitor, {\n scope: path.scope,\n });\n }\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n exportName: \"exports\",\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n lazy,\n esNamespaceOnly:\n typeof state.filename === \"string\" &&\n /\\.mjs$/.test(state.filename)\n ? mjsStrictNamespace\n : strictNamespace,\n },\n );\n\n for (const [source, metadata] of meta.source) {\n const loadExpr = t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(source),\n ]);\n\n let header;\n if (isSideEffectImport(metadata)) {\n if (metadata.lazy) throw new Error(\"Assertion failure\");\n\n header = t.expressionStatement(loadExpr);\n } else {\n const init =\n wrapInterop(path, loadExpr, metadata.interop) || loadExpr;\n\n if (metadata.lazy) {\n header = template.ast`\n function ${metadata.name}() {\n const data = ${init};\n ${metadata.name} = function(){ return data; };\n return data;\n }\n `;\n } else {\n header = template.ast`\n var ${metadata.name} = ${init};\n `;\n }\n }\n header.loc = metadata.loc;\n\n headers.push(header);\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n },\n },\n },\n };\n});\n","import * as t from \"@babel/types\";\n\nconst visitor = {\n Scope(path, state) {\n if (state.kind === \"let\") path.skip();\n },\n\n Function(path) {\n path.skip();\n },\n\n VariableDeclaration(path, state) {\n if (state.kind && path.node.kind !== state.kind) return;\n\n const nodes = [];\n\n const declarations: Array = path.get(\"declarations\");\n let firstId;\n\n for (const declar of declarations) {\n firstId = declar.node.id;\n\n if (declar.node.init) {\n nodes.push(\n t.expressionStatement(\n t.assignmentExpression(\"=\", declar.node.id, declar.node.init),\n ),\n );\n }\n\n for (const name of Object.keys(declar.getBindingIdentifiers())) {\n state.emit(t.identifier(name), name, declar.node.init !== null);\n }\n }\n\n // for (var i in test)\n if (path.parentPath.isFor({ left: path.node })) {\n path.replaceWith(firstId);\n } else {\n path.replaceWithMultiple(nodes);\n }\n },\n};\n\nexport default function(path, emit: Function, kind: \"var\" | \"let\" = \"var\") {\n path.traverse(visitor, { kind, emit });\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport hoistVariables from \"@babel/helper-hoist-variables\";\nimport { template, types as t } from \"@babel/core\";\nimport { getImportSource } from \"babel-plugin-dynamic-import-node/utils\";\nimport { rewriteThis } from \"@babel/helper-module-transforms\";\n\nconst buildTemplate = template(`\n SYSTEM_REGISTER(MODULE_NAME, SOURCES, function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {\n \"use strict\";\n BEFORE_BODY;\n return {\n setters: SETTERS,\n execute: function () {\n BODY;\n }\n };\n });\n`);\n\nconst buildExportAll = template(`\n for (var KEY in TARGET) {\n if (KEY !== \"default\" && KEY !== \"__esModule\") EXPORT_OBJ[KEY] = TARGET[KEY];\n }\n`);\n\nconst MISSING_PLUGIN_WARNING = `\\\nWARNING: Dynamic import() transformation must be enabled using the\n @babel/plugin-proposal-dynamic-import plugin. Babel 8 will\n no longer transform import() without using that plugin.\n`;\n\nfunction constructExportCall(\n path,\n exportIdent,\n exportNames,\n exportValues,\n exportStarTarget,\n) {\n const statements = [];\n if (exportNames.length === 1) {\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [\n t.stringLiteral(exportNames[0]),\n exportValues[0],\n ]),\n ),\n );\n } else if (!exportStarTarget) {\n const objectProperties = [];\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n objectProperties.push(\n t.objectProperty(t.identifier(exportName), exportValue),\n );\n }\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.objectExpression(objectProperties)]),\n ),\n );\n } else {\n const exportObj = path.scope.generateUid(\"exportObj\");\n\n statements.push(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.identifier(exportObj), t.objectExpression([])),\n ]),\n );\n\n statements.push(\n buildExportAll({\n KEY: path.scope.generateUidIdentifier(\"key\"),\n EXPORT_OBJ: t.identifier(exportObj),\n TARGET: exportStarTarget,\n }),\n );\n\n for (let i = 0; i < exportNames.length; i++) {\n const exportName = exportNames[i];\n const exportValue = exportValues[i];\n\n statements.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(\n t.identifier(exportObj),\n t.identifier(exportName),\n ),\n exportValue,\n ),\n ),\n );\n }\n\n statements.push(\n t.expressionStatement(\n t.callExpression(exportIdent, [t.identifier(exportObj)]),\n ),\n );\n }\n return statements;\n}\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { systemGlobal = \"System\", allowTopLevelThis = false } = options;\n const IGNORE_REASSIGNMENT_SYMBOL = Symbol();\n\n const reassignmentVisitor = {\n \"AssignmentExpression|UpdateExpression\"(path) {\n if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;\n path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;\n\n const arg = path.get(path.isAssignmentExpression() ? \"left\" : \"argument\");\n\n if (arg.isObjectPattern() || arg.isArrayPattern()) {\n const exprs = [path.node];\n for (const name of Object.keys(arg.getBindingIdentifiers())) {\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) {\n return;\n }\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n for (const exportedName of exportedNames) {\n exprs.push(\n this.buildCall(exportedName, t.identifier(name)).expression,\n );\n }\n }\n path.replaceWith(t.sequenceExpression(exprs));\n return;\n }\n\n if (!arg.isIdentifier()) return;\n\n const name = arg.node.name;\n\n // redeclared in this scope\n if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;\n\n const exportedNames = this.exports[name];\n if (!exportedNames) return;\n\n let node = path.node;\n\n // if it is a non-prefix update expression (x++ etc)\n // then we must replace with the expression (_export('x', x + 1), x++)\n // in order to ensure the same update expression value\n const isPostUpdateExpression = path.isUpdateExpression({ prefix: false });\n if (isPostUpdateExpression) {\n node = t.binaryExpression(\n node.operator[0],\n t.unaryExpression(\"+\", t.cloneNode(node.argument)),\n t.numericLiteral(1),\n );\n }\n\n for (const exportedName of exportedNames) {\n node = this.buildCall(exportedName, node).expression;\n }\n\n if (isPostUpdateExpression) {\n node = t.sequenceExpression([node, path.node]);\n }\n\n path.replaceWith(node);\n },\n };\n\n return {\n name: \"transform-modules-systemjs\",\n\n pre() {\n this.file.set(\"@babel/plugin-transform-modules-*\", \"systemjs\");\n },\n\n visitor: {\n CallExpression(path, state) {\n if (t.isImport(path.node.callee)) {\n if (!this.file.has(\"@babel/plugin-proposal-dynamic-import\")) {\n console.warn(MISSING_PLUGIN_WARNING);\n }\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"import\"),\n ),\n [getImportSource(t, path.node)],\n ),\n );\n }\n },\n\n MetaProperty(path, state) {\n if (\n path.node.meta.name === \"import\" &&\n path.node.property.name === \"meta\"\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"meta\"),\n ),\n );\n }\n },\n\n ReferencedIdentifier(path, state) {\n if (\n path.node.name === \"__moduleName\" &&\n !path.scope.hasBinding(\"__moduleName\")\n ) {\n path.replaceWith(\n t.memberExpression(\n t.identifier(state.contextIdent),\n t.identifier(\"id\"),\n ),\n );\n }\n },\n\n Program: {\n enter(path, state) {\n state.contextIdent = path.scope.generateUid(\"context\");\n if (!allowTopLevelThis) {\n rewriteThis(path);\n }\n },\n exit(path, state) {\n const undefinedIdent = path.scope.buildUndefinedNode();\n const exportIdent = path.scope.generateUid(\"export\");\n const contextIdent = state.contextIdent;\n\n const exportMap = Object.create(null);\n const modules = [];\n\n let beforeBody = [];\n const setters = [];\n const sources = [];\n const variableIds = [];\n const removedPaths = [];\n\n function addExportName(key, val) {\n exportMap[key] = exportMap[key] || [];\n exportMap[key].push(val);\n }\n\n function pushModule(source, key, specifiers) {\n let module;\n modules.forEach(function(m) {\n if (m.key === source) {\n module = m;\n }\n });\n if (!module) {\n modules.push(\n (module = { key: source, imports: [], exports: [] }),\n );\n }\n module[key] = module[key].concat(specifiers);\n }\n\n function buildExportCall(name, val) {\n return t.expressionStatement(\n t.callExpression(t.identifier(exportIdent), [\n t.stringLiteral(name),\n val,\n ]),\n );\n }\n\n const exportNames = [];\n const exportValues = [];\n\n const body: Array = path.get(\"body\");\n\n for (const path of body) {\n if (path.isFunctionDeclaration()) {\n beforeBody.push(path.node);\n removedPaths.push(path);\n } else if (path.isClassDeclaration()) {\n variableIds.push(path.node.id);\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(path.node.id),\n t.toExpression(path.node),\n ),\n ),\n );\n } else if (path.isImportDeclaration()) {\n const source = path.node.source.value;\n pushModule(source, \"imports\", path.node.specifiers);\n for (const name of Object.keys(path.getBindingIdentifiers())) {\n path.scope.removeBinding(name);\n variableIds.push(t.identifier(name));\n }\n path.remove();\n } else if (path.isExportAllDeclaration()) {\n pushModule(path.node.source.value, \"exports\", path.node);\n path.remove();\n } else if (path.isExportDefaultDeclaration()) {\n const declar = path.get(\"declaration\");\n const id = declar.node.id;\n if (declar.isClassDeclaration()) {\n if (id) {\n exportNames.push(\"default\");\n exportValues.push(undefinedIdent);\n variableIds.push(id);\n addExportName(id.name, \"default\");\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(id),\n t.toExpression(declar.node),\n ),\n ),\n );\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar.node));\n removedPaths.push(path);\n }\n } else if (declar.isFunctionDeclaration()) {\n if (id) {\n beforeBody.push(declar.node);\n exportNames.push(\"default\");\n exportValues.push(t.cloneNode(id));\n addExportName(id.name, \"default\");\n } else {\n exportNames.push(\"default\");\n exportValues.push(t.toExpression(declar.node));\n }\n removedPaths.push(path);\n } else {\n path.replaceWith(buildExportCall(\"default\", declar.node));\n }\n } else if (path.isExportNamedDeclaration()) {\n const declar = path.get(\"declaration\");\n\n if (declar.node) {\n path.replaceWith(declar);\n\n if (path.isFunction()) {\n const node = declar.node;\n const name = node.id.name;\n addExportName(name, name);\n beforeBody.push(node);\n exportNames.push(name);\n exportValues.push(t.cloneNode(node.id));\n removedPaths.push(path);\n } else if (path.isClass()) {\n const name = declar.node.id.name;\n exportNames.push(name);\n exportValues.push(undefinedIdent);\n variableIds.push(declar.node.id);\n path.replaceWith(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(declar.node.id),\n t.toExpression(declar.node),\n ),\n ),\n );\n addExportName(name, name);\n } else {\n for (const name of Object.keys(\n declar.getBindingIdentifiers(),\n )) {\n addExportName(name, name);\n }\n }\n } else {\n const specifiers = path.node.specifiers;\n if (specifiers && specifiers.length) {\n if (path.node.source) {\n pushModule(path.node.source.value, \"exports\", specifiers);\n path.remove();\n } else {\n const nodes = [];\n\n for (const specifier of specifiers) {\n const binding = path.scope.getBinding(\n specifier.local.name,\n );\n // hoisted function export\n if (\n binding &&\n t.isFunctionDeclaration(binding.path.node)\n ) {\n exportNames.push(specifier.exported.name);\n exportValues.push(t.cloneNode(specifier.local));\n }\n // only globals also exported this way\n else if (!binding) {\n nodes.push(\n buildExportCall(\n specifier.exported.name,\n specifier.local,\n ),\n );\n }\n addExportName(\n specifier.local.name,\n specifier.exported.name,\n );\n }\n\n path.replaceWithMultiple(nodes);\n }\n } else {\n path.remove();\n }\n }\n }\n }\n\n modules.forEach(function(specifiers) {\n let setterBody = [];\n const target = path.scope.generateUid(specifiers.key);\n\n for (let specifier of specifiers.imports) {\n if (t.isImportNamespaceSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.identifier(target),\n ),\n ),\n );\n } else if (t.isImportDefaultSpecifier(specifier)) {\n specifier = t.importSpecifier(\n specifier.local,\n t.identifier(\"default\"),\n );\n }\n\n if (t.isImportSpecifier(specifier)) {\n setterBody.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n specifier.local,\n t.memberExpression(\n t.identifier(target),\n specifier.imported,\n ),\n ),\n ),\n );\n }\n }\n\n if (specifiers.exports.length) {\n const exportNames = [];\n const exportValues = [];\n let hasExportStar = false;\n\n for (const node of specifiers.exports) {\n if (t.isExportAllDeclaration(node)) {\n hasExportStar = true;\n } else if (t.isExportSpecifier(node)) {\n exportNames.push(node.exported.name);\n exportValues.push(\n t.memberExpression(t.identifier(target), node.local),\n );\n } else {\n // todo\n }\n }\n\n setterBody = setterBody.concat(\n constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n hasExportStar ? t.identifier(target) : null,\n ),\n );\n }\n\n sources.push(t.stringLiteral(specifiers.key));\n setters.push(\n t.functionExpression(\n null,\n [t.identifier(target)],\n t.blockStatement(setterBody),\n ),\n );\n });\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n hoistVariables(\n path,\n (id, name, hasInit) => {\n variableIds.push(id);\n if (!hasInit) {\n exportNames.push(name);\n exportValues.push(undefinedIdent);\n }\n },\n null,\n );\n\n if (variableIds.length) {\n beforeBody.unshift(\n t.variableDeclaration(\n \"var\",\n variableIds.map(id => t.variableDeclarator(id)),\n ),\n );\n }\n\n if (exportNames.length) {\n beforeBody = beforeBody.concat(\n constructExportCall(\n path,\n t.identifier(exportIdent),\n exportNames,\n exportValues,\n null,\n ),\n );\n }\n\n path.traverse(reassignmentVisitor, {\n exports: exportMap,\n buildCall: buildExportCall,\n scope: path.scope,\n });\n\n for (const path of removedPaths) {\n path.remove();\n }\n\n path.node.body = [\n buildTemplate({\n SYSTEM_REGISTER: t.memberExpression(\n t.identifier(systemGlobal),\n t.identifier(\"register\"),\n ),\n BEFORE_BODY: beforeBody,\n MODULE_NAME: moduleName,\n SETTERS: t.arrayExpression(setters),\n SOURCES: t.arrayExpression(sources),\n BODY: path.node.body,\n EXPORT_IDENTIFIER: t.identifier(exportIdent),\n CONTEXT_IDENTIFIER: t.identifier(contextIdent),\n }),\n ];\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { basename, extname } from \"path\";\nimport {\n isModule,\n rewriteModuleStatementsAndPrepareHeader,\n hasExports,\n isSideEffectImport,\n buildNamespaceInitStatements,\n ensureStatementsHoisted,\n wrapInterop,\n} from \"@babel/helper-module-transforms\";\nimport { types as t, template } from \"@babel/core\";\n\nconst buildPrerequisiteAssignment = template(`\n GLOBAL_REFERENCE = GLOBAL_REFERENCE || {}\n`);\n// Note: we avoid comparing typeof results with \"object\" or \"symbol\" otherwise\n// they will be processed by `transform-typeof-symbol`, which in return could\n// cause typeof helper used before declaration\nconst buildWrapper = template(`\n (function (global, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(MODULE_NAME, AMD_ARGUMENTS, factory);\n } else if (typeof exports !== \"undefined\") {\n factory(COMMONJS_ARGUMENTS);\n } else {\n var mod = { exports: {} };\n factory(BROWSER_ARGUMENTS);\n\n GLOBAL_TO_ASSIGN;\n }\n })(\n typeof globalThis !== \"undefined\" ? globalThis\n : typeof self !== \"undefined\" ? self\n : this,\n function(IMPORT_NAMES) {\n })\n`);\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const {\n globals,\n exactGlobals,\n loose,\n allowTopLevelThis,\n strict,\n strictMode,\n noInterop,\n } = options;\n\n /**\n * Build the assignment statements that initialize the UMD global.\n */\n function buildBrowserInit(\n browserGlobals,\n exactGlobals,\n filename,\n moduleName,\n ) {\n const moduleNameOrBasename = moduleName\n ? moduleName.value\n : basename(filename, extname(filename));\n let globalToAssign = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(moduleNameOrBasename)),\n );\n let initAssignments = [];\n\n if (exactGlobals) {\n const globalName = browserGlobals[moduleNameOrBasename];\n\n if (globalName) {\n initAssignments = [];\n\n const members = globalName.split(\".\");\n globalToAssign = members.slice(1).reduce((accum, curr) => {\n initAssignments.push(\n buildPrerequisiteAssignment({\n GLOBAL_REFERENCE: t.cloneNode(accum),\n }),\n );\n return t.memberExpression(accum, t.identifier(curr));\n }, t.memberExpression(t.identifier(\"global\"), t.identifier(members[0])));\n }\n }\n\n initAssignments.push(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n globalToAssign,\n t.memberExpression(t.identifier(\"mod\"), t.identifier(\"exports\")),\n ),\n ),\n );\n\n return initAssignments;\n }\n\n /**\n * Build the member expression that reads from a global for a given source.\n */\n function buildBrowserArg(browserGlobals, exactGlobals, source) {\n let memberExpression;\n if (exactGlobals) {\n const globalRef = browserGlobals[source];\n if (globalRef) {\n memberExpression = globalRef\n .split(\".\")\n .reduce(\n (accum, curr) => t.memberExpression(accum, t.identifier(curr)),\n t.identifier(\"global\"),\n );\n } else {\n memberExpression = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(source)),\n );\n }\n } else {\n const requireName = basename(source, extname(source));\n const globalName = browserGlobals[requireName] || requireName;\n memberExpression = t.memberExpression(\n t.identifier(\"global\"),\n t.identifier(t.toIdentifier(globalName)),\n );\n }\n return memberExpression;\n }\n\n return {\n name: \"transform-modules-umd\",\n\n visitor: {\n Program: {\n exit(path) {\n if (!isModule(path)) return;\n\n const browserGlobals = globals || {};\n\n let moduleName = this.getModuleName();\n if (moduleName) moduleName = t.stringLiteral(moduleName);\n\n const { meta, headers } = rewriteModuleStatementsAndPrepareHeader(\n path,\n {\n loose,\n strict,\n strictMode,\n allowTopLevelThis,\n noInterop,\n },\n );\n\n const amdArgs = [];\n const commonjsArgs = [];\n const browserArgs = [];\n const importNames = [];\n\n if (hasExports(meta)) {\n amdArgs.push(t.stringLiteral(\"exports\"));\n commonjsArgs.push(t.identifier(\"exports\"));\n browserArgs.push(\n t.memberExpression(t.identifier(\"mod\"), t.identifier(\"exports\")),\n );\n importNames.push(t.identifier(meta.exportName));\n }\n\n for (const [source, metadata] of meta.source) {\n amdArgs.push(t.stringLiteral(source));\n commonjsArgs.push(\n t.callExpression(t.identifier(\"require\"), [\n t.stringLiteral(source),\n ]),\n );\n browserArgs.push(\n buildBrowserArg(browserGlobals, exactGlobals, source),\n );\n importNames.push(t.identifier(metadata.name));\n\n if (!isSideEffectImport(metadata)) {\n const interop = wrapInterop(\n path,\n t.identifier(metadata.name),\n metadata.interop,\n );\n if (interop) {\n const header = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.identifier(metadata.name),\n interop,\n ),\n );\n header.loc = meta.loc;\n headers.push(header);\n }\n }\n\n headers.push(\n ...buildNamespaceInitStatements(meta, metadata, loose),\n );\n }\n\n ensureStatementsHoisted(headers);\n path.unshiftContainer(\"body\", headers);\n\n const { body, directives } = path.node;\n path.node.directives = [];\n path.node.body = [];\n const umdWrapper = path.pushContainer(\"body\", [\n buildWrapper({\n MODULE_NAME: moduleName,\n\n AMD_ARGUMENTS: t.arrayExpression(amdArgs),\n COMMONJS_ARGUMENTS: commonjsArgs,\n BROWSER_ARGUMENTS: browserArgs,\n IMPORT_NAMES: importNames,\n\n GLOBAL_TO_ASSIGN: buildBrowserInit(\n browserGlobals,\n exactGlobals,\n this.filename || \"unknown\",\n moduleName,\n ),\n }),\n ])[0];\n const umdFactory = umdWrapper\n .get(\"expression.arguments\")[1]\n .get(\"body\");\n umdFactory.pushContainer(\"directives\", directives);\n umdFactory.pushContainer(\"body\", body);\n },\n },\n },\n };\n});\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\n\nexport default function(core, options) {\n const { runtime = true } = options;\n if (typeof runtime !== \"boolean\") {\n throw new Error(\"The 'runtime' option must be boolean\");\n }\n\n return createRegExpFeaturePlugin({\n name: \"transform-named-capturing-groups-regex\",\n feature: \"namedCaptureGroups\",\n options: { runtime },\n });\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-new-target\",\n\n visitor: {\n MetaProperty(path) {\n const meta = path.get(\"meta\");\n const property = path.get(\"property\");\n const { scope } = path;\n\n if (\n meta.isIdentifier({ name: \"new\" }) &&\n property.isIdentifier({ name: \"target\" })\n ) {\n const func = path.findParent(path => {\n if (path.isClass()) return true;\n if (path.isFunction() && !path.isArrowFunctionExpression()) {\n if (path.isClassMethod({ kind: \"constructor\" })) {\n return false;\n }\n\n return true;\n }\n return false;\n });\n\n if (!func) {\n throw path.buildCodeFrameError(\n \"new.target must be under a (non-arrow) function or a class.\",\n );\n }\n\n const { node } = func;\n if (!node.id) {\n if (func.isMethod()) {\n path.replaceWith(scope.buildUndefinedNode());\n return;\n }\n\n node.id = scope.generateUidIdentifier(\"target\");\n }\n\n const constructor = t.memberExpression(\n t.thisExpression(),\n t.identifier(\"constructor\"),\n );\n\n if (func.isClass()) {\n path.replaceWith(constructor);\n return;\n }\n\n path.replaceWith(\n t.conditionalExpression(\n t.binaryExpression(\n \"instanceof\",\n t.thisExpression(),\n t.cloneNode(node.id),\n ),\n constructor,\n scope.buildUndefinedNode(),\n ),\n );\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-assign\",\n\n visitor: {\n CallExpression: function(path, file) {\n if (path.get(\"callee\").matchesPattern(\"Object.assign\")) {\n path.node.callee = file.addHelper(\"extends\");\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport { types as t } from \"@babel/core\";\n\nfunction replacePropertySuper(path, getObjectRef, file) {\n const replaceSupers = new ReplaceSupers({\n getObjectRef: getObjectRef,\n methodPath: path,\n file: file,\n });\n\n replaceSupers.replace();\n}\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-super\",\n\n visitor: {\n ObjectExpression(path, state) {\n let objectRef;\n const getObjectRef = () =>\n (objectRef = objectRef || path.scope.generateUidIdentifier(\"obj\"));\n\n path.get(\"properties\").forEach(propPath => {\n if (!propPath.isMethod()) return;\n\n replacePropertySuper(propPath, getObjectRef, state);\n });\n\n if (objectRef) {\n path.scope.push({ id: t.cloneNode(objectRef) });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(objectRef), path.node),\n );\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-object-set-prototype-of-to-assign\",\n\n visitor: {\n CallExpression(path, file) {\n if (path.get(\"callee\").matchesPattern(\"Object.setPrototypeOf\")) {\n path.node.callee = file.addHelper(\"defaults\");\n }\n },\n },\n };\n});\n","import hoistVariables from \"@babel/helper-hoist-variables\";\nimport type { NodePath } from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\n\nconst visitor = {\n enter(path, state) {\n if (path.isThisExpression()) {\n state.foundThis = true;\n }\n\n if (path.isReferencedIdentifier({ name: \"arguments\" })) {\n state.foundArguments = true;\n }\n },\n\n Function(path) {\n path.skip();\n },\n};\n\nexport default function(path: NodePath, scope = path.scope) {\n const { node } = path;\n const container = t.functionExpression(\n null,\n [],\n node.body,\n node.generator,\n node.async,\n );\n\n let callee = container;\n let args = [];\n\n // todo: only hoist if necessary\n hoistVariables(path, id => scope.push({ id }));\n\n const state = {\n foundThis: false,\n foundArguments: false,\n };\n\n path.traverse(visitor, state);\n\n if (state.foundArguments || state.foundThis) {\n callee = t.memberExpression(container, t.identifier(\"apply\"));\n args = [];\n\n if (state.foundThis) {\n args.push(t.thisExpression());\n }\n\n if (state.foundArguments) {\n if (!state.foundThis) args.push(t.nullLiteral());\n args.push(t.identifier(\"arguments\"));\n }\n }\n\n let call = t.callExpression(callee, args);\n if (node.generator) call = t.yieldExpression(call, true);\n\n return t.returnStatement(call);\n}\n","import callDelegate from \"@babel/helper-call-delegate\";\nimport { template, types as t } from \"@babel/core\";\n\nconst buildDefaultParam = template(`\n let VARIABLE_NAME =\n arguments.length > ARGUMENT_KEY && arguments[ARGUMENT_KEY] !== undefined ?\n arguments[ARGUMENT_KEY]\n :\n DEFAULT_VALUE;\n`);\n\nconst buildLooseDefaultParam = template(`\n if (ASSIGNMENT_IDENTIFIER === UNDEFINED) {\n ASSIGNMENT_IDENTIFIER = DEFAULT_VALUE;\n }\n`);\n\nconst buildLooseDestructuredDefaultParam = template(`\n let ASSIGNMENT_IDENTIFIER = PARAMETER_NAME === UNDEFINED ? DEFAULT_VALUE : PARAMETER_NAME ;\n`);\n\nconst buildSafeArgumentsAccess = template(`\n let $0 = arguments.length > $1 ? arguments[$1] : undefined;\n`);\n\nfunction isSafeBinding(scope, node) {\n if (!scope.hasOwnBinding(node.name)) return true;\n const { kind } = scope.getOwnBinding(node.name);\n return kind === \"param\" || kind === \"local\";\n}\n\nconst iifeVisitor = {\n ReferencedIdentifier(path, state) {\n const { scope, node } = path;\n if (\n node.name === \"eval\" ||\n !isSafeBinding(scope, node) ||\n !isSafeBinding(state.scope, node)\n ) {\n state.iife = true;\n path.stop();\n }\n },\n\n Scope(path) {\n // different bindings\n path.skip();\n },\n};\n\nexport default function convertFunctionParams(path, loose) {\n const { node, scope } = path;\n\n const state = {\n iife: false,\n scope: scope,\n };\n\n const body = [];\n const params = path.get(\"params\");\n\n let firstOptionalIndex = null;\n\n for (let i = 0; i < params.length; i++) {\n const param = params[i];\n\n const paramIsAssignmentPattern = param.isAssignmentPattern();\n if (paramIsAssignmentPattern && (loose || node.kind === \"set\")) {\n const left = param.get(\"left\");\n const right = param.get(\"right\");\n\n const undefinedNode = scope.buildUndefinedNode();\n\n if (left.isIdentifier()) {\n body.push(\n buildLooseDefaultParam({\n ASSIGNMENT_IDENTIFIER: t.cloneNode(left.node),\n DEFAULT_VALUE: right.node,\n UNDEFINED: undefinedNode,\n }),\n );\n param.replaceWith(left.node);\n } else if (left.isObjectPattern() || left.isArrayPattern()) {\n const paramName = scope.generateUidIdentifier();\n body.push(\n buildLooseDestructuredDefaultParam({\n ASSIGNMENT_IDENTIFIER: left.node,\n DEFAULT_VALUE: right.node,\n PARAMETER_NAME: t.cloneNode(paramName),\n UNDEFINED: undefinedNode,\n }),\n );\n param.replaceWith(paramName);\n }\n } else if (paramIsAssignmentPattern) {\n if (firstOptionalIndex === null) firstOptionalIndex = i;\n\n const left = param.get(\"left\");\n const right = param.get(\"right\");\n\n if (!state.iife) {\n if (right.isIdentifier() && !isSafeBinding(scope, right.node)) {\n // the right hand side references a parameter\n state.iife = true;\n } else {\n right.traverse(iifeVisitor, state);\n }\n }\n\n const defNode = buildDefaultParam({\n VARIABLE_NAME: left.node,\n DEFAULT_VALUE: right.node,\n ARGUMENT_KEY: t.numericLiteral(i),\n });\n body.push(defNode);\n } else if (firstOptionalIndex !== null) {\n const defNode = buildSafeArgumentsAccess([\n param.node,\n t.numericLiteral(i),\n ]);\n body.push(defNode);\n } else if (param.isObjectPattern() || param.isArrayPattern()) {\n const uid = path.scope.generateUidIdentifier(\"ref\");\n\n const defNode = t.variableDeclaration(\"let\", [\n t.variableDeclarator(param.node, uid),\n ]);\n body.push(defNode);\n\n param.replaceWith(t.cloneNode(uid));\n }\n\n if (!state.iife && !param.isIdentifier()) {\n param.traverse(iifeVisitor, state);\n }\n }\n\n if (body.length === 0) return false;\n\n // we need to cut off all trailing parameters\n if (firstOptionalIndex !== null) {\n node.params = node.params.slice(0, firstOptionalIndex);\n }\n\n // ensure it's a block, useful for arrow functions\n path.ensureBlock();\n\n if (state.iife) {\n body.push(callDelegate(path, scope));\n path.set(\"body\", t.blockStatement(body));\n } else {\n path.get(\"body\").unshiftContainer(\"body\", body);\n }\n\n return true;\n}\n","import { template, types as t } from \"@babel/core\";\n\nconst buildRest = template(`\n for (var LEN = ARGUMENTS.length,\n ARRAY = new Array(ARRAY_LEN),\n KEY = START;\n KEY < LEN;\n KEY++) {\n ARRAY[ARRAY_KEY] = ARGUMENTS[KEY];\n }\n`);\n\nconst restIndex = template(`\n (INDEX < OFFSET || ARGUMENTS.length <= INDEX) ? undefined : ARGUMENTS[INDEX]\n`);\n\nconst restIndexImpure = template(`\n REF = INDEX, (REF < OFFSET || ARGUMENTS.length <= REF) ? undefined : ARGUMENTS[REF]\n`);\n\nconst restLength = template(`\n ARGUMENTS.length <= OFFSET ? 0 : ARGUMENTS.length - OFFSET\n`);\n\nfunction referencesRest(path, state) {\n if (path.node.name === state.name) {\n // Check rest parameter is not shadowed by a binding in another scope.\n return path.scope.bindingIdentifierEquals(state.name, state.outerBinding);\n }\n\n return false;\n}\n\nconst memberExpressionOptimisationVisitor = {\n Scope(path, state) {\n // check if this scope has a local binding that will shadow the rest parameter\n if (!path.scope.bindingIdentifierEquals(state.name, state.outerBinding)) {\n path.skip();\n }\n },\n\n Flow(path) {\n // Do not skip TypeCastExpressions as the contain valid non flow code\n if (path.isTypeCastExpression()) return;\n // don't touch reference in type annotations\n path.skip();\n },\n\n Function(path, state) {\n // Detect whether any reference to rest is contained in nested functions to\n // determine if deopt is necessary.\n const oldNoOptimise = state.noOptimise;\n state.noOptimise = true;\n path.traverse(memberExpressionOptimisationVisitor, state);\n state.noOptimise = oldNoOptimise;\n\n // Skip because optimizing references to rest would refer to the `arguments`\n // of the nested function.\n path.skip();\n },\n\n ReferencedIdentifier(path, state) {\n const { node } = path;\n\n // we can't guarantee the purity of arguments\n if (node.name === \"arguments\") {\n state.deopted = true;\n }\n\n // is this a referenced identifier and is it referencing the rest parameter?\n if (!referencesRest(path, state)) return;\n\n if (state.noOptimise) {\n state.deopted = true;\n } else {\n const { parentPath } = path;\n\n // Is this identifier the right hand side of a default parameter?\n if (parentPath.listKey === \"params\" && parentPath.key < state.offset) {\n return;\n }\n\n // ex: `args[0]`\n // ex: `args.whatever`\n if (parentPath.isMemberExpression({ object: node })) {\n const grandparentPath = parentPath.parentPath;\n\n const argsOptEligible =\n !state.deopted &&\n !(\n // ex: `args[0] = \"whatever\"`\n (\n (grandparentPath.isAssignmentExpression() &&\n parentPath.node === grandparentPath.node.left) ||\n // ex: `[args[0]] = [\"whatever\"]`\n grandparentPath.isLVal() ||\n // ex: `for (rest[0] in this)`\n // ex: `for (rest[0] of this)`\n grandparentPath.isForXStatement() ||\n // ex: `++args[0]`\n // ex: `args[0]--`\n grandparentPath.isUpdateExpression() ||\n // ex: `delete args[0]`\n grandparentPath.isUnaryExpression({ operator: \"delete\" }) ||\n // ex: `args[0]()`\n // ex: `new args[0]()`\n // ex: `new args[0]`\n ((grandparentPath.isCallExpression() ||\n grandparentPath.isNewExpression()) &&\n parentPath.node === grandparentPath.node.callee)\n )\n );\n\n if (argsOptEligible) {\n if (parentPath.node.computed) {\n // if we know that this member expression is referencing a number then\n // we can safely optimise it\n if (parentPath.get(\"property\").isBaseType(\"number\")) {\n state.candidates.push({ cause: \"indexGetter\", path });\n return;\n }\n } else if (parentPath.node.property.name === \"length\") {\n // args.length\n state.candidates.push({ cause: \"lengthGetter\", path });\n return;\n }\n }\n }\n\n // we can only do these optimizations if the rest variable would match\n // the arguments exactly\n // optimise single spread args in calls\n // ex: fn(...args)\n if (state.offset === 0 && parentPath.isSpreadElement()) {\n const call = parentPath.parentPath;\n if (call.isCallExpression() && call.node.arguments.length === 1) {\n state.candidates.push({ cause: \"argSpread\", path });\n return;\n }\n }\n\n state.references.push(path);\n }\n },\n\n /**\n * Deopt on use of a binding identifier with the same name as our rest param.\n *\n * See https://github.com/babel/babel/issues/2091\n */\n\n BindingIdentifier(path, state) {\n if (referencesRest(path, state)) {\n state.deopted = true;\n }\n },\n};\nfunction hasRest(node) {\n const length = node.params.length;\n return length > 0 && t.isRestElement(node.params[length - 1]);\n}\n\nfunction optimiseIndexGetter(path, argsId, offset) {\n const offsetLiteral = t.numericLiteral(offset);\n let index;\n\n if (t.isNumericLiteral(path.parent.property)) {\n index = t.numericLiteral(path.parent.property.value + offset);\n } else if (offset === 0) {\n // Avoid unnecessary '+ 0'\n index = path.parent.property;\n } else {\n index = t.binaryExpression(\n \"+\",\n path.parent.property,\n t.cloneNode(offsetLiteral),\n );\n }\n\n const { scope } = path;\n if (!scope.isPure(index)) {\n const temp = scope.generateUidIdentifierBasedOnNode(index);\n scope.push({ id: temp, kind: \"var\" });\n path.parentPath.replaceWith(\n restIndexImpure({\n ARGUMENTS: argsId,\n OFFSET: offsetLiteral,\n INDEX: index,\n REF: t.cloneNode(temp),\n }),\n );\n } else {\n const parentPath = path.parentPath;\n parentPath.replaceWith(\n restIndex({\n ARGUMENTS: argsId,\n OFFSET: offsetLiteral,\n INDEX: index,\n }),\n );\n\n // See if we can statically evaluate the first test (i.e. index < offset)\n // and optimize the AST accordingly.\n const offsetTestPath = parentPath.get(\"test\").get(\"left\");\n const valRes = offsetTestPath.evaluate();\n if (valRes.confident) {\n if (valRes.value === true) {\n parentPath.replaceWith(parentPath.scope.buildUndefinedNode());\n } else {\n parentPath.get(\"test\").replaceWith(parentPath.get(\"test\").get(\"right\"));\n }\n }\n }\n}\n\nfunction optimiseLengthGetter(path, argsId, offset) {\n if (offset) {\n path.parentPath.replaceWith(\n restLength({\n ARGUMENTS: argsId,\n OFFSET: t.numericLiteral(offset),\n }),\n );\n } else {\n path.replaceWith(argsId);\n }\n}\n\nexport default function convertFunctionRest(path) {\n const { node, scope } = path;\n if (!hasRest(node)) return false;\n\n let rest = node.params.pop().argument;\n\n const argsId = t.identifier(\"arguments\");\n\n if (t.isPattern(rest)) {\n const pattern = rest;\n rest = scope.generateUidIdentifier(\"ref\");\n\n const declar = t.variableDeclaration(\"let\", [\n t.variableDeclarator(pattern, rest),\n ]);\n node.body.body.unshift(declar);\n }\n\n // check and optimise for extremely common cases\n const state = {\n references: [],\n offset: node.params.length,\n\n argumentsNode: argsId,\n outerBinding: scope.getBindingIdentifier(rest.name),\n\n // candidate member expressions we could optimise if there are no other references\n candidates: [],\n\n // local rest binding name\n name: rest.name,\n\n /*\n It may be possible to optimize the output code in certain ways, such as\n not generating code to initialize an array (perhaps substituting direct\n references to arguments[i] or arguments.length for reads of the\n corresponding rest parameter property) or positioning the initialization\n code so that it may not have to execute depending on runtime conditions.\n\n This property tracks eligibility for optimization. \"deopted\" means give up\n and don't perform optimization. For example, when any of rest's elements /\n properties is assigned to at the top level, or referenced at all in a\n nested function.\n */\n deopted: false,\n };\n\n path.traverse(memberExpressionOptimisationVisitor, state);\n\n // There are only \"shorthand\" references\n if (!state.deopted && !state.references.length) {\n for (const { path, cause } of (state.candidates: Array)) {\n const clonedArgsId = t.cloneNode(argsId);\n switch (cause) {\n case \"indexGetter\":\n optimiseIndexGetter(path, clonedArgsId, state.offset);\n break;\n case \"lengthGetter\":\n optimiseLengthGetter(path, clonedArgsId, state.offset);\n break;\n default:\n path.replaceWith(clonedArgsId);\n }\n }\n return true;\n }\n\n state.references = state.references.concat(\n state.candidates.map(({ path }) => path),\n );\n\n const start = t.numericLiteral(node.params.length);\n const key = scope.generateUidIdentifier(\"key\");\n const len = scope.generateUidIdentifier(\"len\");\n\n let arrKey, arrLen;\n if (node.params.length) {\n // this method has additional params, so we need to subtract\n // the index of the current argument position from the\n // position in the array that we want to populate\n arrKey = t.binaryExpression(\"-\", t.cloneNode(key), t.cloneNode(start));\n\n // we need to work out the size of the array that we're\n // going to store all the rest parameters\n //\n // we need to add a check to avoid constructing the array\n // with <0 if there are less arguments than params as it'll\n // cause an error\n arrLen = t.conditionalExpression(\n t.binaryExpression(\">\", t.cloneNode(len), t.cloneNode(start)),\n t.binaryExpression(\"-\", t.cloneNode(len), t.cloneNode(start)),\n t.numericLiteral(0),\n );\n } else {\n arrKey = t.identifier(key.name);\n arrLen = t.identifier(len.name);\n }\n\n const loop = buildRest({\n ARGUMENTS: argsId,\n ARRAY_KEY: arrKey,\n ARRAY_LEN: arrLen,\n START: start,\n ARRAY: rest,\n KEY: key,\n LEN: len,\n });\n\n if (state.deopted) {\n node.body.body.unshift(loop);\n } else {\n let target = path\n .getEarliestCommonAncestorFrom(state.references)\n .getStatementParent();\n\n // don't perform the allocation inside a loop\n target.findParent(path => {\n if (path.isLoop()) {\n target = path;\n } else {\n // Stop crawling up if this is a function.\n return path.isFunction();\n }\n });\n\n target.insertBefore(loop);\n }\n\n return true;\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport convertFunctionParams from \"./params\";\nimport convertFunctionRest from \"./rest\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n return {\n name: \"transform-parameters\",\n\n visitor: {\n Function(path) {\n if (\n path.isArrowFunctionExpression() &&\n path\n .get(\"params\")\n .some(param => param.isRestElement() || param.isAssignmentPattern())\n ) {\n // default/rest visitors require access to `arguments`, so it cannot be an arrow\n path.arrowFunctionToExpression();\n }\n\n const convertedRest = convertFunctionRest(path);\n const convertedParams = convertFunctionParams(path, loose);\n\n if (convertedRest || convertedParams) {\n // Manually reprocess this scope to ensure that the moved params are updated.\n path.scope.crawl();\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-property-literals\",\n\n visitor: {\n ObjectProperty: {\n exit({ node }) {\n const key = node.key;\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n !t.isValidES3Identifier(key.name)\n ) {\n // default: \"bar\" -> \"default\": \"bar\"\n node.key = t.stringLiteral(key.name);\n }\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport * as defineMap from \"@babel/helper-define-map\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-property-mutators\",\n\n visitor: {\n ObjectExpression(path, file) {\n const { node } = path;\n let hasAny = false;\n for (const prop of (node.properties: Array)) {\n if (prop.kind === \"get\" || prop.kind === \"set\") {\n hasAny = true;\n break;\n }\n }\n if (!hasAny) return;\n\n const mutatorMap = {};\n\n node.properties = node.properties.filter(function(prop) {\n if (!prop.computed && (prop.kind === \"get\" || prop.kind === \"set\")) {\n defineMap.push(mutatorMap, prop, null, file);\n return false;\n } else {\n return true;\n }\n });\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(\n t.identifier(\"Object\"),\n t.identifier(\"defineProperties\"),\n ),\n [node, defineMap.toDefineObject(mutatorMap)],\n ),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport pull from \"lodash/pull\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function isProtoKey(node) {\n return t.isLiteral(t.toComputedKey(node, node.key), { value: \"__proto__\" });\n }\n\n function isProtoAssignmentExpression(node) {\n const left = node.left;\n return (\n t.isMemberExpression(left) &&\n t.isLiteral(t.toComputedKey(left, left.property), { value: \"__proto__\" })\n );\n }\n\n function buildDefaultsCallExpression(expr, ref, file) {\n return t.expressionStatement(\n t.callExpression(file.addHelper(\"defaults\"), [ref, expr.right]),\n );\n }\n\n return {\n name: \"transform-proto-to-assign\",\n\n visitor: {\n AssignmentExpression(path, file) {\n if (!isProtoAssignmentExpression(path.node)) return;\n\n const nodes = [];\n const left = path.node.left.object;\n const temp = path.scope.maybeGenerateMemoised(left);\n\n if (temp) {\n nodes.push(\n t.expressionStatement(t.assignmentExpression(\"=\", temp, left)),\n );\n }\n nodes.push(\n buildDefaultsCallExpression(\n path.node,\n t.cloneNode(temp || left),\n file,\n ),\n );\n if (temp) nodes.push(t.cloneNode(temp));\n\n path.replaceWithMultiple(nodes);\n },\n\n ExpressionStatement(path, file) {\n const expr = path.node.expression;\n if (!t.isAssignmentExpression(expr, { operator: \"=\" })) return;\n\n if (isProtoAssignmentExpression(expr)) {\n path.replaceWith(\n buildDefaultsCallExpression(expr, expr.left.object, file),\n );\n }\n },\n\n ObjectExpression(path, file) {\n let proto;\n const { node } = path;\n\n for (const prop of (node.properties: Array)) {\n if (isProtoKey(prop)) {\n proto = prop.value;\n pull(node.properties, prop);\n }\n }\n\n if (proto) {\n const args = [t.objectExpression([]), proto];\n if (node.properties.length) args.push(node);\n path.replaceWith(t.callExpression(file.addHelper(\"extends\"), args));\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { allowMutablePropsOnTags } = options;\n\n if (\n allowMutablePropsOnTags != null &&\n !Array.isArray(allowMutablePropsOnTags)\n ) {\n throw new Error(\n \".allowMutablePropsOnTags must be an array, null, or undefined.\",\n );\n }\n\n const HOISTED = new WeakSet();\n\n const immutabilityVisitor = {\n enter(path, state) {\n const stop = () => {\n state.isImmutable = false;\n path.stop();\n };\n\n if (path.isJSXClosingElement()) {\n path.skip();\n return;\n }\n\n // Elements with refs are not safe to hoist.\n if (\n path.isJSXIdentifier({ name: \"ref\" }) &&\n path.parentPath.isJSXAttribute({ name: path.node })\n ) {\n return stop();\n }\n\n // Ignore identifiers & JSX expressions.\n if (\n path.isJSXIdentifier() ||\n path.isIdentifier() ||\n path.isJSXMemberExpression()\n ) {\n return;\n }\n\n if (!path.isImmutable()) {\n // If it's not immutable, it may still be a pure expression, such as string concatenation.\n // It is still safe to hoist that, so long as its result is immutable.\n // If not, it is not safe to replace as mutable values (like objects) could be mutated after render.\n // https://github.com/facebook/react/issues/3226\n if (path.isPure()) {\n const expressionResult = path.evaluate();\n if (expressionResult.confident) {\n // We know the result; check its mutability.\n const { value } = expressionResult;\n const isMutable =\n (!state.mutablePropsAllowed &&\n value &&\n typeof value === \"object\") ||\n typeof value === \"function\";\n if (!isMutable) {\n // It evaluated to an immutable value, so we can hoist it.\n path.skip();\n return;\n }\n } else if (t.isIdentifier(expressionResult.deopt)) {\n // It's safe to hoist here if the deopt reason is an identifier (e.g. func param).\n // The hoister will take care of how high up it can be hoisted.\n return;\n }\n }\n stop();\n }\n },\n };\n\n return {\n name: \"transform-react-constant-elements\",\n\n visitor: {\n JSXElement(path) {\n if (HOISTED.has(path.node)) return;\n HOISTED.add(path.node);\n\n const state = { isImmutable: true };\n\n // This transform takes the option `allowMutablePropsOnTags`, which is an array\n // of JSX tags to allow mutable props (such as objects, functions) on. Use sparingly\n // and only on tags you know will never modify their own props.\n if (allowMutablePropsOnTags != null) {\n // Get the element's name. If it's a member expression, we use the last part of the path.\n // So the option [\"FormattedMessage\"] would match \"Intl.FormattedMessage\".\n let namePath = path.get(\"openingElement.name\");\n while (namePath.isJSXMemberExpression()) {\n namePath = namePath.get(\"property\");\n }\n\n const elementName = namePath.node.name;\n state.mutablePropsAllowed =\n allowMutablePropsOnTags.indexOf(elementName) > -1;\n }\n\n // Traverse all props passed to this element for immutability.\n path.traverse(immutabilityVisitor, state);\n\n if (state.isImmutable) {\n const hoisted = path.hoist();\n\n if (hoisted) {\n annotateAsPure(hoisted);\n }\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport path from \"path\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function addDisplayName(id, call) {\n const props = call.arguments[0].properties;\n let safe = true;\n\n for (let i = 0; i < props.length; i++) {\n const prop = props[i];\n const key = t.toComputedKey(prop);\n if (t.isLiteral(key, { value: \"displayName\" })) {\n safe = false;\n break;\n }\n }\n\n if (safe) {\n props.unshift(\n t.objectProperty(t.identifier(\"displayName\"), t.stringLiteral(id)),\n );\n }\n }\n\n const isCreateClassCallExpression = t.buildMatchMemberExpression(\n \"React.createClass\",\n );\n const isCreateClassAddon = callee => callee.name === \"createReactClass\";\n\n function isCreateClass(node) {\n if (!node || !t.isCallExpression(node)) return false;\n\n // not createReactClass nor React.createClass call member object\n if (\n !isCreateClassCallExpression(node.callee) &&\n !isCreateClassAddon(node.callee)\n ) {\n return false;\n }\n\n // no call arguments\n const args = node.arguments;\n if (args.length !== 1) return false;\n\n // first node arg is not an object\n const first = args[0];\n if (!t.isObjectExpression(first)) return false;\n\n return true;\n }\n\n return {\n name: \"transform-react-display-name\",\n\n visitor: {\n ExportDefaultDeclaration({ node }, state) {\n if (isCreateClass(node.declaration)) {\n const filename = state.filename || \"unknown\";\n\n let displayName = path.basename(filename, path.extname(filename));\n\n // ./{module name}/index.js\n if (displayName === \"index\") {\n displayName = path.basename(path.dirname(filename));\n }\n\n addDisplayName(displayName, node.declaration);\n }\n },\n\n CallExpression(path) {\n const { node } = path;\n if (!isCreateClass(node)) return;\n\n let id;\n\n // crawl up the ancestry looking for possible candidates for displayName inference\n path.find(function(path) {\n if (path.isAssignmentExpression()) {\n id = path.node.left;\n } else if (path.isObjectProperty()) {\n id = path.node.key;\n } else if (path.isVariableDeclarator()) {\n id = path.node.id;\n } else if (path.isStatement()) {\n // we've hit a statement, we should stop crawling up\n return true;\n }\n\n // we've got an id! no need to continue\n if (id) return true;\n });\n\n // ensure that we have an identifier we can inherit from\n if (!id) return;\n\n // foo.bar -> bar\n if (t.isMemberExpression(id)) {\n id = id.property;\n }\n\n // identifiers are the only thing we can reliably get a name from\n if (t.isIdentifier(id)) {\n addDisplayName(id.name, node);\n }\n },\n },\n };\n});\n","import esutils from \"esutils\";\nimport * as t from \"@babel/types\";\n\ntype ElementState = {\n tagExpr: Object, // tag node\n tagName: ?string, // raw string tag name\n args: Array, // array of call arguments\n call?: Object, // optional call property that can be set to override the call expression returned\n};\n\nexport default function(opts) {\n const visitor = {};\n\n visitor.JSXNamespacedName = function(path) {\n if (opts.throwIfNamespace) {\n throw path.buildCodeFrameError(\n `Namespace tags are not supported by default. React's JSX doesn't support namespace tags. \\\nYou can turn on the 'throwIfNamespace' flag to bypass this warning.`,\n );\n }\n };\n\n visitor.JSXSpreadChild = function(path) {\n throw path.buildCodeFrameError(\n \"Spread children are not supported in React.\",\n );\n };\n\n visitor.JSXElement = {\n exit(path, file) {\n const callExpr = buildElementCall(path, file);\n if (callExpr) {\n path.replaceWith(t.inherits(callExpr, path.node));\n }\n },\n };\n\n visitor.JSXFragment = {\n exit(path, file) {\n if (opts.compat) {\n throw path.buildCodeFrameError(\n \"Fragment tags are only supported in React 16 and up.\",\n );\n }\n const callExpr = buildFragmentCall(path, file);\n if (callExpr) {\n path.replaceWith(t.inherits(callExpr, path.node));\n }\n },\n };\n\n return visitor;\n\n function convertJSXIdentifier(node, parent) {\n if (t.isJSXIdentifier(node)) {\n if (node.name === \"this\" && t.isReferenced(node, parent)) {\n return t.thisExpression();\n } else if (esutils.keyword.isIdentifierNameES6(node.name)) {\n node.type = \"Identifier\";\n } else {\n return t.stringLiteral(node.name);\n }\n } else if (t.isJSXMemberExpression(node)) {\n return t.memberExpression(\n convertJSXIdentifier(node.object, node),\n convertJSXIdentifier(node.property, node),\n );\n } else if (t.isJSXNamespacedName(node)) {\n /**\n * If there is flag \"throwIfNamespace\"\n * print XMLNamespace like string literal\n */\n return t.stringLiteral(`${node.namespace.name}:${node.name.name}`);\n }\n\n return node;\n }\n\n function convertAttributeValue(node) {\n if (t.isJSXExpressionContainer(node)) {\n return node.expression;\n } else {\n return node;\n }\n }\n\n function convertAttribute(node) {\n const value = convertAttributeValue(node.value || t.booleanLiteral(true));\n\n if (t.isJSXSpreadAttribute(node)) {\n return t.spreadElement(node.argument);\n }\n\n if (t.isStringLiteral(value) && !t.isJSXExpressionContainer(node.value)) {\n value.value = value.value.replace(/\\n\\s+/g, \" \");\n\n // \"raw\" JSXText should not be used from a StringLiteral because it needs to be escaped.\n delete value.extra?.raw;\n }\n\n if (t.isJSXNamespacedName(node.name)) {\n node.name = t.stringLiteral(\n node.name.namespace.name + \":\" + node.name.name.name,\n );\n } else if (esutils.keyword.isIdentifierNameES6(node.name.name)) {\n node.name.type = \"Identifier\";\n } else {\n node.name = t.stringLiteral(node.name.name);\n }\n\n return t.inherits(t.objectProperty(node.name, value), node);\n }\n\n function buildElementCall(path, file) {\n if (opts.filter && !opts.filter(path.node, file)) return;\n\n const openingPath = path.get(\"openingElement\");\n openingPath.parent.children = t.react.buildChildren(openingPath.parent);\n\n const tagExpr = convertJSXIdentifier(\n openingPath.node.name,\n openingPath.node,\n );\n const args = [];\n\n let tagName;\n if (t.isIdentifier(tagExpr)) {\n tagName = tagExpr.name;\n } else if (t.isLiteral(tagExpr)) {\n tagName = tagExpr.value;\n }\n\n const state: ElementState = {\n tagExpr: tagExpr,\n tagName: tagName,\n args: args,\n };\n\n if (opts.pre) {\n opts.pre(state, file);\n }\n\n let attribs = openingPath.node.attributes;\n if (attribs.length) {\n attribs = buildOpeningElementAttributes(attribs, file);\n } else {\n attribs = t.nullLiteral();\n }\n\n args.push(attribs, ...path.node.children);\n\n if (opts.post) {\n opts.post(state, file);\n }\n\n return state.call || t.callExpression(state.callee, args);\n }\n\n function pushProps(_props, objs) {\n if (!_props.length) return _props;\n\n objs.push(t.objectExpression(_props));\n return [];\n }\n\n /**\n * The logic for this is quite terse. It's because we need to\n * support spread elements. We loop over all attributes,\n * breaking on spreads, we then push a new object containing\n * all prior attributes to an array for later processing.\n */\n\n function buildOpeningElementAttributes(attribs, file) {\n let _props = [];\n const objs = [];\n\n const { useSpread = false } = file.opts;\n if (typeof useSpread !== \"boolean\") {\n throw new Error(\n \"transform-react-jsx currently only accepts a boolean option for \" +\n \"useSpread (defaults to false)\",\n );\n }\n\n const useBuiltIns = file.opts.useBuiltIns || false;\n if (typeof useBuiltIns !== \"boolean\") {\n throw new Error(\n \"transform-react-jsx currently only accepts a boolean option for \" +\n \"useBuiltIns (defaults to false)\",\n );\n }\n\n if (useSpread && useBuiltIns) {\n throw new Error(\n \"transform-react-jsx currently only accepts useBuiltIns or useSpread \" +\n \"but not both\",\n );\n }\n\n if (useSpread) {\n const props = attribs.map(convertAttribute);\n return t.objectExpression(props);\n }\n\n while (attribs.length) {\n const prop = attribs.shift();\n if (t.isJSXSpreadAttribute(prop)) {\n _props = pushProps(_props, objs);\n objs.push(prop.argument);\n } else {\n _props.push(convertAttribute(prop));\n }\n }\n\n pushProps(_props, objs);\n\n if (objs.length === 1) {\n // only one object\n attribs = objs[0];\n } else {\n // looks like we have multiple objects\n if (!t.isObjectExpression(objs[0])) {\n objs.unshift(t.objectExpression([]));\n }\n\n const helper = useBuiltIns\n ? t.memberExpression(t.identifier(\"Object\"), t.identifier(\"assign\"))\n : file.addHelper(\"extends\");\n\n // spread it\n attribs = t.callExpression(helper, objs);\n }\n\n return attribs;\n }\n\n function buildFragmentCall(path, file) {\n if (opts.filter && !opts.filter(path.node, file)) return;\n\n const openingPath = path.get(\"openingElement\");\n openingPath.parent.children = t.react.buildChildren(openingPath.parent);\n\n const args = [];\n const tagName = null;\n const tagExpr = file.get(\"jsxFragIdentifier\")();\n\n const state: ElementState = {\n tagExpr: tagExpr,\n tagName: tagName,\n args: args,\n };\n\n if (opts.pre) {\n opts.pre(state, file);\n }\n\n // no attributes are allowed with <> syntax\n args.push(t.nullLiteral(), ...path.node.children);\n\n if (opts.post) {\n opts.post(state, file);\n }\n\n file.set(\"usedFragment\", true);\n return state.call || t.callExpression(state.callee, args);\n }\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function hasRefOrSpread(attrs) {\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (t.isJSXSpreadAttribute(attr)) return true;\n if (isJSXAttributeOfName(attr, \"ref\")) return true;\n }\n return false;\n }\n\n function isJSXAttributeOfName(attr, name) {\n return (\n t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name })\n );\n }\n\n const visitor = helper({\n filter(node) {\n return (\n // Regular JSX nodes have an `openingElement`. JSX fragments, however, don't have an\n // `openingElement` which causes `node.openingElement.attributes` to throw.\n node.openingElement && !hasRefOrSpread(node.openingElement.attributes)\n );\n },\n pre(state) {\n const tagName = state.tagName;\n const args = state.args;\n if (t.react.isCompatTag(tagName)) {\n args.push(t.stringLiteral(tagName));\n } else {\n args.push(state.tagExpr);\n }\n },\n post(state, pass) {\n state.callee = pass.addHelper(\"jsx\");\n // NOTE: The arguments passed to the \"jsx\" helper are:\n // (element, props, key, ...children) or (element, props)\n // The argument generated by the helper are:\n // (element, { ...props, key }, ...children)\n\n const props = state.args[1];\n let hasKey = false;\n if (t.isObjectExpression(props)) {\n const keyIndex = props.properties.findIndex(prop =>\n t.isIdentifier(prop.key, { name: \"key\" }),\n );\n if (keyIndex > -1) {\n state.args.splice(2, 0, props.properties[keyIndex].value);\n props.properties.splice(keyIndex, 1);\n hasKey = true;\n }\n } else if (t.isNullLiteral(props)) {\n state.args.splice(1, 1, t.objectExpression([]));\n }\n\n if (!hasKey && state.args.length > 2) {\n state.args.splice(2, 0, t.unaryExpression(\"void\", t.numericLiteral(0)));\n }\n },\n });\n return {\n name: \"transform-react-inline-elements\",\n visitor,\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport jsx from \"@babel/plugin-syntax-jsx\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const THROW_IF_NAMESPACE =\n options.throwIfNamespace === undefined ? true : !!options.throwIfNamespace;\n\n const PRAGMA_DEFAULT = options.pragma || \"React.createElement\";\n const PRAGMA_FRAG_DEFAULT = options.pragmaFrag || \"React.Fragment\";\n\n const JSX_ANNOTATION_REGEX = /\\*?\\s*@jsx\\s+([^\\s]+)/;\n const JSX_FRAG_ANNOTATION_REGEX = /\\*?\\s*@jsxFrag\\s+([^\\s]+)/;\n\n // returns a closure that returns an identifier or memberExpression node\n // based on the given id\n const createIdentifierParser = (id: string) => () => {\n return id\n .split(\".\")\n .map(name => t.identifier(name))\n .reduce((object, property) => t.memberExpression(object, property));\n };\n\n const visitor = helper({\n pre(state) {\n const tagName = state.tagName;\n const args = state.args;\n if (t.react.isCompatTag(tagName)) {\n args.push(t.stringLiteral(tagName));\n } else {\n args.push(state.tagExpr);\n }\n },\n\n post(state, pass) {\n state.callee = pass.get(\"jsxIdentifier\")();\n },\n\n throwIfNamespace: THROW_IF_NAMESPACE,\n });\n\n visitor.Program = {\n enter(path, state) {\n const { file } = state;\n\n let pragma = PRAGMA_DEFAULT;\n let pragmaFrag = PRAGMA_FRAG_DEFAULT;\n let pragmaSet = !!options.pragma;\n let pragmaFragSet = !!options.pragmaFrag;\n\n if (file.ast.comments) {\n for (const comment of (file.ast.comments: Array)) {\n const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);\n if (jsxMatches) {\n pragma = jsxMatches[1];\n pragmaSet = true;\n }\n const jsxFragMatches = JSX_FRAG_ANNOTATION_REGEX.exec(comment.value);\n if (jsxFragMatches) {\n pragmaFrag = jsxFragMatches[1];\n pragmaFragSet = true;\n }\n }\n }\n\n state.set(\"jsxIdentifier\", createIdentifierParser(pragma));\n state.set(\"jsxFragIdentifier\", createIdentifierParser(pragmaFrag));\n state.set(\"usedFragment\", false);\n state.set(\"pragmaSet\", pragmaSet);\n state.set(\"pragmaFragSet\", pragmaFragSet);\n },\n exit(path, state) {\n if (\n state.get(\"pragmaSet\") &&\n state.get(\"usedFragment\") &&\n !state.get(\"pragmaFragSet\")\n ) {\n throw new Error(\n \"transform-react-jsx: pragma has been set but \" +\n \"pragmaFrag has not been set\",\n );\n }\n },\n };\n\n visitor.JSXAttribute = function(path) {\n if (t.isJSXElement(path.node.value)) {\n path.node.value = t.jsxExpressionContainer(path.node.value);\n }\n };\n\n return {\n name: \"transform-react-jsx\",\n inherits: jsx,\n visitor,\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport helper from \"@babel/helper-builder-react-jsx\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-react-jsx-compat\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"jsx\");\n },\n\n visitor: helper({\n pre(state) {\n state.callee = state.tagExpr;\n },\n\n post(state) {\n if (t.react.isCompatTag(state.tagName)) {\n state.call = t.callExpression(\n t.memberExpression(\n t.memberExpression(t.identifier(\"React\"), t.identifier(\"DOM\")),\n state.tagExpr,\n t.isLiteral(state.tagExpr),\n ),\n state.args,\n );\n }\n },\n compat: true,\n }),\n };\n});\n","/**\n * This adds a __self={this} JSX attribute to all JSX elements, which React will use\n * to generate some runtime warnings.\n *\n *\n * == JSX Literals ==\n *\n * \n *\n * becomes:\n *\n * \n */\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nconst TRACE_ID = \"__self\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n const visitor = {\n JSXOpeningElement({ node }) {\n const id = t.jsxIdentifier(TRACE_ID);\n const trace = t.thisExpression();\n\n node.attributes.push(t.jsxAttribute(id, t.jsxExpressionContainer(trace)));\n },\n };\n\n return {\n name: \"transform-react-jsx-self\",\n visitor,\n };\n});\n","/**\n * This adds {fileName, lineNumber} annotations to React component definitions\n * and to jsx tag literals.\n *\n *\n * == JSX Literals ==\n *\n * \n *\n * becomes:\n *\n * var __jsxFileName = 'this/file.js';\n * \n */\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nconst TRACE_ID = \"__source\";\nconst FILE_NAME_VAR = \"_jsxFileName\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n function makeTrace(fileNameIdentifier, lineNumber) {\n const fileLineLiteral =\n lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral();\n const fileNameProperty = t.objectProperty(\n t.identifier(\"fileName\"),\n fileNameIdentifier,\n );\n const lineNumberProperty = t.objectProperty(\n t.identifier(\"lineNumber\"),\n fileLineLiteral,\n );\n return t.objectExpression([fileNameProperty, lineNumberProperty]);\n }\n\n const visitor = {\n JSXOpeningElement(path, state) {\n const id = t.jsxIdentifier(TRACE_ID);\n const location = path.container.openingElement.loc;\n if (!location) {\n // the element was generated and doesn't have location information\n return;\n }\n\n const attributes = path.container.openingElement.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const name = attributes[i].name;\n if (name && name.name === TRACE_ID) {\n // The __source attribute already exists\n return;\n }\n }\n\n if (!state.fileNameIdentifier) {\n const fileName = state.filename || \"\";\n\n const fileNameIdentifier = path.scope.generateUidIdentifier(\n FILE_NAME_VAR,\n );\n const scope = path.hub.getScope();\n if (scope) {\n scope.push({\n id: fileNameIdentifier,\n init: t.stringLiteral(fileName),\n });\n }\n state.fileNameIdentifier = fileNameIdentifier;\n }\n\n const trace = makeTrace(state.fileNameIdentifier, location.start.line);\n attributes.push(t.jsxAttribute(id, t.jsxExpressionContainer(trace)));\n },\n };\n\n return {\n name: \"transform-react-jsx-source\",\n visitor,\n };\n});\n","\"use strict\";\n\nexports.__esModule = true;\nexports.wrapWithTypes = wrapWithTypes;\nexports.getTypes = getTypes;\nexports.runtimeProperty = runtimeProperty;\nexports.isReference = isReference;\nexports.replaceWithOrRemove = replaceWithOrRemove;\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar currentTypes = null;\n\nfunction wrapWithTypes(types, fn) {\n return function () {\n var oldTypes = currentTypes;\n currentTypes = types;\n\n try {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return fn.apply(this, args);\n } finally {\n currentTypes = oldTypes;\n }\n };\n}\n\nfunction getTypes() {\n return currentTypes;\n}\n\nfunction runtimeProperty(name) {\n var t = getTypes();\n return t.memberExpression(t.identifier(\"regeneratorRuntime\"), t.identifier(name), false);\n}\n\nfunction isReference(path) {\n return path.isReferenced() || path.parentPath.isAssignmentExpression({\n left: path.node\n });\n}\n\nfunction replaceWithOrRemove(path, replacement) {\n if (replacement) {\n path.replaceWith(replacement);\n } else {\n path.remove();\n }\n}","\"use strict\";\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar hasOwn = Object.prototype.hasOwnProperty; // The hoist function takes a FunctionExpression or FunctionDeclaration\n// and replaces any Declaration nodes in its body with assignments, then\n// returns a VariableDeclaration containing just the names of the removed\n// declarations.\n\nexports.hoist = function (funPath) {\n var t = util.getTypes();\n t.assertFunction(funPath.node);\n var vars = {};\n\n function varDeclToExpr(_ref, includeIdentifiers) {\n var vdec = _ref.node,\n scope = _ref.scope;\n t.assertVariableDeclaration(vdec); // TODO assert.equal(vdec.kind, \"var\");\n\n var exprs = [];\n vdec.declarations.forEach(function (dec) {\n // Note: We duplicate 'dec.id' here to ensure that the variable declaration IDs don't\n // have the same 'loc' value, since that can make sourcemaps and retainLines behave poorly.\n vars[dec.id.name] = t.identifier(dec.id.name); // Remove the binding, to avoid \"duplicate declaration\" errors when it will\n // be injected again.\n\n scope.removeBinding(dec.id.name);\n\n if (dec.init) {\n exprs.push(t.assignmentExpression(\"=\", dec.id, dec.init));\n } else if (includeIdentifiers) {\n exprs.push(dec.id);\n }\n });\n if (exprs.length === 0) return null;\n if (exprs.length === 1) return exprs[0];\n return t.sequenceExpression(exprs);\n }\n\n funPath.get(\"body\").traverse({\n VariableDeclaration: {\n exit: function exit(path) {\n var expr = varDeclToExpr(path, false);\n\n if (expr === null) {\n path.remove();\n } else {\n // We don't need to traverse this expression any further because\n // there can't be any new declarations inside an expression.\n util.replaceWithOrRemove(path, t.expressionStatement(expr));\n } // Since the original node has been either removed or replaced,\n // avoid traversing it any further.\n\n\n path.skip();\n }\n },\n ForStatement: function ForStatement(path) {\n var init = path.get(\"init\");\n\n if (init.isVariableDeclaration()) {\n util.replaceWithOrRemove(init, varDeclToExpr(init, false));\n }\n },\n ForXStatement: function ForXStatement(path) {\n var left = path.get(\"left\");\n\n if (left.isVariableDeclaration()) {\n util.replaceWithOrRemove(left, varDeclToExpr(left, true));\n }\n },\n FunctionDeclaration: function FunctionDeclaration(path) {\n var node = path.node;\n vars[node.id.name] = node.id;\n var assignment = t.expressionStatement(t.assignmentExpression(\"=\", t.clone(node.id), t.functionExpression(path.scope.generateUidIdentifierBasedOnNode(node), node.params, node.body, node.generator, node.expression)));\n\n if (path.parentPath.isBlockStatement()) {\n // Insert the assignment form before the first statement in the\n // enclosing block.\n path.parentPath.unshiftContainer(\"body\", assignment); // Remove the function declaration now that we've inserted the\n // equivalent assignment form at the beginning of the block.\n\n path.remove();\n } else {\n // If the parent node is not a block statement, then we can just\n // replace the declaration with the equivalent assignment form\n // without worrying about hoisting it.\n util.replaceWithOrRemove(path, assignment);\n } // Remove the binding, to avoid \"duplicate declaration\" errors when it will\n // be injected again.\n\n\n path.scope.removeBinding(node.id.name); // Don't hoist variables out of inner functions.\n\n path.skip();\n },\n FunctionExpression: function FunctionExpression(path) {\n // Don't descend into nested function expressions.\n path.skip();\n },\n ArrowFunctionExpression: function ArrowFunctionExpression(path) {\n // Don't descend into nested function expressions.\n path.skip();\n }\n });\n var paramNames = {};\n funPath.get(\"params\").forEach(function (paramPath) {\n var param = paramPath.node;\n\n if (t.isIdentifier(param)) {\n paramNames[param.name] = param;\n } else {// Variables declared by destructuring parameter patterns will be\n // harmlessly re-declared.\n }\n });\n var declarations = [];\n Object.keys(vars).forEach(function (name) {\n if (!hasOwn.call(paramNames, name)) {\n declarations.push(t.variableDeclarator(vars[name], null));\n }\n });\n\n if (declarations.length === 0) {\n return null; // Be sure to handle this case!\n }\n\n return t.variableDeclaration(\"var\", declarations);\n};","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _emit = require(\"./emit\");\n\nvar _util = require(\"util\");\n\nvar _util2 = require(\"./util\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction Entry() {\n _assert[\"default\"].ok(this instanceof Entry);\n}\n\nfunction FunctionEntry(returnLoc) {\n Entry.call(this);\n (0, _util2.getTypes)().assertLiteral(returnLoc);\n this.returnLoc = returnLoc;\n}\n\n(0, _util.inherits)(FunctionEntry, Entry);\nexports.FunctionEntry = FunctionEntry;\n\nfunction LoopEntry(breakLoc, continueLoc, label) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(breakLoc);\n t.assertLiteral(continueLoc);\n\n if (label) {\n t.assertIdentifier(label);\n } else {\n label = null;\n }\n\n this.breakLoc = breakLoc;\n this.continueLoc = continueLoc;\n this.label = label;\n}\n\n(0, _util.inherits)(LoopEntry, Entry);\nexports.LoopEntry = LoopEntry;\n\nfunction SwitchEntry(breakLoc) {\n Entry.call(this);\n (0, _util2.getTypes)().assertLiteral(breakLoc);\n this.breakLoc = breakLoc;\n}\n\n(0, _util.inherits)(SwitchEntry, Entry);\nexports.SwitchEntry = SwitchEntry;\n\nfunction TryEntry(firstLoc, catchEntry, finallyEntry) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n\n if (catchEntry) {\n _assert[\"default\"].ok(catchEntry instanceof CatchEntry);\n } else {\n catchEntry = null;\n }\n\n if (finallyEntry) {\n _assert[\"default\"].ok(finallyEntry instanceof FinallyEntry);\n } else {\n finallyEntry = null;\n } // Have to have one or the other (or both).\n\n\n _assert[\"default\"].ok(catchEntry || finallyEntry);\n\n this.firstLoc = firstLoc;\n this.catchEntry = catchEntry;\n this.finallyEntry = finallyEntry;\n}\n\n(0, _util.inherits)(TryEntry, Entry);\nexports.TryEntry = TryEntry;\n\nfunction CatchEntry(firstLoc, paramId) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n t.assertIdentifier(paramId);\n this.firstLoc = firstLoc;\n this.paramId = paramId;\n}\n\n(0, _util.inherits)(CatchEntry, Entry);\nexports.CatchEntry = CatchEntry;\n\nfunction FinallyEntry(firstLoc, afterLoc) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(firstLoc);\n t.assertLiteral(afterLoc);\n this.firstLoc = firstLoc;\n this.afterLoc = afterLoc;\n}\n\n(0, _util.inherits)(FinallyEntry, Entry);\nexports.FinallyEntry = FinallyEntry;\n\nfunction LabeledEntry(breakLoc, label) {\n Entry.call(this);\n var t = (0, _util2.getTypes)();\n t.assertLiteral(breakLoc);\n t.assertIdentifier(label);\n this.breakLoc = breakLoc;\n this.label = label;\n}\n\n(0, _util.inherits)(LabeledEntry, Entry);\nexports.LabeledEntry = LabeledEntry;\n\nfunction LeapManager(emitter) {\n _assert[\"default\"].ok(this instanceof LeapManager);\n\n _assert[\"default\"].ok(emitter instanceof _emit.Emitter);\n\n this.emitter = emitter;\n this.entryStack = [new FunctionEntry(emitter.finalLoc)];\n}\n\nvar LMp = LeapManager.prototype;\nexports.LeapManager = LeapManager;\n\nLMp.withEntry = function (entry, callback) {\n _assert[\"default\"].ok(entry instanceof Entry);\n\n this.entryStack.push(entry);\n\n try {\n callback.call(this.emitter);\n } finally {\n var popped = this.entryStack.pop();\n\n _assert[\"default\"].strictEqual(popped, entry);\n }\n};\n\nLMp._findLeapLocation = function (property, label) {\n for (var i = this.entryStack.length - 1; i >= 0; --i) {\n var entry = this.entryStack[i];\n var loc = entry[property];\n\n if (loc) {\n if (label) {\n if (entry.label && entry.label.name === label.name) {\n return loc;\n }\n } else if (entry instanceof LabeledEntry) {// Ignore LabeledEntry entries unless we are actually breaking to\n // a label.\n } else {\n return loc;\n }\n }\n }\n\n return null;\n};\n\nLMp.getBreakLoc = function (label) {\n return this._findLeapLocation(\"breakLoc\", label);\n};\n\nLMp.getContinueLoc = function (label) {\n return this._findLeapLocation(\"continueLoc\", label);\n};","\"use strict\";\n\nvar originalObject = Object;\nvar originalDefProp = Object.defineProperty;\nvar originalCreate = Object.create;\n\nfunction defProp(obj, name, value) {\n if (originalDefProp) try {\n originalDefProp.call(originalObject, obj, name, { value: value });\n } catch (definePropertyIsBrokenInIE8) {\n obj[name] = value;\n } else {\n obj[name] = value;\n }\n}\n\n// For functions that will be invoked using .call or .apply, we need to\n// define those methods on the function objects themselves, rather than\n// inheriting them from Function.prototype, so that a malicious or clumsy\n// third party cannot interfere with the functionality of this module by\n// redefining Function.prototype.call or .apply.\nfunction makeSafeToCall(fun) {\n if (fun) {\n defProp(fun, \"call\", fun.call);\n defProp(fun, \"apply\", fun.apply);\n }\n return fun;\n}\n\nmakeSafeToCall(originalDefProp);\nmakeSafeToCall(originalCreate);\n\nvar hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty);\nvar numToStr = makeSafeToCall(Number.prototype.toString);\nvar strSlice = makeSafeToCall(String.prototype.slice);\n\nvar cloner = function(){};\nfunction create(prototype) {\n if (originalCreate) {\n return originalCreate.call(originalObject, prototype);\n }\n cloner.prototype = prototype || null;\n return new cloner;\n}\n\nvar rand = Math.random;\nvar uniqueKeys = create(null);\n\nfunction makeUniqueKey() {\n // Collisions are highly unlikely, but this module is in the business of\n // making guarantees rather than safe bets.\n do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2));\n while (hasOwn.call(uniqueKeys, uniqueKey));\n return uniqueKeys[uniqueKey] = uniqueKey;\n}\n\nfunction internString(str) {\n var obj = {};\n obj[str] = true;\n return Object.keys(obj)[0];\n}\n\n// External users might find this function useful, but it is not necessary\n// for the typical use of this module.\nexports.makeUniqueKey = makeUniqueKey;\n\n// Object.getOwnPropertyNames is the only way to enumerate non-enumerable\n// properties, so if we wrap it to ignore our secret keys, there should be\n// no way (except guessing) to access those properties.\nvar originalGetOPNs = Object.getOwnPropertyNames;\nObject.getOwnPropertyNames = function getOwnPropertyNames(object) {\n for (var names = originalGetOPNs(object),\n src = 0,\n dst = 0,\n len = names.length;\n src < len;\n ++src) {\n if (!hasOwn.call(uniqueKeys, names[src])) {\n if (src > dst) {\n names[dst] = names[src];\n }\n ++dst;\n }\n }\n names.length = dst;\n return names;\n};\n\nfunction defaultCreatorFn(object) {\n return create(null);\n}\n\nfunction makeAccessor(secretCreatorFn) {\n var brand = makeUniqueKey();\n var passkey = create(null);\n\n secretCreatorFn = secretCreatorFn || defaultCreatorFn;\n\n function register(object) {\n var secret; // Created lazily.\n\n function vault(key, forget) {\n // Only code that has access to the passkey can retrieve (or forget)\n // the secret object.\n if (key === passkey) {\n return forget\n ? secret = null\n : secret || (secret = secretCreatorFn(object));\n }\n }\n\n defProp(object, brand, vault);\n }\n\n function accessor(object) {\n if (!hasOwn.call(object, brand))\n register(object);\n return object[brand](passkey);\n }\n\n accessor.forget = function(object) {\n if (hasOwn.call(object, brand))\n object[brand](passkey, true);\n };\n\n return accessor;\n}\n\nexports.makeAccessor = makeAccessor;\n","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _util = require(\"./util.js\");\n\nvar _private = require(\"private\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar m = (0, _private.makeAccessor)();\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction makePredicate(propertyName, knownTypes) {\n function onlyChildren(node) {\n var t = (0, _util.getTypes)();\n t.assertNode(node); // Assume no side effects until we find out otherwise.\n\n var result = false;\n\n function check(child) {\n if (result) {// Do nothing.\n } else if (Array.isArray(child)) {\n child.some(check);\n } else if (t.isNode(child)) {\n _assert[\"default\"].strictEqual(result, false);\n\n result = predicate(child);\n }\n\n return result;\n }\n\n var keys = t.VISITOR_KEYS[node.type];\n\n if (keys) {\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var child = node[key];\n check(child);\n }\n }\n\n return result;\n }\n\n function predicate(node) {\n (0, _util.getTypes)().assertNode(node);\n var meta = m(node);\n if (hasOwn.call(meta, propertyName)) return meta[propertyName]; // Certain types are \"opaque,\" which means they have no side\n // effects or leaps and we don't care about their subexpressions.\n\n if (hasOwn.call(opaqueTypes, node.type)) return meta[propertyName] = false;\n if (hasOwn.call(knownTypes, node.type)) return meta[propertyName] = true;\n return meta[propertyName] = onlyChildren(node);\n }\n\n predicate.onlyChildren = onlyChildren;\n return predicate;\n}\n\nvar opaqueTypes = {\n FunctionExpression: true,\n ArrowFunctionExpression: true\n}; // These types potentially have side effects regardless of what side\n// effects their subexpressions have.\n\nvar sideEffectTypes = {\n CallExpression: true,\n // Anything could happen!\n ForInStatement: true,\n // Modifies the key variable.\n UnaryExpression: true,\n // Think delete.\n BinaryExpression: true,\n // Might invoke .toString() or .valueOf().\n AssignmentExpression: true,\n // Side-effecting by definition.\n UpdateExpression: true,\n // Updates are essentially assignments.\n NewExpression: true // Similar to CallExpression.\n\n}; // These types are the direct cause of all leaps in control flow.\n\nvar leapTypes = {\n YieldExpression: true,\n BreakStatement: true,\n ContinueStatement: true,\n ReturnStatement: true,\n ThrowStatement: true\n}; // All leap types are also side effect types.\n\nfor (var type in leapTypes) {\n if (hasOwn.call(leapTypes, type)) {\n sideEffectTypes[type] = leapTypes[type];\n }\n}\n\nexports.hasSideEffects = makePredicate(\"hasSideEffects\", sideEffectTypes);\nexports.containsLeap = makePredicate(\"containsLeap\", leapTypes);","\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar leap = _interopRequireWildcard(require(\"./leap\"));\n\nvar meta = _interopRequireWildcard(require(\"./meta\"));\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar hasOwn = Object.prototype.hasOwnProperty;\n\nfunction Emitter(contextId) {\n _assert[\"default\"].ok(this instanceof Emitter);\n\n util.getTypes().assertIdentifier(contextId); // Used to generate unique temporary names.\n\n this.nextTempId = 0; // In order to make sure the context object does not collide with\n // anything in the local scope, we might have to rename it, so we\n // refer to it symbolically instead of just assuming that it will be\n // called \"context\".\n\n this.contextId = contextId; // An append-only list of Statements that grows each time this.emit is\n // called.\n\n this.listing = []; // A sparse array whose keys correspond to locations in this.listing\n // that have been marked as branch/jump targets.\n\n this.marked = [true];\n this.insertedLocs = new Set(); // The last location will be marked when this.getDispatchLoop is\n // called.\n\n this.finalLoc = this.loc(); // A list of all leap.TryEntry statements emitted.\n\n this.tryEntries = []; // Each time we evaluate the body of a loop, we tell this.leapManager\n // to enter a nested loop context that determines the meaning of break\n // and continue statements therein.\n\n this.leapManager = new leap.LeapManager(this);\n}\n\nvar Ep = Emitter.prototype;\nexports.Emitter = Emitter; // Offsets into this.listing that could be used as targets for branches or\n// jumps are represented as numeric Literal nodes. This representation has\n// the amazingly convenient benefit of allowing the exact value of the\n// location to be determined at any time, even after generating code that\n// refers to the location.\n\nEp.loc = function () {\n var l = util.getTypes().numericLiteral(-1);\n this.insertedLocs.add(l);\n return l;\n};\n\nEp.getInsertedLocs = function () {\n return this.insertedLocs;\n};\n\nEp.getContextId = function () {\n return util.getTypes().clone(this.contextId);\n}; // Sets the exact value of the given location to the offset of the next\n// Statement emitted.\n\n\nEp.mark = function (loc) {\n util.getTypes().assertLiteral(loc);\n var index = this.listing.length;\n\n if (loc.value === -1) {\n loc.value = index;\n } else {\n // Locations can be marked redundantly, but their values cannot change\n // once set the first time.\n _assert[\"default\"].strictEqual(loc.value, index);\n }\n\n this.marked[index] = true;\n return loc;\n};\n\nEp.emit = function (node) {\n var t = util.getTypes();\n\n if (t.isExpression(node)) {\n node = t.expressionStatement(node);\n }\n\n t.assertStatement(node);\n this.listing.push(node);\n}; // Shorthand for emitting assignment statements. This will come in handy\n// for assignments to temporary variables.\n\n\nEp.emitAssign = function (lhs, rhs) {\n this.emit(this.assign(lhs, rhs));\n return lhs;\n}; // Shorthand for an assignment statement.\n\n\nEp.assign = function (lhs, rhs) {\n var t = util.getTypes();\n return t.expressionStatement(t.assignmentExpression(\"=\", t.cloneDeep(lhs), rhs));\n}; // Convenience function for generating expressions like context.next,\n// context.sent, and context.rval.\n\n\nEp.contextProperty = function (name, computed) {\n var t = util.getTypes();\n return t.memberExpression(this.getContextId(), computed ? t.stringLiteral(name) : t.identifier(name), !!computed);\n}; // Shorthand for setting context.rval and jumping to `context.stop()`.\n\n\nEp.stop = function (rval) {\n if (rval) {\n this.setReturnValue(rval);\n }\n\n this.jump(this.finalLoc);\n};\n\nEp.setReturnValue = function (valuePath) {\n util.getTypes().assertExpression(valuePath.value);\n this.emitAssign(this.contextProperty(\"rval\"), this.explodeExpression(valuePath));\n};\n\nEp.clearPendingException = function (tryLoc, assignee) {\n var t = util.getTypes();\n t.assertLiteral(tryLoc);\n var catchCall = t.callExpression(this.contextProperty(\"catch\", true), [t.clone(tryLoc)]);\n\n if (assignee) {\n this.emitAssign(assignee, catchCall);\n } else {\n this.emit(catchCall);\n }\n}; // Emits code for an unconditional jump to the given location, even if the\n// exact value of the location is not yet known.\n\n\nEp.jump = function (toLoc) {\n this.emitAssign(this.contextProperty(\"next\"), toLoc);\n this.emit(util.getTypes().breakStatement());\n}; // Conditional jump.\n\n\nEp.jumpIf = function (test, toLoc) {\n var t = util.getTypes();\n t.assertExpression(test);\n t.assertLiteral(toLoc);\n this.emit(t.ifStatement(test, t.blockStatement([this.assign(this.contextProperty(\"next\"), toLoc), t.breakStatement()])));\n}; // Conditional jump, with the condition negated.\n\n\nEp.jumpIfNot = function (test, toLoc) {\n var t = util.getTypes();\n t.assertExpression(test);\n t.assertLiteral(toLoc);\n var negatedTest;\n\n if (t.isUnaryExpression(test) && test.operator === \"!\") {\n // Avoid double negation.\n negatedTest = test.argument;\n } else {\n negatedTest = t.unaryExpression(\"!\", test);\n }\n\n this.emit(t.ifStatement(negatedTest, t.blockStatement([this.assign(this.contextProperty(\"next\"), toLoc), t.breakStatement()])));\n}; // Returns a unique MemberExpression that can be used to store and\n// retrieve temporary values. Since the object of the member expression is\n// the context object, which is presumed to coexist peacefully with all\n// other local variables, and since we just increment `nextTempId`\n// monotonically, uniqueness is assured.\n\n\nEp.makeTempVar = function () {\n return this.contextProperty(\"t\" + this.nextTempId++);\n};\n\nEp.getContextFunction = function (id) {\n var t = util.getTypes();\n return t.functionExpression(id || null\n /*Anonymous*/\n , [this.getContextId()], t.blockStatement([this.getDispatchLoop()]), false, // Not a generator anymore!\n false // Nor an expression.\n );\n}; // Turns this.listing into a loop of the form\n//\n// while (1) switch (context.next) {\n// case 0:\n// ...\n// case n:\n// return context.stop();\n// }\n//\n// Each marked location in this.listing will correspond to one generated\n// case statement.\n\n\nEp.getDispatchLoop = function () {\n var self = this;\n var t = util.getTypes();\n var cases = [];\n var current; // If we encounter a break, continue, or return statement in a switch\n // case, we can skip the rest of the statements until the next case.\n\n var alreadyEnded = false;\n self.listing.forEach(function (stmt, i) {\n if (self.marked.hasOwnProperty(i)) {\n cases.push(t.switchCase(t.numericLiteral(i), current = []));\n alreadyEnded = false;\n }\n\n if (!alreadyEnded) {\n current.push(stmt);\n if (t.isCompletionStatement(stmt)) alreadyEnded = true;\n }\n }); // Now that we know how many statements there will be in this.listing,\n // we can finally resolve this.finalLoc.value.\n\n this.finalLoc.value = this.listing.length;\n cases.push(t.switchCase(this.finalLoc, [// Intentionally fall through to the \"end\" case...\n ]), // So that the runtime can jump to the final location without having\n // to know its offset, we provide the \"end\" case as a synonym.\n t.switchCase(t.stringLiteral(\"end\"), [// This will check/clear both context.thrown and context.rval.\n t.returnStatement(t.callExpression(this.contextProperty(\"stop\"), []))]));\n return t.whileStatement(t.numericLiteral(1), t.switchStatement(t.assignmentExpression(\"=\", this.contextProperty(\"prev\"), this.contextProperty(\"next\")), cases));\n};\n\nEp.getTryLocsList = function () {\n if (this.tryEntries.length === 0) {\n // To avoid adding a needless [] to the majority of runtime.wrap\n // argument lists, force the caller to handle this case specially.\n return null;\n }\n\n var t = util.getTypes();\n var lastLocValue = 0;\n return t.arrayExpression(this.tryEntries.map(function (tryEntry) {\n var thisLocValue = tryEntry.firstLoc.value;\n\n _assert[\"default\"].ok(thisLocValue >= lastLocValue, \"try entries out of order\");\n\n lastLocValue = thisLocValue;\n var ce = tryEntry.catchEntry;\n var fe = tryEntry.finallyEntry;\n var locs = [tryEntry.firstLoc, // The null here makes a hole in the array.\n ce ? ce.firstLoc : null];\n\n if (fe) {\n locs[2] = fe.firstLoc;\n locs[3] = fe.afterLoc;\n }\n\n return t.arrayExpression(locs.map(function (loc) {\n return loc && t.clone(loc);\n }));\n }));\n}; // All side effects must be realized in order.\n// If any subexpression harbors a leap, all subexpressions must be\n// neutered of side effects.\n// No destructive modification of AST nodes.\n\n\nEp.explode = function (path, ignoreResult) {\n var t = util.getTypes();\n var node = path.node;\n var self = this;\n t.assertNode(node);\n if (t.isDeclaration(node)) throw getDeclError(node);\n if (t.isStatement(node)) return self.explodeStatement(path);\n if (t.isExpression(node)) return self.explodeExpression(path, ignoreResult);\n\n switch (node.type) {\n case \"Program\":\n return path.get(\"body\").map(self.explodeStatement, self);\n\n case \"VariableDeclarator\":\n throw getDeclError(node);\n // These node types should be handled by their parent nodes\n // (ObjectExpression, SwitchStatement, and TryStatement, respectively).\n\n case \"Property\":\n case \"SwitchCase\":\n case \"CatchClause\":\n throw new Error(node.type + \" nodes should be handled by their parents\");\n\n default:\n throw new Error(\"unknown Node of type \" + JSON.stringify(node.type));\n }\n};\n\nfunction getDeclError(node) {\n return new Error(\"all declarations should have been transformed into \" + \"assignments before the Exploder began its work: \" + JSON.stringify(node));\n}\n\nEp.explodeStatement = function (path, labelId) {\n var t = util.getTypes();\n var stmt = path.node;\n var self = this;\n var before, after, head;\n t.assertStatement(stmt);\n\n if (labelId) {\n t.assertIdentifier(labelId);\n } else {\n labelId = null;\n } // Explode BlockStatement nodes even if they do not contain a yield,\n // because we don't want or need the curly braces.\n\n\n if (t.isBlockStatement(stmt)) {\n path.get(\"body\").forEach(function (path) {\n self.explodeStatement(path);\n });\n return;\n }\n\n if (!meta.containsLeap(stmt)) {\n // Technically we should be able to avoid emitting the statement\n // altogether if !meta.hasSideEffects(stmt), but that leads to\n // confusing generated code (for instance, `while (true) {}` just\n // disappears) and is probably a more appropriate job for a dedicated\n // dead code elimination pass.\n self.emit(stmt);\n return;\n }\n\n switch (stmt.type) {\n case \"ExpressionStatement\":\n self.explodeExpression(path.get(\"expression\"), true);\n break;\n\n case \"LabeledStatement\":\n after = this.loc(); // Did you know you can break from any labeled block statement or\n // control structure? Well, you can! Note: when a labeled loop is\n // encountered, the leap.LabeledEntry created here will immediately\n // enclose a leap.LoopEntry on the leap manager's stack, and both\n // entries will have the same label. Though this works just fine, it\n // may seem a bit redundant. In theory, we could check here to\n // determine if stmt knows how to handle its own label; for example,\n // stmt happens to be a WhileStatement and so we know it's going to\n // establish its own LoopEntry when we explode it (below). Then this\n // LabeledEntry would be unnecessary. Alternatively, we might be\n // tempted not to pass stmt.label down into self.explodeStatement,\n // because we've handled the label here, but that's a mistake because\n // labeled loops may contain labeled continue statements, which is not\n // something we can handle in this generic case. All in all, I think a\n // little redundancy greatly simplifies the logic of this case, since\n // it's clear that we handle all possible LabeledStatements correctly\n // here, regardless of whether they interact with the leap manager\n // themselves. Also remember that labels and break/continue-to-label\n // statements are rare, and all of this logic happens at transform\n // time, so it has no additional runtime cost.\n\n self.leapManager.withEntry(new leap.LabeledEntry(after, stmt.label), function () {\n self.explodeStatement(path.get(\"body\"), stmt.label);\n });\n self.mark(after);\n break;\n\n case \"WhileStatement\":\n before = this.loc();\n after = this.loc();\n self.mark(before);\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), after);\n self.leapManager.withEntry(new leap.LoopEntry(after, before, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.jump(before);\n self.mark(after);\n break;\n\n case \"DoWhileStatement\":\n var first = this.loc();\n var test = this.loc();\n after = this.loc();\n self.mark(first);\n self.leapManager.withEntry(new leap.LoopEntry(after, test, labelId), function () {\n self.explode(path.get(\"body\"));\n });\n self.mark(test);\n self.jumpIf(self.explodeExpression(path.get(\"test\")), first);\n self.mark(after);\n break;\n\n case \"ForStatement\":\n head = this.loc();\n var update = this.loc();\n after = this.loc();\n\n if (stmt.init) {\n // We pass true here to indicate that if stmt.init is an expression\n // then we do not care about its result.\n self.explode(path.get(\"init\"), true);\n }\n\n self.mark(head);\n\n if (stmt.test) {\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), after);\n } else {// No test means continue unconditionally.\n }\n\n self.leapManager.withEntry(new leap.LoopEntry(after, update, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.mark(update);\n\n if (stmt.update) {\n // We pass true here to indicate that if stmt.update is an\n // expression then we do not care about its result.\n self.explode(path.get(\"update\"), true);\n }\n\n self.jump(head);\n self.mark(after);\n break;\n\n case \"TypeCastExpression\":\n return self.explodeExpression(path.get(\"expression\"));\n\n case \"ForInStatement\":\n head = this.loc();\n after = this.loc();\n var keyIterNextFn = self.makeTempVar();\n self.emitAssign(keyIterNextFn, t.callExpression(util.runtimeProperty(\"keys\"), [self.explodeExpression(path.get(\"right\"))]));\n self.mark(head);\n var keyInfoTmpVar = self.makeTempVar();\n self.jumpIf(t.memberExpression(t.assignmentExpression(\"=\", keyInfoTmpVar, t.callExpression(t.cloneDeep(keyIterNextFn), [])), t.identifier(\"done\"), false), after);\n self.emitAssign(stmt.left, t.memberExpression(t.cloneDeep(keyInfoTmpVar), t.identifier(\"value\"), false));\n self.leapManager.withEntry(new leap.LoopEntry(after, head, labelId), function () {\n self.explodeStatement(path.get(\"body\"));\n });\n self.jump(head);\n self.mark(after);\n break;\n\n case \"BreakStatement\":\n self.emitAbruptCompletion({\n type: \"break\",\n target: self.leapManager.getBreakLoc(stmt.label)\n });\n break;\n\n case \"ContinueStatement\":\n self.emitAbruptCompletion({\n type: \"continue\",\n target: self.leapManager.getContinueLoc(stmt.label)\n });\n break;\n\n case \"SwitchStatement\":\n // Always save the discriminant into a temporary variable in case the\n // test expressions overwrite values like context.sent.\n var disc = self.emitAssign(self.makeTempVar(), self.explodeExpression(path.get(\"discriminant\")));\n after = this.loc();\n var defaultLoc = this.loc();\n var condition = defaultLoc;\n var caseLocs = []; // If there are no cases, .cases might be undefined.\n\n var cases = stmt.cases || [];\n\n for (var i = cases.length - 1; i >= 0; --i) {\n var c = cases[i];\n t.assertSwitchCase(c);\n\n if (c.test) {\n condition = t.conditionalExpression(t.binaryExpression(\"===\", t.cloneDeep(disc), c.test), caseLocs[i] = this.loc(), condition);\n } else {\n caseLocs[i] = defaultLoc;\n }\n }\n\n var discriminant = path.get(\"discriminant\");\n util.replaceWithOrRemove(discriminant, condition);\n self.jump(self.explodeExpression(discriminant));\n self.leapManager.withEntry(new leap.SwitchEntry(after), function () {\n path.get(\"cases\").forEach(function (casePath) {\n var i = casePath.key;\n self.mark(caseLocs[i]);\n casePath.get(\"consequent\").forEach(function (path) {\n self.explodeStatement(path);\n });\n });\n });\n self.mark(after);\n\n if (defaultLoc.value === -1) {\n self.mark(defaultLoc);\n\n _assert[\"default\"].strictEqual(after.value, defaultLoc.value);\n }\n\n break;\n\n case \"IfStatement\":\n var elseLoc = stmt.alternate && this.loc();\n after = this.loc();\n self.jumpIfNot(self.explodeExpression(path.get(\"test\")), elseLoc || after);\n self.explodeStatement(path.get(\"consequent\"));\n\n if (elseLoc) {\n self.jump(after);\n self.mark(elseLoc);\n self.explodeStatement(path.get(\"alternate\"));\n }\n\n self.mark(after);\n break;\n\n case \"ReturnStatement\":\n self.emitAbruptCompletion({\n type: \"return\",\n value: self.explodeExpression(path.get(\"argument\"))\n });\n break;\n\n case \"WithStatement\":\n throw new Error(\"WithStatement not supported in generator functions.\");\n\n case \"TryStatement\":\n after = this.loc();\n var handler = stmt.handler;\n var catchLoc = handler && this.loc();\n var catchEntry = catchLoc && new leap.CatchEntry(catchLoc, handler.param);\n var finallyLoc = stmt.finalizer && this.loc();\n var finallyEntry = finallyLoc && new leap.FinallyEntry(finallyLoc, after);\n var tryEntry = new leap.TryEntry(self.getUnmarkedCurrentLoc(), catchEntry, finallyEntry);\n self.tryEntries.push(tryEntry);\n self.updateContextPrevLoc(tryEntry.firstLoc);\n self.leapManager.withEntry(tryEntry, function () {\n self.explodeStatement(path.get(\"block\"));\n\n if (catchLoc) {\n if (finallyLoc) {\n // If we have both a catch block and a finally block, then\n // because we emit the catch block first, we need to jump over\n // it to the finally block.\n self.jump(finallyLoc);\n } else {\n // If there is no finally block, then we need to jump over the\n // catch block to the fall-through location.\n self.jump(after);\n }\n\n self.updateContextPrevLoc(self.mark(catchLoc));\n var bodyPath = path.get(\"handler.body\");\n var safeParam = self.makeTempVar();\n self.clearPendingException(tryEntry.firstLoc, safeParam);\n bodyPath.traverse(catchParamVisitor, {\n getSafeParam: function getSafeParam() {\n return t.cloneDeep(safeParam);\n },\n catchParamName: handler.param.name\n });\n self.leapManager.withEntry(catchEntry, function () {\n self.explodeStatement(bodyPath);\n });\n }\n\n if (finallyLoc) {\n self.updateContextPrevLoc(self.mark(finallyLoc));\n self.leapManager.withEntry(finallyEntry, function () {\n self.explodeStatement(path.get(\"finalizer\"));\n });\n self.emit(t.returnStatement(t.callExpression(self.contextProperty(\"finish\"), [finallyEntry.firstLoc])));\n }\n });\n self.mark(after);\n break;\n\n case \"ThrowStatement\":\n self.emit(t.throwStatement(self.explodeExpression(path.get(\"argument\"))));\n break;\n\n default:\n throw new Error(\"unknown Statement of type \" + JSON.stringify(stmt.type));\n }\n};\n\nvar catchParamVisitor = {\n Identifier: function Identifier(path, state) {\n if (path.node.name === state.catchParamName && util.isReference(path)) {\n util.replaceWithOrRemove(path, state.getSafeParam());\n }\n },\n Scope: function Scope(path, state) {\n if (path.scope.hasOwnBinding(state.catchParamName)) {\n // Don't descend into nested scopes that shadow the catch\n // parameter with their own declarations.\n path.skip();\n }\n }\n};\n\nEp.emitAbruptCompletion = function (record) {\n if (!isValidCompletion(record)) {\n _assert[\"default\"].ok(false, \"invalid completion record: \" + JSON.stringify(record));\n }\n\n _assert[\"default\"].notStrictEqual(record.type, \"normal\", \"normal completions are not abrupt\");\n\n var t = util.getTypes();\n var abruptArgs = [t.stringLiteral(record.type)];\n\n if (record.type === \"break\" || record.type === \"continue\") {\n t.assertLiteral(record.target);\n abruptArgs[1] = this.insertedLocs.has(record.target) ? record.target : t.cloneDeep(record.target);\n } else if (record.type === \"return\" || record.type === \"throw\") {\n if (record.value) {\n t.assertExpression(record.value);\n abruptArgs[1] = this.insertedLocs.has(record.value) ? record.value : t.cloneDeep(record.value);\n }\n }\n\n this.emit(t.returnStatement(t.callExpression(this.contextProperty(\"abrupt\"), abruptArgs)));\n};\n\nfunction isValidCompletion(record) {\n var type = record.type;\n\n if (type === \"normal\") {\n return !hasOwn.call(record, \"target\");\n }\n\n if (type === \"break\" || type === \"continue\") {\n return !hasOwn.call(record, \"value\") && util.getTypes().isLiteral(record.target);\n }\n\n if (type === \"return\" || type === \"throw\") {\n return hasOwn.call(record, \"value\") && !hasOwn.call(record, \"target\");\n }\n\n return false;\n} // Not all offsets into emitter.listing are potential jump targets. For\n// example, execution typically falls into the beginning of a try block\n// without jumping directly there. This method returns the current offset\n// without marking it, so that a switch case will not necessarily be\n// generated for this offset (I say \"not necessarily\" because the same\n// location might end up being marked in the process of emitting other\n// statements). There's no logical harm in marking such locations as jump\n// targets, but minimizing the number of switch cases keeps the generated\n// code shorter.\n\n\nEp.getUnmarkedCurrentLoc = function () {\n return util.getTypes().numericLiteral(this.listing.length);\n}; // The context.prev property takes the value of context.next whenever we\n// evaluate the switch statement discriminant, which is generally good\n// enough for tracking the last location we jumped to, but sometimes\n// context.prev needs to be more precise, such as when we fall\n// successfully out of a try block and into a finally block without\n// jumping. This method exists to update context.prev to the freshest\n// available location. If we were implementing a full interpreter, we\n// would know the location of the current instruction with complete\n// precision at all times, but we don't have that luxury here, as it would\n// be costly and verbose to set context.prev before every statement.\n\n\nEp.updateContextPrevLoc = function (loc) {\n var t = util.getTypes();\n\n if (loc) {\n t.assertLiteral(loc);\n\n if (loc.value === -1) {\n // If an uninitialized location literal was passed in, set its value\n // to the current this.listing.length.\n loc.value = this.listing.length;\n } else {\n // Otherwise assert that the location matches the current offset.\n _assert[\"default\"].strictEqual(loc.value, this.listing.length);\n }\n } else {\n loc = this.getUnmarkedCurrentLoc();\n } // Make sure context.prev is up to date in case we fell into this try\n // statement without jumping to it. TODO Consider avoiding this\n // assignment when we know control must have jumped here.\n\n\n this.emitAssign(this.contextProperty(\"prev\"), loc);\n};\n\nEp.explodeExpression = function (path, ignoreResult) {\n var t = util.getTypes();\n var expr = path.node;\n\n if (expr) {\n t.assertExpression(expr);\n } else {\n return expr;\n }\n\n var self = this;\n var result; // Used optionally by several cases below.\n\n var after;\n\n function finish(expr) {\n t.assertExpression(expr);\n\n if (ignoreResult) {\n self.emit(expr);\n } else {\n return expr;\n }\n } // If the expression does not contain a leap, then we either emit the\n // expression as a standalone statement or return it whole.\n\n\n if (!meta.containsLeap(expr)) {\n return finish(expr);\n } // If any child contains a leap (such as a yield or labeled continue or\n // break statement), then any sibling subexpressions will almost\n // certainly have to be exploded in order to maintain the order of their\n // side effects relative to the leaping child(ren).\n\n\n var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); // In order to save the rest of explodeExpression from a combinatorial\n // trainwreck of special cases, explodeViaTempVar is responsible for\n // deciding when a subexpression needs to be \"exploded,\" which is my\n // very technical term for emitting the subexpression as an assignment\n // to a temporary variable and the substituting the temporary variable\n // for the original subexpression. Think of exploded view diagrams, not\n // Michael Bay movies. The point of exploding subexpressions is to\n // control the precise order in which the generated code realizes the\n // side effects of those subexpressions.\n\n function explodeViaTempVar(tempVar, childPath, ignoreChildResult) {\n _assert[\"default\"].ok(!ignoreChildResult || !tempVar, \"Ignoring the result of a child expression but forcing it to \" + \"be assigned to a temporary variable?\");\n\n var result = self.explodeExpression(childPath, ignoreChildResult);\n\n if (ignoreChildResult) {// Side effects already emitted above.\n } else if (tempVar || hasLeapingChildren && !t.isLiteral(result)) {\n // If tempVar was provided, then the result will always be assigned\n // to it, even if the result does not otherwise need to be assigned\n // to a temporary variable. When no tempVar is provided, we have\n // the flexibility to decide whether a temporary variable is really\n // necessary. Unfortunately, in general, a temporary variable is\n // required whenever any child contains a yield expression, since it\n // is difficult to prove (at all, let alone efficiently) whether\n // this result would evaluate to the same value before and after the\n // yield (see #206). One narrow case where we can prove it doesn't\n // matter (and thus we do not need a temporary variable) is when the\n // result in question is a Literal value.\n result = self.emitAssign(tempVar || self.makeTempVar(), result);\n }\n\n return result;\n } // If ignoreResult is true, then we must take full responsibility for\n // emitting the expression with all its side effects, and we should not\n // return a result.\n\n\n switch (expr.type) {\n case \"MemberExpression\":\n return finish(t.memberExpression(self.explodeExpression(path.get(\"object\")), expr.computed ? explodeViaTempVar(null, path.get(\"property\")) : expr.property, expr.computed));\n\n case \"CallExpression\":\n var calleePath = path.get(\"callee\");\n var argsPath = path.get(\"arguments\");\n var newCallee;\n var newArgs = [];\n var hasLeapingArgs = false;\n argsPath.forEach(function (argPath) {\n hasLeapingArgs = hasLeapingArgs || meta.containsLeap(argPath.node);\n });\n\n if (t.isMemberExpression(calleePath.node)) {\n if (hasLeapingArgs) {\n // If the arguments of the CallExpression contained any yield\n // expressions, then we need to be sure to evaluate the callee\n // before evaluating the arguments, but if the callee was a member\n // expression, then we must be careful that the object of the\n // member expression still gets bound to `this` for the call.\n var newObject = explodeViaTempVar( // Assign the exploded callee.object expression to a temporary\n // variable so that we can use it twice without reevaluating it.\n self.makeTempVar(), calleePath.get(\"object\"));\n var newProperty = calleePath.node.computed ? explodeViaTempVar(null, calleePath.get(\"property\")) : calleePath.node.property;\n newArgs.unshift(newObject);\n newCallee = t.memberExpression(t.memberExpression(t.cloneDeep(newObject), newProperty, calleePath.node.computed), t.identifier(\"call\"), false);\n } else {\n newCallee = self.explodeExpression(calleePath);\n }\n } else {\n newCallee = explodeViaTempVar(null, calleePath);\n\n if (t.isMemberExpression(newCallee)) {\n // If the callee was not previously a MemberExpression, then the\n // CallExpression was \"unqualified,\" meaning its `this` object\n // should be the global object. If the exploded expression has\n // become a MemberExpression (e.g. a context property, probably a\n // temporary variable), then we need to force it to be unqualified\n // by using the (0, object.property)(...) trick; otherwise, it\n // will receive the object of the MemberExpression as its `this`\n // object.\n newCallee = t.sequenceExpression([t.numericLiteral(0), t.cloneDeep(newCallee)]);\n }\n }\n\n argsPath.forEach(function (argPath) {\n newArgs.push(explodeViaTempVar(null, argPath));\n });\n return finish(t.callExpression(newCallee, newArgs.map(function (arg) {\n return t.cloneDeep(arg);\n })));\n\n case \"NewExpression\":\n return finish(t.newExpression(explodeViaTempVar(null, path.get(\"callee\")), path.get(\"arguments\").map(function (argPath) {\n return explodeViaTempVar(null, argPath);\n })));\n\n case \"ObjectExpression\":\n return finish(t.objectExpression(path.get(\"properties\").map(function (propPath) {\n if (propPath.isObjectProperty()) {\n return t.objectProperty(propPath.node.key, explodeViaTempVar(null, propPath.get(\"value\")), propPath.node.computed);\n } else {\n return propPath.node;\n }\n })));\n\n case \"ArrayExpression\":\n return finish(t.arrayExpression(path.get(\"elements\").map(function (elemPath) {\n return explodeViaTempVar(null, elemPath);\n })));\n\n case \"SequenceExpression\":\n var lastIndex = expr.expressions.length - 1;\n path.get(\"expressions\").forEach(function (exprPath) {\n if (exprPath.key === lastIndex) {\n result = self.explodeExpression(exprPath, ignoreResult);\n } else {\n self.explodeExpression(exprPath, true);\n }\n });\n return result;\n\n case \"LogicalExpression\":\n after = this.loc();\n\n if (!ignoreResult) {\n result = self.makeTempVar();\n }\n\n var left = explodeViaTempVar(result, path.get(\"left\"));\n\n if (expr.operator === \"&&\") {\n self.jumpIfNot(left, after);\n } else {\n _assert[\"default\"].strictEqual(expr.operator, \"||\");\n\n self.jumpIf(left, after);\n }\n\n explodeViaTempVar(result, path.get(\"right\"), ignoreResult);\n self.mark(after);\n return result;\n\n case \"ConditionalExpression\":\n var elseLoc = this.loc();\n after = this.loc();\n var test = self.explodeExpression(path.get(\"test\"));\n self.jumpIfNot(test, elseLoc);\n\n if (!ignoreResult) {\n result = self.makeTempVar();\n }\n\n explodeViaTempVar(result, path.get(\"consequent\"), ignoreResult);\n self.jump(after);\n self.mark(elseLoc);\n explodeViaTempVar(result, path.get(\"alternate\"), ignoreResult);\n self.mark(after);\n return result;\n\n case \"UnaryExpression\":\n return finish(t.unaryExpression(expr.operator, // Can't (and don't need to) break up the syntax of the argument.\n // Think about delete a[b].\n self.explodeExpression(path.get(\"argument\")), !!expr.prefix));\n\n case \"BinaryExpression\":\n return finish(t.binaryExpression(expr.operator, explodeViaTempVar(null, path.get(\"left\")), explodeViaTempVar(null, path.get(\"right\"))));\n\n case \"AssignmentExpression\":\n if (expr.operator === \"=\") {\n // If this is a simple assignment, the left hand side does not need\n // to be read before the right hand side is evaluated, so we can\n // avoid the more complicated logic below.\n return finish(t.assignmentExpression(expr.operator, self.explodeExpression(path.get(\"left\")), self.explodeExpression(path.get(\"right\"))));\n }\n\n var lhs = self.explodeExpression(path.get(\"left\"));\n var temp = self.emitAssign(self.makeTempVar(), lhs); // For example,\n //\n // x += yield y\n //\n // becomes\n //\n // context.t0 = x\n // x = context.t0 += yield y\n //\n // so that the left-hand side expression is read before the yield.\n // Fixes https://github.com/facebook/regenerator/issues/345.\n\n return finish(t.assignmentExpression(\"=\", t.cloneDeep(lhs), t.assignmentExpression(expr.operator, t.cloneDeep(temp), self.explodeExpression(path.get(\"right\")))));\n\n case \"UpdateExpression\":\n return finish(t.updateExpression(expr.operator, self.explodeExpression(path.get(\"argument\")), expr.prefix));\n\n case \"YieldExpression\":\n after = this.loc();\n var arg = expr.argument && self.explodeExpression(path.get(\"argument\"));\n\n if (arg && expr.delegate) {\n var _result = self.makeTempVar();\n\n var _ret = t.returnStatement(t.callExpression(self.contextProperty(\"delegateYield\"), [arg, t.stringLiteral(_result.property.name), after]));\n\n _ret.loc = expr.loc;\n self.emit(_ret);\n self.mark(after);\n return _result;\n }\n\n self.emitAssign(self.contextProperty(\"next\"), after);\n var ret = t.returnStatement(t.cloneDeep(arg) || null); // Preserve the `yield` location so that source mappings for the statements\n // link back to the yield properly.\n\n ret.loc = expr.loc;\n self.emit(ret);\n self.mark(after);\n return self.contextProperty(\"sent\");\n\n default:\n throw new Error(\"unknown Expression of type \" + JSON.stringify(expr.type));\n }\n};","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = replaceShorthandObjectMethod;\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n// this function converts a shorthand object generator method into a normal\n// (non-shorthand) object property which is a generator function expression. for\n// example, this:\n//\n// var foo = {\n// *bar(baz) { return 5; }\n// }\n//\n// should be replaced with:\n//\n// var foo = {\n// bar: function*(baz) { return 5; }\n// }\n//\n// to do this, it clones the parameter array and the body of the object generator\n// method into a new FunctionExpression.\n//\n// this method can be passed any Function AST node path, and it will return\n// either:\n// a) the path that was passed in (iff the path did not need to be replaced) or\n// b) the path of the new FunctionExpression that was created as a replacement\n// (iff the path did need to be replaced)\n//\n// In either case, though, the caller can count on the fact that the return value\n// is a Function AST node path.\n//\n// If this function is called with an AST node path that is not a Function (or with an\n// argument that isn't an AST node path), it will throw an error.\nfunction replaceShorthandObjectMethod(path) {\n var t = util.getTypes();\n\n if (!path.node || !t.isFunction(path.node)) {\n throw new Error(\"replaceShorthandObjectMethod can only be called on Function AST node paths.\");\n } // this function only replaces shorthand object methods (called ObjectMethod\n // in Babel-speak).\n\n\n if (!t.isObjectMethod(path.node)) {\n return path;\n } // this function only replaces generators.\n\n\n if (!path.node.generator) {\n return path;\n }\n\n var parameters = path.node.params.map(function (param) {\n return t.cloneDeep(param);\n });\n var functionExpression = t.functionExpression(null, // id\n parameters, // params\n t.cloneDeep(path.node.body), // body\n path.node.generator, path.node.async);\n util.replaceWithOrRemove(path, t.objectProperty(t.cloneDeep(path.node.key), // key\n functionExpression, //value\n path.node.computed, // computed\n false // shorthand\n )); // path now refers to the ObjectProperty AST node path, but we want to return a\n // Function AST node path for the function expression we created. we know that\n // the FunctionExpression we just created is the value of the ObjectProperty,\n // so return the \"value\" path off of this path.\n\n return path.get(\"value\");\n}","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\"use strict\";\n\nvar _assert = _interopRequireDefault(require(\"assert\"));\n\nvar _hoist = require(\"./hoist\");\n\nvar _emit = require(\"./emit\");\n\nvar _replaceShorthandObjectMethod = _interopRequireDefault(require(\"./replaceShorthandObjectMethod\"));\n\nvar util = _interopRequireWildcard(require(\"./util\"));\n\nvar _private = require(\"private\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj[\"default\"] = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nexports.getVisitor = function (_ref) {\n var t = _ref.types;\n return {\n Method: function Method(path, state) {\n var node = path.node;\n if (!shouldRegenerate(node, state)) return;\n var container = t.functionExpression(null, [], t.cloneNode(node.body, false), node.generator, node.async);\n path.get(\"body\").set(\"body\", [t.returnStatement(t.callExpression(container, []))]); // Regardless of whether or not the wrapped function is a an async method\n // or generator the outer function should not be\n\n node.async = false;\n node.generator = false; // Unwrap the wrapper IIFE's environment so super and this and such still work.\n\n path.get(\"body.body.0.argument.callee\").unwrapFunctionEnvironment();\n },\n Function: {\n exit: util.wrapWithTypes(t, function (path, state) {\n var node = path.node;\n if (!shouldRegenerate(node, state)) return; // if this is an ObjectMethod, we need to convert it to an ObjectProperty\n\n path = (0, _replaceShorthandObjectMethod[\"default\"])(path);\n node = path.node;\n var contextId = path.scope.generateUidIdentifier(\"context\");\n var argsId = path.scope.generateUidIdentifier(\"args\");\n path.ensureBlock();\n var bodyBlockPath = path.get(\"body\");\n\n if (node.async) {\n bodyBlockPath.traverse(awaitVisitor);\n }\n\n bodyBlockPath.traverse(functionSentVisitor, {\n context: contextId\n });\n var outerBody = [];\n var innerBody = [];\n bodyBlockPath.get(\"body\").forEach(function (childPath) {\n var node = childPath.node;\n\n if (t.isExpressionStatement(node) && t.isStringLiteral(node.expression)) {\n // Babylon represents directives like \"use strict\" as elements\n // of a bodyBlockPath.node.directives array, but they could just\n // as easily be represented (by other parsers) as traditional\n // string-literal-valued expression statements, so we need to\n // handle that here. (#248)\n outerBody.push(node);\n } else if (node && node._blockHoist != null) {\n outerBody.push(node);\n } else {\n innerBody.push(node);\n }\n });\n\n if (outerBody.length > 0) {\n // Only replace the inner body if we actually hoisted any statements\n // to the outer body.\n bodyBlockPath.node.body = innerBody;\n }\n\n var outerFnExpr = getOuterFnExpr(path); // Note that getOuterFnExpr has the side-effect of ensuring that the\n // function has a name (so node.id will always be an Identifier), even\n // if a temporary name has to be synthesized.\n\n t.assertIdentifier(node.id);\n var innerFnId = t.identifier(node.id.name + \"$\"); // Turn all declarations into vars, and replace the original\n // declarations with equivalent assignment expressions.\n\n var vars = (0, _hoist.hoist)(path);\n var context = {\n usesThis: false,\n usesArguments: false,\n getArgsId: function getArgsId() {\n return t.clone(argsId);\n }\n };\n path.traverse(argumentsThisVisitor, context);\n\n if (context.usesArguments) {\n vars = vars || t.variableDeclaration(\"var\", []);\n var argumentIdentifier = t.identifier(\"arguments\"); // we need to do this as otherwise arguments in arrow functions gets hoisted\n\n argumentIdentifier._shadowedFunctionLiteral = path;\n vars.declarations.push(t.variableDeclarator(t.clone(argsId), argumentIdentifier));\n }\n\n var emitter = new _emit.Emitter(contextId);\n emitter.explode(path.get(\"body\"));\n\n if (vars && vars.declarations.length > 0) {\n outerBody.push(vars);\n }\n\n var wrapArgs = [emitter.getContextFunction(innerFnId)];\n var tryLocsList = emitter.getTryLocsList();\n\n if (node.generator) {\n wrapArgs.push(outerFnExpr);\n } else if (context.usesThis || tryLocsList) {\n // Async functions that are not generators don't care about the\n // outer function because they don't need it to be marked and don't\n // inherit from its .prototype.\n wrapArgs.push(t.nullLiteral());\n }\n\n if (context.usesThis) {\n wrapArgs.push(t.thisExpression());\n } else if (tryLocsList) {\n wrapArgs.push(t.nullLiteral());\n }\n\n if (tryLocsList) {\n wrapArgs.push(tryLocsList);\n }\n\n var wrapCall = t.callExpression(util.runtimeProperty(node.async ? \"async\" : \"wrap\"), wrapArgs);\n outerBody.push(t.returnStatement(wrapCall));\n node.body = t.blockStatement(outerBody); // We injected a few new variable declarations (for every hoisted var),\n // so we need to add them to the scope.\n\n path.get(\"body.body\").forEach(function (p) {\n return p.scope.registerDeclaration(p);\n });\n var oldDirectives = bodyBlockPath.node.directives;\n\n if (oldDirectives) {\n // Babylon represents directives like \"use strict\" as elements of\n // a bodyBlockPath.node.directives array. (#248)\n node.body.directives = oldDirectives;\n }\n\n var wasGeneratorFunction = node.generator;\n\n if (wasGeneratorFunction) {\n node.generator = false;\n }\n\n if (node.async) {\n node.async = false;\n }\n\n if (wasGeneratorFunction && t.isExpression(node)) {\n util.replaceWithOrRemove(path, t.callExpression(util.runtimeProperty(\"mark\"), [node]));\n path.addComment(\"leading\", \"#__PURE__\");\n }\n\n var insertedLocs = emitter.getInsertedLocs();\n path.traverse({\n NumericLiteral: function NumericLiteral(path) {\n if (!insertedLocs.has(path.node)) {\n return;\n }\n\n path.replaceWith(t.numericLiteral(path.node.value));\n }\n }); // Generators are processed in 'exit' handlers so that regenerator only has to run on\n // an ES5 AST, but that means traversal will not pick up newly inserted references\n // to things like 'regeneratorRuntime'. To avoid this, we explicitly requeue.\n\n path.requeue();\n })\n }\n };\n}; // Check if a node should be transformed by regenerator\n\n\nfunction shouldRegenerate(node, state) {\n if (node.generator) {\n if (node.async) {\n // Async generator\n return state.opts.asyncGenerators !== false;\n } else {\n // Plain generator\n return state.opts.generators !== false;\n }\n } else if (node.async) {\n // Async function\n return state.opts.async !== false;\n } else {\n // Not a generator or async function.\n return false;\n }\n} // Given a NodePath for a Function, return an Expression node that can be\n// used to refer reliably to the function object from inside the function.\n// This expression is essentially a replacement for arguments.callee, with\n// the key advantage that it works in strict mode.\n\n\nfunction getOuterFnExpr(funPath) {\n var t = util.getTypes();\n var node = funPath.node;\n t.assertFunction(node);\n\n if (!node.id) {\n // Default-exported function declarations, and function expressions may not\n // have a name to reference, so we explicitly add one.\n node.id = funPath.scope.parent.generateUidIdentifier(\"callee\");\n }\n\n if (node.generator && // Non-generator functions don't need to be marked.\n t.isFunctionDeclaration(node)) {\n // Return the identifier returned by runtime.mark().\n return getMarkedFunctionId(funPath);\n }\n\n return t.clone(node.id);\n}\n\nvar getMarkInfo = (0, _private.makeAccessor)();\n\nfunction getMarkedFunctionId(funPath) {\n var t = util.getTypes();\n var node = funPath.node;\n t.assertIdentifier(node.id);\n var blockPath = funPath.findParent(function (path) {\n return path.isProgram() || path.isBlockStatement();\n });\n\n if (!blockPath) {\n return node.id;\n }\n\n var block = blockPath.node;\n\n _assert[\"default\"].ok(Array.isArray(block.body));\n\n var info = getMarkInfo(block);\n\n if (!info.decl) {\n info.decl = t.variableDeclaration(\"var\", []);\n blockPath.unshiftContainer(\"body\", info.decl);\n info.declPath = blockPath.get(\"body.0\");\n }\n\n _assert[\"default\"].strictEqual(info.declPath.node, info.decl); // Get a new unique identifier for our marked variable.\n\n\n var markedId = blockPath.scope.generateUidIdentifier(\"marked\");\n var markCallExp = t.callExpression(util.runtimeProperty(\"mark\"), [t.clone(node.id)]);\n var index = info.decl.declarations.push(t.variableDeclarator(markedId, markCallExp)) - 1;\n var markCallExpPath = info.declPath.get(\"declarations.\" + index + \".init\");\n\n _assert[\"default\"].strictEqual(markCallExpPath.node, markCallExp);\n\n markCallExpPath.addComment(\"leading\", \"#__PURE__\");\n return t.clone(markedId);\n}\n\nvar argumentsThisVisitor = {\n \"FunctionExpression|FunctionDeclaration|Method\": function FunctionExpressionFunctionDeclarationMethod(path) {\n path.skip();\n },\n Identifier: function Identifier(path, state) {\n if (path.node.name === \"arguments\" && util.isReference(path)) {\n util.replaceWithOrRemove(path, state.getArgsId());\n state.usesArguments = true;\n }\n },\n ThisExpression: function ThisExpression(path, state) {\n state.usesThis = true;\n }\n};\nvar functionSentVisitor = {\n MetaProperty: function MetaProperty(path) {\n var node = path.node;\n\n if (node.meta.name === \"function\" && node.property.name === \"sent\") {\n var t = util.getTypes();\n util.replaceWithOrRemove(path, t.memberExpression(t.clone(this.context), t.identifier(\"_sent\")));\n }\n }\n};\nvar awaitVisitor = {\n Function: function Function(path) {\n path.skip(); // Don't descend into nested function scopes.\n },\n AwaitExpression: function AwaitExpression(path) {\n var t = util.getTypes(); // Convert await expressions to yield expressions.\n\n var argument = path.node.argument; // Transforming `await x` to `yield regeneratorRuntime.awrap(x)`\n // causes the argument to be wrapped in such a way that the runtime\n // can distinguish between awaited and merely yielded values.\n\n util.replaceWithOrRemove(path, t.yieldExpression(t.callExpression(util.runtimeProperty(\"awrap\"), [argument]), false));\n }\n};","\"use strict\";\n\nexports.__esModule = true;\nexports[\"default\"] = _default;\n\nvar _visit = require(\"./visit\");\n\n/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nfunction _default(context) {\n var plugin = {\n visitor: (0, _visit.getVisitor)(context)\n }; // Some presets manually call child presets, but fail to pass along the\n // context object. Out of an abundance of caution, we verify that it\n // exists first to avoid causing unnecessary breaking changes.\n\n var version = context && context.version; // The \"name\" property is not allowed in older versions of Babel (6.x)\n // and will cause the plugin validator to throw an exception.\n\n if (version && parseInt(version, 10) >= 7) {\n plugin.name = \"regenerator-transform\";\n }\n\n return plugin;\n}","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-reserved-words\",\n\n visitor: {\n \"BindingIdentifier|ReferencedIdentifier\"(path) {\n if (!t.isValidES3Identifier(path.node.name)) {\n path.scope.rename(path.node.name);\n }\n },\n },\n };\n});\n","module.exports = function () {\n // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi\n var origPrepareStackTrace = Error.prepareStackTrace;\n Error.prepareStackTrace = function (_, stack) { return stack; };\n var stack = (new Error()).stack;\n Error.prepareStackTrace = origPrepareStackTrace;\n return stack[2].getFileName();\n};\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into three parts: [*, device, slash,\n// tail] windows-only\nvar splitDeviceRe =\n /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\n// Regex to split the tail part of the above into [*, dir, basename, ext]\nvar splitTailRe =\n /^([\\s\\S]*?)((?:\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))(?:[\\\\\\/]*)$/;\n\nvar win32 = {};\n\n// Function to split a filename into [root, dir, basename, ext]\nfunction win32SplitPath(filename) {\n // Separate device+slash from tail\n var result = splitDeviceRe.exec(filename),\n device = (result[1] || '') + (result[2] || ''),\n tail = result[3] || '';\n // Split the tail into dir, basename and extension\n var result2 = splitTailRe.exec(tail),\n dir = result2[1],\n basename = result2[2],\n ext = result2[3];\n return [device, dir, basename, ext];\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 4) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n};\n\n\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 4) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n allParts[1] = allParts[1] || '';\n allParts[2] = allParts[2] || '';\n allParts[3] = allParts[3] || '';\n\n return {\n root: allParts[0],\n dir: allParts[0] + allParts[1].slice(0, -1),\n base: allParts[2],\n ext: allParts[3],\n name: allParts[2].slice(0, allParts[2].length - allParts[3].length)\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","var path = require('path');\nvar parse = path.parse || require('path-parse');\n\nvar getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {\n var prefix = '/';\n if ((/^([A-Za-z]:)/).test(absoluteStart)) {\n prefix = '';\n } else if ((/^\\\\\\\\/).test(absoluteStart)) {\n prefix = '\\\\\\\\';\n }\n\n var paths = [absoluteStart];\n var parsed = parse(absoluteStart);\n while (parsed.dir !== paths[paths.length - 1]) {\n paths.push(parsed.dir);\n parsed = parse(parsed.dir);\n }\n\n return paths.reduce(function (dirs, aPath) {\n return dirs.concat(modules.map(function (moduleDir) {\n return path.resolve(prefix, aPath, moduleDir);\n }));\n }, []);\n};\n\nmodule.exports = function nodeModulesPaths(start, opts, request) {\n var modules = opts && opts.moduleDirectory\n ? [].concat(opts.moduleDirectory)\n : ['node_modules'];\n\n if (opts && typeof opts.paths === 'function') {\n return opts.paths(\n request,\n start,\n function () { return getNodeModulesDirs(start, modules); },\n opts\n );\n }\n\n var dirs = getNodeModulesDirs(start, modules);\n return opts && opts.paths ? dirs.concat(opts.paths) : dirs;\n};\n","module.exports = function (x, opts) {\n /**\n * This file is purposefully a passthrough. It's expected that third-party\n * environments will override it at runtime in order to inject special logic\n * into `resolve` (by manipulating the options). One such example is the PnP\n * code path in Yarn.\n */\n\n return opts || {};\n};\n","var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];\n\nfunction specifierIncluded(specifier) {\n var parts = specifier.split(' ');\n var op = parts.length > 1 ? parts[0] : '=';\n var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');\n\n for (var i = 0; i < 3; ++i) {\n var cur = Number(current[i] || 0);\n var ver = Number(versionParts[i] || 0);\n if (cur === ver) {\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n }\n if (op === '<') {\n return cur < ver;\n } else if (op === '>=') {\n return cur >= ver;\n } else {\n return false;\n }\n }\n return op === '>=';\n}\n\nfunction matchesRange(range) {\n var specifiers = range.split(/ ?&& ?/);\n if (specifiers.length === 0) { return false; }\n for (var i = 0; i < specifiers.length; ++i) {\n if (!specifierIncluded(specifiers[i])) { return false; }\n }\n return true;\n}\n\nfunction versionIncluded(specifierValue) {\n if (typeof specifierValue === 'boolean') { return specifierValue; }\n if (specifierValue && typeof specifierValue === 'object') {\n for (var i = 0; i < specifierValue.length; ++i) {\n if (matchesRange(specifierValue[i])) { return true; }\n }\n return false;\n }\n return matchesRange(specifierValue);\n}\n\nvar data = require('./core.json');\n\nvar core = {};\nfor (var mod in data) { // eslint-disable-line no-restricted-syntax\n if (Object.prototype.hasOwnProperty.call(data, mod)) {\n core[mod] = versionIncluded(data[mod]);\n }\n}\nmodule.exports = core;\n","var core = require('./core');\n\nmodule.exports = function isCore(x) {\n return Object.prototype.hasOwnProperty.call(core, x);\n};\n","var fs = require('fs');\nvar path = require('path');\nvar caller = require('./caller.js');\nvar nodeModulesPaths = require('./node-modules-paths.js');\nvar normalizeOptions = require('./normalize-options.js');\nvar isCore = require('./is-core');\n\nvar defaultIsFile = function isFile(file, cb) {\n fs.stat(file, function (err, stat) {\n if (!err) {\n return cb(null, stat.isFile() || stat.isFIFO());\n }\n if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n return cb(err);\n });\n};\n\nvar defaultIsDir = function isDirectory(dir, cb) {\n fs.stat(dir, function (err, stat) {\n if (!err) {\n return cb(null, stat.isDirectory());\n }\n if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);\n return cb(err);\n });\n};\n\nvar maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts, cb) {\n if (opts && opts.preserveSymlinks === false) {\n fs.realpath(x, function (realPathErr, realPath) {\n if (realPathErr && realPathErr.code !== 'ENOENT') cb(realPathErr);\n else cb(null, realPathErr ? x : realPath);\n });\n } else {\n cb(null, x);\n }\n};\n\nmodule.exports = function resolve(x, options, callback) {\n var cb = callback;\n var opts = options;\n if (typeof options === 'function') {\n cb = opts;\n opts = {};\n }\n if (typeof x !== 'string') {\n var err = new TypeError('Path must be a string.');\n return process.nextTick(function () {\n cb(err);\n });\n }\n\n opts = normalizeOptions(x, opts);\n\n var isFile = opts.isFile || defaultIsFile;\n var isDirectory = opts.isDirectory || defaultIsDir;\n var readFile = opts.readFile || fs.readFile;\n\n var extensions = opts.extensions || ['.js'];\n var basedir = opts.basedir || path.dirname(caller());\n var parent = opts.filename || basedir;\n\n opts.paths = opts.paths || [];\n\n // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory\n var absoluteStart = path.resolve(basedir);\n\n maybeUnwrapSymlink(\n absoluteStart,\n opts,\n function (err, realStart) {\n if (err) cb(err);\n else init(realStart);\n }\n );\n\n var res;\n function init(basedir) {\n if ((/^(?:\\.\\.?(?:\\/|$)|\\/|([A-Za-z]:)?[/\\\\])/).test(x)) {\n res = path.resolve(basedir, x);\n if (x === '..' || x.slice(-1) === '/') res += '/';\n if ((/\\/$/).test(x) && res === basedir) {\n loadAsDirectory(res, opts.package, onfile);\n } else loadAsFile(res, opts.package, onfile);\n } else if (isCore(x)) {\n return cb(null, x);\n } else loadNodeModules(x, basedir, function (err, n, pkg) {\n if (err) cb(err);\n else if (n) {\n return maybeUnwrapSymlink(n, opts, function (err, realN) {\n if (err) {\n cb(err);\n } else {\n cb(null, realN, pkg);\n }\n });\n } else {\n var moduleError = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n moduleError.code = 'MODULE_NOT_FOUND';\n cb(moduleError);\n }\n });\n }\n\n function onfile(err, m, pkg) {\n if (err) cb(err);\n else if (m) cb(null, m, pkg);\n else loadAsDirectory(res, function (err, d, pkg) {\n if (err) cb(err);\n else if (d) {\n maybeUnwrapSymlink(d, opts, function (err, realD) {\n if (err) {\n cb(err);\n } else {\n cb(null, realD, pkg);\n }\n });\n } else {\n var moduleError = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n moduleError.code = 'MODULE_NOT_FOUND';\n cb(moduleError);\n }\n });\n }\n\n function loadAsFile(x, thePackage, callback) {\n var loadAsFilePackage = thePackage;\n var cb = callback;\n if (typeof loadAsFilePackage === 'function') {\n cb = loadAsFilePackage;\n loadAsFilePackage = undefined;\n }\n\n var exts = [''].concat(extensions);\n load(exts, x, loadAsFilePackage);\n\n function load(exts, x, loadPackage) {\n if (exts.length === 0) return cb(null, undefined, loadPackage);\n var file = x + exts[0];\n\n var pkg = loadPackage;\n if (pkg) onpkg(null, pkg);\n else loadpkg(path.dirname(file), onpkg);\n\n function onpkg(err, pkg_, dir) {\n pkg = pkg_;\n if (err) return cb(err);\n if (dir && pkg && opts.pathFilter) {\n var rfile = path.relative(dir, file);\n var rel = rfile.slice(0, rfile.length - exts[0].length);\n var r = opts.pathFilter(pkg, x, rel);\n if (r) return load(\n [''].concat(extensions.slice()),\n path.resolve(dir, r),\n pkg\n );\n }\n isFile(file, onex);\n }\n function onex(err, ex) {\n if (err) return cb(err);\n if (ex) return cb(null, file, pkg);\n load(exts.slice(1), x, pkg);\n }\n }\n }\n\n function loadpkg(dir, cb) {\n if (dir === '' || dir === '/') return cb(null);\n if (process.platform === 'win32' && (/^\\w:[/\\\\]*$/).test(dir)) {\n return cb(null);\n }\n if ((/[/\\\\]node_modules[/\\\\]*$/).test(dir)) return cb(null);\n\n maybeUnwrapSymlink(dir, opts, function (unwrapErr, pkgdir) {\n if (unwrapErr) return loadpkg(path.dirname(dir), cb);\n var pkgfile = path.join(pkgdir, 'package.json');\n isFile(pkgfile, function (err, ex) {\n // on err, ex is false\n if (!ex) return loadpkg(path.dirname(dir), cb);\n\n readFile(pkgfile, function (err, body) {\n if (err) cb(err);\n try { var pkg = JSON.parse(body); } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n pkg = opts.packageFilter(pkg, pkgfile);\n }\n cb(null, pkg, dir);\n });\n });\n });\n }\n\n function loadAsDirectory(x, loadAsDirectoryPackage, callback) {\n var cb = callback;\n var fpkg = loadAsDirectoryPackage;\n if (typeof fpkg === 'function') {\n cb = fpkg;\n fpkg = opts.package;\n }\n\n maybeUnwrapSymlink(x, opts, function (unwrapErr, pkgdir) {\n if (unwrapErr) return cb(unwrapErr);\n var pkgfile = path.join(pkgdir, 'package.json');\n isFile(pkgfile, function (err, ex) {\n if (err) return cb(err);\n if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);\n\n readFile(pkgfile, function (err, body) {\n if (err) return cb(err);\n try {\n var pkg = JSON.parse(body);\n } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n pkg = opts.packageFilter(pkg, pkgfile);\n }\n\n if (pkg && pkg.main) {\n if (typeof pkg.main !== 'string') {\n var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');\n mainError.code = 'INVALID_PACKAGE_MAIN';\n return cb(mainError);\n }\n if (pkg.main === '.' || pkg.main === './') {\n pkg.main = 'index';\n }\n loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {\n if (err) return cb(err);\n if (m) return cb(null, m, pkg);\n if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);\n\n var dir = path.resolve(x, pkg.main);\n loadAsDirectory(dir, pkg, function (err, n, pkg) {\n if (err) return cb(err);\n if (n) return cb(null, n, pkg);\n loadAsFile(path.join(x, 'index'), pkg, cb);\n });\n });\n return;\n }\n\n loadAsFile(path.join(x, '/index'), pkg, cb);\n });\n });\n });\n }\n\n function processDirs(cb, dirs) {\n if (dirs.length === 0) return cb(null, undefined);\n var dir = dirs[0];\n\n isDirectory(dir, isdir);\n\n function isdir(err, isdir) {\n if (err) return cb(err);\n if (!isdir) return processDirs(cb, dirs.slice(1));\n var file = path.join(dir, x);\n loadAsFile(file, opts.package, onfile);\n }\n\n function onfile(err, m, pkg) {\n if (err) return cb(err);\n if (m) return cb(null, m, pkg);\n loadAsDirectory(path.join(dir, x), opts.package, ondir);\n }\n\n function ondir(err, n, pkg) {\n if (err) return cb(err);\n if (n) return cb(null, n, pkg);\n processDirs(cb, dirs.slice(1));\n }\n }\n function loadNodeModules(x, start, cb) {\n processDirs(cb, nodeModulesPaths(start, opts, x));\n }\n};\n","var isCore = require('./is-core');\nvar fs = require('fs');\nvar path = require('path');\nvar caller = require('./caller.js');\nvar nodeModulesPaths = require('./node-modules-paths.js');\nvar normalizeOptions = require('./normalize-options.js');\n\nvar defaultIsFile = function isFile(file) {\n try {\n var stat = fs.statSync(file);\n } catch (e) {\n if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n throw e;\n }\n return stat.isFile() || stat.isFIFO();\n};\n\nvar defaultIsDir = function isDirectory(dir) {\n try {\n var stat = fs.statSync(dir);\n } catch (e) {\n if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;\n throw e;\n }\n return stat.isDirectory();\n};\n\nvar maybeUnwrapSymlink = function maybeUnwrapSymlink(x, opts) {\n if (opts && opts.preserveSymlinks === false) {\n try {\n return fs.realpathSync(x);\n } catch (realPathErr) {\n if (realPathErr.code !== 'ENOENT') {\n throw realPathErr;\n }\n }\n }\n return x;\n};\n\nmodule.exports = function (x, options) {\n if (typeof x !== 'string') {\n throw new TypeError('Path must be a string.');\n }\n var opts = normalizeOptions(x, options);\n\n var isFile = opts.isFile || defaultIsFile;\n var readFileSync = opts.readFileSync || fs.readFileSync;\n var isDirectory = opts.isDirectory || defaultIsDir;\n\n var extensions = opts.extensions || ['.js'];\n var basedir = opts.basedir || path.dirname(caller());\n var parent = opts.filename || basedir;\n\n opts.paths = opts.paths || [];\n\n // ensure that `basedir` is an absolute path at this point, resolving against the process' current working directory\n var absoluteStart = maybeUnwrapSymlink(path.resolve(basedir), opts);\n\n if ((/^(?:\\.\\.?(?:\\/|$)|\\/|([A-Za-z]:)?[/\\\\])/).test(x)) {\n var res = path.resolve(absoluteStart, x);\n if (x === '..' || x.slice(-1) === '/') res += '/';\n var m = loadAsFileSync(res) || loadAsDirectorySync(res);\n if (m) return maybeUnwrapSymlink(m, opts);\n } else if (isCore(x)) {\n return x;\n } else {\n var n = loadNodeModulesSync(x, absoluteStart);\n if (n) return maybeUnwrapSymlink(n, opts);\n }\n\n var err = new Error(\"Cannot find module '\" + x + \"' from '\" + parent + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n\n function loadAsFileSync(x) {\n var pkg = loadpkg(path.dirname(x));\n\n if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {\n var rfile = path.relative(pkg.dir, x);\n var r = opts.pathFilter(pkg.pkg, x, rfile);\n if (r) {\n x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign\n }\n }\n\n if (isFile(x)) {\n return x;\n }\n\n for (var i = 0; i < extensions.length; i++) {\n var file = x + extensions[i];\n if (isFile(file)) {\n return file;\n }\n }\n }\n\n function loadpkg(dir) {\n if (dir === '' || dir === '/') return;\n if (process.platform === 'win32' && (/^\\w:[/\\\\]*$/).test(dir)) {\n return;\n }\n if ((/[/\\\\]node_modules[/\\\\]*$/).test(dir)) return;\n\n var pkgfile = path.join(maybeUnwrapSymlink(dir, opts), 'package.json');\n\n if (!isFile(pkgfile)) {\n return loadpkg(path.dirname(dir));\n }\n\n var body = readFileSync(pkgfile);\n\n try {\n var pkg = JSON.parse(body);\n } catch (jsonErr) {}\n\n if (pkg && opts.packageFilter) {\n // v2 will pass pkgfile\n pkg = opts.packageFilter(pkg, /*pkgfile,*/ dir); // eslint-disable-line spaced-comment\n }\n\n return { pkg: pkg, dir: dir };\n }\n\n function loadAsDirectorySync(x) {\n var pkgfile = path.join(maybeUnwrapSymlink(x, opts), '/package.json');\n if (isFile(pkgfile)) {\n try {\n var body = readFileSync(pkgfile, 'UTF8');\n var pkg = JSON.parse(body);\n } catch (e) {}\n\n if (pkg && opts.packageFilter) {\n // v2 will pass pkgfile\n pkg = opts.packageFilter(pkg, /*pkgfile,*/ x); // eslint-disable-line spaced-comment\n }\n\n if (pkg && pkg.main) {\n if (typeof pkg.main !== 'string') {\n var mainError = new TypeError('package “' + pkg.name + '” `main` must be a string');\n mainError.code = 'INVALID_PACKAGE_MAIN';\n throw mainError;\n }\n if (pkg.main === '.' || pkg.main === './') {\n pkg.main = 'index';\n }\n try {\n var m = loadAsFileSync(path.resolve(x, pkg.main));\n if (m) return m;\n var n = loadAsDirectorySync(path.resolve(x, pkg.main));\n if (n) return n;\n } catch (e) {}\n }\n }\n\n return loadAsFileSync(path.join(x, '/index'));\n }\n\n function loadNodeModulesSync(x, start) {\n var dirs = nodeModulesPaths(start, opts, x);\n for (var i = 0; i < dirs.length; i++) {\n var dir = dirs[i];\n if (isDirectory(dir)) {\n var m = loadAsFileSync(path.join(dir, '/', x));\n if (m) return m;\n var n = loadAsDirectorySync(path.join(dir, '/', x));\n if (n) return n;\n }\n }\n }\n};\n","var async = require('./lib/async');\nasync.core = require('./lib/core');\nasync.isCore = require('./lib/is-core');\nasync.sync = require('./lib/sync');\n\nexports = async;\nmodule.exports = async;\n","import semver from \"semver\";\nimport { types as t } from \"@babel/core\";\n\nexport function hasMinVersion(minVersion, runtimeVersion) {\n // If the range is unavailable, we're running the script during Babel's\n // build process, and we want to assume that all versions are satisfied so\n // that the built output will include all definitions.\n if (!runtimeVersion) return true;\n\n // semver.intersects() has some surprising behavior with comparing ranges\n // with preprelease versions. We add '^' to ensure that we are always\n // comparing ranges with ranges, which sidesteps this logic.\n // For example:\n //\n // semver.intersects(`<7.0.1`, \"7.0.0-beta.0\") // false - surprising\n // semver.intersects(`<7.0.1`, \"^7.0.0-beta.0\") // true - expected\n //\n // This is because the first falls back to\n //\n // semver.satisfies(\"7.0.0-beta.0\", `<7.0.1`) // false - surprising\n //\n // and this fails because a prerelease version can only satisfy a range\n // if it is a prerelease within the same major/minor/patch range.\n //\n // Note: If this is found to have issues, please also revisit the logic in\n // babel-core's availableHelper() API.\n if (semver.valid(runtimeVersion)) runtimeVersion = `^${runtimeVersion}`;\n\n return (\n !semver.intersects(`<${minVersion}`, runtimeVersion) &&\n !semver.intersects(`>=8.0.0`, runtimeVersion)\n );\n}\n\n// Note: We can't use NodePath#couldBeBaseType because it doesn't support arrays.\n// Even if we added support for arrays, this package needs to be compatible with\n// ^7.0.0 so we can't rely on it.\nexport function typeAnnotationToString(node) {\n switch (node.type) {\n case \"GenericTypeAnnotation\":\n if (t.isIdentifier(node.id, { name: \"Array\" })) return \"array\";\n break;\n case \"StringTypeAnnotation\":\n return \"string\";\n }\n}\n","import { hasMinVersion } from \"./helpers\";\n\nexport default runtimeVersion => {\n // Conditionally include 'Math' because it was not included in the 7.0.0\n // release of '@babel/runtime'. See issue https://github.com/babel/babel/pull/8616.\n const includeMathModule = hasMinVersion(\"7.0.1\", runtimeVersion);\n\n return {\n BuiltIns: {\n Symbol: { stable: true, path: \"symbol\" },\n Promise: { stable: true, path: \"promise\" },\n Map: { stable: true, path: \"map\" },\n WeakMap: { stable: true, path: \"weak-map\" },\n Set: { stable: true, path: \"set\" },\n WeakSet: { stable: true, path: \"weak-set\" },\n setImmediate: { stable: true, path: \"set-immediate\" },\n clearImmediate: { stable: true, path: \"clear-immediate\" },\n parseFloat: { stable: true, path: \"parse-float\" },\n parseInt: { stable: true, path: \"parse-int\" },\n },\n\n StaticProperties: {\n Array: {\n from: { stable: true, path: \"array/from\" },\n isArray: { stable: true, path: \"array/is-array\" },\n of: { stable: true, path: \"array/of\" },\n },\n\n JSON: {\n stringify: { stable: true, path: \"json/stringify\" },\n },\n\n Object: {\n assign: { stable: true, path: \"object/assign\" },\n create: { stable: true, path: \"object/create\" },\n defineProperties: { stable: true, path: \"object/define-properties\" },\n defineProperty: { stable: true, path: \"object/define-property\" },\n entries: { stable: true, path: \"object/entries\" },\n freeze: { stable: true, path: \"object/freeze\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"object/get-own-property-descriptor\",\n },\n getOwnPropertyDescriptors: {\n stable: true,\n path: \"object/get-own-property-descriptors\",\n },\n getOwnPropertyNames: {\n stable: true,\n path: \"object/get-own-property-names\",\n },\n getOwnPropertySymbols: {\n stable: true,\n path: \"object/get-own-property-symbols\",\n },\n getPrototypeOf: { stable: true, path: \"object/get-prototype-of\" },\n isExtensible: { stable: true, path: \"object/is-extensible\" },\n isFrozen: { stable: true, path: \"object/is-frozen\" },\n isSealed: { stable: true, path: \"object/is-sealed\" },\n is: { stable: true, path: \"object/is\" },\n keys: { stable: true, path: \"object/keys\" },\n preventExtensions: { stable: true, path: \"object/prevent-extensions\" },\n seal: { stable: true, path: \"object/seal\" },\n setPrototypeOf: { stable: true, path: \"object/set-prototype-of\" },\n values: { stable: true, path: \"object/values\" },\n },\n\n ...(includeMathModule\n ? {\n Math: {\n acosh: { stable: true, path: \"math/acosh\" },\n asinh: { stable: true, path: \"math/asinh\" },\n atanh: { stable: true, path: \"math/atanh\" },\n cbrt: { stable: true, path: \"math/cbrt\" },\n clz32: { stable: true, path: \"math/clz32\" },\n cosh: { stable: true, path: \"math/cosh\" },\n expm1: { stable: true, path: \"math/expm1\" },\n fround: { stable: true, path: \"math/fround\" },\n hypot: { stable: true, path: \"math/hypot\" },\n imul: { stable: true, path: \"math/imul\" },\n log10: { stable: true, path: \"math/log10\" },\n log1p: { stable: true, path: \"math/log1p\" },\n log2: { stable: true, path: \"math/log2\" },\n sign: { stable: true, path: \"math/sign\" },\n sinh: { stable: true, path: \"math/sinh\" },\n tanh: { stable: true, path: \"math/tanh\" },\n trunc: { stable: true, path: \"math/trunc\" },\n },\n }\n : {}),\n\n Symbol: {\n // FIXME: Disabled to work around zloirock/core-js#262.\n // asyncIterator: { stable: true, path: \"symbol/async-iterator\" },\n for: { stable: true, path: \"symbol/for\" },\n hasInstance: { stable: true, path: \"symbol/has-instance\" },\n isConcatSpreadable: {\n stable: true,\n path: \"symbol/is-concat-spreadable\",\n },\n iterator: { stable: true, path: \"symbol/iterator\" },\n keyFor: { stable: true, path: \"symbol/key-for\" },\n match: { stable: true, path: \"symbol/match\" },\n replace: { stable: true, path: \"symbol/replace\" },\n search: { stable: true, path: \"symbol/search\" },\n species: { stable: true, path: \"symbol/species\" },\n split: { stable: true, path: \"symbol/split\" },\n toPrimitive: { stable: true, path: \"symbol/to-primitive\" },\n toStringTag: { stable: true, path: \"symbol/to-string-tag\" },\n unscopables: { stable: true, path: \"symbol/unscopables\" },\n },\n\n String: {\n at: { stable: true, path: \"string/at\" },\n fromCodePoint: { stable: true, path: \"string/from-code-point\" },\n raw: { stable: true, path: \"string/raw\" },\n },\n\n Number: {\n EPSILON: { stable: true, path: \"number/epsilon\" },\n isFinite: { stable: true, path: \"number/is-finite\" },\n isInteger: { stable: true, path: \"number/is-integer\" },\n isNaN: { stable: true, path: \"number/is-nan\" },\n isSafeInteger: { stable: true, path: \"number/is-safe-integer\" },\n MAX_SAFE_INTEGER: { stable: true, path: \"number/max-safe-integer\" },\n MIN_SAFE_INTEGER: { stable: true, path: \"number/min-safe-integer\" },\n parseFloat: { stable: true, path: \"number/parse-float\" },\n parseInt: { stable: true, path: \"number/parse-int\" },\n },\n\n Reflect: {\n apply: { stable: true, path: \"reflect/apply\" },\n construct: { stable: true, path: \"reflect/construct\" },\n defineProperty: { stable: true, path: \"reflect/define-property\" },\n deleteProperty: { stable: true, path: \"reflect/delete-property\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"reflect/get-own-property-descriptor\",\n },\n getPrototypeOf: { stable: true, path: \"reflect/get-prototype-of\" },\n get: { stable: true, path: \"reflect/get\" },\n has: { stable: true, path: \"reflect/has\" },\n isExtensible: { stable: true, path: \"reflect/is-extensible\" },\n ownKeys: { stable: true, path: \"reflect/own-keys\" },\n preventExtensions: { stable: true, path: \"reflect/prevent-extensions\" },\n setPrototypeOf: { stable: true, path: \"reflect/set-prototype-of\" },\n set: { stable: true, path: \"reflect/set\" },\n },\n\n Date: {\n now: { stable: true, path: \"date/now\" },\n },\n },\n };\n};\n","export default () => {\n return {\n BuiltIns: {\n AggregateError: { stable: false, path: \"aggregate-error\" },\n Map: { stable: true, path: \"map\" },\n Observable: { stable: false, path: \"observable\" },\n Promise: { stable: true, path: \"promise\" },\n Set: { stable: true, path: \"set\" },\n Symbol: { stable: true, path: \"symbol\" },\n URL: { stable: true, path: \"url\" },\n URLSearchParams: { stable: true, path: \"url-search-params\" },\n WeakMap: { stable: true, path: \"weak-map\" },\n WeakSet: { stable: true, path: \"weak-set\" },\n clearImmediate: { stable: true, path: \"clear-immediate\" },\n compositeKey: { stable: false, path: \"composite-key\" },\n compositeSymbol: { stable: false, path: \"composite-symbol\" },\n globalThis: { stable: false, path: \"global-this\" },\n parseFloat: { stable: true, path: \"parse-float\" },\n parseInt: { stable: true, path: \"parse-int\" },\n queueMicrotask: { stable: true, path: \"queue-microtask\" },\n setImmediate: { stable: true, path: \"set-immediate\" },\n setInterval: { stable: true, path: \"set-interval\" },\n setTimeout: { stable: true, path: \"set-timeout\" },\n },\n\n StaticProperties: {\n Array: {\n from: { stable: true, path: \"array/from\" },\n isArray: { stable: true, path: \"array/is-array\" },\n of: { stable: true, path: \"array/of\" },\n },\n\n Date: {\n now: { stable: true, path: \"date/now\" },\n },\n\n JSON: {\n stringify: { stable: true, path: \"json/stringify\" },\n },\n\n Math: {\n DEG_PER_RAD: { stable: false, path: \"math/deg-per-rad\" },\n RAD_PER_DEG: { stable: false, path: \"math/rad-per-deg\" },\n acosh: { stable: true, path: \"math/acosh\" },\n asinh: { stable: true, path: \"math/asinh\" },\n atanh: { stable: true, path: \"math/atanh\" },\n cbrt: { stable: true, path: \"math/cbrt\" },\n clamp: { stable: false, path: \"math/clamp\" },\n clz32: { stable: true, path: \"math/clz32\" },\n cosh: { stable: true, path: \"math/cosh\" },\n degrees: { stable: false, path: \"math/degrees\" },\n expm1: { stable: true, path: \"math/expm1\" },\n fround: { stable: true, path: \"math/fround\" },\n fscale: { stable: false, path: \"math/fscale\" },\n hypot: { stable: true, path: \"math/hypot\" },\n iaddh: { stable: false, path: \"math/iaddh\" },\n imul: { stable: true, path: \"math/imul\" },\n imulh: { stable: false, path: \"math/imulh\" },\n isubh: { stable: false, path: \"math/isubh\" },\n log10: { stable: true, path: \"math/log10\" },\n log1p: { stable: true, path: \"math/log1p\" },\n log2: { stable: true, path: \"math/log2\" },\n radians: { stable: false, path: \"math/radians\" },\n scale: { stable: false, path: \"math/scale\" },\n seededPRNG: { stable: false, path: \"math/seeded-prng\" },\n sign: { stable: true, path: \"math/sign\" },\n signbit: { stable: false, path: \"math/signbit\" },\n sinh: { stable: true, path: \"math/sinh\" },\n tanh: { stable: true, path: \"math/tanh\" },\n trunc: { stable: true, path: \"math/trunc\" },\n umulh: { stable: false, path: \"math/umulh\" },\n },\n\n Number: {\n EPSILON: { stable: true, path: \"number/epsilon\" },\n MAX_SAFE_INTEGER: { stable: true, path: \"number/max-safe-integer\" },\n MIN_SAFE_INTEGER: { stable: true, path: \"number/min-safe-integer\" },\n fromString: { stable: false, path: \"number/from-string\" },\n isFinite: { stable: true, path: \"number/is-finite\" },\n isInteger: { stable: true, path: \"number/is-integer\" },\n isNaN: { stable: true, path: \"number/is-nan\" },\n isSafeInteger: { stable: true, path: \"number/is-safe-integer\" },\n parseFloat: { stable: true, path: \"number/parse-float\" },\n parseInt: { stable: true, path: \"number/parse-int\" },\n },\n\n Object: {\n assign: { stable: true, path: \"object/assign\" },\n create: { stable: true, path: \"object/create\" },\n defineProperties: { stable: true, path: \"object/define-properties\" },\n defineProperty: { stable: true, path: \"object/define-property\" },\n entries: { stable: true, path: \"object/entries\" },\n freeze: { stable: true, path: \"object/freeze\" },\n fromEntries: { stable: true, path: \"object/from-entries\" },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"object/get-own-property-descriptor\",\n },\n getOwnPropertyDescriptors: {\n stable: true,\n path: \"object/get-own-property-descriptors\",\n },\n getOwnPropertyNames: {\n stable: true,\n path: \"object/get-own-property-names\",\n },\n getOwnPropertySymbols: {\n stable: true,\n path: \"object/get-own-property-symbols\",\n },\n getPrototypeOf: { stable: true, path: \"object/get-prototype-of\" },\n isExtensible: { stable: true, path: \"object/is-extensible\" },\n isFrozen: { stable: true, path: \"object/is-frozen\" },\n isSealed: { stable: true, path: \"object/is-sealed\" },\n is: { stable: true, path: \"object/is\" },\n keys: { stable: true, path: \"object/keys\" },\n preventExtensions: { stable: true, path: \"object/prevent-extensions\" },\n seal: { stable: true, path: \"object/seal\" },\n setPrototypeOf: { stable: true, path: \"object/set-prototype-of\" },\n values: { stable: true, path: \"object/values\" },\n },\n\n Reflect: {\n apply: { stable: true, path: \"reflect/apply\" },\n construct: { stable: true, path: \"reflect/construct\" },\n defineMetadata: { stable: false, path: \"reflect/define-metadata\" },\n defineProperty: { stable: true, path: \"reflect/define-property\" },\n deleteMetadata: { stable: false, path: \"reflect/delete-metadata\" },\n deleteProperty: { stable: true, path: \"reflect/delete-property\" },\n getMetadata: { stable: false, path: \"reflect/get-metadata\" },\n getMetadataKeys: { stable: false, path: \"reflect/get-metadata-keys\" },\n getOwnMetadata: { stable: false, path: \"reflect/get-own-metadata\" },\n getOwnMetadataKeys: {\n stable: false,\n path: \"reflect/get-own-metadata-keys\",\n },\n getOwnPropertyDescriptor: {\n stable: true,\n path: \"reflect/get-own-property-descriptor\",\n },\n getPrototypeOf: { stable: true, path: \"reflect/get-prototype-of\" },\n get: { stable: true, path: \"reflect/get\" },\n has: { stable: true, path: \"reflect/has\" },\n hasMetadata: { stable: false, path: \"reflect/has-metadata\" },\n hasOwnMetadata: { stable: false, path: \"reflect/has-own-metadata\" },\n isExtensible: { stable: true, path: \"reflect/is-extensible\" },\n metadata: { stable: false, path: \"reflect/metadata\" },\n ownKeys: { stable: true, path: \"reflect/own-keys\" },\n preventExtensions: { stable: true, path: \"reflect/prevent-extensions\" },\n set: { stable: true, path: \"reflect/set\" },\n setPrototypeOf: { stable: true, path: \"reflect/set-prototype-of\" },\n },\n\n String: {\n fromCodePoint: { stable: true, path: \"string/from-code-point\" },\n raw: { stable: true, path: \"string/raw\" },\n },\n\n Symbol: {\n asyncIterator: { stable: true, path: \"symbol/async-iterator\" },\n dispose: { stable: false, path: \"symbol/dispose\" },\n for: { stable: true, path: \"symbol/for\" },\n hasInstance: { stable: true, path: \"symbol/has-instance\" },\n isConcatSpreadable: {\n stable: true,\n path: \"symbol/is-concat-spreadable\",\n },\n iterator: { stable: true, path: \"symbol/iterator\" },\n keyFor: { stable: true, path: \"symbol/key-for\" },\n match: { stable: true, path: \"symbol/match\" },\n observable: { stable: false, path: \"symbol/observable\" },\n patternMatch: { stable: false, path: \"symbol/pattern-match\" },\n replace: { stable: true, path: \"symbol/replace\" },\n search: { stable: true, path: \"symbol/search\" },\n species: { stable: true, path: \"symbol/species\" },\n split: { stable: true, path: \"symbol/split\" },\n toPrimitive: { stable: true, path: \"symbol/to-primitive\" },\n toStringTag: { stable: true, path: \"symbol/to-string-tag\" },\n unscopables: { stable: true, path: \"symbol/unscopables\" },\n },\n },\n\n // NOTE: You can specify the object types whose method needs to be polyfilled.\n // e.g. concat: { types: [\"array\"] }\n // See ./helpers.js@typeAnnotationToString for the supported types\n\n InstanceProperties: {\n at: { stable: false, path: \"at\" },\n bind: { stable: true, path: \"bind\" },\n codePointAt: { stable: true, path: \"code-point-at\" },\n codePoints: { stable: false, path: \"code-points\" },\n concat: { stable: true, path: \"concat\", types: [\"array\"] },\n copyWithin: { stable: true, path: \"copy-within\" },\n endsWith: { stable: true, path: \"ends-with\" },\n entries: { stable: true, path: \"entries\" },\n every: { stable: true, path: \"every\" },\n fill: { stable: true, path: \"fill\" },\n filter: { stable: true, path: \"filter\" },\n find: { stable: true, path: \"find\" },\n findIndex: { stable: true, path: \"find-index\" },\n flags: { stable: true, path: \"flags\" },\n flatMap: { stable: true, path: \"flat-map\" },\n flat: { stable: true, path: \"flat\" },\n forEach: { stable: true, path: \"for-each\" },\n includes: { stable: true, path: \"includes\" },\n indexOf: { stable: true, path: \"index-of\" },\n keys: { stable: true, path: \"keys\" },\n lastIndexOf: { stable: true, path: \"last-index-of\" },\n map: { stable: true, path: \"map\" },\n matchAll: { stable: false, path: \"match-all\" },\n padEnd: { stable: true, path: \"pad-end\" },\n padStart: { stable: true, path: \"pad-start\" },\n reduce: { stable: true, path: \"reduce\" },\n reduceRight: { stable: true, path: \"reduce-right\" },\n repeat: { stable: true, path: \"repeat\" },\n replaceAll: { stable: false, path: \"replace-all\" },\n reverse: { stable: true, path: \"reverse\" },\n slice: { stable: true, path: \"slice\" },\n some: { stable: true, path: \"some\" },\n sort: { stable: true, path: \"sort\" },\n splice: { stable: true, path: \"splice\" },\n startsWith: { stable: true, path: \"starts-with\" },\n trim: { stable: true, path: \"trim\" },\n trimEnd: { stable: true, path: \"trim-end\" },\n trimLeft: { stable: true, path: \"trim-left\" },\n trimRight: { stable: true, path: \"trim-right\" },\n trimStart: { stable: true, path: \"trim-start\" },\n values: { stable: true, path: \"values\" },\n },\n };\n};\n","import path from \"path\";\nimport resolve from \"resolve\";\nimport { declare } from \"@babel/helper-plugin-utils\";\nimport { addDefault, isModule } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nimport getCoreJS2Definitions from \"./runtime-corejs2-definitions\";\nimport getCoreJS3Definitions from \"./runtime-corejs3-definitions\";\nimport { typeAnnotationToString } from \"./helpers\";\n\nfunction resolveAbsoluteRuntime(moduleName: string, dirname: string) {\n try {\n return path.dirname(\n resolve.sync(`${moduleName}/package.json`, { basedir: dirname }),\n );\n } catch (err) {\n if (err.code !== \"MODULE_NOT_FOUND\") throw err;\n\n throw Object.assign(\n new Error(`Failed to resolve \"${moduleName}\" relative to \"${dirname}\"`),\n {\n code: \"BABEL_RUNTIME_NOT_FOUND\",\n runtime: moduleName,\n dirname,\n },\n );\n }\n}\n\nfunction supportsStaticESM(caller) {\n return !!(caller && caller.supportsStaticESM);\n}\n\nexport default declare((api, options, dirname) => {\n api.assertVersion(7);\n\n const {\n corejs,\n helpers: useRuntimeHelpers = true,\n regenerator: useRuntimeRegenerator = true,\n useESModules = false,\n version: runtimeVersion = \"7.0.0-beta.0\",\n absoluteRuntime = false,\n } = options;\n\n let proposals = false;\n let rawVersion;\n\n if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const corejsVersion = rawVersion ? Number(rawVersion) : false;\n\n if (![false, 2, 3].includes(corejsVersion)) {\n throw new Error(\n `The \\`core-js\\` version must be false, 2 or 3, but got ${JSON.stringify(\n rawVersion,\n )}.`,\n );\n }\n\n if (proposals && (!corejsVersion || corejsVersion < 3)) {\n throw new Error(\n \"The 'proposals' option is only supported when using 'corejs: 3'\",\n );\n }\n\n if (typeof useRuntimeRegenerator !== \"boolean\") {\n throw new Error(\n \"The 'regenerator' option must be undefined, or a boolean.\",\n );\n }\n\n if (typeof useRuntimeHelpers !== \"boolean\") {\n throw new Error(\"The 'helpers' option must be undefined, or a boolean.\");\n }\n\n if (typeof useESModules !== \"boolean\" && useESModules !== \"auto\") {\n throw new Error(\n \"The 'useESModules' option must be undefined, or a boolean, or 'auto'.\",\n );\n }\n\n if (\n typeof absoluteRuntime !== \"boolean\" &&\n typeof absoluteRuntime !== \"string\"\n ) {\n throw new Error(\n \"The 'absoluteRuntime' option must be undefined, a boolean, or a string.\",\n );\n }\n\n if (typeof runtimeVersion !== \"string\") {\n throw new Error(`The 'version' option must be a version string.`);\n }\n\n function has(obj, key) {\n return Object.prototype.hasOwnProperty.call(obj, key);\n }\n\n function hasMapping(methods, name) {\n return has(methods, name) && (proposals || methods[name].stable);\n }\n\n function hasStaticMapping(object, method) {\n return (\n has(StaticProperties, object) &&\n hasMapping(StaticProperties[object], method)\n );\n }\n\n function isNamespaced(path) {\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n }\n\n function maybeNeedsPolyfill(path, methods, name) {\n if (isNamespaced(path.get(\"object\"))) return false;\n if (!methods[name].types) return true;\n\n const typeAnnotation = path.get(\"object\").getTypeAnnotation();\n const type = typeAnnotationToString(typeAnnotation);\n if (!type) return true;\n\n return methods[name].types.some(name => name === type);\n }\n\n function resolvePropertyName(path, computed) {\n const { node } = path;\n if (!computed) return node.name;\n if (path.isStringLiteral()) return node.value;\n const result = path.evaluate();\n return result.value;\n }\n\n if (has(options, \"useBuiltIns\")) {\n if (options.useBuiltIns) {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. The @babel/runtime \" +\n \"module now uses builtins by default.\",\n );\n } else {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (has(options, \"polyfill\")) {\n if (options.polyfill === false) {\n throw new Error(\n \"The 'polyfill' option has been removed. The @babel/runtime \" +\n \"module now skips polyfilling by default.\",\n );\n } else {\n throw new Error(\n \"The 'polyfill' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (has(options, \"moduleName\")) {\n throw new Error(\n \"The 'moduleName' option has been removed. @babel/transform-runtime \" +\n \"no longer supports arbitrary runtimes. If you were using this to \" +\n \"set an absolute path for Babel's standard runtimes, please use the \" +\n \"'absoluteRuntime' option.\",\n );\n }\n\n const esModules =\n useESModules === \"auto\" ? api.caller(supportsStaticESM) : useESModules;\n\n const injectCoreJS2 = corejsVersion === 2;\n const injectCoreJS3 = corejsVersion === 3;\n const injectCoreJS = corejsVersion !== false;\n\n const moduleName = injectCoreJS3\n ? \"@babel/runtime-corejs3\"\n : injectCoreJS2\n ? \"@babel/runtime-corejs2\"\n : \"@babel/runtime\";\n\n const corejsRoot = injectCoreJS3 && !proposals ? \"core-js-stable\" : \"core-js\";\n\n const { BuiltIns, StaticProperties, InstanceProperties } = (injectCoreJS2\n ? getCoreJS2Definitions\n : getCoreJS3Definitions)(runtimeVersion);\n\n const HEADER_HELPERS = [\"interopRequireWildcard\", \"interopRequireDefault\"];\n\n let modulePath = moduleName;\n if (absoluteRuntime !== false) {\n modulePath = resolveAbsoluteRuntime(\n moduleName,\n path.resolve(dirname, absoluteRuntime === true ? \".\" : absoluteRuntime),\n );\n }\n\n return {\n name: \"transform-runtime\",\n\n pre(file) {\n if (useRuntimeHelpers) {\n file.set(\"helperGenerator\", name => {\n // If the helper didn't exist yet at the version given, we bail\n // out and let Babel either insert it directly, or throw an error\n // so that plugins can handle that case properly.\n if (\n file.availableHelper &&\n !file.availableHelper(name, runtimeVersion)\n ) {\n return;\n }\n\n const isInteropHelper = HEADER_HELPERS.indexOf(name) !== -1;\n\n // Explicitly set the CommonJS interop helpers to their reserve\n // blockHoist of 4 so they are guaranteed to exist\n // when other things used them to import.\n const blockHoist =\n isInteropHelper && !isModule(file.path) ? 4 : undefined;\n\n const helpersDir =\n esModules && file.path.node.sourceType === \"module\"\n ? \"helpers/esm\"\n : \"helpers\";\n\n return this.addDefaultImport(\n `${modulePath}/${helpersDir}/${name}`,\n name,\n blockHoist,\n );\n });\n }\n\n const cache = new Map();\n\n this.addDefaultImport = (source, nameHint, blockHoist) => {\n // If something on the page adds a helper when the file is an ES6\n // file, we can't reused the cached helper name after things have been\n // transformed because it has almost certainly been renamed.\n const cacheKey = isModule(file.path);\n const key = `${source}:${nameHint}:${cacheKey || \"\"}`;\n\n let cached = cache.get(key);\n if (cached) {\n cached = t.cloneNode(cached);\n } else {\n cached = addDefault(file.path, source, {\n importedInterop: \"uncompiled\",\n nameHint,\n blockHoist,\n });\n\n cache.set(key, cached);\n }\n return cached;\n };\n },\n\n visitor: {\n ReferencedIdentifier(path) {\n const { node, parent, scope } = path;\n const { name } = node;\n\n // transform `regeneratorRuntime`\n if (name === \"regeneratorRuntime\" && useRuntimeRegenerator) {\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/regenerator`,\n \"regeneratorRuntime\",\n ),\n );\n return;\n }\n\n if (!injectCoreJS) return;\n\n if (t.isMemberExpression(parent)) return;\n if (!hasMapping(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n // transform global built-ins like `Symbol()`, `new Promise`\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,\n name,\n ),\n );\n },\n\n CallExpression(path) {\n if (!injectCoreJS) return;\n\n const { node } = path;\n const { callee } = node;\n\n if (!t.isMemberExpression(callee)) return;\n\n const { object } = callee;\n const propertyName = resolvePropertyName(\n path.get(\"callee.property\"),\n callee.computed,\n );\n\n // transform calling instance methods like `something.includes()`\n if (injectCoreJS3 && !hasStaticMapping(object.name, propertyName)) {\n if (\n hasMapping(InstanceProperties, propertyName) &&\n maybeNeedsPolyfill(\n path.get(\"callee\"),\n InstanceProperties,\n propertyName,\n )\n ) {\n let context1, context2;\n if (t.isIdentifier(object)) {\n context1 = object;\n context2 = t.cloneNode(object);\n } else {\n context1 = path.scope.generateDeclaredUidIdentifier(\"context\");\n context2 = t.assignmentExpression(\"=\", context1, object);\n }\n node.callee = t.memberExpression(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,\n `${propertyName}InstanceProperty`,\n ),\n [context2],\n ),\n t.identifier(\"call\"),\n );\n node.arguments.unshift(context1);\n return;\n }\n }\n // we can't compile this\n if (node.arguments.length) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n // transform `something[Symbol.iterator]()` to calling `getIterator(something)` helper\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${modulePath}/core-js/get-iterator`,\n \"getIterator\",\n ),\n [object],\n ),\n );\n },\n\n // transform `Symbol.iterator in something` to calling `isIterable(something)` helper\n BinaryExpression(path) {\n if (!injectCoreJS) return;\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${modulePath}/core-js/is-iterable`,\n \"isIterable\",\n ),\n [path.node.right],\n ),\n );\n },\n\n // transform static built-ins methods like `Array.from`\n MemberExpression: {\n enter(path) {\n if (!injectCoreJS) return;\n if (!path.isReferenced()) return;\n\n const { node } = path;\n const { object } = node;\n\n if (!t.isReferenced(object, node)) return;\n\n // transform `something[Symbol.iterator]` to calling `getIteratorMethod(something)` helper\n if (\n !injectCoreJS2 &&\n node.computed &&\n path.get(\"property\").matchesPattern(\"Symbol.iterator\")\n ) {\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/core-js/get-iterator-method`,\n \"getIteratorMethod\",\n ),\n [object],\n ),\n );\n return;\n }\n\n const objectName = object.name;\n const propertyName = resolvePropertyName(\n path.get(\"property\"),\n node.computed,\n );\n // doesn't reference the global\n if (\n path.scope.getBindingIdentifier(objectName) ||\n !hasStaticMapping(objectName, propertyName)\n ) {\n // transform getting of instance methods like `method = something.includes`\n if (\n injectCoreJS3 &&\n hasMapping(InstanceProperties, propertyName) &&\n maybeNeedsPolyfill(path, InstanceProperties, propertyName)\n ) {\n path.replaceWith(\n t.callExpression(\n this.addDefaultImport(\n `${moduleName}/${corejsRoot}/instance/${InstanceProperties[propertyName].path}`,\n `${propertyName}InstanceProperty`,\n ),\n [object],\n ),\n );\n }\n return;\n }\n\n path.replaceWith(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${StaticProperties[objectName][propertyName].path}`,\n `${objectName}$${propertyName}`,\n ),\n );\n },\n\n exit(path) {\n if (!injectCoreJS) return;\n if (!path.isReferenced()) return;\n if (path.node.computed) return;\n\n const { node } = path;\n const { object } = node;\n const { name } = object;\n\n if (!hasMapping(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n path.replaceWith(\n t.memberExpression(\n this.addDefaultImport(\n `${modulePath}/${corejsRoot}/${BuiltIns[name].path}`,\n name,\n ),\n node.property,\n ),\n );\n },\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-shorthand-properties\",\n\n visitor: {\n ObjectMethod(path) {\n const { node } = path;\n if (node.kind === \"method\") {\n const func = t.functionExpression(\n null,\n node.params,\n node.body,\n node.generator,\n node.async,\n );\n func.returnType = node.returnType;\n\n path.replaceWith(t.objectProperty(node.key, func, node.computed));\n }\n },\n\n ObjectProperty({ node }) {\n if (node.shorthand) {\n node.shorthand = false;\n }\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n\n const { loose } = options;\n\n function getSpreadLiteral(spread, scope) {\n if (loose && !t.isIdentifier(spread.argument, { name: \"arguments\" })) {\n return spread.argument;\n } else {\n return scope.toArray(spread.argument, true);\n }\n }\n\n function hasSpread(nodes) {\n for (let i = 0; i < nodes.length; i++) {\n if (t.isSpreadElement(nodes[i])) {\n return true;\n }\n }\n return false;\n }\n\n function push(_props, nodes) {\n if (!_props.length) return _props;\n nodes.push(t.arrayExpression(_props));\n return [];\n }\n\n function build(props: Array, scope) {\n const nodes = [];\n let _props = [];\n\n for (const prop of props) {\n if (t.isSpreadElement(prop)) {\n _props = push(_props, nodes);\n nodes.push(getSpreadLiteral(prop, scope));\n } else {\n _props.push(prop);\n }\n }\n\n push(_props, nodes);\n\n return nodes;\n }\n\n return {\n name: \"transform-spread\",\n\n visitor: {\n ArrayExpression(path) {\n const { node, scope } = path;\n const elements = node.elements;\n if (!hasSpread(elements)) return;\n\n const nodes = build(elements, scope);\n let first = nodes[0];\n\n // If there is only one element in the ArrayExpression and\n // the element was transformed (Array.prototype.slice.call or toConsumableArray)\n // we know that the transformed code already takes care of cloning the array.\n // So we can simply return that element.\n if (nodes.length === 1 && first !== elements[0].argument) {\n path.replaceWith(first);\n return;\n }\n\n // If the first element is a ArrayExpression we can directly call\n // concat on it.\n // `[..].concat(..)`\n // If not then we have to use `[].concat(arr)` and not `arr.concat`\n // because `arr` could be extended/modified (e.g. Immutable) and we do not know exactly\n // what concat would produce.\n if (!t.isArrayExpression(first)) {\n first = t.arrayExpression([]);\n } else {\n nodes.shift();\n }\n\n path.replaceWith(\n t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n ),\n );\n },\n\n CallExpression(path) {\n const { node, scope } = path;\n\n const args = node.arguments;\n if (!hasSpread(args)) return;\n\n const calleePath = path.get(\"callee\");\n if (calleePath.isSuper()) return;\n\n let contextLiteral = scope.buildUndefinedNode();\n\n node.arguments = [];\n\n let nodes;\n if (args.length === 1 && args[0].argument.name === \"arguments\") {\n nodes = [args[0].argument];\n } else {\n nodes = build(args, scope);\n }\n\n const first = nodes.shift();\n if (nodes.length) {\n node.arguments.push(\n t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n ),\n );\n } else {\n node.arguments.push(first);\n }\n\n const callee = node.callee;\n\n if (calleePath.isMemberExpression()) {\n const temp = scope.maybeGenerateMemoised(callee.object);\n if (temp) {\n callee.object = t.assignmentExpression(\"=\", temp, callee.object);\n contextLiteral = temp;\n } else {\n contextLiteral = t.cloneNode(callee.object);\n }\n t.appendToMemberExpression(callee, t.identifier(\"apply\"));\n } else {\n node.callee = t.memberExpression(node.callee, t.identifier(\"apply\"));\n }\n\n if (t.isSuper(contextLiteral)) {\n contextLiteral = t.thisExpression();\n }\n\n node.arguments.unshift(t.cloneNode(contextLiteral));\n },\n\n NewExpression(path) {\n const { node, scope } = path;\n let args = node.arguments;\n if (!hasSpread(args)) return;\n\n const nodes = build(args, scope);\n\n const first = nodes.shift();\n\n if (nodes.length) {\n args = t.callExpression(\n t.memberExpression(first, t.identifier(\"concat\")),\n nodes,\n );\n } else {\n args = first;\n }\n\n path.replaceWith(\n t.callExpression(path.hub.addHelper(\"construct\"), [\n node.callee,\n args,\n ]),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport * as regex from \"@babel/helper-regex\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-sticky-regex\",\n\n visitor: {\n RegExpLiteral(path) {\n const { node } = path;\n if (!regex.is(node, \"y\")) return;\n\n path.replaceWith(\n t.newExpression(t.identifier(\"RegExp\"), [\n t.stringLiteral(node.pattern),\n t.stringLiteral(node.flags),\n ]),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-strict-mode\",\n\n visitor: {\n Program(path) {\n const { node } = path;\n\n for (const directive of (node.directives: Array)) {\n if (directive.value.value === \"use strict\") return;\n }\n\n path.unshiftContainer(\n \"directives\",\n t.directive(t.directiveLiteral(\"use strict\")),\n );\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { template, types as t } from \"@babel/core\";\n\nexport default declare((api, options) => {\n api.assertVersion(7);\n const { loose } = options;\n\n let helperName = \"taggedTemplateLiteral\";\n if (loose) helperName += \"Loose\";\n\n /**\n * This function groups the objects into multiple calls to `.concat()` in\n * order to preserve execution order of the primitive conversion, e.g.\n *\n * \"\".concat(obj.foo, \"foo\", obj2.foo, \"foo2\")\n *\n * would evaluate both member expressions _first_ then, `concat` will\n * convert each one to a primitive, whereas\n *\n * \"\".concat(obj.foo, \"foo\").concat(obj2.foo, \"foo2\")\n *\n * would evaluate the member, then convert it to a primitive, then evaluate\n * the second member and convert that one, which reflects the spec behavior\n * of template literals.\n */\n function buildConcatCallExpressions(items) {\n let avail = true;\n return items.reduce(function(left, right) {\n let canBeInserted = t.isLiteral(right);\n\n if (!canBeInserted && avail) {\n canBeInserted = true;\n avail = false;\n }\n if (canBeInserted && t.isCallExpression(left)) {\n left.arguments.push(right);\n return left;\n }\n return t.callExpression(\n t.memberExpression(left, t.identifier(\"concat\")),\n [right],\n );\n });\n }\n\n return {\n name: \"transform-template-literals\",\n\n visitor: {\n TaggedTemplateExpression(path) {\n const { node } = path;\n const { quasi } = node;\n\n const strings = [];\n const raws = [];\n\n // Flag variable to check if contents of strings and raw are equal\n let isStringsRawEqual = true;\n\n for (const elem of (quasi.quasis: Array)) {\n const { raw, cooked } = elem.value;\n const value =\n cooked == null\n ? path.scope.buildUndefinedNode()\n : t.stringLiteral(cooked);\n\n strings.push(value);\n raws.push(t.stringLiteral(raw));\n\n if (raw !== cooked) {\n // false even if one of raw and cooked are not equal\n isStringsRawEqual = false;\n }\n }\n\n const scope = path.scope.getProgramParent();\n const templateObject = scope.generateUidIdentifier(\"templateObject\");\n\n const helperId = this.addHelper(helperName);\n const callExpressionInput = [t.arrayExpression(strings)];\n\n // only add raw arrayExpression if there is any difference between raws and strings\n if (!isStringsRawEqual) {\n callExpressionInput.push(t.arrayExpression(raws));\n }\n\n const lazyLoad = template.ast`\n function ${templateObject}() {\n const data = ${t.callExpression(helperId, callExpressionInput)};\n ${templateObject} = function() { return data };\n return data;\n } \n `;\n\n scope.path.unshiftContainer(\"body\", lazyLoad);\n path.replaceWith(\n t.callExpression(node.tag, [\n t.callExpression(t.cloneNode(templateObject), []),\n ...quasi.expressions,\n ]),\n );\n },\n\n TemplateLiteral(path) {\n const nodes = [];\n const expressions = path.get(\"expressions\");\n\n let index = 0;\n for (const elem of (path.node.quasis: Array)) {\n if (elem.value.cooked) {\n nodes.push(t.stringLiteral(elem.value.cooked));\n }\n\n if (index < expressions.length) {\n const expr = expressions[index++];\n const node = expr.node;\n if (!t.isStringLiteral(node, { value: \"\" })) {\n nodes.push(node);\n }\n }\n }\n\n // since `+` is left-to-right associative\n // ensure the first node is a string if first/second isn't\n const considerSecondNode = !loose || !t.isStringLiteral(nodes[1]);\n if (!t.isStringLiteral(nodes[0]) && considerSecondNode) {\n nodes.unshift(t.stringLiteral(\"\"));\n }\n let root = nodes[0];\n\n if (loose) {\n for (let i = 1; i < nodes.length; i++) {\n root = t.binaryExpression(\"+\", root, nodes[i]);\n }\n } else if (nodes.length > 1) {\n root = buildConcatCallExpressions(nodes);\n }\n\n path.replaceWith(root);\n },\n },\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport { types as t } from \"@babel/core\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return {\n name: \"transform-typeof-symbol\",\n\n visitor: {\n Scope({ scope }) {\n if (!scope.getBinding(\"Symbol\")) {\n return;\n }\n\n scope.rename(\"Symbol\");\n },\n\n UnaryExpression(path) {\n const { node, parent } = path;\n if (node.operator !== \"typeof\") return;\n\n if (\n path.parentPath.isBinaryExpression() &&\n t.EQUALITY_BINARY_OPERATORS.indexOf(parent.operator) >= 0\n ) {\n // optimise `typeof foo === \"string\"` since we can determine that they'll never\n // need to handle symbols\n const opposite = path.getOpposite();\n if (\n opposite.isLiteral() &&\n opposite.node.value !== \"symbol\" &&\n opposite.node.value !== \"object\"\n ) {\n return;\n }\n }\n\n const helper = this.addHelper(\"typeof\");\n const isUnderHelper = path.findParent(path => {\n return (\n (path.isVariableDeclarator() && path.node.id === helper) ||\n (path.isFunctionDeclaration() &&\n path.node.id &&\n path.node.id.name === helper.name)\n );\n });\n\n if (isUnderHelper) {\n return;\n }\n\n const call = t.callExpression(helper, [node.argument]);\n const arg = path.get(\"argument\");\n if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name, true)) {\n const unary = t.unaryExpression(\"typeof\", t.cloneNode(node.argument));\n path.replaceWith(\n t.conditionalExpression(\n t.binaryExpression(\"===\", unary, t.stringLiteral(\"undefined\")),\n t.stringLiteral(\"undefined\"),\n call,\n ),\n );\n } else {\n path.replaceWith(call);\n }\n },\n },\n };\n});\n","import assert from \"assert\";\nimport { template } from \"@babel/core\";\n\nexport default function transpileEnum(path, t) {\n const { node } = path;\n if (node.declare) {\n path.remove();\n return;\n }\n\n if (node.const) {\n throw path.buildCodeFrameError(\"'const' enums are not supported.\");\n }\n\n const name = node.id.name;\n const fill = enumFill(path, t, node.id);\n\n switch (path.parent.type) {\n case \"BlockStatement\":\n case \"ExportNamedDeclaration\":\n case \"Program\": {\n path.insertAfter(fill);\n if (seen(path.parentPath)) {\n path.remove();\n } else {\n const isGlobal = t.isProgram(path.parent); // && !path.parent.body.some(t.isModuleDeclaration);\n path.scope.registerDeclaration(\n path.replaceWith(makeVar(node.id, t, isGlobal ? \"var\" : \"let\"))[0],\n );\n }\n break;\n }\n\n default:\n throw new Error(`Unexpected enum parent '${path.parent.type}`);\n }\n\n function seen(parentPath: Path) {\n if (parentPath.isExportDeclaration()) {\n return seen(parentPath.parentPath);\n }\n\n if (parentPath.getData(name)) {\n return true;\n } else {\n parentPath.setData(name, true);\n return false;\n }\n }\n}\n\nfunction makeVar(id, t, kind): VariableDeclaration {\n return t.variableDeclaration(kind, [t.variableDeclarator(id)]);\n}\n\nconst buildEnumWrapper = template(`\n (function (ID) {\n ASSIGNMENTS;\n })(ID || (ID = {}));\n`);\n\nconst buildStringAssignment = template(`\n ENUM[\"NAME\"] = VALUE;\n`);\n\nconst buildNumericAssignment = template(`\n ENUM[ENUM[\"NAME\"] = VALUE] = \"NAME\";\n`);\n\nconst buildEnumMember = (isString, options) =>\n (isString ? buildStringAssignment : buildNumericAssignment)(options);\n\n/**\n * Generates the statement that fills in the variable declared by the enum.\n * `(function (E) { ... assignments ... })(E || (E = {}));`\n */\nfunction enumFill(path, t, id) {\n const x = translateEnumValues(path, t);\n const assignments = x.map(([memberName, memberValue]) =>\n buildEnumMember(t.isStringLiteral(memberValue), {\n ENUM: t.cloneNode(id),\n NAME: memberName,\n VALUE: memberValue,\n }),\n );\n\n return buildEnumWrapper({\n ID: t.cloneNode(id),\n ASSIGNMENTS: assignments,\n });\n}\n\n/**\n * Maps the name of an enum member to its value.\n * We keep track of the previous enum members so you can write code like:\n * enum E {\n * X = 1 << 0,\n * Y = 1 << 1,\n * Z = X | Y,\n * }\n */\ntype PreviousEnumMembers = { [name: string]: number | string };\n\nfunction translateEnumValues(path, t) {\n const seen: PreviousEnumMembers = Object.create(null);\n // Start at -1 so the first enum member is its increment, 0.\n let prev: number | typeof undefined = -1;\n return path.node.members.map(member => {\n const name = t.isIdentifier(member.id) ? member.id.name : member.id.value;\n const initializer = member.initializer;\n let value: Expression;\n if (initializer) {\n const constValue = evaluate(initializer, seen);\n if (constValue !== undefined) {\n seen[name] = constValue;\n if (typeof constValue === \"number\") {\n value = t.numericLiteral(constValue);\n prev = constValue;\n } else {\n assert(typeof constValue === \"string\");\n value = t.stringLiteral(constValue);\n prev = undefined;\n }\n } else {\n value = initializer;\n prev = undefined;\n }\n } else {\n if (prev !== undefined) {\n prev++;\n value = t.numericLiteral(prev);\n seen[name] = prev;\n } else {\n throw path.buildCodeFrameError(\"Enum member must have initializer.\");\n }\n }\n\n return [name, value];\n });\n}\n\n// Based on the TypeScript repository's `evalConstant` in `checker.ts`.\nfunction evaluate(\n expr,\n seen: PreviousEnumMembers,\n): number | string | typeof undefined {\n return evalConstant(expr);\n\n function evalConstant(expr): number | typeof undefined {\n switch (expr.type) {\n case \"StringLiteral\":\n return expr.value;\n case \"UnaryExpression\":\n return evalUnaryExpression(expr);\n case \"BinaryExpression\":\n return evalBinaryExpression(expr);\n case \"NumericLiteral\":\n return expr.value;\n case \"ParenthesizedExpression\":\n return evalConstant(expr.expression);\n case \"Identifier\":\n return seen[expr.name];\n case \"TemplateLiteral\":\n if (expr.quasis.length === 1) {\n return expr.quasis[0].value.cooked;\n }\n /* falls through */\n default:\n return undefined;\n }\n }\n\n function evalUnaryExpression({\n argument,\n operator,\n }): number | typeof undefined {\n const value = evalConstant(argument);\n if (value === undefined) {\n return undefined;\n }\n\n switch (operator) {\n case \"+\":\n return value;\n case \"-\":\n return -value;\n case \"~\":\n return ~value;\n default:\n return undefined;\n }\n }\n\n function evalBinaryExpression(expr): number | typeof undefined {\n const left = evalConstant(expr.left);\n if (left === undefined) {\n return undefined;\n }\n const right = evalConstant(expr.right);\n if (right === undefined) {\n return undefined;\n }\n\n switch (expr.operator) {\n case \"|\":\n return left | right;\n case \"&\":\n return left & right;\n case \">>\":\n return left >> right;\n case \">>>\":\n return left >>> right;\n case \"<<\":\n return left << right;\n case \"^\":\n return left ^ right;\n case \"*\":\n return left * right;\n case \"/\":\n return left / right;\n case \"+\":\n return left + right;\n case \"-\":\n return left - right;\n case \"%\":\n return left % right;\n default:\n return undefined;\n }\n }\n}\n","import { template } from \"@babel/core\";\n\nexport default function transpileNamespace(path, t, allowNamespaces) {\n if (path.node.declare || path.node.id.type === \"StringLiteral\") {\n path.remove();\n return;\n }\n\n if (!allowNamespaces) {\n throw path.hub.file.buildCodeFrameError(\n path.node.id,\n \"Namespace not marked type-only declare.\" +\n \" Non-declarative namespaces are only supported experimentally in Babel.\" +\n \" To enable and review caveats see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n\n const name = path.node.id.name;\n const value = handleNested(path, t, t.cloneDeep(path.node));\n const bound = path.scope.hasOwnBinding(name);\n if (path.parent.type === \"ExportNamedDeclaration\") {\n if (!bound) {\n path.parentPath.insertAfter(value);\n path.replaceWith(getDeclaration(t, name));\n path.scope.registerDeclaration(path.parentPath);\n } else {\n path.parentPath.replaceWith(value);\n }\n } else if (bound) {\n path.replaceWith(value);\n } else {\n path.scope.registerDeclaration(\n path.replaceWithMultiple([getDeclaration(t, name), value])[0],\n );\n }\n}\n\nfunction getDeclaration(t, name) {\n return t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.identifier(name)),\n ]);\n}\n\nfunction getMemberExpression(t, name, itemName) {\n return t.memberExpression(t.identifier(name), t.identifier(itemName));\n}\n\nfunction handleNested(path, t, node, parentExport) {\n const names = new Set();\n const realName = node.id;\n const name = path.scope.generateUid(realName.name);\n const namespaceTopLevel = node.body.body;\n for (let i = 0; i < namespaceTopLevel.length; i++) {\n const subNode = namespaceTopLevel[i];\n\n // The first switch is mainly to detect name usage. Only export\n // declarations require further transformation.\n switch (subNode.type) {\n case \"TSModuleDeclaration\": {\n const transformed = handleNested(path, t, subNode);\n const moduleName = subNode.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(t, moduleName),\n transformed,\n );\n }\n continue;\n }\n case \"TSEnumDeclaration\":\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n names.add(subNode.id.name);\n continue;\n case \"VariableDeclaration\":\n for (const variable of subNode.declarations) {\n names.add(variable.id.name);\n }\n continue;\n default:\n // Neither named declaration nor export, continue to next item.\n continue;\n case \"ExportNamedDeclaration\":\n // Export declarations get parsed using the next switch.\n }\n\n // Transform the export declarations that occur inside of a namespace.\n switch (subNode.declaration.type) {\n case \"TSEnumDeclaration\":\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\": {\n const itemName = subNode.declaration.id.name;\n names.add(itemName);\n namespaceTopLevel.splice(\n i++,\n 1,\n subNode.declaration,\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n getMemberExpression(t, name, itemName),\n t.identifier(itemName),\n ),\n ),\n );\n break;\n }\n case \"VariableDeclaration\":\n if (subNode.declaration.kind !== \"const\") {\n throw path.hub.file.buildCodeFrameError(\n subNode.declaration,\n \"Namespaces exporting non-const are not supported by Babel.\" +\n \" Change to const or see:\" +\n \" https://babeljs.io/docs/en/babel-plugin-transform-typescript\",\n );\n }\n for (const variable of subNode.declaration.declarations) {\n variable.init = t.assignmentExpression(\n \"=\",\n getMemberExpression(t, name, variable.id.name),\n variable.init,\n );\n }\n namespaceTopLevel[i] = subNode.declaration;\n break;\n case \"TSModuleDeclaration\": {\n const transformed = handleNested(\n path,\n t,\n subNode.declaration,\n t.identifier(name),\n );\n const moduleName = subNode.declaration.id.name;\n if (names.has(moduleName)) {\n namespaceTopLevel[i] = transformed;\n } else {\n names.add(moduleName);\n namespaceTopLevel.splice(\n i++,\n 1,\n getDeclaration(t, moduleName),\n transformed,\n );\n }\n }\n }\n }\n\n // {}\n let fallthroughValue = t.objectExpression([]);\n\n if (parentExport) {\n fallthroughValue = template.expression.ast`\n ${parentExport}.${realName} || (\n ${parentExport}.${realName} = ${fallthroughValue}\n )\n `;\n }\n\n return template.statement.ast`\n (function (${t.identifier(name)}) {\n ${namespaceTopLevel}\n })(${realName} || (${realName} = ${fallthroughValue}));\n `;\n}\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport syntaxTypeScript from \"@babel/plugin-syntax-typescript\";\nimport { types as t, template } from \"@babel/core\";\nimport { injectInitialization } from \"@babel/helper-create-class-features-plugin\";\n\nimport transpileEnum from \"./enum\";\nimport transpileNamespace from \"./namespace\";\n\nfunction isInType(path) {\n switch (path.parent.type) {\n case \"TSTypeReference\":\n case \"TSQualifiedName\":\n case \"TSExpressionWithTypeArguments\":\n case \"TSTypeQuery\":\n return true;\n default:\n return false;\n }\n}\n\nconst PARSED_PARAMS = new WeakSet();\nconst GLOBAL_TYPES = new WeakMap();\n\nfunction isGlobalType(path, name) {\n const program = path.find(path => path.isProgram()).node;\n if (path.scope.hasOwnBinding(name)) return false;\n if (GLOBAL_TYPES.get(program).has(name)) return true;\n\n console.warn(\n `The exported identifier \"${name}\" is not declared in Babel's scope tracker\\n` +\n `as a JavaScript value binding, and \"@babel/plugin-transform-typescript\"\\n` +\n `never encountered it as a TypeScript type declaration.\\n` +\n `It will be treated as a JavaScript value.\\n\\n` +\n `This problem is likely caused by another plugin injecting\\n` +\n `\"${name}\" without registering it in the scope tracker. If you are the author\\n` +\n ` of that plugin, please use \"scope.registerDeclaration(declarationPath)\".`,\n );\n\n return false;\n}\n\nfunction registerGlobalType(programScope, name) {\n GLOBAL_TYPES.get(programScope.path.node).add(name);\n}\n\nexport default declare(\n (\n api,\n {\n jsxPragma = \"React\",\n allowNamespaces = false,\n allowDeclareFields = false,\n },\n ) => {\n api.assertVersion(7);\n\n const JSX_ANNOTATION_REGEX = /\\*?\\s*@jsx\\s+([^\\s]+)/;\n\n const classMemberVisitors = {\n field(path) {\n const { node } = path;\n\n if (!allowDeclareFields && node.declare) {\n throw path.buildCodeFrameError(\n `The 'declare' modifier is only allowed when the 'allowDeclareFields' option of ` +\n `@babel/plugin-transform-typescript or @babel/preset-typescript is enabled.`,\n );\n }\n if (node.definite || node.declare) {\n if (node.value) {\n throw path.buildCodeFrameError(\n `Definietly assigned fields and fields with the 'declare' modifier cannot` +\n ` be initialized here, but only in the constructor`,\n );\n }\n\n path.remove();\n } else if (!allowDeclareFields && !node.value && !node.decorators) {\n path.remove();\n }\n\n if (node.accessibility) node.accessibility = null;\n if (node.abstract) node.abstract = null;\n if (node.readonly) node.readonly = null;\n if (node.optional) node.optional = null;\n if (node.typeAnnotation) node.typeAnnotation = null;\n },\n method({ node }) {\n if (node.accessibility) node.accessibility = null;\n if (node.abstract) node.abstract = null;\n if (node.optional) node.optional = null;\n\n // Rest handled by Function visitor\n },\n constructor(path, classPath) {\n if (path.node.accessibility) path.node.accessibility = null;\n // Collects parameter properties so that we can add an assignment\n // for each of them in the constructor body\n //\n // We use a WeakSet to ensure an assignment for a parameter\n // property is only added once. This is necessary for cases like\n // using `transform-classes`, which causes this visitor to run\n // twice.\n const parameterProperties = [];\n for (const param of path.node.params) {\n if (\n param.type === \"TSParameterProperty\" &&\n !PARSED_PARAMS.has(param.parameter)\n ) {\n PARSED_PARAMS.add(param.parameter);\n parameterProperties.push(param.parameter);\n }\n }\n\n if (parameterProperties.length) {\n const assigns = parameterProperties.map(p => {\n let id;\n if (t.isIdentifier(p)) {\n id = p;\n } else if (t.isAssignmentPattern(p) && t.isIdentifier(p.left)) {\n id = p.left;\n } else {\n throw path.buildCodeFrameError(\n \"Parameter properties can not be destructuring patterns.\",\n );\n }\n\n return template.statement.ast`this.${id} = ${id}`;\n });\n\n injectInitialization(classPath, path, assigns);\n }\n },\n };\n\n return {\n name: \"transform-typescript\",\n inherits: syntaxTypeScript,\n\n visitor: {\n //\"Pattern\" alias doesn't include Identifier or RestElement.\n Pattern: visitPattern,\n Identifier: visitPattern,\n RestElement: visitPattern,\n\n Program(path, state) {\n const { file } = state;\n let fileJsxPragma = null;\n\n if (!GLOBAL_TYPES.has(path.node)) {\n GLOBAL_TYPES.set(path.node, new Set());\n }\n\n if (file.ast.comments) {\n for (const comment of (file.ast.comments: Array)) {\n const jsxMatches = JSX_ANNOTATION_REGEX.exec(comment.value);\n if (jsxMatches) {\n fileJsxPragma = jsxMatches[1];\n }\n }\n }\n\n // remove type imports\n for (let stmt of path.get(\"body\")) {\n if (t.isImportDeclaration(stmt)) {\n // Note: this will allow both `import { } from \"m\"` and `import \"m\";`.\n // In TypeScript, the former would be elided.\n if (stmt.node.specifiers.length === 0) {\n continue;\n }\n\n let allElided = true;\n const importsToRemove: Path[] = [];\n\n for (const specifier of stmt.node.specifiers) {\n const binding = stmt.scope.getBinding(specifier.local.name);\n\n // The binding may not exist if the import node was explicitly\n // injected by another plugin. Currently core does not do a good job\n // of keeping scope bindings synchronized with the AST. For now we\n // just bail if there is no binding, since chances are good that if\n // the import statement was injected then it wasn't a typescript type\n // import anyway.\n if (\n binding &&\n isImportTypeOnly({\n binding,\n programPath: path,\n jsxPragma: fileJsxPragma || jsxPragma,\n })\n ) {\n importsToRemove.push(binding.path);\n } else {\n allElided = false;\n }\n }\n\n if (allElided) {\n stmt.remove();\n } else {\n for (const importPath of importsToRemove) {\n importPath.remove();\n }\n }\n\n continue;\n }\n\n if (stmt.isExportDeclaration()) {\n stmt = stmt.get(\"declaration\");\n }\n\n if (stmt.isVariableDeclaration({ declare: true })) {\n for (const name of Object.keys(stmt.getBindingIdentifiers())) {\n registerGlobalType(path.scope, name);\n }\n } else if (\n stmt.isTSTypeAliasDeclaration() ||\n stmt.isTSDeclareFunction() ||\n stmt.isTSInterfaceDeclaration() ||\n stmt.isClassDeclaration({ declare: true }) ||\n stmt.isTSEnumDeclaration({ declare: true }) ||\n (stmt.isTSModuleDeclaration({ declare: true }) &&\n stmt.get(\"id\").isIdentifier())\n ) {\n registerGlobalType(path.scope, stmt.node.id.name);\n }\n }\n },\n\n ExportNamedDeclaration(path) {\n // remove export declaration if it's exporting only types\n if (\n !path.node.source &&\n path.node.specifiers.length > 0 &&\n path.node.specifiers.every(({ local }) =>\n isGlobalType(path, local.name),\n )\n ) {\n path.remove();\n }\n },\n\n ExportSpecifier(path) {\n // remove type exports\n if (!path.parent.source && isGlobalType(path, path.node.local.name)) {\n path.remove();\n }\n },\n\n ExportDefaultDeclaration(path) {\n // remove whole declaration if it's exporting a TS type\n if (\n t.isIdentifier(path.node.declaration) &&\n isGlobalType(path, path.node.declaration.name)\n ) {\n path.remove();\n }\n },\n\n TSDeclareFunction(path) {\n path.remove();\n },\n\n TSDeclareMethod(path) {\n path.remove();\n },\n\n VariableDeclaration(path) {\n if (path.node.declare) {\n path.remove();\n }\n },\n\n VariableDeclarator({ node }) {\n if (node.definite) node.definite = null;\n },\n\n TSIndexSignature(path) {\n path.remove();\n },\n\n ClassDeclaration(path) {\n const { node } = path;\n if (node.declare) {\n path.remove();\n return;\n }\n },\n\n Class(path) {\n const { node } = path;\n\n if (node.typeParameters) node.typeParameters = null;\n if (node.superTypeParameters) node.superTypeParameters = null;\n if (node.implements) node.implements = null;\n if (node.abstract) node.abstract = null;\n\n // Similar to the logic in `transform-flow-strip-types`, we need to\n // handle `TSParameterProperty` and `ClassProperty` here because the\n // class transform would transform the class, causing more specific\n // visitors to not run.\n path.get(\"body.body\").forEach(child => {\n if (child.isClassMethod()) {\n if (child.node.kind === \"constructor\") {\n classMemberVisitors.constructor(child, path);\n } else {\n classMemberVisitors.method(child, path);\n }\n } else if (child.isClassProperty()) {\n classMemberVisitors.field(child, path);\n }\n });\n },\n\n Function({ node }) {\n if (node.typeParameters) node.typeParameters = null;\n if (node.returnType) node.returnType = null;\n\n const p0 = node.params[0];\n if (p0 && t.isIdentifier(p0) && p0.name === \"this\") {\n node.params.shift();\n }\n\n // We replace `TSParameterProperty` here so that transforms that\n // rely on a `Function` visitor to deal with arguments, like\n // `transform-parameters`, work properly.\n node.params = node.params.map(p => {\n return p.type === \"TSParameterProperty\" ? p.parameter : p;\n });\n },\n\n TSModuleDeclaration(path) {\n transpileNamespace(path, t, allowNamespaces);\n },\n\n TSInterfaceDeclaration(path) {\n path.remove();\n },\n\n TSTypeAliasDeclaration(path) {\n path.remove();\n },\n\n TSEnumDeclaration(path) {\n transpileEnum(path, t);\n },\n\n TSImportEqualsDeclaration(path) {\n throw path.buildCodeFrameError(\n \"`import =` is not supported by @babel/plugin-transform-typescript\\n\" +\n \"Please consider using \" +\n \"`import from '';` alongside \" +\n \"Typescript's --allowSyntheticDefaultImports option.\",\n );\n },\n\n TSExportAssignment(path) {\n throw path.buildCodeFrameError(\n \"`export =` is not supported by @babel/plugin-transform-typescript\\n\" +\n \"Please consider using `export ;`.\",\n );\n },\n\n TSTypeAssertion(path) {\n path.replaceWith(path.node.expression);\n },\n\n TSAsExpression(path) {\n let { node } = path;\n do {\n node = node.expression;\n } while (t.isTSAsExpression(node));\n path.replaceWith(node);\n },\n\n TSNonNullExpression(path) {\n path.replaceWith(path.node.expression);\n },\n\n CallExpression(path) {\n path.node.typeParameters = null;\n },\n\n NewExpression(path) {\n path.node.typeParameters = null;\n },\n\n JSXOpeningElement(path) {\n path.node.typeParameters = null;\n },\n\n TaggedTemplateExpression(path) {\n path.node.typeParameters = null;\n },\n },\n };\n\n function visitPattern({ node }) {\n if (node.typeAnnotation) node.typeAnnotation = null;\n if (t.isIdentifier(node) && node.optional) node.optional = null;\n // 'access' and 'readonly' are only for parameter properties, so constructor visitor will handle them.\n }\n\n function isImportTypeOnly({ binding, programPath, jsxPragma }) {\n for (const path of binding.referencePaths) {\n if (!isInType(path)) {\n return false;\n }\n }\n\n if (binding.identifier.name !== jsxPragma) {\n return true;\n }\n\n // \"React\" or the JSX pragma is referenced as a value if there are any JSX elements in the code.\n let sourceFileHasJsx = false;\n programPath.traverse({\n JSXElement() {\n sourceFileHasJsx = true;\n },\n JSXFragment() {\n sourceFileHasJsx = true;\n },\n });\n return !sourceFileHasJsx;\n }\n },\n);\n","/* eslint-disable @babel/development/plugin-name */\nimport { createRegExpFeaturePlugin } from \"@babel/helper-create-regexp-features-plugin\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(7);\n\n return createRegExpFeaturePlugin({\n name: \"transform-unicode-regex\",\n feature: \"unicodeFlag\",\n });\n});\n","// @flow\n/*\n * This file is auto-generated! Do not modify it directly.\n * To re-generate run 'make build'\n */\nimport externalHelpers from \"@babel/plugin-external-helpers\";\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport syntaxClassProperties from \"@babel/plugin-syntax-class-properties\";\nimport syntaxDecorators from \"@babel/plugin-syntax-decorators\";\nimport syntaxDoExpressions from \"@babel/plugin-syntax-do-expressions\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport syntaxExportDefaultFrom from \"@babel/plugin-syntax-export-default-from\";\nimport syntaxExportNamespaceFrom from \"@babel/plugin-syntax-export-namespace-from\";\nimport syntaxFlow from \"@babel/plugin-syntax-flow\";\nimport syntaxFunctionBind from \"@babel/plugin-syntax-function-bind\";\nimport syntaxFunctionSent from \"@babel/plugin-syntax-function-sent\";\nimport syntaxImportMeta from \"@babel/plugin-syntax-import-meta\";\nimport syntaxJsx from \"@babel/plugin-syntax-jsx\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\nimport syntaxPipelineOperator from \"@babel/plugin-syntax-pipeline-operator\";\nimport syntaxTopLevelAwait from \"@babel/plugin-syntax-top-level-await\";\nimport syntaxTypescript from \"@babel/plugin-syntax-typescript\";\nimport proposalAsyncGeneratorFunctions from \"@babel/plugin-proposal-async-generator-functions\";\nimport proposalClassProperties from \"@babel/plugin-proposal-class-properties\";\nimport proposalDecorators from \"@babel/plugin-proposal-decorators\";\nimport proposalDoExpressions from \"@babel/plugin-proposal-do-expressions\";\nimport proposalDynamicImport from \"@babel/plugin-proposal-dynamic-import\";\nimport proposalExportDefaultFrom from \"@babel/plugin-proposal-export-default-from\";\nimport proposalExportNamespaceFrom from \"@babel/plugin-proposal-export-namespace-from\";\nimport proposalFunctionBind from \"@babel/plugin-proposal-function-bind\";\nimport proposalFunctionSent from \"@babel/plugin-proposal-function-sent\";\nimport proposalJsonStrings from \"@babel/plugin-proposal-json-strings\";\nimport proposalLogicalAssignmentOperators from \"@babel/plugin-proposal-logical-assignment-operators\";\nimport proposalNullishCoalescingOperator from \"@babel/plugin-proposal-nullish-coalescing-operator\";\nimport proposalNumericSeparator from \"@babel/plugin-proposal-numeric-separator\";\nimport proposalObjectRestSpread from \"@babel/plugin-proposal-object-rest-spread\";\nimport proposalOptionalCatchBinding from \"@babel/plugin-proposal-optional-catch-binding\";\nimport proposalOptionalChaining from \"@babel/plugin-proposal-optional-chaining\";\nimport proposalPipelineOperator from \"@babel/plugin-proposal-pipeline-operator\";\nimport proposalPrivateMethods from \"@babel/plugin-proposal-private-methods\";\nimport proposalThrowExpressions from \"@babel/plugin-proposal-throw-expressions\";\nimport proposalUnicodePropertyRegex from \"@babel/plugin-proposal-unicode-property-regex\";\nimport transformAsyncToGenerator from \"@babel/plugin-transform-async-to-generator\";\nimport transformArrowFunctions from \"@babel/plugin-transform-arrow-functions\";\nimport transformBlockScopedFunctions from \"@babel/plugin-transform-block-scoped-functions\";\nimport transformBlockScoping from \"@babel/plugin-transform-block-scoping\";\nimport transformClasses from \"@babel/plugin-transform-classes\";\nimport transformComputedProperties from \"@babel/plugin-transform-computed-properties\";\nimport transformDestructuring from \"@babel/plugin-transform-destructuring\";\nimport transformDotallRegex from \"@babel/plugin-transform-dotall-regex\";\nimport transformDuplicateKeys from \"@babel/plugin-transform-duplicate-keys\";\nimport transformExponentiationOperator from \"@babel/plugin-transform-exponentiation-operator\";\nimport transformFlowComments from \"@babel/plugin-transform-flow-comments\";\nimport transformFlowStripTypes from \"@babel/plugin-transform-flow-strip-types\";\nimport transformForOf from \"@babel/plugin-transform-for-of\";\nimport transformFunctionName from \"@babel/plugin-transform-function-name\";\nimport transformInstanceof from \"@babel/plugin-transform-instanceof\";\nimport transformJscript from \"@babel/plugin-transform-jscript\";\nimport transformLiterals from \"@babel/plugin-transform-literals\";\nimport transformMemberExpressionLiterals from \"@babel/plugin-transform-member-expression-literals\";\nimport transformModulesAmd from \"@babel/plugin-transform-modules-amd\";\nimport transformModulesCommonjs from \"@babel/plugin-transform-modules-commonjs\";\nimport transformModulesSystemjs from \"@babel/plugin-transform-modules-systemjs\";\nimport transformModulesUmd from \"@babel/plugin-transform-modules-umd\";\nimport transformNamedCapturingGroupsRegex from \"@babel/plugin-transform-named-capturing-groups-regex\";\nimport transformNewTarget from \"@babel/plugin-transform-new-target\";\nimport transformObjectAssign from \"@babel/plugin-transform-object-assign\";\nimport transformObjectSuper from \"@babel/plugin-transform-object-super\";\nimport transformObjectSetPrototypeOfToAssign from \"@babel/plugin-transform-object-set-prototype-of-to-assign\";\nimport transformParameters from \"@babel/plugin-transform-parameters\";\nimport transformPropertyLiterals from \"@babel/plugin-transform-property-literals\";\nimport transformPropertyMutators from \"@babel/plugin-transform-property-mutators\";\nimport transformProtoToAssign from \"@babel/plugin-transform-proto-to-assign\";\nimport transformReactConstantElements from \"@babel/plugin-transform-react-constant-elements\";\nimport transformReactDisplayName from \"@babel/plugin-transform-react-display-name\";\nimport transformReactInlineElements from \"@babel/plugin-transform-react-inline-elements\";\nimport transformReactJsx from \"@babel/plugin-transform-react-jsx\";\nimport transformReactJsxCompat from \"@babel/plugin-transform-react-jsx-compat\";\nimport transformReactJsxSelf from \"@babel/plugin-transform-react-jsx-self\";\nimport transformReactJsxSource from \"@babel/plugin-transform-react-jsx-source\";\nimport transformRegenerator from \"@babel/plugin-transform-regenerator\";\nimport transformReservedWords from \"@babel/plugin-transform-reserved-words\";\nimport transformRuntime from \"@babel/plugin-transform-runtime\";\nimport transformShorthandProperties from \"@babel/plugin-transform-shorthand-properties\";\nimport transformSpread from \"@babel/plugin-transform-spread\";\nimport transformStickyRegex from \"@babel/plugin-transform-sticky-regex\";\nimport transformStrictMode from \"@babel/plugin-transform-strict-mode\";\nimport transformTemplateLiterals from \"@babel/plugin-transform-template-literals\";\nimport transformTypeofSymbol from \"@babel/plugin-transform-typeof-symbol\";\nimport transformTypescript from \"@babel/plugin-transform-typescript\";\nimport transformUnicodeRegex from \"@babel/plugin-transform-unicode-regex\";\n\nexport {\n externalHelpers,\n syntaxAsyncGenerators,\n syntaxClassProperties,\n syntaxDecorators,\n syntaxDoExpressions,\n syntaxDynamicImport,\n syntaxExportDefaultFrom,\n syntaxExportNamespaceFrom,\n syntaxFlow,\n syntaxFunctionBind,\n syntaxFunctionSent,\n syntaxImportMeta,\n syntaxJsx,\n syntaxObjectRestSpread,\n syntaxOptionalCatchBinding,\n syntaxPipelineOperator,\n syntaxTopLevelAwait,\n syntaxTypescript,\n proposalAsyncGeneratorFunctions,\n proposalClassProperties,\n proposalDecorators,\n proposalDoExpressions,\n proposalDynamicImport,\n proposalExportDefaultFrom,\n proposalExportNamespaceFrom,\n proposalFunctionBind,\n proposalFunctionSent,\n proposalJsonStrings,\n proposalLogicalAssignmentOperators,\n proposalNullishCoalescingOperator,\n proposalNumericSeparator,\n proposalObjectRestSpread,\n proposalOptionalCatchBinding,\n proposalOptionalChaining,\n proposalPipelineOperator,\n proposalPrivateMethods,\n proposalThrowExpressions,\n proposalUnicodePropertyRegex,\n transformAsyncToGenerator,\n transformArrowFunctions,\n transformBlockScopedFunctions,\n transformBlockScoping,\n transformClasses,\n transformComputedProperties,\n transformDestructuring,\n transformDotallRegex,\n transformDuplicateKeys,\n transformExponentiationOperator,\n transformFlowComments,\n transformFlowStripTypes,\n transformForOf,\n transformFunctionName,\n transformInstanceof,\n transformJscript,\n transformLiterals,\n transformMemberExpressionLiterals,\n transformModulesAmd,\n transformModulesCommonjs,\n transformModulesSystemjs,\n transformModulesUmd,\n transformNamedCapturingGroupsRegex,\n transformNewTarget,\n transformObjectAssign,\n transformObjectSuper,\n transformObjectSetPrototypeOfToAssign,\n transformParameters,\n transformPropertyLiterals,\n transformPropertyMutators,\n transformProtoToAssign,\n transformReactConstantElements,\n transformReactDisplayName,\n transformReactInlineElements,\n transformReactJsx,\n transformReactJsxCompat,\n transformReactJsxSelf,\n transformReactJsxSource,\n transformRegenerator,\n transformReservedWords,\n transformRuntime,\n transformShorthandProperties,\n transformSpread,\n transformStickyRegex,\n transformStrictMode,\n transformTemplateLiterals,\n transformTypeofSymbol,\n transformTypescript,\n transformUnicodeRegex,\n};\n\nexport const all = {\n \"external-helpers\": externalHelpers,\n \"syntax-async-generators\": syntaxAsyncGenerators,\n \"syntax-class-properties\": syntaxClassProperties,\n \"syntax-decorators\": syntaxDecorators,\n \"syntax-do-expressions\": syntaxDoExpressions,\n \"syntax-dynamic-import\": syntaxDynamicImport,\n \"syntax-export-default-from\": syntaxExportDefaultFrom,\n \"syntax-export-namespace-from\": syntaxExportNamespaceFrom,\n \"syntax-flow\": syntaxFlow,\n \"syntax-function-bind\": syntaxFunctionBind,\n \"syntax-function-sent\": syntaxFunctionSent,\n \"syntax-import-meta\": syntaxImportMeta,\n \"syntax-jsx\": syntaxJsx,\n \"syntax-object-rest-spread\": syntaxObjectRestSpread,\n \"syntax-optional-catch-binding\": syntaxOptionalCatchBinding,\n \"syntax-pipeline-operator\": syntaxPipelineOperator,\n \"syntax-top-level-await\": syntaxTopLevelAwait,\n \"syntax-typescript\": syntaxTypescript,\n \"proposal-async-generator-functions\": proposalAsyncGeneratorFunctions,\n \"proposal-class-properties\": proposalClassProperties,\n \"proposal-decorators\": proposalDecorators,\n \"proposal-do-expressions\": proposalDoExpressions,\n \"proposal-dynamic-import\": proposalDynamicImport,\n \"proposal-export-default-from\": proposalExportDefaultFrom,\n \"proposal-export-namespace-from\": proposalExportNamespaceFrom,\n \"proposal-function-bind\": proposalFunctionBind,\n \"proposal-function-sent\": proposalFunctionSent,\n \"proposal-json-strings\": proposalJsonStrings,\n \"proposal-logical-assignment-operators\": proposalLogicalAssignmentOperators,\n \"proposal-nullish-coalescing-operator\": proposalNullishCoalescingOperator,\n \"proposal-numeric-separator\": proposalNumericSeparator,\n \"proposal-object-rest-spread\": proposalObjectRestSpread,\n \"proposal-optional-catch-binding\": proposalOptionalCatchBinding,\n \"proposal-optional-chaining\": proposalOptionalChaining,\n \"proposal-pipeline-operator\": proposalPipelineOperator,\n \"proposal-private-methods\": proposalPrivateMethods,\n \"proposal-throw-expressions\": proposalThrowExpressions,\n \"proposal-unicode-property-regex\": proposalUnicodePropertyRegex,\n \"transform-async-to-generator\": transformAsyncToGenerator,\n \"transform-arrow-functions\": transformArrowFunctions,\n \"transform-block-scoped-functions\": transformBlockScopedFunctions,\n \"transform-block-scoping\": transformBlockScoping,\n \"transform-classes\": transformClasses,\n \"transform-computed-properties\": transformComputedProperties,\n \"transform-destructuring\": transformDestructuring,\n \"transform-dotall-regex\": transformDotallRegex,\n \"transform-duplicate-keys\": transformDuplicateKeys,\n \"transform-exponentiation-operator\": transformExponentiationOperator,\n \"transform-flow-comments\": transformFlowComments,\n \"transform-flow-strip-types\": transformFlowStripTypes,\n \"transform-for-of\": transformForOf,\n \"transform-function-name\": transformFunctionName,\n \"transform-instanceof\": transformInstanceof,\n \"transform-jscript\": transformJscript,\n \"transform-literals\": transformLiterals,\n \"transform-member-expression-literals\": transformMemberExpressionLiterals,\n \"transform-modules-amd\": transformModulesAmd,\n \"transform-modules-commonjs\": transformModulesCommonjs,\n \"transform-modules-systemjs\": transformModulesSystemjs,\n \"transform-modules-umd\": transformModulesUmd,\n \"transform-named-capturing-groups-regex\": transformNamedCapturingGroupsRegex,\n \"transform-new-target\": transformNewTarget,\n \"transform-object-assign\": transformObjectAssign,\n \"transform-object-super\": transformObjectSuper,\n \"transform-object-set-prototype-of-to-assign\": transformObjectSetPrototypeOfToAssign,\n \"transform-parameters\": transformParameters,\n \"transform-property-literals\": transformPropertyLiterals,\n \"transform-property-mutators\": transformPropertyMutators,\n \"transform-proto-to-assign\": transformProtoToAssign,\n \"transform-react-constant-elements\": transformReactConstantElements,\n \"transform-react-display-name\": transformReactDisplayName,\n \"transform-react-inline-elements\": transformReactInlineElements,\n \"transform-react-jsx\": transformReactJsx,\n \"transform-react-jsx-compat\": transformReactJsxCompat,\n \"transform-react-jsx-self\": transformReactJsxSelf,\n \"transform-react-jsx-source\": transformReactJsxSource,\n \"transform-regenerator\": transformRegenerator,\n \"transform-reserved-words\": transformReservedWords,\n \"transform-runtime\": transformRuntime,\n \"transform-shorthand-properties\": transformShorthandProperties,\n \"transform-spread\": transformSpread,\n \"transform-sticky-regex\": transformStickyRegex,\n \"transform-strict-mode\": transformStrictMode,\n \"transform-template-literals\": transformTemplateLiterals,\n \"transform-typeof-symbol\": transformTypeofSymbol,\n \"transform-typescript\": transformTypescript,\n \"transform-unicode-regex\": transformUnicodeRegex,\n};\n","// @flow\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object): Object => {\n let loose = false;\n let modules = \"commonjs\";\n let spec = false;\n\n if (opts !== undefined) {\n if (opts.loose !== undefined) loose = opts.loose;\n if (opts.modules !== undefined) modules = opts.modules;\n if (opts.spec !== undefined) spec = opts.spec;\n }\n\n // be DRY\n const optsLoose = { loose };\n\n return {\n plugins: [\n [babelPlugins.transformTemplateLiterals, { loose, spec }],\n babelPlugins.transformLiterals,\n babelPlugins.transformFunctionName,\n [babelPlugins.transformArrowFunctions, { spec }],\n babelPlugins.transformBlockScopedFunctions,\n [babelPlugins.transformClasses, optsLoose],\n babelPlugins.transformObjectSuper,\n babelPlugins.transformShorthandProperties,\n babelPlugins.transformDuplicateKeys,\n [babelPlugins.transformComputedProperties, optsLoose],\n [babelPlugins.transformForOf, optsLoose],\n babelPlugins.transformStickyRegex,\n babelPlugins.transformUnicodeRegex,\n [babelPlugins.transformSpread, optsLoose],\n [babelPlugins.transformParameters, optsLoose],\n [babelPlugins.transformDestructuring, optsLoose],\n babelPlugins.transformBlockScoping,\n babelPlugins.transformTypeofSymbol,\n babelPlugins.transformInstanceof,\n (modules === \"commonjs\" || modules === \"cjs\") && [\n babelPlugins.transformModulesCommonjs,\n optsLoose,\n ],\n modules === \"systemjs\" && [\n babelPlugins.transformModulesSystemjs,\n optsLoose,\n ],\n modules === \"amd\" && [babelPlugins.transformModulesAmd, optsLoose],\n modules === \"umd\" && [babelPlugins.transformModulesUmd, optsLoose],\n [\n babelPlugins.transformRegenerator,\n { async: false, asyncGenerators: false },\n ],\n ].filter(Boolean), // filter out falsy values\n };\n};\n","// @flow\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object) => {\n let loose = false;\n\n if (opts !== undefined) {\n if (opts.loose !== undefined) loose = opts.loose;\n }\n\n return {\n plugins: [\n babelPlugins.syntaxDynamicImport,\n babelPlugins.syntaxImportMeta,\n [babelPlugins.proposalOptionalChaining, { loose }],\n [babelPlugins.proposalNullishCoalescingOperator, { loose }],\n [babelPlugins.proposalClassProperties, { loose }],\n babelPlugins.proposalJsonStrings,\n [babelPlugins.proposalPrivateMethods, { loose }],\n ],\n };\n};\n","// @flow\nimport presetStage3 from \"./preset-stage-3\";\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n } = opts;\n\n return {\n presets: [[presetStage3, { loose, useBuiltIns }]],\n plugins: [\n [\n babelPlugins.proposalDecorators,\n { legacy: decoratorsLegacy, decoratorsBeforeExport },\n ],\n babelPlugins.proposalFunctionSent,\n babelPlugins.proposalExportNamespaceFrom,\n babelPlugins.proposalNumericSeparator,\n babelPlugins.proposalThrowExpressions,\n ],\n };\n};\n","// @flow\nimport presetStage2 from \"./preset-stage-2\";\nimport * as babelPlugins from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n pipelineProposal = \"minimal\",\n } = opts;\n\n return {\n presets: [\n [\n presetStage2,\n { loose, useBuiltIns, decoratorsLegacy, decoratorsBeforeExport },\n ],\n ],\n plugins: [\n babelPlugins.proposalExportDefaultFrom,\n babelPlugins.proposalLogicalAssignmentOperators,\n [babelPlugins.proposalPipelineOperator, { proposal: pipelineProposal }],\n babelPlugins.proposalDoExpressions,\n ],\n };\n};\n","// @flow\nimport presetStage1 from \"./preset-stage-1\";\nimport { proposalFunctionBind } from \"./generated/plugins\";\n\nexport default (_: any, opts: Object = {}) => {\n const {\n loose = false,\n useBuiltIns = false,\n decoratorsLegacy = false,\n decoratorsBeforeExport,\n pipelineProposal = \"minimal\",\n } = opts;\n\n return {\n presets: [\n [\n presetStage1,\n {\n loose,\n useBuiltIns,\n decoratorsLegacy,\n decoratorsBeforeExport,\n pipelineProposal,\n },\n ],\n ],\n plugins: [proposalFunctionBind],\n };\n};\n","module.exports={A:\"ie\",B:\"edge\",C:\"firefox\",D:\"chrome\",E:\"safari\",F:\"opera\",G:\"ios_saf\",H:\"op_mini\",I:\"android\",J:\"bb\",K:\"op_mob\",L:\"and_chr\",M:\"and_ff\",N:\"ie_mob\",O:\"and_uc\",P:\"samsung\",Q:\"and_qq\",R:\"baidu\",S:\"kaios\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browsers = exports.browsers = require('../../data/browsers');","module.exports={\"0\":\"56\",\"1\":\"57\",\"2\":\"58\",\"3\":\"60\",\"4\":\"62\",\"5\":\"63\",\"6\":\"64\",\"7\":\"11.1\",\"8\":\"68\",\"9\":\"12.1\",A:\"10\",B:\"11\",C:\"12\",D:\"7\",E:\"9\",F:\"4\",G:\"8\",H:\"6\",I:\"17\",J:\"18\",K:\"13\",L:\"15\",M:\"46\",N:\"16\",O:\"5\",P:\"19\",Q:\"20\",R:\"21\",S:\"22\",T:\"23\",U:\"24\",V:\"25\",W:\"26\",X:\"27\",Y:\"28\",Z:\"29\",a:\"30\",b:\"31\",c:\"32\",d:\"33\",e:\"34\",f:\"14\",g:\"36\",h:\"37\",i:\"38\",j:\"39\",k:\"40\",l:\"41\",m:\"42\",n:\"43\",o:\"44\",p:\"45\",q:\"76\",r:\"47\",s:\"48\",t:\"49\",u:\"50\",v:\"51\",w:\"52\",x:\"53\",y:\"54\",z:\"55\",AB:\"35\",BB:\"66\",CB:\"4.2-4.3\",DB:\"65\",EB:\"59\",FB:\"67\",GB:\"11.5\",HB:\"69\",IB:\"70\",JB:\"71\",KB:\"72\",LB:\"73\",MB:\"61\",NB:\"3\",OB:\"10.1\",PB:\"3.2\",QB:\"78\",RB:\"9.0-9.2\",SB:\"77\",TB:\"80\",UB:\"81\",VB:\"3.1\",WB:\"75\",XB:\"5.1\",YB:\"6.1\",ZB:\"7.1\",aB:\"9.1\",bB:\"74\",cB:\"3.6\",dB:\"3.5\",eB:\"TP\",fB:\"9.5-9.6\",gB:\"10.0-10.1\",hB:\"10.5\",iB:\"10.6\",jB:\"2\",kB:\"11.6\",lB:\"4.0-4.1\",mB:\"5.5\",nB:\"5.0-5.1\",oB:\"6.0-6.1\",pB:\"7.0-7.1\",qB:\"8.1-8.4\",rB:\"79\",sB:\"9.3\",tB:\"10.0-10.2\",uB:\"10.3\",vB:\"11.0-11.2\",wB:\"11.3-11.4\",xB:\"12.0-12.1\",yB:\"12.2-12.4\",zB:\"13.0-13.1\",\"0B\":\"13.2\",\"1B\":\"13.3\",\"2B\":\"all\",\"3B\":\"2.1\",\"4B\":\"2.2\",\"5B\":\"2.3\",\"6B\":\"4.1\",\"7B\":\"4.4\",\"8B\":\"4.4.3-4.4.4\",\"9B\":\"12.12\",AC:\"5.0-5.4\",BC:\"6.2-6.4\",CC:\"7.2-7.4\",DC:\"8.2\",EC:\"9.2\",FC:\"1.2\",GC:\"7.12\",HC:\"2.5\"};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar browserVersions = exports.browserVersions = require('../../data/browserVersions');","module.exports={A:{A:{H:0.0092277,D:0.0092277,G:0.110732,E:0.0415246,A:0.0369108,B:1.43029,mB:0.009298},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"mB\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE\",F:{mB:962323200,H:998870400,D:1161129600,G:1237420800,E:1300060800,A:1346716800,B:1381968000}},B:{A:{C:0.008806,K:0.008806,f:0.017612,L:0.017612,N:0.039627,I:0.149702,J:1.79642,q:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"q\",\"\",\"\"],E:\"Edge\",F:{C:1438128000,K:1447286400,f:1470096000,L:1491868800,N:1508198400,I:1525046400,J:1542067200,q:null},D:{C:\"ms\",K:\"ms\",f:\"ms\",L:\"ms\",N:\"ms\",I:\"ms\",J:\"ms\"}},C:{A:{\"0\":0.026418,\"1\":0.013209,\"2\":0.008806,\"3\":0.039627,\"4\":0.008806,\"5\":0.017612,\"6\":0.026418,\"8\":0.13209,jB:0.004827,NB:0.00487,F:0.00974,O:0.004879,H:0.020136,D:0.005725,G:0.004525,E:0.00533,A:0.004283,B:0.009042,C:0.004471,K:0.004486,f:0.00453,L:0.004465,N:0.004417,I:0.008922,J:0.004393,P:0.004443,Q:0.004283,R:0.008806,S:0.004393,T:0.004525,U:0.008786,V:0.004403,W:0.004317,X:0.004393,Y:0.004418,Z:0.008834,a:0.004403,b:0.008928,c:0.004471,d:0.008922,e:0.004707,AB:0.022015,g:0.004465,h:0.004783,i:0.008806,j:0.004783,k:0.00487,l:0.005029,m:0.0047,n:0.008806,o:0.008806,p:0.013209,M:0.004525,r:0.022015,s:0.030821,t:0.004403,u:0.013209,v:0.008806,w:0.145299,x:0.008806,y:0.013209,z:0.008806,EB:0.008806,MB:0.013209,DB:0.052836,BB:0.04403,FB:0.026418,HB:0.074851,IB:0.761719,JB:2.42605,KB:0.057239,LB:0,dB:0.008786,cB:0.00487},B:\"moz\",C:[\"\",\"\",\"\",\"jB\",\"NB\",\"dB\",\"cB\",\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"\"],E:\"Firefox\",F:{\"0\":1506556800,\"1\":1510617600,\"2\":1516665600,\"3\":1525824000,\"4\":1536105600,\"5\":1540252800,\"6\":1544486400,\"8\":1562630400,jB:1161648000,NB:1213660800,dB:1246320000,cB:1264032000,F:1300752000,O:1308614400,H:1313452800,D:1317081600,G:1317081600,E:1320710400,A:1324339200,B:1327968000,C:1331596800,K:1335225600,f:1338854400,L:1342483200,N:1346112000,I:1349740800,J:1353628800,P:1357603200,Q:1361232000,R:1364860800,S:1368489600,T:1372118400,U:1375747200,V:1379376000,W:1386633600,X:1391472000,Y:1395100800,Z:1398729600,a:1402358400,b:1405987200,c:1409616000,d:1413244800,e:1417392000,AB:1421107200,g:1424736000,h:1428278400,i:1431475200,j:1435881600,k:1439251200,l:1442880000,m:1446508800,n:1450137600,o:1453852800,p:1457395200,M:1461628800,r:1465257600,s:1470096000,t:1474329600,u:1479168000,v:1485216000,w:1488844800,x:1492560000,y:1497312000,z:1502150400,EB:1520985600,MB:1529971200,DB:1548720000,BB:1552953600,FB:1558396800,HB:1567468800,IB:1571788800,JB:1575331200,KB:null,LB:null}},D:{A:{\"0\":0.035224,\"1\":0.066045,\"2\":0.030821,\"3\":0.030821,\"4\":0.030821,\"5\":0.277389,\"6\":0.017612,\"8\":0.061642,F:0.004706,O:0.004879,H:0.004879,D:0.005591,G:0.005591,E:0.005591,A:0.004534,B:0.004464,C:0.010424,K:0.004403,f:0.004706,L:0.015087,N:0.004393,I:0.004393,J:0.008652,P:0.004418,Q:0.004393,R:0.004317,S:0.004465,T:0.008786,U:0.008806,V:0.004461,W:0.004403,X:0.004326,Y:0.0047,Z:0.004461,a:0.004403,b:0.013209,c:0.004465,d:0.013209,e:0.008806,AB:0.008806,g:0.008806,h:0.004464,i:0.022015,j:0.004464,k:0.013209,l:0.008806,m:0.004403,n:0.017612,o:0.004465,p:0.004403,M:0.004403,r:0.008806,s:0.035224,t:0.515151,u:0.008806,v:0.013209,w:0.004403,x:0.022015,y:0.026418,z:0.04403,EB:0.017612,MB:0.035224,DB:0.052836,BB:0.035224,FB:0.066045,HB:0.184926,IB:0.149702,JB:0.198135,KB:0.206941,LB:0.184926,bB:0.224553,WB:0.268583,q:0.281792,SB:0.409479,QB:13.9971,rB:11.5006,TB:0.039627,UB:0.017612},B:\"webkit\",C:[\"F\",\"O\",\"H\",\"D\",\"G\",\"E\",\"A\",\"B\",\"C\",\"K\",\"f\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"EB\",\"3\",\"MB\",\"4\",\"5\",\"6\",\"DB\",\"BB\",\"FB\",\"8\",\"HB\",\"IB\",\"JB\",\"KB\",\"LB\",\"bB\",\"WB\",\"q\",\"SB\",\"QB\",\"rB\",\"TB\",\"UB\"],E:\"Chrome\",F:{\"0\":1485302400,\"1\":1489017600,\"2\":1492560000,\"3\":1500940800,\"4\":1508198400,\"5\":1512518400,\"6\":1516752000,\"8\":1532390400,F:1264377600,O:1274745600,H:1283385600,D:1287619200,G:1291248000,E:1296777600,A:1299542400,B:1303862400,C:1307404800,K:1312243200,f:1316131200,L:1316131200,N:1319500800,I:1323734400,J:1328659200,P:1332892800,Q:1337040000,R:1340668800,S:1343692800,T:1348531200,U:1352246400,V:1357862400,W:1361404800,X:1364428800,Y:1369094400,Z:1374105600,a:1376956800,b:1384214400,c:1389657600,d:1392940800,e:1397001600,AB:1400544000,g:1405468800,h:1409011200,i:1412640000,j:1416268800,k:1421798400,l:1425513600,m:1429401600,n:1432080000,o:1437523200,p:1441152000,M:1444780800,r:1449014400,s:1453248000,t:1456963200,u:1460592000,v:1464134400,w:1469059200,x:1472601600,y:1476230400,z:1480550400,EB:1496707200,MB:1504569600,DB:1520294400,BB:1523923200,FB:1527552000,HB:1536019200,IB:1539648000,JB:1543968000,KB:1548720000,LB:1552348800,bB:1555977600,WB:1559606400,q:1564444800,SB:1568073600,QB:1571702400,rB:null,TB:null,UB:null}},E:{A:{\"7\":0.184926,\"9\":0.435897,F:0,O:0.004403,H:0.004349,D:0.004465,G:0.026418,E:0.013209,A:0.017612,B:0.039627,C:0.136493,K:2.29396,VB:0,PB:0.008692,XB:0.66045,YB:0.00456,ZB:0.004283,aB:0.035224,OB:0.096866,eB:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"VB\",\"PB\",\"F\",\"O\",\"XB\",\"H\",\"YB\",\"D\",\"ZB\",\"G\",\"E\",\"aB\",\"A\",\"OB\",\"B\",\"7\",\"C\",\"9\",\"K\",\"eB\",\"\",\"\"],E:\"Safari\",F:{\"7\":1522281600,\"9\":1553472000,VB:1205798400,PB:1226534400,F:1244419200,O:1275868800,XB:1311120000,H:1343174400,YB:1382400000,D:1382400000,ZB:1410998400,G:1413417600,E:1443657600,aB:1458518400,A:1474329600,OB:1490572800,B:1505779200,C:1537142400,K:1568851200,eB:null}},F:{A:{\"0\":0.008806,\"1\":0.008806,\"2\":0.013209,\"3\":0.004403,\"4\":0.004403,\"5\":0.013209,\"6\":0.070448,\"7\":0.006229,\"9\":0.008806,E:0.0082,B:0.016581,C:0.004317,L:0.00685,N:0.00685,I:0.00685,J:0.005014,P:0.006015,Q:0.004879,R:0.006597,S:0.006597,T:0.013434,U:0.006702,V:0.006015,W:0.005595,X:0.004393,Y:0.008652,Z:0.004879,a:0.004879,b:0.008806,c:0.005152,d:0.005014,e:0.009758,AB:0.004879,g:0.013209,h:0.004283,i:0.004367,j:0.004534,k:0.004367,l:0.004227,m:0.004418,n:0.009042,o:0.004227,p:0.004725,M:0.004417,r:0.008942,s:0.004707,t:0.004827,u:0.004707,v:0.004707,w:0.004326,x:0.008922,y:0.014349,z:0.004725,fB:0.00685,gB:0,hB:0.008392,iB:0.004706,GB:0.004879,kB:0.008786},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"E\",\"fB\",\"gB\",\"hB\",\"iB\",\"B\",\"7\",\"GB\",\"kB\",\"C\",\"9\",\"L\",\"N\",\"I\",\"J\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\",\"a\",\"b\",\"c\",\"d\",\"e\",\"AB\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"M\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\",\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"\",\"\",\"\"],E:\"Opera\",F:{\"0\":1537833600,\"1\":1543363200,\"2\":1548201600,\"3\":1554768000,\"4\":1561593600,\"5\":1566259200,\"6\":1570406400,\"7\":1302566400,\"9\":1352073600,E:1150761600,fB:1223424000,gB:1251763200,hB:1267488000,iB:1277942400,B:1292457600,GB:1309219200,kB:1323129600,C:1323129600,L:1372723200,N:1377561600,I:1381104000,J:1386288000,P:1390867200,Q:1393891200,R:1399334400,S:1401753600,T:1405987200,U:1409616000,V:1413331200,W:1417132800,X:1422316800,Y:1425945600,Z:1430179200,a:1433808000,b:1438646400,c:1442448000,d:1445904000,e:1449100800,AB:1454371200,g:1457308800,h:1462320000,i:1465344000,j:1470096000,k:1474329600,l:1477267200,m:1481587200,n:1486425600,o:1490054400,p:1494374400,M:1498003200,r:1502236800,s:1506470400,t:1510099200,u:1515024000,v:1517961600,w:1521676800,x:1525910400,y:1530144000,z:1534982400},D:{\"7\":\"o\",\"9\":\"o\",E:\"o\",B:\"o\",C:\"o\",fB:\"o\",gB:\"o\",hB:\"o\",iB:\"o\",GB:\"o\",kB:\"o\"}},G:{A:{G:0.00128072,PB:0.00512289,lB:0.00256144,CB:0,nB:0.00768433,oB:0.00256144,pB:0.00896505,qB:0.0166494,RB:0.0153687,sB:0.162652,tB:0.0563518,uB:0.181862,vB:0.153687,wB:0.274074,xB:0.391901,yB:2.77404,zB:4.02787,\"0B\":1.83399,\"1B\":2.88931},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"PB\",\"lB\",\"CB\",\"nB\",\"oB\",\"pB\",\"G\",\"qB\",\"RB\",\"sB\",\"tB\",\"uB\",\"vB\",\"wB\",\"xB\",\"yB\",\"zB\",\"0B\",\"1B\",\"\",\"\"],E:\"iOS Safari\",F:{PB:1270252800,lB:1283904000,CB:1299628800,nB:1331078400,oB:1359331200,pB:1394409600,G:1410912000,qB:1413763200,RB:1442361600,sB:1458518400,tB:1473724800,uB:1490572800,vB:1505779200,wB:1522281600,xB:1537142400,yB:1553472000,zB:1568851200,\"0B\":1572220800,\"1B\":null}},H:{A:{\"2B\":1.16575},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"2B\",\"\",\"\",\"\"],E:\"Opera Mini\",F:{\"2B\":1426464000}},I:{A:{NB:0.000748894,F:0.00324521,q:0,\"3B\":0,\"4B\":0.000499263,\"5B\":0.000499263,\"6B\":0.00574152,CB:0.125565,\"7B\":0,\"8B\":0.0763872},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"3B\",\"4B\",\"5B\",\"NB\",\"F\",\"6B\",\"CB\",\"7B\",\"8B\",\"q\",\"\",\"\",\"\"],E:\"Android Browser\",F:{\"3B\":1256515200,\"4B\":1274313600,\"5B\":1291593600,NB:1298332800,F:1318896000,\"6B\":1341792000,CB:1374624000,\"7B\":1386547200,\"8B\":1401667200,q:1566777600}},J:{A:{D:0,A:0.011194},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"D\",\"A\",\"\",\"\",\"\"],E:\"Blackberry Browser\",F:{D:1325376000,A:1359504000}},K:{A:{\"7\":0,\"9\":0,A:0,B:0,C:0,M:0.0111391,GB:0},B:\"o\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"7\",\"GB\",\"C\",\"9\",\"M\",\"\",\"\",\"\"],E:\"Opera Mobile\",F:{\"7\":1314835200,\"9\":1349740800,A:1287100800,B:1300752000,GB:1318291200,C:1330300800,M:1474588800},D:{M:\"webkit\"}},L:{A:{QB:35.1619},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"QB\",\"\",\"\",\"\"],E:\"Chrome for Android\",F:{QB:1571702400}},M:{A:{\"8\":0.229477},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"8\",\"\",\"\",\"\"],E:\"Firefox for Android\",F:{\"8\":1567468800}},N:{A:{A:0.0115934,B:0.050373},B:\"ms\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"A\",\"B\",\"\",\"\",\"\"],E:\"IE Mobile\",F:{A:1340150400,B:1353456000}},O:{A:{\"9B\":2.88246},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"9B\",\"\",\"\",\"\"],E:\"UC Browser for Android\",F:{\"9B\":1471392000},D:{\"9B\":\"webkit\"}},P:{A:{F:0.33211,AC:0.0311353,BC:0.0207569,CC:0.114163,DC:0.0415137,EC:0.321732,OB:2.72953},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"F\",\"AC\",\"BC\",\"CC\",\"DC\",\"EC\",\"OB\",\"\",\"\",\"\"],E:\"Samsung Internet\",F:{F:1461024000,AC:1481846400,BC:1509408000,CC:1528329600,DC:1546128000,EC:1554163200,OB:1567900800}},Q:{A:{FC:0.201492},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"FC\",\"\",\"\",\"\"],E:\"QQ Browser\",F:{FC:1483228800}},R:{A:{GC:0},B:\"webkit\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"GC\",\"\",\"\",\"\"],E:\"Baidu Browser\",F:{GC:1491004800}},S:{A:{HC:0.195895},B:\"moz\",C:[\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"HC\",\"\",\"\",\"\"],E:\"KaiOS Browser\",F:{HC:1527811200}}};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.agents = undefined;\n\nvar _browsers = require('./browsers');\n\nvar _browserVersions = require('./browserVersions');\n\nvar agentsData = require('../../data/agents');\n\nfunction unpackBrowserVersions(versionsData) {\n return Object.keys(versionsData).reduce(function (usage, version) {\n usage[_browserVersions.browserVersions[version]] = versionsData[version];\n return usage;\n }, {});\n}\n\nvar agents = exports.agents = Object.keys(agentsData).reduce(function (map, key) {\n var versionsData = agentsData[key];\n map[_browsers.browsers[key]] = Object.keys(versionsData).reduce(function (data, entry) {\n if (entry === 'A') {\n data.usage_global = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'C') {\n data.versions = versionsData[entry].reduce(function (list, version) {\n if (version === '') {\n list.push(null);\n } else {\n list.push(_browserVersions.browserVersions[version]);\n }\n return list;\n }, []);\n } else if (entry === 'D') {\n data.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);\n } else if (entry === 'E') {\n data.browser = versionsData[entry];\n } else if (entry === 'F') {\n data.release_date = Object.keys(versionsData[entry]).reduce(function (map, key) {\n map[_browserVersions.browserVersions[key]] = versionsData[entry][key];\n return map;\n }, {});\n } else {\n // entry is B\n data.prefix = versionsData[entry];\n }\n return data;\n }, {});\n return map;\n}, {});","module.exports = {\n\t\"8.0\": \"79\",\n\t\"7.1\": \"78\",\n\t\"7.0\": \"78\",\n\t\"6.1\": \"76\",\n\t\"6.0\": \"76\",\n\t\"5.0\": \"72\",\n\t\"4.2\": \"69\",\n\t\"4.1\": \"69\",\n\t\"4.0\": \"69\",\n\t\"3.1\": \"66\",\n\t\"3.0\": \"66\",\n\t\"2.1\": \"61\",\n\t\"2.0\": \"61\",\n\t\"1.8\": \"59\",\n\t\"1.7\": \"58\",\n\t\"1.6\": \"56\",\n\t\"1.5\": \"54\",\n\t\"1.4\": \"53\",\n\t\"1.3\": \"52\",\n\t\"1.2\": \"51\",\n\t\"1.1\": \"50\",\n\t\"1.0\": \"49\",\n\t\"0.37\": \"49\",\n\t\"0.36\": \"47\",\n\t\"0.35\": \"45\",\n\t\"0.34\": \"45\",\n\t\"0.33\": \"45\",\n\t\"0.32\": \"45\",\n\t\"0.31\": \"44\",\n\t\"0.30\": \"44\",\n\t\"0.29\": \"43\",\n\t\"0.28\": \"43\",\n\t\"0.27\": \"42\",\n\t\"0.26\": \"42\",\n\t\"0.25\": \"42\",\n\t\"0.24\": \"41\",\n\t\"0.23\": \"41\",\n\t\"0.22\": \"41\",\n\t\"0.21\": \"40\",\n\t\"0.20\": \"39\"\n};","function BrowserslistError (message) {\n this.name = 'BrowserslistError'\n this.message = message\n this.browserslist = true\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, BrowserslistError)\n }\n}\n\nBrowserslistError.prototype = Error.prototype\n\nmodule.exports = BrowserslistError\n","var BrowserslistError = require('./error')\n\nfunction noop () { }\n\nmodule.exports = {\n loadQueries: function loadQueries () {\n throw new BrowserslistError(\n 'Sharable configs are not supported in client-side build of Browserslist')\n },\n\n getStat: function getStat (opts) {\n return opts.stats\n },\n\n loadConfig: function loadConfig (opts) {\n if (opts.config) {\n throw new BrowserslistError(\n 'Browserslist config are not supported in client-side build')\n }\n },\n\n loadCountry: function loadCountry () {\n throw new BrowserslistError(\n 'Country statistics is not supported ' +\n 'in client-side build of Browserslist')\n },\n\n currentNode: function currentNode (resolve, context) {\n return resolve(['maintained node versions'], context)[0]\n },\n\n parseConfig: noop,\n\n readConfig: noop,\n\n findConfig: noop,\n\n clearCaches: noop,\n\n oldDataWarning: noop\n}\n","var jsReleases = require('node-releases/data/processed/envs.json')\nvar agents = require('caniuse-lite/dist/unpacker/agents').agents\nvar jsEOL = require('node-releases/data/release-schedule/release-schedule.json')\nvar path = require('path')\nvar e2c = require('electron-to-chromium/versions')\n\nvar BrowserslistError = require('./error')\nvar env = require('./node') // Will load browser.js in webpack\n\nvar YEAR = 365.259641 * 24 * 60 * 60 * 1000\nvar ANDROID_EVERGREEN_FIRST = 37\n\nvar QUERY_OR = 1\nvar QUERY_AND = 2\n\nfunction isVersionsMatch (versionA, versionB) {\n return (versionA + '.').indexOf(versionB + '.') === 0\n}\n\nfunction isEolReleased (name) {\n var version = name.slice(1)\n return jsReleases.some(function (i) {\n return isVersionsMatch(i.version, version)\n })\n}\n\nfunction normalize (versions) {\n return versions.filter(function (version) {\n return typeof version === 'string'\n })\n}\n\nfunction normalizeElectron (version) {\n var versionToUse = version\n if (version.split('.').length === 3) {\n versionToUse = version\n .split('.')\n .slice(0, -1)\n .join('.')\n }\n return versionToUse\n}\n\nfunction nameMapper (name) {\n return function mapName (version) {\n return name + ' ' + version\n }\n}\n\nfunction getMajor (version) {\n return parseInt(version.split('.')[0])\n}\n\nfunction getMajorVersions (released, number) {\n if (released.length === 0) return []\n var minimum = getMajor(released[released.length - 1]) - parseInt(number) + 1\n var selected = []\n for (var i = released.length - 1; i >= 0; i--) {\n if (minimum > getMajor(released[i])) break\n selected.unshift(released[i])\n }\n return selected\n}\n\nfunction uniq (array) {\n var filtered = []\n for (var i = 0; i < array.length; i++) {\n if (filtered.indexOf(array[i]) === -1) filtered.push(array[i])\n }\n return filtered\n}\n\n// Helpers\n\nfunction fillUsage (result, name, data) {\n for (var i in data) {\n result[name + ' ' + i] = data[i]\n }\n}\n\nfunction generateFilter (sign, version) {\n version = parseFloat(version)\n if (sign === '>') {\n return function (v) {\n return parseFloat(v) > version\n }\n } else if (sign === '>=') {\n return function (v) {\n return parseFloat(v) >= version\n }\n } else if (sign === '<') {\n return function (v) {\n return parseFloat(v) < version\n }\n } else {\n return function (v) {\n return parseFloat(v) <= version\n }\n }\n}\n\nfunction generateSemverFilter (sign, version) {\n version = version.split('.').map(parseSimpleInt)\n version[1] = version[1] || 0\n version[2] = version[2] || 0\n if (sign === '>') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) > 0\n }\n } else if (sign === '>=') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(v, version) >= 0\n }\n } else if (sign === '<') {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) > 0\n }\n } else {\n return function (v) {\n v = v.split('.').map(parseSimpleInt)\n return compareSemver(version, v) >= 0\n }\n }\n}\n\nfunction parseSimpleInt (x) {\n return parseInt(x)\n}\n\nfunction compare (a, b) {\n if (a < b) return -1\n if (a > b) return +1\n return 0\n}\n\nfunction compareSemver (a, b) {\n return (\n compare(parseInt(a[0]), parseInt(b[0])) ||\n compare(parseInt(a[1] || '0'), parseInt(b[1] || '0')) ||\n compare(parseInt(a[2] || '0'), parseInt(b[2] || '0'))\n )\n}\n\nfunction resolveVersion (data, version) {\n if (data.versions.indexOf(version) !== -1) {\n return version\n } else if (browserslist.versionAliases[data.name][version]) {\n return browserslist.versionAliases[data.name][version]\n } else {\n return false\n }\n}\n\nfunction normalizeVersion (data, version) {\n var resolved = resolveVersion(data, version)\n if (resolved) {\n return resolved\n } else if (data.versions.length === 1) {\n return data.versions[0]\n } else {\n return false\n }\n}\n\nfunction filterByYear (since, context) {\n since = since / 1000\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var versions = Object.keys(data.releaseDate).filter(function (v) {\n return data.releaseDate[v] >= since\n })\n return selected.concat(versions.map(nameMapper(data.name)))\n }, [])\n}\n\nfunction cloneData (data) {\n return {\n name: data.name,\n versions: data.versions,\n released: data.released,\n releaseDate: data.releaseDate\n }\n}\n\nfunction byName (name, context) {\n name = name.toLowerCase()\n name = browserslist.aliases[name] || name\n if (context.mobileToDesktop && browserslist.desktopNames[name]) {\n var desktop = browserslist.data[browserslist.desktopNames[name]]\n if (name === 'android') {\n return normalizeAndroidData(cloneData(browserslist.data[name]), desktop)\n } else {\n var cloned = cloneData(desktop)\n cloned.name = name\n return cloned\n }\n }\n return browserslist.data[name]\n}\n\nfunction normalizeAndroidVersions (androidVersions, chromeVersions) {\n var firstEvergreen = ANDROID_EVERGREEN_FIRST\n var last = chromeVersions[chromeVersions.length - 1]\n return androidVersions\n .filter(function (version) { return /^(?:[2-4]\\.|[34]$)/.test(version) })\n .concat(chromeVersions.slice(firstEvergreen - last - 1))\n}\n\nfunction normalizeAndroidData (android, chrome) {\n android.released = normalizeAndroidVersions(android.released, chrome.released)\n android.versions = normalizeAndroidVersions(android.versions, chrome.versions)\n return android\n}\n\nfunction checkName (name, context) {\n var data = byName(name, context)\n if (!data) throw new BrowserslistError('Unknown browser ' + name)\n return data\n}\n\nfunction unknownQuery (query) {\n return new BrowserslistError(\n 'Unknown browser query `' + query + '`. ' +\n 'Maybe you are using old Browserslist or made typo in query.'\n )\n}\n\nfunction filterAndroid (list, versions, context) {\n if (context.mobileToDesktop) return list\n var released = browserslist.data.android.released\n var last = released[released.length - 1]\n var diff = last - ANDROID_EVERGREEN_FIRST - versions\n if (diff > 0) {\n return list.slice(-1)\n } else {\n return list.slice(diff - 1)\n }\n}\n\n/**\n * Resolves queries into a browser list.\n * @param {string|string[]} queries Queries to combine.\n * Either an array of queries or a long string of queries.\n * @param {object} [context] Optional arguments to\n * the select function in `queries`.\n * @returns {string[]} A list of browsers\n */\nfunction resolve (queries, context) {\n if (Array.isArray(queries)) {\n queries = flatten(queries.map(parse))\n } else {\n queries = parse(queries)\n }\n\n return queries.reduce(function (result, query, index) {\n var selection = query.queryString\n\n var isExclude = selection.indexOf('not ') === 0\n if (isExclude) {\n if (index === 0) {\n throw new BrowserslistError(\n 'Write any browsers query (for instance, `defaults`) ' +\n 'before `' + selection + '`')\n }\n selection = selection.slice(4)\n }\n\n for (var i = 0; i < QUERIES.length; i++) {\n var type = QUERIES[i]\n var match = selection.match(type.regexp)\n if (match) {\n var args = [context].concat(match.slice(1))\n var array = type.select.apply(browserslist, args).map(function (j) {\n var parts = j.split(' ')\n if (parts[1] === '0') {\n return parts[0] + ' ' + byName(parts[0], context).versions[0]\n } else {\n return j\n }\n })\n\n switch (query.type) {\n case QUERY_AND:\n if (isExclude) {\n return result.filter(function (j) {\n return array.indexOf(j) === -1\n })\n } else {\n return result.filter(function (j) {\n return array.indexOf(j) !== -1\n })\n }\n case QUERY_OR:\n default:\n if (isExclude) {\n var filter = { }\n array.forEach(function (j) {\n filter[j] = true\n })\n return result.filter(function (j) {\n return !filter[j]\n })\n }\n return result.concat(array)\n }\n }\n }\n\n throw unknownQuery(selection)\n }, [])\n}\n\nvar cache = { }\n\n/**\n * Return array of browsers by selection queries.\n *\n * @param {(string|string[])} [queries=browserslist.defaults] Browser queries.\n * @param {object} [opts] Options.\n * @param {string} [opts.path=\".\"] Path to processed file.\n * It will be used to find config files.\n * @param {string} [opts.env=\"production\"] Processing environment.\n * It will be used to take right\n * queries from config file.\n * @param {string} [opts.config] Path to config file with queries.\n * @param {object} [opts.stats] Custom browser usage statistics\n * for \"> 1% in my stats\" query.\n * @param {boolean} [opts.ignoreUnknownVersions=false] Do not throw on unknown\n * version in direct query.\n * @param {boolean} [opts.dangerousExtend] Disable security checks\n * for extend query.\n * @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop\n * version when Can I Use doesn't have\n * data about the specified version.\n * @returns {string[]} Array with browser names in Can I Use.\n *\n * @example\n * browserslist('IE >= 10, IE 8') //=> ['ie 11', 'ie 10', 'ie 8']\n */\nfunction browserslist (queries, opts) {\n if (typeof opts === 'undefined') opts = { }\n\n if (typeof opts.path === 'undefined') {\n opts.path = path.resolve ? path.resolve('.') : '.'\n }\n\n if (typeof queries === 'undefined' || queries === null) {\n var config = browserslist.loadConfig(opts)\n if (config) {\n queries = config\n } else {\n queries = browserslist.defaults\n }\n }\n\n if (!(typeof queries === 'string' || Array.isArray(queries))) {\n throw new BrowserslistError(\n 'Browser queries must be an array or string. Got ' + typeof queries + '.')\n }\n\n var context = {\n ignoreUnknownVersions: opts.ignoreUnknownVersions,\n dangerousExtend: opts.dangerousExtend,\n mobileToDesktop: opts.mobileToDesktop\n }\n\n env.oldDataWarning(browserslist.data)\n var stats = env.getStat(opts, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n\n var cacheKey = JSON.stringify([queries, context])\n if (cache[cacheKey]) return cache[cacheKey]\n\n var result = uniq(resolve(queries, context)).sort(function (name1, name2) {\n name1 = name1.split(' ')\n name2 = name2.split(' ')\n if (name1[0] === name2[0]) {\n // assumptions on caniuse data\n // 1) version ranges never overlaps\n // 2) if version is not a range, it never contains `-`\n var version1 = name1[1].split('-')[0]\n var version2 = name2[1].split('-')[0]\n return compareSemver(version2.split('.'), version1.split('.'))\n } else {\n return compare(name1[0], name2[0])\n }\n })\n if (!process.env.BROWSERSLIST_DISABLE_CACHE) {\n cache[cacheKey] = result\n }\n return result\n}\n\nfunction parse (queries) {\n var qs = []\n do {\n queries = doMatch(queries, qs)\n } while (queries)\n return qs\n}\n\nfunction doMatch (string, qs) {\n var or = /^(?:,\\s*|\\s+or\\s+)(.*)/i\n var and = /^\\s+and\\s+(.*)/i\n\n return find(string, function (parsed, n, max) {\n if (and.test(parsed)) {\n qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })\n return true\n } else if (or.test(parsed)) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })\n return true\n } else if (n === max) {\n qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })\n return true\n }\n return false\n })\n}\n\nfunction find (string, predicate) {\n for (var n = 1, max = string.length; n <= max; n++) {\n var parsed = string.substr(-n, n)\n if (predicate(parsed, n, max)) {\n return string.slice(0, -n)\n }\n }\n return ''\n}\n\nfunction flatten (array) {\n if (!Array.isArray(array)) return [array]\n return array.reduce(function (a, b) {\n return a.concat(flatten(b))\n }, [])\n}\n\n// Will be filled by Can I Use data below\nbrowserslist.data = { }\nbrowserslist.usage = {\n global: { },\n custom: null\n}\n\n// Default browsers query\nbrowserslist.defaults = [\n '> 0.5%',\n 'last 2 versions',\n 'Firefox ESR',\n 'not dead'\n]\n\n// Browser names aliases\nbrowserslist.aliases = {\n fx: 'firefox',\n ff: 'firefox',\n ios: 'ios_saf',\n explorer: 'ie',\n blackberry: 'bb',\n explorermobile: 'ie_mob',\n operamini: 'op_mini',\n operamobile: 'op_mob',\n chromeandroid: 'and_chr',\n firefoxandroid: 'and_ff',\n ucandroid: 'and_uc',\n qqandroid: 'and_qq'\n}\n\n// Can I Use only provides a few versions for some browsers (e.g. and_chr).\n// Fallback to a similar browser for unknown versions\nbrowserslist.desktopNames = {\n and_chr: 'chrome',\n and_ff: 'firefox',\n ie_mob: 'ie',\n op_mob: 'opera',\n android: 'chrome' // has extra processing logic\n}\n\n// Aliases to work with joined versions like `ios_saf 7.0-7.1`\nbrowserslist.versionAliases = { }\n\nbrowserslist.clearCaches = env.clearCaches\nbrowserslist.parseConfig = env.parseConfig\nbrowserslist.readConfig = env.readConfig\nbrowserslist.findConfig = env.findConfig\nbrowserslist.loadConfig = env.loadConfig\n\n/**\n * Return browsers market coverage.\n *\n * @param {string[]} browsers Browsers names in Can I Use.\n * @param {string|object} [stats=\"global\"] Which statistics should be used.\n * Country code or custom statistics.\n * Pass `\"my stats\"` to load statistics\n * from Browserslist files.\n *\n * @return {number} Total market coverage for all selected browsers.\n *\n * @example\n * browserslist.coverage(browserslist('> 1% in US'), 'US') //=> 83.1\n */\nbrowserslist.coverage = function (browsers, stats) {\n var data\n if (typeof stats === 'undefined') {\n data = browserslist.usage.global\n } else if (stats === 'my stats') {\n var opts = {}\n opts.path = path.resolve ? path.resolve('.') : '.'\n var customStats = env.getStat(opts)\n if (!customStats) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n data = {}\n for (var browser in customStats) {\n fillUsage(data, browser, customStats[browser])\n }\n } else if (typeof stats === 'string') {\n if (stats.length > 2) {\n stats = stats.toLowerCase()\n } else {\n stats = stats.toUpperCase()\n }\n env.loadCountry(browserslist.usage, stats)\n data = browserslist.usage[stats]\n } else {\n if ('dataByBrowser' in stats) {\n stats = stats.dataByBrowser\n }\n data = { }\n for (var name in stats) {\n for (var version in stats[name]) {\n data[name + ' ' + version] = stats[name][version]\n }\n }\n }\n\n return browsers.reduce(function (all, i) {\n var usage = data[i]\n if (usage === undefined) {\n usage = data[i.replace(/ \\S+$/, ' 0')]\n }\n return all + (usage || 0)\n }, 0)\n}\n\nvar QUERIES = [\n {\n regexp: /^last\\s+(\\d+)\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = getMajorVersions(data.released, versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.released.slice(-versions)\n list = list.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+major\\s+versions?$/i,\n select: function (context, versions) {\n var validVersions = getMajorVersions(Object.keys(e2c).reverse(), versions)\n return validVersions.map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+major\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var validVersions = getMajorVersions(data.released, versions)\n var list = validVersions.map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+electron\\s+versions?$/i,\n select: function (context, versions) {\n return Object.keys(e2c).reverse().slice(-versions).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^last\\s+(\\d+)\\s+(\\w+)\\s+versions?$/i,\n select: function (context, versions, name) {\n var data = checkName(name, context)\n var list = data.released.slice(-versions).map(nameMapper(data.name))\n if (data.name === 'android') {\n list = filterAndroid(list, versions, context)\n }\n return list\n }\n },\n {\n regexp: /^unreleased\\s+versions$/i,\n select: function (context) {\n return Object.keys(agents).reduce(function (selected, name) {\n var data = byName(name, context)\n if (!data) return selected\n var list = data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n })\n list = list.map(nameMapper(data.name))\n return selected.concat(list)\n }, [])\n }\n },\n {\n regexp: /^unreleased\\s+electron\\s+versions?$/i,\n select: function () {\n return []\n }\n },\n {\n regexp: /^unreleased\\s+(\\w+)\\s+versions?$/i,\n select: function (context, name) {\n var data = checkName(name, context)\n return data.versions.filter(function (v) {\n return data.released.indexOf(v) === -1\n }).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^last\\s+(\\d*.?\\d+)\\s+years?$/i,\n select: function (context, years) {\n return filterByYear(Date.now() - YEAR * years, context)\n }\n },\n {\n regexp: /^since (\\d+)(?:-(\\d+))?(?:-(\\d+))?$/i,\n select: function (context, year, month, date) {\n year = parseInt(year)\n month = parseInt(month || '01') - 1\n date = parseInt(date || '01')\n return filterByYear(Date.UTC(year, month, date, 0, 0, 0), context)\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n var usage = browserslist.usage.global\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+my\\s+stats$/,\n select: function (context, sign, popularity) {\n popularity = parseFloat(popularity)\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+(\\S+)\\s+stats$/,\n select: function (context, sign, popularity, name) {\n popularity = parseFloat(popularity)\n var stats = env.loadStat(context, name, browserslist.data)\n if (stats) {\n context.customUsage = { }\n for (var browser in stats) {\n fillUsage(context.customUsage, browser, stats[browser])\n }\n }\n if (!context.customUsage) {\n throw new BrowserslistError('Custom usage statistics was not provided')\n }\n var usage = context.customUsage\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^(>=?|<=?)\\s*(\\d*\\.?\\d+)%\\s+in\\s+((alt-)?\\w\\w)$/,\n select: function (context, sign, popularity, place) {\n popularity = parseFloat(popularity)\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n var usage = browserslist.usage[place]\n return Object.keys(usage).reduce(function (result, version) {\n if (sign === '>') {\n if (usage[version] > popularity) {\n result.push(version)\n }\n } else if (sign === '<') {\n if (usage[version] < popularity) {\n result.push(version)\n }\n } else if (sign === '<=') {\n if (usage[version] <= popularity) {\n result.push(version)\n }\n } else if (usage[version] >= popularity) {\n result.push(version)\n }\n return result\n }, [])\n }\n },\n {\n regexp: /^cover\\s+(\\d*\\.?\\d+)%(\\s+in\\s+(my\\s+stats|(alt-)?\\w\\w))?$/,\n select: function (context, coverage, statMode) {\n coverage = parseFloat(coverage)\n var usage = browserslist.usage.global\n if (statMode) {\n if (statMode.match(/^\\s+in\\s+my\\s+stats$/)) {\n if (!context.customUsage) {\n throw new BrowserslistError(\n 'Custom usage statistics was not provided'\n )\n }\n usage = context.customUsage\n } else {\n var match = statMode.match(/\\s+in\\s+((alt-)?\\w\\w)/)\n var place = match[1]\n if (place.length === 2) {\n place = place.toUpperCase()\n } else {\n place = place.toLowerCase()\n }\n env.loadCountry(browserslist.usage, place)\n usage = browserslist.usage[place]\n }\n }\n var versions = Object.keys(usage).sort(function (a, b) {\n return usage[b] - usage[a]\n })\n var coveraged = 0\n var result = []\n var version\n for (var i = 0; i <= versions.length; i++) {\n version = versions[i]\n if (usage[version] === 0) break\n coveraged += usage[version]\n result.push(version)\n if (coveraged >= coverage) break\n }\n return result\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, from, to) {\n var fromToUse = normalizeElectron(from)\n var toToUse = normalizeElectron(to)\n if (!e2c[fromToUse]) {\n throw new BrowserslistError('Unknown version ' + from + ' of electron')\n }\n if (!e2c[toToUse]) {\n throw new BrowserslistError('Unknown version ' + to + ' of electron')\n }\n from = parseFloat(from)\n to = parseFloat(to)\n return Object.keys(e2c).filter(function (i) {\n var parsed = parseFloat(i)\n return parsed >= from && parsed <= to\n }).map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^(\\w+)\\s+([\\d.]+)\\s*-\\s*([\\d.]+)$/i,\n select: function (context, name, from, to) {\n var data = checkName(name, context)\n from = parseFloat(normalizeVersion(data, from) || from)\n to = parseFloat(normalizeVersion(data, to) || to)\n function filter (v) {\n var parsed = parseFloat(v)\n return parsed >= from && parsed <= to\n }\n return data.released.filter(filter).map(nameMapper(data.name))\n }\n },\n {\n regexp: /^electron\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var versionToUse = normalizeElectron(version)\n return Object.keys(e2c)\n .filter(generateFilter(sign, versionToUse))\n .map(function (i) {\n return 'chrome ' + e2c[i]\n })\n }\n },\n {\n regexp: /^node\\s*(>=?|<=?)\\s*([\\d.]+)$/i,\n select: function (context, sign, version) {\n var nodeVersions = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n }).map(function (i) {\n return i.version\n })\n return nodeVersions\n .filter(generateSemverFilter(sign, version))\n .map(function (v) {\n return 'node ' + v\n })\n }\n },\n {\n regexp: /^(\\w+)\\s*(>=?|<=?)\\s*([\\d.]+)$/,\n select: function (context, name, sign, version) {\n var data = checkName(name, context)\n var alias = browserslist.versionAliases[data.name][version]\n if (alias) {\n version = alias\n }\n return data.released\n .filter(generateFilter(sign, version))\n .map(function (v) {\n return data.name + ' ' + v\n })\n }\n },\n {\n regexp: /^(firefox|ff|fx)\\s+esr$/i,\n select: function () {\n return ['firefox 68']\n }\n },\n {\n regexp: /(operamini|op_mini)\\s+all/i,\n select: function () {\n return ['op_mini all']\n }\n },\n {\n regexp: /^electron\\s+([\\d.]+)$/i,\n select: function (context, version) {\n var versionToUse = normalizeElectron(version)\n var chrome = e2c[versionToUse]\n if (!chrome) {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of electron')\n }\n return ['chrome ' + chrome]\n }\n },\n {\n regexp: /^node\\s+(\\d+(\\.\\d+)?(\\.\\d+)?)$/i,\n select: function (context, version) {\n var nodeReleases = jsReleases.filter(function (i) {\n return i.name === 'nodejs'\n })\n var matched = nodeReleases.filter(function (i) {\n return isVersionsMatch(i.version, version)\n })\n if (matched.length === 0) {\n if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of Node.js')\n }\n }\n return ['node ' + matched[matched.length - 1].version]\n }\n },\n {\n regexp: /^current\\s+node$/i,\n select: function (context) {\n return [env.currentNode(resolve, context)]\n }\n },\n {\n regexp: /^maintained\\s+node\\s+versions$/i,\n select: function (context) {\n var now = Date.now()\n var queries = Object.keys(jsEOL).filter(function (key) {\n return now < Date.parse(jsEOL[key].end) &&\n now > Date.parse(jsEOL[key].start) &&\n isEolReleased(key)\n }).map(function (key) {\n return 'node ' + key.slice(1)\n })\n return resolve(queries, context)\n }\n },\n {\n regexp: /^phantomjs\\s+1.9$/i,\n select: function () {\n return ['safari 5']\n }\n },\n {\n regexp: /^phantomjs\\s+2.1$/i,\n select: function () {\n return ['safari 6']\n }\n },\n {\n regexp: /^(\\w+)\\s+(tp|[\\d.]+)$/i,\n select: function (context, name, version) {\n if (/^tp$/i.test(version)) version = 'TP'\n var data = checkName(name, context)\n var alias = normalizeVersion(data, version)\n if (alias) {\n version = alias\n } else {\n if (version.indexOf('.') === -1) {\n alias = version + '.0'\n } else {\n alias = version.replace(/\\.0$/, '')\n }\n alias = normalizeVersion(data, alias)\n if (alias) {\n version = alias\n } else if (context.ignoreUnknownVersions) {\n return []\n } else {\n throw new BrowserslistError(\n 'Unknown version ' + version + ' of ' + name)\n }\n }\n return [data.name + ' ' + version]\n }\n },\n {\n regexp: /^extends (.+)$/i,\n select: function (context, name) {\n return resolve(env.loadQueries(context, name), context)\n }\n },\n {\n regexp: /^defaults$/i,\n select: function (context) {\n return resolve(browserslist.defaults, context)\n }\n },\n {\n regexp: /^dead$/i,\n select: function (context) {\n var dead = [\n 'ie <= 10', 'ie_mob <= 10',\n 'bb <= 10',\n 'op_mob <= 12.1',\n 'samsung 4'\n ]\n return resolve(dead, context)\n }\n },\n {\n regexp: /^(\\w+)$/i,\n select: function (context, name) {\n if (byName(name, context)) {\n throw new BrowserslistError(\n 'Specify versions in Browserslist query for browser ' + name)\n } else {\n throw unknownQuery(name)\n }\n }\n }\n];\n\n// Get and convert Can I Use data\n\n(function () {\n for (var name in agents) {\n var browser = agents[name]\n browserslist.data[name] = {\n name: name,\n versions: normalize(agents[name].versions),\n released: normalize(agents[name].versions.slice(0, -3)),\n releaseDate: agents[name].release_date\n }\n fillUsage(browserslist.usage.global, name, browser.usage_global)\n\n browserslist.versionAliases[name] = { }\n for (var i = 0; i < browser.versions.length; i++) {\n var full = browser.versions[i]\n if (!full) continue\n\n if (full.indexOf('-') !== -1) {\n var interval = full.split('-')\n for (var j = 0; j < interval.length; j++) {\n browserslist.versionAliases[name][interval[j]] = full\n }\n }\n }\n }\n}())\n\nmodule.exports = browserslist\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/native-modules.json\");\n","export const unreleasedLabels = {\n safari: \"tp\",\n};\n\nexport const browserNameMap = {\n and_chr: \"chrome\",\n and_ff: \"firefox\",\n android: \"android\",\n chrome: \"chrome\",\n edge: \"edge\",\n firefox: \"firefox\",\n ie: \"ie\",\n ie_mob: \"ie\",\n ios_saf: \"ios\",\n node: \"node\",\n op_mob: \"opera\",\n opera: \"opera\",\n safari: \"safari\",\n samsung: \"samsung\",\n};\n","// @flow\n\nimport invariant from \"invariant\";\nimport semver from \"semver\";\n\nimport { unreleasedLabels } from \"./targets\";\nimport type { Target, Targets } from \"./types\";\n\nconst versionRegExp = /^(\\d+|\\d+.\\d+)$/;\n\nexport function semverMin(first: ?string, second: string): string {\n return first && semver.lt(first, second) ? first : second;\n}\n\n// Convert version to a semver value.\n// 2.5 -> 2.5.0; 1 -> 1.0.0;\nexport function semverify(version: number | string): string {\n if (typeof version === \"string\" && semver.valid(version)) {\n return version;\n }\n\n invariant(\n typeof version === \"number\" ||\n (typeof version === \"string\" && versionRegExp.test(version)),\n `'${version}' is not a valid version`,\n );\n\n const split = version.toString().split(\".\");\n while (split.length < 3) {\n split.push(\"0\");\n }\n return split.join(\".\");\n}\n\nexport function isUnreleasedVersion(\n version: string | number,\n env: string,\n): boolean {\n const unreleasedLabel = unreleasedLabels[env];\n return (\n !!unreleasedLabel && unreleasedLabel === version.toString().toLowerCase()\n );\n}\n\nexport function getLowestUnreleased(a: string, b: string, env: string): string {\n const unreleasedLabel = unreleasedLabels[env];\n const hasUnreleased = [a, b].some(item => item === unreleasedLabel);\n if (hasUnreleased) {\n return a === hasUnreleased ? b : a || b;\n }\n return semverMin(a, b);\n}\n\nexport function getLowestImplementedVersion(\n plugin: Targets,\n environment: Target,\n): string {\n const result = plugin[environment];\n // When Android support data is absent, use Chrome data as fallback\n if (!result && environment === \"android\") {\n return plugin.chrome;\n }\n return result;\n}\n","// @flow\n\nexport const TargetNames = {\n esmodules: \"esmodules\",\n node: \"node\",\n browsers: \"browsers\",\n chrome: \"chrome\",\n opera: \"opera\",\n edge: \"edge\",\n firefox: \"firefox\",\n safari: \"safari\",\n ie: \"ie\",\n ios: \"ios\",\n android: \"android\",\n electron: \"electron\",\n samsung: \"samsung\",\n\n // deprecated\n uglify: \"uglify\",\n};\n","import semver from \"semver\";\nimport { unreleasedLabels } from \"./targets\";\n\nexport function prettifyVersion(version: string) {\n if (typeof version !== \"string\") {\n return version;\n }\n\n const parts = [semver.major(version)];\n const minor = semver.minor(version);\n const patch = semver.patch(version);\n\n if (minor || patch) {\n parts.push(minor);\n }\n\n if (patch) {\n parts.push(patch);\n }\n\n return parts.join(\".\");\n}\n\nexport function prettifyTargets(targets: Targets): Targets {\n return Object.keys(targets).reduce((results, target) => {\n let value = targets[target];\n\n const unreleasedLabel = unreleasedLabels[target];\n if (typeof value === \"string\" && unreleasedLabel !== value) {\n value = prettifyVersion(value);\n }\n\n results[target] = value;\n return results;\n }, {});\n}\n","// @flow\n\nimport semver from \"semver\";\nimport { prettifyVersion } from \"./pretty\";\nimport {\n semverify,\n isUnreleasedVersion,\n getLowestImplementedVersion,\n} from \"./utils\";\nimport type { Targets } from \"./types\";\n\nexport function getInclusionReasons(\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) {\n const minVersions = list[item] || {};\n\n return Object.keys(targetVersions).reduce((result, env) => {\n const minVersion = getLowestImplementedVersion(minVersions, env);\n const targetVersion = targetVersions[env];\n\n if (!minVersion) {\n result[env] = prettifyVersion(targetVersion);\n } else {\n const minIsUnreleased = isUnreleasedVersion(minVersion, env);\n const targetIsUnreleased = isUnreleasedVersion(targetVersion, env);\n\n if (\n !targetIsUnreleased &&\n (minIsUnreleased ||\n semver.lt(targetVersion.toString(), semverify(minVersion)))\n ) {\n result[env] = prettifyVersion(targetVersion);\n }\n }\n\n return result;\n }, {});\n}\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/plugins.json\");\n","// @flow\n\nimport semver from \"semver\";\n\nimport pluginsCompatData from \"@babel/compat-data/plugins\";\n\nimport type { Targets } from \"./types\";\nimport {\n getLowestImplementedVersion,\n isUnreleasedVersion,\n semverify,\n} from \"./utils\";\n\nexport function targetsSupported(target: Targets, support: Targets) {\n const targetEnvironments = Object.keys(target);\n\n if (targetEnvironments.length === 0) {\n return false;\n }\n\n const unsupportedEnvironments = targetEnvironments.filter(environment => {\n const lowestImplementedVersion = getLowestImplementedVersion(\n support,\n environment,\n );\n\n // Feature is not implemented in that environment\n if (!lowestImplementedVersion) {\n return true;\n }\n\n const lowestTargetedVersion = target[environment];\n\n // If targets has unreleased value as a lowest version, then don't require a plugin.\n if (isUnreleasedVersion(lowestTargetedVersion, environment)) {\n return false;\n }\n\n // Include plugin if it is supported in the unreleased environment, which wasn't specified in targets\n if (isUnreleasedVersion(lowestImplementedVersion, environment)) {\n return true;\n }\n\n if (!semver.valid(lowestTargetedVersion.toString())) {\n throw new Error(\n `Invalid version passed for target \"${environment}\": \"${lowestTargetedVersion}\". ` +\n \"Versions must be in semver format (major.minor.patch)\",\n );\n }\n\n return semver.gt(\n semverify(lowestImplementedVersion),\n lowestTargetedVersion.toString(),\n );\n });\n\n return unsupportedEnvironments.length === 0;\n}\n\nexport function isRequired(\n name: string,\n targets: Targets,\n {\n compatData = pluginsCompatData,\n includes,\n excludes,\n }: {\n compatData?: { [feature: string]: Targets },\n includes?: Set,\n excludes?: Set,\n } = {},\n) {\n if (excludes && excludes.has(name)) return false;\n if (includes && includes.has(name)) return true;\n return !targetsSupported(targets, compatData[name]);\n}\n\nexport default function filterItems(\n list: { [feature: string]: Targets },\n includes: Set,\n excludes: Set,\n targets: Targets,\n defaultIncludes: Array | null,\n defaultExcludes?: Array | null,\n pluginSyntaxMap?: Map,\n) {\n const result = new Set();\n const options = { compatData: list, includes, excludes };\n\n for (const item in list) {\n if (isRequired(item, targets, options)) {\n result.add(item);\n } else if (pluginSyntaxMap) {\n const shippedProposalsSyntax = pluginSyntaxMap.get(item);\n\n if (shippedProposalsSyntax) {\n result.add(shippedProposalsSyntax);\n }\n }\n }\n\n if (defaultIncludes) {\n defaultIncludes.forEach(item => !excludes.has(item) && result.add(item));\n }\n\n if (defaultExcludes) {\n defaultExcludes.forEach(item => !includes.has(item) && result.delete(item));\n }\n\n return result;\n}\n","// @flow\n\nimport browserslist from \"browserslist\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport browserModulesData from \"@babel/compat-data/native-modules\";\n\nimport {\n semverify,\n semverMin,\n isUnreleasedVersion,\n getLowestUnreleased,\n} from \"./utils\";\nimport { browserNameMap } from \"./targets\";\nimport { TargetNames } from \"./options\";\nimport type { Targets } from \"./types\";\n\nexport type { Targets };\n\nexport { prettifyTargets } from \"./pretty\";\nexport { getInclusionReasons } from \"./debug\";\nexport { default as filterItems, isRequired } from \"./filter-items\";\nexport { unreleasedLabels } from \"./targets\";\n\nconst browserslistDefaults = browserslist.defaults;\n\nconst validBrowserslistTargets = [\n ...Object.keys(browserslist.data),\n ...Object.keys(browserslist.aliases),\n];\n\nfunction objectToBrowserslist(object: Targets): Array {\n return Object.keys(object).reduce((list, targetName) => {\n if (validBrowserslistTargets.indexOf(targetName) >= 0) {\n const targetVersion = object[targetName];\n return list.concat(`${targetName} ${targetVersion}`);\n }\n return list;\n }, []);\n}\n\nfunction validateTargetNames(targets: Targets): void {\n const validTargets = Object.keys(TargetNames);\n for (const target in targets) {\n if (!TargetNames[target]) {\n throw new Error(\n `Invalid Option: '${target}' is not a valid target\n Maybe you meant to use '${findSuggestion(target, validTargets)}'?`,\n );\n }\n }\n}\n\nexport function isBrowsersQueryValid(\n browsers: string | Array | Targets,\n): boolean {\n return typeof browsers === \"string\" || Array.isArray(browsers);\n}\n\nfunction validateBrowsers(browsers) {\n invariant(\n typeof browsers === \"undefined\" || isBrowsersQueryValid(browsers),\n `Invalid Option: '${browsers}' is not a valid browserslist query`,\n );\n\n return browsers;\n}\n\nfunction mergeBrowsers(fromQuery: Targets, fromTarget: Targets) {\n return Object.keys(fromTarget).reduce((queryObj, targKey) => {\n if (targKey !== TargetNames.browsers) {\n queryObj[targKey] = fromTarget[targKey];\n }\n return queryObj;\n }, fromQuery);\n}\n\nfunction getLowestVersions(browsers: Array): Targets {\n return browsers.reduce((all: Object, browser: string): Object => {\n const [browserName, browserVersion] = browser.split(\" \");\n const normalizedBrowserName = browserNameMap[browserName];\n\n if (!normalizedBrowserName) {\n return all;\n }\n\n try {\n // Browser version can return as \"10.0-10.2\"\n const splitVersion = browserVersion.split(\"-\")[0].toLowerCase();\n const isSplitUnreleased = isUnreleasedVersion(splitVersion, browserName);\n\n if (!all[normalizedBrowserName]) {\n all[normalizedBrowserName] = isSplitUnreleased\n ? splitVersion\n : semverify(splitVersion);\n return all;\n }\n\n const version = all[normalizedBrowserName];\n const isUnreleased = isUnreleasedVersion(version, browserName);\n\n if (isUnreleased && isSplitUnreleased) {\n all[normalizedBrowserName] = getLowestUnreleased(\n version,\n splitVersion,\n browserName,\n );\n } else if (isUnreleased) {\n all[normalizedBrowserName] = semverify(splitVersion);\n } else if (!isUnreleased && !isSplitUnreleased) {\n const parsedBrowserVersion = semverify(splitVersion);\n\n all[normalizedBrowserName] = semverMin(version, parsedBrowserVersion);\n }\n } catch (e) {}\n\n return all;\n }, {});\n}\n\nfunction outputDecimalWarning(decimalTargets: Array): void {\n if (!decimalTargets || !decimalTargets.length) {\n return;\n }\n\n console.log(\"Warning, the following targets are using a decimal version:\");\n console.log(\"\");\n decimalTargets.forEach(({ target, value }) =>\n console.log(` ${target}: ${value}`),\n );\n console.log(\"\");\n console.log(\n \"We recommend using a string for minor/patch versions to avoid numbers like 6.10\",\n );\n console.log(\"getting parsed as 6.1, which can lead to unexpected behavior.\");\n console.log(\"\");\n}\n\nfunction semverifyTarget(target, value) {\n try {\n return semverify(value);\n } catch (error) {\n throw new Error(\n `Invalid Option: '${value}' is not a valid value for 'targets.${target}'.`,\n );\n }\n}\n\nconst targetParserMap = {\n __default(target, value) {\n const version = isUnreleasedVersion(value, target)\n ? value.toLowerCase()\n : semverifyTarget(target, value);\n return [target, version];\n },\n\n // Parse `node: true` and `node: \"current\"` to version\n node(target, value) {\n const parsed =\n value === true || value === \"current\"\n ? process.versions.node\n : semverifyTarget(target, value);\n return [target, parsed];\n },\n};\n\ntype ParsedResult = {\n targets: Targets,\n decimalWarnings: Array,\n};\n\nexport default function getTargets(\n targets: Object = {},\n options: Object = {},\n): Targets {\n const targetOpts: Targets = {};\n\n validateTargetNames(targets);\n\n // `esmodules` as a target indicates the specific set of browsers supporting ES Modules.\n // These values OVERRIDE the `browsers` field.\n if (targets.esmodules) {\n const supportsESModules = browserModulesData[\"es6.module\"];\n targets.browsers = Object.keys(supportsESModules)\n .map(browser => `${browser} ${supportsESModules[browser]}`)\n .join(\", \");\n }\n\n // Parse browsers target via browserslist\n const browsersquery = validateBrowsers(targets.browsers);\n\n const hasTargets = Object.keys(targets).length > 0;\n const shouldParseBrowsers = !!targets.browsers;\n const shouldSearchForConfig =\n !options.ignoreBrowserslistConfig && !hasTargets;\n\n if (shouldParseBrowsers || shouldSearchForConfig) {\n // If no targets are passed, we need to overwrite browserslist's defaults\n // so that we enable all transforms (acting like the now deprecated\n // preset-latest).\n //\n // Note, if browserslist resolves the config (ex. package.json), then usage\n // of `defaults` in queries will be different since we don't want to break\n // the behavior of \"no targets is the same as preset-latest\".\n if (!hasTargets) {\n browserslist.defaults = objectToBrowserslist(targets);\n }\n\n const browsers = browserslist(browsersquery, {\n path: options.configPath,\n mobileToDesktop: true,\n });\n\n const queryBrowsers = getLowestVersions(browsers);\n targets = mergeBrowsers(queryBrowsers, targets);\n\n // Reset browserslist defaults\n browserslist.defaults = browserslistDefaults;\n }\n\n // Parse remaining targets\n const parsed = Object.keys(targets)\n .filter(value => value !== TargetNames.esmodules)\n .sort()\n .reduce(\n (results: ParsedResult, target: string): ParsedResult => {\n if (target !== TargetNames.browsers) {\n const value = targets[target];\n\n // Warn when specifying minor/patch as a decimal\n if (typeof value === \"number\" && value % 1 !== 0) {\n results.decimalWarnings.push({ target, value });\n }\n\n // Check if we have a target parser?\n const parser = targetParserMap[target] || targetParserMap.__default;\n const [parsedTarget, parsedValue] = parser(target, value);\n\n if (parsedValue) {\n // Merge (lowest wins)\n results.targets[parsedTarget] = parsedValue;\n }\n }\n\n return results;\n },\n {\n targets: targetOpts,\n decimalWarnings: [],\n },\n );\n\n outputDecimalWarning(parsed.decimalWarnings);\n\n return parsed.targets;\n}\n","// @flow\n\nimport {\n getInclusionReasons,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\n\nconst wordEnds = (size: number) => {\n return size > 1 ? \"s\" : \"\";\n};\n\n// Outputs a message that shows which target(s) caused an item to be included:\n// transform-foo { \"edge\":\"13\", \"firefox\":\"49\", \"ie\":\"10\" }\nexport const logPluginOrPolyfill = (\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) => {\n const filteredList = getInclusionReasons(item, targetVersions, list);\n\n const formattedTargets = JSON.stringify(filteredList)\n .replace(/,/g, \", \")\n .replace(/^\\{\"/, '{ \"')\n .replace(/\"\\}$/, '\" }');\n\n console.log(` ${item} ${formattedTargets}`);\n};\n\nexport const logEntryPolyfills = (\n polyfillName: string,\n importPolyfillIncluded: boolean,\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!importPolyfillIncluded) {\n console.log(`\\n[${filename}] Import of ${polyfillName} was not found.`);\n return;\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your targets, polyfills were not added.`,\n );\n return;\n }\n\n console.log(\n `\\n[${filename}] Replaced ${polyfillName} entries with the following polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n\nexport const logUsagePolyfills = (\n polyfills: Set,\n filename: string,\n polyfillTargets: Targets,\n allBuiltInsList: { [key: string]: Targets },\n) => {\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n if (!polyfills.size) {\n console.log(\n `\\n[${filename}] Based on your code and targets, core-js polyfills were not added.`,\n );\n return;\n }\n console.log(\n `\\n[${filename}] Added following core-js polyfill${wordEnds(\n polyfills.size,\n )}:`,\n );\n for (const polyfill of polyfills) {\n logPluginOrPolyfill(polyfill, polyfillTargets, allBuiltInsList);\n }\n};\n","// @flow\n\nconst defaultExcludesForLooseMode = [\"transform-typeof-symbol\"];\n\nexport default function({ loose }: { loose: boolean }): null | string[] {\n return loose ? defaultExcludesForLooseMode : null;\n}\n","// @flow\n\nexport function removeUnnecessaryItems(\n items: Set,\n overlapping: { [name: string]: string[] },\n) {\n items.forEach(item => {\n // $FlowIgnore Flow doesn't support calls in optional chains\n overlapping[item]?.forEach(name => items.delete(name));\n });\n}\n","// @flow\n\nimport typeof AvailablePlugins from \"./available-plugins\";\n\nexport default ({\n auto: \"transform-modules-commonjs\",\n amd: \"transform-modules-amd\",\n commonjs: \"transform-modules-commonjs\",\n cjs: \"transform-modules-commonjs\",\n systemjs: \"transform-modules-systemjs\",\n umd: \"transform-modules-umd\",\n}: { [transform: string]: $Keys });\n","'use strict';\nconst array = [];\nconst charCodeCache = [];\n\nconst leven = (left, right) => {\n\tif (left === right) {\n\t\treturn 0;\n\t}\n\n\tconst swap = left;\n\n\t// Swapping the strings if `a` is longer than `b` so we know which one is the\n\t// shortest & which one is the longest\n\tif (left.length > right.length) {\n\t\tleft = right;\n\t\tright = swap;\n\t}\n\n\tlet leftLength = left.length;\n\tlet rightLength = right.length;\n\n\t// Performing suffix trimming:\n\t// We can linearly drop suffix common to both strings since they\n\t// don't increase distance at all\n\t// Note: `~-` is the bitwise way to perform a `- 1` operation\n\twhile (leftLength > 0 && (left.charCodeAt(~-leftLength) === right.charCodeAt(~-rightLength))) {\n\t\tleftLength--;\n\t\trightLength--;\n\t}\n\n\t// Performing prefix trimming\n\t// We can linearly drop prefix common to both strings since they\n\t// don't increase distance at all\n\tlet start = 0;\n\n\twhile (start < leftLength && (left.charCodeAt(start) === right.charCodeAt(start))) {\n\t\tstart++;\n\t}\n\n\tleftLength -= start;\n\trightLength -= start;\n\n\tif (leftLength === 0) {\n\t\treturn rightLength;\n\t}\n\n\tlet bCharCode;\n\tlet result;\n\tlet temp;\n\tlet temp2;\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile (i < leftLength) {\n\t\tcharCodeCache[i] = left.charCodeAt(start + i);\n\t\tarray[i] = ++i;\n\t}\n\n\twhile (j < rightLength) {\n\t\tbCharCode = right.charCodeAt(start + j);\n\t\ttemp = j++;\n\t\tresult = j;\n\n\t\tfor (i = 0; i < leftLength; i++) {\n\t\t\ttemp2 = bCharCode === charCodeCache[i] ? temp : temp + 1;\n\t\t\ttemp = array[i];\n\t\t\t// eslint-disable-next-line no-multi-assign\n\t\t\tresult = array[i] = temp > result ? temp2 > result ? result + 1 : temp2 : temp2 > temp ? temp + 1 : temp2;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nmodule.exports = leven;\n// TODO: Remove this for the next major release\nmodule.exports.default = leven;\n","import leven from 'leven';\n\nexport default function levenArray(str, array) {\n let minLeven = Number.POSITIVE_INFINITY;\n let result = undefined;\n for(const item of array) {\n const distance = leven(str, item);\n if (distance < minLeven) {\n minLeven = distance;\n result = item;\n }\n }\n return result;\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/corejs2-built-ins.json\");\n","// @flow\n\nexport const TopLevelOptions = {\n configPath: \"configPath\",\n corejs: \"corejs\",\n debug: \"debug\",\n exclude: \"exclude\",\n forceAllTransforms: \"forceAllTransforms\",\n ignoreBrowserslistConfig: \"ignoreBrowserslistConfig\",\n include: \"include\",\n loose: \"loose\",\n modules: \"modules\",\n shippedProposals: \"shippedProposals\",\n spec: \"spec\",\n targets: \"targets\",\n useBuiltIns: \"useBuiltIns\",\n};\n\nexport const ModulesOption = {\n false: false,\n auto: \"auto\",\n amd: \"amd\",\n commonjs: \"commonjs\",\n cjs: \"cjs\",\n systemjs: \"systemjs\",\n umd: \"umd\",\n};\n\nexport const UseBuiltInsOption = {\n false: false,\n entry: \"entry\",\n usage: \"usage\",\n};\n","// @flow\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const defaultWebIncludes = [\n \"web.timers\",\n \"web.immediate\",\n \"web.dom.iterable\",\n];\n\nexport default function(targets: Targets): null | string[] {\n const targetNames = Object.keys(targets);\n const isAnyTarget = !targetNames.length;\n const isWebTarget = targetNames.some(name => name !== \"node\");\n\n return isAnyTarget || isWebTarget ? defaultWebIncludes : null;\n}\n","// @flow\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport findSuggestion from \"levenary\";\nimport invariant from \"invariant\";\nimport { coerce, SemVer } from \"semver\";\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport pluginsList from \"@babel/compat-data/plugins\";\nimport moduleTransformations from \"./module-transformations\";\nimport { TopLevelOptions, ModulesOption, UseBuiltInsOption } from \"./options\";\nimport { defaultWebIncludes } from \"./polyfills/corejs2/get-platform-specific-default\";\n\nimport type {\n BuiltInsOption,\n CorejsOption,\n ModuleOption,\n Options,\n PluginListItem,\n PluginListOption,\n} from \"./types\";\n\nconst validateTopLevelOptions = (options: Options) => {\n const validOptions = Object.keys(TopLevelOptions);\n\n for (const option in options) {\n if (!TopLevelOptions[option]) {\n throw new Error(\n `Invalid Option: ${option} is not a valid top-level option.\n Maybe you meant to use '${findSuggestion(option, validOptions)}'?`,\n );\n }\n }\n};\n\nconst allPluginsList = Object.keys(pluginsList);\n\n// NOTE: Since module plugins are handled seperatly compared to other plugins (via the \"modules\" option) it\n// should only be possible to exclude and not include module plugins, otherwise it's possible that preset-env\n// will add a module plugin twice.\nconst modulePlugins = [\n \"proposal-dynamic-import\",\n ...Object.keys(moduleTransformations).map(m => moduleTransformations[m]),\n];\n\nconst getValidIncludesAndExcludes = (\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n new Set([\n ...allPluginsList,\n ...(type === \"exclude\" ? modulePlugins : []),\n ...(corejs\n ? corejs == 2\n ? [...Object.keys(corejs2Polyfills), ...defaultWebIncludes]\n : Object.keys(corejs3Polyfills)\n : []),\n ]);\n\nconst pluginToRegExp = (plugin: PluginListItem) => {\n if (plugin instanceof RegExp) return plugin;\n try {\n return new RegExp(`^${normalizePluginName(plugin)}$`);\n } catch (e) {\n return null;\n }\n};\n\nconst selectPlugins = (\n regexp: RegExp | null,\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) =>\n Array.from(getValidIncludesAndExcludes(type, corejs)).filter(\n item => regexp instanceof RegExp && regexp.test(item),\n );\n\nconst flatten = (array: Array>): Array => [].concat(...array);\n\nconst expandIncludesAndExcludes = (\n plugins: PluginListOption = [],\n type: \"include\" | \"exclude\",\n corejs: number | false,\n) => {\n if (plugins.length === 0) return [];\n\n const selectedPlugins = plugins.map(plugin =>\n selectPlugins(pluginToRegExp(plugin), type, corejs),\n );\n const invalidRegExpList = plugins.filter(\n (p, i) => selectedPlugins[i].length === 0,\n );\n\n invariant(\n invalidRegExpList.length === 0,\n `Invalid Option: The plugins/built-ins '${invalidRegExpList.join(\n \", \",\n )}' passed to the '${type}' option are not\n valid. Please check data/[plugin-features|built-in-features].js in babel-preset-env`,\n );\n\n return flatten(selectedPlugins);\n};\n\nexport const normalizePluginName = (plugin: string) =>\n plugin.replace(/^(@babel\\/|babel-)(plugin-)?/, \"\");\n\nexport const checkDuplicateIncludeExcludes = (\n include: Array = [],\n exclude: Array = [],\n) => {\n const duplicates = include.filter(opt => exclude.indexOf(opt) >= 0);\n\n invariant(\n duplicates.length === 0,\n `Invalid Option: The plugins/built-ins '${duplicates.join(\n \", \",\n )}' were found in both the \"include\" and\n \"exclude\" options.`,\n );\n};\n\nconst normalizeTargets = targets => {\n // TODO: Allow to use only query or strings as a targets from next breaking change.\n if (typeof targets === \"string\" || Array.isArray(targets)) {\n return { browsers: targets };\n }\n return {\n ...targets,\n };\n};\n\nexport const validateConfigPathOption = (\n configPath: string = process.cwd(),\n) => {\n invariant(\n typeof configPath === \"string\",\n `Invalid Option: The configPath option '${configPath}' is invalid, only strings are allowed.`,\n );\n return configPath;\n};\n\nexport const validateBoolOption = (\n name: string,\n value?: boolean,\n defaultValue: boolean,\n) => {\n if (typeof value === \"undefined\") {\n value = defaultValue;\n }\n\n if (typeof value !== \"boolean\") {\n throw new Error(`Preset env: '${name}' option must be a boolean.`);\n }\n\n return value;\n};\n\nexport const validateIgnoreBrowserslistConfig = (\n ignoreBrowserslistConfig: boolean,\n) =>\n validateBoolOption(\n TopLevelOptions.ignoreBrowserslistConfig,\n ignoreBrowserslistConfig,\n false,\n );\n\nexport const validateModulesOption = (\n modulesOpt: ModuleOption = ModulesOption.auto,\n) => {\n invariant(\n ModulesOption[modulesOpt.toString()] ||\n ModulesOption[modulesOpt.toString()] === ModulesOption.false,\n `Invalid Option: The 'modules' option must be one of \\n` +\n ` - 'false' to indicate no module processing\\n` +\n ` - a specific module type: 'commonjs', 'amd', 'umd', 'systemjs'` +\n ` - 'auto' (default) which will automatically select 'false' if the current\\n` +\n ` process is known to support ES module syntax, or \"commonjs\" otherwise\\n`,\n );\n\n return modulesOpt;\n};\n\nexport const validateUseBuiltInsOption = (\n builtInsOpt: BuiltInsOption = false,\n) => {\n invariant(\n UseBuiltInsOption[builtInsOpt.toString()] ||\n UseBuiltInsOption[builtInsOpt.toString()] === UseBuiltInsOption.false,\n `Invalid Option: The 'useBuiltIns' option must be either\n 'false' (default) to indicate no polyfill,\n '\"entry\"' to indicate replacing the entry polyfill, or\n '\"usage\"' to import only used polyfills per file`,\n );\n\n return builtInsOpt;\n};\n\nexport type NormalizedCorejsOption = {\n proposals: boolean,\n version: typeof SemVer | null | false,\n};\n\nexport function normalizeCoreJSOption(\n corejs?: CorejsOption,\n useBuiltIns: BuiltInsOption,\n): NormalizedCorejsOption {\n let proposals = false;\n let rawVersion;\n\n if (useBuiltIns && corejs === undefined) {\n rawVersion = 2;\n console.warn(\n \"\\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a \" +\n \"core-js version. Currently, we assume version 2.x when no version \" +\n \"is passed. Since this default version will likely change in future \" +\n \"versions of Babel, we recommend explicitly setting the core-js version \" +\n \"you are using via the `corejs` option.\\n\" +\n \"\\nYou should also be sure that the version you pass to the `corejs` \" +\n \"option matches the version specified in your `package.json`'s \" +\n \"`dependencies` section. If it doesn't, you need to run one of the \" +\n \"following commands:\\n\\n\" +\n \" npm install --save core-js@2 npm install --save core-js@3\\n\" +\n \" yarn add core-js@2 yarn add core-js@3\\n\",\n );\n } else if (typeof corejs === \"object\" && corejs !== null) {\n rawVersion = corejs.version;\n proposals = Boolean(corejs.proposals);\n } else {\n rawVersion = corejs;\n }\n\n const version = rawVersion ? coerce(String(rawVersion)) : false;\n\n if (!useBuiltIns && version) {\n console.log(\n \"\\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\\n\",\n );\n }\n\n if (useBuiltIns && (!version || version.major < 2 || version.major > 3)) {\n throw new RangeError(\n \"Invalid Option: The version passed to `corejs` is invalid. Currently, \" +\n \"only core-js@2 and core-js@3 are supported.\",\n );\n }\n\n return { version, proposals };\n}\n\nexport default function normalizeOptions(opts: Options) {\n validateTopLevelOptions(opts);\n\n const useBuiltIns = validateUseBuiltInsOption(opts.useBuiltIns);\n\n const corejs = normalizeCoreJSOption(opts.corejs, useBuiltIns);\n\n const include = expandIncludesAndExcludes(\n opts.include,\n TopLevelOptions.include,\n !!corejs.version && corejs.version.major,\n );\n\n const exclude = expandIncludesAndExcludes(\n opts.exclude,\n TopLevelOptions.exclude,\n !!corejs.version && corejs.version.major,\n );\n\n checkDuplicateIncludeExcludes(include, exclude);\n\n const shippedProposals =\n validateBoolOption(\n TopLevelOptions.shippedProposals,\n opts.shippedProposals,\n false,\n ) || corejs.proposals;\n\n return {\n configPath: validateConfigPathOption(opts.configPath),\n corejs,\n debug: validateBoolOption(TopLevelOptions.debug, opts.debug, false),\n include,\n exclude,\n forceAllTransforms: validateBoolOption(\n TopLevelOptions.forceAllTransforms,\n opts.forceAllTransforms,\n false,\n ),\n ignoreBrowserslistConfig: validateIgnoreBrowserslistConfig(\n opts.ignoreBrowserslistConfig,\n ),\n loose: validateBoolOption(TopLevelOptions.loose, opts.loose, false),\n modules: validateModulesOption(opts.modules),\n shippedProposals,\n spec: validateBoolOption(TopLevelOptions.spec, opts.spec, false),\n targets: normalizeTargets(opts.targets),\n useBuiltIns: useBuiltIns,\n };\n}\n","/* eslint sort-keys: \"error\" */\n// These mappings represent the syntax proposals that have been\n// shipped by browsers, and are enabled by the `shippedProposals` option.\n\nconst proposalPlugins = {};\n\n// use intermediary object to enforce alphabetical key order\nconst pluginSyntaxObject = {\n \"proposal-async-generator-functions\": \"syntax-async-generators\",\n \"proposal-json-strings\": \"syntax-json-strings\",\n \"proposal-nullish-coalescing-operator\": \"syntax-nullish-coalescing-operator\",\n \"proposal-object-rest-spread\": \"syntax-object-rest-spread\",\n \"proposal-optional-catch-binding\": \"syntax-optional-catch-binding\",\n \"proposal-optional-chaining\": \"syntax-optional-chaining\",\n \"proposal-unicode-property-regex\": null,\n};\n\nconst pluginSyntaxEntries = Object.keys(pluginSyntaxObject).map(function (key) {\n return [key, pluginSyntaxObject[key]];\n});\n\nconst pluginSyntaxMap = new Map(pluginSyntaxEntries);\n\nmodule.exports = { pluginSyntaxMap, proposalPlugins };\n","// Node < 13.3 doesn't support export maps in package.json.\n// Use this proxy file as a fallback.\n\nmodule.exports = require(\"./data/overlapping-plugins.json\");\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es6.object.to-string\",\n \"es6.array.iterator\",\n \"web.dom.iterable\",\n];\n\nconst CommonIterators = [\"es6.string.iterator\", ...ArrayNatureIterators];\n\nconst PromiseDependencies = [\"es6.object.to-string\", \"es6.promise\"];\n\nexport const BuiltIns: ObjectMap = {\n DataView: \"es6.typed.data-view\",\n Float32Array: \"es6.typed.float32-array\",\n Float64Array: \"es6.typed.float64-array\",\n Int8Array: \"es6.typed.int8-array\",\n Int16Array: \"es6.typed.int16-array\",\n Int32Array: \"es6.typed.int32-array\",\n Map: [\"es6.map\", ...CommonIterators],\n Number: \"es6.number.constructor\",\n Promise: PromiseDependencies,\n RegExp: [\"es6.regexp.constructor\"],\n Set: [\"es6.set\", ...CommonIterators],\n Symbol: [\"es6.symbol\", \"es7.symbol.async-iterator\"],\n Uint8Array: \"es6.typed.uint8-array\",\n Uint8ClampedArray: \"es6.typed.uint8-clamped-array\",\n Uint16Array: \"es6.typed.uint16-array\",\n Uint32Array: \"es6.typed.uint32-array\",\n WeakMap: [\"es6.weak-map\", ...CommonIterators],\n WeakSet: [\"es6.weak-set\", ...CommonIterators],\n};\n\nexport const InstanceProperties: ObjectMap = {\n __defineGetter__: [\"es7.object.define-getter\"],\n __defineSetter__: [\"es7.object.define-setter\"],\n __lookupGetter__: [\"es7.object.lookup-getter\"],\n __lookupSetter__: [\"es7.object.lookup-setter\"],\n anchor: [\"es6.string.anchor\"],\n big: [\"es6.string.big\"],\n bind: [\"es6.function.bind\"],\n blink: [\"es6.string.blink\"],\n bold: [\"es6.string.bold\"],\n codePointAt: [\"es6.string.code-point-at\"],\n copyWithin: [\"es6.array.copy-within\"],\n endsWith: [\"es6.string.ends-with\"],\n entries: ArrayNatureIterators,\n every: [\"es6.array.is-array\"],\n fill: [\"es6.array.fill\"],\n filter: [\"es6.array.filter\"],\n finally: [\"es7.promise.finally\", ...PromiseDependencies],\n find: [\"es6.array.find\"],\n findIndex: [\"es6.array.find-index\"],\n fixed: [\"es6.string.fixed\"],\n flags: [\"es6.regexp.flags\"],\n flatMap: [\"es7.array.flat-map\"],\n fontcolor: [\"es6.string.fontcolor\"],\n fontsize: [\"es6.string.fontsize\"],\n forEach: [\"es6.array.for-each\"],\n includes: [\"es6.string.includes\", \"es7.array.includes\"],\n indexOf: [\"es6.array.index-of\"],\n italics: [\"es6.string.italics\"],\n keys: ArrayNatureIterators,\n lastIndexOf: [\"es6.array.last-index-of\"],\n link: [\"es6.string.link\"],\n map: [\"es6.array.map\"],\n match: [\"es6.regexp.match\"],\n name: [\"es6.function.name\"],\n padStart: [\"es7.string.pad-start\"],\n padEnd: [\"es7.string.pad-end\"],\n reduce: [\"es6.array.reduce\"],\n reduceRight: [\"es6.array.reduce-right\"],\n repeat: [\"es6.string.repeat\"],\n replace: [\"es6.regexp.replace\"],\n search: [\"es6.regexp.search\"],\n slice: [\"es6.array.slice\"],\n small: [\"es6.string.small\"],\n some: [\"es6.array.some\"],\n sort: [\"es6.array.sort\"],\n split: [\"es6.regexp.split\"],\n startsWith: [\"es6.string.starts-with\"],\n strike: [\"es6.string.strike\"],\n sub: [\"es6.string.sub\"],\n sup: [\"es6.string.sup\"],\n toISOString: [\"es6.date.to-iso-string\"],\n toJSON: [\"es6.date.to-json\"],\n toString: [\n \"es6.object.to-string\",\n \"es6.date.to-string\",\n \"es6.regexp.to-string\",\n ],\n trim: [\"es6.string.trim\"],\n trimEnd: [\"es7.string.trim-right\"],\n trimLeft: [\"es7.string.trim-left\"],\n trimRight: [\"es7.string.trim-right\"],\n trimStart: [\"es7.string.trim-left\"],\n values: ArrayNatureIterators,\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es6.array.from\", \"es6.string.iterator\"],\n isArray: \"es6.array.is-array\",\n of: \"es6.array.of\",\n },\n\n Date: {\n now: \"es6.date.now\",\n },\n\n Object: {\n assign: \"es6.object.assign\",\n create: \"es6.object.create\",\n defineProperty: \"es6.object.define-property\",\n defineProperties: \"es6.object.define-properties\",\n entries: \"es7.object.entries\",\n freeze: \"es6.object.freeze\",\n getOwnPropertyDescriptors: \"es7.object.get-own-property-descriptors\",\n getOwnPropertySymbols: \"es6.symbol\",\n is: \"es6.object.is\",\n isExtensible: \"es6.object.is-extensible\",\n isFrozen: \"es6.object.is-frozen\",\n isSealed: \"es6.object.is-sealed\",\n keys: \"es6.object.keys\",\n preventExtensions: \"es6.object.prevent-extensions\",\n seal: \"es6.object.seal\",\n setPrototypeOf: \"es6.object.set-prototype-of\",\n values: \"es7.object.values\",\n },\n\n Math: {\n acosh: \"es6.math.acosh\",\n asinh: \"es6.math.asinh\",\n atanh: \"es6.math.atanh\",\n cbrt: \"es6.math.cbrt\",\n clz32: \"es6.math.clz32\",\n cosh: \"es6.math.cosh\",\n expm1: \"es6.math.expm1\",\n fround: \"es6.math.fround\",\n hypot: \"es6.math.hypot\",\n imul: \"es6.math.imul\",\n log1p: \"es6.math.log1p\",\n log10: \"es6.math.log10\",\n log2: \"es6.math.log2\",\n sign: \"es6.math.sign\",\n sinh: \"es6.math.sinh\",\n tanh: \"es6.math.tanh\",\n trunc: \"es6.math.trunc\",\n },\n\n String: {\n fromCodePoint: \"es6.string.from-code-point\",\n raw: \"es6.string.raw\",\n },\n\n Number: {\n EPSILON: \"es6.number.epsilon\",\n MIN_SAFE_INTEGER: \"es6.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es6.number.max-safe-integer\",\n isFinite: \"es6.number.is-finite\",\n isInteger: \"es6.number.is-integer\",\n isSafeInteger: \"es6.number.is-safe-integer\",\n isNaN: \"es6.number.is-nan\",\n parseFloat: \"es6.number.parse-float\",\n parseInt: \"es6.number.parse-int\",\n },\n\n Promise: {\n all: CommonIterators,\n race: CommonIterators,\n },\n\n Reflect: {\n apply: \"es6.reflect.apply\",\n construct: \"es6.reflect.construct\",\n defineProperty: \"es6.reflect.define-property\",\n deleteProperty: \"es6.reflect.delete-property\",\n get: \"es6.reflect.get\",\n getOwnPropertyDescriptor: \"es6.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es6.reflect.get-prototype-of\",\n has: \"es6.reflect.has\",\n isExtensible: \"es6.reflect.is-extensible\",\n ownKeys: \"es6.reflect.own-keys\",\n preventExtensions: \"es6.reflect.prevent-extensions\",\n set: \"es6.reflect.set\",\n setPrototypeOf: \"es6.reflect.set-prototype-of\",\n },\n};\n","// @flow\n\nimport * as t from \"@babel/types\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { addSideEffect } from \"@babel/helper-module-imports\";\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport const has = Object.hasOwnProperty.call.bind(Object.hasOwnProperty);\n\nexport function getType(target: any): string {\n return Object.prototype.toString\n .call(target)\n .slice(8, -1)\n .toLowerCase();\n}\n\nexport function intersection(\n first: Set,\n second: Set,\n third: Set,\n): Set {\n const result = new Set();\n for (const el of first) {\n if (second.has(el) && third.has(el)) result.add(el);\n }\n return result;\n}\n\nexport function filterStageFromList(\n list: { [feature: string]: Targets },\n stageList: { [feature: string]: boolean },\n) {\n return Object.keys(list).reduce((result, item) => {\n if (!stageList[item]) {\n result[item] = list[item];\n }\n\n return result;\n }, {});\n}\n\nexport function getImportSource({ node }: NodePath) {\n if (node.specifiers.length === 0) return node.source.value;\n}\n\nexport function getRequireSource({ node }: NodePath) {\n if (!t.isExpressionStatement(node)) return;\n const { expression } = node;\n const isRequire =\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee) &&\n expression.callee.name === \"require\" &&\n expression.arguments.length === 1 &&\n t.isStringLiteral(expression.arguments[0]);\n if (isRequire) return expression.arguments[0].value;\n}\n\nexport function isPolyfillSource(source: ?string): boolean {\n return source === \"@babel/polyfill\" || source === \"core-js\";\n}\n\nconst modulePathMap = {\n \"regenerator-runtime\": \"regenerator-runtime/runtime\",\n};\n\nexport function getModulePath(mod: string): string {\n return modulePathMap[mod] || `core-js/modules/${mod}`;\n}\n\nexport function createImport(path: NodePath, mod: string) {\n return addSideEffect(path, getModulePath(mod));\n}\n\nexport function isNamespaced(path: NodePath) {\n if (!path.node) return false;\n const binding = path.scope.getBinding(path.node.name);\n if (!binding) return false;\n return binding.path.isImportNamespaceSpecifier();\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the \\`import '@babel/polyfill'\\` call or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nexport default function(\n { types: t }: { types: Object },\n { include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const addAndRemovePolyfillImports = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n // Symbol()\n // new Promise\n ReferencedIdentifier({ node: { name }, parent, scope }: NodePath) {\n if (t.isMemberExpression(parent)) return;\n if (!has(BuiltIns, name)) return;\n if (scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n\n // arr[Symbol.iterator]()\n CallExpression(path: NodePath) {\n // we can't compile this\n if (path.node.arguments.length) return;\n\n const callee = path.node.callee;\n\n if (!t.isMemberExpression(callee)) return;\n if (!callee.computed) return;\n if (!path.get(\"callee.property\").matchesPattern(\"Symbol.iterator\")) {\n return;\n }\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // Symbol.iterator in arr\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n if (!path.get(\"left\").matchesPattern(\"Symbol.iterator\")) return;\n\n this.addImport(\"web.dom.iterable\");\n },\n\n // yield*\n YieldExpression(path: NodePath) {\n if (path.node.delegate) {\n this.addImport(\"web.dom.iterable\");\n }\n },\n\n // Array.from\n MemberExpression: {\n enter(path: NodePath) {\n const { node } = path;\n const { object, property } = node;\n\n // ignore namespace\n if (isNamespaced(path.get(\"object\"))) return;\n\n let evaluatedPropType = object.name;\n let propertyName = \"\";\n let instanceType = \"\";\n\n if (node.computed) {\n if (t.isStringLiteral(property)) {\n propertyName = property.value;\n } else {\n const result = path.get(\"property\").evaluate();\n if (result.confident && result.value) {\n propertyName = result.value;\n }\n }\n } else {\n propertyName = property.name;\n }\n\n if (path.scope.getBindingIdentifier(object.name)) {\n const result = path.get(\"object\").evaluate();\n if (result.value) {\n instanceType = getType(result.value);\n } else if (result.deopt && result.deopt.isIdentifier()) {\n evaluatedPropType = result.deopt.node.name;\n }\n }\n\n if (has(StaticProperties, evaluatedPropType)) {\n const BuiltInProperties = StaticProperties[evaluatedPropType];\n if (has(BuiltInProperties, propertyName)) {\n const StaticPropertyDependencies = BuiltInProperties[propertyName];\n this.addUnsupported(StaticPropertyDependencies);\n }\n }\n\n if (has(InstanceProperties, propertyName)) {\n let InstancePropertyDependencies = InstanceProperties[propertyName];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n module => module.includes(instanceType),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n }\n },\n\n // Symbol.match\n exit(path: NodePath) {\n const { name } = path.node.object;\n\n if (!has(BuiltIns, name)) return;\n if (path.scope.getBindingIdentifier(name)) return;\n\n const BuiltInDependencies = BuiltIns[name];\n this.addUnsupported(BuiltInDependencies);\n },\n },\n\n // var { repeat, startsWith } = String\n VariableDeclarator(path: NodePath) {\n const { node } = path;\n const { id, init } = node;\n\n if (!t.isObjectPattern(id)) return;\n\n // doesn't reference the global\n if (init && path.scope.getBindingIdentifier(init.name)) return;\n\n for (const { key } of id.properties) {\n if (\n !node.computed &&\n t.isIdentifier(key) &&\n has(InstanceProperties, key.name)\n ) {\n const InstancePropertyDependencies = InstanceProperties[key.name];\n this.addUnsupported(InstancePropertyDependencies);\n }\n }\n },\n };\n\n return {\n name: \"corejs2-usage\",\n pre({ path }: { path: NodePath }) {\n this.polyfillsSet = new Set();\n\n this.addImport = function(builtIn) {\n if (!this.polyfillsSet.has(builtIn)) {\n this.polyfillsSet.add(builtIn);\n createImport(path, builtIn);\n }\n };\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n if (polyfills.has(module)) {\n this.addImport(module);\n }\n }\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.polyfillsSet,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nexport default ([\"esnext.global-this\", \"esnext.string.match-all\"]: string[]);\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\nmodule.exports = {\n SEMVER_SPEC_VERSION,\n MAX_LENGTH,\n MAX_SAFE_INTEGER,\n MAX_SAFE_COMPONENT_LENGTH\n}\n","const { MAX_SAFE_COMPONENT_LENGTH } = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst createToken = (name, value, isGlobal) => {\n const index = R++\n debug(index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*')\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { re, t } = require('../internal/re')\n\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.format()\n this.raw = this.version\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const {MAX_LENGTH} = require('../internal/constants')\nconst { re, t } = require('../internal/re')\nconst SemVer = require('../classes/semver')\n\nconst parse = (version, options) => {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n const r = options.loose ? re[t.LOOSE] : re[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst {re, t} = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null)\n return null\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","'use strict';\nconst cmp = require('semver/functions/cmp');\nconst semver = require('semver/functions/coerce');\n\nconst has = Function.call.bind({}.hasOwnProperty);\n\nfunction compare(a, operator, b) {\n return cmp(semver(a), operator, semver(b));\n}\n\nfunction intersection(list, order) {\n const set = list instanceof Set ? list : new Set(list);\n return order.filter(name => set.has(name));\n}\n\nfunction sortObjectByKey(object, fn) {\n return Object.keys(object).sort(fn).reduce((memo, key) => {\n memo[key] = object[key];\n return memo;\n }, {});\n}\n\nmodule.exports = {\n compare,\n has,\n intersection,\n semver,\n sortObjectByKey,\n};\n","'use strict';\nconst { compare, intersection, semver } = require('./helpers');\nconst modulesByVersions = require('./modules-by-versions');\nconst modules = require('./modules');\n\nmodule.exports = function (raw) {\n const corejs = semver(raw);\n if (corejs.major !== 3) {\n throw RangeError('This version of `core-js-compat` works only with `core-js@3`.');\n }\n const result = [];\n for (const version of Object.keys(modulesByVersions)) {\n if (compare(version, '<=', corejs)) {\n result.push(...modulesByVersions[version]);\n }\n }\n return intersection(result, modules);\n};\n","// @flow\n\ntype ObjectMap = { [name: string]: V };\n\nconst ArrayNatureIterators = [\n \"es.array.iterator\",\n \"web.dom-collections.iterator\",\n];\n\nexport const CommonIterators = [\"es.string.iterator\", ...ArrayNatureIterators];\n\nconst ArrayNatureIteratorsWithTag = [\n \"es.object.to-string\",\n ...ArrayNatureIterators,\n];\n\nconst CommonIteratorsWithTag = [\"es.object.to-string\", ...CommonIterators];\n\nconst TypedArrayDependencies = [\n \"es.typed-array.copy-within\",\n \"es.typed-array.every\",\n \"es.typed-array.fill\",\n \"es.typed-array.filter\",\n \"es.typed-array.find\",\n \"es.typed-array.find-index\",\n \"es.typed-array.for-each\",\n \"es.typed-array.includes\",\n \"es.typed-array.index-of\",\n \"es.typed-array.iterator\",\n \"es.typed-array.join\",\n \"es.typed-array.last-index-of\",\n \"es.typed-array.map\",\n \"es.typed-array.reduce\",\n \"es.typed-array.reduce-right\",\n \"es.typed-array.reverse\",\n \"es.typed-array.set\",\n \"es.typed-array.slice\",\n \"es.typed-array.some\",\n \"es.typed-array.sort\",\n \"es.typed-array.subarray\",\n \"es.typed-array.to-locale-string\",\n \"es.typed-array.to-string\",\n \"es.object.to-string\",\n \"es.array.iterator\",\n \"es.array-buffer.slice\",\n];\n\nconst TypedArrayStaticMethods = {\n from: \"es.typed-array.from\",\n of: \"es.typed-array.of\",\n};\n\nexport const PromiseDependencies = [\"es.promise\", \"es.object.to-string\"];\n\nconst PromiseDependenciesWithIterators = [\n ...PromiseDependencies,\n ...CommonIterators,\n];\n\nconst SymbolDependencies = [\n \"es.symbol\",\n \"es.symbol.description\",\n \"es.object.to-string\",\n];\n\nconst MapDependencies = [\n \"es.map\",\n \"esnext.map.delete-all\",\n \"esnext.map.every\",\n \"esnext.map.filter\",\n \"esnext.map.find\",\n \"esnext.map.find-key\",\n \"esnext.map.includes\",\n \"esnext.map.key-of\",\n \"esnext.map.map-keys\",\n \"esnext.map.map-values\",\n \"esnext.map.merge\",\n \"esnext.map.reduce\",\n \"esnext.map.some\",\n \"esnext.map.update\",\n ...CommonIteratorsWithTag,\n];\n\nconst SetDependencies = [\n \"es.set\",\n \"esnext.set.add-all\",\n \"esnext.set.delete-all\",\n \"esnext.set.difference\",\n \"esnext.set.every\",\n \"esnext.set.filter\",\n \"esnext.set.find\",\n \"esnext.set.intersection\",\n \"esnext.set.is-disjoint-from\",\n \"esnext.set.is-subset-of\",\n \"esnext.set.is-superset-of\",\n \"esnext.set.join\",\n \"esnext.set.map\",\n \"esnext.set.reduce\",\n \"esnext.set.some\",\n \"esnext.set.symmetric-difference\",\n \"esnext.set.union\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakMapDependencies = [\n \"es.weak-map\",\n \"esnext.weak-map.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst WeakSetDependencies = [\n \"es.weak-set\",\n \"esnext.weak-set.add-all\",\n \"esnext.weak-set.delete-all\",\n ...CommonIteratorsWithTag,\n];\n\nconst URLSearchParamsDependencies = [\"web.url\", ...CommonIteratorsWithTag];\n\nexport const BuiltIns: ObjectMap = {\n AggregateError: [\"esnext.aggregate-error\", ...CommonIterators],\n ArrayBuffer: [\n \"es.array-buffer.constructor\",\n \"es.array-buffer.slice\",\n \"es.object.to-string\",\n ],\n DataView: [\"es.data-view\", \"es.array-buffer.slice\", \"es.object.to-string\"],\n Date: [\"es.date.to-string\"],\n Float32Array: [\"es.typed-array.float32-array\", ...TypedArrayDependencies],\n Float64Array: [\"es.typed-array.float64-array\", ...TypedArrayDependencies],\n Int8Array: [\"es.typed-array.int8-array\", ...TypedArrayDependencies],\n Int16Array: [\"es.typed-array.int16-array\", ...TypedArrayDependencies],\n Int32Array: [\"es.typed-array.int32-array\", ...TypedArrayDependencies],\n Uint8Array: [\"es.typed-array.uint8-array\", ...TypedArrayDependencies],\n Uint8ClampedArray: [\n \"es.typed-array.uint8-clamped-array\",\n ...TypedArrayDependencies,\n ],\n Uint16Array: [\"es.typed-array.uint16-array\", ...TypedArrayDependencies],\n Uint32Array: [\"es.typed-array.uint32-array\", ...TypedArrayDependencies],\n Map: MapDependencies,\n Number: [\"es.number.constructor\"],\n Observable: [\n \"esnext.observable\",\n \"esnext.symbol.observable\",\n \"es.object.to-string\",\n ...CommonIteratorsWithTag,\n ],\n Promise: PromiseDependencies,\n RegExp: [\"es.regexp.constructor\", \"es.regexp.exec\", \"es.regexp.to-string\"],\n Set: SetDependencies,\n Symbol: SymbolDependencies,\n URL: [\"web.url\", ...URLSearchParamsDependencies],\n URLSearchParams: URLSearchParamsDependencies,\n WeakMap: WeakMapDependencies,\n WeakSet: WeakSetDependencies,\n clearImmediate: [\"web.immediate\"],\n compositeKey: [\"esnext.composite-key\"],\n compositeSymbol: [\"esnext.composite-symbol\", ...SymbolDependencies],\n fetch: PromiseDependencies,\n globalThis: [\"esnext.global-this\"],\n parseFloat: [\"es.parse-float\"],\n parseInt: [\"es.parse-int\"],\n queueMicrotask: [\"web.queue-microtask\"],\n setTimeout: [\"web.timers\"],\n setInterval: [\"web.timers\"],\n setImmediate: [\"web.immediate\"],\n};\n\nexport const InstanceProperties: ObjectMap = {\n at: [\"esnext.string.at\"],\n anchor: [\"es.string.anchor\"],\n big: [\"es.string.big\"],\n bind: [\"es.function.bind\"],\n blink: [\"es.string.blink\"],\n bold: [\"es.string.bold\"],\n codePointAt: [\"es.string.code-point-at\"],\n codePoints: [\"esnext.string.code-points\"],\n concat: [\"es.array.concat\"],\n copyWithin: [\"es.array.copy-within\"],\n description: [\"es.symbol\", \"es.symbol.description\"],\n endsWith: [\"es.string.ends-with\"],\n entries: ArrayNatureIteratorsWithTag,\n every: [\"es.array.every\"],\n exec: [\"es.regexp.exec\"],\n fill: [\"es.array.fill\"],\n filter: [\"es.array.filter\"],\n finally: [\"es.promise.finally\", ...PromiseDependencies],\n find: [\"es.array.find\"],\n findIndex: [\"es.array.find-index\"],\n fixed: [\"es.string.fixed\"],\n flags: [\"es.regexp.flags\"],\n flat: [\"es.array.flat\", \"es.array.unscopables.flat\"],\n flatMap: [\"es.array.flat-map\", \"es.array.unscopables.flat-map\"],\n fontcolor: [\"es.string.fontcolor\"],\n fontsize: [\"es.string.fontsize\"],\n forEach: [\"es.array.for-each\", \"web.dom-collections.for-each\"],\n includes: [\"es.array.includes\", \"es.string.includes\"],\n indexOf: [\"es.array.index-of\"],\n italics: [\"es.string.italics\"],\n join: [\"es.array.join\"],\n keys: ArrayNatureIteratorsWithTag,\n lastIndex: [\"esnext.array.last-index\"],\n lastIndexOf: [\"es.array.last-index-of\"],\n lastItem: [\"esnext.array.last-item\"],\n link: [\"es.string.link\"],\n match: [\"es.string.match\", \"es.regexp.exec\"],\n matchAll: [\"esnext.string.match-all\"],\n map: [\"es.array.map\"],\n name: [\"es.function.name\"],\n padEnd: [\"es.string.pad-end\"],\n padStart: [\"es.string.pad-start\"],\n reduce: [\"es.array.reduce\"],\n reduceRight: [\"es.array.reduce-right\"],\n repeat: [\"es.string.repeat\"],\n replace: [\"es.string.replace\", \"es.regexp.exec\"],\n replaceAll: [\"esnext.string.replace-all\"],\n reverse: [\"es.array.reverse\"],\n search: [\"es.string.search\", \"es.regexp.exec\"],\n slice: [\"es.array.slice\"],\n small: [\"es.string.small\"],\n some: [\"es.array.some\"],\n sort: [\"es.array.sort\"],\n splice: [\"es.array.splice\"],\n split: [\"es.string.split\", \"es.regexp.exec\"],\n startsWith: [\"es.string.starts-with\"],\n strike: [\"es.string.strike\"],\n sub: [\"es.string.sub\"],\n sup: [\"es.string.sup\"],\n toFixed: [\"es.number.to-fixed\"],\n toISOString: [\"es.date.to-iso-string\"],\n toJSON: [\"es.date.to-json\", \"web.url.to-json\"],\n toPrecision: [\"es.number.to-precision\"],\n toString: [\"es.object.to-string\", \"es.regexp.to-string\", \"es.date.to-string\"],\n trim: [\"es.string.trim\"],\n trimEnd: [\"es.string.trim-end\"],\n trimLeft: [\"es.string.trim-start\"],\n trimRight: [\"es.string.trim-end\"],\n trimStart: [\"es.string.trim-start\"],\n values: ArrayNatureIteratorsWithTag,\n __defineGetter__: [\"es.object.define-getter\"],\n __defineSetter__: [\"es.object.define-setter\"],\n __lookupGetter__: [\"es.object.lookup-getter\"],\n __lookupSetter__: [\"es.object.lookup-setter\"],\n};\n\nexport const StaticProperties: ObjectMap> = {\n Array: {\n from: [\"es.array.from\", \"es.string.iterator\"],\n isArray: [\"es.array.is-array\"],\n of: [\"es.array.of\"],\n },\n\n Date: {\n now: \"es.date.now\",\n },\n\n Object: {\n assign: \"es.object.assign\",\n create: \"es.object.create\",\n defineProperty: \"es.object.define-property\",\n defineProperties: \"es.object.define-properties\",\n entries: \"es.object.entries\",\n freeze: \"es.object.freeze\",\n fromEntries: [\"es.object.from-entries\", \"es.array.iterator\"],\n getOwnPropertyDescriptor: \"es.object.get-own-property-descriptor\",\n getOwnPropertyDescriptors: \"es.object.get-own-property-descriptors\",\n getOwnPropertyNames: \"es.object.get-own-property-names\",\n getOwnPropertySymbols: \"es.symbol\",\n getPrototypeOf: \"es.object.get-prototype-of\",\n is: \"es.object.is\",\n isExtensible: \"es.object.is-extensible\",\n isFrozen: \"es.object.is-frozen\",\n isSealed: \"es.object.is-sealed\",\n keys: \"es.object.keys\",\n preventExtensions: \"es.object.prevent-extensions\",\n seal: \"es.object.seal\",\n setPrototypeOf: \"es.object.set-prototype-of\",\n values: \"es.object.values\",\n },\n\n Math: {\n DEG_PER_RAD: \"esnext.math.deg-per-rad\",\n RAD_PER_DEG: \"esnext.math.rad-per-deg\",\n acosh: \"es.math.acosh\",\n asinh: \"es.math.asinh\",\n atanh: \"es.math.atanh\",\n cbrt: \"es.math.cbrt\",\n clamp: \"esnext.math.clamp\",\n clz32: \"es.math.clz32\",\n cosh: \"es.math.cosh\",\n degrees: \"esnext.math.degrees\",\n expm1: \"es.math.expm1\",\n fround: \"es.math.fround\",\n fscale: \"esnext.math.fscale\",\n hypot: \"es.math.hypot\",\n iaddh: \"esnext.math.iaddh\",\n imul: \"es.math.imul\",\n imulh: \"esnext.math.imulh\",\n isubh: \"esnext.math.isubh\",\n log1p: \"es.math.log1p\",\n log10: \"es.math.log10\",\n log2: \"es.math.log2\",\n radians: \"esnext.math.radians\",\n scale: \"esnext.math.scale\",\n seededPRNG: \"esnext.math.seeded-prng\",\n sign: \"es.math.sign\",\n signbit: \"esnext.math.signbit\",\n sinh: \"es.math.sinh\",\n tanh: \"es.math.tanh\",\n trunc: \"es.math.trunc\",\n umulh: \"esnext.math.umulh\",\n },\n\n String: {\n fromCodePoint: \"es.string.from-code-point\",\n raw: \"es.string.raw\",\n },\n\n Number: {\n EPSILON: \"es.number.epsilon\",\n MIN_SAFE_INTEGER: \"es.number.min-safe-integer\",\n MAX_SAFE_INTEGER: \"es.number.max-safe-integer\",\n fromString: \"esnext.number.from-string\",\n isFinite: \"es.number.is-finite\",\n isInteger: \"es.number.is-integer\",\n isSafeInteger: \"es.number.is-safe-integer\",\n isNaN: \"es.number.is-nan\",\n parseFloat: \"es.number.parse-float\",\n parseInt: \"es.number.parse-int\",\n },\n\n Map: {\n from: [\"esnext.map.from\", ...MapDependencies],\n groupBy: [\"esnext.map.group-by\", ...MapDependencies],\n keyBy: [\"esnext.map.key-by\", ...MapDependencies],\n of: [\"esnext.map.of\", ...MapDependencies],\n },\n\n Set: {\n from: [\"esnext.set.from\", ...SetDependencies],\n of: [\"esnext.set.of\", ...SetDependencies],\n },\n\n WeakMap: {\n from: [\"esnext.weak-map.from\", ...WeakMapDependencies],\n of: [\"esnext.weak-map.of\", ...WeakMapDependencies],\n },\n\n WeakSet: {\n from: [\"esnext.weak-set.from\", ...WeakSetDependencies],\n of: [\"esnext.weak-set.of\", ...WeakSetDependencies],\n },\n\n Promise: {\n all: PromiseDependenciesWithIterators,\n allSettled: [\n \"esnext.promise.all-settled\",\n ...PromiseDependenciesWithIterators,\n ],\n any: [\n \"esnext.promise.any\",\n \"esnext.aggregate-error\",\n ...PromiseDependenciesWithIterators,\n ],\n race: PromiseDependenciesWithIterators,\n try: [\"esnext.promise.try\", ...PromiseDependenciesWithIterators],\n },\n\n Reflect: {\n apply: \"es.reflect.apply\",\n construct: \"es.reflect.construct\",\n defineMetadata: \"esnext.reflect.define-metadata\",\n defineProperty: \"es.reflect.define-property\",\n deleteMetadata: \"esnext.reflect.delete-metadata\",\n deleteProperty: \"es.reflect.delete-property\",\n get: \"es.reflect.get\",\n getMetadata: \"esnext.reflect.get-metadata\",\n getMetadataKeys: \"esnext.reflect.get-metadata-keys\",\n getOwnMetadata: \"esnext.reflect.get-own-metadata\",\n getOwnMetadataKeys: \"esnext.reflect.get-own-metadata-keys\",\n getOwnPropertyDescriptor: \"es.reflect.get-own-property-descriptor\",\n getPrototypeOf: \"es.reflect.get-prototype-of\",\n has: \"es.reflect.has\",\n hasMetadata: \"esnext.reflect.has-metadata\",\n hasOwnMetadata: \"esnext.reflect.has-own-metadata\",\n isExtensible: \"es.reflect.is-extensible\",\n metadata: \"esnext.reflect.metadata\",\n ownKeys: \"es.reflect.own-keys\",\n preventExtensions: \"es.reflect.prevent-extensions\",\n set: \"es.reflect.set\",\n setPrototypeOf: \"es.reflect.set-prototype-of\",\n },\n\n Symbol: {\n asyncIterator: [\"es.symbol.async-iterator\"],\n dispose: [\"esnext.symbol.dispose\"],\n hasInstance: [\"es.symbol.has-instance\", \"es.function.has-instance\"],\n isConcatSpreadable: [\"es.symbol.is-concat-spreadable\", \"es.array.concat\"],\n iterator: [\"es.symbol.iterator\", ...CommonIteratorsWithTag],\n match: [\"es.symbol.match\", \"es.string.match\"],\n observable: [\"esnext.symbol.observable\"],\n patternMatch: [\"esnext.symbol.pattern-match\"],\n replace: [\"es.symbol.replace\", \"es.string.replace\"],\n search: [\"es.symbol.search\", \"es.string.search\"],\n species: [\"es.symbol.species\", \"es.array.species\"],\n split: [\"es.symbol.split\", \"es.string.split\"],\n toPrimitive: [\"es.symbol.to-primitive\", \"es.date.to-primitive\"],\n toStringTag: [\n \"es.symbol.to-string-tag\",\n \"es.object.to-string\",\n \"es.math.to-string-tag\",\n \"es.json.to-string-tag\",\n ],\n unscopables: [\"es.symbol.unscopables\"],\n },\n\n ArrayBuffer: {\n isView: [\"es.array-buffer.is-view\"],\n },\n\n Int8Array: TypedArrayStaticMethods,\n Uint8Array: TypedArrayStaticMethods,\n Uint8ClampedArray: TypedArrayStaticMethods,\n Int16Array: TypedArrayStaticMethods,\n Uint16Array: TypedArrayStaticMethods,\n Int32Array: TypedArrayStaticMethods,\n Uint32Array: TypedArrayStaticMethods,\n Float32Array: TypedArrayStaticMethods,\n Float64Array: TypedArrayStaticMethods,\n};\n\nexport const CommonInstanceDependencies = new Set([\n \"es.object.to-string\",\n \"es.object.define-getter\",\n \"es.object.define-setter\",\n \"es.object.lookup-getter\",\n \"es.object.lookup-setter\",\n \"es.regexp.exec\",\n]);\n\nexport const PossibleGlobalObjects = new Set([\n \"global\",\n \"globalThis\",\n \"self\",\n \"window\",\n]);\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejs3ShippedProposalsList from \"./shipped-proposals\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n BuiltIns,\n StaticProperties,\n InstanceProperties,\n CommonIterators,\n CommonInstanceDependencies,\n PromiseDependencies,\n PossibleGlobalObjects,\n} from \"./built-in-definitions\";\nimport {\n createImport,\n getType,\n has,\n intersection,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n isNamespaced,\n} from \"../../utils\";\nimport { logUsagePolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nconst NO_DIRECT_POLYFILL_IMPORT = `\n When setting \\`useBuiltIns: 'usage'\\`, polyfills are automatically imported when needed.\n Please remove the direct import of \\`core-js\\` or use \\`useBuiltIns: 'entry'\\` instead.`;\n\nconst corejs3PolyfillsWithoutProposals = Object.keys(corejs3Polyfills)\n .filter(name => !name.startsWith(\"esnext.\"))\n .reduce((memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n }, {});\n\nconst corejs3PolyfillsWithShippedProposals = corejs3ShippedProposalsList.reduce(\n (memo, key) => {\n memo[key] = corejs3Polyfills[key];\n return memo;\n },\n { ...corejs3PolyfillsWithoutProposals },\n);\n\nexport default function(\n _: any,\n {\n corejs,\n include,\n exclude,\n polyfillTargets,\n proposals,\n shippedProposals,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n proposals\n ? corejs3Polyfills\n : shippedProposals\n ? corejs3PolyfillsWithShippedProposals\n : corejs3PolyfillsWithoutProposals,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function resolveKey(path, computed) {\n const { node, parent, scope } = path;\n if (path.isStringLiteral()) return node.value;\n const { name } = node;\n const isIdentifier = path.isIdentifier();\n if (isIdentifier && !(computed || parent.computed)) return name;\n if (!isIdentifier || scope.getBindingIdentifier(name)) {\n const { value } = path.evaluate();\n if (typeof value === \"string\") return value;\n }\n }\n\n function resolveSource(path) {\n const { node, scope } = path;\n let builtIn, instanceType;\n if (node) {\n builtIn = node.name;\n if (!path.isIdentifier() || scope.getBindingIdentifier(builtIn)) {\n const { deopt, value } = path.evaluate();\n if (value !== undefined) {\n instanceType = getType(value);\n } else if (deopt && deopt.isIdentifier()) {\n builtIn = deopt.node.name;\n }\n }\n }\n return { builtIn, instanceType, isNamespaced: isNamespaced(path) };\n }\n\n const addAndRemovePolyfillImports = {\n // import 'core-js'\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n path.remove();\n }\n },\n\n // require('core-js')\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n console.warn(NO_DIRECT_POLYFILL_IMPORT);\n bodyPath.remove();\n }\n });\n },\n\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n\n // import('something').then(...)\n Import() {\n this.addUnsupported(PromiseDependencies);\n },\n\n Function({ node }: NodePath) {\n // (async function () { }).finally(...)\n if (node.async) {\n this.addUnsupported(PromiseDependencies);\n }\n },\n\n // for-of, [a, b] = c\n \"ForOfStatement|ArrayPattern\"() {\n this.addUnsupported(CommonIterators);\n },\n\n // [...spread]\n SpreadElement({ parentPath }: NodePath) {\n if (!parentPath.isObjectExpression()) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // yield*\n YieldExpression({ node }: NodePath) {\n if (node.delegate) {\n this.addUnsupported(CommonIterators);\n }\n },\n\n // Symbol(), new Promise\n ReferencedIdentifier({ node: { name }, scope }: NodePath) {\n if (scope.getBindingIdentifier(name)) return;\n\n this.addBuiltInDependencies(name);\n },\n\n MemberExpression(path: NodePath) {\n const source = resolveSource(path.get(\"object\"));\n const key = resolveKey(path.get(\"property\"));\n\n // Object.entries\n // [1, 2, 3].entries\n this.addPropertyDependencies(source, key);\n },\n\n ObjectPattern(path: NodePath) {\n const { parentPath, parent, key } = path;\n let source;\n\n // const { keys, values } = Object\n if (parentPath.isVariableDeclarator()) {\n source = resolveSource(parentPath.get(\"init\"));\n // ({ keys, values } = Object)\n } else if (parentPath.isAssignmentExpression()) {\n source = resolveSource(parentPath.get(\"right\"));\n // !function ({ keys, values }) {...} (Object)\n // resolution does not work after properties transform :-(\n } else if (parentPath.isFunctionExpression()) {\n const grand = parentPath.parentPath;\n if (grand.isCallExpression() || grand.isNewExpression()) {\n if (grand.node.callee === parent) {\n source = resolveSource(grand.get(\"arguments\")[key]);\n }\n }\n }\n\n for (const property of path.get(\"properties\")) {\n if (property.isObjectProperty()) {\n const key = resolveKey(property.get(\"key\"));\n // const { keys, values } = Object\n // const { keys, values } = [1, 2, 3]\n this.addPropertyDependencies(source, key);\n }\n }\n },\n\n BinaryExpression(path: NodePath) {\n if (path.node.operator !== \"in\") return;\n\n const source = resolveSource(path.get(\"right\"));\n const key = resolveKey(path.get(\"left\"), true);\n\n // 'entries' in Object\n // 'entries' in [1, 2, 3]\n this.addPropertyDependencies(source, key);\n },\n };\n\n return {\n name: \"corejs3-usage\",\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.addUnsupported = function(builtIn) {\n const modules = Array.isArray(builtIn) ? builtIn : [builtIn];\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n };\n\n this.addBuiltInDependencies = function(builtIn) {\n if (has(BuiltIns, builtIn)) {\n const BuiltInDependencies = BuiltIns[builtIn];\n this.addUnsupported(BuiltInDependencies);\n }\n };\n\n this.addPropertyDependencies = function(source = {}, key) {\n const { builtIn, instanceType, isNamespaced } = source;\n if (isNamespaced) return;\n if (PossibleGlobalObjects.has(builtIn)) {\n this.addBuiltInDependencies(key);\n } else if (has(StaticProperties, builtIn)) {\n const BuiltInProperties = StaticProperties[builtIn];\n if (has(BuiltInProperties, key)) {\n const StaticPropertyDependencies = BuiltInProperties[key];\n return this.addUnsupported(StaticPropertyDependencies);\n }\n }\n if (!has(InstanceProperties, key)) return;\n let InstancePropertyDependencies = InstanceProperties[key];\n if (instanceType) {\n InstancePropertyDependencies = InstancePropertyDependencies.filter(\n m => m.includes(instanceType) || CommonInstanceDependencies.has(m),\n );\n }\n this.addUnsupported(InstancePropertyDependencies);\n };\n },\n post() {\n if (debug) {\n logUsagePolyfills(\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n visitor: addAndRemovePolyfillImports,\n };\n}\n","// @flow\n\nimport { createImport } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function() {\n return {\n name: \"regenerator-usage\",\n pre() {\n this.usesRegenerator = false;\n },\n visitor: {\n Function(path: NodePath) {\n const { node } = path;\n\n if (!this.usesRegenerator && (node.generator || node.async)) {\n this.usesRegenerator = true;\n createImport(path, \"regenerator-runtime\");\n }\n },\n },\n post() {\n if (this.opts.debug && this.usesRegenerator) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your code and targets, added regenerator-runtime.`,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs2Polyfills from \"@babel/compat-data/corejs2-built-ins\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport getPlatformSpecificDefaultFor from \"./get-platform-specific-default\";\nimport {\n createImport,\n isPolyfillSource,\n getImportSource,\n getRequireSource,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nexport default function(\n _: any,\n {\n include,\n exclude,\n polyfillTargets,\n regenerator,\n debug,\n }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs2Polyfills,\n include,\n exclude,\n polyfillTargets,\n getPlatformSpecificDefaultFor(polyfillTargets),\n );\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n if (isPolyfillSource(getImportSource(path))) {\n this.replaceBySeparateModulesImport(path);\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isPolyfillSource(getRequireSource(bodyPath))) {\n this.replaceBySeparateModulesImport(bodyPath);\n }\n });\n },\n };\n\n return {\n name: \"corejs2-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.importPolyfillIncluded = false;\n\n this.replaceBySeparateModulesImport = function(path) {\n this.importPolyfillIncluded = true;\n\n if (regenerator) {\n createImport(path, \"regenerator-runtime\");\n }\n\n const modules = Array.from(polyfills).reverse();\n\n for (const module of modules) {\n createImport(path, module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"@babel/polyfill\",\n this.importPolyfillIncluded,\n polyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs2Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport corejs3Polyfills from \"core-js-compat/data\";\nimport corejsEntries from \"core-js-compat/entries\";\nimport getModulesListForTargetVersion from \"core-js-compat/get-modules-list-for-target-version\";\nimport { filterItems } from \"@babel/helper-compilation-targets\";\nimport {\n has,\n intersection,\n createImport,\n getImportSource,\n getRequireSource,\n getModulePath,\n} from \"../../utils\";\nimport { logEntryPolyfills } from \"../../debug\";\n\nimport type { InternalPluginOptions } from \"../../types\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isBabelPolyfillSource(source) {\n return source === \"@babel/polyfill\" || source === \"babel-polyfill\";\n}\n\nfunction isCoreJSSource(source) {\n if (typeof source === \"string\") {\n source = source\n .replace(/\\\\/g, \"/\")\n .replace(/(\\/(index)?)?(\\.js)?$/i, \"\")\n .toLowerCase();\n }\n return has(corejsEntries, source) && corejsEntries[source];\n}\n\nconst BABEL_POLYFILL_DEPRECATION = `\n \\`@babel/polyfill\\` is deprecated. Please, use required parts of \\`core-js\\`\n and \\`regenerator-runtime/runtime\\` separately`;\n\nexport default function(\n _: any,\n { corejs, include, exclude, polyfillTargets, debug }: InternalPluginOptions,\n) {\n const polyfills = filterItems(\n corejs3Polyfills,\n include,\n exclude,\n polyfillTargets,\n null,\n );\n\n const available = new Set(getModulesListForTargetVersion(corejs.version));\n\n function shouldReplace(source, modules) {\n if (!modules) return false;\n if (\n // Don't replace an import with itself to avoid an infinite loop\n modules.length === 1 &&\n polyfills.has(modules[0]) &&\n available.has(modules[0]) &&\n getModulePath(modules[0]) === source\n ) {\n return false;\n }\n return true;\n }\n\n const isPolyfillImport = {\n ImportDeclaration(path: NodePath) {\n const source = getImportSource(path);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(path, modules);\n }\n }\n },\n Program: {\n enter(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n const source = getRequireSource(bodyPath);\n if (!source) return;\n if (isBabelPolyfillSource(source)) {\n console.warn(BABEL_POLYFILL_DEPRECATION);\n } else {\n const modules = isCoreJSSource(source);\n if (shouldReplace(source, modules)) {\n this.replaceBySeparateModulesImport(bodyPath, modules);\n }\n }\n });\n },\n exit(path: NodePath) {\n const filtered = intersection(polyfills, this.polyfillsSet, available);\n const reversed = Array.from(filtered).reverse();\n\n for (const module of reversed) {\n // Program:exit could be called multiple times.\n // Avoid injecting the polyfills twice.\n if (!this.injectedPolyfills.has(module)) {\n createImport(path, module);\n }\n }\n\n filtered.forEach(module => this.injectedPolyfills.add(module));\n },\n },\n };\n\n return {\n name: \"corejs3-entry\",\n visitor: isPolyfillImport,\n pre() {\n this.injectedPolyfills = new Set();\n this.polyfillsSet = new Set();\n\n this.replaceBySeparateModulesImport = function(path, modules) {\n for (const module of modules) {\n this.polyfillsSet.add(module);\n }\n\n path.remove();\n };\n },\n post() {\n if (debug) {\n logEntryPolyfills(\n \"core-js\",\n this.injectedPolyfills.size > 0,\n this.injectedPolyfills,\n this.file.opts.filename,\n polyfillTargets,\n corejs3Polyfills,\n );\n }\n },\n };\n}\n","// @flow\n\nimport { getImportSource, getRequireSource } from \"../../utils\";\nimport type { NodePath } from \"@babel/traverse\";\n\nfunction isRegeneratorSource(source) {\n return source === \"regenerator-runtime/runtime\";\n}\n\nexport default function() {\n const visitor = {\n ImportDeclaration(path: NodePath) {\n if (isRegeneratorSource(getImportSource(path))) {\n this.regeneratorImportExcluded = true;\n path.remove();\n }\n },\n Program(path: NodePath) {\n path.get(\"body\").forEach(bodyPath => {\n if (isRegeneratorSource(getRequireSource(bodyPath))) {\n this.regeneratorImportExcluded = true;\n bodyPath.remove();\n }\n });\n },\n };\n\n return {\n name: \"regenerator-entry\",\n visitor,\n pre() {\n this.regeneratorImportExcluded = false;\n },\n post() {\n if (this.opts.debug && this.regeneratorImportExcluded) {\n let filename = this.file.opts.filename;\n // normalize filename to generate consistent preset-env test fixtures\n if (process.env.BABEL_ENV === \"test\") {\n filename = filename.replace(/\\\\/g, \"/\");\n }\n console.log(\n `\\n[${filename}] Based on your targets, regenerator-runtime import excluded.`,\n );\n }\n },\n };\n}\n","// @flow\n/* eslint sort-keys: \"error\" */\n\nimport syntaxAsyncGenerators from \"@babel/plugin-syntax-async-generators\";\nimport syntaxDynamicImport from \"@babel/plugin-syntax-dynamic-import\";\nimport syntaxJsonStrings from \"@babel/plugin-syntax-json-strings\";\nimport syntaxNullishCoalescingOperator from \"@babel/plugin-syntax-nullish-coalescing-operator\";\nimport syntaxObjectRestSpread from \"@babel/plugin-syntax-object-rest-spread\";\nimport syntaxOptionalCatchBinding from \"@babel/plugin-syntax-optional-catch-binding\";\nimport syntaxOptionalChaining from \"@babel/plugin-syntax-optional-chaining\";\nimport syntaxTopLevelAwait from \"@babel/plugin-syntax-top-level-await\";\nimport proposalAsyncGeneratorFunctions from \"@babel/plugin-proposal-async-generator-functions\";\nimport proposalDynamicImport from \"@babel/plugin-proposal-dynamic-import\";\nimport proposalJsonStrings from \"@babel/plugin-proposal-json-strings\";\nimport proposalNullishCoalescingOperator from \"@babel/plugin-proposal-nullish-coalescing-operator\";\nimport proposalObjectRestSpread from \"@babel/plugin-proposal-object-rest-spread\";\nimport proposalOptionalCatchBinding from \"@babel/plugin-proposal-optional-catch-binding\";\nimport proposalOptionalChaining from \"@babel/plugin-proposal-optional-chaining\";\nimport proposalUnicodePropertyRegex from \"@babel/plugin-proposal-unicode-property-regex\";\nimport transformAsyncToGenerator from \"@babel/plugin-transform-async-to-generator\";\nimport transformArrowFunctions from \"@babel/plugin-transform-arrow-functions\";\nimport transformBlockScopedFunctions from \"@babel/plugin-transform-block-scoped-functions\";\nimport transformBlockScoping from \"@babel/plugin-transform-block-scoping\";\nimport transformClasses from \"@babel/plugin-transform-classes\";\nimport transformComputedProperties from \"@babel/plugin-transform-computed-properties\";\nimport transformDestructuring from \"@babel/plugin-transform-destructuring\";\nimport transformDotallRegex from \"@babel/plugin-transform-dotall-regex\";\nimport transformDuplicateKeys from \"@babel/plugin-transform-duplicate-keys\";\nimport transformExponentialOperator from \"@babel/plugin-transform-exponentiation-operator\";\nimport transformForOf from \"@babel/plugin-transform-for-of\";\nimport transformFunctionName from \"@babel/plugin-transform-function-name\";\nimport transformLiterals from \"@babel/plugin-transform-literals\";\nimport transformMemberExpressionLiterals from \"@babel/plugin-transform-member-expression-literals\";\nimport transformModulesAmd from \"@babel/plugin-transform-modules-amd\";\nimport transformModulesCommonjs from \"@babel/plugin-transform-modules-commonjs\";\nimport transformModulesSystemjs from \"@babel/plugin-transform-modules-systemjs\";\nimport transformModulesUmd from \"@babel/plugin-transform-modules-umd\";\nimport transformNamedCapturingGroupsRegex from \"@babel/plugin-transform-named-capturing-groups-regex\";\nimport transformNewTarget from \"@babel/plugin-transform-new-target\";\nimport transformObjectSuper from \"@babel/plugin-transform-object-super\";\nimport transformParameters from \"@babel/plugin-transform-parameters\";\nimport transformPropertyLiterals from \"@babel/plugin-transform-property-literals\";\nimport transformRegenerator from \"@babel/plugin-transform-regenerator\";\nimport transformReservedWords from \"@babel/plugin-transform-reserved-words\";\nimport transformShorthandProperties from \"@babel/plugin-transform-shorthand-properties\";\nimport transformSpread from \"@babel/plugin-transform-spread\";\nimport transformStickyRegex from \"@babel/plugin-transform-sticky-regex\";\nimport transformTemplateLiterals from \"@babel/plugin-transform-template-literals\";\nimport transformTypeofSymbol from \"@babel/plugin-transform-typeof-symbol\";\nimport transformUnicodeRegex from \"@babel/plugin-transform-unicode-regex\";\n\nexport default {\n \"proposal-async-generator-functions\": proposalAsyncGeneratorFunctions,\n \"proposal-dynamic-import\": proposalDynamicImport,\n \"proposal-json-strings\": proposalJsonStrings,\n \"proposal-nullish-coalescing-operator\": proposalNullishCoalescingOperator,\n \"proposal-object-rest-spread\": proposalObjectRestSpread,\n \"proposal-optional-catch-binding\": proposalOptionalCatchBinding,\n \"proposal-optional-chaining\": proposalOptionalChaining,\n \"proposal-unicode-property-regex\": proposalUnicodePropertyRegex,\n \"syntax-async-generators\": syntaxAsyncGenerators,\n \"syntax-dynamic-import\": syntaxDynamicImport,\n \"syntax-json-strings\": syntaxJsonStrings,\n \"syntax-nullish-coalescing-operator\": syntaxNullishCoalescingOperator,\n \"syntax-object-rest-spread\": syntaxObjectRestSpread,\n \"syntax-optional-catch-binding\": syntaxOptionalCatchBinding,\n \"syntax-optional-chaining\": syntaxOptionalChaining,\n \"syntax-top-level-await\": syntaxTopLevelAwait,\n \"transform-arrow-functions\": transformArrowFunctions,\n \"transform-async-to-generator\": transformAsyncToGenerator,\n \"transform-block-scoped-functions\": transformBlockScopedFunctions,\n \"transform-block-scoping\": transformBlockScoping,\n \"transform-classes\": transformClasses,\n \"transform-computed-properties\": transformComputedProperties,\n \"transform-destructuring\": transformDestructuring,\n \"transform-dotall-regex\": transformDotallRegex,\n \"transform-duplicate-keys\": transformDuplicateKeys,\n \"transform-exponentiation-operator\": transformExponentialOperator,\n \"transform-for-of\": transformForOf,\n \"transform-function-name\": transformFunctionName,\n \"transform-literals\": transformLiterals,\n \"transform-member-expression-literals\": transformMemberExpressionLiterals,\n \"transform-modules-amd\": transformModulesAmd,\n \"transform-modules-commonjs\": transformModulesCommonjs,\n \"transform-modules-systemjs\": transformModulesSystemjs,\n \"transform-modules-umd\": transformModulesUmd,\n \"transform-named-capturing-groups-regex\": transformNamedCapturingGroupsRegex,\n \"transform-new-target\": transformNewTarget,\n \"transform-object-super\": transformObjectSuper,\n \"transform-parameters\": transformParameters,\n \"transform-property-literals\": transformPropertyLiterals,\n \"transform-regenerator\": transformRegenerator,\n \"transform-reserved-words\": transformReservedWords,\n \"transform-shorthand-properties\": transformShorthandProperties,\n \"transform-spread\": transformSpread,\n \"transform-sticky-regex\": transformStickyRegex,\n \"transform-template-literals\": transformTemplateLiterals,\n \"transform-typeof-symbol\": transformTypeofSymbol,\n \"transform-unicode-regex\": transformUnicodeRegex,\n};\n","//@flow\n\nimport { SemVer } from \"semver\";\nimport { logPluginOrPolyfill } from \"./debug\";\nimport getOptionSpecificExcludesFor from \"./get-option-specific-excludes\";\nimport { removeUnnecessaryItems } from \"./filter-items\";\nimport moduleTransformations from \"./module-transformations\";\nimport normalizeOptions from \"./normalize-options\";\nimport pluginList from \"@babel/compat-data/plugins\";\nimport { proposalPlugins, pluginSyntaxMap } from \"../data/shipped-proposals\";\nimport overlappingPlugins from \"@babel/compat-data/overlapping-plugins\";\n\nimport addCoreJS2UsagePlugin from \"./polyfills/corejs2/usage-plugin\";\nimport addCoreJS3UsagePlugin from \"./polyfills/corejs3/usage-plugin\";\nimport addRegeneratorUsagePlugin from \"./polyfills/regenerator/usage-plugin\";\nimport replaceCoreJS2EntryPlugin from \"./polyfills/corejs2/entry-plugin\";\nimport replaceCoreJS3EntryPlugin from \"./polyfills/corejs3/entry-plugin\";\nimport removeRegeneratorEntryPlugin from \"./polyfills/regenerator/entry-plugin\";\n\nimport getTargets, {\n prettifyTargets,\n filterItems,\n isRequired,\n type Targets,\n} from \"@babel/helper-compilation-targets\";\nimport availablePlugins from \"./available-plugins\";\nimport { filterStageFromList } from \"./utils\";\nimport { declare } from \"@babel/helper-plugin-utils\";\n\nimport typeof ModuleTransformationsType from \"./module-transformations\";\nimport type { BuiltInsOption, ModuleOption } from \"./types\";\n\n// TODO: Remove in Babel 8\nexport function isPluginRequired(targets: Targets, support: Targets) {\n return isRequired(\"fake-name\", targets, {\n compatData: { \"fake-name\": support },\n });\n}\n\nconst pluginListWithoutProposals = filterStageFromList(\n pluginList,\n proposalPlugins,\n);\n\nconst getPlugin = (pluginName: string) => {\n const plugin = availablePlugins[pluginName];\n\n if (!plugin) {\n throw new Error(\n `Could not find plugin \"${pluginName}\". Ensure there is an entry in ./available-plugins.js for it.`,\n );\n }\n\n return plugin;\n};\n\nexport const transformIncludesAndExcludes = (opts: Array): Object => {\n return opts.reduce(\n (result, opt) => {\n const target = opt.match(/^(es|es6|es7|esnext|web)\\./)\n ? \"builtIns\"\n : \"plugins\";\n result[target].add(opt);\n return result;\n },\n {\n all: opts,\n plugins: new Set(),\n builtIns: new Set(),\n },\n );\n};\n\nexport const getModulesPluginNames = ({\n modules,\n transformations,\n shouldTransformESM,\n shouldTransformDynamicImport,\n shouldParseTopLevelAwait,\n}: {\n modules: ModuleOption,\n transformations: ModuleTransformationsType,\n shouldTransformESM: boolean,\n shouldTransformDynamicImport: boolean,\n shouldParseTopLevelAwait: boolean,\n}) => {\n const modulesPluginNames = [];\n if (modules !== false && transformations[modules]) {\n if (shouldTransformESM) {\n modulesPluginNames.push(transformations[modules]);\n }\n\n if (\n shouldTransformDynamicImport &&\n shouldTransformESM &&\n modules !== \"umd\"\n ) {\n modulesPluginNames.push(\"proposal-dynamic-import\");\n } else {\n if (shouldTransformDynamicImport) {\n console.warn(\n \"Dynamic import can only be supported when transforming ES modules\" +\n \" to AMD, CommonJS or SystemJS. Only the parser plugin will be enabled.\",\n );\n }\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n } else {\n modulesPluginNames.push(\"syntax-dynamic-import\");\n }\n\n if (shouldParseTopLevelAwait) {\n modulesPluginNames.push(\"syntax-top-level-await\");\n }\n\n return modulesPluginNames;\n};\n\nexport const getPolyfillPlugins = ({\n useBuiltIns,\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n regenerator,\n debug,\n}: {\n useBuiltIns: BuiltInsOption,\n corejs: typeof SemVer | null | false,\n polyfillTargets: Targets,\n include: Set,\n exclude: Set,\n proposals: boolean,\n shippedProposals: boolean,\n regenerator: boolean,\n debug: boolean,\n}) => {\n const polyfillPlugins = [];\n if (useBuiltIns === \"usage\" || useBuiltIns === \"entry\") {\n const pluginOptions = {\n corejs,\n polyfillTargets,\n include,\n exclude,\n proposals,\n shippedProposals,\n regenerator,\n debug,\n };\n\n if (corejs) {\n if (useBuiltIns === \"usage\") {\n if (corejs.major === 2) {\n polyfillPlugins.push([addCoreJS2UsagePlugin, pluginOptions]);\n } else {\n polyfillPlugins.push([addCoreJS3UsagePlugin, pluginOptions]);\n }\n if (regenerator) {\n polyfillPlugins.push([addRegeneratorUsagePlugin, pluginOptions]);\n }\n } else {\n if (corejs.major === 2) {\n polyfillPlugins.push([replaceCoreJS2EntryPlugin, pluginOptions]);\n } else {\n polyfillPlugins.push([replaceCoreJS3EntryPlugin, pluginOptions]);\n if (!regenerator) {\n polyfillPlugins.push([removeRegeneratorEntryPlugin, pluginOptions]);\n }\n }\n }\n }\n }\n return polyfillPlugins;\n};\n\nfunction supportsStaticESM(caller) {\n return !!(caller && caller.supportsStaticESM);\n}\n\nfunction supportsDynamicImport(caller) {\n return !!(caller && caller.supportsDynamicImport);\n}\n\nfunction supportsTopLevelAwait(caller) {\n return !!(caller && caller.supportsTopLevelAwait);\n}\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const {\n configPath,\n debug,\n exclude: optionsExclude,\n forceAllTransforms,\n ignoreBrowserslistConfig,\n include: optionsInclude,\n loose,\n modules,\n shippedProposals,\n spec,\n targets: optionsTargets,\n useBuiltIns,\n corejs: { version: corejs, proposals },\n } = normalizeOptions(opts);\n // TODO: remove this in next major\n let hasUglifyTarget = false;\n\n if (optionsTargets && optionsTargets.uglify) {\n hasUglifyTarget = true;\n delete optionsTargets.uglify;\n\n console.log(\"\");\n console.log(\"The uglify target has been deprecated. Set the top level\");\n console.log(\"option `forceAllTransforms: true` instead.\");\n console.log(\"\");\n }\n\n if (optionsTargets && optionsTargets.esmodules && optionsTargets.browsers) {\n console.log(\"\");\n console.log(\n \"@babel/preset-env: esmodules and browsers targets have been specified together.\",\n );\n console.log(\n `\\`browsers\\` target, \\`${optionsTargets.browsers}\\` will be ignored.`,\n );\n console.log(\"\");\n }\n\n const targets = getTargets(optionsTargets, {\n ignoreBrowserslistConfig,\n configPath,\n });\n const include = transformIncludesAndExcludes(optionsInclude);\n const exclude = transformIncludesAndExcludes(optionsExclude);\n\n const transformTargets = forceAllTransforms || hasUglifyTarget ? {} : targets;\n\n const modulesPluginNames = getModulesPluginNames({\n modules,\n transformations: moduleTransformations,\n // TODO: Remove the 'api.caller' check eventually. Just here to prevent\n // unnecessary breakage in the short term for users on older betas/RCs.\n shouldTransformESM:\n modules !== \"auto\" || !api.caller || !api.caller(supportsStaticESM),\n shouldTransformDynamicImport:\n modules !== \"auto\" || !api.caller || !api.caller(supportsDynamicImport),\n shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait),\n });\n\n const pluginNames = filterItems(\n shippedProposals ? pluginList : pluginListWithoutProposals,\n include.plugins,\n exclude.plugins,\n transformTargets,\n modulesPluginNames,\n getOptionSpecificExcludesFor({ loose }),\n pluginSyntaxMap,\n );\n removeUnnecessaryItems(pluginNames, overlappingPlugins);\n\n const polyfillPlugins = getPolyfillPlugins({\n useBuiltIns,\n corejs,\n polyfillTargets: targets,\n include: include.builtIns,\n exclude: exclude.builtIns,\n proposals,\n shippedProposals,\n regenerator: pluginNames.has(\"transform-regenerator\"),\n debug,\n });\n\n const pluginUseBuiltIns = useBuiltIns !== false;\n const plugins = Array.from(pluginNames)\n .map(pluginName => [\n getPlugin(pluginName),\n { spec, loose, useBuiltIns: pluginUseBuiltIns },\n ])\n .concat(polyfillPlugins);\n\n if (debug) {\n console.log(\"@babel/preset-env: `DEBUG` option\");\n console.log(\"\\nUsing targets:\");\n console.log(JSON.stringify(prettifyTargets(targets), null, 2));\n console.log(`\\nUsing modules transform: ${modules.toString()}`);\n console.log(\"\\nUsing plugins:\");\n pluginNames.forEach(pluginName => {\n logPluginOrPolyfill(pluginName, targets, pluginList);\n });\n\n if (!useBuiltIns) {\n console.log(\n \"\\nUsing polyfills: No polyfills were added, since the `useBuiltIns` option was not set.\",\n );\n } else {\n // NOTE: Polyfill plugins are outputting debug info internally\n console.log(`\\nUsing polyfills with \\`${useBuiltIns}\\` option:`);\n }\n }\n\n return { plugins };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformFlowStripTypes from \"@babel/plugin-transform-flow-strip-types\";\n\nexport default declare((api, { all }) => {\n api.assertVersion(7);\n\n return {\n plugins: [[transformFlowStripTypes, { all }]],\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformReactJSX from \"@babel/plugin-transform-react-jsx\";\nimport transformReactDisplayName from \"@babel/plugin-transform-react-display-name\";\nimport transformReactJSXSource from \"@babel/plugin-transform-react-jsx-source\";\nimport transformReactJSXSelf from \"@babel/plugin-transform-react-jsx-self\";\n\nexport default declare((api, opts) => {\n api.assertVersion(7);\n\n const pragma = opts.pragma || \"React.createElement\";\n const pragmaFrag = opts.pragmaFrag || \"React.Fragment\";\n const throwIfNamespace =\n opts.throwIfNamespace === undefined ? true : !!opts.throwIfNamespace;\n const development = !!opts.development;\n const useBuiltIns = !!opts.useBuiltIns;\n const { useSpread } = opts;\n\n if (typeof development !== \"boolean\") {\n throw new Error(\n \"@babel/preset-react 'development' option must be a boolean.\",\n );\n }\n\n return {\n plugins: [\n [\n transformReactJSX,\n { pragma, pragmaFrag, throwIfNamespace, useBuiltIns, useSpread },\n ],\n transformReactDisplayName,\n\n development && transformReactJSXSource,\n development && transformReactJSXSelf,\n ].filter(Boolean),\n };\n});\n","import { declare } from \"@babel/helper-plugin-utils\";\nimport transformTypeScript from \"@babel/plugin-transform-typescript\";\n\nexport default declare(\n (\n api,\n {\n jsxPragma,\n allExtensions = false,\n isTSX = false,\n allowNamespaces,\n allowDeclareFields,\n },\n ) => {\n api.assertVersion(7);\n\n if (typeof allExtensions !== \"boolean\") {\n throw new Error(\".allExtensions must be a boolean, or undefined\");\n }\n\n if (typeof isTSX !== \"boolean\") {\n throw new Error(\".isTSX must be a boolean, or undefined\");\n }\n\n if (isTSX && !allExtensions) {\n throw new Error(\"isTSX:true requires allExtensions:true\");\n }\n\n const pluginOptions = isTSX => ({\n jsxPragma,\n isTSX,\n allowNamespaces,\n allowDeclareFields,\n });\n\n return {\n overrides: allExtensions\n ? [\n {\n plugins: [[transformTypeScript, pluginOptions(isTSX)]],\n },\n ]\n : [\n {\n // Only set 'test' if explicitly requested, since it requires that\n // Babel is being called`\n test: /\\.ts$/,\n plugins: [[transformTypeScript, pluginOptions(false)]],\n },\n {\n // Only set 'test' if explicitly requested, since it requires that\n // Babel is being called`\n test: /\\.tsx$/,\n plugins: [[transformTypeScript, pluginOptions(true)]],\n },\n ],\n };\n },\n);\n","/**\n * Copyright 2013-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of the React source tree.\n */\n\nconst scriptTypes = [\"text/jsx\", \"text/babel\"];\n\nlet headEl;\nlet inlineScriptCount = 0;\n\n/**\n * Actually transform the code.\n */\nfunction transformCode(transformFn, script) {\n let source;\n if (script.url != null) {\n source = script.url;\n } else {\n source = \"Inline Babel script\";\n inlineScriptCount++;\n if (inlineScriptCount > 1) {\n source += \" (\" + inlineScriptCount + \")\";\n }\n }\n\n return transformFn(script.content, {\n filename: source,\n ...buildBabelOptions(script),\n }).code;\n}\n\n/**\n * Builds the Babel options for transforming the specified script, using some\n * sensible default presets and plugins if none were explicitly provided.\n */\nfunction buildBabelOptions(script) {\n return {\n presets: script.presets || [\"react\", \"es2015\"],\n plugins: script.plugins || [\n \"proposal-class-properties\",\n \"proposal-object-rest-spread\",\n \"transform-flow-strip-types\",\n ],\n sourceMaps: \"inline\",\n };\n}\n\n/**\n * Appends a script element at the end of the with the content of code,\n * after transforming it.\n */\nfunction run(transformFn, script) {\n const scriptEl = document.createElement(\"script\");\n scriptEl.text = transformCode(transformFn, script);\n headEl.appendChild(scriptEl);\n}\n\n/**\n * Load script from the provided url and pass the content to the callback.\n */\nfunction load(url, successCallback, errorCallback) {\n const xhr = new XMLHttpRequest();\n\n // async, however scripts will be executed in the order they are in the\n // DOM to mirror normal script loading.\n xhr.open(\"GET\", url, true);\n if (\"overrideMimeType\" in xhr) {\n xhr.overrideMimeType(\"text/plain\");\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 0 || xhr.status === 200) {\n successCallback(xhr.responseText);\n } else {\n errorCallback();\n throw new Error(\"Could not load \" + url);\n }\n }\n };\n return xhr.send(null);\n}\n\n/**\n * Converts a comma-separated data attribute string into an array of values. If\n * the string is empty, returns an empty array. If the string is not defined,\n * returns null.\n */\nfunction getPluginsOrPresetsFromScript(script, attributeName) {\n const rawValue = script.getAttribute(attributeName);\n if (rawValue === \"\") {\n // Empty string means to not load ANY presets or plugins\n return [];\n }\n if (!rawValue) {\n // Any other falsy value (null, undefined) means we're not overriding this\n // setting, and should use the default.\n return null;\n }\n return rawValue.split(\",\").map(item => item.trim());\n}\n\n/**\n * Loop over provided script tags and get the content, via innerHTML if an\n * inline script, or by using XHR. Transforms are applied if needed. The scripts\n * are executed in the order they are found on the page.\n */\nfunction loadScripts(transformFn, scripts) {\n const result = [];\n const count = scripts.length;\n\n function check() {\n let script, i;\n\n for (i = 0; i < count; i++) {\n script = result[i];\n\n if (script.loaded && !script.executed) {\n script.executed = true;\n run(transformFn, script);\n } else if (!script.loaded && !script.error && !script.async) {\n break;\n }\n }\n }\n\n scripts.forEach((script, i) => {\n const scriptData = {\n // script.async is always true for non-JavaScript script tags\n async: script.hasAttribute(\"async\"),\n error: false,\n executed: false,\n plugins: getPluginsOrPresetsFromScript(script, \"data-plugins\"),\n presets: getPluginsOrPresetsFromScript(script, \"data-presets\"),\n };\n\n if (script.src) {\n result[i] = {\n ...scriptData,\n content: null,\n loaded: false,\n url: script.src,\n };\n\n load(\n script.src,\n content => {\n result[i].loaded = true;\n result[i].content = content;\n check();\n },\n () => {\n result[i].error = true;\n check();\n },\n );\n } else {\n result[i] = {\n ...scriptData,\n content: script.innerHTML,\n loaded: true,\n url: script.getAttribute(\"data-module\") || null,\n };\n }\n });\n\n check();\n}\n\n/**\n * Run script tags with type=\"text/jsx\".\n * @param {Array} scriptTags specify script tags to run, run all in the if not given\n */\nexport function runScripts(transformFn, scripts) {\n headEl = document.getElementsByTagName(\"head\")[0];\n if (!scripts) {\n scripts = document.getElementsByTagName(\"script\");\n }\n\n // Array.prototype.slice cannot be used on NodeList on IE8\n const jsxScripts = [];\n for (let i = 0; i < scripts.length; i++) {\n const script = scripts.item(i);\n // Support the old type=\"text/jsx;harmony=true\"\n const type = script.type.split(\";\")[0];\n if (scriptTypes.indexOf(type) !== -1) {\n jsxScripts.push(script);\n }\n }\n\n if (jsxScripts.length === 0) {\n return;\n }\n\n console.warn(\n \"You are using the in-browser Babel transformer. Be sure to precompile \" +\n \"your scripts for production - https://babeljs.io/docs/setup/\",\n );\n\n loadScripts(transformFn, jsxScripts);\n}\n","/**\n * Entry point for @babel/standalone. This wraps Babel's API in a version that's\n * friendlier for use in web browsers. It removes the automagical detection of\n * plugins, instead explicitly registering all the available plugins and\n * presets, and requiring custom ones to be registered through `registerPlugin`\n * and `registerPreset` respectively.\n * @flow\n */\n\n/* global VERSION */\n/* eslint-disable max-len */\n\nimport {\n transformFromAst as babelTransformFromAst,\n transform as babelTransform,\n buildExternalHelpers as babelBuildExternalHelpers,\n} from \"@babel/core\";\nimport { all } from \"./generated/plugins\";\nimport preset2015 from \"./preset-es2015\";\nimport presetStage0 from \"./preset-stage-0\";\nimport presetStage1 from \"./preset-stage-1\";\nimport presetStage2 from \"./preset-stage-2\";\nimport presetStage3 from \"./preset-stage-3\";\nimport presetEnv from \"@babel/preset-env\";\nimport presetFlow from \"@babel/preset-flow\";\nimport presetReact from \"@babel/preset-react\";\nimport presetTypescript from \"@babel/preset-typescript\";\n\nimport { runScripts } from \"./transformScriptTags\";\n\nconst isArray =\n Array.isArray ||\n (arg => Object.prototype.toString.call(arg) === \"[object Array]\");\n\n/**\n * Loads the given name (or [name, options] pair) from the given table object\n * holding the available presets or plugins.\n *\n * Returns undefined if the preset or plugin is not available; passes through\n * name unmodified if it (or the first element of the pair) is not a string.\n */\nfunction loadBuiltin(builtinTable, name) {\n if (isArray(name) && typeof name[0] === \"string\") {\n if (Object.prototype.hasOwnProperty.call(builtinTable, name[0])) {\n return [builtinTable[name[0]]].concat(name.slice(1));\n }\n return;\n } else if (typeof name === \"string\") {\n return builtinTable[name];\n }\n // Could be an actual preset/plugin module\n return name;\n}\n\n/**\n * Parses plugin names and presets from the specified options.\n */\nfunction processOptions(options) {\n // Parse preset names\n const presets = (options.presets || []).map(presetName => {\n const preset = loadBuiltin(availablePresets, presetName);\n\n if (preset) {\n // workaround for babel issue\n // at some point, babel copies the preset, losing the non-enumerable\n // buildPreset key; convert it into an enumerable key.\n if (\n isArray(preset) &&\n typeof preset[0] === \"object\" &&\n Object.prototype.hasOwnProperty.call(preset[0], \"buildPreset\")\n ) {\n preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };\n }\n } else {\n throw new Error(\n `Invalid preset specified in Babel options: \"${presetName}\"`,\n );\n }\n return preset;\n });\n\n // Parse plugin names\n const plugins = (options.plugins || []).map(pluginName => {\n const plugin = loadBuiltin(availablePlugins, pluginName);\n\n if (!plugin) {\n throw new Error(\n `Invalid plugin specified in Babel options: \"${pluginName}\"`,\n );\n }\n return plugin;\n });\n\n return {\n babelrc: false,\n ...options,\n presets,\n plugins,\n };\n}\n\nexport function transform(code: string, options: Object) {\n return babelTransform(code, processOptions(options));\n}\n\nexport function transformFromAst(ast: Object, code: string, options: Object) {\n return babelTransformFromAst(ast, code, processOptions(options));\n}\nexport const availablePlugins = {};\nexport const availablePresets = {};\nexport const buildExternalHelpers = babelBuildExternalHelpers;\n/**\n * Registers a named plugin for use with Babel.\n */\nexport function registerPlugin(name: string, plugin: Object | Function): void {\n if (Object.prototype.hasOwnProperty.call(availablePlugins, name)) {\n console.warn(\n `A plugin named \"${name}\" is already registered, it will be overridden`,\n );\n }\n availablePlugins[name] = plugin;\n}\n/**\n * Registers multiple plugins for use with Babel. `newPlugins` should be an object where the key\n * is the name of the plugin, and the value is the plugin itself.\n */\nexport function registerPlugins(newPlugins: {\n [string]: Object | Function,\n}): void {\n Object.keys(newPlugins).forEach(name =>\n registerPlugin(name, newPlugins[name]),\n );\n}\n\n/**\n * Registers a named preset for use with Babel.\n */\nexport function registerPreset(name: string, preset: Object | Function): void {\n if (Object.prototype.hasOwnProperty.call(availablePresets, name)) {\n if (name === \"env\") {\n console.warn(\n \"@babel/preset-env is now included in @babel/standalone, please remove @babel/preset-env-standalone\",\n );\n } else {\n console.warn(\n `A preset named \"${name}\" is already registered, it will be overridden`,\n );\n }\n }\n availablePresets[name] = preset;\n}\n/**\n * Registers multiple presets for use with Babel. `newPresets` should be an object where the key\n * is the name of the preset, and the value is the preset itself.\n */\nexport function registerPresets(newPresets: {\n [string]: Object | Function,\n}): void {\n Object.keys(newPresets).forEach(name =>\n registerPreset(name, newPresets[name]),\n );\n}\n\n// All the plugins we should bundle\n// Want to get rid of this long whitelist of plugins?\n// Wait! Please read https://github.com/babel/babel/pull/6177 first.\nregisterPlugins(all);\n\n// All the presets we should bundle\n// Want to get rid of this whitelist of presets?\n// Wait! Please read https://github.com/babel/babel/pull/6177 first.\nregisterPresets({\n env: presetEnv,\n es2015: preset2015,\n es2016: () => {\n return {\n plugins: [availablePlugins[\"transform-exponentiation-operator\"]],\n };\n },\n es2017: () => {\n return {\n plugins: [availablePlugins[\"transform-async-to-generator\"]],\n };\n },\n react: presetReact,\n \"stage-0\": presetStage0,\n \"stage-1\": presetStage1,\n \"stage-2\": presetStage2,\n \"stage-3\": presetStage3,\n \"es2015-loose\": {\n presets: [[preset2015, { loose: true }]],\n },\n // ES2015 preset with es2015-modules-commonjs removed\n \"es2015-no-commonjs\": {\n presets: [[preset2015, { modules: false }]],\n },\n typescript: presetTypescript,\n flow: presetFlow,\n});\n\n// $FlowIgnore\nexport const version = VERSION;\n\nfunction onDOMContentLoaded() {\n transformScriptTags();\n}\n\n// Listen for load event if we're in a browser and then kick off finding and\n// running of scripts with \"text/babel\" type.\nif (typeof window !== \"undefined\" && window && window.addEventListener) {\n window.addEventListener(\"DOMContentLoaded\", onDOMContentLoaded, false);\n}\n\n/**\n * Transform